Skip to content

SharedWorker: Implement constructor, port wiring, and connect event delivery - #44761

Merged
Taym95 merged 6 commits into
servo:mainfrom
Taym95:sharedworker-constructor-connect-startup
May 18, 2026
Merged

Taym95 merged 6 commits into
servo:mainfrom
Taym95:sharedworker-constructor-connect-startup

Conversation

@Taym95

@Taym95 Taym95 commented May 6, 2026 •

Copy link
Copy Markdown
Member

this PR implements the SharedWorker constructor, creates and exposes port, starts a SharedWorkerGlobalScope, and delivers connections to the worker through connect events using MessageEvent with the worker port in event.ports[0].

Testing: more SharedWorker WPT test are passing now.

part of #7458

@Taym95
Taym95 requested a review from gterzian as a code owner May 6, 2026 11:35
@servo-highfive servo-highfive added S-awaiting-review There is new code that needs to be reviewed. S-needs-rebase There are merge conflict errors. labels May 6, 2026
@Taym95
Taym95 force-pushed the sharedworker-constructor-connect-startup branch from 7173fe6 to 13df311 Compare May 6, 2026 11:47
@servo-highfive servo-highfive removed the S-needs-rebase There are merge conflict errors. label May 6, 2026
@Taym95
Taym95 marked this pull request as draft May 6, 2026 11:53
@Taym95 Taym95 added the T-linux-wpt Do a try run of the WPT label May 6, 2026
@github-actions github-actions Bot removed the T-linux-wpt Do a try run of the WPT label May 6, 2026
@github-actions

github-actions Bot commented May 6, 2026

Copy link
Copy Markdown

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

@github-actions

github-actions Bot commented May 6, 2026

Copy link
Copy Markdown

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

