Convert more frame manipulation APIs to take rvalue reference of nsFrameList
Categories
(Core :: Layout, task)
Tracking
()
Tracking | Status | |
---|---|---|
firefox108 | --- | fixed |
People
(Reporter: TYLin, Assigned: TYLin)
References
Details
Attachments
(8 files)
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review |
Bug 1797011 enables us to convert more frame manipulation APIs to take rvalue reference of nsFrameList
. This conveys the ownership transfer of frames more clearly, but at the expense of adding std::move
when passing an existing nsFrameList
.
However, when passing a temporary frame list, we don't have to create extra temp variable. For example, if SetInitialChildList
takes nsFrameList&&
, we can simplify the two lines at [1].
Before:
nsFrameList textList(textFrame, textFrame);
mDisplayFrame->SetInitialChildList(kPrincipalList, textList);
After:
mDisplayFrame->SetInitialChildList(kPrincipalList, nsFrameList(textFrame, textFrame));
Assignee | ||
Comment 1•2 years ago
|
||
Assignee | ||
Comment 2•2 years ago
|
||
Depends on D160837
Assignee | ||
Comment 3•2 years ago
|
||
The removed SetFrames() is slow (it traverses the next sibling chain to find the
last sibling) and has only one caller. Let's remove it.
The rewrite in nsInlineFrame::PullOneFrame() doesn't change behavior because
frame
is just removed from the overflow list, so it won't have any next
sibling. We are creating a frame list containing only frame
.
Depends on D160838
Assignee | ||
Comment 4•2 years ago
|
||
SetFrame() is equivalent to operator=
, so external callers can use operator=
instead. For the two callers wanting to set nsFrameList
to AbsoluteFrameList
in nsCSSFrameConstructor
, removing SetFrame() disallows it. However, we can
easily change the declaration from nsFrameList
to a AbsoluteFrameList
to
resolve the problem.
Depends on D160839
Assignee | ||
Comment 5•2 years ago
|
||
Depends on D160840
Assignee | ||
Comment 6•2 years ago
|
||
Change nsBlockFrame::AppendFrames() helper, too.
Depends on D160841
Assignee | ||
Comment 7•2 years ago
|
||
Depends on D160842
Assignee | ||
Comment 8•2 years ago
|
||
Depends on D160843
Comment 10•2 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/7928d6c39dbb
https://hg.mozilla.org/mozilla-central/rev/9ab4a5dbb198
https://hg.mozilla.org/mozilla-central/rev/eb03bad6dd43
https://hg.mozilla.org/mozilla-central/rev/60bc4d2bee78
https://hg.mozilla.org/mozilla-central/rev/3fcd5080f02b
https://hg.mozilla.org/mozilla-central/rev/aacc637af7ac
https://hg.mozilla.org/mozilla-central/rev/9e554c8105fa
https://hg.mozilla.org/mozilla-central/rev/121a88263004
Description
•