Closed Bug 1793826 Opened 4 months ago Closed 4 months ago

Remove nsFrameList::FrameLinkEnumerator

Categories

(Core :: Layout, task)

task

Tracking

()

RESOLVED FIXED
107 Branch
Tracking Status
firefox107 --- fixed

People

(Reporter: TYLin, Assigned: TYLin)

References

Details

Attachments

(2 files)

nsFrameList::FrameLinkEnumerator iterates "links" between frames, which is an idea rarely used in layout.

To iterate nsFrameList, we can use a ranged-based for-loop, or nsFrameList::Iterator.

This is a preparation to remove nsFrameList::FrameLinkEnumerator in the next
part.

FrameLinkEnumerator::Find() can be replaced with std::find/std::find_if.

Assignee: nobody → aethanyc
Status: NEW → ASSIGNED

Change the last caller of FrameLinkEnumerator to use Iterator instead, and we
are ready to remove it.

Depends on D158700

Pushed by aethanyc@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/01820845ab62
Part 1 - Change nsFrameList::ExtractHead and ExtractTail to take nsIFrame* argument. r=emilio
https://hg.mozilla.org/integration/autoland/rev/9e398426c46f
Part 2 - Remove nsFrameList::FrameLinkEnumerator. r=emilio

Backed out for causing build bustages.

[task 2022-10-06T00:37:12.030Z] 00:37:12     INFO -  In file included from /builds/worker/workspace/obj-build/dist/stl_wrappers/xutility:54:
[task 2022-10-06T00:37:12.031Z] 00:37:12     INFO -  /builds/worker/fetches/vs/vc/tools/msvc/14.16.27023/include/xutility(848,7): error: object of type 'nsFrameList::Iterator' cannot be assigned because its copy assignment operator is implicitly deleted
[task 2022-10-06T00:37:12.031Z] 00:37:12     INFO -                  _It = _UIt;
[task 2022-10-06T00:37:12.031Z] 00:37:12     INFO -                      ^
[task 2022-10-06T00:37:12.031Z] 00:37:12     INFO -  /builds/worker/fetches/vs/vc/tools/msvc/14.16.27023/include/xutility(3541,2): note: in instantiation of function template specialization 'std::_Seek_wrapped<nsFrameList::Iterator, nsFrameList::Iterator>' requested here
[task 2022-10-06T00:37:12.031Z] 00:37:12     INFO -          _Seek_wrapped(_First,
[task 2022-10-06T00:37:12.032Z] 00:37:12     INFO -          ^
[task 2022-10-06T00:37:12.032Z] 00:37:12     INFO -  /builds/worker/checkouts/gecko/layout/generic/nsContainerFrame.cpp(1427,29): note: in instantiation of function template specialization 'std::find<nsFrameList::Iterator, nsIFrame *>' requested here
[task 2022-10-06T00:37:12.032Z] 00:37:12     INFO -    if (auto childIter = std::find(mFrames.begin(), mFrames.end(), aChild);
[task 2022-10-06T00:37:12.032Z] 00:37:12     INFO -                              ^
[task 2022-10-06T00:37:12.033Z] 00:37:12     INFO -  /builds/worker/workspace/obj-build/dist/include/nsFrameList.h(498,24): note: copy assignment operator of 'Iterator' is implicitly deleted because field 'mList' is of reference type 'const nsFrameList &'
[task 2022-10-06T00:37:12.033Z] 00:37:12     INFO -      const nsFrameList& mList;
[task 2022-10-06T00:37:12.034Z] 00:37:12     INFO -                         ^
[task 2022-10-06T00:37:12.034Z] 00:37:12     INFO -  1 error generated.
[task 2022-10-06T00:37:12.035Z] 00:37:12    ERROR -  gmake[4]: *** [/builds/worker/checkouts/gecko/config/rules.mk:668: Unified_cpp_layout_generic1.obj] Error 1
[task 2022-10-06T00:37:12.035Z] 00:37:12     INFO -  gmake[4]: Leaving directory '/builds/worker/workspace/obj-build/layout/generic'
[task 2022-10-06T00:37:12.036Z] 00:37:12     INFO -  gmake[4]: *** Waiting for unfinished jobs....
Flags: needinfo?(aethanyc)
Flags: needinfo?(aethanyc)
Pushed by aethanyc@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/cf6607770818
Part 1 - Change nsFrameList::ExtractHead and ExtractTail to take nsIFrame* argument. r=emilio
https://hg.mozilla.org/integration/autoland/rev/9a1090f6834c
Part 2 - Remove nsFrameList::FrameLinkEnumerator. r=emilio
Status: ASSIGNED → RESOLVED
Closed: 4 months ago
Resolution: --- → FIXED
Target Milestone: --- → 107 Branch
Blocks: 1794035
You need to log in before you can comment on or make changes to this bug.