Skip to content

Conversation

@gterzian
Copy link
Member

@gterzian gterzian commented Jan 17, 2024

Implement the basic infra for the ResizeObserver Web API, and support size calculations for content boxes.


  • ./mach build -d does not report any errors
  • ./mach test-tidy does not report any errors
  • These changes fix Implement ResizeObserver  #31006 (GitHub issue number if applicable)
  • There are tests for these changes OR
  • These changes do not require tests because ___

@gterzian gterzian force-pushed the implement_resize_observer branch 2 times, most recently from 5176c1b to 1f071d3 Compare January 23, 2024 05:26
@gterzian gterzian added the T-linux-wpt Do a try run of the WPT label Jan 25, 2024
@github-actions github-actions bot removed the T-linux-wpt Do a try run of the WPT label Jan 25, 2024
@github-actions
Copy link

🔨 Triggering try run (#7655994547) with platforms=linux and layout=2020

@github-actions
Copy link

Test results for linux-wpt-layout-2020 from try job (#7655994547):

Flaky unexpected result (14)
  • CRASH [expected PASS] /_webgl/conformance/glsl/bugs/nested-functions-should-not-crash.html (#30680)
  • TIMEOUT [expected OK] /_webgl/conformance/glsl/misc/shader-with-non-reserved-words.html (#16216)
    • NOTRUN [expected PASS] subtest: Overall test
  • TIMEOUT [expected OK] /_webgl/conformance/uniforms/out-of-bounds-uniform-array-access.html (#26225)
    • NOTRUN [expected PASS] subtest: Overall test
  • OK /html/browsers/browsing-the-web/navigating-across-documents/initial-empty-document/iframe-src-aboutblank-navigate-immediately.html (#29048)
    • PASS [expected FAIL] subtest: Navigating to a different document with link click
  • OK /html/browsers/browsing-the-web/navigating-across-documents/navigate-to-unparseable-url.html (#29050)
    • FAIL [expected PASS] subtest: <a> tag navigate fails for unparseable URLs promise_test: Unhandled rejection with value: object "Error: Navigation was attempted to unparseable URL"
  • OK /html/browsers/browsing-the-web/navigating-across-documents/navigation-unload-cross-origin.sub.window.html (#29056)
    • FAIL [expected PASS] subtest: Cross-origin navigation started from unload handler must be ignored promise_test: Unhandled rejection with value: object "SecurityError: The operation is insecure."
  • OK /html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/a-click.html (#28697)
  • OK /html/browsers/history/the-history-interface/traverse_the_history_4.html (#21383)
    • PASS [expected FAIL] subtest: Multiple history traversals, last would be aborted
  • OK [expected TIMEOUT] /html/infrastructure/urls/base-url/document-base-url-window-initiator-is-not-opener.https.window.html (#30970)
  • CRASH [expected OK] /html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_escaping-1.html (#22647)
  • OK /html/semantics/forms/form-submission-0/text-plain.window.html (#28687)
    • PASS [expected FAIL] subtest: text/plain: \n in value (normal form)
  • TIMEOUT [expected OK] /html/webappapis/scripting/processing-model-2/integration-with-the-javascript-job-queue/promise-job-entry.html (#25805)
    • TIMEOUT [expected FAIL] subtest: Fulfillment handler on pending-then-fulfilled promise Test timed out
    • TIMEOUT [expected FAIL] subtest: Rejection handler on pending-then-rejected promise Test timed out
  • TIMEOUT [expected OK] /webmessaging/without-ports/018.html (#24485)
    • TIMEOUT [expected PASS] subtest: origin of the script that invoked the method, javascript: Test timed out
  • TIMEOUT [expected OK] /webstorage/localstorage-about-blank-3P-iframe-opens-3P-window.partitioned.tentative.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 (13)
  • TIMEOUT [expected OK] /_webgl/conformance/glsl/misc/shader-uniform-packing-restrictions.html (#28103)
    • NOTRUN [expected PASS] subtest: Overall test
  • OK /css/css-fonts/variations/at-font-face-font-matching.html (#20684)
    • FAIL [expected PASS] subtest: Matching font-weight: '400' should prefer '351 398' over '501 550' assert_equals: Unexpected font on test element expected 487 but got 532
    • PASS [expected FAIL] subtest: Matching font-weight: '430' should prefer '501 550' over '502 560'
    • FAIL [expected PASS] subtest: Matching font-weight: '500' should prefer '500' over '450 460' assert_equals: Unexpected font on test element expected 487 but got 532
    • 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
    • PASS [expected FAIL] subtest: Matching font-weight: '399' should prefer '450 460' over '500 501'
    • FAIL [expected PASS] subtest: Matching font-stretch: '100%' should prefer '100%' over '110% 120%' assert_equals: Unexpected font on test element expected 487 but got 532
    • FAIL [expected PASS] subtest: Matching font-stretch: '110%' should prefer '105%' over '100%' assert_equals: Unexpected font on test element expected 487 but got 532
    • FAIL [expected PASS] subtest: Matching font-style: 'normal' should prefer 'oblique 20deg 30deg' over 'oblique -50deg -20deg' assert_equals: Unexpected font on test element expected 487 but got 532
    • FAIL [expected PASS] subtest: Matching font-style: 'italic' should prefer 'oblique 30deg 60deg' over 'oblique 40deg 50deg' assert_equals: Unexpected font on test element expected 487 but got 532
    • PASS [expected FAIL] subtest: Matching font-style: 'oblique 20deg' should prefer 'italic' over 'oblique 0deg'
    • And 4 more unexpected results...
  • OK /css/cssom-view/MediaQueryList-addListener-removeListener.html (#24569)
    • FAIL [expected PASS] subtest: listeners are called correct number of times assert_equals: expected 5 but got 4
  • OK /css/cssom-view/scroll-behavior-smooth-navigation.html (#29564)
    • FAIL [expected PASS] subtest: Smooth scrolling while doing history navigation. assert_not_equals: Shouldn't be scrolled to top anymore. got disallowed value 0
  • OK [expected TIMEOUT] /html/browsers/browsing-the-web/navigating-across-documents/about-srcdoc-navigation-blocked.window.html (#31025)
  • OK /html/browsers/browsing-the-web/navigating-across-documents/empty-iframe-load-event.html (#29066)
    • PASS [expected FAIL] subtest: Check execution order on load handler
    • PASS [expected FAIL] subtest: Check execution order from nested timeout
  • OK /html/browsers/browsing-the-web/navigating-across-documents/initial-empty-document/load-pageshow-events-iframe-contentWindow.html (#28681)
    • FAIL [expected PASS] subtest: load & pageshow events do not fire on contentWindow of <iframe> element created with src='' assert_unreached: load should not be fired Reached unreachable code
  • 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_3.html (#21383)
    • PASS [expected FAIL] subtest: Multiple history traversals, last would be aborted
  • OK /html/browsers/history/the-history-interface/traverse_the_history_5.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 TIMEOUT] /html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_nonescaping-3.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 /html/semantics/forms/form-submission-0/urlencoded2.window.html (#28687)
    • FAIL [expected PASS] subtest: application/x-www-form-urlencoded: 0x00 in value (formdata event) assert_equals: expected "a=b%00c" but got ""
  • OK [expected ERROR] /workers/semantics/run-a-worker/003.html (#22765)
Stable unexpected results (3)
  • OK [expected TIMEOUT] /resize-observer/callback-cross-realm-report-exception.html
  • FAIL [expected TIMEOUT] /resize-observer/iframe-same-origin.html
  • PASS [expected TIMEOUT] /resize-observer/multiple-observers-with-mutation-crash.html

@github-actions
Copy link

⚠️ Try run (#7655994547) failed.

@gterzian gterzian force-pushed the implement_resize_observer branch from 1805dd6 to 9bf1b6b Compare January 26, 2024 03:24
@gterzian gterzian marked this pull request as ready for review January 26, 2024 04:53
@gterzian gterzian added the T-linux-wpt Do a try run of the WPT label Jan 26, 2024
@github-actions github-actions bot removed the T-linux-wpt Do a try run of the WPT label Jan 26, 2024
@github-actions
Copy link

🔨 Triggering try run (#7664120775) with platforms=linux and layout=2020

@gterzian gterzian changed the title Implement resize observer Implement ResizeObserver Jan 26, 2024
@github-actions
Copy link

Test results for linux-wpt-layout-2020 from try job (#7664120775):

Flaky unexpected result (16)
  • CRASH [expected PASS] /_webgl/conformance/glsl/bugs/long-expressions-should-not-crash.html (#19221)
  • TIMEOUT [expected OK] /_webgl/conformance/glsl/misc/shader-with-non-reserved-words.html (#16216)
    • NOTRUN [expected PASS] subtest: Overall test
  • TIMEOUT [expected OK] /_webgl/conformance/uniforms/out-of-bounds-uniform-array-access.html (#26225)
    • NOTRUN [expected PASS] subtest: Overall test
  • TIMEOUT /fetch/metadata/generated/css-images.sub.tentative.html (#29047)
    • TIMEOUT [expected PASS] subtest: background-image sec-fetch-site - HTTPS downgrade (header not sent) Test timed out
  • OK /html/browsers/browsing-the-web/navigating-across-documents/navigation-unload-cross-origin.sub.window.html (#29056)
    • FAIL [expected PASS] subtest: Cross-origin navigation started from unload handler must be ignored promise_test: Unhandled rejection with value: object "SecurityError: The operation is insecure."
  • OK /html/browsers/the-window-object/open-close/creating_browsing_context_test_01.html (#29046)
    • PASS [expected FAIL] subtest: first argument: absolute url
  • TIMEOUT [expected CRASH] /html/browsers/windows/embedded-opener-remove-frame.html (#23867)
  • TIMEOUT [expected OK] /html/interaction/focus/the-autofocus-attribute/document-with-fragment-empty.html (#28259)
    • TIMEOUT [expected FAIL] subtest: Autofocus elements in top-level browsing context's documents with empty 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.
  • OK /html/semantics/forms/form-submission-0/text-plain.window.html (#28687)
    • PASS [expected FAIL] subtest: text/plain: double quote in name (formdata event)
  • TIMEOUT [expected OK] /html/webappapis/scripting/processing-model-2/integration-with-the-javascript-job-queue/promise-job-entry.html (#25805)
    • TIMEOUT [expected FAIL] subtest: Fulfillment handler on pending-then-fulfilled promise Test timed out
    • TIMEOUT [expected FAIL] subtest: Rejection handler on pending-then-rejected promise Test timed out
  • ERROR /resource-timing/content-type-parsing.html (#29131)
    • FAIL [expected TIMEOUT] subtest: mime-type 16 : text/html;charset=�gbk assert_equals: expected (string) "text/html" but got (undefined) undefined
    • TIMEOUT [expected NOTRUN] subtest: mime-type 17 : text/html;charset= gbk Test timed out
  • TIMEOUT /resource-timing/test_resource_timing.html (#25720)
    • FAIL [expected PASS] subtest: PerformanceEntry has correct name, initiatorType, startTime, and duration (img) assert_equals: expected 6826240 but got 6826496
  • TIMEOUT /resource-timing/test_resource_timing.https.html (#25216)
    • FAIL [expected PASS] subtest: PerformanceEntry has correct name, initiatorType, startTime, and duration (img) assert_equals: expected 8497408 but got 8497152
  • TIMEOUT [expected OK] /webmessaging/without-ports/017.html (#24486)
    • TIMEOUT [expected PASS] subtest: origin of the script that invoked the method, about:blank Test timed out
  • OK [expected ERROR] /workers/semantics/run-a-worker/003.html (#22765)
Stable unexpected results that are known to be intermittent (14)
  • TIMEOUT [expected OK] /_webgl/conformance/glsl/misc/shader-uniform-packing-restrictions.html (#28103)
    • NOTRUN [expected PASS] subtest: Overall test
  • OK /css/css-fonts/variations/at-font-face-font-matching.html (#20684)
    • FAIL [expected PASS] subtest: Matching font-weight: '400' should prefer '351 398' over '501 550' assert_equals: Unexpected font on test element expected 487 but got 532
    • FAIL [expected PASS] subtest: Matching font-weight: '500' should prefer '500' over '450 460' assert_equals: Unexpected font on test element expected 487 but got 532
    • PASS [expected FAIL] subtest: Matching font-weight: '500' should prefer '351 398' over '501 550'
    • PASS [expected FAIL] subtest: Matching font-weight: '501' should prefer '501' over '502 510'
    • PASS [expected FAIL] subtest: Matching font-weight: '399' should prefer '200 300' over '400'
    • FAIL [expected PASS] subtest: Matching font-stretch: '100%' should prefer '100%' over '110% 120%' assert_equals: Unexpected font on test element expected 487 but got 532
    • FAIL [expected PASS] subtest: Matching font-stretch: '110%' should prefer '105%' over '100%' assert_equals: Unexpected font on test element expected 487 but got 532
    • PASS [expected FAIL] subtest: Matching font-stretch: '90%' should prefer '90% 100%' over '50% 80%'
    • FAIL [expected PASS] subtest: Matching font-style: 'normal' should prefer 'oblique 20deg 30deg' over 'oblique -50deg -20deg' assert_equals: Unexpected font on test element expected 487 but got 532
    • FAIL [expected PASS] subtest: Matching font-style: 'italic' should prefer 'oblique 30deg 60deg' over 'oblique 40deg 50deg' assert_equals: Unexpected font on test element expected 487 but got 532
    • And 6 more unexpected results...
  • TIMEOUT /fetch/metadata/generated/element-img-environment-change.sub.html (#30111)
    • FAIL [expected TIMEOUT] subtest: sec-fetch-site - Not sent to non-trustworthy same-site destination, no attributes promise_test: Unhandled rejection with value: object "Error: Failed to query for recorded headers."
    • TIMEOUT [expected NOTRUN] subtest: sec-fetch-site - Not sent to non-trustworthy cross-site destination, no attributes Test timed out
  • OK [expected TIMEOUT] /html/browsers/browsing-the-web/navigating-across-documents/about-srcdoc-navigation-blocked.window.html (#31025)
  • 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='about:blank#foo'
  • OK /html/browsers/browsing-the-web/navigating-across-documents/navigate-to-unparseable-url.html (#29050)
    • FAIL [expected PASS] subtest: <a> tag navigate fails for unparseable URLs promise_test: Unhandled rejection with value: object "Error: Navigation was attempted to unparseable URL"
  • OK /html/browsers/history/the-history-interface/traverse_the_history_2.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 2 (expected array [6, 3] got [6, 2])
  • OK /html/browsers/history/the-history-interface/traverse_the_history_5.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])
  • TIMEOUT [expected OK] /html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_nonescaping-1.html (#24066)
    • 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-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"
  • OK [expected TIMEOUT] /html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_nonescaping-3.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 /html/semantics/forms/form-submission-0/urlencoded2.window.html (#28687)
    • FAIL [expected PASS] subtest: application/x-www-form-urlencoded: 0x00 in value (formdata event) assert_equals: expected "a=b%00c" but got ""
  • OK [expected ERROR] /html/semantics/scripting-1/the-script-element/defer-script/async-script.html?reload (#29054)
  • TIMEOUT [expected OK] /webmessaging/without-ports/018.html (#24485)
    • TIMEOUT [expected PASS] subtest: origin of the script that invoked the method, javascript: Test timed out
Stable unexpected results (1)
  • ERROR [expected TIMEOUT] /resize-observer/observe.html
    • PASS [expected FAIL] subtest: test1: multiple observation on same element trigger only one

@github-actions
Copy link

⚠️ Try run (#7664120775) failed.

@gterzian gterzian added the T-linux-wpt Do a try run of the WPT label Jan 26, 2024
@github-actions
Copy link

🔨 Triggering try run (#7664526221) with platforms=linux and layout=2020

@github-actions github-actions bot removed the T-linux-wpt Do a try run of the WPT label Jan 26, 2024
@github-actions
Copy link

Test results for linux-wpt-layout-2020 from try job (#7664526221):

Flaky unexpected result (10)
  • TIMEOUT [expected OK] /_webgl/conformance/uniforms/out-of-bounds-uniform-array-access.html (#26225)
    • NOTRUN [expected PASS] subtest: Overall test
  • OK /css/cssom-view/scroll-behavior-smooth-navigation.html (#29564)
    • FAIL [expected PASS] subtest: Smooth scrolling while doing history navigation. assert_not_equals: Shouldn't be scrolled to top anymore. got disallowed value 0
  • 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/semantics/embedded-content/the-img-element/environment-changes/viewport-change.html (#21682)
    • PASS [expected FAIL] subtest: img (srcset 1 cand) valid image, resize to wide
  • OK /html/semantics/forms/form-submission-0/text-plain.window.html (#28687)
    • PASS [expected FAIL] subtest: text/plain: \n in name (normal form)
  • TIMEOUT [expected OK] /html/webappapis/scripting/processing-model-2/integration-with-the-javascript-job-queue/promise-job-entry-different-function-realm.html (#25805)
    • TIMEOUT [expected FAIL] subtest: Fulfillment handler on pending-then-fulfilled promise Test timed out
    • TIMEOUT [expected FAIL] subtest: Rejection handler on pending-then-rejected promise Test timed out
  • TIMEOUT [expected OK] /html/webappapis/scripting/processing-model-2/integration-with-the-javascript-job-queue/promise-job-entry.html (#25805)
    • TIMEOUT [expected FAIL] subtest: Fulfillment handler on pending-then-fulfilled promise Test timed out
    • TIMEOUT [expected FAIL] subtest: Rejection handler on pending-then-rejected promise Test timed out
  • TIMEOUT [expected OK] /webmessaging/without-ports/018.html (#24485)
    • TIMEOUT [expected PASS] subtest: origin of the script that invoked the method, javascript: Test timed out
  • ERROR [expected OK] /workers/baseurl/alpha/import-in-moduleworker.html (#21315)
Stable unexpected results that are known to be intermittent (11)
  • TIMEOUT [expected OK] /_webgl/conformance/glsl/misc/shader-uniform-packing-restrictions.html (#28103)
    • NOTRUN [expected PASS] subtest: Overall test
  • TIMEOUT [expected OK] /_webgl/conformance/glsl/misc/shader-with-non-reserved-words.html (#16216)
    • NOTRUN [expected PASS] subtest: Overall test
  • OK /css/css-fonts/variations/at-font-face-font-matching.html (#20684)
    • FAIL [expected PASS] subtest: Matching font-weight: '400' should prefer '351 398' over '501 550' assert_equals: Unexpected font on test element expected 487 but got 532
    • FAIL [expected PASS] subtest: Matching font-weight: '500' should prefer '500' over '450 460' assert_equals: Unexpected font on test element expected 487 but got 532
    • 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
    • PASS [expected FAIL] subtest: Matching font-weight: '501' should prefer '501' over '502 510'
    • FAIL [expected PASS] subtest: Matching font-stretch: '100%' should prefer '100%' over '110% 120%' assert_equals: Unexpected font on test element expected 487 but got 532
    • FAIL [expected PASS] subtest: Matching font-stretch: '110%' should prefer '105%' over '100%' assert_equals: Unexpected font on test element expected 487 but got 532
    • FAIL [expected PASS] subtest: Matching font-style: 'normal' should prefer 'oblique 20deg 30deg' over 'oblique -50deg -20deg' assert_equals: Unexpected font on test element expected 487 but got 532
    • FAIL [expected PASS] subtest: Matching font-style: 'italic' should prefer 'oblique 30deg 60deg' over 'oblique 40deg 50deg' assert_equals: Unexpected font on test element expected 487 but got 532
    • PASS [expected FAIL] subtest: Matching font-style: 'italic' should prefer 'oblique 5deg 10deg' over 'oblique 5deg'
    • PASS [expected FAIL] subtest: Matching font-style: 'oblique 20deg' should prefer 'oblique 20deg' over 'oblique 30deg 60deg'
    • And 8 more unexpected results...
  • OK [expected TIMEOUT] /html/browsers/browsing-the-web/navigating-across-documents/about-srcdoc-navigation-blocked.window.html (#31025)
  • OK /html/browsers/browsing-the-web/navigating-across-documents/initial-empty-document/load-pageshow-events-iframe-contentWindow.html (#28681)
    • FAIL [expected PASS] subtest: load & pageshow events do not fire on contentWindow of <iframe> element created with src='' assert_unreached: load should not be fired Reached unreachable code
  • OK /html/browsers/browsing-the-web/navigating-across-documents/navigate-to-unparseable-url.html (#29050)
    • FAIL [expected PASS] subtest: <a> tag navigate fails for unparseable URLs promise_test: Unhandled rejection with value: object "Error: Navigation was attempted to unparseable URL"
  • OK /html/browsers/browsing-the-web/read-media/pageload-image-in-popup.html (#23849)
    • PASS [expected FAIL] subtest: The document for a standalone media file should have one child in the body.
  • CRASH [expected OK] /html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_escaping-2.html (#22667)
  • OK /html/semantics/forms/form-submission-0/urlencoded2.window.html (#28687)
    • FAIL [expected PASS] subtest: application/x-www-form-urlencoded: 0x00 in value (formdata event) assert_equals: expected "a=b%00c" but got ""
  • TIMEOUT /html/webappapis/scripting/events/compile-event-handler-settings-objects.html (#24246)
    • FAIL [expected PASS] subtest: The entry settings object while executing the compiled callback via Web IDL's invoke must be that of the node document assert_equals: expected "/html/webappapis/scripting/events/resources/open-window.html" but got "blank"
  • TIMEOUT /resource-timing/test_resource_timing.https.html (#25216)
    • FAIL [expected PASS] subtest: PerformanceEntry has correct name, initiatorType, startTime, and duration (img) assert_equals: expected 20185856 but got 20185600
Stable unexpected results (2)
  • OK /resize-observer/change-layout-in-error.html
    • FAIL [expected PASS] subtest: Changing layout in window error handler should not result in lifecyle loop when resize observer loop limit is reached. assert_equals: expected 1 but got 2
  • ERROR [expected TIMEOUT] /resize-observer/observe.html

@github-actions
Copy link

⚠️ Try run (#7664526221) failed.

@gterzian gterzian requested review from emilio, jdm and mrobinson January 26, 2024 07:14
@gterzian
Copy link
Member Author

gterzian commented Jan 26, 2024

Those two appear to be intermittent, how do I mark them as such again? EDIT: updated meta, they fail all the time. See filed issue.

I have filed an issue for tests that are still failing: #31182

The base case appears to work, there are some failures which appears related to the delivery of rafs(used in the tests),

@gterzian gterzian added the T-linux-wpt Do a try run of the WPT label Jan 29, 2024
@github-actions github-actions bot removed the T-linux-wpt Do a try run of the WPT label Jan 29, 2024
@github-actions
Copy link

⚠️ Try run (#7692638213) failed.

@gterzian gterzian added the T-linux-wpt Do a try run of the WPT label Jan 29, 2024
@github-actions github-actions bot removed the T-linux-wpt Do a try run of the WPT label Jan 29, 2024
Copy link
Member

@jdm jdm left a comment

Choose a reason for hiding this comment

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

Looks great! Thanks!

@gterzian gterzian enabled auto-merge June 6, 2024 11:33
@gterzian
Copy link
Member Author

gterzian commented Jun 6, 2024

@mrobinson I think the PR needs an approval from you as well. I have addressed your suggestions at the time, but I haven't added the additional layout calculations because I think it's a good follow-up(see comment above).

let mut shallowest = ResizeObservationDepth::max();
// Breaking potential re-borrow cycle on `resize_observers`:
// broadcasting resize observations calls into a JS callback,
// which can add new obeservers.
Copy link
Contributor

Choose a reason for hiding this comment

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

Typo: observers

.pop()
.unwrap_or_else(|| Rect::zero())
},
// TODO#31182): add support for border box, and device pixel size, calculations.
Copy link
Contributor

Choose a reason for hiding this comment

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

Missing (

Copy link
Member Author

Choose a reason for hiding this comment

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

Thank you.

@gterzian
Copy link
Member Author

gterzian commented Jun 11, 2024

@mrobinson @Loirooriol Thanks for the additional comments.

Device_pixel_content_box should snap to device pixels.
Also, bounding_content_box_or_zero is the wrong choice if there are multiple fragments, we don't want the bounding rect. As per the current spec it should just be the 1st fragment, with the idea of extending to an array with all fragments in the future.

I'm not sure if I have addressed this comment, but as per the latest, I am using the content_boxes API for the content box(first fragment only) calculations, and I am not handling border boxes or device pixel.

@Loirooriol can you please confirm?

See the relevant part of the code: https://github.com/servo/servo/pull/31108/files#diff-2a44f61a5e5b7cf6b7a47e74a04dbec244b81507f0517bdc92484ba58e6e90c6R263

Also @mrobinson I think this needs your explicit approval for it to merge, since you have requested changes before.

@gterzian gterzian disabled auto-merge June 13, 2024 10:21
Copy link
Member

@mrobinson mrobinson left a comment

Choose a reason for hiding this comment

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

Just a couple nits, but I don't see any big issues with this change. Hopefully we can land it in the next couple days. Sorry for the big delays!

}
let _ = self
.callback
.Call__(entries, self, ExceptionHandling::Report);
Copy link
Member

Choose a reason for hiding this comment

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

Should this only happen when the size changes? I'm a bit unclear on the mechanism here because is_active() checks to see if the size has changed, but it seems this code both updates the size and then calls the resize observer callbacks. I don't see how the code avoids that if the size changes.

It also seems like is_active() is calculating the size but not caching it anywhere...meaning it updates here as well. It's not a cheap calculating right now, unfortunately, so that seems a little wasteful. Perhaps I misunderstand this code though...?

Copy link
Member Author

Choose a reason for hiding this comment

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

Should this only happen when the size changes?

This only happens for active observations, so that means size has changed plus observation depth is right. The code here does not update the size.

It's not a cheap calculating right now, unfortunately, so that seems a little wasteful.

I have added a caching mechanism, see the last commit.

@gterzian gterzian requested a review from mrobinson June 14, 2024 10:22
@gterzian gterzian force-pushed the implement_resize_observer branch 3 times, most recently from c59a74b to 68013c6 Compare June 14, 2024 10:25
@mrobinson
Copy link
Member

@gterzian Looks good, though please squash your changes before landing or else the commit message will contain a lot of noise. Thanks you!

@gterzian gterzian force-pushed the implement_resize_observer branch from 68013c6 to 68e30d5 Compare June 17, 2024 10:07
@gterzian gterzian enabled auto-merge June 17, 2024 10:08
@gterzian
Copy link
Member Author

@Loirooriol @jdm @mrobinson thank you for your reviews.

@gterzian gterzian added this pull request to the merge queue Jun 17, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jun 17, 2024
@gterzian gterzian force-pushed the implement_resize_observer branch 2 times, most recently from 8b72b78 to 78f606a Compare June 17, 2024 15:41
@gterzian gterzian force-pushed the implement_resize_observer branch from 78f606a to 8a04803 Compare June 17, 2024 16:16
@gterzian gterzian enabled auto-merge June 17, 2024 16:19
@gterzian gterzian added this pull request to the merge queue Jun 17, 2024
Merged via the queue into servo:main with commit 3d78d60 Jun 17, 2024
@gterzian gterzian deleted the implement_resize_observer branch June 17, 2024 18:56
@gterzian gterzian changed the title Implement ResizeObserver infra, support content box calculatons. Implement ResizeObserver infra, support content box calculations. Jun 18, 2024
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.

Implement ResizeObserver

5 participants