Refactor handling of trailing trimmable whitespace
Categories
(Core :: Layout: Text and Fonts, task)
Tracking
()
Tracking | Status | |
---|---|---|
firefox113 | --- | fixed |
People
(Reporter: jfkthame, Assigned: jfkthame)
References
Details
Attachments
(1 file)
The current handling of trimmable whitespace, handled by nsTextFrame and gfxTextRun, is needlessly complex, and makes it difficult to reason about the changes needed for bugs like 1712703 and 1253840.
Currently, depending on the aTrimWhitespace and aHangWhitespace parameters, gfxTextRun::BreakAndMeasureText may "trim" trailing whitespace from the metrics it returns, and return the advance of the trimmed space separately. But then nsTextFrame::ReflowText may add this advance back, if it cannot be sure at reflow time that the frame will be at end-of-line; and then we'll potentially remove it again in nsTextFrame::TrimTrailingWhiteSpace.
I think a cleaner model will be to always have BreakAndMeasureText simply return the true metrics of the full range being measured, and the amount of this that is trimmable-or-hangable trailing whitespace.
Assignee | ||
Comment 1•2 years ago
|
||
This slightly simplifies gfxTextRun::BreakAndMeasureText, and should make it less confusing
to reason about trailing whitespace in nsTextFrame/nsLineLayout.
Updated•2 years ago
|
Comment 3•2 years ago
|
||
bugherder |
Description
•