Open Bug 1794709 Opened 3 years ago Updated 3 years ago

Hang (slow reflow) with extremely linewrapped block with ::first-letter styling

Categories

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

defect

Tracking

()

People

(Reporter: dholbert, Unassigned)

Details

Attachments

(2 files)

Attached file testcase 1

[Spinning this off from bug 997280, whose testcase used to crash and now hangs for a few seconds instead]

STR:

  1. Load attached testcase (simplified from the one on bug 997280).
  2. Wait for text to appear.

ACTUAL RESULTS:
Hang for a few seconds. (The actual duration is logged via console.log().)

EXPECTED RESULTS:
No hang.

This seems to be dependent on the first letter having ::first-letter styling, and the text being extremely linewrapped. If I remove the ::first-letter rule, or if I change the specified width to be a larger value like 300px, then the issue goes away.

Profile of the long reflow with the attached testcase: https://share.firefox.dev/3VkPlkd

The reflow is ~2.7 seconds long (and console.log shows Duration: 2714ms).

Most of the time (2.699 seconds) is spent in nsFirstLetterFrame::Reflow, specifically its call to nsTextFrame::EnsureTextRun and its various calls into BuildTextRunsScanner APIs.

Attachment #9298116 - Attachment description: reference case 1 (no first-letter rule) → semi-reference case 1 (no first-letter rule)

In Chrome, console.log() reports 8-9 ms for the original testcase (vs. our ~2700ms).

For the "semi-reference case" that I just attached, we get times between 7-9ms as well.

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: