Bug 1525133: Explicitly skip orthogonal-flow children when determining last-baseline of a block from its children. r=mats

Without the check that I'm adding in this patch, we'd violate the
"parallel writing mode" expectation of some baseline accessors
that we use in the now-guarded code. And we'd produce bogus layout
as a result.

The added assertions are just for good measure. The included testcase
causes us to fail both assertions, in a build that's missing the fix.

Differential Revision: https://phabricator.services.mozilla.com/D18715
This commit is contained in:
Daniel Holbert
2019-02-05 19:45:46 +00:00
parent 9ab6a4b4fb
commit 43dffe3513
5 changed files with 88 additions and 1 deletions

View File

@@ -487,7 +487,8 @@ bool nsBlockFrame::GetNaturalBaselineBOffset(
if (line->IsBlock()) {
nscoord offset;
nsIFrame* kid = line->mFirstChild;
if (kid->GetVerticalAlignBaseline(aWM, &offset)) {
if (!aWM.IsOrthogonalTo(kid->GetWritingMode()) &&
kid->GetVerticalAlignBaseline(aWM, &offset)) {
// Ignore relative positioning for baseline calculations.
const nsSize& sz = line->mContainerSize;
offset += kid->GetLogicalNormalPosition(aWM, sz).B(aWM);