Skip to content

script: Replace initial about:blank document - #46975

Merged
jdm merged 22 commits into
servo:mainfrom
jdm:timer-push-down
Aug 20, 2026
Merged

jdm merged 22 commits into
servo:mainfrom
jdm:timer-push-down

Conversation

@jdm

@jdm jdm commented Aug 4, 2026 •

Copy link
Copy Markdown
Member

These changes move away from the 1:1 model for windows and documents and implement initial about:blank document replacement. This means that the concept of a global's active document becomes meaningful, so we need to be more careful about verifying that a particular document is actually relevant in various operations.

Testing: Many new passing tests.
Fixes: part of #43149
Fixes: #44521
Fixes: #28691
Fixes: #24145
Fixes: #28684

@jdm

jdm commented Aug 4, 2026

Copy link
Copy Markdown
Member Author

This is a draft right now because the change introduces a number of new intermittent results that we need to figure out how to address. Latest try push: https://github.com/servo/servo/actions/runs/30235058042

@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.

Seems like document.domain is a good area to investigate as a follow-up. However, since that's API already has plenty of other issues, I don't consider that blocking.

My comments are mostly to make links to the spec more explicit and for my own understanding of how things are tied together.

Mostly looking good, let's see what the state of affairs is after #46988

Comment thread components/script/dom/window/window.rs Outdated
LayoutValue::new(self.layout_marker.borrow().clone(), value)
}

pub(crate) fn prepare_for_document_replacement(

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.

This looks to vaguely match https://html.spec.whatwg.org/multipage/nav-history-apis.html#set-up-a-window-environment-settings-object While it isn't a full match, since the window already exists, it does perform similar steps as is done in the spec

If you agree, lets add it in the doc and name it set_up_a_window_environment_settings_object.

self.top_level_creation_url.borrow().clone()
}

