Closed Bug 1728497 Opened 3 years ago Closed 3 years ago

nsColumnSetFrame::CalculateColumnRuleBounds isn't worth it

Categories

(Core :: Layout: Columns, enhancement, P3)

enhancement

Tracking

()

RESOLVED FIXED
93 Branch
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.)

Comment 0 sounds reasonable to me.

Pushed by mpalmgren@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/d68c972998b5
Remove nsColumnSetFrame::CalculateColumnRuleBounds and just return InkOverflowRect() instead.  r=TYLin
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 93 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: