Bug 1145218 - Require a new float manager if a block frame has a different writing-mode to its parent's. r=dbaron
☠☠ backed out by 5dd1b08994a7 ☠ ☠
authorJonathan Kew <jkew@mozilla.com>
Wed, 01 Apr 2015 16:43:59 +0100
changeset 237003 2bf6b633b05403d1bbb4e42d9edcb2786e4046b7
parent 237002 bad0f7f068645d64da893cf8a831e488733c480b
child 237004 569c61b9d058b2780388d31b7b77547148652be9
push id57851
push userjkew@mozilla.com
push dateWed, 01 Apr 2015 15:44:19 +0000
treeherdermozilla-inbound@2bf6b633b054 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdbaron
bugs1145218
milestone40.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1145218 - Require a new float manager if a block frame has a different writing-mode to its parent's. r=dbaron
layout/generic/nsBlockFrame.cpp
--- a/layout/generic/nsBlockFrame.cpp
+++ b/layout/generic/nsBlockFrame.cpp
@@ -6640,18 +6640,29 @@ nsBlockFrame::Init(nsIContent*       aCo
     // Copy over the inherited block frame bits from the prev-in-flow.
     SetFlags(aPrevInFlow->GetStateBits() &
              (NS_BLOCK_FLAGS_MASK & ~NS_BLOCK_FLAGS_NON_INHERITED_MASK));
   }
 
   nsBlockFrameSuper::Init(aContent, aParent, aPrevInFlow);
 
   if (!aPrevInFlow ||
-      aPrevInFlow->GetStateBits() & NS_BLOCK_NEEDS_BIDI_RESOLUTION)
+      aPrevInFlow->GetStateBits() & NS_BLOCK_NEEDS_BIDI_RESOLUTION) {
     AddStateBits(NS_BLOCK_NEEDS_BIDI_RESOLUTION);
+  }
+
+  // If a box has a different block flow direction than its containing block:
+  // ...
+  //   If the box is a block container, then it establishes a new block
+  //   formatting context.
+  // (http://dev.w3.org/csswg/css-writing-modes/#block-flow)
+  if (GetParent() && StyleVisibility()->mWritingMode !=
+                     GetParent()->StyleVisibility()->mWritingMode) {
+    AddStateBits(NS_BLOCK_FLOAT_MGR | NS_BLOCK_MARGIN_ROOT);
+  }
 
   if ((GetStateBits() &
        (NS_FRAME_FONT_INFLATION_CONTAINER | NS_BLOCK_FLOAT_MGR)) ==
       (NS_FRAME_FONT_INFLATION_CONTAINER | NS_BLOCK_FLOAT_MGR)) {
     AddStateBits(NS_FRAME_FONT_INFLATION_FLOW_ROOT);
   }
 }