Closed Bug 1671726 Opened 3 years ago Closed 2 years ago

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


(Core :: Layout, task)




84 Branch
Tracking Status
firefox84 --- fixed


(Reporter: TYLin, Assigned: TYLin)




(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
Part 1 - Fix a writing-mode mismatch in ViewportFrame::Reflow(). r=jfkthame
Part 2 - Store LogicalSize as a member variable in ReflowOutput, and improve the documentation. r=jfkthame
Closed: 2 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.