Skip to content

script: Update source set synchronously for <img> style computation - #48790

Merged
TimvdLippe merged 1 commit into
servo:mainfrom
TimvdLippe:source-synchronous-update
Oct 11, 2026
Merged

TimvdLippe merged 1 commit into
servo:mainfrom
TimvdLippe:source-synchronous-update

Conversation

@TimvdLippe

Copy link
Copy Markdown
Contributor

This is required for computing dimensions of an <img> which tests expect to be available synchronously when adding a <source> to a <picture>. However, the spec didn't account for this, despite browsers running this logic synchronously:
whatwg/html#8207

Therefore, by updating the source set before we queue a task, the style information is immediately available while the rest of the logic is maintained.

Part of #48603

Testing: new WPT tests passes

This is required for computing dimensions of an `<img>` which tests
expect to be available synchronously when adding a `<source>` to a
`<picture>`. However, the spec didn't account for this, despite browsers
running this logic synchronously:
whatwg/html#8207

Therefore, by updating the source set before we queue a task, the style
information is immediately available while the rest of the logic is
maintained.

Part of servo#48603

Testing: new WPT tests passes

Signed-off-by: Tim van der Lippe <[email protected]>
@TimvdLippe
TimvdLippe requested a review from gterzian as a code owner October 10, 2026 08:03
@TimvdLippe TimvdLippe added the T-linux-wpt Do a try run of the WPT label Oct 10, 2026
@servo-highfive servo-highfive added the S-awaiting-review There is new code that needs to be reviewed. label Oct 10, 2026
@github-actions github-actions Bot removed the T-linux-wpt Do a try run of the WPT label Oct 10, 2026
@github-actions

Copy link
Copy Markdown

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

}
}

// TODO(https://github.com/whatwg/html/issues/8207): Add spec step once spec is aligned

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Spec fix: whatwg/html#13057

@TimvdLippe TimvdLippe changed the title script: Update source set synchronously for style computation script: Update source set synchronously for <img> style computation Oct 10, 2026
@github-actions

Copy link
Copy Markdown

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

