More nsFrameList improvement and clean up
Categories
(Core :: Layout, task)
Tracking
()
Tracking | Status | |
---|---|---|
firefox107 | --- | fixed |
People
(Reporter: TYLin, Assigned: TYLin)
References
Details
Attachments
(4 files)
After finishing bug 1793826, I discover more opportunities to improve nsFrameList
. See the patches' commit message for details.
Assignee | ||
Comment 1•2 years ago
|
||
I feel it's hard to understand the purpose of ExtractHead(), especially where
aFrame is going after the call. Therefore, I rename it to RemoveFramesBefore(),
and have it complement the existing RemoveFramesAfter(). No behavioral change
intended.
Also, slightly reword the method's documentation to reflect the its new
name. (Remove the "sibling" wording from the comment since it's an
implementation details that frames are actually a doubly linked list.)
Updated•2 years ago
|
Assignee | ||
Comment 2•2 years ago
|
||
RemoveFramesAfter and ExtractTail have similar purpose, so we really should keep
one of them to avoid confusion.
They have the following minor differences:
- RemoveFramesAfter() keeps aFrame in the list, while ExtractTail() returns it.
- If aFrame is empty, RemoveFramesAfter() returns the entire list, while
ExtractTail returns an empty list.
It's more convenient for the existing callers to use the RemoveFramesAfter(), so
ExtractTail is unneeded.
After this patch, both RemoveFramesAfter() and RemoveFramesBefore() return the
entire list if aFrame is nullptr.
This change shouldn't change the behavior.
Depends on D158806
Assignee | ||
Comment 3•2 years ago
|
||
It is large enough to live in cpp.
Depends on D158807
Assignee | ||
Comment 4•2 years ago
|
||
Also, HasPushedFloatsFromPrevContinuation() is larger enough to live in cpp.
After this patch, we still need nsFrameList::Enumerator to iterate
nsFrameList::Slice. We might enhance nsFrameList::Iterator to support Slice, but
I'll leave this for another day.
Depends on D158808
Updated•2 years ago
|
Updated•2 years ago
|
Pushed by aethanyc@gmail.com: https://hg.mozilla.org/integration/autoland/rev/1287c6591e6b Part 1 - Rename nsFrameList::ExtractHead to TakeFramesBefore. r=emilio https://hg.mozilla.org/integration/autoland/rev/30770c70f020 Part 2 - Rename RemoveFramesAfter, improve its implementation, and remove ExtractTail. r=emilio https://hg.mozilla.org/integration/autoland/rev/14ff4ca235d1 Part 3 - Move nsBlockFrame::HasPushedFloatsFromPrevContinuation() implementation to cpp. r=emilio https://hg.mozilla.org/integration/autoland/rev/d96df925c943 Part 4 - Use range-based for loops to iterate nsFrameList. r=emilio
Comment 6•2 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/1287c6591e6b
https://hg.mozilla.org/mozilla-central/rev/30770c70f020
https://hg.mozilla.org/mozilla-central/rev/14ff4ca235d1
https://hg.mozilla.org/mozilla-central/rev/d96df925c943
Description
•