You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit ac6b35c
Browse filesBrowse the repository at this point in the historyBrowse files
[IFC] Replace InlineIterator traversal with modern C++ style iterators and ranges
https://bugs.webkit.org/show_bug.cgi?id=327538
rdar://190023418
Reviewed by Alan Baradlay.
InlineIterator was designed to fit the linked lists of legacy inline tree which meant it simulated
pointer traversal. With legacy tree gone we can modernize the interface.
This patch makes the iterators standard bidirectional iterators and switches traversal in many places
to range-for syntax. The ranges are standard views so std::ranges algorithms and std::views adaptors
like std::views::reverse work with them. The iterators are still the nullable box type and keep their
named traversal functions, which are now the same as ++ and --. An iterator converts to another kind of
iterator positioned at the same box. Outside traversal the interface stays largely the same.
Box handles are now copied when iterating, so InlineContent uses CanMakeSingleThreadWeakPtr to avoid atomic
refcount churn. The thread-safe CanMakeWeakPtr use predated the single-thread variant.
Copying box handles now destroys SingleThreadWeakPtrs in NODELETE functions. Mark SingleThreadWeakPtrImpl::deref()
SUPPRESS_NODELETE, mirroring what 320003@main did for WeakPtr's DefaultWeakPtrImpl.
* Source/WTF/wtf/WeakPtrImpl.h:
(WTF::SingleThreadWeakPtrImpl::deref const):
* Source/WebCore/layout/integration/inline/InlineIteratorBox.cpp:
* Source/WebCore/layout/integration/inline/InlineIteratorBox.h:
* Source/WebCore/layout/integration/inline/InlineIteratorBoxInlines.h:
* Source/WebCore/layout/integration/inline/InlineIteratorInlineBox.cpp:
* Source/WebCore/layout/integration/inline/InlineIteratorInlineBox.h:
* Source/WebCore/layout/integration/inline/InlineIteratorLineBox.cpp:
* Source/WebCore/layout/integration/inline/InlineIteratorLineBox.h:
* Source/WebCore/layout/integration/inline/InlineIteratorLogicalOrderTraversal.h:
* Source/WebCore/layout/integration/inline/InlineIteratorSVGTextBox.cpp:
* Source/WebCore/layout/integration/inline/InlineIteratorSVGTextBox.h:
* Source/WebCore/layout/integration/inline/InlineIteratorTextBox.cpp:
* Source/WebCore/layout/integration/inline/InlineIteratorTextBox.h:
* Source/WebCore/layout/integration/inline/LayoutIntegrationInlineContent.h:
Callers updated.
Canonical link: https://commits.webkit.org/324129@main
0 commit comments