Flaky unexpected result (18)
  • TIMEOUT [expected OK] /IndexedDB/idb-partitioned-coverage.sub.html
    • TIMEOUT [expected PASS] subtest: - advance

      Test timed out
      

    • TIMEOUT [expected PASS] subtest: - fresh continue still async

      Test timed out
      

    • TIMEOUT [expected FAIL] subtest: Get bound range (generated) with maxCount

      Test timed out
      

    • TIMEOUT [expected FAIL] subtest: maxCount=0

      Test timed out
      

    • TIMEOUT [expected FAIL] subtest: Query with empty range where lowerBound &lt; last key

      Test timed out
      

    • TIMEOUT [expected FAIL] subtest: Retrieve multiEntry key

      Test timed out
      

    • TIMEOUT [expected FAIL] subtest: Retrieve one key multiple values

      Test timed out
      

    • TIMEOUT [expected FAIL] subtest: Get all values with invalid query keys

      Test timed out
      

    • TIMEOUT [expected PASS] subtest: IDBObjectStore.openKeyCursor() - forward iteration

      Test timed out
      

    • TIMEOUT [expected PASS] subtest: IDBObjectStore.openKeyCursor() - reverse iteration

      Test timed out
      

    • And 3 more unexpected results...
  • CRASH [expected OK] /_webgl/conformance/glsl/bugs/sampler-struct-function-arg.html
  • FAIL [expected PASS] /css/css-backgrounds/background-size-042.html
  • OK /dom/nodes/moveBefore/iframe-document-preserve.window.html (#43152)
    • FAIL [expected PASS] subtest: moveBefore(): cross-origin iframe is preserved: remove new parent

      assert_equals: iframe does not fire a second load event expected 1 but got 0
      

  • TIMEOUT /html/browsers/history/the-history-interface/001.html (#12580)
    • PASS [expected FAIL] subtest: traversing history must also traverse hash changes
  • CRASH [expected OK] /html/browsers/history/the-location-interface/assign-replace-from-iframe.html (#47679)
  • 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 [expected TIMEOUT] /html/semantics/embedded-content/media-elements/autoplay-disabled-by-permissions-policy.https.sub.html (#46012, #46804)
    • FAIL [expected TIMEOUT] subtest: Permissions-Policy header: autoplay "none" disallows same-origin iframes.

      assert_false: autoplay expected false got true
      

  • 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.
  • CRASH [expected FAIL] /html/semantics/interestfor/interestfor-plain-inline-element.tentative.html
  • TIMEOUT [expected OK] /html/user-activation/navigation-state-reset-sameorigin.html (#45151)
    • TIMEOUT [expected FAIL] subtest: Post-navigation state reset.

      Test timed out
      

  • TIMEOUT [expected OK] /html/user-activation/propagation-sameorigin.html
    • NOTRUN [expected PASS] subtest: Propagation test
  • OK /html/webappapis/user-prompts/print-during-unload.html (#35944)
    • PASS [expected FAIL] subtest: print() during unload
  • TIMEOUT [expected OK] /pointerevents/compat/pointerevent_touch-action_two-finger_interaction.html
    • 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 /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 /webdriver/tests/classic/element_click/scroll_into_view.py
    • FAIL [expected PASS] subtest: test_partially_visible_does_not_scroll[4]

      assert 0 == 1
      

  • OK /webdriver/tests/classic/execute_async_script/properties.py
    • FAIL [expected PASS] subtest: test_content_attribute

      AssertionError: script timeout (500)
      

  • 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
      

Stable unexpected results that are known to be intermittent (10)
  • 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-overflow/scrollable-overflow-textarea.html (#47563)
    • PASS [expected FAIL] subtest: #textarea 1
  • OK /html/browsers/browsing-the-web/navigating-across-documents/navigation-unload-same-origin-fragment.html (#20768)
    • FAIL [expected PASS] subtest: Tests that a fragment navigation in the unload handler will not block the initial navigation

      assert_equals: expected "" but got "#fragment"
      

  • OK /html/browsers/browsing-the-web/navigating-across-documents/refresh/same-document-refresh.html (#34597)
    • PASS [expected FAIL] subtest: Same-Document Referrer from Refresh
  • CRASH [expected OK] /html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/location-setter-user-mouseup.html (#48744)
  • TIMEOUT [expected OK] /html/semantics/embedded-content/media-elements/autoplay-allowed-by-permissions-policy.https.sub.html (#46803)
    • TIMEOUT [expected PASS] subtest: Permissions-Policy header: autoplay * allows the top-level document.

      Test timed out
      

    • TIMEOUT [expected PASS] subtest: Permissions-Policy header: autoplay * allows same-origin iframes.

      Test timed out
      

  • OK /resource-timing/test_resource_timing.html (#25720)
    • PASS [expected FAIL] subtest: PerformanceEntry has correct name, initiatorType, startTime, and duration (iframe)
    • PASS [expected FAIL] subtest: PerformanceEntry has correct name, initiatorType, startTime, and duration (script)
  • OK /resource-timing/test_resource_timing.https.html (#25216)
    • FAIL [expected PASS] subtest: PerformanceEntry has correct name, initiatorType, startTime, and duration (link)

      assert_equals: expected 8.189999999999998 but got 8.19
      

  • OK /sanitizer-api/sanitizer-inert-document.html (#45260)
    • PASS [expected FAIL] subtest: Test whether setHTML loads the image.
    • FAIL [expected PASS] subtest: Test whether setHTMLUnsafe loads the image.

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

  • OK /webdriver/tests/classic/element_click/single_tick.py (#48249)
    • FAIL [expected PASS] subtest: test_element_click_dispatches_actions_in_a_single_tick

      assert not True
      

@github-actions

Copy link
Copy Markdown

✨ Try run (#38036571146) succeeded.

@servo-highfive servo-highfive removed the S-awaiting-review There is new code that needs to be reviewed. label Oct 11, 2026
@TimvdLippe
TimvdLippe added this pull request to the merge queue Oct 11, 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 Oct 11, 2026
Merged via the queue into servo:main with commit 13b7443 Oct 11, 2026
102 of 104 checks passed
@TimvdLippe
TimvdLippe deleted the source-synchronous-update branch October 11, 2026 12:15
@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 Oct 11, 2026
hhhwsqhhh pushed a commit to hhhwsqhhh/servo that referenced this pull request Oct 12, 2026
…servo#48790)

This is required for computing dimensions of an `<img>` which tests
expect to be available synchronously when adding a `<source>` to a
`<picture>`. However, the spec didn't account for this, despite browsers
running this logic synchronously:
whatwg/html#8207

Therefore, by updating the source set before we queue a task, the style
information is immediately available while the rest of the logic is
maintained.

Part of servo#48603

Testing: new WPT tests passes

Signed-off-by: Tim van der Lippe <[email protected]>
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.

3 participants