Skip to content

layout: Split overflow calculation after fragment tree construction#37203

Merged
Loirooriol merged 1 commit intoservo:mainfrom
Loirooriol:recalculate-overflow
May 30, 2025
Merged

layout: Split overflow calculation after fragment tree construction#37203
Loirooriol merged 1 commit intoservo:mainfrom
Loirooriol:recalculate-overflow

Conversation

@Loirooriol
Copy link
Copy Markdown
Contributor

@Loirooriol Loirooriol commented May 30, 2025

Instead of computing scrollable overflow while constructing the fragment tree, we will now do it later. In the future this will also allow to only recalculate the overflow without rebuilding the tree when transform properties change, but that's left for a follow-up.

Stylo PR: servo/stylo#194

Testing: One test is now passing (more investigation is needed), but otherwise this isn't expected to have any effect.

@Loirooriol Loirooriol added A-layout/2020 https://github.com/servo/servo/wiki/Layout-2020 T-linux-wpt Do a try run of the WPT labels May 30, 2025
@github-actions github-actions bot removed the T-linux-wpt Do a try run of the WPT label May 30, 2025
@github-actions
Copy link
Copy Markdown

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

@Loirooriol Loirooriol force-pushed the recalculate-overflow branch from aaeb173 to 1843693 Compare May 30, 2025 18:26
@github-actions
Copy link
Copy Markdown

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