Flaky unexpected result (62)
  • TIMEOUT /FileAPI/url/url-in-tags-revoke.window.html (#19978)
    • TIMEOUT [expected PASS] subtest: Fetching a blob URL immediately before revoking it works in <script> tags.

      Test timed out
      

  • OK /IndexedDB/idbdatabase_deleteObjectStore.any.html (#43823)
    • 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/transaction-create_in_versionchange.any.html (#44200)
    • PASS [expected FAIL] subtest: Attempt to create new transactions inside a versionchange transaction
  • ERROR [expected OK] /_mozilla/mozilla/hit-test-pos-fixed.html
  • CRASH [expected OK] /content-security-policy/meta/sandbox-iframe.html (#43478)
  • FAIL [expected PASS] /css/css-backgrounds/background-size-041.html
  • 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-002.html (#40929)
    • FAIL [expected PASS] subtest: font-family: -webkit-serif treated as <font-family>, not <generic-name>

      assert_equals: expected 30 but got 50
      

    • FAIL [expected PASS] subtest: font-family: -webkit-sans-serif treated as <font-family>, not <generic-name>

      assert_equals: expected 30 but got 50
      

    • FAIL [expected PASS] subtest: font-family: -webkit-cursive treated as <font-family>, not <generic-name>

      assert_equals: expected 30 but got 50
      

    • FAIL [expected PASS] subtest: font-family: -webkit-fantasy treated as <font-family>, not <generic-name>

      assert_equals: expected 30 but got 50
      

    • FAIL [expected PASS] subtest: font-family: -webkit-monospace treated as <font-family>, not <generic-name>

      assert_equals: expected 30 but got 50
      

    • FAIL [expected PASS] subtest: font-family: -webkit-system-ui treated as <font-family>, not <generic-name>

      assert_equals: expected 30 but got 50
      

    • FAIL [expected PASS] subtest: font-family: -webkit-math treated as <font-family>, not <generic-name>

      assert_equals: expected 30 but got 50
      

    • PASS [expected FAIL] subtest: font-family: -webkit-generic(fangsong) treated as <font-family>, not <generic-name>
    • PASS [expected FAIL] subtest: font-family: -webkit-generic(kai) treated as <font-family>, not <generic-name>
    • PASS [expected FAIL] subtest: font-family: -webkit-generic(khmer-mul) treated as <font-family>, not <generic-name>
    • And 12 more unexpected results...
  • OK /css/css-fonts/variations/font-weight-matching.html (#38577)
    • FAIL [expected PASS] subtest: Test @font-face matching for weight 99

      assert_approx_equals: @font-face should be mapped to CSSTest Weights 900. expected 90 +/- 2 but got 180
      

    • FAIL [expected PASS] subtest: Test @font-face matching for weight 100

      assert_approx_equals: @font-face should be mapped to CSSTest Weights 900. expected 90 +/- 2 but got 180
      

    • FAIL [expected PASS] subtest: Test @font-face matching for weight 249

      assert_approx_equals: @font-face should be mapped to CSSTest Weights 900. expected 90 +/- 2 but got 180
      

    • FAIL [expected PASS] subtest: Test @font-face matching for weight 400

      assert_approx_equals: @font-face should be mapped to CSSTest Weights 700. expected 90 +/- 2 but got 180
      

    • FAIL [expected PASS] subtest: Test @font-face matching for weight 470

      assert_approx_equals: @font-face should be mapped to CSSTest Weights 300. expected 90 +/- 2 but got 180
      

    • FAIL [expected PASS] subtest: Test @font-face matching for weight 500

      assert_approx_equals: @font-face should be mapped to CSSTest Weights 300. expected 90 +/- 2 but got 180
      

  • FAIL [expected PASS] /css/css-ui/appearance-menulist-button-001.html
  • OK [expected ERROR] /fetch/fetch-later/quota/same-origin-iframe/multiple-iframes.https.window.html (#35176)
  • OK /fetch/metadata/generated/css-font-face.https.sub.tentative.html (#32732)
    • PASS [expected FAIL] subtest: sec-fetch-dest
  • 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-origin destination
  • 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
  • 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)&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"
      

  • OK /html/browsers/history/the-history-interface/traverse_the_history_4.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/sandboxing/sandbox-initial-empty-document-toward-same-origin.html (#35948)
  • TIMEOUT [expected OK] /html/interaction/focus/the-autofocus-attribute/update-the-rendering.html (#24145)
    • TIMEOUT [expected FAIL] subtest: "Flush autofocus candidates" should be happen before a scroll event and animation frame callbacks

      Test timed out
      

  • 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
  • TIMEOUT [expected OK] /html/semantics/embedded-content/the-iframe-element/iframe_sandbox_navigate_other_frame_popup.sub.html (#39702)
    • TIMEOUT [expected FAIL] subtest: Sandboxed iframe can not navigate other frame's popup

      Test timed out
      

  • CRASH [expected ERROR] /html/semantics/forms/the-select-element/customizable-select/select-appearance-button-after-span.html
  • OK /html/semantics/scripting-1/the-script-element/module/choice-of-error-1.html (#44058)
    • PASS [expected FAIL] subtest: Parse errors in different files should be reported depending on different roots
  • 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"
      

  • TIMEOUT [expected OK] /html/user-activation/propagation-sameorigin.html
    • NOTRUN [expected PASS] subtest: Propagation test
  • PASS [expected FAIL] /png/apng/acTL-plays-one.html (#41218)
  • PASS [expected FAIL] /png/apng/fcTL-dispose-none.html (#41817)
  • 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'
  • CRASH [expected OK] /pointerevents/pointerevent_touch-action-none-css_touch.html
  • OK /resource-timing/buffer-full-when-populate-entries.html (#44408)
    • PASS [expected FAIL] subtest: Test that a buffer full event does not bubble and that resourcetimingbufferfull is called only once per overflow
  • OK [expected TIMEOUT] /trusted-types/trusted-types-navigation.html?01-05 (#38975)
    • PASS [expected TIMEOUT] subtest: Navigate a window via anchor with javascript:-urls in report-only mode.
    • PASS [expected NOTRUN] subtest: Navigate a window via anchor with javascript:-urls w/ default policy in report-only mode.
    • PASS [expected NOTRUN] subtest: Navigate a frame via anchor with javascript:-urls in enforcing mode.
  • OK [expected TIMEOUT] /trusted-types/trusted-types-navigation.html?06-10 (#37920)
    • PASS [expected TIMEOUT] subtest: Navigate a frame via anchor with javascript:-urls w/ default policy in report-only mode.
    • FAIL [expected NOTRUN] subtest: Navigate a window via anchor 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 anchor 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!\""
      

  • 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 /webaudio/the-audio-api/the-audiobuffersourcenode-interface/sub-sample-buffer-stitching.html (#22849)
    • FAIL [expected PASS] subtest: buffer-stitching-2

      assert_approx_equals: Stitched sine‑wave buffers at sample rate 43800 sample[36549] |-4.01764232993429e-10 - -0.8484253287315369| = 0.8484253283297727 > 0.0038986 expected -0.8484253287315369 +/- 0.0038986 but got -4.01764232993429e-10
      

  • CRASH [expected OK] /webaudio/the-audio-api/the-mediastreamaudiodestinationnode-interface/closed-audiocontext-construction.html
  • CRASH [expected ERROR] /workers/Worker-base64.any.serviceworker.html
  • CRASH [expected OK] /workers/WorkerLocation-origin.sub.window.html
  • CRASH [expected ERROR] /workers/WorkerNavigator-hardware-concurrency.any.sharedworker.html
  • CRASH [expected ERROR] /workers/WorkerNavigator.any.serviceworker.html
  • CRASH [expected OK] /workers/WorkerNavigator_appName.htm
  • CRASH [expected OK] /workers/constructors/SharedWorker/interface-objects.html
  • CRASH [expected OK] /workers/constructors/SharedWorker/port-properties.html
  • CRASH [expected OK] /workers/constructors/SharedWorker/port-readonly.html
  • CRASH [expected OK] /workers/constructors/SharedWorker/setting-port-members.html
  • CRASH [expected OK] /workers/constructors/Worker/expected-self-properties.worker.html
  • CRASH [expected OK] /workers/constructors/Worker/terminate.html
  • CRASH [expected OK] /workers/dedicated-worker-parse-error-failure.html
  • CRASH [expected ERROR] /workers/importscripts_mime.any.serviceworker.html
  • CRASH [expected OK] /workers/importscripts_mime.any.worker.html
  • CRASH [expected OK] /workers/importscripts_mime_local.any.worker.html
  • CRASH [expected OK] /workers/interfaces/DedicatedWorkerGlobalScope/postMessage/event-ports-dedicated.html
  • CRASH [expected OK] /workers/interfaces/WorkerGlobalScope/location/worker-separate-file.html
  • CRASH [expected OK] /workers/interfaces/WorkerUtils/WindowTimers/001.html
  • CRASH [expected OK] /workers/interfaces/WorkerUtils/WindowTimers/002.html
  • CRASH [expected OK] /workers/interfaces/WorkerUtils/WindowTimers/003.html
  • CRASH [expected OK] /workers/interfaces/WorkerUtils/importScripts/report-error-cross-origin.sub.any.worker.html
  • CRASH [expected ERROR] /workers/interfaces/WorkerUtils/importScripts/report-error-same-origin.sub.any.sharedworker.html
  • CRASH [expected OK] /workers/modules/dedicated-worker-options-credentials.html
  • CRASH [expected OK] /workers/modules/shared-worker-import-meta.html
  • CRASH [expected OK] /workers/postMessage_DataCloneErr.htm
  • CRASH [expected OK] /workers/same-site-cookies/third-party.none.tentative.sub.https.window.html
  • CRASH [expected OK] /workers/semantics/multiple-workers/002.html
  • CRASH [expected OK] /xhr/access-control-preflight-request-header-lowercase.htm
Stable unexpected results that are known to be intermittent (13)
  • TIMEOUT [expected OK] /_mozilla/mozilla/window-resize-event.html (#36741)
    • TIMEOUT [expected PASS] subtest: Popup onresize event fires after resizeTo

      Test timed out
      

  • 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 6 more unexpected results...
  • OK [expected TIMEOUT] /credential-management/credentialscontainer-frame-basics.https.html (#39430)
    • FAIL [expected TIMEOUT] subtest: navigator.credentials should be undefined in documents generated from data: URLs.

      assert_equals: expected "undefined" but got "[object CredentialsContainer]"
      

  • OK /css/css-fonts/generic-family-keywords-001.html (#37467)
    • FAIL [expected PASS] subtest: @font-face matching for quoted and unquoted generic(khmer-mul)

      assert_equals: quoted generic(khmer-mul) matches  @font-face rule expected 50 but got 30
      

    • FAIL [expected PASS] subtest: @font-face matching for quoted and unquoted generic(nastaliq)

      assert_equals: quoted generic(nastaliq) matches  @font-face rule expected 50 but got 30
      

  • OK /css/css-fonts/generic-family-keywords-003.html (#38994)
    • PASS [expected FAIL] subtest: @font-face matching for quoted and unquoted sans-serif (drawing text in a canvas)
    • 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(fangsong) (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(khmer-mul) (drawing text in a canvas)
    • PASS [expected FAIL] subtest: @font-face matching for quoted and unquoted generic(nastaliq) (drawing text in a canvas)
  • 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/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/history/the-history-interface/traverse_the_history_5.html (#21383)
    • PASS [expected FAIL] subtest: Multiple history traversals, last would be aborted
  • ERROR [expected OK] /html/canvas/offscreen/text/2d.text.measure.getActualBoundingBox.tentative.html (#43710)
  • OK /html/semantics/document-metadata/the-meta-element/pragma-directives/attr-meta-http-equiv-refresh/allow-scripts-flag-changing-1.html (#39694)
    • PASS [expected FAIL] subtest: Meta refresh is blocked by the allow-scripts sandbox flag at its creation time, not when refresh comes due
  • OK /navigation-timing/test-navigation-type-reload.html (#33334)
    • FAIL [expected PASS] subtest: Reload domInteractive > Original domInteractive

      assert_true: Reload domInteractive > Original domInteractive expected true got false
      

  • CRASH [expected OK] /resource-timing/render-blocking-status-link.html (#41664)
  • OK /trusted-types/trusted-types-reporting.html (#43737)
    • FAIL [expected PASS] subtest: Trusted Type violation report: creating a forbidden-but-not-reported policy.

      assert_equals: a single violation reported expected 1 but got 0
      

    • FAIL [expected PASS] subtest: Trusted Type violation report: sample for SVGScriptElement href assignment by setAttribute

      assert_equals: a single violation reported expected 1 but got 0
      

    • FAIL [expected PASS] subtest: Trusted Type violation report: Worker constructor

      assert_equals: a single violation reported expected 1 but got 2
      

@github-actions

github-actions Bot commented May 6, 2026

Copy link
Copy Markdown

✨ Try run (#25460135341) succeeded.

@Taym95
Taym95 marked this pull request as ready for review May 9, 2026 19:59
@servo-highfive servo-highfive added the S-needs-rebase There are merge conflict errors. label May 9, 2026
@Taym95
Taym95 force-pushed the sharedworker-constructor-connect-startup branch from b19b861 to b6d159d Compare May 15, 2026 10:22
@servo-highfive servo-highfive removed the S-needs-rebase There are merge conflict errors. label May 15, 2026

@TimvdLippe TimvdLippe left a comment

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.

WPT setup LGTM, thanks for cleaning that up. The actual implementation I will defer to other reviewers, as I am not yet familiar with that. Glad to see so many tests starting to pass 🎉

@servo-highfive servo-highfive removed the S-awaiting-review There is new code that needs to be reviewed. label May 15, 2026

@gterzian gterzian left a comment

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.

LGTM overall as a first step, with some comments mostly about documentation.

}
},
SharedWorkerScriptMsg::CommonWorker(WorkerScriptMsg::DOMMessage(_)) => {
unreachable!("SharedWorkerGlobalScope does not support direct DOMMessage dispatch")

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.

Is this because of the message port being used for those, right? Good to clarify.

Also debug_assert probably better choice than unreachable.

let credentials = worker_options.parent.credentials.convert();

// Step 3. Let outsideSettings be this's relevant settings object.
// (outsideSettings is `global` throughout.)

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.

Note bad to keep it as a note.

debugger_global: &DebuggerGlobalScope,
) -> SharedWorkerGlobalScope {
SharedWorkerGlobalScope {
// Step 9. Set worker global scope's type to options["type"].

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.

this doesn't seem to belong here, it seems to be step 10.3 of run a worker.

own_sender: Sender<SharedWorkerScriptMsg>,
worker: DomRefCell<Option<TrustedSharedWorkerAddress>>,
parent_event_loop_sender: ScriptEventLoopSender,
pending_connects: DomRefCell<Vec<Dom<MessagePort>>>,

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.

There should be only ever one pending no?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yes indeed

if let Some(dedicated) = self.downcast::<DedicatedWorkerGlobalScope>() {
dedicated.fire_queued_messages(cx);
} else if let Some(shared) = self.downcast::<SharedWorkerGlobalScope>() {
shared.enable_outside_port_message_queue();

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.

Step 11: Enable outside port's port message queue.

worker.upcast().fire_event(cx, atom!("error"));
}

pub(crate) fn enable_outside_port_message_queue(

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.

Step 11 of onComplete of run a worker.

.expect("Sending to parent failed");
}

pub(crate) fn enable_outside_port_message_queue(&self) {

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.

Part of onComplete.

)
}

pub(crate) fn forward_simple_error_at_worker(&self) {

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.

part of onComplete

global.font_context().cloned(),
);

sender

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.

Good to clarify this is kind of the onComplete hook, except that it could be received by the worker too early, in which case the effect is queued.

// TODO Step 9. Let outsideStorageKey be the result of running obtain a storage key
// for non-storage purposes given outsideSettings.
// Step 11. Enqueue the following steps to the shared worker manager.
// TODO Steps 12-16.

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.

Good to clarify that the worker now essentially works as a dedicated worker.

Signed-off-by: Taym Haddadi <[email protected]>
@servo-highfive servo-highfive added the S-awaiting-review There is new code that needs to be reviewed. label May 18, 2026
@Taym95
Taym95 enabled auto-merge May 18, 2026 15:49
@Taym95
Taym95 added this pull request to the merge queue May 18, 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 May 18, 2026
Merged via the queue into servo:main with commit 80da5bc May 18, 2026
33 checks passed
@Taym95
Taym95 deleted the sharedworker-constructor-connect-startup branch May 18, 2026 17:12
@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 May 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-awaiting-review There is new code that needs to be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants