Make DOMPoint and DOMPointReadOnly serializable (#35989)

* script: Make DOMPointReadOnly serializable.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* script: Make DOMPoint serializable.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* script: Shrink worker script event.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* Update components/script/dom/dompoint.rs

Co-authored-by: Martin Robinson <mrobinson@igalia.com>
Signed-off-by: Josh Matthews <josh@joshmatthews.net>

---------

Signed-off-by: Josh Matthews <josh@joshmatthews.net>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
This commit is contained in:
Josh Matthews 2025-03-26 21:35:02 -04:00 committed by GitHub
parent 1df1ba58d6
commit 53a2e61fec
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 224 additions and 45 deletions

View file

@ -195,6 +195,7 @@ impl PipelineNamespace {
namespace_id_method! {next_service_worker_registration_id, ServiceWorkerRegistrationId,
self, ServiceWorkerRegistrationIndex}
namespace_id_method! {next_blob_id, BlobId, self, BlobIndex}
namespace_id_method! {next_dom_point_id, DomPointId, self, DomPointIndex}
}
thread_local!(pub static PIPELINE_NAMESPACE: Cell<Option<PipelineNamespace>> = const { Cell::new(None) });
@ -411,6 +412,19 @@ impl BlobId {
}
}
namespace_id! {DomPointId, DomPointIndex, "DomPoint"}
impl DomPointId {
pub fn new() -> DomPointId {
PIPELINE_NAMESPACE.with(|tls| {
let mut namespace = tls.get().expect("No namespace set for this thread!");
let next_point_id = namespace.next_dom_point_id();
tls.set(Some(namespace));
next_point_id
})
}
}
namespace_id! {HistoryStateId, HistoryStateIndex, "HistoryState"}
impl HistoryStateId {