Flaky unexpected result (24)
  • 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/iframe/hide_and_show.html (#15265)
  • OK [expected ERROR] /fetch/fetch-later/quota/same-origin-iframe/multiple-iframes.tentative.https.window.html (#35176)
  • OK [expected ERROR] /fetch/fetch-later/quota/same-origin-iframe/oversized-payload.tentative.https.window.html (#35210)
  • OK /html/browsers/browsing-the-web/navigating-across-documents/008.html (#24456)
    • PASS [expected FAIL] subtest: Link with onclick form submit to javascript url and href navigation
  • OK /html/browsers/browsing-the-web/navigating-across-documents/initial-empty-document/iframe-nosrc.html (#34819)
    • PASS [expected FAIL] subtest: link click
  • OK /html/browsers/browsing-the-web/navigating-across-documents/initial-empty-document/load-pageshow-events-window-open.html (#28691)
    • PASS [expected FAIL] subtest: load event does not fire on window.open('about:blank')
  • OK /html/browsers/browsing-the-web/navigating-across-documents/navigation-unload-same-origin.window.html (#29049)
    • PASS [expected FAIL] subtest: Same-origin navigation started from unload handler must be ignored
  • OK /html/browsers/history/the-history-interface/traverse_the_history_4.html (#21383)
    • FAIL [expected PASS] subtest: Multiple history traversals, last would be aborted

      assert_array_equals: Pages opened during history navigation expected property 1 to be 5 but got 3 (expected array [6, 5] got [6, 3])
      

  • OK [expected ERROR] /html/canvas/element/manual/imagebitmap/createImageBitmap-drawImage.html (#32745)
  • PASS [expected FAIL] /html/canvas/element/manual/text/canvas.2d.disconnected.html (#30063)
  • TIMEOUT [expected OK] /html/interaction/focus/the-autofocus-attribute/document-with-fragment-top.html (#28259)
    • TIMEOUT [expected FAIL] subtest: Autofocus elements in top-level browsing context's documents with "top" fragments should work.

      Test timed out
      

  • OK /html/interaction/focus/the-autofocus-attribute/document-with-fragment-valid.html (#28259)
    • PASS [expected FAIL] subtest: Autofocus elements in top-level browsing context's documents with URL fragments should be skipped.
  • TIMEOUT [expected OK] /html/semantics/embedded-content/the-canvas-element/security.pattern.fillStyle.sub.html (#36989)
    • TIMEOUT [expected FAIL] subtest: redirected to same-origin HTMLVideoElement: Setting fillStyle to an origin-unclean pattern makes the canvas origin-unclean

      Test timed out
      

    • NOTRUN [expected PASS] subtest: unclean HTMLCanvasElement: Setting fillStyle to an origin-unclean pattern makes the canvas origin-unclean
    • NOTRUN [expected FAIL] subtest: unclean ImageBitmap: Setting fillStyle to an origin-unclean pattern makes the canvas origin-unclean
    • NOTRUN [expected PASS] subtest: cross-origin HTMLImageElement: Setting fillStyle to an origin-unclean offscreen canvas pattern makes the canvas origin-unclean
    • NOTRUN [expected FAIL] subtest: cross-origin SVGImageElement: Setting fillStyle to an origin-unclean offscreen canvas pattern makes the canvas origin-unclean
    • NOTRUN [expected FAIL] subtest: cross-origin HTMLVideoElement: Setting fillStyle to an origin-unclean offscreen canvas pattern makes the canvas origin-unclean
    • NOTRUN [expected FAIL] subtest: redirected to cross-origin HTMLVideoElement: Setting fillStyle to an origin-unclean offscreen canvas pattern makes the canvas origin-unclean
    • NOTRUN [expected FAIL] subtest: redirected to same-origin HTMLVideoElement: Setting fillStyle to an origin-unclean offscreen canvas pattern makes the canvas origin-unclean
    • NOTRUN [expected PASS] subtest: unclean HTMLCanvasElement: Setting fillStyle to an origin-unclean offscreen canvas pattern makes the canvas origin-unclean
    • NOTRUN [expected FAIL] subtest: unclean ImageBitmap: Setting fillStyle to an origin-unclean offscreen canvas pattern makes the canvas origin-unclean
  • OK [expected TIMEOUT] /html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_escaping-1.html (#22647)
    • 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_nonescaping-2.html (#22154)
    • FAIL [expected NOTRUN] subtest: Check that popups from a sandboxed iframe do not escape the sandbox

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

  • TIMEOUT [expected OK] /html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_nonescaping-3.html (#24066)
    • NOTRUN [expected FAIL] subtest: Check that popups from a sandboxed iframe do not escape the sandbox
  • 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 [expected TIMEOUT] /performance-timeline/navigation-id-detached-frame.tentative.html (#34773)
    • PASS [expected TIMEOUT] subtest: The navigation_id getter does not crash a window of detached frame
  • TIMEOUT /preload/preload-resource-match.https.html
    • TIMEOUT [expected FAIL] subtest: Loading script (use-credentials) with link (no-cors) should discard the preloaded response

      Test timed out
      

    • NOTRUN [expected TIMEOUT] subtest: Loading script (use-credentials) with link (anonymous) should discard the preloaded response
  • TIMEOUT [expected OK] /resource-timing/nested-context-navigations-iframe.html (#24311)
    • TIMEOUT [expected PASS] subtest: Test that crossorigin iframe navigations are not observable by the parent, even after history navigations by the parent

      Test timed out
      

    • NOTRUN [expected PASS] subtest: Test that cross-site iframe navigations are not observable by the parent, even after history navigations by the parent
    • NOTRUN [expected PASS] subtest: Test that iframe navigations are not observable by the parent
    • NOTRUN [expected PASS] subtest: Test that crossorigin iframe navigations are not observable by the parent
    • NOTRUN [expected PASS] subtest: Test that cross-site iframe navigations are not observable by the parent
    • NOTRUN [expected PASS] subtest: Test that iframe refreshes are not observable by the parent
    • NOTRUN [expected PASS] subtest: Test that crossorigin iframe refreshes are not observable by the parent
    • NOTRUN [expected PASS] subtest: Test that cross-site iframe refreshes are not observable by the parent
  • ERROR /service-workers/idlharness.https.any.html (#36250)
    • PASS [expected TIMEOUT] subtest: ServiceWorkerContainer interface: operation register((TrustedScriptURL or USVString), optional RegistrationOptions)
    • PASS [expected TIMEOUT] subtest: NavigationPreloadManager interface: operation enable()
    • PASS [expected TIMEOUT] subtest: NavigationPreloadManager interface: operation disable()
    • PASS [expected TIMEOUT] subtest: NavigationPreloadManager interface: operation setHeaderValue(ByteString)
    • PASS [expected TIMEOUT] subtest: NavigationPreloadManager interface: operation getState()
  • 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
      

Stable unexpected results that are known to be intermittent (22)
  • FAIL [expected PASS] /_mozilla/mozilla/sslfail.html (#10760)
  • TIMEOUT [expected OK] /_mozilla/mozilla/window_resizeTo.html (#36741)
    • TIMEOUT [expected PASS] subtest: Popup onresize event fires after resizeTo

      Test timed out
      

  • PASS [expected FAIL] /css/css-overflow/overflow-video.html (#34720)
  • OK /fetch/metadata/generated/css-font-face.https.sub.tentative.html (#32732)
    • PASS [expected FAIL] subtest: sec-fetch-dest
    • PASS [expected FAIL] subtest: sec-fetch-storage-access - Same site
  • TIMEOUT /fetch/metadata/redirect/multiple-redirect-https-downgrade-upgrade.sub.html (#27251)
    • PASS [expected TIMEOUT] subtest: Https downgrade-upgrade preload
  • OK [expected ERROR] /fetch/nosniff/importscripts.html (#27144)
    • PASS [expected TIMEOUT] subtest: Test importScripts()
  • OK /html/browsers/browsing-the-web/navigating-across-documents/005.html (#27062)
    • PASS [expected FAIL] subtest: Link with onclick navigation and href navigation
  • OK /html/browsers/browsing-the-web/navigating-across-documents/initial-empty-document/iframe-src-aboutblank-navigate-immediately.html (#29048)
    • FAIL [expected PASS] subtest: Navigating to a different document with form submission

      assert_equals: expected "http://web-platform.test:8000/common/blank.html?1=" but got "about:blank"
      

  • OK /html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/a-click.html (#28697)
    • FAIL [expected PASS] subtest: aElement.click() before the load event must NOT replace

      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)&code=%0A%20%20%20%20const%20a%20%3D%20document.createElement(%22a%22)%3B%0A%20%20%20%20a.href%20%3D%20%22%2Fcommon%2Fblank.html%3Fthereplacement%22%3B%0A%20%20%20%20document.currentScript.before(a)%3B%0A%20%20%20%20a.click()%3B%0A%20%20"
      

  • TIMEOUT [expected OK] /html/browsers/history/the-history-interface/001.html (#12580)
  • OK /html/browsers/history/the-history-interface/traverse_the_history_3.html (#21383)
    • FAIL [expected PASS] subtest: Multiple history traversals, last would be aborted

      assert_array_equals: Pages opened during history navigation expected property 1 to be 3 but got 1 (expected array [6, 3] got [6, 1])
      

  • TIMEOUT /html/canvas/element/manual/imagebitmap/createImageBitmap-origin.sub.html (#31931)
    • TIMEOUT [expected FAIL] subtest: cross-origin HTMLVideoElement: origin unclear 2dContext.drawImage

      Test timed out
      

    • NOTRUN [expected FAIL] subtest: cross-origin HTMLVideoElement: origin unclear bitmaprenderer.transferFromImageBitmap
    • NOTRUN [expected FAIL] subtest: redirected to cross-origin HTMLVideoElement: origin unclear getImageData
    • NOTRUN [expected FAIL] subtest: redirected to cross-origin HTMLVideoElement: origin unclear 2dContext.drawImage
    • NOTRUN [expected FAIL] subtest: redirected to cross-origin HTMLVideoElement: origin unclear bitmaprenderer.transferFromImageBitmap
    • NOTRUN [expected FAIL] subtest: redirected to same-origin HTMLVideoElement: origin unclear getImageData
    • NOTRUN [expected FAIL] subtest: redirected to same-origin HTMLVideoElement: origin unclear 2dContext.drawImage
    • NOTRUN [expected FAIL] subtest: redirected to same-origin HTMLVideoElement: origin unclear bitmaprenderer.transferFromImageBitmap
    • NOTRUN [expected FAIL] subtest: unclean HTMLCanvasElement: origin unclear getImageData
    • NOTRUN [expected FAIL] subtest: unclean HTMLCanvasElement: origin unclear 2dContext.drawImage
    • And 4 more unexpected results...
  • ERROR [expected OK] /html/canvas/element/manual/imagebitmap/createImageBitmap-serializable.html (#34120)
  • TIMEOUT /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
  • 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 [expected CRASH] /html/semantics/embedded-content/media-elements/media_fragment_seek.html (#24114)
  • OK [expected TIMEOUT] /html/semantics/embedded-content/media-elements/playing-the-media-resource/loop-from-ended.tentative.html (#33778)
    • FAIL [expected TIMEOUT] subtest: play() with loop set to true after playback ended

      this argument is not a finite floating-point value
      

  • OK /html/semantics/embedded-content/the-iframe-element/iframe-loading-lazy-reload-location-reload.html (#32595)
    • FAIL [expected PASS] subtest: Reloading iframe loading='lazy' before it is loaded: location.reload

      uncaught exception: Error: assert_equals: expected "http://web-platform.test:8000/html/semantics/embedded-content/the-iframe-element/support/blank.htm?src" but got "about:blank"
      

  • OK [expected TIMEOUT] /html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_nonescaping-1.html (#24066)
    • FAIL [expected NOTRUN] subtest: Check that popups from a sandboxed iframe do not escape the sandbox

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

  • OK /navigation-timing/test-navigation-type-reload.html (#33334)
    • FAIL [expected PASS] subtest: Reload domComplete > Original domComplete

      assert_true: Reload domComplete > Original domComplete expected true got false
      

    • FAIL [expected PASS] subtest: Reload domContentLoadedEventEnd > Original domContentLoadedEventEnd

      assert_true: Reload domContentLoadedEventEnd > Original domContentLoadedEventEnd expected true got false
      

    • FAIL [expected PASS] subtest: Reload loadEventEnd > Original loadEventEnd

      assert_true: Reload loadEventEnd > Original loadEventEnd expected true got false
      

    • FAIL [expected PASS] subtest: Reload loadEventStart > Original loadEventStart

      assert_true: Reload loadEventStart > Original loadEventStart expected true got false
      

  • OK /preload/preload-error.sub.html (#37177)
    • PASS [expected FAIL] subtest: success (style): main
    • PASS [expected FAIL] subtest: 404 (style): main
    • PASS [expected FAIL] subtest: CORS (style): main
    • PASS [expected FAIL] subtest: success (script): main
    • PASS [expected FAIL] subtest: Decode-error (script): main
    • FAIL [expected PASS] subtest: MIME-error (script): main

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

  • OK /webaudio/the-audio-api/the-audiobuffersourcenode-interface/sub-sample-buffer-stitching.html (#22849)
    • FAIL [expected PASS] subtest: X Stitched sine-wave buffers at sample rate 43800 does not equal [0,0.06264832615852356,0.12505052983760834,0.18696144223213196,0.24813786149024963,0.308339387178421,0.36732959747314453,0.4248766601085663,0.480754554271698,0.5347436666488647,0.5866320133209229,0.6362156271934509,0.6832997798919678,0.7276994585990906,0.7692402601242065,0.8077589869499207...] with an element-wise tolerance of {"absoluteThreshold":0.0038986,"relativeThreshold":0}. Index Actual Expected AbsError RelError Test threshold [14650] 1.1481978906250000e+5 8.6956524848937988e-1 1.1481891949725151e+5 1.3204175269965819e+5 3.8985999999999999e-3 [14651] 3.0547976493835449e-1 8.9879405498504639e-1 5.9331429004669189e-1 6.6012262403823208e-1 3.8985999999999999e-3 Max AbsError of 1.1481891949725151e+5 at index of 14650. Max RelError of 1.3204175269965819e+5 at index of 14650.

      assert_true: expected true got false
      

    • FAIL [expected PASS] subtest: X SNR (-57.76618316857792 dB) is not greater than or equal to 65.737. Got -57.76618316857792.

      assert_true: expected true got false
      

Stable unexpected results (1)
  • PASS [expected FAIL] /css/css-masking/clip-path/clip-path-fixed-scroll.html

@github-actions
Copy link
Copy Markdown

⚠️ Try run (#15352686462) failed.

@Loirooriol Loirooriol force-pushed the recalculate-overflow branch 2 times, most recently from 352f68b to 283ce80 Compare May 30, 2025 18:55
@Loirooriol Loirooriol marked this pull request as ready for review May 30, 2025 18:56
@Loirooriol Loirooriol requested a review from nicoburns as a code owner May 30, 2025 18:56
Instead of computing scrollable overflow while constructing the fragment
tree, we will now do it later. In the future this will also allow to
only recalculate the overflow without rebuildign the tree when transform
properties change, but that's left for a follow-up.

Signed-off-by: Oriol Brufau <[email protected]>
Co-authored-by: Martin Robinson <[email protected]>
@Loirooriol Loirooriol force-pushed the recalculate-overflow branch from 283ce80 to bc05434 Compare May 30, 2025 19:00
@Loirooriol Loirooriol enabled auto-merge May 30, 2025 19:01
@Loirooriol Loirooriol added this pull request to the merge queue May 30, 2025
Merged via the queue into servo:main with commit de2da3b May 30, 2025
21 checks passed
@Loirooriol Loirooriol deleted the recalculate-overflow branch May 30, 2025 20:34
vlindhol added a commit to vlindhol/servo that referenced this pull request Jun 1, 2025
* main: (510 commits)
  DevTools: Fix empty `debugger > source` panel (servo#37197)
  dom: implement signal abort on controller and signal (servo#37192)
  build(deps): bump parking_lot from 0.12.3 to 0.12.4 (servo#37199)
  layout: Split overflow calculation after fragment tree construction (servo#37203)
  build(deps): bump parking_lot_core from 0.9.10 to 0.9.11 (servo#37202)
  build(deps): bump lock_api from 0.4.12 to 0.4.13 (servo#37201)
  build(deps): bump cc from 1.2.24 to 1.2.25 (servo#37198)
  Constellation can now optionally report memory usage when the page is loaded. (servo#37151)
  Implement Input `type=text` UA Shadow DOM (servo#37065)
  constellation: Wait for canvas thread to shut down before shutting down system font service (servo#37182)
  Add slot default display style test (servo#37189)
  Send synthetic keydown/keyup at ime_insert_text (servo#37175)
  script: Let canvas serialization to image fail gracefully (servo#37184)
  Implement basics of link preloading (servo#37036)
  compositor: Add an initial RefreshDriver (servo#37169)
  pixels: Add limitation to max image total bytes length (servo#37172)
  Chore: Remove unused variable in `transition-zero-duration-with-delay.html` (servo#37179)
  build(deps): bump ohos-ime from 0.2.0 to 0.3.0 (servo#37180)
  Add a user agent style for the `<slot>` element (servo#37174)
  build(deps): bump hitrace from 0.1.4 to 0.1.5 (servo#37170)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-layout/2020 https://github.com/servo/servo/wiki/Layout-2020

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants