Skip to content

script: Implement observable array - #46130

Closed
arihant2math wants to merge 1 commit into
servo:mainfrom
arihant2math:oa
Closed

arihant2math wants to merge 1 commit into
servo:mainfrom
arihant2math:oa

Conversation

@arihant2math

@arihant2math arihant2math commented Jul 1, 2026 •

Copy link
Copy Markdown
Contributor

Ports over firefox's implementation. Uses observable array in adopted stylesheet.

Fixes: #37902
Fixes: #38132

@arihant2math arihant2math changed the title script: Implement and use observable array script: Implement observable array Jul 1, 2026
@arihant2math

Copy link
Copy Markdown
Contributor Author

Currently it seems codegen is still a little broken, once I fix that, the PR should be ready.

@arihant2math
arihant2math force-pushed the oa branch 4 times, most recently from 0ddbf96 to d60f214 Compare July 1, 2026 03:07
@arihant2math arihant2math added the T-linux-wpt Do a try run of the WPT label Jul 1, 2026
@github-actions github-actions Bot removed the T-linux-wpt Do a try run of the WPT label Jul 1, 2026
@github-actions

github-actions Bot commented Jul 1, 2026

Copy link
Copy Markdown

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

@github-actions

github-actions Bot commented Jul 1, 2026

Copy link
Copy Markdown

