Skip to content

constellation: Report history traversals to webdriver when they are requested - #50006

Merged
yezhizhen merged 2 commits into
servo:mainfrom
yezhizhen:fix-intermittent
Nov 18, 2026
Merged

yezhizhen merged 2 commits into
servo:mainfrom
yezhizhen:fix-intermittent

Conversation

@yezhizhen

@yezhizhen yezhizhen commented Nov 17, 2026 •

Copy link
Copy Markdown
Member

History traversal didn't report webdriver navigation status, until a pipeline is created (which is queued),
so WebDriverCommandMsg::IsNavigationInProgress might say false, which makes webdriver server
skip the waiting when it should.

Testing: This fixes one intermittent case in tests/webdriver/tests/classic/back/user_prompts.py, where the back commands finishes prematurely, so that when next command is run, we are still on the old document.
Fixes: Part of #42802.
Fixes: Part of #49983

@servo-highfive servo-highfive added the S-awaiting-review There is new code that needs to be reviewed. label Nov 17, 2026
@yezhizhen yezhizhen changed the title webdriver: Report history traversals when they are requested constellation: Report history traversals to webdriver when they are requested Nov 17, 2026
Comment on lines +4808 to +4821
/// Whether a history traversal is still running,
/// or the top-level document is still loading.
fn webview_is_navigating(&self, webview_id: WebViewId) -> bool {
let has_ongoing_traversal = self
.webviews
.get(&webview_id)
.is_some_and(|webview| webview.ongoing_history_traversal_request.is_some());
let top_level_is_loading = self
.browsing_contexts
.get(&BrowsingContextId::from(webview_id))
.and_then(|context| self.pipelines.get(&context.pipeline_id))
.is_some_and(|pipeline| !pipeline.completely_loaded);
has_ongoing_traversal || top_level_is_loading
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it makes sense to add this to ConstellationWebView a helper that takes the BrowsingContext.

@yezhizhen yezhizhen added the T-linux-wpt Do a try run of the WPT label Nov 17, 2026
@github-actions github-actions Bot removed the T-linux-wpt Do a try run of the WPT label Nov 17, 2026
@github-actions

Copy link
Copy Markdown

🔨 Triggering try run (#44118484016) for Linux (WPT)

@github-actions

Copy link
Copy Markdown

Test results for linux-wpt from try job (#44118484016):

Flaky unexpected result (29)
  • TIMEOUT [expected OK] /IndexedDB/idbcursor-request-source.any.html (#48728)
  • FAIL [expected PASS] /content-security-policy/img-src/shared-stylesheet-image-cache-bypass-strict-first.html
  • TIMEOUT [expected OK] /content-security-policy/navigation/to-javascript-parent-initiated-parent-csp.html (#46400)
    • TIMEOUT [expected PASS] subtest: Should not have executed the javascript url for area[target=iframe].href

      Test timed out
      

    • NOTRUN [expected PASS] subtest: Should not have executed the javascript url for area[target=otherTab].href
    • NOTRUN [expected PASS] subtest: Should not have executed the javascript url for a[target=otherTab].href
    • NOTRUN [expected PASS] subtest: Should not have executed the javascript url for a[target=iframe].href
  • OK /css/css-position/static-position/inline-containing-block-with-border.html (#49970)
    • FAIL [expected PASS] subtest: writing-mode: horizontal-tb; direction: ltr; inline box 'border-inline-start: 30px solid; padding-inline-start: 7px'; originally inline-level absolutely positioned box

      assert_equals: left expected 111 but got 137
      

  • OK /css/css-position/static-position/static-position-through-absolute-in-inline-containing-block.html
    • FAIL [expected PASS] subtest: writing-mode: horizontal-tb; fixed positioned box in an absolutely positioned box without insets in an inline box containing block

      assert_equals: left expected 62 but got 100
      

  • OK /css/css-text-decor/parsing/text-decoration-inset-computed.html (#47617)
    • FAIL [expected PASS] subtest: Property text-decoration-inset value '0'

      assert_true: text-decoration-inset doesn't seem to be supported in the computed style expected true got false
      

    • FAIL [expected PASS] subtest: Property text-decoration-inset value '0px 0px'

      assert_true: text-decoration-inset doesn't seem to be supported in the computed style expected true got false
      

    • FAIL [expected PASS] subtest: Property text-decoration-inset value '0.5em'

      assert_true: text-decoration-inset doesn't seem to be supported in the computed style expected true got false
      

    • FAIL [expected PASS] subtest: Property text-decoration-inset value '-1em'

      assert_true: text-decoration-inset doesn't seem to be supported in the computed style expected true got false
      

    • FAIL [expected PASS] subtest: Property text-decoration-inset value '-1ch -1ch'

      assert_true: text-decoration-inset doesn't seem to be supported in the computed style expected true got false
      

    • FAIL [expected PASS] subtest: Property text-decoration-inset value '1px 2px'

      assert_true: text-decoration-inset doesn't seem to be supported in the computed style expected true got false
      

    • FAIL [expected PASS] subtest: Property text-decoration-inset value '1ch -1ch'

      assert_true: text-decoration-inset doesn't seem to be supported in the computed style expected true got false
      

    • FAIL [expected PASS] subtest: Property text-decoration-inset value 'calc(1em / 4) calc(-1ch)'

      assert_true: text-decoration-inset doesn't seem to be supported in the computed style expected true got false
      

    • FAIL [expected PASS] subtest: Property text-decoration-inset value 'auto'

      assert_true: text-decoration-inset doesn't seem to be supported in the computed style expected true got false
      

    • FAIL [expected PASS] subtest: Property text-decoration-inset value '10%'

      assert_true: text-decoration-inset doesn't seem to be supported in the computed style expected true got false
      

    • And 5 more unexpected results...
  • TIMEOUT [expected PASS] /dom/nodes/moveBefore/moveBefore-range-iframe-crash.html
  • OK [expected TIMEOUT] /fetch/api/redirect/redirect-keepalive.https.any.html (#32153)
    • PASS [expected TIMEOUT] subtest: [keepalive][iframe][load] mixed content redirect; setting up
  • OK [expected TIMEOUT] /html/browsers/browsing-the-web/navigating-across-documents/cross-origin-top-navigation-with-user-activation-in-parent.window.html (#48205)
    • FAIL [expected TIMEOUT] subtest: Cross-origin top navigation is blocked without user activation, even if the parent has user activation

      assert_equals: expected "Denied" but got "Allowed"
      

  • OK /html/browsers/browsing-the-web/navigating-across-documents/refresh/same-document-refresh.html (#34597)
    • FAIL [expected PASS] subtest: Same-Document Referrer from Refresh

      assert_equals: original page loads expected "http://web-platform.test:8000/html/browsers/browsing-the-web/navigating-across-documents/refresh/resources/refresh-with-section.sub.html?url=%23section" but got "http://web-platform.test:8000/html/browsers/browsing-the-web/navigating-across-documents/refresh/resources/refresh-with-section.sub.html?url=%23section#section"
      

  • CRASH [expected TIMEOUT] /html/browsers/the-window-object/open-close/open-features-is-popup-condition.html?single-2
  • OK /html/semantics/embedded-content/media-elements/media_fragment_seek.html (#24114)
    • FAIL [expected PASS] subtest: Video should seek to time specified in media fragment syntax

      assert_equals: expected 3 but got 0
      

  • OK /html/semantics/forms/form-submission-0/jsurl-form-submit.tentative.html (#36489)
    • PASS [expected FAIL] subtest: Verifies that form submissions scheduled inside javascript: urls take precedence over the javascript: url's return value.
  • OK /infrastructure/testdriver/click_iframe.html (#47688)
    • FAIL [expected PASS] subtest: TestDriver click on a document in an iframe

      Unhandled rejection: assert_unreached: click failed Reached unreachable code
      

  • OK /infrastructure/testdriver/click_window.html (#47303)
    • FAIL [expected PASS] subtest: TestDriver click method in window

      Unhandled rejection: assert_unreached: click failed Reached unreachable code
      

  • FAIL [expected PASS] /mathml/presentation-markup/operators/mo-form-dynamic-002.html (#49169)
  • OK /pointerevents/compat/pointerevent_touch-action_two-finger_interaction.html
    • FAIL [expected PASS] subtest: touch two-finger pan on 'touch-action: pan-x pan-y'

      assert_equals: expected 2 but got 1
      

  • OK /pointerevents/pointerevent_pointercapture_in_frame.html?pen (#45536)
    • PASS [expected FAIL] subtest: Test penpointer capture in same-origin frame: Pointer down at inner frame and set pointer capture.
    • PASS [expected FAIL] subtest: Test penpointer capture in same-origin frame: Pointer down at inner frame and set pointer capture to outer frame should not capture.
  • OK /sanitizer-api/sanitizer-inert-document.html (#45260)
    • FAIL [expected PASS] subtest: Test whether setHTML loads the image.

      promise_test: Unhandled rejection with value: "The server observed a request. It shouldn't have."
      

    • PASS [expected FAIL] subtest: Test whether setHTMLUnsafe loads the image.
  • OK /upgrade-insecure-requests/gen/sharedworker-module-data.meta/unset/fetch.https.html
    • FAIL [expected PASS] subtest: Upgrade-Insecure-Requests: Expects blocked for fetch to cross-http-downgrade origin and downgrade redirection from https context.

      assert_equals: The resource request should be 'blocked'. expected "blocked" but got "allowed"
      

    • FAIL [expected PASS] subtest: Upgrade-Insecure-Requests: Expects blocked for fetch to cross-http-downgrade origin and no-redirect redirection from https context.

      assert_equals: The resource request should be 'blocked'. expected "blocked" but got "allowed"
      

    • FAIL [expected PASS] subtest: Upgrade-Insecure-Requests: Expects blocked for fetch to cross-https origin and downgrade redirection from https context.

      assert_equals: The resource request should be 'blocked'. expected "blocked" but got "allowed"
      

    • FAIL [expected PASS] subtest: Upgrade-Insecure-Requests: Expects blocked for fetch to same-http-downgrade origin and downgrade redirection from https context.

      assert_equals: The resource request should be 'blocked'. expected "blocked" but got "allowed"
      

    • FAIL [expected PASS] subtest: Upgrade-Insecure-Requests: Expects blocked for fetch to same-http-downgrade origin and no-redirect redirection from https context.

      assert_equals: The resource request should be 'blocked'. expected "blocked" but got "allowed"
      

    • FAIL [expected PASS] subtest: Upgrade-Insecure-Requests: Expects blocked for fetch to same-https origin and downgrade redirection from https context.

      assert_equals: The resource request should be 'blocked'. expected "blocked" but got "allowed"
      

  • OK /webdriver/tests/classic/back/user_prompts.py (#49983)
    • FAIL [expected PASS] subtest: test_accept[alert]

      AssertionError: assert 'about:blank' == 'https://web-platform.test:8443/webdriver/tests/support/inline.py?doc=%3C%21doctype+html%3E%0A%3Cmeta+charset%3DUTF-8%3E%0A%3Cp+id%3D1%3E&mime=text%2Fhtml&charset=UTF-8'
      

    • FAIL [expected PASS] subtest: test_accept_and_notify[confirm-True]

      AssertionError: assert 'about:blank' == 'https://web-platform.test:8443/webdriver/tests/support/inline.py?doc=%3C%21doctype+html%3E%0A%3Cmeta+charset%3DUTF-8%3E%0A%3Cp+id%3D2%3E&mime=text%2Fhtml&charset=UTF-8'
      

    • FAIL [expected PASS] subtest: test_ignore[beforeunload]

      webdriver.error.NoSuchElementException: no such element (404)
      

  • OK /webdriver/tests/classic/find_element/find.py
    • ERROR [expected FAIL] subtest: test_no_browsing_context

      setup error: webdriver.error.NoSuchElementException: no such element (404)
      

  • OK /webdriver/tests/classic/get_all_cookies/get.py
    • ERROR [expected FAIL] subtest: test_no_browsing_context

      setup error: webdriver.error.NoSuchElementException: no such element (404)
      

  • OK /webdriver/tests/classic/get_window_handles/get.py
    • ERROR [expected PASS] subtest: test_no_browsing_context

      setup error: webdriver.error.NoSuchElementException: no such element (404)
      

  • OK /webdriver/tests/classic/perform_actions/pointer_dblclick.py
    • FAIL [expected PASS] subtest: test_dblclick_at_coordinates[0]

      AssertionError: assert 7 == 8
      

  • OK /webdriver/tests/classic/perform_actions/pointer_mouse.py (#49662)
    • FAIL [expected PASS] subtest: test_down_closes_browsing_context[without up]

      Failed: DID NOT RAISE <class 'webdriver.error.NoSuchWindowException'>
      

  • OK /webdriver/tests/classic/switch_to_parent_frame/switch.py
    • FAIL [expected PASS] subtest: test_no_top_browsing_context

      webdriver.error.NoSuchElementException: no such element (404)
      

  • OK [expected TIMEOUT] /webstorage/localstorage-about-blank-3P-iframe-opens-3P-window.partitioned.html (#29053)
    • FAIL [expected TIMEOUT] subtest: StorageKey: test 3P about:blank window opened from a 3P iframe

      assert_true: about:blank window opened by 3P iframe does not inherit 3P iframe's StorageKey expected true got false
      

  • OK /xhr/send-redirect.htm (#32026)
    • FAIL [expected PASS] subtest: XMLHttpRequest: send() - Redirects (basics) (301, GET, content.py)

      assert_equals: expected (string) "GET" but got (object) null
      

Stable unexpected results that are known to be intermittent (9)
  • OK /css/CSS2/floats/float-in-block-in-inline-position-001.html (#49534)
    • FAIL [expected PASS] subtest: A line after a bordered block containing a float avoids it at the block's position (sibling)

      assert_equals: the line's block-axis position expected 108 but got 106.35000000000002
      

  • OK /css/CSS2/floats/floats-in-inline-content-intrinsic-size-001.html (#49728)
    • FAIL [expected PASS] subtest: An empty float next to text (emptyFloatAndText, min-content)

      assert_equals: expected 70 but got 50
      

    • FAIL [expected PASS] subtest: An empty float next to text (emptyFloatAndText, max-content)

      assert_equals: expected 160 but got 113
      

    • FAIL [expected PASS] subtest: A float takes its own min-content width under a min-content constraint and its own max-content width under a max-content one (floatWithText, min-content)

      assert_equals: expected 80 but got 48
      

  • OK [expected ERROR] /focus/focus-event-after-switching-iframes.sub.html (#40368)
  • TIMEOUT [expected OK] /html/browsers/windows/consume-user-activation/window-open-multi-global.html (#47399)
    • TIMEOUT [expected FAIL] subtest: window.open() and consuming user activation with multiple globals in play

      Test timed out
      

  • OK /html/webappapis/user-prompts/print-during-unload.html (#35944)
    • FAIL [expected PASS] subtest: print() during unload

      assert_array_equals: expected property 1 to be "destination" but got "error: window.print is not a function" (expected array ["start", "destination"] got ["start", "error: window.print is not a function"])
      

  • PASS [expected FAIL] /mathml/presentation-markup/operators/mo-lspace-rspace-dynamic.html (#49168)
  • ERROR [expected TIMEOUT] /performance-timeline/not-restored-reasons/abort-block-bfcache.window.html (#42802)
  • OK /preload/prefetch-document.html (#37210)
    • PASS [expected FAIL] subtest: different-site document prefetch with 'as=document' should not be consumed
  • OK [expected TIMEOUT] /webdriver/tests/classic/perform_actions/navigation.py (#38822)

@github-actions

Copy link
Copy Markdown

✨ Try run (#44118484016) succeeded.

@TimvdLippe TimvdLippe left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving to get CI back to stable, given the amount of intermittent webdriver tests in the other PRs. That said, I assume that Martins only concern was moving the helper and he was okay with the rest of the code. If that assumption turns out to be false, then I am sorry for that, but I am willing to take that risk in favor of stabilizing CI.

@servo-highfive servo-highfive removed the S-awaiting-review There is new code that needs to be reviewed. label Nov 17, 2026
@TimvdLippe
TimvdLippe added this pull request to the merge queue Nov 17, 2026
@servo-highfive servo-highfive added the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Nov 17, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 17, 2026
@servo-highfive servo-highfive added S-tests-failed The changes caused existing tests to fail. and removed S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. labels Nov 17, 2026
@yezhizhen
yezhizhen added this pull request to the merge queue Nov 17, 2026
@servo-highfive servo-highfive added S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. and removed S-tests-failed The changes caused existing tests to fail. labels Nov 17, 2026
@yezhizhen

yezhizhen commented Nov 17, 2026 •

Copy link
Copy Markdown
Member Author

The failure was test_largest_contentful_paint_js_api_with_mouse_click_and_reload, known as #49756 for a while.

The moving was done in second commit.

Merged via the queue into servo:main with commit 7a0e581 Nov 18, 2026
83 checks passed
@yezhizhen
yezhizhen deleted the fix-intermittent branch November 18, 2026 01:41
@servo-highfive servo-highfive removed the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Nov 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants