nsBlockFrame::GetNaturalBaselineBOffset calls kid->GetVerticalAlignBaseline() without checking whether its WM is orthogonal
Categories
(Core :: Layout: Block and Inline, enhancement, P3)
Tracking
()
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:
- @note You should only call this on frames with a WM that's parallel to aWM.
https://searchfox.org/mozilla-central/rev/152993fa346c8fd9296e4cd6622234a664f53341/layout/generic/nsIFrame.h#1406
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.)
Assignee | ||
Comment 1•7 years ago
|
||
The problematic call is here:
https://searchfox.org/mozilla-central/rev/152993fa346c8fd9296e4cd6622234a664f53341/layout/generic/nsBlockFrame.cpp#490
...which comes from bug 1312379. Adding dependency on that bug.
Assignee | ||
Comment 2•7 years ago
|
||
Assignee | ||
Comment 3•7 years ago
|
||
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.
Assignee | ||
Comment 4•7 years ago
|
||
Assignee | ||
Comment 5•7 years ago
|
||
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.
Assignee | ||
Comment 6•7 years ago
|
||
Try run: https://treeherder.mozilla.org/#/jobs?repo=try&revision=82b600024b1959d175545705867ce520f3029891
(including bug 969874 which layers on top of this)
Comment 8•7 years ago
|
||
bugherder |
Description
•