Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: f1e55dd8fe6fdc38c20c3409672b89f021417819
      
https://github.com/WebKit/WebKit/commit/f1e55dd8fe6fdc38c20c3409672b89f021417819
  Author: Basuke Suzuki <bas...@apple.com>
  Date:   2025-08-28 (Thu, 28 Aug 2025)

  Changed paths:
    M LayoutTests/TestExpectations
    A LayoutTests/http/wpt/dom/inline-module-script-timing-expected.txt
    A LayoutTests/http/wpt/dom/inline-module-script-timing.html
    A LayoutTests/http/wpt/dom/inline-module-script-with-imports-expected.txt
    A LayoutTests/http/wpt/dom/inline-module-script-with-imports.html
    A LayoutTests/http/wpt/dom/resources/delayed-module.js
    M 
LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/microtasks/evaluation-order-2-expected.txt
    M 
LayoutTests/imported/w3c/web-platform-tests/navigation-api/navigate-event/cross-origin-traversal-redirect-expected.txt
    M Source/WebCore/dom/Microtasks.h
    M Source/WebCore/html/parser/HTMLDocumentParser.cpp

  Log Message:
  -----------
  Race condition between module script execution and FrameLoader's document 
completion check.
https://bugs.webkit.org/show_bug.cgi?id=297939
rdar://159112160

Reviewed by Alex Christensen.

Module scripts that create microtasks were seeing inconsistent 
document.readyState values, the
module script itself saw "interactive" but Promise callbacks saw "complete". 
This happened
because FrameLoader::finishedParsing() was being called during microtask 
checkpoint execution.

The fix detects when attemptToRunDeferredScriptsAndEnd() is called during a 
microtask checkpoint
and defers the end() call using the regular task queue, ensuring 
finishedParsing() runs after
all microtasks complete.

* LayoutTests/TestExpectations:
* LayoutTests/http/wpt/dom/inline-module-script-timing-expected.txt: Added.
* LayoutTests/http/wpt/dom/inline-module-script-timing.html: Added.
* LayoutTests/http/wpt/dom/inline-module-script-with-imports-expected.txt: 
Added.
* LayoutTests/http/wpt/dom/inline-module-script-with-imports.html: Added.
* LayoutTests/http/wpt/dom/resources/delayed-module.js: Added.
* 
LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/microtasks/evaluation-order-2-expected.txt:
* 
LayoutTests/imported/w3c/web-platform-tests/navigation-api/navigate-event/cross-origin-traversal-redirect-expected.txt:
* Source/WebCore/dom/Microtasks.h:
* Source/WebCore/html/parser/HTMLDocumentParser.cpp:
(WebCore::HTMLDocumentParser::notifyFinished):

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



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

Reply via email to