Refactor & clean up computation of decoration line position/thickness
Categories
(Core :: Layout: Text and Fonts, task, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox74 | --- | fixed |
People
(Reporter: jfkthame, Assigned: jfkthame)
References
Details
Attachments
(1 file)
The calculation of exactly where to draw text decoration lines (especially underlines) is a bit tricky, and currently there's quite a bit of duplication of the logic across various places that need to know. I think we can clean up and simplify this to make it more understandable and maintainable.
Assignee | ||
Comment 1•6 years ago
|
||
We replace SetWidthIfLength and SetOffsetIfLength with ComputeDecorationLine{Thickness,Offset} functions,
and consolidate more of the computation of the offset within this function to simplify callers.
Assignee | ||
Comment 2•6 years ago
|
||
Here's at least a step along the way to making this more sane. I think we may be able to do more... e.g. it may be possible to eliminate the defaultLineThickness member in nsCSSRendering::DecorationRectParams altogether. But that will involve changes inside nsCSSRendering as well as in nsTextFrame's computation, so I'm leaving that for now.
Comment 4•6 years ago
|
||
bugherder |
Description
•