Branch: refs/heads/webkitglib/2.54
  Home:   https://github.com/WebKit/WebKit
  Commit: b5e79ef4f63f3e0c6a85e25f19bf485b3ee99eb2
      
https://github.com/WebKit/WebKit/commit/b5e79ef4f63f3e0c6a85e25f19bf485b3ee99eb2
  Author: Lauro Moura <[email protected]>
  Date:   2026-09-17 (Thu, 17 Sep 2026)

  Changed paths:
    M Source/WebDriver/SessionHost.cpp
    M Source/WebKit/UIProcess/Automation/WebAutomationSession.cpp
    M Source/WebKit/UIProcess/Automation/WebAutomationSession.h

  Log Message:
  -----------
  Cherry-pick 321165@main (d37826b37420). 
https://bugs.webkit.org/show_bug.cgi?id=323447

    [WebDriver] waitForNavigationToComplete callbacks might be lost in 
concurrent commands
    https://bugs.webkit.org/show_bug.cgi?id=323447

    Reviewed by BJ Burg.

    Currently, in assertion-less builds, an existing navigation wait
    callback can get silently dropped, replaced by a new incoming one. This
    in turn can end up making the client wait indefinitely for the original
    callback's reply.

    While properly enqueueing WebDriverClassic commands would avoid this
    issue (bug323444) on this front, this can still happen when
    WebDriverBiDi is used, for example. (e.g. WebDriverBiDi navigates a
    target, setting the wait callback, and while it is not fulfilled, an
    incoming classic command arrives and waits for navigation to complete).

    This commit addresses this by storing all pending navigations for a
    given target in a vector, so each one of them can be fulfilled when the
    navigation reaches the expected stage (eager/normal), or rejected if
    the target is destroyed.

    This commit also fixes an error where a loop was using the ASYNC_FAIL
    macros for error reportning. These macros are supposed to be "bail out"
    macros, so in practice it was returning early from the function on the
    first iteration.

    Note that this still leaves the current WebAutomationSession limitation
    of using a single load timer across all waits, but this will be
    addressed in bug323980. The only timer-related change was removing the
    assertion when adding new callbacks, as this is now supported.

    * Source/WebDriver/SessionHost.cpp:
    (WebDriver::SessionHost::dispatchMessage):
    * Source/WebKit/UIProcess/Automation/WebAutomationSession.cpp:
    (WebKit::WebAutomationSession::didDestroyFrame):
    (WebKit::addPendingNavigationCallback):
    (WebKit::WebAutomationSession::waitForNavigationToCompleteOnPage):
    (WebKit::WebAutomationSession::waitForNavigationToCompleteOnFrame):
    
(WebKit::WebAutomationSession::respondToPendingPageNavigationCallbacksWithTimeout):
    
(WebKit::WebAutomationSession::respondToPendingFrameNavigationCallbacksWithTimeout):
    
(WebKit::WebAutomationSession::respondToPendingNavigationCallbacksWithSuccess):
    (WebKit::WebAutomationSession::navigationOccurredForFrame):
    (WebKit::WebAutomationSession::documentLoadedForFrame):
    (WebKit::WebAutomationSession::willClosePage):
    * Source/WebKit/UIProcess/Automation/WebAutomationSession.h:

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

Canonical link: https://commits.webkit.org/317695.337@webkitglib/2.54



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

Reply via email to