Skip to content

Implement element.shadowRoot attribute#34306

Merged
jdm merged 3 commits intoservo:mainfrom
simonwuelker:shadowdom-constructor
Nov 21, 2024
Merged

Implement element.shadowRoot attribute#34306
jdm merged 3 commits intoservo:mainfrom
simonwuelker:shadowdom-constructor

Conversation

@simonwuelker
Copy link
Copy Markdown
Contributor

Implements https://dom.spec.whatwg.org/#dom-element-shadowroot and, as a consequence, adds support for ShadowRootMode::Closed.

If a shadow root is "closed" then it is effectively "hidden", meaning element.shadowRoot returns null.


  • ./mach build -d does not report any errors
  • ./mach test-tidy does not report any errors
  • There are tests for these changes

@simonwuelker simonwuelker added the A-content/dom Interacting with the DOM from web content label Nov 20, 2024
@simonwuelker simonwuelker added this pull request to the merge queue Nov 20, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Nov 20, 2024
@mrobinson
Copy link
Copy Markdown
Member

Looks like there are some new passes, some new failures, and unfortunately a couple new crashes: https://github.com/servo/servo/runs/33266534275

@simonwuelker simonwuelker added the T-linux-wpt Do a try run of the WPT label Nov 20, 2024
@github-actions github-actions bot removed the T-linux-wpt Do a try run of the WPT label Nov 20, 2024
@github-actions
Copy link
Copy Markdown