⚠️ Try run (#28490716551) failed!

@arihant2math
arihant2math force-pushed the oa branch 3 times, most recently from ba779a4 to 0d49164 Compare July 1, 2026 03:53
Signed-off-by: Ashwin Naren <[email protected]>
@arihant2math arihant2math added the T-linux-wpt Do a try run of the WPT label Jul 1, 2026
@github-actions github-actions Bot removed the T-linux-wpt Do a try run of the WPT label Jul 1, 2026
@github-actions

github-actions Bot commented Jul 1, 2026

Copy link
Copy Markdown

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

@github-actions

github-actions Bot commented Jul 1, 2026

Copy link
Copy Markdown

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

Flaky unexpected result (46)
  • TIMEOUT [expected OK] /_mozilla/mozilla/focus-scroll-when-visible.html
  • TIMEOUT [expected OK] /_webgl/conformance/uniforms/no-over-optimization-on-uniform-array-09.html
    • NOTRUN [expected PASS] subtest: Overall test
  • TIMEOUT [expected OK] /_webgl/conformance/uniforms/no-over-optimization-on-uniform-array-16.html
  • TIMEOUT [expected OK] /_webgl/conformance2/state/gl-object-get-calls.html
    • NOTRUN [expected PASS] subtest: Overall test
  • TIMEOUT [expected OK] /_webgl/conformance2/sync/sync-webgl-specific.html
  • CRASH [expected OK] /_webgl/conformance2/transform_feedback/transform_feedback.html
  • OK /beacon/beacon-basic.https.window.html (#41723)
    • FAIL [expected PASS] subtest: Payload size restriction should be accumulated: type = arraybuffer

      assert_false: expected false got true
      

  • TIMEOUT /content-security-policy/inheritance/auxiliary-blank-document.html (#44821)
    • PASS [expected FAIL] subtest: For transient doc, violation event occurs in auxiliary, not opener window.
  • TIMEOUT [expected OK] /cookies/attributes/domain.sub.html
    • TIMEOUT [expected PASS] subtest: Empty domain treated as host cookie 3

      Test timed out
      

    • NOTRUN [expected PASS] subtest: No host cookies returned for host cookies after non-host redirect 1
    • NOTRUN [expected PASS] subtest: No host cookies returned for host cookies after non-host redirect 2
    • NOTRUN [expected PASS] subtest: No host cookies returned for host cookies after non-host redirect 3
  • FAIL [expected PASS] /css/css-backgrounds/background-size-042.html
  • OK /css/css-cascade/layer-font-face-override.html (#35935)
    • PASS [expected FAIL] subtest: @font-face override update with appended sheet 1
    • PASS [expected FAIL] subtest: @font-face override update with appended sheet 2
  • OK /css/css-fonts/variations/at-font-face-font-matching.html (#20684)
    • FAIL [expected PASS] subtest: Matching font-style: 'oblique 10deg' should prefer 'oblique -50deg -20deg' over 'oblique -40deg -30deg'

      assert_equals: Unexpected font on test element expected 487 but got 532
      

    • PASS [expected FAIL] subtest: Matching font-style: 'oblique -10deg' should prefer 'oblique 40deg 50deg' over 'italic'
  • TIMEOUT [expected PASS] /css/css-grid/abspos/grid-abspos-staticpos-align-self-flex-end.html
  • FAIL [expected PASS] /css/css-sizing/dynamic-available-size-iframe.html (#45763)
  • PASS [expected FAIL] /css/css-text-decor/text-underline-position-from-font-variable.html (#45615)
  • TIMEOUT [expected OK] /fetch/content-encoding/br/big-br-body.https.any.html
    • TIMEOUT [expected PASS] subtest: large br data should be decompressed successfully

      Test timed out
      

    • NOTRUN [expected FAIL] subtest: large br data should be decompressed successfully with byte stream
  • TIMEOUT [expected OK] /fetch/content-encoding/zstd/big-zstd-body.https.any.worker.html
    • TIMEOUT [expected PASS] subtest: large zstd data should be decompressed successfully

      Test timed out
      

    • NOTRUN [expected FAIL] subtest: large zstd data should be decompressed successfully with byte stream
  • TIMEOUT [expected OK] /fetch/metadata/generated/css-font-face.https.sub.tentative.html
    • TIMEOUT [expected PASS] subtest: sec-fetch-site - Same-Site -&gt; Same-Site

      Test timed out
      

    • NOTRUN [expected PASS] subtest: sec-fetch-site - Same-Site -&gt; Cross-Site
    • NOTRUN [expected PASS] subtest: sec-fetch-mode
    • NOTRUN [expected PASS] subtest: sec-fetch-dest
    • NOTRUN [expected PASS] subtest: sec-fetch-user
    • NOTRUN [expected PASS] subtest: sec-fetch-storage-access - Cross-site
    • NOTRUN [expected PASS] 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/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/javascript-url-return-value-handling-dynamic.html
    • 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-cross-origin.sub.window.html (#29056)
    • PASS [expected FAIL] subtest: Cross-origin navigation started from unload handler must be ignored
  • 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 [expected TIMEOUT] /html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/form-submit-button-click.html (#44099)
    • FAIL [expected TIMEOUT] subtest: Replace before load, triggered by submitButton.click()

      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)&amp;code=%0A%20%20%20%20const%20form%20%3D%20document.createElement(%22form%22)%3B%0A%20%20%20%20form.action%20%3D%20%22%2Fcommon%2Fblank.html%22%3B%0A%0A%20%20%20%20const%20input%20%3D%20document.createElement(%22input%22)%3B%0A%20%20%20%20input.type%20%3D%20%22hidden%22%3B%0A%20%20%20%20input.name%20%3D%20%22thereplacement%22%3B%0A%20%20%20%20form.append(input)%3B%0A%0A%20%20%20%20const%20button%20%3D%20document.createElement(%22button%22)%3B%0A%20%20%20%20button.type%20%3D%20%22submit%22%3B%0A%20%20%20%20form.append(button)%3B%0A%0A%20%20%20%20document.currentScript.before(form)%3B%0A%20%20%20%20button.click()%3B%0A%20%20"
      

  • TIMEOUT [expected ERROR] /html/browsers/history/the-location-interface/location_replace_session_history.html (#41896)
  • OK /html/semantics/embedded-content/media-elements/seeking/seek-to-currentTime.html (#46014)
    • FAIL [expected PASS] subtest: seek to currentTime

      assert_greater_than: seekable ranges expected a number greater than 0 but got 0
      

  • OK [expected TIMEOUT] /html/semantics/embedded-content/media-elements/src_object_blob.html (#40340)
    • PASS [expected TIMEOUT] subtest: HTMLMediaElement.srcObject blob
  • OK /html/semantics/embedded-content/the-iframe-element/iframe-loading-lazy-nav-location-replace-set-src.html (#32697)
    • PASS [expected FAIL] subtest: Navigating iframe loading='lazy' and then setting src: location.replace
  • OK /html/semantics/scripting-1/the-script-element/module/choice-of-error-1.html (#44058)
    • FAIL [expected PASS] subtest: Parse errors in different files should be reported depending on different roots

      assert_not_equals: two different parse errors should be reported got disallowed value object "SyntaxError: expected expression, got '%'"
      

  • OK /html/webappapis/dynamic-markup-insertion/document-write/iframe_005.html (#43671)
    • PASS [expected FAIL] subtest: document.write external script into iframe write back into parent
  • OK /html/webappapis/dynamic-markup-insertion/document-write/module-tla-import.html (#42419)
    • FAIL [expected PASS] subtest: document.write in an imported module

      assert_true: onload must be called expected true got false
      

  • OK /infrastructure/testdriver/click_iframe.html
    • FAIL [expected PASS] subtest: TestDriver click on a document in an iframe

      Unhandled rejection: assert_unreached: click failed Reached unreachable code
      

  • OK /paint-timing/with-lcp/fcp-document-opacity-image.html (#43068)
    • FAIL [expected PASS] subtest: Test that FCP after opacity change is not a larger value than LCP

      assert_equals: First contentful paint marked too early.  expected 0 but got 1
      

  • ERROR [expected TIMEOUT] /performance-timeline/not-restored-reasons/abort-block-bfcache.window.html (#42802)
  • TIMEOUT [expected OK] /pointerevents/compat/pointerevent_touch-action_two-finger_interaction.html (#44693)
    • NOTRUN [expected PASS] subtest: touch two-finger pan on 'touch-action: pan-x pan-y'
    • NOTRUN [expected FAIL] subtest: touch two-finger pan on 'touch-action: pinch-zoom'
  • OK /pointerevents/compat/pointerevent_touch_target_after_pointerdown_target_removed.tentative.html (#42813)
    • PASS [expected FAIL] subtest: After a touchstart listener removes its target, touch events should be fired on the touchstart target even though an orphan and pointer events should be fired on the parent
    • PASS [expected FAIL] subtest: After a touchstart listener removes its target, touchmove event should be fired on the pointerdown target
  • OK /preload/preload-resource-match.https.html
    • PASS [expected FAIL] subtest: Loading font (same-origin) with link (same-origin) should reuse the preloaded response
  • OK /resource-timing/buffer-full-add-then-clear.html (#40819)
    • FAIL [expected PASS] subtest: Test that if the buffer is cleared after entries were added to the secondary buffer, those entries make it into the primary one

      assert_equals: Number of entries does not match the expected value. expected 3 but got 0
      

  • OK [expected CRASH] /resource-timing/iframe-failed-commit.html
    • FAIL [expected PASS] subtest: Test iframe from non-existent host gets reported

      promise_test: Unhandled rejection with value: object "TimeoutError: Timeout was reached before entry fired"
      

    • FAIL [expected PASS] subtest: Test iframe redirecting to non-existent host gets reported

      assert_greater_than: startTime should be greater than 0 expected a number greater than 0 but got 0
      

    • FAIL [expected PASS] subtest: Same-origin iframe that complies with CSP attribute gets reported

      assert_greater_than_equal: domainLookupEnd should be greater than domainLookupStart expected a number greater than or equal to 4339.6 but got 0
      

    • FAIL [expected PASS] subtest: Same-origin iframe that doesn't comply with CSP attribute gets reported

      assert_equals: domainLookupStart should be 0 expected 0 but got 4350.38
      

    • FAIL [expected PASS] subtest: Same-origin empty iframe with a 200 status gets reported

      assert_equals: domainLookupStart should be 0 expected 0 but got 4395.06
      

    • FAIL [expected PASS] subtest: Same-origin empty iframe with a 204 status gets reported

      promise_test: Unhandled rejection with value: object "TimeoutError: Timeout was reached before entry fired"
      

    • FAIL [expected PASS] subtest: Same-origin empty iframe with a 205 status gets reported

      promise_test: Unhandled rejection with value: object "TimeoutError: Timeout was reached before entry fired"
      

    • FAIL [expected PASS] subtest: Cross-origin empty iframe with a 204 status gets reported

      promise_test: Unhandled rejection with value: object "TimeoutError: Timeout was reached before entry fired"
      

    • FAIL [expected PASS] subtest: Cross-origin empty iframe with a 205 status gets reported

      promise_test: Unhandled rejection with value: object "TimeoutError: Timeout was reached before entry fired"
      

  • CRASH [expected OK] /upgrade-insecure-requests/gen/iframe-blank-inherit.meta/unset/sharedworker-module.https.html
  • OK /upgrade-insecure-requests/gen/sharedworker-module-data.meta/unset/fetch.https.html
    • FAIL [expected PASS] subtest: Upgrade-Insecure-Requests: Expects blocked for fetch to cross-http-downgrade origin and downgrade redirection from https context.

      assert_equals: The resource request should be 'blocked'. expected "blocked" but got "allowed"
      

    • FAIL [expected PASS] subtest: Upgrade-Insecure-Requests: Expects blocked for fetch to cross-http-downgrade origin and no-redirect redirection from https context.

      assert_equals: The resource request should be 'blocked'. expected "blocked" but got "allowed"
      

    • FAIL [expected PASS] subtest: Upgrade-Insecure-Requests: Expects blocked for fetch to cross-https origin and downgrade redirection from https context.

      assert_equals: The resource request should be 'blocked'. expected "blocked" but got "allowed"
      

    • FAIL [expected PASS] subtest: Upgrade-Insecure-Requests: Expects blocked for fetch to same-http-downgrade origin and downgrade redirection from https context.

      assert_equals: The resource request should be 'blocked'. expected "blocked" but got "allowed"
      

    • FAIL [expected PASS] subtest: Upgrade-Insecure-Requests: Expects blocked for fetch to same-http-downgrade origin and no-redirect redirection from https context.

      assert_equals: The resource request should be 'blocked'. expected "blocked" but got "allowed"
      

    • FAIL [expected PASS] subtest: Upgrade-Insecure-Requests: Expects blocked for fetch to same-https origin and downgrade redirection from https context.

      assert_equals: The resource request should be 'blocked'. expected "blocked" but got "allowed"
      

  • OK /webdriver/tests/classic/dismiss_alert/dismiss.py (#39098)
    • FAIL [expected PASS] subtest: test_dismiss_in_popup_window

      AssertionError: no such alert (404): No user prompt is currently active.
      

  • OK [expected TIMEOUT] /webstorage/localstorage-about-blank-3P-iframe-opens-3P-window.partitioned.html (#29053)
    • FAIL [expected TIMEOUT] subtest: StorageKey: test 3P about:blank window opened from a 3P iframe

      assert_true: about:blank window opened by 3P iframe does not inherit 3P iframe's StorageKey expected true got false
      

  • TIMEOUT [expected OK] /webstorage/storage_local_setitem_quotaexceedederr.window.html
  • OK /webxr/xrSession_features_deviceSupport.https.html (#24357)
    • FAIL [expected PASS] subtest: Immersive XRSession requests with no supported device should reject

      assert_unreached: Should have rejected: undefined Reached unreachable code
      

  • CRASH [expected OK] /webxr/xrSession_input_events_end.https.html
Stable unexpected results that are known to be intermittent (20)
  • OK /css/css-animations/animation-iteration-event-001.html (#46004)
    • PASS [expected FAIL] subtest: Got the expected elapsedTime in the correct order
  • OK /dom/nodes/moveBefore/iframe-document-preserve.window.html (#43152)
    • FAIL [expected PASS] subtest: moveBefore(): cross-origin iframe is preserved: remove new parent

      assert_equals: iframe does not fire a second load event expected 1 but got 0
      

    • FAIL [expected PASS] subtest: moveBefore(): cross-origin iframe is preserved: remove self

      assert_equals: iframe does not fire a second load event expected 1 but got 0
      

    • FAIL [expected PASS] subtest: moveBefore(): cross-origin iframe is preserved: remove self via replaceChildren()

      assert_equals: iframe does not fire a second load event expected 1 but got 0
      

  • ERROR [expected OK] /fetch/fetch-later/quota/same-origin-iframe/accumulated-oversized-payload.https.window.html (#41705)
  • OK /html/browsers/browsing-the-web/navigating-across-documents/refresh/same-document-refresh.html (#34597)
    • PASS [expected FAIL] subtest: Same-Document Referrer from Refresh
  • OK [expected TIMEOUT] /html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/form-requestsubmit.html (#44098)
    • FAIL [expected TIMEOUT] subtest: Replace before load, triggered by formElement.requestSubmit()

      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)&amp;code=%0A%20%20%20%20const%20form%20%3D%20document.createElement(%22form%22)%3B%0A%20%20%20%20form.action%20%3D%20%22%2Fcommon%2Fblank.html%22%3B%0A%0A%20%20%20%20const%20input%20%3D%20document.createElement(%22input%22)%3B%0A%20%20%20%20input.type%20%3D%20%22hidden%22%3B%0A%20%20%20%20input.name%20%3D%20%22thereplacement%22%3B%0A%20%20%20%20form.append(input)%3B%0A%0A%20%20%20%20document.currentScript.before(form)%3B%0A%20%20%20%20form.requestSubmit()%3B%0A%20%20"
      

  • TIMEOUT [expected OK] /html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/form-submit.html (#44028)
  • TIMEOUT [expected CRASH] /html/browsers/history/the-history-interface/001.html (#12580)
  • OK /html/browsers/history/the-history-interface/traverse_the_history_5.html (#21383)
    • PASS [expected FAIL] subtest: Multiple history traversals, last would be aborted
  • TIMEOUT [expected OK] /html/infrastructure/urls/base-url/document-base-url-window-initiator-is-not-opener.https.window.html (#30970)
  • OK /html/interaction/focus/the-autofocus-attribute/autofocus-dialog.html (#29087)
    • PASS [expected FAIL] subtest: &lt;dialog&gt;-contained autofocus element gets focused when the dialog is shown
  • 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
    • 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
  • OK [expected TIMEOUT] /html/interaction/focus/the-autofocus-attribute/update-the-rendering.html (#24145)
    • FAIL [expected TIMEOUT] subtest: "Flush autofocus candidates" should be happen before a scroll event and animation frame callbacks

      assert_array_equals: animationFrame lengths differ, expected array ["autofocus", "scroll", "animationFrame"] length 3, got ["animationFrame"] length 1
      

  • TIMEOUT /html/semantics/embedded-content/media-elements/preserves-pitch.html (#40352)
    • TIMEOUT [expected PASS] subtest: Speed-ups should not change the pitch when preservesPitch=true

      Test timed out
      

    • NOTRUN [expected PASS] subtest: Slow-downs should not change the pitch when preservesPitch=true
    • NOTRUN [expected TIMEOUT] subtest: Speed-ups should change the pitch when preservesPitch=false
  • OK /html/semantics/scripting-1/the-script-element/execution-timing/077.html (#22139)
    • PASS [expected FAIL] subtest: adding several types of scripts through the DOM and removing some of them confuses scheduler
  • TIMEOUT [expected OK] /infrastructure/testdriver/click_nested.html (#43887)
    • NOTRUN [expected FAIL] subtest: TestDriver click method with multiple windows and nested iframe
  • OK /resource-timing/test_resource_timing.https.html (#25216)
    • PASS [expected FAIL] subtest: PerformanceEntry has correct name, initiatorType, startTime, and duration (script)
  • OK /sanitizer-api/sanitizer-inert-document.html (#45260)
    • FAIL [expected PASS] subtest: Test whether setHTML loads the image.

      promise_test: Unhandled rejection with value: "The server observed a request. It shouldn't have."
      

    • PASS [expected FAIL] subtest: Test whether setHTMLUnsafe loads the image.
  • TIMEOUT [expected OK] /trusted-types/trusted-types-navigation.html?16-20 (#44835)
    • TIMEOUT [expected PASS] subtest: Navigate a frame via area with javascript:-urls in report-only mode.

      Test timed out
      

    • NOTRUN [expected PASS] subtest: Navigate a frame via area with javascript:-urls w/ default policy in report-only mode.
  • OK [expected TIMEOUT] /trusted-types/trusted-types-navigation.html?26-30 (#38807)
    • PASS [expected TIMEOUT] subtest: Navigate a window via form-submission with javascript:-urls in report-only mode.
    • PASS [expected NOTRUN] subtest: Navigate a window via form-submission with javascript:-urls w/ default policy in report-only mode.
    • PASS [expected NOTRUN] subtest: Navigate a frame via form-submission with javascript:-urls in enforcing mode.
    • PASS [expected NOTRUN] subtest: Navigate a frame via form-submission with javascript:-urls w/ default policy in enforcing mode.
  • OK [expected TIMEOUT] /trusted-types/trusted-types-navigation.html?31-35 (#38034)
    • PASS [expected TIMEOUT] subtest: Navigate a frame via form-submission with javascript:-urls w/ default policy in report-only mode.
    • FAIL [expected NOTRUN] subtest: Navigate a window via form-submission with javascript:-urls w/ a default policy throwing an exception in enforcing mode.

      promise_test: Unhandled rejection with value: "Unexpected message received: \"No securitypolicyviolation reported!\""
      

    • FAIL [expected NOTRUN] subtest: Navigate a window via form-submission with javascript:-urls w/ a default policy throwing an exception in report-only mode.

      promise_test: Unhandled rejection with value: "Unexpected message received: \"No securitypolicyviolation reported!\""
      

    • FAIL [expected NOTRUN] subtest: Navigate a window via form-submission with javascript:-urls w/ a default policy making the URL invalid in enforcing mode.

      promise_test: Unhandled rejection with value: "Unexpected message received: \"No securitypolicyviolation reported!\""
      

Stable unexpected results (7)
  • TIMEOUT [expected PASS] /css/cssom/CSSStyleSheet-constructable-concat.html
  • PASS [expected FAIL] /css/cssom/CSSStyleSheet-constructable-insertRule-base-uri.html
  • OK /css/cssom/adoptedstylesheets-observablearray.html
    • PASS [expected FAIL] subtest: document.adoptedStyleSheets should allow mutation in-place
    • FAIL [expected PASS] subtest: adoptedStyleSheets should return true for isArray()

      assert_true: expected true got false
      

  • OK /css/cssom/idlharness.html
    • FAIL [expected PASS] subtest: Document interface: document must inherit property "adoptedStyleSheets" with the proper type

      assert_true: should be an Array expected true got false
      

    • FAIL [expected PASS] subtest: Document interface: new Document() must inherit property "adoptedStyleSheets" with the proper type

      assert_true: should be an Array expected true got false
      

  • OK [expected ERROR] /custom-elements/state/state-css-selector-shadow-dom.html
  • CRASH [expected OK] /webidl/ecmascript-binding/observable-array-no-leak-of-internals.window.html
  • OK /webidl/ecmascript-binding/observable-array-ownkeys.window.html
    • PASS [expected FAIL] subtest: ObservableArray's ownKeys trap

@github-actions

github-actions Bot commented Jul 1, 2026

Copy link
Copy Markdown

⚠️ Try run (#28493600359) failed!

#[expect(unsafe_code)]
fn OnSetAdoptedStyleSheets(
&self,
cx: SafeJSContext,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We have removed SafeJsContext from codegen. Use &mut jSContext instead

@jerensl jerensl Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I wonder how to deal with this, I also add OnSetAdoptedStyleSheets on Bindings.rs cx?

Diagnostics:
1. method `OnSetAdoptedStyleSheets` has an incompatible type for trait
   expected signature `fn(&dom::document::document::Document, script_bindings::script_runtime::JSContext, script_bindings::root::Root<_>, _) -> std::result::Result<_, _>`
      found signature `fn(&dom::document::document::Document, &mut js::context::JSContext, script_bindings::root::Root<_>, _) -> std::result::Result<_, _>` [E0053]

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Yes, &mut js::context::JSContext is what we use now, and adding a method to cx in Bindings.conf makes that argument be added.

@jerensl jerensl Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Yes, &mut js::context::JSContext is what we use now, and adding a method to cx in Bindings.conf makes that argument be added.

I still got the error after updating cx in Bindings.conf and doing the rebuild

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Then it looks like the implementation in doucment.rs needs to be updated with the correct argument type?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Well, this PR was behind the current &mut js::context::JSContext implementation. After updating the branch, it now generates the cx bindings

@jdm

jdm commented Oct 16, 2026

Copy link
Copy Markdown
Member

Closing in favour of #48506. Thanks for the initial implementation!

@jdm jdm closed this Oct 16, 2026
opensource-fork-sync Bot pushed a commit to cla7aye15I4nd/opensource-servo__servo that referenced this pull request Oct 24, 2026
Resurrecting the implementation of ObservableArray in servo#46130

Testing: 
- ./mach test-wpt
tests/wpt/tests/webidl/ecmascript-binding/observable-array-ownkeys.window.js
- ./mach test-wpt
tests/wpt/tests/webidl/ecmascript-binding/observable-array-no-leak-of-internals.window.js
- ./mach test-wpt
tests/wpt/meta/css/cssom/CSSStyleSheet-constructable-insertRule-base-uri.html
- ./mach test-wpt
tests/wpt/meta/custom-elements/state/state-css-selector-shadow-dom.html
- ./mach test-wpt
tests/wpt/meta/webidl/ecmascript-binding/observable-array-ownkeys.window.js

Fixes servo#37902
Fixes servo#38132

---------

Signed-off-by: Jerens Lensun <[email protected]>
Co-authored-by: Ashwin Naren <[email protected]>
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.

Feature Tracking: Adopted Stylesheet Implement ObservableArray

4 participants