Bug 1321703 - Use the margin-box when synthesizing a baseline from a block line with a non-visible-overflow child frame. r=dholbert
authorMats Palmgren <mats@mozilla.com>
Sat, 03 Dec 2016 18:53:56 +0100
changeset 325244 bd4568a3fd8bad6ff4d8797175209a61462cdca0
parent 325219 5144592dd9180a21472159e4d813a7f61c90484e
child 325245 90ad2f05b90d1ca988f5105057cb1d6abf577b10
push id24
push usermaklebus@msu.edu
push dateTue, 20 Dec 2016 03:11:33 +0000
reviewersdholbert
bugs1321703
milestone53.0a1
Bug 1321703 - Use the margin-box when synthesizing a baseline from a block line with a non-visible-overflow child frame. r=dholbert
layout/base/nsLayoutUtils.cpp
--- a/layout/base/nsLayoutUtils.cpp
+++ b/layout/base/nsLayoutUtils.cpp
@@ -5937,20 +5937,21 @@ nsLayoutUtils::GetLastLineBaseline(Writi
       nscoord kidBaseline;
       const nsSize& containerSize = line->mContainerSize;
       if (GetLastLineBaseline(aWM, kid, &kidBaseline)) {
         // Ignore relative positioning for baseline calculations
         *aResult = kidBaseline +
           kid->GetLogicalNormalPosition(aWM, containerSize).B(aWM);
         return true;
       } else if (kid->GetType() == nsGkAtoms::scrollFrame) {
-        // Use the bottom of the scroll frame.
-        // XXX CSS2.1 really doesn't say what to do here.
-        *aResult = kid->GetLogicalNormalPosition(aWM, containerSize).B(aWM) +
-                   kid->BSize(aWM);
+        // Defer to nsFrame::GetLogicalBaseline (which synthesizes a baseline
+        // from the margin-box).
+        kidBaseline = kid->GetLogicalBaseline(aWM);
+        *aResult = kidBaseline +
+          kid->GetLogicalNormalPosition(aWM, containerSize).B(aWM);
         return true;
       }
     } else {
       // XXX Is this the right test?  We have some bogus empty lines
       // floating around, but IsEmpty is perhaps too weak.
       if (line->BSize() != 0 || !line->IsEmpty()) {
         *aResult = line->BStart() + line->GetLogicalAscent();
         return true;