Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: acbb559fb9d1b93dae46f2b4af915cfee42f4c4c
      
https://github.com/WebKit/WebKit/commit/acbb559fb9d1b93dae46f2b4af915cfee42f4c4c
  Author: Andrew Fryer <[email protected]>
  Date:   2026-02-09 (Mon, 09 Feb 2026)

  Changed paths:
    M Source/WebCore/bindings/js/ScriptController.cpp
    M Source/WebCore/bindings/js/ScriptController.h
    M Source/WebCore/dom/ContainerNode.cpp

  Log Message:
  -----------
  Avoid redoing DOM checks when no js executed
https://bugs.webkit.org/show_bug.cgi?id=306972
rdar://168630999

Reviewed by Ryosuke Niwa.

In 305963@main, I avoid revalidating nodes' structure and types in
between performing DOM mutations when the DOM version is unchanged.
Make this more precise by only revalidating when we actually executed js,
which can happen when we dispatch an event such as a DOM MutationEvent.
To detect js execution, have ScriptController::canExecuteScripts increment
a global counter and see if it changed since previous DOM validation.

* Source/WebCore/bindings/js/ScriptController.cpp:
(WebCore::ScriptController::scriptExecutionCount):
(WebCore::ScriptController::canExecuteScripts):
* Source/WebCore/bindings/js/ScriptController.h:
* Source/WebCore/dom/ContainerNode.cpp:
(WebCore::ContainerNode::insertBefore):
(WebCore::ContainerNode::replaceChild):
(WebCore::ContainerNode::appendChildWithoutPreInsertionValidityCheck):
(WebCore::ContainerNode::insertChildrenBeforeWithoutPreInsertionValidityCheck):

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



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

Reply via email to