pub(crate) fn set_top_level_creation_url(&self, url: ServoUrl) {

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.

If I understand the spec correctly, it doesn't differentiate between top-level documents and child documents. Therefore, that would mean that the top_level_creation_url shouldn't change. I understand that for now this is required to set it after the initial replacement, but ideally we remove this setter to make top_level_creation_url immutable. Can you add a TODO for that?

@@ -1,31 +1,12 @@
[inheriting-csp-for-local-schemes.html]

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.

Love this

pull Bot pushed a commit to Haofei/servo that referenced this pull request Aug 4, 2026
…s. (servo#46988)

The initial about:blank document is intended to be synchronously
available. Our current implementation is too tied to our asynchronous
navigation infrastructure, and this gets in the way of the work
happening in servo#46975. This change removes one source of intermittent
failures due to timing when a test attempts to navigate the initial
about:blank shortly after it is created—when the constellation observes
that there is a pending navigation approval for the about:blank, it will
silently discard any navigation attempt for the pipeline. I expect to
revisit this later after we have decoupled about:blank from our
asynchronous navigation infrastructure.

Testing: Not observable behaviour within WPT except via timing changes
in tests that involve navigating about:blank iframes/windows.
Fixes: part of servo#43149

---------

Signed-off-by: Josh Matthews <[email protected]>
niyabits pushed a commit to niyabits/servo that referenced this pull request Aug 5, 2026
…s. (servo#46988)

The initial about:blank document is intended to be synchronously
available. Our current implementation is too tied to our asynchronous
navigation infrastructure, and this gets in the way of the work
happening in servo#46975. This change removes one source of intermittent
failures due to timing when a test attempts to navigate the initial
about:blank shortly after it is created—when the constellation observes
that there is a pending navigation approval for the about:blank, it will
silently discard any navigation attempt for the pipeline. I expect to
revisit this later after we have decoupled about:blank from our
asynchronous navigation infrastructure.

Testing: Not observable behaviour within WPT except via timing changes
in tests that involve navigating about:blank iframes/windows.
Fixes: part of servo#43149

---------

Signed-off-by: Josh Matthews <[email protected]>
@jdm

jdm commented Aug 6, 2026

Copy link
Copy Markdown
Member Author

@jdm

jdm commented Aug 8, 2026

Copy link
Copy Markdown
Member Author

Seems like document.domain is a good area to investigate as a follow-up. However, since that's API already has plenty of other issues, I don't consider that blocking.

That's all #44669.

@jdm jdm added the T-linux-wpt Do a try run of the WPT label Aug 8, 2026
@github-actions github-actions Bot removed the T-linux-wpt Do a try run of the WPT label Aug 8, 2026
@github-actions

github-actions Bot commented Aug 8, 2026

Copy link
Copy Markdown

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

@github-actions

github-actions Bot commented Aug 8, 2026

Copy link
Copy Markdown

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

Flaky unexpected result (38)
  • CRASH [expected OK] /_mozilla/mozilla/focus-scroll-when-visible.html
  • TIMEOUT [expected OK] /_webgl/conformance/extensions/oes-texture-float-linear.html
    • NOTRUN [expected PASS] subtest: Overall test
  • OK /_webgl/conformance/textures/misc/texture-upload-size.html (#21770)
    • PASS [expected FAIL] subtest: WebGL test #45
    • PASS [expected FAIL] subtest: WebGL test #47
    • PASS [expected FAIL] subtest: WebGL test #49
    • PASS [expected FAIL] subtest: WebGL test #51
    • PASS [expected FAIL] subtest: WebGL test #61
    • PASS [expected FAIL] subtest: WebGL test #63
    • PASS [expected FAIL] subtest: WebGL test #65
    • PASS [expected FAIL] subtest: WebGL test #67
    • FAIL [expected PASS] subtest: WebGL test #69

      assert_true: Texture was smaller than the expected size 2x2 expected true got false
      

    • FAIL [expected PASS] subtest: WebGL test #71

      assert_true: getError expected: INVALID_VALUE. Was NO_ERROR : when calling texSubImage2D with the same texture upload with offset 1, 1 expected true got false
      

    • And 6 more unexpected results...
  • CRASH [expected OK] /_webgl/conformance/uniforms/no-over-optimization-on-uniform-array-06.html
  • CRASH [expected OK] /_webgl/conformance/uniforms/no-over-optimization-on-uniform-array-14.html
  • CRASH [expected OK] /_webgl/conformance/uniforms/no-over-optimization-on-uniform-array-16.html
  • CRASH [expected OK] /_webgl/conformance2/wasm/readpixels-2gb-in-4gb-wasm-memory.html
  • OK /beacon/beacon-basic.https.window.html (#41723)
    • FAIL [expected PASS] subtest: Payload size restriction should be accumulated: type = arraybuffer

      assert_false: expected false got true
      

    • FAIL [expected PASS] subtest: Payload size restriction should be accumulated: type = blob

      assert_false: expected false got true
      

  • FAIL [expected PASS] /css/css-backgrounds/background-size-042.html
  • OK /css/css-fonts/variations/at-font-face-font-matching.html (#20684)
    • FAIL [expected PASS] subtest: Matching font-weight: '500' should prefer '400' over '350 399'

      assert_equals: Unexpected font on test element expected 487 but got 532
      

    • FAIL [expected PASS] subtest: Matching font-style: 'oblique 20deg' should prefer 'oblique 40deg 50deg' over 'oblique 10deg'

      assert_equals: Unexpected font on test element expected 487 but got 532
      

    • FAIL [expected PASS] subtest: Matching font-style: 'oblique 10deg' should prefer 'oblique -50deg -20deg' over 'oblique -40deg -30deg'

      assert_equals: Unexpected font on test element expected 487 but got 532
      

  • CRASH [expected OK] /dom/nodes/NodeList-static-length-getter-tampered-indexOf-3.html
  • TIMEOUT [expected CRASH] /editing/whitespaces/chrome-compat/inserttext.tentative.html
  • TIMEOUT [expected OK] /fetch/content-encoding/br/big-br-body.https.any.html
    • TIMEOUT [expected PASS] subtest: large br data should be decompressed successfully

      Test timed out
      

    • NOTRUN [expected FAIL] subtest: large br data should be decompressed successfully with byte stream
  • TIMEOUT [expected OK] /fetch/content-encoding/gzip/big-gzip-body.https.any.worker.html
    • TIMEOUT [expected PASS] subtest: large gzip data should be decompressed successfully

      Test timed out
      

    • NOTRUN [expected FAIL] subtest: large gzip data should be decompressed successfully with byte stream
  • OK /fetch/h1-parsing/h1-parsing.tentative.html?include=after-value
    • FAIL [expected PASS] subtest: SP at &lt;after-value&gt; should fetch without an error

      promise_test: Unhandled rejection with value: object "TypeError: Network error: HTTP failure: client error (SendRequest)"
      

  • OK /html/browsers/browsing-the-web/navigating-across-documents/navigation-unload-cross-origin.sub.window.html (#29056)
    • PASS [expected FAIL] subtest: Cross-origin navigation started from unload handler must be ignored
  • OK /html/browsers/browsing-the-web/navigating-across-documents/navigation-unload-same-origin-fragment.html (#20768)
    • PASS [expected FAIL] subtest: Tests that a fragment navigation in the unload handler will not block the initial navigation
  • 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"
      

  • OK /html/browsers/history/the-history-interface/traverse_the_history_2.html (#21383)
    • PASS [expected FAIL] subtest: Multiple history traversals, last would be aborted
  • TIMEOUT [expected ERROR] /html/browsers/history/the-location-interface/location_replace_session_history.html (#41896)
  • TIMEOUT /html/semantics/embedded-content/media-elements/autoplay-disabled-by-permissions-policy.https.sub.html (#46012, #46804)
    • PASS [expected TIMEOUT] subtest: Permissions-Policy header: autoplay "none" has no effect on the top level document.
    • TIMEOUT [expected FAIL] subtest: Permissions-Policy header: autoplay "none" disallows same-origin iframes.

      Test timed out
      

  • TIMEOUT /html/semantics/embedded-content/media-elements/preserves-pitch.html (#40352)
    • PASS [expected TIMEOUT] subtest: Speed-ups should not change the pitch when preservesPitch=true
    • TIMEOUT [expected NOTRUN] subtest: Slow-downs should not change the pitch when preservesPitch=true

      Test timed out
      

  • OK [expected TIMEOUT] /html/semantics/embedded-content/media-elements/src_object_blob.html (#40340)
    • PASS [expected TIMEOUT] subtest: HTMLMediaElement.srcObject blob
  • TIMEOUT [expected OK] /html/semantics/embedded-content/media-elements/track/track-element/track-cues-seeking.html (#46789)
    • TIMEOUT [expected FAIL] subtest: TextTrack's activeCues are indexed and updated during video playback

      Test timed out
      

  • TIMEOUT [expected OK] /html/semantics/embedded-content/the-iframe-element/iframe_sandbox_navigate_other_frame_popup.sub.html (#39702)
    • TIMEOUT [expected FAIL] subtest: Sandboxed iframe can not navigate other frame's popup

      Test timed out
      

  • TIMEOUT [expected OK] /html/syntax/parsing/html5lib_write.html?file=tests1 (#46224)
    • TIMEOUT [expected PASS] subtest: &lt;!COM--MENT&gt;

      Test timed out
      

    • TIMEOUT [expected PASS] subtest: &lt;b&gt;&lt;p&gt;&lt;/b&gt;TEST

      Test timed out
      

    • TIMEOUT [expected PASS] subtest: &lt;!DOCTYPE html&gt;&lt;title&gt;U-test&lt;/title&gt;&lt;body&gt;&lt;div&gt;&lt;p&gt;Test&lt;u&gt;&lt;/p&gt;&lt;/div&gt;&lt;/body&gt;

      Test timed out
      

  • ERROR [expected OK] /intersection-observer/v2/animated-opacity.html (#40827)
  • OK /mixed-content/tentative/autoupgrades/audio-upgrade.https.sub.html (#41697)
    • FAIL [expected PASS] subtest: Audio autoupgraded

      assert_equals: Length expected 1 but got Infinity
      

  • ERROR [expected TIMEOUT] /performance-timeline/not-restored-reasons/abort-block-bfcache.window.html (#42802)
  • TIMEOUT [expected OK] /pointerevents/compat/pointerevent_touch-action_two-finger_interaction.html (#44693)
    • NOTRUN [expected PASS] subtest: touch two-finger pan on 'touch-action: pan-x pan-y'
    • NOTRUN [expected FAIL] subtest: touch two-finger pan on 'touch-action: pinch-zoom'
  • OK /preload/prefetch-document.html (#37210)
    • FAIL [expected PASS] subtest: different-site document prefetch with 'as=document' should not be consumed

      assert_equals: expected 2 but got 1
      

  • OK /resize-observer/observer-in-cross-origin-frame.sub.html
    • FAIL [expected PASS] subtest: Cross-origin observer responds to explicitly set physical size

      assert_equals: expected 200 but got 284
      

  • 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.
  • CRASH [expected OK] /svg/animations/animate-calcMode-spline-from-by.html
  • CRASH [expected OK] /trusted-types/TrustedTypePolicyFactory-createPolicy-unenforced.html
  • TIMEOUT /trusted-types/trusted-types-navigation.html?26-30 (#38807)
    • PASS [expected TIMEOUT] subtest: Navigate a window via form-submission with javascript:-urls in report-only mode.
    • PASS [expected NOTRUN] subtest: Navigate a window via form-submission with javascript:-urls w/ default policy in report-only mode.
    • PASS [expected NOTRUN] subtest: Navigate a frame via form-submission with javascript:-urls in enforcing mode.
    • TIMEOUT [expected NOTRUN] subtest: Navigate a frame via form-submission with javascript:-urls w/ default policy in enforcing mode.

      Test timed out
      

  • OK /uievents/order-of-events/mouse-events/mousemove-between.html
    • FAIL [expected PASS] subtest: Mousemove events between elements should fire in the correct order.

      assert_true: expected true got false
      

  • CRASH [expected OK] /webstorage/storage_session_setitem_quotaexceedederr.window.html
Stable unexpected results that are known to be intermittent (22)
  • OK [expected TIMEOUT] /_mozilla/mozilla/window-resize-event.html (#36741)
    • PASS [expected TIMEOUT] subtest: Popup onresize event fires after resizeTo
  • FAIL [expected PASS] /css/css-sizing/dynamic-available-size-iframe.html (#45763)
  • OK /dom/nodes/moveBefore/iframe-document-preserve.window.html (#43152)
    • PASS [expected FAIL] subtest: moveBefore(): cross-origin iframe is preserved: remove new parent
    • PASS [expected FAIL] subtest: moveBefore(): cross-origin iframe is preserved: remove self
  • TIMEOUT /fetch/metadata/generated/css-images.sub.tentative.html (#29047)
    • TIMEOUT [expected PASS] subtest: background-image sec-fetch-mode - Not sent to non-trustworthy cross-site destination

      Test timed out
      

    • FAIL [expected PASS] subtest: content sec-fetch-storage-access - Not sent to non-trustworthy same-site destination

      assert_unreached: Reached unreachable code
      

  • OK /html/browsers/browsing-the-web/navigating-across-documents/initial-empty-document/iframe-src-204.html (#44521)
    • FAIL [expected PASS] subtest: about:blank on top of 204 loads async

      assert_equals: expected "complete" but got "interactive"
      

  • OK [expected TIMEOUT] /html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/form-requestsubmit.html (#44098)
    • FAIL [expected TIMEOUT] subtest: Replace before load, triggered by formElement.requestSubmit()

      assert_equals: expected "http://web-platform.test:8000/common/blank.html?thereplacement=" but got "http://web-platform.test:8000/html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/resources/code-injector.html?pipe=sub(none)&amp;code=%0A%20%20%20%20const%20form%20%3D%20document.createElement(%22form%22)%3B%0A%20%20%20%20form.action%20%3D%20%22%2Fcommon%2Fblank.html%22%3B%0A%0A%20%20%20%20const%20input%20%3D%20document.createElement(%22input%22)%3B%0A%20%20%20%20input.type%20%3D%20%22hidden%22%3B%0A%20%20%20%20input.name%20%3D%20%22thereplacement%22%3B%0A%20%20%20%20form.append(input)%3B%0A%0A%20%20%20%20document.currentScript.before(form)%3B%0A%20%20%20%20form.requestSubmit()%3B%0A%20%20"
      

  • TIMEOUT /html/browsers/history/the-history-interface/001.html (#12580)
    • PASS [expected FAIL] subtest: traversing history must also traverse hash changes
  • OK /html/browsers/history/the-history-interface/traverse_the_history_5.html (#21383)
    • PASS [expected FAIL] subtest: Multiple history traversals, last would be aborted
  • OK /html/browsers/windows/embedded-opener-remove-frame.html (#23867)
    • PASS [expected FAIL] subtest: opener of discarded auxiliary browsing context
  • TIMEOUT [expected OK] /html/infrastructure/urls/base-url/document-base-url-window-initiator-is-not-opener.https.window.html (#30970)
  • TIMEOUT [expected OK] /html/interaction/focus/the-autofocus-attribute/autofocus-dialog.html (#29087)
  • TIMEOUT [expected OK] /html/interaction/focus/the-autofocus-attribute/supported-elements.html (#24145)
    • TIMEOUT [expected FAIL] subtest: Element with tabindex should support autofocus

      Test timed out
      

    • NOTRUN [expected PASS] subtest: Non-HTMLElement should not support autofocus
    • NOTRUN [expected FAIL] subtest: Host element with delegatesFocus should support autofocus
    • NOTRUN [expected FAIL] subtest: Host element with delegatesFocus including no focusable descendants should be skipped
    • NOTRUN [expected FAIL] subtest: Area element should support autofocus
  • CRASH [expected OK] /html/semantics/embedded-content/the-iframe-element/iframe-loading-lazy-reload-location-reload.html (#32595)
  • OK /html/semantics/scripting-1/the-script-element/execution-timing/077.html (#22139)
    • FAIL [expected PASS] subtest: adding several types of scripts through the DOM and removing some of them confuses scheduler

      assert_array_equals: expected property 1 to be "Script #1 ran" but got "Script #3 ran" (expected array ["Script #2 ran", "Script #1 ran", "Script #3 ran", "Script #4 ran"] got ["Script #2 ran", "Script #3 ran", "Script #4 ran", "Script #1 ran"])
      

  • OK /html/webappapis/dynamic-markup-insertion/opening-the-input-stream/remove-initial-about-blankness.window.html (#28684)
    • PASS [expected FAIL] subtest: Double-check: without document.open(), Window reuse indeed happens
  • OK /html/webappapis/user-prompts/print-during-unload.html (#35944)
    • PASS [expected FAIL] subtest: print() during unload
  • OK [expected TIMEOUT] /infrastructure/testdriver/click_nested.html (#43887)
    • FAIL [expected NOTRUN] subtest: TestDriver click method with multiple windows and nested iframe

      Unhandled rejection: assert_unreached: click failed Reached unreachable code
      

  • OK /largest-contentful-paint/image-upscaling.html (#47080)
    • PASS [expected FAIL] subtest: An upscaled image (width/height) should report the natural size
    • PASS [expected FAIL] subtest: A background image smaller than the container should report the natural size
  • OK /paint-timing/with-lcp/fcp-document-opacity-image.html (#43068)
    • FAIL [expected PASS] subtest: Test that FCP after opacity change is not a larger value than LCP

      assert_equals: First contentful paint marked too early.  expected 0 but got 1
      

  • OK /pointerevents/pointerevent_pointercapture_in_frame.html?pen (#45536)
    • FAIL [expected PASS] subtest: Test penpointer capture in same-origin frame: Pointer down at inner frame and set pointer capture.

      assert_true: Timed out waiting for lostpointercapture expected true got false
      

    • FAIL [expected PASS] subtest: Test penpointer capture in same-origin frame: Pointer down at inner frame and set pointer capture to outer frame should not capture.

      assert_array_equals: Received events: innerFrame received pointerdown,innerFrame received pointermove,innerFrame received pointerup,innerFrame received lostpointercapture lengths differ, expected array ["innerFrame received pointerdown", "innerFrame received pointermove", "innerFrame received pointerup"] length 3, got ["innerFrame received pointerdown", "innerFrame received pointermove", "innerFrame received pointerup", "innerFrame received lostpointercapture"] length 4
      

  • OK /pointerevents/pointerevent_pointercapture_in_frame.html?touch (#45445)
    • FAIL [expected PASS] subtest: Test touchpointer capture in same-origin frame: Pointer down at inner frame and set pointer capture.

      assert_true: Timed out waiting for lostpointercapture expected true got false
      

  • OK [expected TIMEOUT] /trusted-types/trusted-types-navigation.html?31-35 (#38034)
    • PASS [expected TIMEOUT] subtest: Navigate a frame via form-submission with javascript:-urls in report-only mode.
    • PASS [expected NOTRUN] subtest: Navigate a frame via form-submission with javascript:-urls w/ default policy in report-only mode.
    • FAIL [expected NOTRUN] subtest: Navigate a window via form-submission with javascript:-urls w/ a default policy throwing an exception in enforcing mode.

      promise_test: Unhandled rejection with value: "Unexpected message received: \"No securitypolicyviolation reported!\""
      

    • FAIL [expected NOTRUN] subtest: Navigate a window via form-submission with javascript:-urls w/ a default policy throwing an exception in report-only mode.

      promise_test: Unhandled rejection with value: "Unexpected message received: \"No securitypolicyviolation reported!\""
      

    • FAIL [expected NOTRUN] subtest: Navigate a window via form-submission with javascript:-urls w/ a default policy making the URL invalid in enforcing mode.

      promise_test: Unhandled rejection with value: "Unexpected message received: \"No securitypolicyviolation reported!\""
      

Stable unexpected results (8)
  • TIMEOUT /content-security-policy/navigation/to-javascript-parent-initiated-child-csp.html
    • TIMEOUT [expected NOTRUN] subtest: Should not have executed the javascript URL for iframe.contentWindow.location.href with child's CSP "script-src 'none'"

      Test timed out
      

    • NOTRUN [expected TIMEOUT] subtest: Should not have executed the javascript URL for iframe.src with child's CSP "script-src 'none'"
    • NOTRUN [expected TIMEOUT] subtest: Should not have executed the javascript URL for iframe.src with child's CSP "script-src 'none'"
  • TIMEOUT [expected PASS] /css/css-fonts/downloadable-font-scoped-to-document.html
  • OK /html/browsers/browsing-the-web/navigating-across-documents/013.html
    • FAIL [expected PASS] subtest: Link with onclick navigation to javascript url with delayed document.write and href navigation

      assert_array_equals: lengths differ, expected array ["after script", "javascript"] length 2, got ["after script"] length 1
      

  • OK /html/browsers/browsing-the-web/navigating-across-documents/014.html
    • FAIL [expected PASS] subtest: Link with javascript onclick form submission script order

      assert_array_equals: lengths differ, expected array ["after script", "submit"] length 2, got ["after script"] length 1
      

  • OK /html/browsers/browsing-the-web/navigating-across-documents/015.html
    • FAIL [expected PASS] subtest: Link with javascript onclick and href script order

      assert_array_equals: lengths differ, expected array ["click", "after script", "href"] length 3, got ["click", "after script"] length 2
      

  • TIMEOUT [expected OK] /html/browsers/browsing-the-web/navigating-across-documents/javascript-url-abort/javascript-url-abort-return-value-undefined.tentative.html
    • TIMEOUT [expected PASS] subtest: Not aborting fetch for javascript:undefined navigation

      Test timed out
      

  • OK [expected TIMEOUT] /navigation-timing/response-start-after-coop-bcg-switch.https.html
    • FAIL [expected TIMEOUT] subtest: Navigation responseStart is not clamped to zero after a cross-origin COOP browsing context group switch

      assert_true: Not expecting event, but got load event expected true got false
      

  • TIMEOUT [expected OK] /trusted-types/inheriting-csp-for-local-schemes.html
    • TIMEOUT [expected FAIL] subtest: require-trusted-types-for directive should be inherited in local data frames

      Test timed out
      

    • NOTRUN [expected FAIL] subtest: trusted-types directive should be inherited in local data frames
    • NOTRUN [expected FAIL] subtest: require-trusted-types-for directive should be inherited in local blob frames
    • NOTRUN [expected FAIL] subtest: trusted-types directive should be inherited in local blob frames
    • NOTRUN [expected PASS] subtest: require-trusted-types-for directive should be inherited in local about:blank frames
    • NOTRUN [expected PASS] subtest: trusted-types directive should be inherited in local about:blank frames
    • NOTRUN [expected PASS] subtest: require-trusted-types-for directive should not be inherited in local blank.html frames
    • NOTRUN [expected PASS] subtest: trusted-types directive should not be inherited in local blank.html frames

@github-actions

github-actions Bot commented Aug 8, 2026

Copy link
Copy Markdown

⚠️ Try run (#31258915992) failed!

@jdm

jdm commented Aug 10, 2026

Copy link
Copy Markdown
Member Author

I'm pretty sure the intermittent /trusted-types/inheriting-csp-for-local-schemes.html timeout comes from the missing postMessage behaviour that @TimvdLippe and I have run into at different times.

@jdm

jdm commented Aug 10, 2026

Copy link
Copy Markdown
Member Author

/navigation-timing/response-start-after-coop-bcg-switch.https.html happens because the current changes in this PR cause window.open("page.html") to dispatch two load events: one for about:blank, and one for page.html. I'm testing changes that inhibit this as part of #47050.

@TimvdLippe

Copy link
Copy Markdown
Contributor

@jdm

jdm commented Aug 10, 2026

Copy link
Copy Markdown
Member Author

Yes, but there's failing the test for test-related reasons and failing the test for completely unrelated reasons, and right now we're doing the second one.

@jdm jdm added the T-linux-wpt Do a try run of the WPT label Aug 10, 2026
@github-actions github-actions Bot removed the T-linux-wpt Do a try run of the WPT label Aug 10, 2026
@github-actions

Copy link
Copy Markdown

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

@github-actions

Copy link
Copy Markdown

⚠️ Try run (#31421301561) failed!

janeoa pushed a commit to janeoa/servo that referenced this pull request Aug 11, 2026
)

In preparation for servo#46975, we need to ensure that we don't expose an
outdated font context if the document is replaced. This fixes a timeout
exposed by servo#46975.

Testing: No behaviour change expected; existing tests suffice.
Part of servo#43149

Signed-off-by: Josh Matthews <[email protected]>
@jdm

jdm commented Aug 15, 2026

Copy link
Copy Markdown
Member Author

The big new set of test timeouts is related to this behaviour change:

<script>
  events = 0;
  function doload() {
      console.log("load event");
      events += 1;
      if (events == 1) {
          setTimeout(() => {
              frame.contentDocument.open();
              frame.contentDocument.write("hi");
              frame.contentDocument.close();
          }, 0);
      }
  }
</script>
<iframe id=frame onload="doload()"></iframe>

In Firefox/old Servo this gives two load events, but in this PR it only gives one.

@TimvdLippe

Copy link
Copy Markdown
Contributor

With the state machine for the load event, it can only fire once. Should we reset the state machine to the initial state when document.write has finished?

@jdm

jdm commented Aug 16, 2026 •

Copy link
Copy Markdown
Member Author

I am delighted to report that removing some of our complex iframe load event code fixes the timeouts in each test I have checked while maintaining the expected number of iframe load events.

Try run: https://github.com/jdm/servo/actions/runs/31956519005

@github-actions

Copy link
Copy Markdown

✨ Try run (#32323029446) succeeded.

@TimvdLippe

Copy link
Copy Markdown
Contributor

Let's go ahead and merge this?

@mrobinson mrobinson left a comment

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.

This looks like a big improvement, but the new failures related to document.domain still look a bit scary.

@servo-highfive servo-highfive removed the S-awaiting-review There is new code that needs to be reviewed. label Aug 20, 2026
@jdm
jdm added this pull request to the merge queue Aug 20, 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 Aug 20, 2026
Merged via the queue into servo:main with commit ea54c00 Aug 20, 2026
73 checks passed
@jdm
jdm deleted the timer-push-down branch August 20, 2026 11:58
@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 Aug 20, 2026
@servo-highfive

Copy link
Copy Markdown

Someone thinks this change could be added to the monthly blog post! To help with this, we need someone to answer the following questions: 😄

  1. Who is most impacted by this change: users, Servo developers, embedders, or some other group?
  2. What observable difference does this change make?
  3. What preferences (if any) need to be enabled to observe this difference?
  4. What (if any) specific URLs are affected?

If this change is part of a broader feature/project please make sure the PR description contains a Fixes: #12345 or Part of: #12345 issue reference.

Please add @servo-highfive monthly update answer when answering these questions so the bot notices your answer (or just quote this comment).

Thanks for helping us prepare the monthly blog post! ❤️

@TimvdLippe

Copy link
Copy Markdown
Contributor
  1. Servo developers

  2. For years, Servo has battled intermittency in test results as a result of iframe loading inconsistencies. During day-to-day browsing of the web, this would not have a major impact. However, for Servo as a project, these inconsistencies led to long-standing annoyances and longer merge times as a result. That's because web platform features are tested with web-platform-tests. These tests commonly use <iframe> to test a particular feature. When iframe loading is inconsistent, a test for a completely different web platform feature could therefore exhibit flakiness. This led to reduced confidence and lack of clarity about which features Servo supports and which would require more work.

    This PR is the culmination of months of work to improve various parts of navigation code to make this PR possible. In doing so, we made significant improvements to deterministically load webpages, improve spec-compliance and also found various spec bugs along the way. Now, Servo correctly loads an initial about:blank document and then replaces it with the actual page that would be requested by <iframe src="mywebpage.html">. Many tests now run stably and every preceding PR brought us closer to stability. While we are not there yet, this PR is the biggest milestone in years on improving <iframe> compliance.

  3. n/a

  4. n/a

@servo-highfive monthly update answer

@jdm

jdm commented Aug 20, 2026

Copy link
Copy Markdown
Member Author

This also affects users—any pages using window.open usually were broken, because any onload event would fire long before the actual page loaded.

TimvdLippe added a commit to TimvdLippe/servo that referenced this pull request Aug 21, 2026
This is a reland of servo#46059 which now reliably works
thanks to the changes in servo#46975.

The tests that I updated I all verified locally that
they run correct with `--repeat-until-unexpected` for
at least 20 runs.

Signed-off-by: Tim van der Lippe <[email protected]>
TimvdLippe added a commit to TimvdLippe/servo that referenced this pull request Aug 23, 2026
This is a reland of servo#46059 which now reliably works
thanks to the changes in servo#46975.

The tests that I updated I all verified locally that
they run correct with `--repeat-until-unexpected` for
at least 20 runs.

Signed-off-by: Tim van der Lippe <[email protected]>
TimvdLippe added a commit to TimvdLippe/servo that referenced this pull request Aug 23, 2026
This is a reland of servo#46059 which now reliably works
thanks to the changes in servo#46975.

The tests that I updated I all verified locally that
they run correct with `--repeat-until-unexpected` for
at least 20 runs.

Signed-off-by: Tim van der Lippe <[email protected]>
TimvdLippe added a commit to TimvdLippe/servo that referenced this pull request Aug 26, 2026
This is a reland of servo#46059 which now reliably works
thanks to the changes in servo#46975.

The tests that I updated I all verified locally that
they run correct with `--repeat-until-unexpected` for
at least 20 runs.

Signed-off-by: Tim van der Lippe <[email protected]>
mrobinson pushed a commit to TimvdLippe/servo that referenced this pull request Aug 27, 2026
This is a reland of servo#46059 which now reliably works
thanks to the changes in servo#46975.

The tests that I updated I all verified locally that
they run correct with `--repeat-until-unexpected` for
at least 20 runs.

Signed-off-by: Tim van der Lippe <[email protected]>
mrobinson pushed a commit to TimvdLippe/servo that referenced this pull request Aug 27, 2026
This is a reland of servo#46059 which now reliably works
thanks to the changes in servo#46975.

The tests that I updated I all verified locally that
they run correct with `--repeat-until-unexpected` for
at least 20 runs.

Signed-off-by: Tim van der Lippe <[email protected]>
drtychai pushed a commit to drtychai/servo that referenced this pull request Aug 27, 2026
This is a reland of servo#46059 which now reliably works thanks to the
changes in servo#46975. The tests that I updated I all verified locally that
they run correct with `--repeat-until-unexpected` for at least 20 runs.

Testing: new WPT passes
Fixes: Part of servo#46859

---------

Signed-off-by: Tim van der Lippe <[email protected]>
Co-authored-by: Martin Robinson <[email protected]>
RichardTjokroutomo pushed a commit to RichardTjokroutomo/servo that referenced this pull request Oct 6, 2026
…s. (servo#46988)

The initial about:blank document is intended to be synchronously
available. Our current implementation is too tied to our asynchronous
navigation infrastructure, and this gets in the way of the work
happening in servo#46975. This change removes one source of intermittent
failures due to timing when a test attempts to navigate the initial
about:blank shortly after it is created—when the constellation observes
that there is a pending navigation approval for the about:blank, it will
silently discard any navigation attempt for the pipeline. I expect to
revisit this later after we have decoupled about:blank from our
asynchronous navigation infrastructure.

Testing: Not observable behaviour within WPT except via timing changes
in tests that involve navigating about:blank iframes/windows.
Fixes: part of servo#43149

---------

Signed-off-by: Josh Matthews <[email protected]>
RichardTjokroutomo pushed a commit to RichardTjokroutomo/servo that referenced this pull request Oct 6, 2026
)

In preparation for servo#46975, we need to ensure that we don't expose an
outdated font context if the document is replaced. This fixes a timeout
exposed by servo#46975.

Testing: No behaviour change expected; existing tests suffice.
Part of servo#43149

Signed-off-by: Josh Matthews <[email protected]>
RichardTjokroutomo pushed a commit to RichardTjokroutomo/servo that referenced this pull request Oct 6, 2026
…nceTiming (servo#47289)

servo#46975 exposes a case where the navigation timing information for
documents in iframes is incorrect, because PerformanceTiming is
initialized with the timing information for about:blank. We can avoid
this by always returning timing information derived from the global's
active document instead.

Testing: No behaviour change possible before servo#46975, and this change
fixes failures exposed in that PR.
Part of servo#43149

Signed-off-by: Josh Matthews <[email protected]>
RichardTjokroutomo pushed a commit to RichardTjokroutomo/servo that referenced this pull request Oct 6, 2026
These changes move away from the 1:1 model for windows and documents and
implement initial about:blank document replacement. This means that the
concept of a global's active document becomes meaningful, so we need to
be more careful about verifying that a particular document is actually
relevant in various operations.

Testing: Many new passing tests.
Fixes: part of servo#43149
Fixes: servo#44521
Fixes: servo#28691
Fixes: servo#24145
Fixes: servo#28684

---------

Signed-off-by: Josh Matthews <[email protected]>
RichardTjokroutomo pushed a commit to RichardTjokroutomo/servo that referenced this pull request Oct 6, 2026
This is a reland of servo#46059 which now reliably works thanks to the
changes in servo#46975. The tests that I updated I all verified locally that
they run correct with `--repeat-until-unexpected` for at least 20 runs.

Testing: new WPT passes
Fixes: Part of servo#46859

---------

Signed-off-by: Tim van der Lippe <[email protected]>
Co-authored-by: Martin Robinson <[email protected]>
Psychpsyo pushed a commit to Psychpsyo/servo that referenced this pull request Oct 12, 2026
This is a reland of servo#46059 which now reliably works thanks to the
changes in servo#46975. The tests that I updated I all verified locally that
they run correct with `--repeat-until-unexpected` for at least 20 runs.

Testing: new WPT passes
Fixes: Part of servo#46859

---------

Signed-off-by: Tim van der Lippe <[email protected]>
Co-authored-by: Martin Robinson <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment