Skip to content

script: Introduce Promise::reject_error_with_cx - #45320

Merged
TimvdLippe merged 1 commit into
servo:mainfrom
TimvdLippe:cx-reject-error
Jun 3, 2026
Merged

script: Introduce Promise::reject_error_with_cx#45320
TimvdLippe merged 1 commit into
servo:mainfrom
TimvdLippe:cx-reject-error

Conversation

@TimvdLippe

Copy link
Copy Markdown
Contributor

This allows for a gradual migration to pass in cx, to avoid having to do a big bang change across all code.

All call-sides were automatically migrated using the following regex replacement:

Before:

.reject_error\([ \n]*(.+),[ \n]+CanGc::from_cx\(cx\),?[ \n]*\);

After:

.reject_error_with_cx(cx, $1);

Part of #40600

Testing: it compiles

This allows for a gradual migration to pass in `cx`, to avoid
having to do a big bang change across all code.

Part of servo#40600

Testing: it compiles

Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
@TimvdLippe TimvdLippe added the T-linux-wpt Do a try run of the WPT label Jun 2, 2026
@servo-highfive servo-highfive added the S-awaiting-review There is new code that needs to be reviewed. label Jun 2, 2026
@github-actions github-actions Bot removed the T-linux-wpt Do a try run of the WPT label Jun 2, 2026
@github-actions

github-actions Bot commented Jun 2, 2026

Copy link
Copy Markdown

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

@servo-highfive servo-highfive removed the S-awaiting-review There is new code that needs to be reviewed. label Jun 2, 2026
@github-actions

github-actions Bot commented Jun 2, 2026

Copy link
Copy Markdown

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

