Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: a1eb40279d6b1325a2e63cb87dc5240809914e0a
      
https://github.com/WebKit/WebKit/commit/a1eb40279d6b1325a2e63cb87dc5240809914e0a
  Author: Ryosuke Niwa <[email protected]>
  Date:   2025-10-03 (Fri, 03 Oct 2025)

  Changed paths:
    M LayoutTests/fast/dom/gc-dom-tree-lifetime-shadow-tree.html
    M Source/WebCore/dom/Element.cpp
    M Source/WebCore/dom/Element.h
    M Source/WebCore/dom/Event.cpp
    M Source/WebCore/dom/Event.h
    M Source/WebCore/dom/EventNames.json
    M Source/WebCore/dom/EventTarget.cpp
    M Source/WebCore/dom/MutationObserver.cpp
    M Source/WebCore/dom/MutationObserver.h
    M Source/WebCore/dom/Node.h
    M Source/WebCore/dom/WindowEventLoop.h
    M Tools/TestWebKitAPI/Tests/WebKitCocoa/FormValidation.mm
    M Tools/TestWebKitAPI/Tests/WebKitCocoa/UserContentController.mm

  Log Message:
  -----------
  Introduce an event when attaching a shadow root to an element
https://bugs.webkit.org/show_bug.cgi?id=299580

Reviewed by Sihui Liu.

Introduce a new DOM event, webkitshadowrootattached, which gets fired on an 
element
whenever a non-user-agent shadow root attached to the element.

We dispatch this event whenever DOM wrapper world is supposed to have access to 
all
shadow roots regardless of its mode.

Tests: Tools/TestWebKitAPI/Tests/WebKitCocoa/FormValidation.mm
       Tools/TestWebKitAPI/Tests/WebKitCocoa/UserContentController.mm

* LayoutTests/fast/dom/gc-dom-tree-lifetime-shadow-tree.html: Fixed the test to 
wait
with a 0s timer so that we perform the liveness check after 
webkitshadowrootattached
has been dispatched.
* Source/WebCore/dom/Element.cpp:
(WebCore::Element::addShadowRoot):
(WebCore::Element::enqueueShadowRootAttachedEvent):
(WebCore::Element::dispatchShadowRootAttachedEvent):
* Source/WebCore/dom/Element.h:
(WebCore::Element::didDispatchShadowRootAttachedEvent):
* Source/WebCore/dom/Event.h:
(WebCore::Event::isShadowRootAttachedEvent):
(WebCore::Event::setIsShadowRootAttachedEvent):
* Source/WebCore/dom/EventNames.json:
* Source/WebCore/dom/EventTarget.cpp:
(WebCore::EventTarget::innerInvokeEventListeners):
* Source/WebCore/dom/MutationObserver.cpp:
(WebCore::MutationObserver::enqueueShadowRootAttachedEvent):
(WebCore::MutationObserver::notifyMutationObservers):
* Source/WebCore/dom/MutationObserver.h:
* Source/WebCore/dom/Node.h:
* Source/WebCore/dom/WindowEventLoop.h:
* Tools/TestWebKitAPI/Tests/WebKitCocoa/FormValidation.mm:
(TestWebKitAPI::TEST(WebKit, DidAssociateFormControls)): Deleted.
* Tools/TestWebKitAPI/Tests/WebKitCocoa/UserContentController.mm:
(TEST(WKUserContentController, DidAssociateFormControls)):
(TEST(WKUserContentController, ShadowRootAttachedEvent)):

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



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to