🔨 Triggering try run (#11938065998) for Linux WPT

@github-actions
Copy link
Copy Markdown

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

Flaky unexpected result (20)
  • OK /FileAPI/url/url-with-fetch.any.worker.html (#21517)
    • FAIL [expected PASS] subtest: Revoke blob URL after calling fetch, fetch should succeed

      promise_test: Unhandled rejection with value: object "TypeError: Network error occurred"
      

  • TIMEOUT [expected OK] /_webgl/conformance/glsl/misc/shader-uniform-packing-restrictions.html (#28103)
  • TIMEOUT [expected OK] /_webgl/conformance/reading/read-pixels-test.html
  • TIMEOUT [expected OK] /_webgl/conformance/uniforms/out-of-bounds-uniform-array-access.html (#26225)
    • NOTRUN [expected PASS] subtest: Overall test
  • PASS [expected FAIL] /css/compositing/mix-blend-mode/mix-blend-mode-video-sibling.html (#32849)
  • TIMEOUT [expected OK] /css/css-flexbox/abspos/position-absolute-013.html
  • FAIL [expected PASS] /css/css-overflow/overflow-video.html
  • CRASH [expected OK] /encoding/legacy-mb-tchinese/big5/big5-decode-big5-hkscs.html?12001-13000
  • 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 location.href

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

    • FAIL [expected PASS] subtest: Navigating to a different document with location.assign

      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/javascript-url-return-value-handling-dynamic.html (#28066)
    • FAIL [expected PASS] subtest: 0041 set in href="" targeting a frame and clicked

      assert_equals: expected "A" but got ""
      

  • 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"
      

  • TIMEOUT [expected OK] /html/browsers/origin/cross-origin-objects/cross-origin-objects.html (#28569)
  • OK /html/browsers/windows/embedded-opener-remove-frame.html (#23867)
    • PASS [expected FAIL] subtest: opener of discarded auxiliary browsing context
  • 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)
    • PASS [expected FAIL] subtest: Reloading iframe loading='lazy' before it is loaded: location.reload
  • 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 /html/semantics/forms/form-submission-0/form-data-set-usv.html
    • FAIL [expected PASS] subtest: Strings from form controls should be converted to Unicode scalar values in form submission

      assert_equals: expected "69 6e 70 75 74 31 ef bf bd 3d 69 6e 70 75 74 31 ef bf bd 0d 0a 69 6e 70 75 74 32 ef bf bd 3d 69 6e 70 75 74 32 ef bf bd 0d 0a 69 6e 70 75 74 33 ef bf bd 3d 69 6e 70 75 74 33 ef bf bd 0d 0a 69 6e 70 75 74 34 ef bf bd 3d 69 6e 70 75 74 34 ef bf bd 0d 0a" but got "\n  \n  \n    option\n  \n  \n  \n\n\n\n\"use strict\";\n\nconst form = document.querySelector(\"form\");\n\nfor (let el of Array.from(form.querySelectorAll(\"input\"))) { // Firefox/Edge support\n  el.name = el.id + \"\\uDC01\";\n  el.value = el.id + \"\\uDC01\";\n}\n\nconst select = document.querySelector(\"select\");\nselect.name = select.id + \"\\uDC01\";\nselect.firstElementChild.value = select.id + \"\\uDC01\";\n\n"
      

  • OK /html/webappapis/update-rendering/child-document-raf-order.html (#33028)
    • FAIL [expected PASS] subtest: Ordering of steps in "Update the Rendering" - child document requestAnimationFrame order

      assert_array_equals: expected order of notifications lengths differ, expected array ["parent_raf", "first_child_raf", "second_child_raf"] length 3, got ["parent_raf", "first_child_raf", "second_child_raf", "parent_raf", "first_child_raf", "second_child_raf"] length 6
      

  • 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] /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 that are known to be intermittent (11)
  • FAIL [expected PASS] /_mozilla/css/dirty_viewport.html (#13731)
  • FAIL [expected PASS] /_mozilla/css/iframe/hide_and_show.html (#15265)
  • TIMEOUT /fetch/metadata/generated/element-img-environment-change.sub.html (#30111)
    • TIMEOUT [expected PASS] subtest: sec-fetch-site - Not sent to non-trustworthy same-origin destination, no attributes

      Test timed out
      

    • NOTRUN [expected TIMEOUT] subtest: sec-fetch-site - Not sent to non-trustworthy same-site destination, no attributes
  • 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."
      

  • TIMEOUT [expected OK] /html/infrastructure/urls/base-url/document-base-url-window-initiator-is-not-opener.https.window.html (#30970)
  • 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"
      

  • 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
      

  • TIMEOUT [expected CRASH] /html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_nonescaping-2.html (#22154)
  • OK /html/syntax/parsing/DOMContentLoaded-defer.html (#21550)
    • PASS [expected FAIL] subtest: The end: DOMContentLoaded and defer scripts
  • TIMEOUT /resource-timing/nested-context-navigations-iframe.html (#24311)
    • TIMEOUT [expected PASS] subtest: Test that iframe navigations are not observable by the parent, even after history navigations by the parent

      Test timed out
      

  • 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 (3)
  • OK [expected FAIL] /css/css-transforms/transform-origin-in-shadow.html
    • FAIL [expected PASS] subtest: 'transform-origin' on <svg> being direct descendant of shadow root

      assert_equals: expected "50px 50px" but got "50% 50% 0px"
      

  • OK [expected ERROR] /html/semantics/interactive-elements/the-dialog-element/dialog-focus-shadow.html
    • FAIL [expected PASS] subtest: show: No autofocus, no delegatesFocus, no siblings

      assert_equals: expected Element node <dialog data-description="No autofocus, no delegatesFocus... but got Element node <button id="focus-between-tests">Focus between tests</but...
      

    • FAIL [expected PASS] subtest: showModal: No autofocus, no delegatesFocus, no siblings

      dialog[method] is not a function
      

    • FAIL [expected PASS] subtest: show: No autofocus, no delegatesFocus, sibling before

      assert_equals: expected Element node <button class="focus-me">Focusable</button> but got Element node <button id="focus-between-tests">Focus between tests</but...
      

    • FAIL [expected PASS] subtest: showModal: No autofocus, no delegatesFocus, sibling before

      dialog[method] is not a function
      

    • FAIL [expected PASS] subtest: show: No autofocus, no delegatesFocus, sibling after

      assert_equals: expected Element node <button class="focus-me">Focusable</button> but got Element node <button id="focus-between-tests">Focus between tests</but...
      

    • FAIL [expected PASS] subtest: showModal: No autofocus, no delegatesFocus, sibling after

      dialog[method] is not a function
      

    • FAIL [expected PASS] subtest: show: No autofocus, yes delegatesFocus, no siblings

      assert_equals: expected Element node <div></div> but got Element node <button id="focus-between-tests">Focus between tests</but...
      

    • FAIL [expected PASS] subtest: showModal: No autofocus, yes delegatesFocus, no siblings

      dialog[method] is not a function
      

    • FAIL [expected PASS] subtest: show: No autofocus, yes delegatesFocus, sibling before

      assert_equals: expected Element node <button class="focus-me">Focusable</button> but got Element node <button id="focus-between-tests">Focus between tests</but...
      

    • FAIL [expected PASS] subtest: showModal: No autofocus, yes delegatesFocus, sibling before

      dialog[method] is not a function
      

    • And 40 more unexpected results...
  • CRASH [expected OK] /shadow-dom/focus/focus-selector-delegatesFocus.html

@github-actions
Copy link
Copy Markdown

⚠️ Try run (#11938065998) failed.

This is obviously not the case anymore.

Signed-off-by: Simon Wülker <[email protected]>
Signed-off-by: Simon Wülker <[email protected]>
@jdm jdm enabled auto-merge November 20, 2024 23:56
@jdm jdm added this pull request to the merge queue Nov 21, 2024
Merged via the queue into servo:main with commit 527e2d4 Nov 21, 2024
@simonwuelker simonwuelker deleted the shadowdom-constructor branch November 21, 2024 01:31
@gterzian gterzian mentioned this pull request Nov 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-content/dom Interacting with the DOM from web content

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants