Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename ComputedValuesExt::establishes_containing_block #29644

Merged

Conversation

mrobinson
Copy link
Member

This renames the helper method to be a bit more accurate. For elements with static, relative, and sticky positioning, their containing block is always formed by their nearest block container ancestor. This method is really dealing with style that means an element will establish a containing block for absolutely positioned descendants.


  • ./mach build -d does not report any errors
  • ./mach test-tidy does not report any errors
  • These changes do not require tests because they do not change behavior.

@mrobinson mrobinson added the A-layout/2020 https://github.com/servo/servo/wiki/Layout-2020 label Apr 19, 2023
@mrobinson mrobinson requested a review from delan April 19, 2023 08:19
Copy link
Sponsor Member

@delan delan left a comment

Choose a reason for hiding this comment

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

This looks helpful, though I have a suggestion:

components/layout_2020/style_ext.rs Outdated Show resolved Hide resolved
This renames the helper method to be a bit more accurate. For elements
with static, relative, and sticky positioning, their containing block is
always formed by their nearest block container ancestor. This method is
really dealing with style that means an element will establish a
containing block for absolutely positioned descendants.
@mrobinson mrobinson force-pushed the rename-establishes-containing-block branch from 2437fc5 to db194e7 Compare April 20, 2023 09:49
@delan
Copy link
Sponsor Member

delan commented Apr 21, 2023

@bors-servo r+

@bors-servo
Copy link
Contributor

📌 Commit db194e7 has been approved by delan

@bors-servo
Copy link
Contributor

⌛ Testing commit db194e7 with merge 2f14a0d...

bors-servo added a commit that referenced this pull request Apr 21, 2023
… r=delan

Rename `ComputedValuesExt::establishes_containing_block`

This renames the helper method to be a bit more accurate. For elements with static, relative, and sticky positioning, their containing block is always formed by their nearest block container ancestor. This method is really dealing with style that means an element will establish a containing block for absolutely positioned descendants.

<!-- Please describe your changes on the following line: -->

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: -->
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes do not require tests because they do not change behavior.

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
@github-actions
Copy link

