From 1716aee26bc385d5976f5dd6dca03d4e4bd57fdf Mon Sep 17 00:00:00 2001 From: webbeef Date: Sat, 5 Sep 2026 20:50:52 -0700 Subject: [PATCH] servo: update our Promise usage to the new RootedPromise Signed-off-by: webbeef --- .../script/dom/abort/abortsignal.rs.patch | 6 +- .../components/script/dom/atproto.rs.patch | 41 +++++----- .../script/dom/brightnessdevice.rs.patch | 11 ++- .../script/dom/contentblocker.rs.patch | 22 +++--- patches/components/script/dom/dbus.rs.patch | 32 ++++---- .../components/script/dom/embedder.rs.patch | 11 ++- .../dom/html/htmlwebviewelement.rs.patch | 10 +-- .../script/dom/idledetector.rs.patch | 13 ++-- .../components/script/dom/keyboard.rs.patch | 14 ++-- .../script/dom/navigator/navigator.rs.patch | 42 +++++------ .../components/script/dom/pairing.rs.patch | 75 ++++++++++--------- patches/components/script/dom/power.rs.patch | 27 ++++--- .../script/dom/window/window.rs.patch | 30 +++++--- .../codegen/Bindings.conf.patch | 30 +++----- ui/homescreen/elements/home_item.js | 2 +- 15 files changed, 176 insertions(+), 190 deletions(-) diff --git a/patches/components/script/dom/abort/abortsignal.rs.patch b/patches/components/script/dom/abort/abortsignal.rs.patch index 8ab7eb7..e646c0f 100644 --- a/patches/components/script/dom/abort/abortsignal.rs.patch +++ b/patches/components/script/dom/abort/abortsignal.rs.patch @@ -5,7 +5,7 @@ use crate::dom::eventtarget::EventTarget; use crate::dom::globalscope::GlobalScope; +use crate::dom::idledetector::IdleDetector; -+use crate::dom::promise::Promise; ++use crate::dom::promise::RootedPromise; use crate::dom::readablestream::PipeTo; use crate::fetch::fetch::{DeferredFetchRecordId, FetchContext}; use crate::realms::enter_auto_realm; @@ -23,8 +23,8 @@ #[cfg_attr(crown, crown::unrooted_must_root_lint::must_root)] +pub(crate) struct IdleDetectorAbort { + pub(crate) detector: Trusted, -+ #[conditional_malloc_size_of] -+ pub(crate) promise: Rc, ++ #[ignore_malloc_size_of = "TODO"] ++ pub(crate) promise: RootedPromise, +} + +#[derive(Clone, JSTraceable, MallocSizeOf)] diff --git a/patches/components/script/dom/atproto.rs.patch b/patches/components/script/dom/atproto.rs.patch index 5d0909e..ab1d04a 100644 --- a/patches/components/script/dom/atproto.rs.patch +++ b/patches/components/script/dom/atproto.rs.patch @@ -1,10 +1,8 @@ --- original +++ modified -@@ -0,0 +1,301 @@ +@@ -0,0 +1,304 @@ +// SPDX-License-Identifier: AGPL-3.0-or-later + -+use std::rc::Rc; -+ +use dom_struct::dom_struct; +use js::context::JSContext; +use js::jsval::UndefinedValue; @@ -27,7 +25,7 @@ +use crate::dom::event::Event; +use crate::dom::eventtarget::EventTarget; +use crate::dom::globalscope::GlobalScope; -+use crate::dom::promise::Promise; ++use crate::dom::promise::promise::{Promise, RootedPromise}; +use crate::routed_promise::{RoutedPromiseListener, callback_promise}; + +#[dom_struct] @@ -86,9 +84,9 @@ +} + +impl AtProto { -+ fn request(&self, cx: &mut JSContext, request: AtProtoRequest) -> Rc { ++ fn request(&self, cx: &mut JSContext, request: AtProtoRequest) -> RootedPromise { + let global = &self.global(); -+ let promise = Promise::new(cx, global); ++ let promise = Promise::new_rooted(cx, global); + let task_manager = global.task_manager(); + let task_source = task_manager.dom_manipulation_task_source(); + let callback = callback_promise(&promise, self, task_source); @@ -128,7 +126,7 @@ + ); + + /// -+ fn Login(&self, cx: &mut JSContext, handle: USVString, password: USVString) -> Rc { ++ fn Login(&self, cx: &mut JSContext, handle: USVString, password: USVString) -> RootedPromise { + self.request( + cx, + AtProtoRequest::Login(handle.to_string(), password.to_string()), @@ -136,44 +134,44 @@ + } + + /// -+ fn Logout(&self, cx: &mut JSContext) -> Rc { ++ fn Logout(&self, cx: &mut JSContext) -> RootedPromise { + self.request(cx, AtProtoRequest::Logout) + } + + /// -+ fn Current(&self, cx: &mut JSContext) -> Rc { ++ fn Current(&self, cx: &mut JSContext) -> RootedPromise { + self.request(cx, AtProtoRequest::Current) + } + -+ fn AuthorizeOrigin(&self, cx: &mut JSContext, origin: USVString) -> Rc { ++ fn AuthorizeOrigin(&self, cx: &mut JSContext, origin: USVString) -> RootedPromise { + self.request(cx, AtProtoRequest::AuthorizeOrigin(origin.to_string())) + } + -+ fn RevokeOrigin(&self, cx: &mut JSContext, origin: USVString) -> Rc { ++ fn RevokeOrigin(&self, cx: &mut JSContext, origin: USVString) -> RootedPromise { + self.request(cx, AtProtoRequest::RevokeOrigin(origin.to_string())) + } + -+ fn AuthorizedOrigins(&self, cx: &mut JSContext) -> Rc { ++ fn AuthorizedOrigins(&self, cx: &mut JSContext) -> RootedPromise { + self.request(cx, AtProtoRequest::GetAuthorizedOrigins) + } + + /// -+ fn SyncRepo(&self, cx: &mut JSContext, did: USVString) -> Rc { ++ fn SyncRepo(&self, cx: &mut JSContext, did: USVString) -> RootedPromise { + self.request(cx, AtProtoRequest::SyncRepo(did.to_string())) + } + + /// -+ fn RepoStatus(&self, cx: &mut JSContext, did: USVString) -> Rc { ++ fn RepoStatus(&self, cx: &mut JSContext, did: USVString) -> RootedPromise { + self.request(cx, AtProtoRequest::RepoStatus(did.to_string())) + } + + /// -+ fn ClearRepo(&self, cx: &mut JSContext, did: USVString) -> Rc { ++ fn ClearRepo(&self, cx: &mut JSContext, did: USVString) -> RootedPromise { + self.request(cx, AtProtoRequest::ClearRepo(did.to_string())) + } + + /// -+ fn SearchText(&self, cx: &mut JSContext, needle: USVString, max_results: u32) -> Rc { ++ fn SearchText(&self, cx: &mut JSContext, needle: USVString, max_results: u32) -> RootedPromise { + self.request( + cx, + AtProtoRequest::SearchText(needle.to_string(), max_results), @@ -181,7 +179,7 @@ + } + + /// -+ fn SearchUrl(&self, cx: &mut JSContext, url: USVString, exact: bool) -> Rc { ++ fn SearchUrl(&self, cx: &mut JSContext, url: USVString, exact: bool) -> RootedPromise { + self.request(cx, AtProtoRequest::SearchUrl(url.to_string(), exact)) + } + @@ -191,7 +189,7 @@ + cx: &mut JSContext, + sql: USVString, + params: Vec, -+ ) -> Rc { ++ ) -> RootedPromise { + self.request( + cx, + AtProtoRequest::QueryStore( @@ -203,7 +201,12 @@ +} + +impl RoutedPromiseListener for AtProto { -+ fn handle_response(&self, cx: &mut JSContext, response: AtProtoResult, promise: &Rc) { ++ fn handle_response( ++ &self, ++ cx: &mut JSContext, ++ response: AtProtoResult, ++ promise: &RootedPromise, ++ ) { + match response { + AtProtoResult::NewSession(session, _) => { + println!("New session is {session:?}"); diff --git a/patches/components/script/dom/brightnessdevice.rs.patch b/patches/components/script/dom/brightnessdevice.rs.patch index 3b69775..3254287 100644 --- a/patches/components/script/dom/brightnessdevice.rs.patch +++ b/patches/components/script/dom/brightnessdevice.rs.patch @@ -1,13 +1,12 @@ --- original +++ modified -@@ -0,0 +1,133 @@ +@@ -0,0 +1,132 @@ +/* SPDX Id: AGPL-3.0-or-later */ + +//! A single brightness-controllable device (screen backlight, keyboard LED), +//! backed by the `beaver_hal` crate through the constellation. + +use std::cell::Cell; -+use std::rc::Rc; + +use dom_struct::dom_struct; +use js::context::JSContext; @@ -23,7 +22,7 @@ +use crate::dom::bindings::reflector::DomGlobal; +use crate::dom::bindings::root::DomRoot; +use crate::dom::globalscope::GlobalScope; -+use crate::dom::promise::Promise; ++use crate::dom::promise::{Promise, RootedPromise}; +use crate::routed_promise::{RoutedPromiseListener, callback_promise}; + +#[dom_struct] @@ -86,9 +85,9 @@ + /// cache only tracks this page's own writes: the level can also change from + /// outside (function keys, brightnessctl, logind). + /// TODO: replace by an "onchange" event. -+ fn Read(&self, cx: &mut JSContext) -> Rc { ++ fn Read(&self, cx: &mut JSContext) -> RootedPromise { + let global = &self.global(); -+ let promise = Promise::new(cx, global); ++ let promise = Promise::new_rooted(cx, global); + let task_manager = global.task_manager(); + let task_source = task_manager.dom_manipulation_task_source(); + let callback = callback_promise(&promise, self, task_source); @@ -123,7 +122,7 @@ + &self, + cx: &mut JSContext, + response: Result, -+ promise: &Rc, ++ promise: &RootedPromise, + ) { + match response { + Ok(percent) => { diff --git a/patches/components/script/dom/contentblocker.rs.patch b/patches/components/script/dom/contentblocker.rs.patch index fd4b2af..df7989f 100644 --- a/patches/components/script/dom/contentblocker.rs.patch +++ b/patches/components/script/dom/contentblocker.rs.patch @@ -1,10 +1,8 @@ --- original +++ modified -@@ -0,0 +1,139 @@ +@@ -0,0 +1,137 @@ +/* SPDX Id: AGPL-3.0-or-later */ + -+use std::rc::Rc; -+ +use dom_struct::dom_struct; +use js::context::JSContext; +use script_bindings::error::Error; @@ -18,7 +16,7 @@ +use crate::dom::bindings::root::DomRoot; +use crate::dom::bindings::str::USVString; +use crate::dom::globalscope::GlobalScope; -+use crate::dom::promise::Promise; ++use crate::dom::promise::{Promise, RootedPromise}; +use crate::routed_promise::{RoutedPromiseListener, callback_promise}; + +#[dom_struct] @@ -39,9 +37,9 @@ +} + +impl ContentBlockerMethods for ContentBlocker { -+ fn GetOriginState(&self, cx: &mut JSContext, origin: USVString) -> Rc { ++ fn GetOriginState(&self, cx: &mut JSContext, origin: USVString) -> RootedPromise { + let global = &self.global(); -+ let promise = Promise::new(cx, global); ++ let promise = Promise::new_rooted(cx, global); + let task_manager = global.task_manager(); + let task_source = task_manager.dom_manipulation_task_source(); + let callback = callback_promise(&promise, self, task_source); @@ -63,9 +61,9 @@ + cx: &mut JSContext, + origin: USVString, + enabled: bool, -+ ) -> Rc { ++ ) -> RootedPromise { + let global = &self.global(); -+ let promise = Promise::new(cx, global); ++ let promise = Promise::new_rooted(cx, global); + let task_manager = global.task_manager(); + let task_source = task_manager.dom_manipulation_task_source(); + let callback = callback_promise(&promise, self, task_source); @@ -84,9 +82,9 @@ + promise + } + -+ fn ResetCounts(&self, cx: &mut JSContext, origin: USVString) -> Rc { ++ fn ResetCounts(&self, cx: &mut JSContext, origin: USVString) -> RootedPromise { + let global = &self.global(); -+ let promise = Promise::new(cx, global); ++ let promise = Promise::new_rooted(cx, global); + let task_manager = global.task_manager(); + let task_source = task_manager.dom_manipulation_task_source(); + let callback = callback_promise(&promise, self, task_source); @@ -109,7 +107,7 @@ + &self, + cx: &mut JSContext, + response: Result, -+ promise: &Rc, ++ promise: &RootedPromise, + ) { + match response { + Ok(state) => { @@ -132,7 +130,7 @@ + &self, + cx: &mut JSContext, + response: Result<(), String>, -+ promise: &Rc, ++ promise: &RootedPromise, + ) { + match response { + Ok(()) => promise.resolve_native(cx, &()), diff --git a/patches/components/script/dom/dbus.rs.patch b/patches/components/script/dom/dbus.rs.patch index 41b792c..333428d 100644 --- a/patches/components/script/dom/dbus.rs.patch +++ b/patches/components/script/dom/dbus.rs.patch @@ -1,10 +1,8 @@ --- original +++ modified -@@ -0,0 +1,292 @@ +@@ -0,0 +1,290 @@ +/* SPDX Id: AGPL-3.0-or-later */ + -+use std::rc::Rc; -+ +use dom_struct::dom_struct; +use js::context::JSContext; +use js::conversions::FromJSValConvertible; @@ -27,7 +25,7 @@ +use crate::dom::event::Event; +use crate::dom::eventtarget::EventTarget; +use crate::dom::globalscope::GlobalScope; -+use crate::dom::promise::Promise; ++use crate::dom::promise::{Promise, RootedPromise}; +use crate::routed_promise::{RoutedPromiseListener, callback_promise}; + +#[dom_struct] @@ -77,9 +75,9 @@ + &self, + cx: &mut JSContext, + options: RootedTraceableBox, -+ ) -> Rc { ++ ) -> RootedPromise { + let global = &self.global(); -+ let promise = Promise::new(cx, global); ++ let promise = Promise::new_rooted(cx, global); + let task_manager = global.task_manager(); + let task_source = task_manager.dom_manipulation_task_source(); + let callback = callback_promise(&promise, self, task_source); @@ -109,9 +107,9 @@ + promise + } + -+ fn GetProperty(&self, cx: &mut JSContext, options: &DBusPropertyOptions) -> Rc { ++ fn GetProperty(&self, cx: &mut JSContext, options: &DBusPropertyOptions) -> RootedPromise { + let global = &self.global(); -+ let promise = Promise::new(cx, global); ++ let promise = Promise::new_rooted(cx, global); + let task_manager = global.task_manager(); + let task_source = task_manager.dom_manipulation_task_source(); + let callback = callback_promise(&promise, self, task_source); @@ -138,9 +136,9 @@ + cx: &mut JSContext, + options: &DBusPropertyOptions, + value: HandleValue, -+ ) -> Rc { ++ ) -> RootedPromise { + let global = &self.global(); -+ let promise = Promise::new(cx, global); ++ let promise = Promise::new_rooted(cx, global); + let task_manager = global.task_manager(); + let task_source = task_manager.dom_manipulation_task_source(); + let callback = callback_promise(&promise, self, task_source); @@ -165,9 +163,9 @@ + promise + } + -+ fn Subscribe(&self, cx: &mut JSContext, options: &DBusSignalOptions) -> Rc { ++ fn Subscribe(&self, cx: &mut JSContext, options: &DBusSignalOptions) -> RootedPromise { + let global = &self.global(); -+ let promise = Promise::new(cx, global); ++ let promise = Promise::new_rooted(cx, global); + let task_manager = global.task_manager(); + let task_source = task_manager.dom_manipulation_task_source(); + let callback = callback_promise(&promise, self, task_source); @@ -195,9 +193,9 @@ + promise + } + -+ fn Unsubscribe(&self, cx: &mut JSContext, subscription_id: u32) -> Rc { ++ fn Unsubscribe(&self, cx: &mut JSContext, subscription_id: u32) -> RootedPromise { + let global = &self.global(); -+ let promise = Promise::new(cx, global); ++ let promise = Promise::new_rooted(cx, global); + let task_manager = global.task_manager(); + let task_source = task_manager.dom_manipulation_task_source(); + let callback = callback_promise(&promise, self, task_source); @@ -253,7 +251,7 @@ + &self, + cx: &mut JSContext, + response: Result, -+ promise: &Rc, ++ promise: &RootedPromise, + ) { + match response { + Ok(value) => { @@ -271,7 +269,7 @@ + &self, + cx: &mut JSContext, + response: Result<(), String>, -+ promise: &Rc, ++ promise: &RootedPromise, + ) { + match response { + Ok(()) => promise.resolve_native(cx, &()), @@ -285,7 +283,7 @@ + &self, + cx: &mut JSContext, + response: Result, -+ promise: &Rc, ++ promise: &RootedPromise, + ) { + match response { + Ok(id) => promise.resolve_native(cx, &id), diff --git a/patches/components/script/dom/embedder.rs.patch b/patches/components/script/dom/embedder.rs.patch index 627c6c0..92b2dd9 100644 --- a/patches/components/script/dom/embedder.rs.patch +++ b/patches/components/script/dom/embedder.rs.patch @@ -1,13 +1,12 @@ --- original +++ modified -@@ -0,0 +1,642 @@ +@@ -0,0 +1,641 @@ +/* SPDX Id: AGPL-3.0-or-later */ + +//! The `Embedder` interface provides communication between web content and the embedder. +//! This is a Servo-specific, non-standard API. + +use std::ptr; -+use std::rc::Rc; + +use dom_struct::dom_struct; +use embedder_traits::{ @@ -48,7 +47,7 @@ +use crate::dom::globalscope::GlobalScope; +use crate::dom::pairing::Pairing; +use crate::dom::power::Power; -+use crate::dom::promise::Promise; ++use crate::dom::promise::{Promise, RootedPromise}; +use crate::js::conversions::ToJSValConvertible; +use crate::routed_promise::{RoutedPromiseListener, callback_promise}; + @@ -536,7 +535,7 @@ + &self, + cx: &mut JSContext, + options: &ScreenshotOptions, -+ ) -> Fallible> { ++ ) -> Fallible { + let global = self.global(); + let Some(webview_id) = global.webview_id() else { + return Err(Error::InvalidState(Some( @@ -544,7 +543,7 @@ + ))); + }; + -+ let promise = Promise::new(cx, &global); ++ let promise = Promise::new_rooted(cx, &global); + + let image_type = match &*options.type_.str() { + "image/jpeg" => ScreenshotImageType::Jpeg, @@ -620,7 +619,7 @@ + &self, + cx: &mut JSContext, + response: Result, -+ promise: &Rc, ++ promise: &RootedPromise, + ) { + match response { + Ok(result) => { diff --git a/patches/components/script/dom/html/htmlwebviewelement.rs.patch b/patches/components/script/dom/html/htmlwebviewelement.rs.patch index d902637..044a7f7 100644 --- a/patches/components/script/dom/html/htmlwebviewelement.rs.patch +++ b/patches/components/script/dom/html/htmlwebviewelement.rs.patch @@ -72,7 +72,7 @@ +use crate::dom::html::htmlelement::HTMLElement; +use crate::dom::node::virtualmethods::VirtualMethods; +use crate::dom::node::{BindContext, Node, NodeDamage, NodeTraits, UnbindContext}; -+use crate::dom::promise::Promise; ++use crate::dom::promise::{Promise, RootedPromise}; +use crate::dom::types::Blob; +use crate::dom::url::URL; +use crate::dom::windowproxy::{CreatorBrowsingContextInfo, WindowProxy}; @@ -1141,7 +1141,7 @@ + &self, + cx: &mut JSContext, + options: &ScreenshotOptions, -+ ) -> Fallible> { ++ ) -> Fallible { + // Must be an embedded webview + let Some(webview_id) = self.embedded_webview_id() else { + return Err(Error::InvalidState(Some( @@ -1150,7 +1150,7 @@ + }; + + let global = self.owner_global(); -+ let promise = Promise::new(cx, &global); ++ let promise = Promise::new_rooted(cx, &global); + + // Parse image type from options + let image_type = match &*options.type_.str() { @@ -1513,7 +1513,7 @@ + &self, + cx: &mut JSContext, + options: &ScreenshotOptions, -+ ) -> Fallible> { ++ ) -> Fallible { + self.take_screenshot(cx, options) + } + @@ -1702,7 +1702,7 @@ + &self, + cx: &mut JSContext, + response: Result, -+ promise: &Rc, ++ promise: &RootedPromise, + ) { + match response { + Ok(result) => { diff --git a/patches/components/script/dom/idledetector.rs.patch b/patches/components/script/dom/idledetector.rs.patch index fb11eef..ecb4fc8 100644 --- a/patches/components/script/dom/idledetector.rs.patch +++ b/patches/components/script/dom/idledetector.rs.patch @@ -1,6 +1,6 @@ --- original +++ modified -@@ -0,0 +1,358 @@ +@@ -0,0 +1,357 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ @@ -12,7 +12,6 @@ +//! timer for whatever is left. + +use std::cell::Cell; -+use std::rc::Rc; +use std::time::{Duration, Instant}; + +use dom_struct::dom_struct; @@ -39,7 +38,7 @@ +use crate::dom::eventtarget::EventTarget; +use crate::dom::globalscope::GlobalScope; +use crate::dom::permissions::{descriptor_permission_state, request_permission_to_use}; -+use crate::dom::promise::Promise; ++use crate::dom::promise::{Promise, RootedPromise}; +use crate::dom::window::Window; +use crate::event_loop::timers::{OneshotTimerCallback, OneshotTimerHandle}; + @@ -234,9 +233,9 @@ + event_handler!(change, GetOnchange, SetOnchange); + + /// -+ fn RequestPermission(cx: &mut JSContext, window: &Window) -> Rc { ++ fn RequestPermission(cx: &mut JSContext, window: &Window) -> RootedPromise { + let global = window.as_global_scope(); -+ let promise = Promise::new(cx, global); ++ let promise = Promise::new_rooted(cx, global); + + // Step 2. If the relevant global object does not have transient + // activation, reject with "NotAllowedError". @@ -255,9 +254,9 @@ + } + + /// -+ fn Start(&self, cx: &mut JSContext, options: &IdleOptions) -> Rc { ++ fn Start(&self, cx: &mut JSContext, options: &IdleOptions) -> RootedPromise { + let global = self.global(); -+ let promise = Promise::new(cx, &global); ++ let promise = Promise::new_rooted(cx, &global); + + // Step 1-2. If the document is not fully active, reject with + // "InvalidStateError". Always a Window: `Exposed=Window`. diff --git a/patches/components/script/dom/keyboard.rs.patch b/patches/components/script/dom/keyboard.rs.patch index cd3fcf2..b3489e6 100644 --- a/patches/components/script/dom/keyboard.rs.patch +++ b/patches/components/script/dom/keyboard.rs.patch @@ -1,13 +1,11 @@ --- original +++ modified -@@ -0,0 +1,301 @@ +@@ -0,0 +1,299 @@ +/* SPDX Id: AGPL-3.0-or-later */ + +//! The `Keyboard` interface provides virtual keyboard input injection. +//! This is a Servo-specific, non-standard API for privileged pages. + -+use std::rc::Rc; -+ +use dom_struct::dom_struct; +use embedder_traits::{ + EmbedderMsg, ImeEvent, InputEvent, InputEventAndId, KeyboardEvent as EmbedderKeyboardEvent, @@ -35,7 +33,7 @@ +use crate::dom::event::Event; +use crate::dom::eventtarget::EventTarget; +use crate::dom::globalscope::GlobalScope; -+use crate::dom::promise::Promise; ++use crate::dom::promise::{Promise, RootedPromise}; +use crate::routed_promise::{RoutedPromiseListener, callback_promise}; + +#[dom_struct] @@ -216,9 +214,9 @@ + + /// Ask the constellation for the text/selection around the caret of the active IME + /// input, resolving `promise` when the focused pipeline's script replies. -+ fn request_surrounding_text(&self, cx: &mut JSContext, max_chars: u32) -> Rc { ++ fn request_surrounding_text(&self, cx: &mut JSContext, max_chars: u32) -> RootedPromise { + let global = self.global(); -+ let promise = Promise::new(cx, &global); ++ let promise = Promise::new_rooted(cx, &global); + let task_manager = global.task_manager(); + let task_source = task_manager.dom_manipulation_task_source(); + let callback = callback_promise(&promise, self, task_source); @@ -275,7 +273,7 @@ + } + + /// Read the live text/selection around the caret of the active IME input. -+ fn GetSurroundingText(&self, cx: &mut JSContext, max_chars: u32) -> Rc { ++ fn GetSurroundingText(&self, cx: &mut JSContext, max_chars: u32) -> RootedPromise { + self.request_surrounding_text(cx, max_chars) + } +} @@ -285,7 +283,7 @@ + &self, + cx: &mut JSContext, + response: Option, -+ promise: &Rc, ++ promise: &RootedPromise, + ) { + match response { + Some(surrounding) => { diff --git a/patches/components/script/dom/navigator/navigator.rs.patch b/patches/components/script/dom/navigator/navigator.rs.patch index 56bc300..7fb754d 100644 --- a/patches/components/script/dom/navigator/navigator.rs.patch +++ b/patches/components/script/dom/navigator/navigator.rs.patch @@ -1,14 +1,6 @@ --- original +++ modified -@@ -6,6 +6,7 @@ - use std::cell::Cell; - use std::convert::TryInto; - use std::ops::Deref; -+use std::rc::Rc; - use std::sync::LazyLock; - - use bytes::Bytes; -@@ -14,7 +15,8 @@ +@@ -14,7 +14,8 @@ use headers::HeaderMap; use http::header::{self, HeaderValue}; use js::context::JSContext; @@ -18,7 +10,7 @@ use net_traits::blob_url_store::UrlWithBlobClaim; use net_traits::request::{ CredentialsMode, Destination, RequestBuilder, RequestId, RequestMode, -@@ -26,9 +28,12 @@ +@@ -26,9 +27,12 @@ use script_bindings::cell::DomRefCell; use script_bindings::reflector::{Reflector, reflect_dom_object_with_cx}; use servo_base::generic_channel; @@ -31,7 +23,7 @@ use crate::dom::bindings::codegen::Bindings::NavigatorBinding::NavigatorMethods; #[cfg(feature = "gamepad")] use crate::dom::bindings::codegen::Bindings::PermissionStatusBinding::PermissionName; -@@ -39,6 +44,7 @@ +@@ -39,6 +43,7 @@ use crate::dom::bindings::reflector::DomGlobal; use crate::dom::bindings::root::{DomRoot, MutNullableDom}; use crate::dom::bindings::str::{DOMString, USVString}; @@ -39,7 +31,7 @@ use crate::dom::bindings::utils::to_frozen_array; #[cfg(feature = "bluetooth")] use crate::dom::bluetooth::Bluetooth; -@@ -45,17 +51,21 @@ +@@ -45,17 +50,21 @@ use crate::dom::clipboard::Clipboard; use crate::dom::credentialmanagement::credentialscontainer::CredentialsContainer; use crate::dom::csp::{GlobalCspReporting, Violation}; @@ -57,11 +49,11 @@ use crate::dom::performance::performanceresourcetiming::InitiatorType; use crate::dom::permissions::Permissions; use crate::dom::pluginarray::PluginArray; -+use crate::dom::promise::Promise; ++use crate::dom::promise::{Promise, RootedPromise}; use crate::dom::serviceworkercontainer::ServiceWorkerContainer; use crate::dom::servointernals::ServoInternals; use crate::dom::storagemanager::StorageManager; -@@ -71,6 +81,7 @@ +@@ -71,6 +80,7 @@ use crate::fetch::network_listener::{ FetchResponseListener, ResourceTimingListener, submit_timing, }; @@ -69,7 +61,7 @@ pub(crate) fn hardware_concurrency() -> u64 { static CPUS: LazyLock = LazyLock::new(|| num_cpus::get().try_into().unwrap_or(1)); -@@ -141,6 +152,9 @@ +@@ -141,6 +151,9 @@ servo_internals: MutNullableDom, user_activation: MutNullableDom, wake_lock: MutNullableDom, @@ -79,7 +71,7 @@ } impl Navigator { -@@ -169,6 +183,9 @@ +@@ -169,6 +182,9 @@ servo_internals: Default::default(), user_activation: Default::default(), wake_lock: Default::default(), @@ -89,7 +81,7 @@ } } -@@ -181,6 +198,21 @@ +@@ -181,6 +197,21 @@ self.xr.get() } @@ -111,7 +103,7 @@ #[cfg(feature = "gamepad")] pub(crate) fn get_gamepad(&self, index: usize) -> Option> { self.gamepads.borrow().get(index).and_then(|g| g.get()) -@@ -620,6 +652,16 @@ +@@ -620,6 +651,16 @@ .or_init(|| ServoInternals::new(cx, &self.global())) } @@ -128,7 +120,7 @@ /// fn RegisterProtocolHandler(&self, scheme: DOMString, url: USVString) -> Fallible<()> { // Step 1. Let (normalizedScheme, normalizedURLString) be the result of -@@ -668,6 +710,209 @@ +@@ -668,6 +709,209 @@ fn WakeLock(&self, cx: &mut js::context::JSContext) -> DomRoot { self.wake_lock.or_init(|| WakeLock::new(cx, &self.global())) } @@ -138,9 +130,9 @@ + cx: &mut js::context::JSContext, + peer_id: DOMString, + target_url: USVString, -+ ) -> Fallible> { ++ ) -> Fallible { + let global = self.global(); -+ let promise = Promise::new(cx, &global); ++ let promise = Promise::new_rooted(cx, &global); + + // Create a local port and a virtual remote port ID. + // The remote port is NOT tracked in this global — it only exists @@ -187,10 +179,10 @@ + cx: &mut js::context::JSContext, + name: DOMString, + options: HandleValue, -+ ) -> Fallible> { ++ ) -> Fallible { + let global = self.global(); + let mut realm = CurrentRealm::assert(cx); -+ let promise = Promise::new_in_realm(&mut realm); ++ let promise = Promise::new_in_realm_rooted(&mut realm); + let task_manager = global.task_manager(); + let task_source = task_manager.dom_manipulation_task_source(); + @@ -338,7 +330,7 @@ } struct BeaconFetchListener { -@@ -728,3 +973,31 @@ +@@ -728,3 +972,31 @@ self.global.root() } } @@ -349,7 +341,7 @@ + &self, + cx: &mut js::context::JSContext, + response: Result, -+ promise: &Rc, ++ promise: &RootedPromise, + ) { + match response { + Ok(data) => { diff --git a/patches/components/script/dom/pairing.rs.patch b/patches/components/script/dom/pairing.rs.patch index a81d8ce..9ee3f63 100644 --- a/patches/components/script/dom/pairing.rs.patch +++ b/patches/components/script/dom/pairing.rs.patch @@ -1,10 +1,8 @@ --- original +++ modified -@@ -0,0 +1,452 @@ +@@ -0,0 +1,455 @@ +/* SPDX Id: AGPL-3.0-or-later */ + -+use std::rc::Rc; -+ +use dom_struct::dom_struct; +use js::context::JSContext; +use script_bindings::error::Error; @@ -24,7 +22,7 @@ +use crate::dom::globalscope::GlobalScope; +use crate::dom::pairingpeerevent::PairingPeerEvent; +use crate::dom::peer::Peer; -+use crate::dom::promise::Promise; ++use crate::dom::promise::{Promise, RootedPromise}; +use crate::routed_promise::{RoutedPromiseListener, callback_promise}; + +#[dom_struct] @@ -87,9 +85,9 @@ +} + +impl PairingMethods for Pairing { -+ fn Local(&self, cx: &mut JSContext) -> Rc { ++ fn Local(&self, cx: &mut JSContext) -> RootedPromise { + let global = &self.global(); -+ let promise = Promise::new(cx, global); ++ let promise = Promise::new_rooted(cx, global); + let task_manager = global.task_manager(); + let task_source = task_manager.dom_manipulation_task_source(); + let callback = callback_promise(&promise, self, task_source); @@ -104,9 +102,9 @@ + promise + } + -+ fn GuestPin(&self, cx: &mut JSContext) -> Rc { ++ fn GuestPin(&self, cx: &mut JSContext) -> RootedPromise { + let global = &self.global(); -+ let promise = Promise::new(cx, global); ++ let promise = Promise::new_rooted(cx, global); + let task_manager = global.task_manager(); + let task_source = task_manager.dom_manipulation_task_source(); + let callback = callback_promise(&promise, self, task_source); @@ -121,9 +119,9 @@ + promise + } + -+ fn Peers(&self, cx: &mut JSContext) -> Rc { ++ fn Peers(&self, cx: &mut JSContext) -> RootedPromise { + let global = &self.global(); -+ let promise = Promise::new(cx, global); ++ let promise = Promise::new_rooted(cx, global); + let task_manager = global.task_manager(); + let task_source = task_manager.dom_manipulation_task_source(); + let callback = callback_promise(&promise, self, task_source); @@ -138,9 +136,9 @@ + promise + } + -+ fn RequestPairing(&self, cx: &mut JSContext, peer: &Peer) -> Rc { ++ fn RequestPairing(&self, cx: &mut JSContext, peer: &Peer) -> RootedPromise { + let global = &self.global(); -+ let promise = Promise::new(cx, global); ++ let promise = Promise::new_rooted(cx, global); + let task_manager = global.task_manager(); + let task_source = task_manager.dom_manipulation_task_source(); + let callback = callback_promise(&promise, self, task_source); @@ -158,9 +156,9 @@ + promise + } + -+ fn AcceptPairing(&self, cx: &mut JSContext, peer: &Peer) -> Rc { ++ fn AcceptPairing(&self, cx: &mut JSContext, peer: &Peer) -> RootedPromise { + let global = &self.global(); -+ let promise = Promise::new(cx, global); ++ let promise = Promise::new_rooted(cx, global); + let task_manager = global.task_manager(); + let task_source = task_manager.dom_manipulation_task_source(); + let callback = callback_promise(&promise, self, task_source); @@ -178,9 +176,9 @@ + promise + } + -+ fn RejectPairing(&self, cx: &mut JSContext, peer: &Peer) -> Rc { ++ fn RejectPairing(&self, cx: &mut JSContext, peer: &Peer) -> RootedPromise { + let global = &self.global(); -+ let promise = Promise::new(cx, global); ++ let promise = Promise::new_rooted(cx, global); + let task_manager = global.task_manager(); + let task_source = task_manager.dom_manipulation_task_source(); + let callback = callback_promise(&promise, self, task_source); @@ -198,9 +196,9 @@ + promise + } + -+ fn RemovePeer(&self, cx: &mut JSContext, peer: &Peer) -> Rc { ++ fn RemovePeer(&self, cx: &mut JSContext, peer: &Peer) -> RootedPromise { + let global = &self.global(); -+ let promise = Promise::new(cx, global); ++ let promise = Promise::new_rooted(cx, global); + let task_manager = global.task_manager(); + let task_source = task_manager.dom_manipulation_task_source(); + let callback = callback_promise(&promise, self, task_source); @@ -218,9 +216,9 @@ + promise + } + -+ fn EnableGuestMode(&self, cx: &mut JSContext, duration_minutes: u32) -> Rc { ++ fn EnableGuestMode(&self, cx: &mut JSContext, duration_minutes: u32) -> RootedPromise { + let global = &self.global(); -+ let promise = Promise::new(cx, global); ++ let promise = Promise::new_rooted(cx, global); + let task_manager = global.task_manager(); + let task_source = task_manager.dom_manipulation_task_source(); + let callback = callback_promise(&promise, self, task_source); @@ -238,9 +236,9 @@ + promise + } + -+ fn DisableGuestMode(&self, cx: &mut JSContext) -> Rc { ++ fn DisableGuestMode(&self, cx: &mut JSContext) -> RootedPromise { + let global = &self.global(); -+ let promise = Promise::new(cx, global); ++ let promise = Promise::new_rooted(cx, global); + let task_manager = global.task_manager(); + let task_source = task_manager.dom_manipulation_task_source(); + let callback = callback_promise(&promise, self, task_source); @@ -257,9 +255,14 @@ + promise + } + -+ fn RequestGuestPairing(&self, cx: &mut JSContext, peer: &Peer, pin: DOMString) -> Rc { ++ fn RequestGuestPairing( ++ &self, ++ cx: &mut JSContext, ++ peer: &Peer, ++ pin: DOMString, ++ ) -> RootedPromise { + let global = &self.global(); -+ let promise = Promise::new(cx, global); ++ let promise = Promise::new_rooted(cx, global); + let task_manager = global.task_manager(); + let task_source = task_manager.dom_manipulation_task_source(); + let callback = callback_promise(&promise, self, task_source); @@ -278,9 +281,9 @@ + promise + } + -+ fn SetName(&self, cx: &mut JSContext, name: DOMString) -> Rc { ++ fn SetName(&self, cx: &mut JSContext, name: DOMString) -> RootedPromise { + let global = &self.global(); -+ let promise = Promise::new(cx, global); ++ let promise = Promise::new_rooted(cx, global); + let task_manager = global.task_manager(); + let task_source = task_manager.dom_manipulation_task_source(); + let callback = callback_promise(&promise, self, task_source); @@ -298,9 +301,9 @@ + promise + } + -+ fn Start(&self, cx: &mut JSContext) -> Rc { ++ fn Start(&self, cx: &mut JSContext) -> RootedPromise { + let global = &self.global(); -+ let promise = Promise::new(cx, global); ++ let promise = Promise::new_rooted(cx, global); + let task_manager = global.task_manager(); + let task_source = task_manager.dom_manipulation_task_source(); + let callback = callback_promise(&promise, self, task_source); @@ -315,9 +318,9 @@ + promise + } + -+ fn Stop(&self, cx: &mut JSContext) -> Rc { ++ fn Stop(&self, cx: &mut JSContext) -> RootedPromise { + let global = &self.global(); -+ let promise = Promise::new(cx, global); ++ let promise = Promise::new_rooted(cx, global); + let task_manager = global.task_manager(); + let task_source = task_manager.dom_manipulation_task_source(); + let callback = callback_promise(&promise, self, task_source); @@ -348,7 +351,7 @@ + &self, + cx: &mut JSContext, + response: Result<(), String>, -+ promise: &Rc, ++ promise: &RootedPromise, + ) { + match response { + Ok(()) => promise.resolve_native(cx, &()), @@ -362,7 +365,7 @@ + &self, + cx: &mut JSContext, + response: Result, -+ promise: &Rc, ++ promise: &RootedPromise, + ) { + match response { + Ok(info) => { @@ -380,7 +383,7 @@ + &self, + cx: &mut JSContext, + response: Result, String>, -+ promise: &Rc, ++ promise: &RootedPromise, + ) { + match response { + Ok(peers) => { @@ -416,7 +419,7 @@ + &self, + cx: &mut JSContext, + response: Result, -+ promise: &Rc, ++ promise: &RootedPromise, + ) { + match response { + Ok(accepted) => promise.resolve_native(cx, &accepted), @@ -430,7 +433,7 @@ + &self, + cx: &mut JSContext, + response: Result, -+ promise: &Rc, ++ promise: &RootedPromise, + ) { + match response { + Ok(value) => promise.resolve_native(cx, &value), @@ -445,7 +448,7 @@ + &self, + cx: &mut JSContext, + response: Result, String>, -+ promise: &Rc, ++ promise: &RootedPromise, + ) { + match response { + Ok(value) => promise.resolve_native(cx, &value), diff --git a/patches/components/script/dom/power.rs.patch b/patches/components/script/dom/power.rs.patch index 6b22583..bd88105 100644 --- a/patches/components/script/dom/power.rs.patch +++ b/patches/components/script/dom/power.rs.patch @@ -1,13 +1,12 @@ --- original +++ modified -@@ -0,0 +1,188 @@ +@@ -0,0 +1,187 @@ +/* SPDX Id: AGPL-3.0-or-later */ + +//! `navigator.embedder.power`: control of the device's brightness-capable +//! hardware, the screen's power state, and device power actions. + +use std::cell::Cell; -+use std::rc::Rc; + +use beaver_hal::system::RebootTarget as HalRebootTarget; +use dom_struct::dom_struct; @@ -21,7 +20,7 @@ +use crate::dom::bindings::root::DomRoot; +use crate::dom::brightnessdevice::BrightnessDevice; +use crate::dom::globalscope::GlobalScope; -+use crate::dom::promise::Promise; ++use crate::dom::promise::{Promise, RootedPromise}; +use crate::routed_promise::{RoutedPromiseListener, callback_promise}; + +#[dom_struct] @@ -47,9 +46,9 @@ +} + +impl PowerMethods for Power { -+ fn Devices(&self, cx: &mut JSContext) -> Rc { ++ fn Devices(&self, cx: &mut JSContext) -> RootedPromise { + let global = &self.global(); -+ let promise = Promise::new(cx, global); ++ let promise = Promise::new_rooted(cx, global); + let task_manager = global.task_manager(); + let task_source = task_manager.dom_manipulation_task_source(); + let callback = callback_promise(&promise, self, task_source); @@ -79,9 +78,9 @@ + } + + /// Re-read the real state and refresh the cached value. -+ fn ReadScreenOn(&self, cx: &mut JSContext) -> Rc { ++ fn ReadScreenOn(&self, cx: &mut JSContext) -> RootedPromise { + let global = &self.global(); -+ let promise = Promise::new(cx, global); ++ let promise = Promise::new_rooted(cx, global); + let task_manager = global.task_manager(); + let task_source = task_manager.dom_manipulation_task_source(); + let callback = callback_promise(&promise, self, task_source); @@ -96,9 +95,9 @@ + promise + } + -+ fn Shutdown(&self, cx: &mut JSContext) -> Rc { ++ fn Shutdown(&self, cx: &mut JSContext) -> RootedPromise { + let global = &self.global(); -+ let promise = Promise::new(cx, global); ++ let promise = Promise::new_rooted(cx, global); + let task_manager = global.task_manager(); + let task_source = task_manager.dom_manipulation_task_source(); + let callback = callback_promise(&promise, self, task_source); @@ -113,9 +112,9 @@ + promise + } + -+ fn Reboot(&self, cx: &mut JSContext, target: RebootTarget) -> Rc { ++ fn Reboot(&self, cx: &mut JSContext, target: RebootTarget) -> RootedPromise { + let global = &self.global(); -+ let promise = Promise::new(cx, global); ++ let promise = Promise::new_rooted(cx, global); + let task_manager = global.task_manager(); + let task_source = task_manager.dom_manipulation_task_source(); + let callback = callback_promise(&promise, self, task_source); @@ -142,7 +141,7 @@ + &self, + cx: &mut JSContext, + response: Result, String>, -+ promise: &Rc, ++ promise: &RootedPromise, + ) { + match response { + Ok(infos) => { @@ -163,7 +162,7 @@ + &self, + cx: &mut JSContext, + response: Result, -+ promise: &Rc, ++ promise: &RootedPromise, + ) { + match response { + Ok(on) => { @@ -181,7 +180,7 @@ + &self, + cx: &mut JSContext, + response: Result<(), String>, -+ promise: &Rc, ++ promise: &RootedPromise, + ) { + match response { + Ok(()) => promise.resolve_native(cx, &()), diff --git a/patches/components/script/dom/window/window.rs.patch b/patches/components/script/dom/window/window.rs.patch index b30df30..1b663fb 100644 --- a/patches/components/script/dom/window/window.rs.patch +++ b/patches/components/script/dom/window/window.rs.patch @@ -41,6 +41,15 @@ use crate::dom::location::Location; use crate::dom::medialist::MediaList; use crate::dom::mediaquerylist::{MediaQueryList, MediaQueryListMatchState}; +@@ -174,7 +178,7 @@ + use crate::dom::node::{Node, NodeDamage, NodeTraits, from_untrusted_node_address}; + use crate::dom::performance::performance::Performance; + use crate::dom::performanceresourcetiming::InitiatorType; +-use crate::dom::promise::Promise; ++use crate::dom::promise::{Promise, RootedPromise}; + use crate::dom::reporting::reportingendpoint::{ReportingEndpoint, SendReportsToEndpoints}; + use crate::dom::reporting::reportingobserver::ReportingObserver; + use crate::dom::selection::Selection; @@ -1225,12 +1229,22 @@ let (sender, receiver) = @@ -115,7 +124,7 @@ // Step 6: Let userPromptHandler be WebDriver BiDi user prompt opened with this, // "prompt", and message. // TODO: Add support for WebDriver BiDi. -@@ -1812,6 +1844,27 @@ +@@ -1812,6 +1844,28 @@ // https://html.spec.whatwg.org/multipage/#windoweventhandlers window_event_handlers!(); @@ -127,7 +136,8 @@ + let promise = Promise::new(cx, global); + let task_manager = global.task_manager(); + let task_source = task_manager.dom_manipulation_task_source(); -+ let callback = crate::routed_promise::callback_promise(&promise, self, task_source); ++ let callback = ++ crate::routed_promise::callback_promise(&promise.clone().into(), self, task_source); + + let chan = global.script_to_constellation_chan(); + if chan @@ -143,7 +153,7 @@ /// fn Screen(&self, cx: &mut JSContext) -> DomRoot { self.screen.or_init(|| Screen::new(cx, self)) -@@ -2722,6 +2775,10 @@ +@@ -2722,6 +2776,10 @@ accessibility_damage = Some(accessibility_data.drain_pending_accessibility_damage()); } @@ -154,7 +164,7 @@ // Send new document and relevant styles to layout. let reflow = ReflowRequest { document: document.upcast::().to_trusted_node_address(), -@@ -3249,10 +3306,33 @@ +@@ -3249,10 +3307,33 @@ flags: HitTestFlags, input_event: &ConstellationInputEvent, ) -> Option { @@ -192,7 +202,7 @@ } #[expect(unsafe_code)] -@@ -3273,8 +3353,42 @@ +@@ -3273,8 +3354,42 @@ let address = UntrustedNodeAddress(node.0 as *const c_void); unsafe { from_untrusted_node_address(address) } }; @@ -236,7 +246,7 @@ dom_position_for_selection: result .dom_position_for_selection .map(|(node, offset)| (from_opaque_node(node), offset)), -@@ -3672,17 +3786,19 @@ +@@ -3672,17 +3787,19 @@ } pub(crate) fn send_to_embedder(&self, msg: EmbedderMsg) { @@ -262,7 +272,7 @@ } #[cfg(feature = "webxr")] -@@ -3914,6 +4030,8 @@ +@@ -3914,6 +4031,8 @@ #[cfg(feature = "webgpu")] gpu_id_hub: Arc, inherited_secure_context: Option, embedder_theme: Theme, @@ -271,7 +281,7 @@ weak_script_thread: Weak, ) -> DomRoot { let error_reporter = CSSErrorReporter { -@@ -3937,6 +4055,8 @@ +@@ -3937,6 +4056,8 @@ gpu_id_hub, inherited_secure_context, unminify_js, @@ -280,7 +290,7 @@ ), caches: Default::default(), ongoing_navigation: Default::default(), -@@ -4238,3 +4358,114 @@ +@@ -4238,3 +4359,114 @@ Window::origin(self) } } @@ -296,7 +306,7 @@ + &self, + cx: &mut JSContext, + response: Option<(String, Option, Vec)>, -+ promise: &Rc, ++ promise: &RootedPromise, + ) { + let Some((task_name, data, port_id_bytes)) = response else { + promise.reject_error( diff --git a/patches/components/script_bindings/codegen/Bindings.conf.patch b/patches/components/script_bindings/codegen/Bindings.conf.patch index 0235b33..fdefdd2 100644 --- a/patches/components/script_bindings/codegen/Bindings.conf.patch +++ b/patches/components/script_bindings/codegen/Bindings.conf.patch @@ -1,6 +1,6 @@ --- original +++ modified -@@ -35,6 +35,24 @@ +@@ -35,6 +35,23 @@ 'no_gc': ['GetFloatFrequencyData', 'GetByteFrequencyData', 'GetFloatTimeDomainData', 'GetByteTimeDomainData'] }, @@ -18,73 +18,65 @@ + 'SearchText', + 'SearchUrl', + 'SyncRepo' -+ ], -+ 'useRcPromise': True, ++ ] +}, + 'Attr': { 'implicitCxSetters': True, }, -@@ -142,6 +160,26 @@ +@@ -142,6 +159,22 @@ 'cx': ['Assert', 'Count', 'CountReset', 'Debug', 'Dir', 'Error', 'Group', 'GroupCollapsed', 'Info', 'Log', 'Time', 'TimeEnd', 'TimeLog', 'Trace', 'Warn'], }, +'ContentBlocker': { + 'cx': ['GetOriginState', 'SetOriginEnabled', 'ResetCounts'], -+ 'useRcPromise': True, +}, + +'DBus': { + 'cx': ['Call', 'GetProperty', 'SetProperty', 'Subscribe', 'Unsubscribe'], -+ 'useRcPromise': True, +}, + +'Power': { + 'cx': ['Devices', 'ReadScreenOn', 'Shutdown', 'Reboot'], -+ 'useRcPromise': True, +}, + +'BrightnessDevice': { + 'cx': ['Read'], -+ 'useRcPromise': True, +}, + 'CookieStore': { 'cx': ['Set', 'Set_', 'Get', 'Get_', 'GetAll', 'GetAll_', 'Delete', 'Delete_'], 'useRcPromise': True, -@@ -465,6 +503,12 @@ +@@ -465,6 +498,11 @@ 'cx': ['CheckValidity', 'GetValidity', 'GetLabels', 'ReportValidity', 'SetValidity', 'States'], }, +'Embedder': { + 'additionalTraits': ['crate::interfaces::EmbedderHelpers'], + 'cx': ['CaptureScreen', 'ContentBlocker', 'Dbus', 'Pairing', 'Power'], -+ 'useRcPromise': True, +}, + 'Event': { 'cx': ['TimeStamp'], }, -@@ -845,6 +889,12 @@ +@@ -845,6 +883,11 @@ 'weakReferenceable': True, }, +'HTMLWebViewElement': { + 'cx': ['TakeScreenshot'], + 'no_gc': ['SetPageZoom'], -+ 'useRcPromise': True, +}, + 'IDBCursor': { 'cx': ['Key', 'PrimaryKey'] }, -@@ -882,11 +932,21 @@ +@@ -882,11 +925,19 @@ 'cx': ['Abort', 'ObjectStore', 'ObjectStoreNames'], }, +'IdleDetector': { + 'cx': ['RequestPermission', 'Start'], -+ 'useRcPromise': True, +}, + 'IntersectionObserver': { @@ -94,36 +86,32 @@ +'Keyboard': { + 'cx': ["GetSurroundingText"], -+ 'useRcPromise': True, +}, + 'KeyframeEffect': { 'cx': ['GetKeyframes', 'SetKeyframes'] }, -@@ -964,8 +1024,9 @@ +@@ -964,7 +1015,7 @@ }, 'Navigator': { - 'cx': ['Bluetooth', 'Credentials', 'Clipboard', 'Geolocation', 'Gpu', 'MimeTypes', 'Languages', 'SendBeacon', 'ServiceWorker', 'Servo', + 'cx': ['Atproto', 'Bluetooth', 'Credentials', 'Clipboard', 'CreatePeerStream', 'Embedder', 'Geolocation', 'Gpu', 'Keyboard', 'Languages', 'MimeTypes', 'RequestTask', 'SendBeacon', 'ServiceWorker', 'Servo', 'Storage', 'Plugins', 'UserActivation', 'WakeLock', 'Xr', 'MediaDevices', 'MediaSession', 'Permissions', 'GetGamepads'], -+ 'useRcPromise': True, }, - 'CredentialsContainer': { -@@ -1023,6 +1084,11 @@ +@@ -1023,6 +1074,10 @@ 'cx': ['RegisterPaint'], }, +'Pairing': { + 'cx': ['GuestPin', 'Start', 'Stop', 'Local', 'Peers', 'RequestPairing', 'SetName', 'AcceptPairing', 'RejectPairing', 'RemovePeer', 'EnableGuestMode', 'DisableGuestMode', 'RequestGuestPairing'], -+ 'useRcPromise': True, +}, + 'Performance': { 'cx': ['Mark', 'Measure'], }, -@@ -1457,6 +1523,7 @@ +@@ -1457,6 +1512,7 @@ 'additionalTraits': ['crate::interfaces::WindowHelpers', 'crate::interfaces::HasOrigin'], 'realm': ['CreateImageBitmap', 'CreateImageBitmap_', 'WebdriverCallback', 'GetOpener', 'Fetch'], 'cx': [ diff --git a/ui/homescreen/elements/home_item.js b/ui/homescreen/elements/home_item.js index f1f9dc8..24a3bc9 100644 --- a/ui/homescreen/elements/home_item.js +++ b/ui/homescreen/elements/home_item.js @@ -8,7 +8,7 @@ * * Live tiles hydrate lazily. A poster (the icon and title) stands in until the * tile scrolls into view, so a cold start does not fan out into N simultaneous - * page loads. They also unload when the homescreen is not the visible carousel + * page loads. They also unload when the homescreen is not the visible carousel * view. */ -- 2.51.2