Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 062b738e29f11571137df04410bc53a5fe5fc72b
      
https://github.com/WebKit/WebKit/commit/062b738e29f11571137df04410bc53a5fe5fc72b
  Author: Nipun Shukla <[email protected]>
  Date:   2026-02-05 (Thu, 05 Feb 2026)

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

  Log Message:
  -----------
  Use bit flag to identify whether Element has shadowRoot
https://bugs.webkit.org/show_bug.cgi?id=307083
rdar://169720290

Reviewed by Ryosuke Niwa.

Add HasShadowRoot bit flag to optimize Element::shadowRoot()
by allowing fast-path early return when an element has no shadow
root, commonly avoiding ElementRareData access.

This change does not introduce any new behavior.

* Source/WebCore/dom/Element.cpp:
(WebCore::Element::addShadowRoot):
(WebCore::Element::removeShadowRootSlow):
* Source/WebCore/dom/ElementRareData.h:
(WebCore::Node::shadowRoot const):
(WebCore::Element::shadowRoot const):
* Source/WebCore/dom/Node.h:
(WebCore::Node::hasShadowRoot const):
(WebCore::Node::setHasShadowRoot):

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



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

Reply via email to