Open Bug 1288983 Opened 8 years ago Updated 2 years ago

Break text frames for force line break inside earlier

Categories

(Core :: Layout: Text and Fonts, defect, P3)

defect

Tracking

()

People

(Reporter: xidorn, Unassigned)

References

(Blocks 1 open bug)

Details

We sometimes run into O(N^2) algorithm for processing text runs (e.g. bug 1288938), and shorter text run would make those issues happen less frequently. I suggest we have the frame constructor split text frames which has force line break inside, so that when we are creating text runs, frames are already short enough, and we wouldn't ever create text run which is across any force line break.
I wonder if we split the text frame in nsCSSFrameConstructor::ConstructTextFrame, do we still need the current code in nsTextFrame::ReflowText to find newlines.
Looks like we would still need that in case the data is changed dynamically. I guess we may want to move the newline cache to frame property table, so that we avoid an allocation (because it is just one integer then), and we should be able to skip more rescanning. (The invalidation could take some time, but we need an O(n) in CharacterDataChanged anyway).
Priority: -- → P3
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.