Results from try job (#4763957348):

Flaky unexpected result (21)
  • OK /_mozilla/mozilla/task_queue_throttling.any.html (#22519)
    • FAIL [expected PASS] subtest: Throttling the performance timeline task queue.
  • TIMEOUT [expected OK] /_webgl/conformance/glsl/misc/shader-uniform-packing-restrictions.html (#28103)
    • NOTRUN [expected PASS] subtest: Overall test
  • OK /css/CSS2/floats/hit-test-floats-001.html (#23693)
    • PASS [expected FAIL] subtest: hit-test-floats-001
  • OK /css/CSS2/floats/hit-test-floats-003.html (#25733)
    • PASS [expected FAIL] subtest: Miss float below something else
  • OK /css/CSS2/normal-flow/block-in-inline-hittest-002.html (#29057)
    • FAIL [expected PASS] subtest: elementFromPoint
  • OK /css/CSS2/normal-flow/block-in-inline-hittest-relpos-zindex.html (#29052)
    • FAIL [expected PASS] subtest: block-in-inline-hittest-relpos-zindex
  • OK /css/css-flexbox/hittest-anonymous-box.html (#27091)
    • FAIL [expected PASS] subtest: Hit-testing within an anonymous flex-item should return the flexbox as the hittest result.
  • PASS [expected FAIL] /css/css-text/white-space/trailing-other-space-separators-break-spaces-011.html (#25875)
  • OK /css/css-transforms/transform-scale-hittest.html (#24667)
    • FAIL [expected PASS] subtest: Hit test within unscaled box
  • OK /css/css-transitions/properties-value-inherit-002.html (#21486)
    • FAIL [expected PASS] subtest: max-height length(ex) / values
    • FAIL [expected PASS] subtest: max-height length(mm) / values
    • FAIL [expected PASS] subtest: max-height length(cm) / values
    • FAIL [expected PASS] subtest: max-height length(in) / values
    • FAIL [expected PASS] subtest: max-height percentage(%) / values
    • FAIL [expected PASS] subtest: max-width length(pt) / values
    • FAIL [expected PASS] subtest: max-width length(pc) / values
    • FAIL [expected PASS] subtest: max-width length(px) / values
    • FAIL [expected PASS] subtest: max-width length(em) / values
    • FAIL [expected PASS] subtest: max-width length(ex) / values
    • And 90 more unexpected results...
  • OK /css/cssom-view/elementFromPoint-subpixel.html (#23623)
    • PASS [expected FAIL] subtest: Hit test top left corner of box
  • 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=''
  • OK /html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/a-click.html (#28697)
    • PASS [expected FAIL] subtest: aElement.click() before the load event must NOT replace
  • TIMEOUT [expected OK] /html/browsers/history/the-history-interface/traverse-during-unload.html (#28688)
    • TIMEOUT [expected PASS] subtest: Traversing the history during unload
  • TIMEOUT [expected OK] /html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_escaping-1.html (#22647)
    • TIMEOUT [expected FAIL] subtest: Check that popups from a sandboxed iframe escape the sandbox if
      allow-popups-to-escape-sandbox is used
  • OK /html/syntax/parsing/DOMContentLoaded-defer.html (#21550)
    • FAIL [expected PASS] subtest: The end: DOMContentLoaded and defer scripts
  • TIMEOUT [expected OK] /webaudio/the-audio-api/the-audiocontext-interface/audiocontext-not-fully-active.html (#27664)
  • TIMEOUT [expected OK] /webmessaging/with-ports/017.html (#24486)
    • TIMEOUT [expected PASS] subtest: origin of the script that invoked the method, about:blank
  • TIMEOUT [expected OK] /webmessaging/with-ports/018.html (#24485)
    • TIMEOUT [expected PASS] subtest: origin of the script that invoked the method, javascript:
  • TIMEOUT [expected OK] /webmessaging/without-ports/017.html (#24486)
    • TIMEOUT [expected PASS] subtest: origin of the script that invoked the method, about:blank
  • OK [expected TIMEOUT] /webstorage/localstorage-about-blank-3P-iframe-opens-3P-window.partitioned.tentative.html (#29053)
    • PASS [expected TIMEOUT] subtest: StorageKey: test 3P about:blank window opened from a 3P iframe
Stable unexpected results that are known to be intermittent (22)
  • OK [expected TIMEOUT] /FileAPI/url/url-charset.window.html (#26997)
    • PASS [expected TIMEOUT] subtest: Blob charset should override any auto-detected charset.
  • TIMEOUT /FileAPI/url/url-in-tags-revoke.window.html (#19978)
    • FAIL [expected TIMEOUT] subtest: Opening a blob URL in a new window immediately before revoking it works.
  • OK /css/CSS2/floats/hit-test-floats-005.html (#25804)
    • PASS [expected FAIL] subtest: Miss clipped float
  • OK /css/cssom-view/elementFromPoint-001.html (#22452)
    • PASS [expected FAIL] subtest: CSSOM View - 5 - extensions to the Document interface
  • CRASH [expected OK] /css/cssom-view/elementFromPoint-dynamic-anon-box.html (#22337)
  • OK /css/cssom-view/elementFromPoint-list-001.html (#23915)
    • FAIL [expected PASS] subtest: <li>Inside 2</li>
  • OK /css/cssom-view/elementFromPosition.html (#21295)
    • PASS [expected FAIL] subtest: test some point of the element: top left corner
  • CRASH [expected TIMEOUT] /fetch/api/basic/keepalive.any.html (#29536)
  • ERROR [expected TIMEOUT] /html/browsers/browsing-the-web/history-traversal/persisted-user-state-restoration/scroll-restoration-fragment-scrolling-cross-origin.html (#28541)
  • OK [expected TIMEOUT] /html/browsers/browsing-the-web/navigating-across-documents/initial-empty-document/iframe-src-aboutblank-navigate-immediately.html (#29048)
    • FAIL [expected TIMEOUT] subtest: Navigating to a different document with link click
    • FAIL [expected NOTRUN] subtest: Navigating to a different document with form submission
  • TIMEOUT /html/browsers/browsing-the-web/navigating-across-documents/javascript-url-no-beforeunload.window.html (#29055)
    • PASS [expected FAIL] subtest: Navigating an opened window with an iframe via location.href to a javascript: URL must not fire beforeunload on the iframe: undefined completion
  • OK /html/browsers/browsing-the-web/read-media/pageload-image-in-popup.html (#23849)
    • FAIL [expected PASS] subtest: The document for a standalone media file should have one child in the body.
  • OK /html/browsers/the-window-object/open-close/creating_browsing_context_test_01.html (#29046)
    • FAIL [expected PASS] subtest: first argument: absolute url
  • CRASH [expected OK] /html/browsers/windows/embedded-opener-remove-frame.html (#23867)
  • TIMEOUT [expected OK] /html/interaction/focus/the-autofocus-attribute/supported-elements.html (#24145)
    • TIMEOUT [expected FAIL] subtest: Element with tabindex should support autofocus
    • NOTRUN [expected PASS] subtest: Non-HTMLElement should not support autofocus
    • NOTRUN [expected FAIL] subtest: Host element with delegatesFocus should support autofocus
    • NOTRUN [expected FAIL] subtest: Host element with delegatesFocus including no focusable descendants should be skipped
    • NOTRUN [expected FAIL] subtest: Area element should support autofocus
  • TIMEOUT [expected OK] /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
  • 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
  • OK /html/semantics/embedded-content/the-img-element/non-active-document.html (#21544)
    • PASS [expected FAIL] subtest: createHTMLDocument
    • PASS [expected FAIL] subtest: <template>
  • 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] /html/webappapis/scripting/processing-model-2/integration-with-the-javascript-job-queue/promise-job-entry-different-function-realm.html (#25805)
    • FAIL [expected TIMEOUT] subtest: Fulfillment handler on pending-then-fulfilled promise
    • FAIL [expected TIMEOUT] subtest: Rejection handler on pending-then-rejected promise
  • 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
    • TIMEOUT [expected FAIL] subtest: Rejection handler on pending-then-rejected promise
  • TIMEOUT [expected CRASH] /webmessaging/broadcastchannel/cross-partition.https.tentative.html (#29058)

@bors-servo
Copy link
Contributor

💔 Test failed - checks-github

@CYBAI
Copy link
Member

CYBAI commented Apr 21, 2023

The CI failed with #29653.

@mrobinson
Copy link
Member Author

@bors-servo retry

@bors-servo
Copy link
Contributor

⌛ Testing commit db194e7 with merge 0b888c8...

@github-actions
Copy link

Results from try job (#4779802026):

Flaky unexpected result (22)
  • OK /_mozilla/mozilla/task_queue_throttling.any.html (#22519)
    • FAIL [expected PASS] subtest: Throttling the performance timeline task queue.
  • TIMEOUT [expected OK] /_webgl/conformance/glsl/misc/shader-uniform-packing-restrictions.html (#28103)
    • NOTRUN [expected PASS] subtest: Overall test
  • OK /css/CSS2/floats/hit-test-floats-003.html (#25733)
    • PASS [expected FAIL] subtest: Miss float below something else
  • OK /css/CSS2/normal-flow/block-in-inline-hittest-002.html (#29057)
    • FAIL [expected PASS] subtest: elementFromPoint
  • OK /css/CSS2/normal-flow/block-in-inline-hittest-float-001.html (#29565)
    • FAIL [expected PASS] subtest: block-in-inline-hittest-float-001
  • OK /css/css-transforms/inline-with-filter-and-hidden-backface.html (#29547)
    • FAIL [expected PASS] subtest: Hit test
  • OK /css/css-transforms/transform-scale-hittest.html (#24667)
    • FAIL [expected PASS] subtest: Hit test within unscaled box
  • CRASH [expected OK] /css/cssom-view/elementFromPoint-dynamic-anon-box.html (#22337)
  • OK /css/cssom-view/elementFromPoint-list-001.html (#23915)
    • FAIL [expected PASS] subtest: <li>Inside 2</li>
    • FAIL [expected PASS] subtest: <li>Inside 3</li>
  • OK /css/cssom-view/elementFromPoint-visibility-hidden-resizer.html (#28695)
    • FAIL [expected PASS] subtest: elementFromPoint on resizer area of an element with visibility:hidden
  • TIMEOUT [expected OK] /fetch/local-network-access/iframe.tentative.https.window.html (#29605)
    • TIMEOUT [expected PASS] subtest: local to local, grandparent navigates: no preflight required.
    • TIMEOUT [expected FAIL] subtest: public to local, grandparent navigates: failure.
    • TIMEOUT [expected FAIL] subtest: public to local, grandparent navigates: success.
  • ERROR [expected TIMEOUT] /html/browsers/browsing-the-web/history-traversal/persisted-user-state-restoration/scroll-restoration-fragment-scrolling-cross-origin.html (#28541)
  • 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=''
    • FAIL [expected PASS] 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-same-origin.window.html (#29049)
    • PASS [expected FAIL] subtest: Same-origin navigation started from unload handler must be ignored
  • OK /html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/a-click.html (#28697)
    • PASS [expected FAIL] subtest: aElement.click() before the load event must NOT replace
  • TIMEOUT [expected OK] /html/browsers/browsing-the-web/read-media/pageload-image-in-popup.html (#23849)
    • NOTRUN [expected PASS] subtest: The document for a standalone media file should have one child in the body.
  • TIMEOUT [expected OK] /html/browsers/history/the-history-interface/traverse-during-unload.html (#28688)
    • TIMEOUT [expected PASS] subtest: Traversing the history during unload
  • OK /html/browsers/history/the-history-interface/traverse_the_history_1.html (#21383)
    • PASS [expected FAIL] subtest: Multiple history traversals from the same task
  • 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
  • TIMEOUT [expected PASS] /html/semantics/embedded-content/the-img-element/img-with-containment-and-size.html (#23101)
  • ERROR [expected OK] /html/semantics/scripting-1/the-script-element/defer-script/async-script.html?reload (#29054)
  • OK /html/syntax/parsing/DOMContentLoaded-defer.html (#21550)
    • FAIL [expected PASS] subtest: The end: DOMContentLoaded and defer scripts
Stable unexpected results that are known to be intermittent (21)
  • OK [expected TIMEOUT] /FileAPI/url/url-charset.window.html (#26997)
    • PASS [expected TIMEOUT] subtest: Blob charset should override any auto-detected charset.
  • TIMEOUT /FileAPI/url/url-in-tags-revoke.window.html (#19978)
    • FAIL [expected TIMEOUT] subtest: Opening a blob URL in a new window immediately before revoking it works.
  • TIMEOUT [expected OK] /_webgl/conformance/uniforms/out-of-bounds-uniform-array-access.html (#26225)
    • NOTRUN [expected PASS] subtest: Overall test
  • OK /css/CSS2/floats/hit-test-floats-001.html (#23693)
    • PASS [expected FAIL] subtest: hit-test-floats-001
  • OK /css/CSS2/floats/hit-test-floats-005.html (#25804)
    • PASS [expected FAIL] subtest: Miss clipped float
  • OK /css/CSS2/normal-flow/block-in-inline-hittest-001.html (#29064)
    • FAIL [expected PASS] subtest: block-in-inline-hittest-001
  • OK /css/cssom-view/CaretPosition-001.html (#21338)
    • PASS [expected FAIL] subtest: Element at (400, 100)
  • OK /css/cssom-view/elementFromPoint-subpixel.html (#23623)
    • PASS [expected FAIL] subtest: Hit test top left corner of box
  • OK /css/cssom-view/elementFromPosition.html (#21295)
    • PASS [expected FAIL] subtest: test some point of the element: top left corner
  • OK /css/cssom-view/elementsFromPoint-invalid-cases.html (#21338)
    • FAIL [expected PASS] subtest: The root element is the last element returned for otherwise empty queries within the viewport
  • TIMEOUT [expected OK] /fetch/api/redirect/redirect-keepalive.any.html (#29536)
  • TIMEOUT /fetch/metadata/generated/css-images.sub.tentative.html (#29047)
    • PASS [expected FAIL] subtest: border-image sec-fetch-site - HTTPS downgrade (header not sent)
  • CRASH [expected OK] /html/browsers/windows/embedded-opener-remove-frame.html (#23867)
  • TIMEOUT [expected OK] /html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_escaping-1.html (#22647)
    • TIMEOUT [expected FAIL] subtest: Check that popups from a sandboxed iframe escape the sandbox if
      allow-popups-to-escape-sandbox is used
  • 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
  • OK /html/semantics/embedded-content/the-img-element/non-active-document.html (#21544)
    • PASS [expected FAIL] subtest: createHTMLDocument
    • PASS [expected FAIL] subtest: <template>
  • 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] /html/webappapis/scripting/processing-model-2/integration-with-the-javascript-job-queue/promise-job-entry-different-function-realm.html (#25805)
    • FAIL [expected TIMEOUT] subtest: Fulfillment handler on pending-then-fulfilled promise
    • FAIL [expected TIMEOUT] subtest: Rejection handler on pending-then-rejected promise
  • TIMEOUT [expected OK] /webmessaging/with-ports/017.html (#24486)
    • TIMEOUT [expected PASS] subtest: origin of the script that invoked the method, about:blank
  • TIMEOUT [expected OK] /webmessaging/with-ports/018.html (#24485)
    • TIMEOUT [expected PASS] subtest: origin of the script that invoked the method, javascript:
  • OK [expected TIMEOUT] /webstorage/localstorage-about-blank-3P-iframe-opens-3P-window.partitioned.tentative.html (#29053)
    • PASS [expected TIMEOUT] subtest: StorageKey: test 3P about:blank window opened from a 3P iframe

@bors-servo
Copy link
Contributor

☀️ Test successful - checks-github
Approved by: delan
Pushing 0b888c8 to master...

@bors-servo bors-servo merged commit 0b888c8 into servo:master Apr 23, 2023
10 checks passed
@mrobinson mrobinson deleted the rename-establishes-containing-block branch June 26, 2023 08:45
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.

None yet

4 participants