Closed Bug 838688 Opened 13 years ago Closed 13 years ago

Improve nsBlockFrame::ReparentFloats/CollectFloats

Categories

(Core :: Layout, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla22

People

(Reporter: MatsPalmgren_bugz, Assigned: MatsPalmgren_bugz)

References

Details

(Keywords: perf)

Attachments

(2 files)

No description provided.
Removing a nFrameList::RemoveFrameIfPresent and a ContainsFrame in the process (both O(n)).
Attachment #710784 - Flags: review?(bzbarsky)
Blocks: 838706
Comment on attachment 710784 [details] [diff] [review] Make ReparentFloats/CollectFloats not require a priori knowledge of which child list a float is expected to be on. >+ // Floats lives in mFloats, or in the PushedFloat or OverflowOutOfFlows s/lives/live/ Again would be good to have asserts that the frame is in one of the lists in question.... r=me with that
Attachment #710784 - Flags: review?(bzbarsky) → review+
Comment on attachment 710794 [details] [diff] [review] Optimize CollectFloats by doing an early return if this block doesn't have any floats. Why is returning early if the frame has no floats OK if aCollectSiblings is true?
Comment on attachment 710794 [details] [diff] [review] Optimize CollectFloats by doing an early return if this block doesn't have any floats. r- pending explanation
Attachment #710794 - Flags: review?(bzbarsky) → review-
Comment on attachment 710794 [details] [diff] [review] Optimize CollectFloats by doing an early return if this block doesn't have any floats. (In reply to Boris Zbarsky (:bz) from comment #4) > Why is returning early if the frame has no floats OK if aCollectSiblings is > true? Because nsBlockFrame::CollectFloats ignores floats that belongs to some other frame (can happen due to lazy reparenting in nsInlineFrame). http://mxr.mozilla.org/mozilla-central/source/layout/generic/nsBlockFrame.cpp#6877 So if 'this' has no floats, CollectFloats is a NOP. (with the assumption that floats are correctly parented and present on one of the lists of its parent -- which I'm pretty sure holds)
Attachment #710794 - Flags: review- → review?(bzbarsky)
... and the above is independent of aCollectSiblings, which just says if we should also traverse aFrame's siblings or not.
Comment on attachment 710794 [details] [diff] [review] Optimize CollectFloats by doing an early return if this block doesn't have any floats. Oh, I see. aFrame is not the block itself, gotcha. r=me
Attachment #710794 - Flags: review?(bzbarsky) → review+
Blocks: 843332
(In reply to Boris Zbarsky (:bz) from comment #3) > s/lives/live/ fixed > Again would be good to have asserts that the frame is in one of the lists in > question.... r=me with that Added an assertion for that: https://hg.mozilla.org/integration/mozilla-inbound/rev/73ac17d659f6 https://hg.mozilla.org/integration/mozilla-inbound/rev/504e5b0d7d53
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla22
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: