Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 645f9091db79c271b9a6706da6be254ed89850a7
      
https://github.com/WebKit/WebKit/commit/645f9091db79c271b9a6706da6be254ed89850a7
  Author: Chris Dumez <[email protected]>
  Date:   2026-06-22 (Mon, 22 Jun 2026)

  Changed paths:
    M Source/WebCore/dom/GCReachableRef.h

  Log Message:
  -----------
  GCReachableRef's HashTraits peek()/take() use the wrong value type
https://bugs.webkit.org/show_bug.cgi?id=317564

Reviewed by Darin Adler.

HashTraits<GCReachableRef<P>>::peek() and take() were declared in terms of
Ref<P> instead of GCReachableRef<P>, a copy-paste leftover from RefHashTraits.
These members are not currently instantiated by any user of
HashSet<GCReachableRef<Node>> (MutationObserver / MutationObserverRegistration
only add, iterate, move and swap the set), so the file compiles today, but any
future call to take()/takeAny()/get() on such a container would fail to compile:
a GCReachableRef rvalue does not bind to a Ref<P> parameter, and the take()
body's isEmptyValue() check is declared for GCReachableRef<P>.

Fix the parameter and return types to use GCReachableRef<P>. TakeType is kept as
std::optional<GCReachableRef<P>> rather than RefPtr<P> so that taking a value 
out
of the set preserves its GCReachableRefMap registration through the move.

No change in behavior; no new tests as the affected code was previously
uninstantiated.

* Source/WebCore/dom/GCReachableRef.h:
(WTF::HashTraits<WebCore::GCReachableRef<P>>::peek):
(WTF::HashTraits<WebCore::GCReachableRef<P>>::take):

Canonical link: https://commits.webkit.org/315647@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to