mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
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:
parent
1df1ba58d6
commit
53a2e61fec
13 changed files with 224 additions and 45 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue