Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: dc7cb414300fd3c094ff871f132dcc4cddef2466
https://github.com/WebKit/WebKit/commit/dc7cb414300fd3c094ff871f132dcc4cddef2466
Author: Ahmad Saleem <[email protected]>
Date: 2026-10-05 (Mon, 05 Oct 2026)
Changed paths:
M Source/WebCore/rendering/HitTestResult.cpp
M Source/WebCore/rendering/HitTestResult.h
Log Message:
-----------
HitTestResult has no move operations, so every move deep-copies its node list
https://bugs.webkit.org/show_bug.cgi?id=326187
rdar://189069703
Reviewed by Simon Fraser.
HitTestResult declares its own copy constructor and copy assignment operator,
which stops the compiler from generating move operations. Every move of a
HitTestResult therefore used the copy constructor. That copy allocates a new
ListHashSet and re-adds every node from a rect-based hit test, and it bumps the
reference counts of all the RefPtr members.
This adds defaulted move operations so moves hand over the members, including
the std::unique_ptr holding the node list.
It also fixes the copy assignment operator, which only replaced
m_listBasedTestResult when the source had a list. Assigning from a result with
no list left the target holding stale nodes from an earlier hit test. The
target's list is now cleared in that case.
No new tests. The move operations don't change behavior. The stale-list case
isn't reachable from current web-exposed callers.
* Source/WebCore/rendering/HitTestResult.cpp:
(WebCore::HitTestResult::operator=):
* Source/WebCore/rendering/HitTestResult.h:
Canonical link: https://commits.webkit.org/322728@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications