E53E servoshell: Consider window decorations when handling resize requests from web content by yezhizhen · Pull Request #38174 · servo/servo · GitHub
[go: up one dir, main page]

Skip to content

Conversation

yezhizhen
Copy link
Member
@yezhizhen yezhizhen commented Jul 19, 2025

Also fix some docs. This is used by JS resizeTo, resizeBy and webdriver set window rect.

Testing: Can now pass more tests for headed window.
Fixes: Well.. Originally the attempt is to address #38093 (comment). But it turns out as a more general problem to be fixed in another PR.

@yezhizhen yezhizhen requested a review from atbrakhi as a code owner July 19, 2025 13:32
@yezhizhen yezhizhen changed the title servoshell: Considering toolbar height when resizing servoshell: Consider toolbar height when resizing Jul 19, 2025
@yezhizhen yezhizhen added the T-linux-wpt Do a try run of the WPT label Jul 19, 2025
@github-actions github-actions bot removed the T-linux-wpt Do a try run of the WPT label Jul 19, 2025
Copy link

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

Copy link

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

Flaky unexpected result (17)
  • OK /css/css-cascade/layer-cssom-order-reverse.html (#36094)
    • FAIL [expected PASS] subtest: Delete layer invalidates @font-face

      assert_equals: expected "220px" but got "133px"
      

  • OK /css/css-fonts/generic-family-keywords-001.html (#37467)
    • PASS [expected FAIL] subtest: @font-face matching for quoted and unquoted generic(khmer-mul)
  • TIMEOUT [expected FAIL] /dom/xslt/large-cdata.html (#38029)
  • CRASH [expected OK] /fetch/security/embedded-credentials.tentative.sub.html
  • 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/initial-empty-document/load-pageshow-events-window-open.html (#28691)
    • FAIL [expected PASS] subtest: load event does not fire on window.open('about:blank')

      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)
    • FAIL [expected PASS] subtest: Same-origin navigation started from unload handler must be ignored

      assert_equals: expected "?pass" but got "?fail"
      

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

      Test timed out
      

  • OK /html/browsers/history/the-history-interface/traverse_the_history_2.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)
    • PASS [expected FAIL] subtest: Multiple history traversals, last would be aborted
  • 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"
      

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

      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/scripting-1/the-script-element/module/dynamic-import/blob-url.any.html (#33948)
    • FAIL [expected PASS] subtest: Revoking a blob URL immediately after calling import will not fail

      promise_test: Unhandled rejection with value: object "TypeError: Dynamic import failed"
      

  • OK /resize-observer/change-layout-in-error.html (#32629)
    • PASS [expected FAIL] subtest: Changing layout in window error handler should not result in lifecyle loop when resize observer loop limit is reached.
  • 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()
Stable unexpected results that are known to be intermittent (23)
  • FAIL [expected PASS] /_mozilla/css/stacked_layers.html (#15988)
  • FAIL [expected PASS] /_mozilla/mozilla/sslfail.html (#10760)
  • TIMEOUT [expected OK] /_mozilla/mozilla/window_resize_event.html (#36741)
    • TIMEOUT [expected PASS] subtest: Popup onresize event fires after resizeTo

      Test timed out
      

  • FAIL [expected PASS] /css/css-transitions/render-blocking/no-transition-from-ua-to-blocking-stylesheet.html (#29187)
  • ERROR [expected TIMEOUT] /fetch/fetch-later/quota/same-origin-iframe/max-payload.tentative.https.window.html (#35210)
  • OK [expected ERROR] /fetch/fetch-later/quota/same-origin-iframe/multiple-iframes.tentative.https.window.html (#35176)
  • OK /fetch/metadata/generated/css-font-face.https.sub.tentative.html (#32732)
    • PASS [expected FAIL] subtest: sec-fetch-user
    • PASS [expected FAIL] subtest: sec-fetch-storage-access - Same site
  • 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/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'
  • 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/interaction/focus/the-autofocus-attribute/supported-elements.html (#24145)
    • FAIL [expected NOTRUN] subtest: Host element with delegatesFocus including no focusable descendants should be skipped

      assert_equals: expected Element node <input autofocus=""></input> but got Element node <body></body>
      

    • FAIL [expected NOTRUN] subtest: Area element should support autofocus

      promise_test: Unhandled rejection with value: object "TypeError: w.document.querySelector(...) is null"
      

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

      Test timed out
      

  • OK [expected CRASH] /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/historical.html (#28568)
    • FAIL [expected PASS] subtest: <input name=isindex> should not be supported

      assert_regexp_match: expected object "/\?isindex=x$/" but got "about:blank"
      

  • OK /navigation-timing/test-navigation-type-reload.html (#33334)
    • PASS [expected FAIL] subtest: Reload domComplete > Original domComplete
    • PASS [expected FAIL] subtest: Reload domContentLoadedEventEnd > Original domContentLoadedEventEnd
    • PASS [expected FAIL] subtest: Reload domContentLoadedEventStart > Original domContentLoadedEventStart
    • PASS [expected FAIL] subtest: Reload domInteractive > Original domInteractive
    • PASS [expected FAIL] subtest: Reload fetchStart > Original fetchStart
    • PASS [expected FAIL] subtest: Reload loadEventEnd > Original loadEventEnd
    • PASS [expected FAIL] subtest: Reload loadEventStart > Original loadEventStart
  • 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 /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
      

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

      assert_greater_than: http://not-web-platform.test:8000/preload/resources/dummy.css?pipe=header%28Access-Control-Allow-Origin%2C*%29&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
      

    • FAIL [expected PASS] subtest: Decode-error (script): main

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

  • TIMEOUT /preload/preload-resource-match.https.html (#38088)
    • FAIL [expected TIMEOUT] subtest: Loading script (anonymous) with link (no-cors) should discard the preloaded response

      assert_equals: https://www1.web-platform.test:8443/preload/resources/echo-with-cors.py?type=application%2Fjavascript&content=function%20dummy()%20%7B%20%7D&uid=58e189b7-affc-4c03-b82c-ee358281dc8c&9b6d2cd7-4ce2-4d42-8f93-10e92013f1c9 expected 2 but got 1
      

    • PASS [expected NOTRUN] subtest: Loading script (anonymous) with link (anonymous) should reuse the preloaded response
    • FAIL [expected NOTRUN] subtest: Loading script (anonymous) with link (use-credentials) should discard the preloaded response

      assert_equals: https://www1.web-platform.test:8443/preload/resources/echo-with-cors.py?type=application%2Fjavascript&content=function%20dummy()%20%7B%20%7D&uid=58e189b7-affc-4c03-b82c-ee358281dc8c&171bc729-776c-4658-9bd0-ec04b57d720f expected 2 but got 1
      

    • FAIL [expected NOTRUN] subtest: Loading script (use-credentials) with link (no-cors) should discard the preloaded response

      assert_equals: https://www1.web-platform.test:8443/preload/resources/echo-with-cors.py?type=application%2Fjavascript&content=function%20dummy()%20%7B%20%7D&uid=58e189b7-affc-4c03-b82c-ee358281dc8c&9faf5326-ee50-4409-98d2-08f6c323e8ca expected 2 but got 1
      

    • TIMEOUT [expected NOTRUN] subtest: Loading script (use-credentials) with link (anonymous) should discard the preloaded response

      Test timed out
      

  • TIMEOUT [expected ERROR] /streams/writable-streams/write.https.any.shadowrealm-in-audioworklet.html (#36349)
  • TIMEOUT [expected CRASH] /trusted-types/trusted-types-navigation.html?06-10 (#37920)
  • TIMEOUT [expected ERROR] /wasm/jsapi/table/type.tentative.https.any.shadowrealm-in-audioworklet.html (#36349)
  • TIMEOUT [expected OK] /webaudio/the-audio-api/the-analysernode-interface/test-analysernode.html (#36350)
  • TIMEOUT [expected OK] /webmessaging/with-ports/018.html (#24485)
    • TIMEOUT [expected PASS] subtest: origin of the script that invoked the method, javascript:

      Test timed out
      

Stable unexpected results (1)
  • TIMEOUT [expected ERROR] /streams/writable-streams/bad-strategies.https.any.shadowrealm-in-audioworklet.html

Copy link

⚠️ Try run (#16390150893) failed.

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.

Looks good with some minor requests here. I would say this is less about the toolbar height and more about taking into account window decorations when resizing.

self.inner().rect
}

/// Update Compositor's [`WebViewRenderer`] rect and notify repaint.
Copy link
Member

Choose a reason for hiding this comment

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

I don't think we should talk about internal concepts like the "Compositor" in the public documentation. FWIW, the "Compositor" is misnamed as it doesn't work like a normal web engine compositor any longer, so the name will need to change eventually. I think for now we can omit the documentation and write it at a later time.

@mrobinson mrobinson changed the title servoshell: Consider toolbar height when resizing servoshell: Consider window decorations when handling resize requests from web content Jul 23, 2025
Signed-off-by: Euclid Ye <euclid.ye@huawei.com>
@yezhizhen yezhizhen force-pushed the improve-script-resize-to branch from 52ac7b2 to c0e9006 Compare July 23, 2025 14:42
@yezhizhen yezhizhen requested a review from mrobinson July 23, 2025 14:43
Signed-off-by: Euclid Ye <euclid.ye@huawei.com>
@mrobinson mrobinson force-pushed the improve-script-resize-to branch from c0e9006 to ebb5709 Compare July 24, 2025 05:08
@mrobinson mrobinson enabled auto-merge July 24, 2025 05:08
@mrobinson mrobinson added this pull request to the merge queue Jul 24, 2025
Merged via the queue into servo:main with commit 0b8986c Jul 24, 2025
21 checks passed
@yezhizhen yezhizhen deleted the improve-script-resize-to branch July 24, 2025 06:36
github-merge-queue bot pushed a commit that referenced this pull request Jul 29, 2025
They are redundant as marked in #38174 as rendering related rect already
updated in `minibrowser::update`. As a result, we are able to remove
`window_rendering_context` and `inner_size` fields from `struct Window`.

Testing: No regression/behaviour change in all tests running with headed
window.
Fixes:
#38255 (comment)

Signed-off-by: Euclid Ye <euclid.ye@huawei.com>
uthmaniv pushed a commit to uthmaniv/servo that referenced this pull request Jul 29, 2025
)

They are redundant as marked in servo#38174 as rendering related rect already
updated in `minibrowser::update`. As a result, we are able to remove
`window_rendering_context` and `inner_size` fields from `struct Window`.

Testing: No regression/behaviour change in all tests running with headed
window.
Fixes:
servo#38255 (comment)

Signed-off-by: Euclid Ye <euclid.ye@huawei.com>
minghuaw pushed a commit to minghuaw/servo that referenced this pull request Aug 1, 2025
)

They are redundant as marked in servo#38174 as rendering related rect already
updated in `minibrowser::update`. As a result, we are able to remove
`window_rendering_context` and `inner_size` fields from `struct Window`.

Testing: No regression/behaviour change in all tests running with headed
window.
Fixes:
servo#38255 (comment)

Signed-off-by: Euclid Ye <euclid.ye@huawei.com>
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.

2 participants
0