Closed Bug 1525133 Opened 7 years ago Closed 7 years ago

nsBlockFrame::GetNaturalBaselineBOffset calls kid->GetVerticalAlignBaseline() without checking whether its WM is orthogonal

Categories

(Core :: Layout: Block and Inline, enhancement, P3)

enhancement

Tracking

()

RESOLVED FIXED
mozilla67
Tracking Status
firefox67 --- fixed

People

(Reporter: dholbert, Assigned: dholbert)

References

Details

Attachments

(3 files)

nsBlockFrame::GetNaturalBaselineBOffset has a call to...

kid->GetVerticalAlignBaseline(aWM)

...without checking whether aWM is parallel to kid's writing mode.

This is bogus, per the GetVerticalAlignBaseline documentation:

We should add a writing mode check before the call in question.

(I ran into this when fixing bug 969874, when trying to add a more subtle implementation of GetLogicalBaseline. Inside that implementation, I assumed that the passed-in aWM was parallel to the this frame's WM, and that assumption turned out not to be valid, in part due to this bug.)

Depends on: 1312379
Attached file testcase 1

Chrome 73 and Edge 18 render "outside --> <-- inside" lined up in the attached testcase, and doesn't change the alignment when you hover the vertical text (increasing its font size).

Firefox Nightly renders outside--> higher up than "<--inside" (at a kind of arbitrary point that depends on the size of the vertical text), and it changes the position of "outside-->" when you hover the vertical text to adjust its font size.

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.

Pushed by dholbert@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/dbdbcc95849b Explicitly skip orthogonal-flow children when determining last-baseline of a block from its children. r=mats
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla67
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/15274 for changes under testing/web-platform/tests
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: