Closed Bug 1671726 Opened 4 years ago Closed 4 years ago

Improve ReflowOutput a bit, and fix writing mode mismatch in ViewportFrame::Reflow()

Categories

(Core :: Layout, task)

task

Tracking

()

RESOLVED FIXED
84 Branch
Tracking Status
firefox84 --- fixed

People

(Reporter: TYLin, Assigned: TYLin)

References

Details

Attachments

(2 files)

In this bug, I'd like to change mISize and mBSize stored in ReflowOutput to LogicalSize so that most of the ReflowOutput's methods can delegate to LogicalSize's methods.

With above, the CHECK_WRITING_MODE assertion in LogicalSize does discover a writing mode mismatch in ViewportFrame::Reflow. I'll fix it in this bug as well.

After applying the next part, 1161752.html's runTest2() can trigger the
following assertion without this patch.

ASSERTION: writing-mode mismatch: 'aWritingMode.IgnoreSideways() == GetWritingMode().IgnoreSideways()'

kidDesiredSize is initialized by ViewportFrame's reflow input, so it
stores the ViewportFrame's writing mode. But after calling
ReflowChild, the old code is accessing the kid's block-size by using
kidDesiredSize.BSize(wm), where wm is being shadowed within the
inner if and becomes the kid's writing mode. This patch fixed it by
changing the inner wm to kidWM for the clarity and avoiding the
variable shadowing.

In the next part, ReflowOutput's documentation is updated, hoping to
prevent the writing mode misusages in the future.

By using LogicalSize instead of a pair of mISize and mBSize, most of the
ReflowOutput's methods can delegate to LogicalSize's methods.

This change shouldn't change behavior.

Depends on D93868

Pushed by aethanyc@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/d9b31b7b645a
Part 1 - Fix a writing-mode mismatch in ViewportFrame::Reflow(). r=jfkthame
https://hg.mozilla.org/integration/autoland/rev/2e4c9e0bdba9
Part 2 - Store LogicalSize as a member variable in ReflowOutput, and improve the documentation. r=jfkthame
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 84 Branch
Blocks: 1678098
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: