Skip to content

script: Also update canvas contents when laying out right after / during long parsing#37899

Merged
sagudev merged 2 commits intoservo:mainfrom
sagudev:fffff
Jul 5, 2025
Merged

script: Also update canvas contents when laying out right after / during long parsing#37899
sagudev merged 2 commits intoservo:mainfrom
sagudev:fffff

Conversation

@sagudev
Copy link
Copy Markdown
Member

@sagudev sagudev commented Jul 5, 2025

Before #37703 we were actually doing update rendering of canvases/images as part of allow_layout_if_necessary so let's keep doing that until we fix this properly as this will be much more involved and we want usable canvases in the mean time.

Testing: Manual testing + WPT tests
Fixes: #37891

@sagudev sagudev requested a review from gterzian as a code owner July 5, 2025 12:31
@sagudev sagudev added the T-linux-wpt Do a try run of the WPT label Jul 5, 2025
@github-actions github-actions bot removed the T-linux-wpt Do a try run of the WPT label Jul 5, 2025
@github-actions
Copy link
Copy Markdown

github-actions bot commented Jul 5, 2025

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

@github-actions
Copy link
Copy Markdown

github-actions bot commented Jul 5, 2025

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

Flaky unexpected result (20)
  • TIMEOUT /FileAPI/url/url-in-tags-revoke.window.html (#19978)
    • TIMEOUT [expected PASS] subtest: Fetching a blob URL immediately before revoking it works in <script> tags.

      Test timed out
      

  • FAIL [expected PASS] /_mozilla/css/dirty_viewport.html (#13731)
  • OK /_webgl/conformance/textures/misc/texture-upload-size.html (#21770)
    • 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
  • OK /css/css-cascade/layer-cssom-order-reverse.html (#36094)
    • PASS [expected FAIL] subtest: Delete layer invalidates @font-face
  • OK [expected ERROR] /fetch/fetch-later/quota/same-origin-iframe/multiple-iframes.tentative.https.window.html (#35176)
  • OK /html/browsers/browsing-the-web/navigating-across-documents/009.html (#24456)
    • PASS [expected FAIL] subtest: Link with onclick form submit to javascript url with document.write and href navigation
  • 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
  • TIMEOUT /html/browsers/history/the-history-interface/001.html (#12580)
    • FAIL [expected PASS] subtest: traversing history must also traverse hash changes

      assert_equals: (this could cause other failures later on) expected "" but got "test"
      

  • TIMEOUT [expected OK] /html/browsers/sandboxing/sandbox-initial-empty-document-toward-same-origin.html (#35948)
  • 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/document-with-fragment-nonexistent.html (#28259)
    • TIMEOUT [expected FAIL] subtest: Autofocus elements in top-level browsing context's documents with non-existent fragments should work.

      Test timed out
      

  • TIMEOUT [expected OK] /html/interaction/focus/the-autofocus-attribute/update-the-rendering.html (#24145)
    • TIMEOUT [expected FAIL] subtest: "Flush autofocus candidates" should be happen before a scroll event and animation frame callbacks

      Test timed out
      

  • OK /html/semantics/embedded-content/the-video-element/intrinsic_sizes.htm (#37173)
    • FAIL [expected PASS] subtest: default object size after src is removed

      assert_equals: expected "300px" but got "320px"
      

  • OK /html/semantics/forms/form-submission-0/form-submit-iframe-then-location-navigate.html (#29634)
    • PASS [expected FAIL] subtest: Verifies that location navigations take precedence when following form submissions.
  • 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 [expected TIMEOUT] /resource-timing/tentative/document-initiated.html (#37785)
  • TIMEOUT [expected OK] /service-workers/service-worker/detached-context.https.html
    • TIMEOUT [expected FAIL] subtest: accessing navigator.serviceWorker on a detached iframe

      Test timed out
      

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

      Test timed out
      

  • OK [expected ERROR] /workers/constructors/Worker/Worker-constructor.html (#22991)
  • 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 (18)
  • OK /FileAPI/url/url-with-fetch.any.worker.html (#21517)
    • FAIL [expected PASS] subtest: Revoke blob URL after calling fetch, fetch should succeed

      promise_test: Unhandled rejection with value: object "TypeError: Network error occurred"
      

  • FAIL [expected PASS] /_mozilla/css/stacked_layers.html (#15988)
  • FAIL [expected PASS] /_mozilla/mozilla/sslfail.html (#10760)
  • OK /_mozilla/mozilla/window_resizeTo.html (#36741)
    • PASS [expected FAIL] subtest: Correctly resize outerWidth and outerHeight
  • TIMEOUT [expected OK] /_mozilla/mozilla/window_resize_event.html (#36741)
    • TIMEOUT [expected PASS] subtest: Popup onresize event fires after resizeTo

      Test timed out
      

  • OK /css/css-fonts/variations/at-font-face-font-matching.html (#20684)
    • FAIL [expected PASS] subtest: Matching font-weight: '501' should prefer '501' over '502 510'

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

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

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

  • FAIL [expected PASS] /css/css-grid/grid-items/grid-auto-margin-and-replaced-item-001.html (#37162)
  • OK /fetch/metadata/generated/css-font-face.sub.tentative.html (#34624)
    • FAIL [expected PASS] subtest: sec-fetch-storage-access - Not sent to non-trustworthy cross-site destination

      promise_test: Unhandled rejection with value: object "Error: Failed to query for recorded headers."
      

  • OK /html/browsers/browsing-the-web/navigating-across-documents/initial-empty-document/load-pageshow-events-iframe-contentWindow.html (#28681)
    • PASS [expected FAIL] subtest: load & pageshow events do not fire on contentWindow of <iframe> element created with src=''
    • PASS [expected FAIL] subtest: load & pageshow events do not fire on contentWindow of <iframe> element created with src='about:blank'
  • 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
  • TIMEOUT /html/interaction/focus/the-autofocus-attribute/supported-elements.html (#24145)
    • PASS [expected NOTRUN] subtest: Non-HTMLElement should not support autofocus
    • TIMEOUT [expected NOTRUN] subtest: Host element with delegatesFocus should support autofocus

      Test timed out
      

  • OK [expected TIMEOUT] /html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_escaping-2.html (#22667)
    • FAIL [expected TIMEOUT] subtest: Check that popups from a sandboxed iframe escape the sandbox if allow-popups-to-escape-sandbox is used

      assert_equals: It came from a sandboxed iframe expected "null" but got "http://web-platform.test:8000"
      

  • OK [expected TIMEOUT] /html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_escaping-3.html (#24057)
    • FAIL [expected TIMEOUT] subtest: Check that popups from a sandboxed iframe escape the sandbox if allow-popups-to-escape-sandbox is used

      assert_equals: It came from a sandboxed iframe expected "null" but got "http://web-platform.test:8000"
      

  • CRASH [expected TIMEOUT] /html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_nonescaping-1.html (#24066)
  • TIMEOUT /html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_nonescaping-2.html (#22154)
    • NOTRUN [expected FAIL] subtest: Check that popups from a sandboxed iframe do not escape the sandbox
  • OK [expected TIMEOUT] /html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_nonescaping-3.html (#24066)
  • OK /preload/preload-error.sub.html (#37177)
    • FAIL [expected PASS] subtest: success (style): main

      assert_greater_than: http://web-platform.test:8000/preload/resources/dummy.css?label=style should be loaded expected a number greater than 0 but got 0
      

    • PASS [expected FAIL] subtest: 404 (script): main
    • FAIL [expected PASS] subtest: CORS (script): main

      assert_greater_than: http://not-web-platform.test:8000/preload/resources/dummy.js?pipe=header%28Access-Control-Allow-Origin%2C*%29&label=script should be loaded expected a number greater than 0 but got 0
      

    • PASS [expected FAIL] subtest: 404 (xhr): main
    • PASS [expected FAIL] subtest: CORS (xhr): main
    • FAIL [expected PASS] subtest: Decode-error (style): main

      assert_greater_than: http://web-platform.test:8000/preload/resources/dummy.xml?pipe=header%28Content-Type%2Ctext%2Fcss%29&label=style should be loaded expected a number greater than 0 but got 0
      

    • PASS [expected FAIL] subtest: MIME-error (script): main
  • OK [expected TIMEOUT] /webmessaging/without-ports/018.html (#24485)
    • PASS [expected TIMEOUT] subtest: origin of the script that invoked the method, javascript:

@github-actions
Copy link
Copy Markdown

github-actions bot commented Jul 5, 2025

✨ Try run (#16088140205) succeeded.

@sagudev sagudev requested a review from mrobinson July 5, 2025 12:56
@mrobinson mrobinson changed the title update rendering of canvases/images in allow_layout_if_necessary script: Also update canvas contents when laying out right after / during long parsing Jul 5, 2025
@sagudev sagudev added this pull request to the merge queue Jul 5, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jul 5, 2025
@sagudev sagudev added this pull request to the merge queue Jul 5, 2025
github-merge-queue bot pushed a commit that referenced this pull request Jul 5, 2025
…ing long parsing (#37899)

Before #37703 we were actually doing update rendering of canvases/images
as part of `allow_layout_if_necessary` so let's keep doing that until we
fix this properly as this will be much more involved and we want usable
canvases in the mean time.

Testing: Manual testing + WPT tests
Fixes: #37891

Signed-off-by: sagudev <[email protected]>
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jul 5, 2025
Signed-off-by: sagudev <[email protected]>
@sagudev sagudev enabled auto-merge July 5, 2025 17:35
@sagudev
Copy link
Copy Markdown
Member Author

sagudev commented Jul 5, 2025

 OK /_mozilla/mozilla/window_resizeTo.html
    PASS [expected FAIL] subtest: Correctly resize outerWidth and outerHeight

@sagudev sagudev added this pull request to the merge queue Jul 5, 2025
Merged via the queue into servo:main with commit 48cf503 Jul 5, 2025
21 checks passed
@sagudev sagudev deleted the fffff branch July 5, 2025 18:55
@yezhizhen
Copy link
Copy Markdown
Member

yezhizhen commented Jul 9, 2025

 OK /_mozilla/mozilla/window_resizeTo.html
    PASS [expected FAIL] subtest: Correctly resize outerWidth and outerHeight

Strange.. When I test this locally, it still fails before #37960
Must because I only run headed mode.

But I am curious why your change make it pass:
Before #37960, outerWidth/outerHeight are retrieved from Compositor. When you run headless mode, there is no other OS decoration to window, and the test was failing only because Resize does not change compositor info in time?

@sagudev

@sagudev
Copy link
Copy Markdown
Member Author

sagudev commented Jul 9, 2025

Strange.. When I test this locally, it still fails before #37960

You mean #37703 right? If not it might be worth to test that.

Anyway various script_thread/compositor/constellation stuff cannot be reliably tested or at least not in all configurations :(

When you run headless mode, there is no other OS decoration to window, and the test was failing only because Resize does not change compositor info in time?

That would be possible.

@yezhizhen
Copy link
Copy Markdown
Member

yezhizhen commented Jul 9, 2025

You mean #37703 right? If not it might be worth to test that.

Subtle point: #37856 is merged after #37703, which changes the test itself and changes the expectation from intermittently TIMEOUT to FAIL.

github-merge-queue bot pushed a commit that referenced this pull request Jul 10, 2025
Testing: For windows, it now passes
`/_mozilla/mozilla/window_resizeTo.html` in headless mode but fails in
headed window as expected in
#37899 (comment).

Fixes: #37973 
Fixes: #26431 
Fixes: #20365

Signed-off-by: Euclid Ye [email protected] 
Co-authored-by: Josh Matthews [email protected]

Signed-off-by: Euclid Ye <[email protected]>
Co-authored-by: Josh Matthews <[email protected]>
@sagudev sagudev self-assigned this Aug 11, 2025
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.

2d canvas is not visible

3 participants