Unify continuation linking operations by removing SetPrevContinuation() and SetPrevInFlow()
Categories
(Core :: Layout, task)
Tracking
()
Tracking | Status | |
---|---|---|
firefox123 | --- | fixed |
People
(Reporter: TYLin, Assigned: TYLin)
References
Details
Attachments
(3 files)
While working on bug 1865012, I notice that SetNextInFlow()
and SetPrevInFlow()
are almost always called together when setting up a continuation link, but the callers don't call them in particular order. For example, we call SetPrevInFlow()
first in [1], but call SetNextInFlow()
first in [2]. It makes asserting invariant difficult when only one direction of the doubly link is setup. Ideally, setting up a frame continuation doubly link should be one operation just like SetNextSibling()
[3]. (Yes, we don't have SetPrevSibling
.)
[1] https://searchfox.org/mozilla-central/rev/43c40b22c776d098afb89d5237da3464a7545532/layout/generic/nsSplittableFrame.cpp#27-28
[2] https://searchfox.org/mozilla-central/rev/43c40b22c776d098afb89d5237da3464a7545532/layout/base/nsBidiPresUtils.cpp#681-687
[3] https://searchfox.org/mozilla-central/rev/43c40b22c776d098afb89d5237da3464a7545532/layout/generic/nsIFrame.h#1791-1801
Assignee | ||
Comment 1•9 months ago
|
||
While I'm here, change aFrame
to mNextContinuation
so that it is clearer
that we are tweaking the bit on mNextContinuation
.
Updated•9 months ago
|
Assignee | ||
Comment 2•9 months ago
|
||
SetPrevContinuation()
and SetPrevInFlow()
have the same piece of code. Let's
move it into a helper.
Depends on D197756
Assignee | ||
Comment 3•9 months ago
|
||
SetNextContinuation() and SetPrevContinuation() are almost always called
together when setting up a continuation link, but the callers don't call them in
particular order. We should unify them as one method so that it's more
ergonomics and robust, especially when we do more complex work such as caching
continuations. Same reason for SetNextInFlow() and SetPrevInFlow().
We choose to merge the SetPrevContinuation() code into SetNextContinuation() for
the symmetry of SetNextSibling(). (Yes, we don't have SetPrevSibling().)
This patch doesn't change behavior.
Depends on D197965
Comment 5•9 months ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/d26545584207
https://hg.mozilla.org/mozilla-central/rev/7b396c4118af
https://hg.mozilla.org/mozilla-central/rev/dfcfa98a7e21
Description
•