Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 85e09b241c129c868e96cdc02c5368cdd61abb96
      
https://github.com/WebKit/WebKit/commit/85e09b241c129c868e96cdc02c5368cdd61abb96
  Author: Basuke Suzuki <[email protected]>
  Date:   2025-10-10 (Fri, 10 Oct 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 LayoutTests/platform/ios/TestExpectations
    M Source/WebCore/html/parser/HTMLDocumentParser.cpp
    M 
Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteScrollingCoordinator.h
    M 
Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteScrollingCoordinator.mm
    M Source/WebKit/WebProcess/WebPage/WebPage.cpp
    M Source/WebKit/WebProcess/WebPage/WebPage.h
    M Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm

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

Reviewed by Ryosuke Niwa.

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.

Because this changes the execution timing of some test code, a regression can 
be seen on iOS's
scrolling behavior. When WebPage gets visibleContentRectUpdateInfo from 
UIProcess, added
validation to check the existance of local change after last CommitLayerTree is 
sent.

This was originally landed on 299282@main and reverted on 301215@main.

Tests: http/wpt/dom/inline-module-script-timing.html
       http/wpt/dom/inline-module-script-with-imports.html
       
imported/w3c/web-platform-tests/css/css-scroll-anchoring/shadow-dom-subscroller.html

* 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:
* LayoutTests/platform/ios/TestExpectations:
* Source/WebCore/html/parser/HTMLDocumentParser.cpp:
(WebCore::HTMLDocumentParser::notifyFinished):
* Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteScrollingCoordinator.h:
* 
Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteScrollingCoordinator.mm:
(WebKit::RemoteScrollingCoordinator::applyScrollUpdate):
* Source/WebKit/WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::willCommitLayerTree):
(WebKit::WebPage::shouldIgnoreScrollPositionUpdate const):
(WebKit::WebPage::markPendingLocalScrollPositionChange):
* Source/WebKit/WebProcess/WebPage/WebPage.h:
* Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::markPendingLocalScrollPositionChange):
(WebKit::WebPage::shouldIgnoreScrollPositionUpdate const):
(WebKit::WebPage::updateVisibleContentRects):

Canonical link: https://commits.webkit.org/301345@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