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

  Changed paths:
    M Source/WebCore/dom/Element.cpp
    M Source/WebCore/dom/Element.h
    M Source/WebCore/dom/SelectorQuery.cpp
    M Source/WebCore/dom/SelectorQuery.h

  Log Message:
  -----------
  Remove redundant selectorClosest() in SelectorDataList
https://bugs.webkit.org/show_bug.cgi?id=311551

Reviewed by Anne van Kesteren.

selectorClosest() was identical to selectorMatches() except it returned
Element* instead of bool. Rewrite closest() to use selectorMatches()
directly, eliminating the duplicated method. Update closest() to return
RefPtr<Element> instead of a raw pointer since the Ref local variable
used for the result is LIFETIME_BOUND.

* Source/WebCore/dom/Element.cpp:
(WebCore::Element::closest):
* Source/WebCore/dom/Element.h:
* Source/WebCore/dom/SelectorQuery.cpp:
(WebCore::SelectorDataList::closest const):
(WebCore::SelectorDataList::selectorClosest const): Deleted.
* Source/WebCore/dom/SelectorQuery.h:
(WebCore::SelectorQuery::closest const):

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



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

Reply via email to