Closed
Bug 728255
Opened 12 years ago
Closed 12 years ago
Replace nsLineBox::LastChild() calls with O(1) equivalents where possible
Categories
(Core :: Layout: Block and Inline, defect)
Core
Layout: Block and Inline
Tracking
()
RESOLVED
FIXED
mozilla13
People
(Reporter: MatsPalmgren_bugz, Assigned: MatsPalmgren_bugz)
References
Details
(Keywords: perf, Whiteboard: [inbound])
Attachments
(1 file)
5.45 KB,
patch
|
bzbarsky
:
review+
|
Details | Diff | Splinter Review |
In general we don't need to use nsLineBox::LastChild(), which is O(n) on the number of frames in the line, except for the last line of the overflow lines list. 1. the last frame of the last normal line is the same as mFrames.LastChild() which is O(1) 2. for any line that isn't the last line, the next line's mFirstChild->GetPrevSibling() is our last frame, also O(1) 3. for the last overflow line we must still use nsLineBox::LastChild() (this looks like a rare case though) These invariants holds except in very rare cases when splitting a line and messing with the mFirstChild / mChildCount. nsLineBox::LastChild() probably isn't correct in those cases either. Anyway, that shouldn't be the case for the places I'm fixing.
Assignee | ||
Comment 1•12 years ago
|
||
Try run is green: https://tbpl.mozilla.org/?tree=Try&rev=25542a0f20f3
Attachment #598256 -
Flags: review?(bzbarsky)
Comment 2•12 years ago
|
||
Comment on attachment 598256 [details] [diff] [review] fix r=me
Attachment #598256 -
Flags: review?(bzbarsky) → review+
Assignee | ||
Comment 3•12 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/aaed6b9c8952
Whiteboard: [inbound]
Target Milestone: --- → mozilla13
Comment 4•12 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/aaed6b9c8952
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•