Closed Bug 1588025 Opened 5 years ago Closed 5 years ago

ViewportFrame is orthogonal to nsCanvasFrame's mCustomContentContainer when setting vertical writing-mode on <html>

Categories

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

defect

Tracking

()

RESOLVED FIXED
mozilla72
Tracking Status
firefox72 --- fixed

People

(Reporter: TYLin, Assigned: TYLin)

References

Details

Attachments

(3 files)

Attached file font-inflation-1e.html

The backout in bug 1102175 comment 39 happens only on Android because AccessibleCaret is enabled, making nsCanvasFrame create mCustomContentContainer.

When setting vertical writing-mode on <html>, ViewportFrame and nsCanvasFrame's child mCustomContentContainer become orthogonal during reflow. Thus, it causes this assertion in FindFontInflationDataFor(). In the assertion condition, aFrame is custom content container's primary frame where bfc is ViewportFrame.

Why is mCustomContentContainer's used writing-mode horizontal? When mCustomContentContainer is constructed, it inherits its writing-mode from nsCanvasFrame, which is a default horizontal-tb writing-mode inheriting further up from Viewport. Later in nsCanvasFrame::MaybePropagateRootElementWritingMode(), we then propagate <html>'s used mWritingMode (vertical) all the way up to Viewport. Bug 1102175 Part 1 changes how we propagate the used writing-mode up (either taken from <html> or <body>), but the situation is the same.

The attached test case can trigger the assertion on destkop browser by enabling layout.accessiblecaret.enabled=true and all the test-pref listed here.

The only caller SetRootElementFrameAndConstructCanvasAnonContent()
already passes nsContainerFrame* to aFrame.

A minor cleanup discovered while working on this bug.

Depends on D48942

Assignee: nobody → aethanyc
No longer blocks: 1102175
Status: NEW → ASSIGNED
Depends on: 1102175
Attachment #9100393 - Attachment description: Bug 1588025 - Disable font inflation for the custom content container subtree. → Bug 1588025 - Make the custom content container a font inflation root.
Pushed by aethanyc@gmail.com: https://hg.mozilla.org/integration/autoland/rev/b46a40b2287c Make the custom content container a font inflation root. r=emilio https://hg.mozilla.org/integration/autoland/rev/0ba412a99ed5 Change an argument to nsContainerFrame* for ConstructAnonymousContentForCanvas. r=jfkthame
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla72
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: