Bug 1146112 - Mark ruby pseudo frames as line participant in frame constructor. r=roc
authorXidorn Quan <quanxunzhen@gmail.com>
Tue, 31 Mar 2015 09:20:01 +1100
changeset 236669 969baf537e95ce8631ad5477708d59f8cffc18bf
parent 236668 46067a10bd37764de683c92490e461b1ed46d11b
child 236670 399c30b5e3576ee7b98e3d10afa372a9b4d0dc80
push id28514
push usercbook@mozilla.com
push dateTue, 31 Mar 2015 12:46:33 +0000
treeherdermozilla-central@c20f8549d631 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc
bugs1146112
milestone39.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 1146112 - Mark ruby pseudo frames as line participant in frame constructor. r=roc
layout/base/nsCSSFrameConstructor.cpp
--- a/layout/base/nsCSSFrameConstructor.cpp
+++ b/layout/base/nsCSSFrameConstructor.cpp
@@ -10149,28 +10149,36 @@ nsCSSFrameConstructor::WrapItemsInPseudo
                               // to match that of our first child item to
                               // match the old behavior
                               aIter.item().mNameSpaceID,
                               // no pending binding
                               nullptr,
                               wrapperStyle,
                               true, nullptr);
 
+  const nsStyleDisplay* disp = newItem->mStyleContext->StyleDisplay();
   // Here we're cheating a tad... technically, table-internal items should be
   // inline if aParentFrame is inline, but they'll get wrapped in an
   // inline-table in the end, so it'll all work out.  In any case, arguably
   // we don't need to maintain this state at this point... but it's better
   // to, I guess.
   newItem->mIsAllInline = newItem->mHasInlineEnds =
-    newItem->mStyleContext->StyleDisplay()->IsInlineOutsideStyle();
-
-  // Table pseudo frames always induce line boundaries around their
-  // contents.
-  newItem->mChildItems.SetLineBoundaryAtStart(true);
-  newItem->mChildItems.SetLineBoundaryAtEnd(true);
+    disp->IsInlineOutsideStyle();
+
+  bool isRuby = disp->IsRubyDisplayType();
+  // All types of ruby frames need a block frame to provide line layout,
+  // hence they are always line participant.
+  newItem->mIsLineParticipant = isRuby;
+
+  if (!isRuby) {
+    // Table pseudo frames always induce line boundaries around their
+    // contents.
+    newItem->mChildItems.SetLineBoundaryAtStart(true);
+    newItem->mChildItems.SetLineBoundaryAtEnd(true);
+  }
   // The parent of the items in aItems is also the parent of the items
   // in mChildItems
   newItem->mChildItems.SetParentHasNoXBLChildren(
       aIter.List()->ParentHasNoXBLChildren());
 
   // Eat up all items between |aIter| and |aEndIter| and put them in our
   // wrapper Advances |aIter| to point to |aEndIter|.
   aIter.AppendItemsToList(aEndIter, newItem->mChildItems);