Flaky unexpected result (64)
  • OK /IndexedDB/idbdatabase_deleteObjectStore.any.worker.html (#43776)
    • PASS [expected FAIL] subtest: Deleted object store's name should be removed from database's list. Attempting to use a deleted IDBObjectStore should throw an InvalidStateError
  • OK /IndexedDB/idbtransaction-oncomplete.any.html (#42845)
    • FAIL [expected PASS] subtest: IDBTransaction - complete event

      assert_array_equals: lengths differ, expected array ["upgradeneeded", "complete", "success", "opencursor"] length 4, got ["upgradeneeded", "complete", "success"] length 3
      

  • ERROR [expected OK] /_mozilla/mozilla/upstream/css-variables-setProperty-recompute.html
  • OK /_webgl/conformance/textures/misc/texture-upload-size.html (#21770)
    • FAIL [expected PASS] subtest: WebGL test #45

      assert_true: Texture was smaller than the expected size 2x2 expected true got false
      

    • FAIL [expected PASS] subtest: WebGL test #47

      assert_true: getError expected: INVALID_VALUE. Was NO_ERROR : when calling texSubImage2D with the same texture upload with offset 1, 1 expected true got false
      

    • FAIL [expected PASS] subtest: WebGL test #49

      assert_true: Texture was smaller than the expected size 2x2 expected true got false
      

    • FAIL [expected PASS] subtest: WebGL test #51

      assert_true: getError expected: INVALID_VALUE. Was NO_ERROR : when calling texSubImage2D with the same texture upload with offset 1, 1 expected true got false
      

    • PASS [expected FAIL] subtest: WebGL test #53
    • PASS [expected FAIL] subtest: WebGL test #55
    • PASS [expected FAIL] subtest: WebGL test #57
    • PASS [expected FAIL] subtest: WebGL test #59
    • FAIL [expected PASS] subtest: WebGL test #61

      assert_true: Texture was smaller than the expected size 2x2 expected true got false
      

    • FAIL [expected PASS] subtest: WebGL test #63

      assert_true: getError expected: INVALID_VALUE. Was NO_ERROR : when calling texSubImage2D with the same texture upload with offset 1, 1 expected true got false
      

    • And 14 more unexpected results...
  • CRASH [expected OK] /content-security-policy/meta/sandbox-iframe.html (#43478)
  • FAIL [expected PASS] /css/css-backgrounds/background-size-041.html
  • OK /dom/nodes/moveBefore/iframe-document-preserve.window.html (#43152)
    • 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
      

  • OK [expected ERROR] /fetch/fetch-later/quota/same-origin-iframe/multiple-iframes.https.window.html (#35176)
  • OK /fetch/metadata/generated/css-font-face.sub.tentative.html (#34624)
    • PASS [expected FAIL] subtest: sec-fetch-storage-access - Not sent to non-trustworthy same-site destination
  • ERROR [expected OK] /fetch/metadata/window-open.https.sub.html (#40339)
  • 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-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
  • TIMEOUT [expected OK] /html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/form-requestsubmit.html (#44098)
    • TIMEOUT [expected FAIL] subtest: Replace before load, triggered by formElement.requestSubmit()

      Test timed out
      

  • CRASH [expected OK] /html/browsers/browsing-the-web/unloading-documents/prompt/003.html
  • 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])
      

  • CRASH [expected OK] /html/browsers/history/the-location-interface/reload_document_open_write.html
  • OK /html/interaction/focus/the-autofocus-attribute/supported-elements.html (#24145)
    • FAIL [expected PASS] subtest: Non-HTMLElement should not support autofocus

      promise_test: Unhandled rejection with value: object "TypeError: can't access property "tagName", w.document.activeElement is null"
      

  • OK /html/semantics/embedded-content/the-iframe-element/iframe-loading-lazy-nav-form-submit.html (#32607)
    • FAIL [expected PASS] subtest: Navigating iframe loading='lazy' before it is loaded: form submit

      uncaught exception: Error: assert_equals: expected "http://web-platform.test:8000/html/semantics/embedded-content/the-iframe-element/support/blank.htm?" but got "http://web-platform.test:8000/html/semantics/embedded-content/the-iframe-element/support/blank.htm?src"
      

  • CRASH [expected FAIL] /html/semantics/interestfor/interestfor-plain-inline-element.tentative.html
  • OK /html/semantics/scripting-1/the-script-element/execution-timing/077.html (#22139)
    • FAIL [expected PASS] subtest: adding several types of scripts through the DOM and removing some of them confuses scheduler

      assert_array_equals: expected property 1 to be "Script #1 ran" but got "Script #3 ran" (expected array ["Script #2 ran", "Script #1 ran", "Script #3 ran", "Script #4 ran"] got ["Script #2 ran", "Script #3 ran", "Script #4 ran", "Script #1 ran"])
      

  • OK /html/semantics/scripting-1/the-script-element/module/dynamic-import/blob-url.any.worker-module.html (#43510)
    • FAIL [expected PASS] subtest: Revoking a blob URL immediately after calling import will not fail

      promise_test: Unhandled rejection with value: object "TypeError: Module fetching failed"
      

  • OK /html/semantics/scripting-1/the-script-element/module/dynamic-import/blob-url.any.worker.html (#33909)
    • FAIL [expected PASS] subtest: Revoking a blob URL immediately after calling import will not fail

      promise_test: Unhandled rejection with value: object "TypeError: Module fetching failed"
      

  • OK /html/semantics/scripting-1/the-script-element/module/modulepreload-referrerpolicy.html
    • FAIL [expected PASS] subtest: Modulepreload with same-origin policy should send full referrer for same-origin requests

      assert_equals: Modulepreload with same-origin policy should send full referrer for same-origin requests expected "http://web-platform.test:8000/html/semantics/scripting-1/the-script-element/module/modulepreload-referrerpolicy.html" but got "http://web-platform.test:8000/"
      

  • TIMEOUT [expected OK] /infrastructure/testdriver/click_nested.html (#43887)
    • NOTRUN [expected FAIL] subtest: TestDriver click method with multiple windows and nested iframe
  • 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
      

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

  • CRASH [expected OK] /resource-timing/initiator-type/svg.html
  • OK /resource-timing/test_resource_timing.https.html (#25216)
    • FAIL [expected PASS] subtest: PerformanceEntry has correct name, initiatorType, startTime, and duration (xmlhttprequest)

      assert_equals: expected 48.74000000000001 but got 48.74
      

  • OK /sanitizer-api/sanitizer-inert-document.html (#45260)
    • PASS [expected FAIL] subtest: Test whether setHTML loads the image.
    • FAIL [expected PASS] subtest: Test whether setHTMLUnsafe loads the image.

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

  • TIMEOUT /trusted-types/trusted-types-navigation.html?06-10 (#37920)
    • TIMEOUT [expected FAIL] subtest: Navigate a frame via anchor with javascript:-urls in report-only mode.

      Test timed out
      

    • NOTRUN [expected TIMEOUT] subtest: Navigate a frame via anchor with javascript:-urls w/ default policy in report-only mode.
  • TIMEOUT [expected OK] /trusted-types/trusted-types-navigation.html?16-20 (#44835)
    • FAIL [expected PASS] subtest: Navigate a frame via area with javascript:-urls in report-only mode.

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

    • TIMEOUT [expected PASS] subtest: Navigate a frame via area with javascript:-urls w/ default policy in report-only mode.

      Test timed out
      

  • OK /visual-viewport/resize-event-order.html (#41981)
    • PASS [expected FAIL] subtest: Popup: DOMWindow resize fired before VisualViewport.
  • CRASH [expected OK] /workers/SharedWorker-extendedLifetime-data.html
  • CRASH [expected TIMEOUT] /workers/SharedWorker_dataUrl.html
  • CRASH [expected OK] /workers/Worker-location.sub.any.worker.html
  • CRASH [expected ERROR] /workers/Worker-replace-self.any.sharedworker.html
  • CRASH [expected OK] /workers/Worker-timeout-increasing-order.html
  • CRASH [expected OK] /workers/WorkerLocation_href.htm
  • CRASH [expected OK] /workers/Worker_ErrorEvent_filename.htm
  • CRASH [expected OK] /workers/constructors/SharedWorker/number-arguments.html
  • CRASH [expected OK] /workers/constructors/SharedWorker/same-origin.html
  • CRASH [expected OK] /workers/constructors/Worker/constructor-utf16-bom.html
  • CRASH [expected OK] /workers/constructors/Worker/ctor-1.html
  • CRASH [expected OK] /workers/constructors/Worker/same-origin.html
  • CRASH [expected OK] /workers/constructors/Worker/terminate.html
  • CRASH [expected OK] /workers/dedicated-worker-parse-error-failure.html
  • CRASH [expected OK] /workers/examples/fetch_tests_from_worker.html
  • CRASH [expected ERROR] /workers/examples/general.any.serviceworker.html
  • CRASH [expected OK] /workers/examples/general.worker.html
  • CRASH [expected OK] /workers/interfaces/DedicatedWorkerGlobalScope/EventTarget.worker.html
  • CRASH [expected OK] /workers/interfaces/SharedWorkerGlobalScope/name/setting.html
  • CRASH [expected OK] /workers/interfaces/SharedWorkerGlobalScope/onconnect.html
  • CRASH [expected OK] /workers/interfaces/WorkerGlobalScope/onerror/handled.html
  • CRASH [expected ERROR] /workers/interfaces/WorkerGlobalScope/self.any.serviceworker.html
  • CRASH [expected OK] /workers/interfaces/WorkerUtils/WindowTimers/002.html
  • CRASH [expected OK] /workers/interfaces/WorkerUtils/importScripts/005.html
  • CRASH [expected ERROR] /workers/interfaces/WorkerUtils/importScripts/report-error-redirect-to-cross-origin.sub.any.sharedworker.html
  • CRASH [expected OK] /workers/interfaces/WorkerUtils/navigator/008.worker.html
  • CRASH [expected OK] /workers/modules/shared-worker-import-data-url-cross-origin.html
  • CRASH [expected OK] /workers/modules/shared-worker-import-referrer.html
  • CRASH [expected OK] /workers/postMessage_target_source.htm
  • CRASH [expected OK] /workers/same-site-cookies/first-party.default.tentative.https.window.html
Stable unexpected results that are known to be intermittent (16)
  • 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.
  • 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(fangsong)
  • OK /css/css-fonts/generic-family-keywords-003.html (#38994)
    • PASS [expected FAIL] subtest: @font-face matching for quoted and unquoted cursive (drawing text in a canvas)
    • PASS [expected FAIL] subtest: @font-face matching for quoted and unquoted fantasy (drawing text in a canvas)
    • PASS [expected FAIL] subtest: @font-face matching for quoted and unquoted monospace (drawing text in a canvas)
    • PASS [expected FAIL] subtest: @font-face matching for quoted and unquoted system-ui (drawing text in a canvas)
    • PASS [expected FAIL] subtest: @font-face matching for quoted and unquoted math (drawing text in a canvas)
    • PASS [expected FAIL] subtest: @font-face matching for quoted and unquoted generic(kai) (drawing text in a canvas)
    • PASS [expected FAIL] subtest: @font-face matching for quoted and unquoted generic(nastaliq) (drawing text in a canvas)
  • TIMEOUT [expected OK] /fetch/api/redirect/redirect-keepalive.https.any.html (#32153)
    • TIMEOUT [expected PASS] subtest: [keepalive][iframe][load] mixed content redirect; setting up

      Test timed out
      

  • OK /html/browsers/browsing-the-web/navigating-across-documents/navigation-unload-same-origin-fragment.html (#20768)
    • PASS [expected FAIL] subtest: Tests that a fragment navigation in the unload handler will not block the initial navigation
  • TIMEOUT [expected OK] /html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/form-submit.html (#44028)
  • OK [expected ERROR] /html/canvas/offscreen/text/2d.text.measure.getActualBoundingBox.tentative.html (#43710)
  • TIMEOUT [expected OK] /html/user-activation/navigation-state-reset-sameorigin.html (#45151)
    • TIMEOUT [expected PASS] subtest: Post-navigation state reset.

      Test timed out
      

  • OK /html/webappapis/user-prompts/print-during-unload.html (#35944)
    • FAIL [expected PASS] subtest: print() during unload

      assert_array_equals: expected property 1 to be "destination" but got "error: window.print is not a function" (expected array ["start", "destination"] got ["start", "error: window.print is not a function"])
      

  • FAIL [expected PASS] /png/apng/acTL-plays-one.html (#41218)
  • 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 /resource-timing/test_resource_timing.html (#25720)
    • PASS [expected FAIL] subtest: PerformanceEntry has correct name, initiatorType, startTime, and duration (xmlhttprequest)
  • TIMEOUT /trusted-types/trusted-types-navigation.html?31-35 (#38034)
    • TIMEOUT [expected PASS] subtest: Navigate a frame via form-submission with javascript:-urls in report-only mode.

      Test timed out
      

    • NOTRUN [expected TIMEOUT] subtest: Navigate a frame via form-submission with javascript:-urls w/ default policy in report-only mode.
  • OK /webdriver/tests/classic/execute_async_script/promise.py (#45198)
    • FAIL [expected PASS] subtest: test_promise_reject_timeout_none

      AssertionError
      

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

      Test timed out
      

@github-actions

github-actions Bot commented Jun 2, 2026

Copy link
Copy Markdown

✨ Try run (#26843305503) succeeded.

@TimvdLippe
TimvdLippe added this pull request to the merge queue Jun 3, 2026
@servo-highfive servo-highfive added the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Jun 3, 2026
Merged via the queue into servo:main with commit 3a215a9 Jun 3, 2026
71 checks passed
@TimvdLippe
TimvdLippe deleted the cx-reject-error branch June 3, 2026 06:25
@servo-highfive servo-highfive removed the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Jun 3, 2026
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.

3 participants