nsColumnSetFrame::CalculateColumnRuleBounds isn't worth it
Categories
(Core :: Layout: Columns, enhancement, P3)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox93 | --- | fixed |
People
(Reporter: MatsPalmgren_bugz, Assigned: MatsPalmgren_bugz)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
nsColumnSetFrame::CalculateColumnRuleBounds seems unnecessarily complex to me:
https://searchfox.org/mozilla-central/rev/ad2ffab089e4e0c0fe99a1a046ab2b1c45546bdb/layout/generic/nsColumnSetFrame.cpp#167
The only caller is nsDisplayColumnRule::GetBounds:
https://searchfox.org/mozilla-central/rev/ad2ffab089e4e0c0fe99a1a046ab2b1c45546bdb/layout/generic/nsColumnSetFrame.cpp#37-41
but that method could just return the frame's InkOverflowRect() instead since that always contains the column-rule areas. That's slightly larger than the union of the column-gap areas but it doesn't seem worth optimizing for the case where the first/last column is visible but none of the column-rules. That seems like a rare edge case, so CalculateColumnRuleBounds just wastes CPU cycles for the common case.
Let me know if I'm missing something...
(The reason I want to remove it is that I'm generalizing nsDisplayColumnRule for bug 1725495 so that we can use it for Flexbox and Grid too. So I want to get rid of this dependency on nsColumnSetFrame.)
| Assignee | ||
Comment 1•4 years ago
|
||
| Assignee | ||
Comment 2•4 years ago
|
||
Comment 5•4 years ago
|
||
| bugherder | ||
Description
•