mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Replace script_plugins with a clippy like rustc driver (named crown) (#30508)
* Remove script_plugins * Use crown instead of script_plugins * crown_is_not_used * Use crown in command base * bootstrap crown * tidy happy * disable sccache * Bring crown in tree * Install crown from tree * fix windows ci * fix warning * fix mac libscript_plugins.dylib is not available anymore * Update components/script/lib.rs Co-authored-by: Martin Robinson <mrobinson@igalia.com> * Update for nightly-2023-03-18 Mostly just based off https://github.com/servo/servo/pull/30630 * Always install crown it's slow only when there is new version * Run crown test with `mach test-unit` * Small fixups; better trace_in_no_trace tests * Better doc * crown in config.toml * Fix tidy for real * no sccache on rustc_wrapper * document rustc overrides * fixup of compiletest * Make a few minor comment adjustments * Fix a typo in python/servo/platform/base.py Co-authored-by: Samson <16504129+sagudev@users.noreply.github.com> * Proper test types * Ignore tidy on crown/tests --------- Co-authored-by: Martin Robinson <mrobinson@igalia.com>
This commit is contained in:
parent
20a73721de
commit
604979e367
231 changed files with 881 additions and 680 deletions
|
@ -13,7 +13,7 @@ pub fn dom_struct(args: TokenStream, input: TokenStream) -> TokenStream {
|
|||
}
|
||||
let attributes = quote! {
|
||||
#[derive(deny_public_fields::DenyPublicFields, domobject_derive::DomObject, JSTraceable, MallocSizeOf)]
|
||||
#[unrooted_must_root_lint::must_root]
|
||||
#[crown::unrooted_must_root_lint::must_root]
|
||||
#[repr(C)]
|
||||
};
|
||||
|
||||
|
|
|
@ -16,9 +16,6 @@ path = "lib.rs"
|
|||
debugmozjs = ['js/debugmozjs']
|
||||
jitspew = ['js/jitspew']
|
||||
profilemozjs = ['js/profilemozjs']
|
||||
unrooted_must_root_lint = ["script_plugins/unrooted_must_root_lint"]
|
||||
trace_in_no_trace_lint = ["script_plugins/trace_in_no_trace_lint"]
|
||||
default = ["unrooted_must_root_lint", "trace_in_no_trace_lint"]
|
||||
webgl_backtrace = ["canvas_traits/webgl_backtrace"]
|
||||
js_backtrace = []
|
||||
refcell_backtrace = ["accountable-refcell"]
|
||||
|
@ -88,7 +85,6 @@ range = { path = "../range" }
|
|||
ref_filter_map = "1.0.1"
|
||||
regex = { workspace = true }
|
||||
script_layout_interface = { workspace = true }
|
||||
script_plugins = { path = "../script_plugins" }
|
||||
script_traits = { workspace = true }
|
||||
selectors = { path = "../selectors", features = ["shmem"] }
|
||||
serde = { workspace = true, features = ["derive"] }
|
||||
|
|
|
@ -36,7 +36,7 @@ use crate::dom::window::Window;
|
|||
|
||||
/// The set of animations for a document.
|
||||
#[derive(Default, JSTraceable, MallocSizeOf)]
|
||||
#[unrooted_must_root_lint::must_root]
|
||||
#[crown::unrooted_must_root_lint::must_root]
|
||||
pub(crate) struct Animations {
|
||||
/// The map of nodes to their animation states.
|
||||
#[no_trace]
|
||||
|
|
|
@ -715,7 +715,7 @@ impl Callback for ConsumeBodyPromiseHandler {
|
|||
}
|
||||
|
||||
// https://fetch.spec.whatwg.org/#concept-body-consume-body
|
||||
#[allow(unrooted_must_root)]
|
||||
#[allow(crown::unrooted_must_root)]
|
||||
pub fn consume_body<T: BodyMixin + DomObject>(object: &T, body_type: BodyType) -> Rc<Promise> {
|
||||
let in_realm_proof = AlreadyInRealm::assert();
|
||||
let promise = Promise::new_in_current_realm(InRealm::Already(&in_realm_proof));
|
||||
|
@ -739,7 +739,7 @@ pub fn consume_body<T: BodyMixin + DomObject>(object: &T, body_type: BodyType) -
|
|||
}
|
||||
|
||||
// https://fetch.spec.whatwg.org/#concept-body-consume-body
|
||||
#[allow(unrooted_must_root)]
|
||||
#[allow(crown::unrooted_must_root)]
|
||||
fn consume_body_with_promise<T: BodyMixin + DomObject>(
|
||||
object: &T,
|
||||
body_type: BodyType,
|
||||
|
|
|
@ -57,7 +57,7 @@ use crate::dom::paintworkletglobalscope::PaintWorkletGlobalScope;
|
|||
use crate::dom::textmetrics::TextMetrics;
|
||||
use crate::unpremultiplytable::UNPREMULTIPLY_TABLE;
|
||||
|
||||
#[unrooted_must_root_lint::must_root]
|
||||
#[crown::unrooted_must_root_lint::must_root]
|
||||
#[derive(Clone, JSTraceable, MallocSizeOf)]
|
||||
#[allow(dead_code)]
|
||||
pub(crate) enum CanvasFillOrStrokeStyle {
|
||||
|
@ -76,7 +76,7 @@ impl CanvasFillOrStrokeStyle {
|
|||
}
|
||||
}
|
||||
|
||||
#[unrooted_must_root_lint::must_root]
|
||||
#[crown::unrooted_must_root_lint::must_root]
|
||||
#[derive(Clone, JSTraceable, MallocSizeOf)]
|
||||
pub(crate) struct CanvasContextState {
|
||||
global_alpha: f64,
|
||||
|
@ -136,7 +136,7 @@ impl CanvasContextState {
|
|||
}
|
||||
}
|
||||
|
||||
#[unrooted_must_root_lint::must_root]
|
||||
#[crown::unrooted_must_root_lint::must_root]
|
||||
#[derive(JSTraceable, MallocSizeOf)]
|
||||
pub(crate) struct CanvasState {
|
||||
#[ignore_malloc_size_of = "Defined in ipc-channel"]
|
||||
|
@ -927,7 +927,7 @@ impl CanvasState {
|
|||
self.send_canvas_2d_msg(Canvas2dMsg::SaveContext);
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
#[allow(crown::unrooted_must_root)]
|
||||
// https://html.spec.whatwg.org/multipage/#dom-context-2d-restore
|
||||
pub fn restore(&self) {
|
||||
let mut saved_states = self.saved_states.borrow_mut();
|
||||
|
|
|
@ -172,7 +172,7 @@ is where we actually call the SpiderMonkey trace hooks:
|
|||
|
||||
```rust
|
||||
/// Trace the `JSObject` held by `reflector`.
|
||||
#[allow(unrooted_must_root)]
|
||||
#[allow(crown::unrooted_must_root)]
|
||||
pub fn trace_reflector(tracer: *mut JSTracer, description: &str, reflector: &Reflector) {
|
||||
trace!("tracing reflector {}", description);
|
||||
trace_object(tracer, description, reflector.rootable())
|
||||
|
|
|
@ -29,7 +29,7 @@ pub enum LoadType {
|
|||
/// created via DocumentLoader::fetch_async) are always removed by the time
|
||||
/// that the owner is destroyed.
|
||||
#[derive(JSTraceable, MallocSizeOf)]
|
||||
#[unrooted_must_root_lint::must_root]
|
||||
#[crown::unrooted_must_root_lint::must_root]
|
||||
pub struct LoadBlocker {
|
||||
/// The document whose load event is blocked by this object existing.
|
||||
doc: Dom<Document>,
|
||||
|
|
|
@ -37,7 +37,7 @@ pub struct AnalyserNode {
|
|||
}
|
||||
|
||||
impl AnalyserNode {
|
||||
#[allow(unrooted_must_root)]
|
||||
#[allow(crown::unrooted_must_root)]
|
||||
pub fn new_inherited(
|
||||
_: &Window,
|
||||
context: &BaseAudioContext,
|
||||
|
@ -99,7 +99,7 @@ impl AnalyserNode {
|
|||
Self::new_with_proto(window, None, context, options)
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
#[allow(crown::unrooted_must_root)]
|
||||
pub fn new_with_proto(
|
||||
window: &Window,
|
||||
proto: Option<HandleObject>,
|
||||
|
|
|
@ -63,7 +63,7 @@ pub struct AudioBuffer {
|
|||
}
|
||||
|
||||
impl AudioBuffer {
|
||||
#[allow(unrooted_must_root)]
|
||||
#[allow(crown::unrooted_must_root)]
|
||||
#[allow(unsafe_code)]
|
||||
pub fn new_inherited(number_of_channels: u32, length: u32, sample_rate: f32) -> AudioBuffer {
|
||||
let vec = (0..number_of_channels).map(|_| Heap::default()).collect();
|
||||
|
@ -95,7 +95,7 @@ impl AudioBuffer {
|
|||
)
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
#[allow(crown::unrooted_must_root)]
|
||||
fn new_with_proto(
|
||||
global: &Window,
|
||||
proto: Option<HandleObject>,
|
||||
|
|
|
@ -42,7 +42,7 @@ pub struct AudioBufferSourceNode {
|
|||
}
|
||||
|
||||
impl AudioBufferSourceNode {
|
||||
#[allow(unrooted_must_root)]
|
||||
#[allow(crown::unrooted_must_root)]
|
||||
fn new_inherited(
|
||||
window: &Window,
|
||||
context: &BaseAudioContext,
|
||||
|
@ -105,7 +105,7 @@ impl AudioBufferSourceNode {
|
|||
Self::new_with_proto(window, None, context, options)
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
#[allow(crown::unrooted_must_root)]
|
||||
fn new_with_proto(
|
||||
window: &Window,
|
||||
proto: Option<HandleObject>,
|
||||
|
|
|
@ -46,7 +46,7 @@ pub struct AudioContext {
|
|||
}
|
||||
|
||||
impl AudioContext {
|
||||
#[allow(unrooted_must_root)]
|
||||
#[allow(crown::unrooted_must_root)]
|
||||
// https://webaudio.github.io/web-audio-api/#AudioContext-constructors
|
||||
fn new_inherited(options: &AudioContextOptions, pipeline_id: PipelineId) -> AudioContext {
|
||||
// Steps 1-3.
|
||||
|
@ -78,7 +78,7 @@ impl AudioContext {
|
|||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
#[allow(crown::unrooted_must_root)]
|
||||
fn new(
|
||||
window: &Window,
|
||||
proto: Option<HandleObject>,
|
||||
|
|
|
@ -37,7 +37,7 @@ impl AudioDestinationNode {
|
|||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
#[allow(crown::unrooted_must_root)]
|
||||
pub fn new(
|
||||
global: &GlobalScope,
|
||||
context: &BaseAudioContext,
|
||||
|
|
|
@ -142,7 +142,7 @@ impl AudioListener {
|
|||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
#[allow(crown::unrooted_must_root)]
|
||||
pub fn new(window: &Window, context: &BaseAudioContext) -> DomRoot<AudioListener> {
|
||||
let node = AudioListener::new_inherited(window, context);
|
||||
reflect_dom_object(Box::new(node), window)
|
||||
|
|
|
@ -58,7 +58,7 @@ impl AudioParam {
|
|||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
#[allow(crown::unrooted_must_root)]
|
||||
pub fn new(
|
||||
window: &Window,
|
||||
context: &BaseAudioContext,
|
||||
|
|
|
@ -27,7 +27,7 @@ pub struct AudioScheduledSourceNode {
|
|||
}
|
||||
|
||||
impl AudioScheduledSourceNode {
|
||||
#[allow(unrooted_must_root)]
|
||||
#[allow(crown::unrooted_must_root)]
|
||||
pub fn new_inherited(
|
||||
node_type: AudioNodeInit,
|
||||
context: &BaseAudioContext,
|
||||
|
|
|
@ -109,7 +109,7 @@ pub struct BaseAudioContext {
|
|||
}
|
||||
|
||||
impl BaseAudioContext {
|
||||
#[allow(unrooted_must_root)]
|
||||
#[allow(crown::unrooted_must_root)]
|
||||
pub fn new_inherited(
|
||||
options: BaseAudioContextOptions,
|
||||
pipeline_id: PipelineId,
|
||||
|
@ -193,9 +193,9 @@ impl BaseAudioContext {
|
|||
/// does not take a list of promises to fulfill. Callers cannot just pop
|
||||
/// the front list off of `in_flight_resume_promises_queue` and later fulfill
|
||||
/// the promises because that would mean putting
|
||||
/// `#[allow(unrooted_must_root)]` on even more functions, potentially
|
||||
/// `#[allow(crown::unrooted_must_root)]` on even more functions, potentially
|
||||
/// hiding actual safety bugs.
|
||||
#[allow(unrooted_must_root)]
|
||||
#[allow(crown::unrooted_must_root)]
|
||||
fn fulfill_in_flight_resume_promises<F>(&self, f: F)
|
||||
where
|
||||
F: FnOnce(),
|
||||
|
|
|
@ -42,7 +42,7 @@ pub enum ExceptionHandling {
|
|||
/// A common base class for representing IDL callback function and
|
||||
/// callback interface types.
|
||||
#[derive(JSTraceable)]
|
||||
#[unrooted_must_root_lint::must_root]
|
||||
#[crown::unrooted_must_root_lint::must_root]
|
||||
pub struct CallbackObject {
|
||||
/// The underlying `JSObject`.
|
||||
callback: Heap<*mut JSObject>,
|
||||
|
@ -63,14 +63,14 @@ pub struct CallbackObject {
|
|||
}
|
||||
|
||||
impl Default for CallbackObject {
|
||||
#[allow(unrooted_must_root)]
|
||||
#[allow(crown::unrooted_must_root)]
|
||||
fn default() -> CallbackObject {
|
||||
CallbackObject::new()
|
||||
}
|
||||
}
|
||||
|
||||
impl CallbackObject {
|
||||
#[allow(unrooted_must_root)]
|
||||
#[allow(crown::unrooted_must_root)]
|
||||
fn new() -> CallbackObject {
|
||||
CallbackObject {
|
||||
callback: Heap::default(),
|
||||
|
@ -133,14 +133,14 @@ pub trait CallbackContainer {
|
|||
|
||||
/// A common base class for representing IDL callback function types.
|
||||
#[derive(JSTraceable, PartialEq)]
|
||||
#[unrooted_must_root_lint::must_root]
|
||||
#[crown::unrooted_must_root_lint::must_root]
|
||||
pub struct CallbackFunction {
|
||||
object: CallbackObject,
|
||||
}
|
||||
|
||||
impl CallbackFunction {
|
||||
/// Create a new `CallbackFunction` for this object.
|
||||
#[allow(unrooted_must_root)]
|
||||
#[allow(crown::unrooted_must_root)]
|
||||
pub fn new() -> CallbackFunction {
|
||||
CallbackFunction {
|
||||
object: CallbackObject::new(),
|
||||
|
@ -161,7 +161,7 @@ impl CallbackFunction {
|
|||
|
||||
/// A common base class for representing IDL callback interface types.
|
||||
#[derive(JSTraceable, PartialEq)]
|
||||
#[unrooted_must_root_lint::must_root]
|
||||
#[crown::unrooted_must_root_lint::must_root]
|
||||
pub struct CallbackInterface {
|
||||
object: CallbackObject,
|
||||
}
|
||||
|
@ -241,7 +241,7 @@ pub struct CallSetup {
|
|||
|
||||
impl CallSetup {
|
||||
/// Performs the setup needed to make a call.
|
||||
#[allow(unrooted_must_root)]
|
||||
#[allow(crown::unrooted_must_root)]
|
||||
pub fn new<T: CallbackContainer>(callback: &T, handling: ExceptionHandling) -> CallSetup {
|
||||
let global = unsafe { GlobalScope::from_object(callback.callback()) };
|
||||
if let Some(window) = global.downcast::<Window>() {
|
||||
|
|
|
@ -6906,7 +6906,7 @@ class CGDictionary(CGThing):
|
|||
derive = ["JSTraceable"]
|
||||
mustRoot = ""
|
||||
if self.membersNeedTracing():
|
||||
mustRoot = "#[unrooted_must_root_lint::must_root]\n"
|
||||
mustRoot = "#[crown::unrooted_must_root_lint::must_root]\n"
|
||||
if not self.hasRequiredFields(self.dictionary):
|
||||
derive += ["Default"]
|
||||
|
||||
|
@ -7450,7 +7450,7 @@ class CGCallback(CGClass):
|
|||
constructors=self.getConstructors(),
|
||||
methods=realMethods,
|
||||
decorators="#[derive(JSTraceable, PartialEq)]\n"
|
||||
"#[unrooted_must_root_lint::allow_unrooted_interior]")
|
||||
"#[crown::unrooted_must_root_lint::allow_unrooted_interior]")
|
||||
|
||||
def getConstructors(self):
|
||||
return [ClassConstructor(
|
||||
|
|
|
@ -165,7 +165,7 @@ pub mod xmlname;
|
|||
/// Generated JS-Rust bindings.
|
||||
#[allow(missing_docs, non_snake_case)]
|
||||
pub mod codegen {
|
||||
#[allow(dead_code, unrooted_must_root)]
|
||||
#[allow(dead_code, crown::unrooted_must_root)]
|
||||
pub mod Bindings {
|
||||
include!(concat!(env!("OUT_DIR"), "/Bindings/mod.rs"));
|
||||
}
|
||||
|
|
|
@ -80,7 +80,7 @@ impl TrustedPromise {
|
|||
/// Create a new `TrustedPromise` instance from an existing DOM object. The object will
|
||||
/// be prevented from being GCed for the duration of the resulting `TrustedPromise` object's
|
||||
/// lifetime.
|
||||
#[allow(unrooted_must_root)]
|
||||
#[allow(crown::unrooted_must_root)]
|
||||
pub fn new(promise: Rc<Promise>) -> TrustedPromise {
|
||||
LIVE_REFERENCES.with(|ref r| {
|
||||
let r = r.borrow();
|
||||
|
@ -130,7 +130,7 @@ impl TrustedPromise {
|
|||
}
|
||||
|
||||
/// A task which will reject the promise.
|
||||
#[allow(unrooted_must_root)]
|
||||
#[allow(crown::unrooted_must_root)]
|
||||
pub fn reject_task(self, error: Error) -> impl TaskOnce {
|
||||
let this = self;
|
||||
task!(reject_promise: move || {
|
||||
|
@ -140,7 +140,7 @@ impl TrustedPromise {
|
|||
}
|
||||
|
||||
/// A task which will resolve the promise.
|
||||
#[allow(unrooted_must_root)]
|
||||
#[allow(crown::unrooted_must_root)]
|
||||
pub fn resolve_task<T>(self, value: T) -> impl TaskOnce
|
||||
where
|
||||
T: ToJSValConvertible + Send,
|
||||
|
@ -157,7 +157,7 @@ impl TrustedPromise {
|
|||
/// shared among threads for use in asynchronous operations. The underlying
|
||||
/// DOM object is guaranteed to live at least as long as the last outstanding
|
||||
/// `Trusted<T>` instance.
|
||||
#[unrooted_must_root_lint::allow_unrooted_interior]
|
||||
#[crown::unrooted_must_root_lint::allow_unrooted_interior]
|
||||
pub struct Trusted<T: DomObject> {
|
||||
/// A pointer to the Rust DOM object of type T, but void to allow
|
||||
/// sending `Trusted<T>` between threads, regardless of T's sendability.
|
||||
|
@ -220,7 +220,7 @@ impl<T: DomObject> Clone for Trusted<T> {
|
|||
|
||||
/// The set of live, pinned DOM objects that are currently prevented
|
||||
/// from being garbage collected due to outstanding references.
|
||||
#[allow(unrooted_must_root)]
|
||||
#[allow(crown::unrooted_must_root)]
|
||||
pub struct LiveDOMReferences {
|
||||
// keyed on pointer to Rust DOM object
|
||||
reflectable_table: RefCell<HashMap<*const libc::c_void, Weak<TrustedReference>>>,
|
||||
|
@ -244,7 +244,7 @@ impl LiveDOMReferences {
|
|||
});
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
#[allow(crown::unrooted_must_root)]
|
||||
fn addref_promise(&self, promise: Rc<Promise>) {
|
||||
let mut table = self.promise_table.borrow_mut();
|
||||
table.entry(&*promise).or_insert(vec![]).push(promise)
|
||||
|
@ -294,7 +294,7 @@ fn remove_nulls<K: Eq + Hash + Clone, V>(table: &mut HashMap<K, Weak<V>>) {
|
|||
}
|
||||
|
||||
/// A JSTraceDataOp for tracing reflectors held in LIVE_REFERENCES
|
||||
#[allow(unrooted_must_root)]
|
||||
#[allow(crown::unrooted_must_root)]
|
||||
pub unsafe fn trace_refcounted_objects(tracer: *mut JSTracer) {
|
||||
info!("tracing live refcounted references");
|
||||
LIVE_REFERENCES.with(|ref r| {
|
||||
|
|
|
@ -42,16 +42,16 @@ where
|
|||
}
|
||||
|
||||
/// A struct to store a reference to the reflector of a DOM object.
|
||||
#[allow(unrooted_must_root)]
|
||||
#[allow(crown::unrooted_must_root)]
|
||||
#[derive(MallocSizeOf)]
|
||||
#[unrooted_must_root_lint::must_root]
|
||||
#[crown::unrooted_must_root_lint::must_root]
|
||||
// If you're renaming or moving this field, update the path in plugins::reflector as well
|
||||
pub struct Reflector {
|
||||
#[ignore_malloc_size_of = "defined and measured in rust-mozjs"]
|
||||
object: Heap<*mut JSObject>,
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
#[allow(crown::unrooted_must_root)]
|
||||
impl PartialEq for Reflector {
|
||||
fn eq(&self, other: &Reflector) -> bool {
|
||||
self.object.get() == other.object.get()
|
||||
|
|
|
@ -44,8 +44,8 @@ use crate::dom::bindings::trace::{trace_reflector, JSTraceable};
|
|||
use crate::dom::node::Node;
|
||||
|
||||
/// A rooted value.
|
||||
#[allow(unrooted_must_root)]
|
||||
#[unrooted_must_root_lint::allow_unrooted_interior]
|
||||
#[allow(crown::unrooted_must_root)]
|
||||
#[crown::unrooted_must_root_lint::allow_unrooted_interior]
|
||||
pub struct Root<T: StableTraceObject> {
|
||||
/// The value to root.
|
||||
value: T,
|
||||
|
@ -60,7 +60,7 @@ where
|
|||
/// Create a new stack-bounded root for the provided value.
|
||||
/// It cannot outlive its associated `RootCollection`, and it gives
|
||||
/// out references which cannot outlive this new `Root`.
|
||||
#[allow(unrooted_must_root)]
|
||||
#[allow(crown::unrooted_must_root)]
|
||||
pub unsafe fn new(value: T) -> Self {
|
||||
unsafe fn add_to_root_list(object: *const dyn JSTraceable) -> *const RootCollection {
|
||||
assert_in_script();
|
||||
|
@ -92,7 +92,7 @@ where
|
|||
// The JSTraceable impl for Reflector doesn't actually do anything,
|
||||
// so we need this shenanigan to actually trace the reflector of the
|
||||
// T pointer in Dom<T>.
|
||||
#[allow(unrooted_must_root)]
|
||||
#[allow(crown::unrooted_must_root)]
|
||||
struct ReflectorStackRoot(Reflector);
|
||||
unsafe impl JSTraceable for ReflectorStackRoot {
|
||||
unsafe fn trace(&self, tracer: *mut JSTracer) {
|
||||
|
@ -111,7 +111,7 @@ where
|
|||
// The JSTraceable impl for Reflector doesn't actually do anything,
|
||||
// so we need this shenanigan to actually trace the reflector of the
|
||||
// T pointer in Dom<T>.
|
||||
#[allow(unrooted_must_root)]
|
||||
#[allow(crown::unrooted_must_root)]
|
||||
struct MaybeUnreflectedStackRoot<T>(T);
|
||||
unsafe impl<T> JSTraceable for MaybeUnreflectedStackRoot<T>
|
||||
where
|
||||
|
@ -316,7 +316,7 @@ where
|
|||
/// on the stack, the `Dom<T>` can point to freed memory.
|
||||
///
|
||||
/// This should only be used as a field in other DOM objects.
|
||||
#[unrooted_must_root_lint::must_root]
|
||||
#[crown::unrooted_must_root_lint::must_root]
|
||||
pub struct Dom<T> {
|
||||
ptr: ptr::NonNull<T>,
|
||||
}
|
||||
|
@ -341,7 +341,7 @@ impl<T> Dom<T> {
|
|||
|
||||
impl<T: DomObject> Dom<T> {
|
||||
/// Create a Dom<T> from a &T
|
||||
#[allow(unrooted_must_root)]
|
||||
#[allow(crown::unrooted_must_root)]
|
||||
pub fn from_ref(obj: &T) -> Dom<T> {
|
||||
assert_in_script();
|
||||
Dom {
|
||||
|
@ -375,7 +375,7 @@ unsafe impl<T: DomObject> JSTraceable for Dom<T> {
|
|||
}
|
||||
|
||||
/// A traced reference to a DOM object that may not be reflected yet.
|
||||
#[unrooted_must_root_lint::must_root]
|
||||
#[crown::unrooted_must_root_lint::must_root]
|
||||
pub struct MaybeUnreflectedDom<T> {
|
||||
ptr: ptr::NonNull<T>,
|
||||
}
|
||||
|
@ -384,7 +384,7 @@ impl<T> MaybeUnreflectedDom<T>
|
|||
where
|
||||
T: DomObject,
|
||||
{
|
||||
#[allow(unrooted_must_root)]
|
||||
#[allow(crown::unrooted_must_root)]
|
||||
pub unsafe fn from_box(value: Box<T>) -> Self {
|
||||
Self {
|
||||
ptr: Box::leak(value).into(),
|
||||
|
@ -416,7 +416,7 @@ where
|
|||
|
||||
/// An unrooted reference to a DOM object for use in layout. `Layout*Helpers`
|
||||
/// traits must be implemented on this.
|
||||
#[unrooted_must_root_lint::allow_unrooted_interior]
|
||||
#[crown::unrooted_must_root_lint::allow_unrooted_interior]
|
||||
pub struct LayoutDom<'dom, T> {
|
||||
value: &'dom T,
|
||||
}
|
||||
|
@ -505,7 +505,7 @@ impl<T> Hash for LayoutDom<'_, T> {
|
|||
|
||||
impl<T> Clone for Dom<T> {
|
||||
#[inline]
|
||||
#[allow(unrooted_must_root)]
|
||||
#[allow(crown::unrooted_must_root)]
|
||||
fn clone(&self) -> Self {
|
||||
assert_in_script();
|
||||
Dom {
|
||||
|
@ -539,7 +539,7 @@ impl LayoutDom<'_, Node> {
|
|||
///
|
||||
/// This should only be used as a field in other DOM objects; see warning
|
||||
/// on `Dom<T>`.
|
||||
#[unrooted_must_root_lint::must_root]
|
||||
#[crown::unrooted_must_root_lint::must_root]
|
||||
#[derive(JSTraceable)]
|
||||
pub struct MutDom<T: DomObject> {
|
||||
val: UnsafeCell<Dom<T>>,
|
||||
|
@ -602,7 +602,7 @@ pub(crate) fn assert_in_layout() {
|
|||
///
|
||||
/// This should only be used as a field in other DOM objects; see warning
|
||||
/// on `Dom<T>`.
|
||||
#[unrooted_must_root_lint::must_root]
|
||||
#[crown::unrooted_must_root_lint::must_root]
|
||||
#[derive(JSTraceable)]
|
||||
pub struct MutNullableDom<T: DomObject> {
|
||||
ptr: UnsafeCell<Option<Dom<T>>>,
|
||||
|
@ -636,14 +636,14 @@ impl<T: DomObject> MutNullableDom<T> {
|
|||
|
||||
/// Retrieve a copy of the inner optional `Dom<T>` as `LayoutDom<T>`.
|
||||
/// For use by layout, which can't use safe types like Temporary.
|
||||
#[allow(unrooted_must_root)]
|
||||
#[allow(crown::unrooted_must_root)]
|
||||
pub unsafe fn get_inner_as_layout(&self) -> Option<LayoutDom<T>> {
|
||||
assert_in_layout();
|
||||
(*self.ptr.get()).as_ref().map(|js| js.to_layout())
|
||||
}
|
||||
|
||||
/// Get a rooted value out of this object
|
||||
#[allow(unrooted_must_root)]
|
||||
#[allow(crown::unrooted_must_root)]
|
||||
pub fn get(&self) -> Option<DomRoot<T>> {
|
||||
assert_in_script();
|
||||
unsafe { ptr::read(self.ptr.get()).map(|o| DomRoot::from_ref(&*o)) }
|
||||
|
@ -678,7 +678,7 @@ impl<'a, T: DomObject> PartialEq<Option<&'a T>> for MutNullableDom<T> {
|
|||
}
|
||||
|
||||
impl<T: DomObject> Default for MutNullableDom<T> {
|
||||
#[allow(unrooted_must_root)]
|
||||
#[allow(crown::unrooted_must_root)]
|
||||
fn default() -> MutNullableDom<T> {
|
||||
assert_in_script();
|
||||
MutNullableDom {
|
||||
|
@ -700,7 +700,7 @@ impl<T: DomObject> MallocSizeOf for MutNullableDom<T> {
|
|||
///
|
||||
/// This should only be used as a field in other DOM objects; see warning
|
||||
/// on `Dom<T>`.
|
||||
#[unrooted_must_root_lint::must_root]
|
||||
#[crown::unrooted_must_root_lint::must_root]
|
||||
pub struct DomOnceCell<T: DomObject> {
|
||||
ptr: OnceCell<Dom<T>>,
|
||||
}
|
||||
|
@ -711,7 +711,7 @@ where
|
|||
{
|
||||
/// Retrieve a copy of the current inner value. If it is `None`, it is
|
||||
/// initialized with the result of `cb` first.
|
||||
#[allow(unrooted_must_root)]
|
||||
#[allow(crown::unrooted_must_root)]
|
||||
pub fn init_once<F>(&self, cb: F) -> &T
|
||||
where
|
||||
F: FnOnce() -> DomRoot<T>,
|
||||
|
@ -722,7 +722,7 @@ where
|
|||
}
|
||||
|
||||
impl<T: DomObject> Default for DomOnceCell<T> {
|
||||
#[allow(unrooted_must_root)]
|
||||
#[allow(crown::unrooted_must_root)]
|
||||
fn default() -> DomOnceCell<T> {
|
||||
assert_in_script();
|
||||
DomOnceCell {
|
||||
|
@ -738,7 +738,7 @@ impl<T: DomObject> MallocSizeOf for DomOnceCell<T> {
|
|||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
#[allow(crown::unrooted_must_root)]
|
||||
unsafe impl<T: DomObject> JSTraceable for DomOnceCell<T> {
|
||||
unsafe fn trace(&self, trc: *mut JSTracer) {
|
||||
if let Some(ptr) = self.ptr.get() {
|
||||
|
|
|
@ -20,7 +20,7 @@ enum StackEntryKind {
|
|||
Entry,
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
#[allow(crown::unrooted_must_root)]
|
||||
#[derive(JSTraceable)]
|
||||
struct StackEntry {
|
||||
global: Dom<GlobalScope>,
|
||||
|
|
|
@ -100,7 +100,7 @@ unsafe impl<T: JSTraceable> CustomTraceable for OnceCell<T> {
|
|||
///
|
||||
/// SAFETY: Inner type must not impl JSTraceable
|
||||
#[derive(Clone, Copy, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)]
|
||||
#[trace_in_no_trace_lint::must_not_have_traceable]
|
||||
#[crown::trace_in_no_trace_lint::must_not_have_traceable]
|
||||
pub struct NoTrace<T>(pub T);
|
||||
|
||||
impl<T: Display> Display for NoTrace<T> {
|
||||
|
@ -130,7 +130,7 @@ impl<T: MallocSizeOf> MallocSizeOf for NoTrace<T> {
|
|||
/// HashMap wrapper, that has non-jsmanaged keys
|
||||
///
|
||||
/// Not all methods are reexposed, but you can access inner type via .0
|
||||
#[trace_in_no_trace_lint::must_not_have_traceable(0)]
|
||||
#[crown::trace_in_no_trace_lint::must_not_have_traceable(0)]
|
||||
#[derive(Clone, Debug)]
|
||||
pub struct HashMapTracedValues<K, V, S = RandomState>(pub HashMap<K, V, S>);
|
||||
|
||||
|
@ -276,7 +276,7 @@ pub fn trace_jsval(tracer: *mut JSTracer, description: &str, val: &Heap<JSVal>)
|
|||
}
|
||||
|
||||
/// Trace the `JSObject` held by `reflector`.
|
||||
#[allow(unrooted_must_root)]
|
||||
#[allow(crown::unrooted_must_root)]
|
||||
pub fn trace_reflector(tracer: *mut JSTracer, description: &str, reflector: &Reflector) {
|
||||
trace!("tracing reflector {}", description);
|
||||
trace_object(tracer, description, reflector.rootable())
|
||||
|
@ -482,7 +482,7 @@ pub use js::gc::RootedTraceableSet;
|
|||
/// If you have GC things like *mut JSObject or JSVal, use rooted!.
|
||||
/// If you have an arbitrary number of DomObjects to root, use rooted_vec!.
|
||||
/// If you know what you're doing, use this.
|
||||
#[unrooted_must_root_lint::allow_unrooted_interior]
|
||||
#[crown::unrooted_must_root_lint::allow_unrooted_interior]
|
||||
pub struct RootedTraceableBox<T: JSTraceable + 'static>(js::gc::RootedTraceableBox<T>);
|
||||
|
||||
unsafe impl<T: JSTraceable + 'static> JSTraceable for RootedTraceableBox<T> {
|
||||
|
@ -547,9 +547,9 @@ impl<T: JSTraceable> DerefMut for RootedTraceableBox<T> {
|
|||
/// Guaranteed to be empty when not rooted.
|
||||
/// Usage: `rooted_vec!(let mut v);` or if you have an
|
||||
/// iterator of `DomRoot`s, `rooted_vec!(let v <- iterator);`.
|
||||
#[allow(unrooted_must_root)]
|
||||
#[allow(crown::unrooted_must_root)]
|
||||
#[derive(JSTraceable)]
|
||||
#[unrooted_must_root_lint::allow_unrooted_interior]
|
||||
#[crown::unrooted_must_root_lint::allow_unrooted_interior]
|
||||
pub struct RootableVec<T: JSTraceable> {
|
||||
v: Vec<T>,
|
||||
}
|
||||
|
@ -562,7 +562,7 @@ impl<T: JSTraceable> RootableVec<T> {
|
|||
}
|
||||
|
||||
/// A vector of items that are rooted for the lifetime 'a.
|
||||
#[unrooted_must_root_lint::allow_unrooted_interior]
|
||||
#[crown::unrooted_must_root_lint::allow_unrooted_interior]
|
||||
pub struct RootedVec<'a, T: 'static + JSTraceable> {
|
||||
root: &'a mut RootableVec<T>,
|
||||
}
|
||||
|
|
|
@ -33,14 +33,14 @@ use crate::dom::bindings::trace::JSTraceable;
|
|||
pub const DOM_WEAK_SLOT: u32 = 1;
|
||||
|
||||
/// A weak reference to a JS-managed DOM object.
|
||||
#[allow(unrooted_must_root)]
|
||||
#[unrooted_must_root_lint::allow_unrooted_interior]
|
||||
#[allow(crown::unrooted_must_root)]
|
||||
#[crown::unrooted_must_root_lint::allow_unrooted_interior]
|
||||
pub struct WeakRef<T: WeakReferenceable> {
|
||||
ptr: ptr::NonNull<WeakBox<T>>,
|
||||
}
|
||||
|
||||
/// The inner box of weak references, public for the finalization in codegen.
|
||||
#[unrooted_must_root_lint::must_root]
|
||||
#[crown::unrooted_must_root_lint::must_root]
|
||||
pub struct WeakBox<T: WeakReferenceable> {
|
||||
/// The reference count. When it reaches zero, the `value` field should
|
||||
/// have already been set to `None`. The pointee contributes one to the count.
|
||||
|
@ -218,7 +218,7 @@ unsafe impl<T: WeakReferenceable> JSTraceable for MutableWeakRef<T> {
|
|||
|
||||
/// A vector of weak references. On tracing, the vector retains
|
||||
/// only references which still point to live objects.
|
||||
#[unrooted_must_root_lint::allow_unrooted_interior]
|
||||
#[crown::unrooted_must_root_lint::allow_unrooted_interior]
|
||||
#[derive(MallocSizeOf)]
|
||||
pub struct WeakRefVec<T: WeakReferenceable> {
|
||||
vec: Vec<WeakRef<T>>,
|
||||
|
@ -268,7 +268,7 @@ impl<T: WeakReferenceable> DerefMut for WeakRefVec<T> {
|
|||
|
||||
/// An entry of a vector of weak references. Passed to the closure
|
||||
/// given to `WeakRefVec::update`.
|
||||
#[unrooted_must_root_lint::allow_unrooted_interior]
|
||||
#[crown::unrooted_must_root_lint::allow_unrooted_interior]
|
||||
pub struct WeakRefEntry<'a, T: WeakReferenceable> {
|
||||
vec: &'a mut WeakRefVec<T>,
|
||||
index: &'a mut usize,
|
||||
|
|
|
@ -39,7 +39,7 @@ pub struct BiquadFilterNode {
|
|||
}
|
||||
|
||||
impl BiquadFilterNode {
|
||||
#[allow(unrooted_must_root)]
|
||||
#[allow(crown::unrooted_must_root)]
|
||||
pub fn new_inherited(
|
||||
window: &Window,
|
||||
context: &BaseAudioContext,
|
||||
|
@ -116,7 +116,7 @@ impl BiquadFilterNode {
|
|||
Self::new_with_proto(window, None, context, options)
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
#[allow(crown::unrooted_must_root)]
|
||||
fn new_with_proto(
|
||||
window: &Window,
|
||||
proto: Option<HandleObject>,
|
||||
|
|
|
@ -56,7 +56,7 @@ impl Blob {
|
|||
dom_blob
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
#[allow(crown::unrooted_must_root)]
|
||||
pub fn new_inherited(blob_impl: &BlobImpl) -> Blob {
|
||||
Blob {
|
||||
reflector_: Reflector::new(),
|
||||
|
|
|
@ -113,7 +113,7 @@ impl<T> BluetoothContext<T>
|
|||
where
|
||||
T: AsyncBluetoothListener + DomObject,
|
||||
{
|
||||
#[allow(unrooted_must_root)]
|
||||
#[allow(crown::unrooted_must_root)]
|
||||
fn response(&mut self, response: BluetoothResponseResult) {
|
||||
let promise = self.promise.take().expect("bt promise is missing").root();
|
||||
|
||||
|
@ -737,7 +737,7 @@ impl PermissionAlgorithm for Bluetooth {
|
|||
// NOTE: Step 3. is in BluetoothPermissionResult's `handle_response` function.
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
#[allow(crown::unrooted_must_root)]
|
||||
// https://webbluetoothcg.github.io/web-bluetooth/#revoke-bluetooth-access
|
||||
fn permission_revoke(
|
||||
_descriptor: &BluetoothPermissionDescriptor,
|
||||
|
|
|
@ -187,7 +187,7 @@ impl BluetoothDevice {
|
|||
}
|
||||
|
||||
// https://webbluetoothcg.github.io/web-bluetooth/#clean-up-the-disconnected-device
|
||||
#[allow(unrooted_must_root)]
|
||||
#[allow(crown::unrooted_must_root)]
|
||||
pub fn clean_up_disconnected_device(&self) {
|
||||
// Step 1.
|
||||
self.get_gatt().set_connected(false);
|
||||
|
@ -223,7 +223,7 @@ impl BluetoothDevice {
|
|||
}
|
||||
|
||||
// https://webbluetoothcg.github.io/web-bluetooth/#garbage-collect-the-connection
|
||||
#[allow(unrooted_must_root)]
|
||||
#[allow(crown::unrooted_must_root)]
|
||||
pub fn garbage_collect_the_connection(&self) -> ErrorResult {
|
||||
// Step 1: TODO: Check if other systems using this device.
|
||||
|
||||
|
|
|
@ -34,7 +34,7 @@ pub struct BluetoothPermissionResult {
|
|||
}
|
||||
|
||||
impl BluetoothPermissionResult {
|
||||
#[allow(unrooted_must_root)]
|
||||
#[allow(crown::unrooted_must_root)]
|
||||
fn new_inherited(status: &PermissionStatus) -> BluetoothPermissionResult {
|
||||
let result = BluetoothPermissionResult {
|
||||
status: PermissionStatus::new_inherited(status.get_query()),
|
||||
|
@ -74,7 +74,7 @@ impl BluetoothPermissionResult {
|
|||
self.status.State()
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
#[allow(crown::unrooted_must_root)]
|
||||
pub fn set_devices(&self, devices: Vec<Dom<BluetoothDevice>>) {
|
||||
*self.devices.borrow_mut() = devices;
|
||||
}
|
||||
|
|
|
@ -175,7 +175,7 @@ impl CanvasRenderingContext2DMethods for CanvasRenderingContext2D {
|
|||
self.canvas_state.save()
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
#[allow(crown::unrooted_must_root)]
|
||||
// https://html.spec.whatwg.org/multipage/#dom-context-2d-restore
|
||||
fn Restore(&self) {
|
||||
self.canvas_state.restore()
|
||||
|
|
|
@ -24,7 +24,7 @@ pub struct ChannelMergerNode {
|
|||
}
|
||||
|
||||
impl ChannelMergerNode {
|
||||
#[allow(unrooted_must_root)]
|
||||
#[allow(crown::unrooted_must_root)]
|
||||
pub fn new_inherited(
|
||||
_: &Window,
|
||||
context: &BaseAudioContext,
|
||||
|
@ -62,7 +62,7 @@ impl ChannelMergerNode {
|
|||
Self::new_with_proto(window, None, context, options)
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
#[allow(crown::unrooted_must_root)]
|
||||
fn new_with_proto(
|
||||
window: &Window,
|
||||
proto: Option<HandleObject>,
|
||||
|
|
|
@ -23,7 +23,7 @@ pub struct ChannelSplitterNode {
|
|||
}
|
||||
|
||||
impl ChannelSplitterNode {
|
||||
#[allow(unrooted_must_root)]
|
||||
#[allow(crown::unrooted_must_root)]
|
||||
pub fn new_inherited(
|
||||
_: &Window,
|
||||
context: &BaseAudioContext,
|
||||
|
@ -64,7 +64,7 @@ impl ChannelSplitterNode {
|
|||
Self::new_with_proto(window, None, context, options)
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
#[allow(crown::unrooted_must_root)]
|
||||
fn new_with_proto(
|
||||
window: &Window,
|
||||
proto: Option<HandleObject>,
|
||||
|
|
|
@ -29,7 +29,7 @@ pub struct ConstantSourceNode {
|
|||
}
|
||||
|
||||
impl ConstantSourceNode {
|
||||
#[allow(unrooted_must_root)]
|
||||
#[allow(crown::unrooted_must_root)]
|
||||
fn new_inherited(
|
||||
window: &Window,
|
||||
context: &BaseAudioContext,
|
||||
|
@ -69,7 +69,7 @@ impl ConstantSourceNode {
|
|||
Self::new_with_proto(window, None, context, options)
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
#[allow(crown::unrooted_must_root)]
|
||||
fn new_with_proto(
|
||||
window: &Window,
|
||||
proto: Option<HandleObject>,
|
||||
|
|
|
@ -33,7 +33,7 @@ impl CSSFontFaceRule {
|
|||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
#[allow(crown::unrooted_must_root)]
|
||||
pub fn new(
|
||||
window: &Window,
|
||||
parent_stylesheet: &CSSStyleSheet,
|
||||
|
|
|
@ -33,7 +33,7 @@ impl CSSImportRule {
|
|||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
#[allow(crown::unrooted_must_root)]
|
||||
pub fn new(
|
||||
window: &Window,
|
||||
parent_stylesheet: &CSSStyleSheet,
|
||||
|
|
|
@ -38,7 +38,7 @@ impl CSSKeyframeRule {
|
|||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
#[allow(crown::unrooted_must_root)]
|
||||
pub fn new(
|
||||
window: &Window,
|
||||
parent_stylesheet: &CSSStyleSheet,
|
||||
|
|
|
@ -42,7 +42,7 @@ impl CSSKeyframesRule {
|
|||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
#[allow(crown::unrooted_must_root)]
|
||||
pub fn new(
|
||||
window: &Window,
|
||||
parent_stylesheet: &CSSStyleSheet,
|
||||
|
|
|
@ -37,7 +37,7 @@ impl CSSMediaRule {
|
|||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
#[allow(crown::unrooted_must_root)]
|
||||
pub fn new(
|
||||
window: &Window,
|
||||
parent_stylesheet: &CSSStyleSheet,
|
||||
|
|
|
@ -34,7 +34,7 @@ impl CSSNamespaceRule {
|
|||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
#[allow(crown::unrooted_must_root)]
|
||||
pub fn new(
|
||||
window: &Window,
|
||||
parent_stylesheet: &CSSStyleSheet,
|
||||
|
|
|
@ -36,7 +36,7 @@ pub struct CSSRule {
|
|||
}
|
||||
|
||||
impl CSSRule {
|
||||
#[allow(unrooted_must_root)]
|
||||
#[allow(crown::unrooted_must_root)]
|
||||
pub fn new_inherited(parent_stylesheet: &CSSStyleSheet) -> CSSRule {
|
||||
CSSRule {
|
||||
reflector_: Reflector::new(),
|
||||
|
|
|
@ -52,7 +52,7 @@ pub enum RulesSource {
|
|||
}
|
||||
|
||||
impl CSSRuleList {
|
||||
#[allow(unrooted_must_root)]
|
||||
#[allow(crown::unrooted_must_root)]
|
||||
pub fn new_inherited(parent_stylesheet: &CSSStyleSheet, rules: RulesSource) -> CSSRuleList {
|
||||
let guard = parent_stylesheet.shared_lock().read();
|
||||
let dom_rules = match rules {
|
||||
|
@ -78,7 +78,7 @@ impl CSSRuleList {
|
|||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
#[allow(crown::unrooted_must_root)]
|
||||
pub fn new(
|
||||
window: &Window,
|
||||
parent_stylesheet: &CSSStyleSheet,
|
||||
|
|
|
@ -39,7 +39,7 @@ pub struct CSSStyleDeclaration {
|
|||
}
|
||||
|
||||
#[derive(JSTraceable, MallocSizeOf)]
|
||||
#[unrooted_must_root_lint::must_root]
|
||||
#[crown::unrooted_must_root_lint::must_root]
|
||||
pub enum CSSStyleOwner {
|
||||
Element(Dom<Element>),
|
||||
CSSRule(
|
||||
|
@ -209,7 +209,7 @@ fn remove_property(decls: &mut PropertyDeclarationBlock, id: &PropertyId) -> boo
|
|||
}
|
||||
|
||||
impl CSSStyleDeclaration {
|
||||
#[allow(unrooted_must_root)]
|
||||
#[allow(crown::unrooted_must_root)]
|
||||
pub fn new_inherited(
|
||||
owner: CSSStyleOwner,
|
||||
pseudo: Option<PseudoElement>,
|
||||
|
@ -223,7 +223,7 @@ impl CSSStyleDeclaration {
|
|||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
#[allow(crown::unrooted_must_root)]
|
||||
pub fn new(
|
||||
global: &Window,
|
||||
owner: CSSStyleOwner,
|
||||
|
|
|
@ -44,7 +44,7 @@ impl CSSStyleRule {
|
|||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
#[allow(crown::unrooted_must_root)]
|
||||
pub fn new(
|
||||
window: &Window,
|
||||
parent_stylesheet: &CSSStyleSheet,
|
||||
|
|
|
@ -50,7 +50,7 @@ impl CSSStyleSheet {
|
|||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
#[allow(crown::unrooted_must_root)]
|
||||
pub fn new(
|
||||
window: &Window,
|
||||
owner: &Element,
|
||||
|
|
|
@ -36,7 +36,7 @@ impl CSSSupportsRule {
|
|||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
#[allow(crown::unrooted_must_root)]
|
||||
pub fn new(
|
||||
window: &Window,
|
||||
parent_stylesheet: &CSSStyleSheet,
|
||||
|
|
|
@ -248,7 +248,7 @@ fn get_callback(
|
|||
}
|
||||
|
||||
impl CustomElementRegistryMethods for CustomElementRegistry {
|
||||
#[allow(unsafe_code, unrooted_must_root)]
|
||||
#[allow(unsafe_code, crown::unrooted_must_root)]
|
||||
/// <https://html.spec.whatwg.org/multipage/#dom-customelementregistry-define>
|
||||
fn Define(
|
||||
&self,
|
||||
|
@ -762,7 +762,7 @@ pub fn try_upgrade_element(element: &Element) {
|
|||
}
|
||||
|
||||
#[derive(JSTraceable, MallocSizeOf)]
|
||||
#[unrooted_must_root_lint::must_root]
|
||||
#[crown::unrooted_must_root_lint::must_root]
|
||||
pub enum CustomElementReaction {
|
||||
Upgrade(#[ignore_malloc_size_of = "Rc"] Rc<CustomElementDefinition>),
|
||||
Callback(
|
||||
|
@ -808,7 +808,7 @@ enum BackupElementQueueFlag {
|
|||
|
||||
/// <https://html.spec.whatwg.org/multipage/#custom-element-reactions-stack>
|
||||
#[derive(JSTraceable, MallocSizeOf)]
|
||||
#[unrooted_must_root_lint::must_root]
|
||||
#[crown::unrooted_must_root_lint::must_root]
|
||||
pub struct CustomElementReactionStack {
|
||||
stack: DomRefCell<Vec<ElementQueue>>,
|
||||
backup_queue: ElementQueue,
|
||||
|
@ -994,7 +994,7 @@ impl CustomElementReactionStack {
|
|||
|
||||
/// <https://html.spec.whatwg.org/multipage/#element-queue>
|
||||
#[derive(JSTraceable, MallocSizeOf)]
|
||||
#[unrooted_must_root_lint::must_root]
|
||||
#[crown::unrooted_must_root_lint::must_root]
|
||||
struct ElementQueue {
|
||||
queue: DomRefCell<VecDeque<Dom<Element>>>,
|
||||
}
|
||||
|
|
|
@ -28,7 +28,7 @@ pub struct DissimilarOriginLocation {
|
|||
}
|
||||
|
||||
impl DissimilarOriginLocation {
|
||||
#[allow(unrooted_must_root)]
|
||||
#[allow(crown::unrooted_must_root)]
|
||||
fn new_inherited(window: &DissimilarOriginWindow) -> DissimilarOriginLocation {
|
||||
DissimilarOriginLocation {
|
||||
reflector: Reflector::new(),
|
||||
|
|
|
@ -224,7 +224,7 @@ pub enum IsHTMLDocument {
|
|||
}
|
||||
|
||||
#[derive(JSTraceable, MallocSizeOf)]
|
||||
#[unrooted_must_root_lint::must_root]
|
||||
#[crown::unrooted_must_root_lint::must_root]
|
||||
enum FocusTransaction {
|
||||
/// No focus operation is in effect.
|
||||
NotInTransaction,
|
||||
|
@ -2878,7 +2878,7 @@ impl Document {
|
|||
.or_insert_with(|| Dom::from_ref(context));
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
#[allow(crown::unrooted_must_root)]
|
||||
pub fn flush_dirty_webgpu_canvases(&self) {
|
||||
self.dirty_webgpu_contexts
|
||||
.borrow_mut()
|
||||
|
@ -3817,7 +3817,7 @@ impl Document {
|
|||
|
||||
/// Add a stylesheet owned by `owner` to the list of document sheets, in the
|
||||
/// correct tree position.
|
||||
#[allow(unrooted_must_root)] // Owner needs to be rooted already necessarily.
|
||||
#[allow(crown::unrooted_must_root)] // Owner needs to be rooted already necessarily.
|
||||
pub fn add_stylesheet(&self, owner: &Element, sheet: Arc<Stylesheet>) {
|
||||
let stylesheets = &mut *self.stylesheets.borrow_mut();
|
||||
let insertion_point = stylesheets
|
||||
|
@ -3850,7 +3850,7 @@ impl Document {
|
|||
}
|
||||
|
||||
/// Remove a stylesheet owned by `owner` from the list of document sheets.
|
||||
#[allow(unrooted_must_root)] // Owner needs to be rooted already necessarily.
|
||||
#[allow(crown::unrooted_must_root)] // Owner needs to be rooted already necessarily.
|
||||
pub fn remove_stylesheet(&self, owner: &Element, s: &Arc<Stylesheet>) {
|
||||
match self.window.layout_chan() {
|
||||
Some(chan) => chan.send(Msg::RemoveStylesheet(s.clone())).unwrap(),
|
||||
|
@ -3876,7 +3876,7 @@ impl Document {
|
|||
})
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
#[allow(crown::unrooted_must_root)]
|
||||
pub fn drain_pending_restyles(&self) -> Vec<(TrustedNodeAddress, PendingRestyle)> {
|
||||
self.pending_restyles
|
||||
.borrow_mut()
|
||||
|
@ -5358,7 +5358,7 @@ impl AnimationFrameCallback {
|
|||
}
|
||||
|
||||
#[derive(Default, JSTraceable, MallocSizeOf)]
|
||||
#[unrooted_must_root_lint::must_root]
|
||||
#[crown::unrooted_must_root_lint::must_root]
|
||||
struct PendingInOrderScriptVec {
|
||||
scripts: DomRefCell<VecDeque<PendingScript>>,
|
||||
}
|
||||
|
@ -5396,7 +5396,7 @@ impl PendingInOrderScriptVec {
|
|||
}
|
||||
|
||||
#[derive(JSTraceable, MallocSizeOf)]
|
||||
#[unrooted_must_root_lint::must_root]
|
||||
#[crown::unrooted_must_root_lint::must_root]
|
||||
struct PendingScript {
|
||||
element: Dom<HTMLScriptElement>,
|
||||
// TODO(sagudev): could this be all no_trace?
|
||||
|
|
|
@ -27,7 +27,7 @@ use crate::dom::window::Window;
|
|||
use crate::stylesheet_set::StylesheetSetRef;
|
||||
|
||||
#[derive(Clone, JSTraceable, MallocSizeOf)]
|
||||
#[unrooted_must_root_lint::must_root]
|
||||
#[crown::unrooted_must_root_lint::must_root]
|
||||
pub struct StyleSheetInDocument {
|
||||
#[ignore_malloc_size_of = "Arc"]
|
||||
#[no_trace]
|
||||
|
@ -68,7 +68,7 @@ impl ::style::stylesheets::StylesheetInDocument for StyleSheetInDocument {
|
|||
}
|
||||
|
||||
// https://w3c.github.io/webcomponents/spec/shadow/#extensions-to-the-documentorshadowroot-mixin
|
||||
#[unrooted_must_root_lint::must_root]
|
||||
#[crown::unrooted_must_root_lint::must_root]
|
||||
#[derive(JSTraceable, MallocSizeOf)]
|
||||
pub struct DocumentOrShadowRoot {
|
||||
window: Dom<Window>,
|
||||
|
@ -199,7 +199,7 @@ impl DocumentOrShadowRoot {
|
|||
}
|
||||
|
||||
/// Remove a stylesheet owned by `owner` from the list of document sheets.
|
||||
#[allow(unrooted_must_root)] // Owner needs to be rooted already necessarily.
|
||||
#[allow(crown::unrooted_must_root)] // Owner needs to be rooted already necessarily.
|
||||
pub fn remove_stylesheet(
|
||||
owner: &Element,
|
||||
s: &Arc<Stylesheet>,
|
||||
|
@ -220,7 +220,7 @@ impl DocumentOrShadowRoot {
|
|||
|
||||
/// Add a stylesheet owned by `owner` to the list of document sheets, in the
|
||||
/// correct tree position.
|
||||
#[allow(unrooted_must_root)] // Owner needs to be rooted already necessarily.
|
||||
#[allow(crown::unrooted_must_root)] // Owner needs to be rooted already necessarily.
|
||||
pub fn add_stylesheet(
|
||||
owner: &Element,
|
||||
mut stylesheets: StylesheetSetRef<StyleSheetInDocument>,
|
||||
|
|
|
@ -37,7 +37,7 @@ impl DocumentType {
|
|||
system_id: system_id.unwrap_or_default(),
|
||||
}
|
||||
}
|
||||
#[allow(unrooted_must_root)]
|
||||
#[allow(crown::unrooted_must_root)]
|
||||
pub fn new(
|
||||
name: DOMString,
|
||||
public_id: Option<DOMString>,
|
||||
|
|
|
@ -32,7 +32,7 @@ impl DOMMatrix {
|
|||
Self::new_with_proto(global, None, is2D, matrix)
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
#[allow(crown::unrooted_must_root)]
|
||||
fn new_with_proto(
|
||||
global: &GlobalScope,
|
||||
proto: Option<HandleObject>,
|
||||
|
|
|
@ -46,7 +46,7 @@ impl DOMMatrixReadOnly {
|
|||
Self::new_with_proto(global, None, is2D, matrix)
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
#[allow(crown::unrooted_must_root)]
|
||||
fn new_with_proto(
|
||||
global: &GlobalScope,
|
||||
proto: Option<HandleObject>,
|
||||
|
|
|
@ -30,7 +30,7 @@ pub struct DynamicModuleOwner {
|
|||
}
|
||||
|
||||
impl DynamicModuleOwner {
|
||||
#[allow(unrooted_must_root)]
|
||||
#[allow(crown::unrooted_must_root)]
|
||||
fn new_inherited(promise: Rc<Promise>, id: DynamicModuleId) -> Self {
|
||||
DynamicModuleOwner {
|
||||
reflector_: Reflector::new(),
|
||||
|
@ -39,7 +39,7 @@ impl DynamicModuleOwner {
|
|||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
#[allow(crown::unrooted_must_root)]
|
||||
pub fn new(global: &GlobalScope, promise: Rc<Promise>, id: DynamicModuleId) -> DomRoot<Self> {
|
||||
reflect_dom_object(
|
||||
Box::new(DynamicModuleOwner::new_inherited(promise, id)),
|
||||
|
|
|
@ -3769,7 +3769,7 @@ impl ElementPerformFullscreenEnter {
|
|||
}
|
||||
|
||||
impl TaskOnce for ElementPerformFullscreenEnter {
|
||||
#[allow(unrooted_must_root)]
|
||||
#[allow(crown::unrooted_must_root)]
|
||||
fn run_once(self) {
|
||||
let element = self.element.root();
|
||||
let promise = self.promise.root();
|
||||
|
@ -3820,7 +3820,7 @@ impl ElementPerformFullscreenExit {
|
|||
}
|
||||
|
||||
impl TaskOnce for ElementPerformFullscreenExit {
|
||||
#[allow(unrooted_must_root)]
|
||||
#[allow(crown::unrooted_must_root)]
|
||||
fn run_once(self) {
|
||||
let element = self.element.root();
|
||||
let document = document_from_node(&*element);
|
||||
|
|
|
@ -27,7 +27,7 @@ pub struct File {
|
|||
}
|
||||
|
||||
impl File {
|
||||
#[allow(unrooted_must_root)]
|
||||
#[allow(crown::unrooted_must_root)]
|
||||
fn new_inherited(blob_impl: &BlobImpl, name: DOMString, modified: Option<i64>) -> File {
|
||||
File {
|
||||
blob: Blob::new_inherited(blob_impl),
|
||||
|
@ -52,7 +52,7 @@ impl File {
|
|||
Self::new_with_proto(global, None, blob_impl, name, modified)
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
#[allow(crown::unrooted_must_root)]
|
||||
fn new_with_proto(
|
||||
global: &GlobalScope,
|
||||
proto: Option<HandleObject>,
|
||||
|
|
|
@ -20,7 +20,7 @@ pub struct FileList {
|
|||
}
|
||||
|
||||
impl FileList {
|
||||
#[allow(unrooted_must_root)]
|
||||
#[allow(crown::unrooted_must_root)]
|
||||
fn new_inherited(files: Vec<Dom<File>>) -> FileList {
|
||||
FileList {
|
||||
reflector_: Reflector::new(),
|
||||
|
@ -28,7 +28,7 @@ impl FileList {
|
|||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
#[allow(crown::unrooted_must_root)]
|
||||
pub fn new(window: &Window, files: Vec<DomRoot<File>>) -> DomRoot<FileList> {
|
||||
reflect_dom_object(
|
||||
Box::new(FileList::new_inherited(
|
||||
|
|
|
@ -92,7 +92,7 @@ impl FormDataMethods for FormData {
|
|||
.push((NoTrace(LocalName::from(name.0)), datum));
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
#[allow(crown::unrooted_must_root)]
|
||||
// https://xhr.spec.whatwg.org/#dom-formdata-append
|
||||
fn Append_(&self, name: USVString, blob: &Blob, filename: Option<USVString>) {
|
||||
let datum = FormDatum {
|
||||
|
@ -173,7 +173,7 @@ impl FormDataMethods for FormData {
|
|||
));
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
#[allow(crown::unrooted_must_root)]
|
||||
// https://xhr.spec.whatwg.org/#dom-formdata-set
|
||||
fn Set_(&self, name: USVString, blob: &Blob, filename: Option<USVString>) {
|
||||
let mut data = self.data.borrow_mut();
|
||||
|
|
|
@ -30,7 +30,7 @@ pub struct GainNode {
|
|||
}
|
||||
|
||||
impl GainNode {
|
||||
#[allow(unrooted_must_root)]
|
||||
#[allow(crown::unrooted_must_root)]
|
||||
pub fn new_inherited(
|
||||
window: &Window,
|
||||
context: &BaseAudioContext,
|
||||
|
@ -71,7 +71,7 @@ impl GainNode {
|
|||
Self::new_with_proto(window, None, context, options)
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
#[allow(crown::unrooted_must_root)]
|
||||
fn new_with_proto(
|
||||
window: &Window,
|
||||
proto: Option<HandleObject>,
|
||||
|
|
|
@ -19,7 +19,7 @@ pub struct GamepadButtonList {
|
|||
// TODO: support gamepad discovery
|
||||
#[allow(dead_code)]
|
||||
impl GamepadButtonList {
|
||||
#[allow(unrooted_must_root)]
|
||||
#[allow(crown::unrooted_must_root)]
|
||||
fn new_inherited(list: &[&GamepadButton]) -> GamepadButtonList {
|
||||
GamepadButtonList {
|
||||
reflector_: Reflector::new(),
|
||||
|
|
|
@ -418,7 +418,7 @@ enum BlobResult {
|
|||
|
||||
/// Data representing a message-port managed by this global.
|
||||
#[derive(JSTraceable, MallocSizeOf)]
|
||||
#[unrooted_must_root_lint::must_root]
|
||||
#[crown::unrooted_must_root_lint::must_root]
|
||||
pub struct ManagedMessagePort {
|
||||
/// The DOM port.
|
||||
dom_port: Dom<MessagePort>,
|
||||
|
@ -438,7 +438,7 @@ pub struct ManagedMessagePort {
|
|||
|
||||
/// State representing whether this global is currently managing broadcast channels.
|
||||
#[derive(JSTraceable, MallocSizeOf)]
|
||||
#[unrooted_must_root_lint::must_root]
|
||||
#[crown::unrooted_must_root_lint::must_root]
|
||||
pub enum BroadcastChannelState {
|
||||
/// The broadcast-channel router id for this global, and a queue of managed channels.
|
||||
/// Step 9, "sort destinations"
|
||||
|
@ -455,7 +455,7 @@ pub enum BroadcastChannelState {
|
|||
|
||||
/// State representing whether this global is currently managing messageports.
|
||||
#[derive(JSTraceable, MallocSizeOf)]
|
||||
#[unrooted_must_root_lint::must_root]
|
||||
#[crown::unrooted_must_root_lint::must_root]
|
||||
pub enum MessagePortState {
|
||||
/// The message-port router id for this global, and a map of managed ports.
|
||||
Managed(
|
||||
|
|
|
@ -54,7 +54,7 @@ struct WGPUResponse<T: AsyncWGPUListener + DomObject> {
|
|||
}
|
||||
|
||||
impl<T: AsyncWGPUListener + DomObject> WGPUResponse<T> {
|
||||
#[allow(unrooted_must_root)]
|
||||
#[allow(crown::unrooted_must_root)]
|
||||
fn response(self, response: WebGPUResponseResult) {
|
||||
let promise = self.trusted.root();
|
||||
self.receiver.root().handle_response(response, &promise);
|
||||
|
|
|
@ -126,7 +126,7 @@ impl FromStr for GPUFeatureName {
|
|||
}
|
||||
|
||||
// this error is wrong because if we inline Self::Key and Self::Value all errors are gone
|
||||
#[allow(unrooted_must_root)]
|
||||
#[allow(crown::unrooted_must_root)]
|
||||
impl Setlike for GPUSupportedFeatures {
|
||||
type Key = DOMString;
|
||||
|
||||
|
|
|
@ -61,7 +61,7 @@ impl HTMLAnchorElement {
|
|||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
#[allow(crown::unrooted_must_root)]
|
||||
pub fn new(
|
||||
local_name: LocalName,
|
||||
prefix: Option<Prefix>,
|
||||
|
|
|
@ -251,7 +251,7 @@ impl HTMLAreaElement {
|
|||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
#[allow(crown::unrooted_must_root)]
|
||||
pub fn new(
|
||||
local_name: LocalName,
|
||||
prefix: Option<Prefix>,
|
||||
|
|
|
@ -34,7 +34,7 @@ impl HTMLAudioElement {
|
|||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
#[allow(crown::unrooted_must_root)]
|
||||
pub fn new(
|
||||
local_name: LocalName,
|
||||
prefix: Option<Prefix>,
|
||||
|
|
|
@ -34,7 +34,7 @@ impl HTMLBaseElement {
|
|||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
#[allow(crown::unrooted_must_root)]
|
||||
pub fn new(
|
||||
local_name: LocalName,
|
||||
prefix: Option<Prefix>,
|
||||
|
|
|
@ -43,7 +43,7 @@ impl HTMLBodyElement {
|
|||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
#[allow(crown::unrooted_must_root)]
|
||||
pub fn new(
|
||||
local_name: LocalName,
|
||||
prefix: Option<Prefix>,
|
||||
|
|
|
@ -27,7 +27,7 @@ impl HTMLBRElement {
|
|||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
#[allow(crown::unrooted_must_root)]
|
||||
pub fn new(
|
||||
local_name: LocalName,
|
||||
prefix: Option<Prefix>,
|
||||
|
|
|
@ -68,7 +68,7 @@ impl HTMLButtonElement {
|
|||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
#[allow(crown::unrooted_must_root)]
|
||||
pub fn new(
|
||||
local_name: LocalName,
|
||||
prefix: Option<Prefix>,
|
||||
|
|
|
@ -52,7 +52,7 @@ use crate::script_runtime::JSContext;
|
|||
const DEFAULT_WIDTH: u32 = 300;
|
||||
const DEFAULT_HEIGHT: u32 = 150;
|
||||
|
||||
#[unrooted_must_root_lint::must_root]
|
||||
#[crown::unrooted_must_root_lint::must_root]
|
||||
#[derive(Clone, JSTraceable, MallocSizeOf)]
|
||||
pub enum CanvasContext {
|
||||
Context2d(Dom<CanvasRenderingContext2D>),
|
||||
|
@ -79,7 +79,7 @@ impl HTMLCanvasElement {
|
|||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
#[allow(crown::unrooted_must_root)]
|
||||
pub fn new(
|
||||
local_name: LocalName,
|
||||
prefix: Option<Prefix>,
|
||||
|
|
|
@ -69,7 +69,7 @@ pub struct HTMLCollection {
|
|||
}
|
||||
|
||||
impl HTMLCollection {
|
||||
#[allow(unrooted_must_root)]
|
||||
#[allow(crown::unrooted_must_root)]
|
||||
pub fn new_inherited(
|
||||
root: &Node,
|
||||
filter: Box<dyn CollectionFilter + 'static>,
|
||||
|
@ -99,7 +99,7 @@ impl HTMLCollection {
|
|||
Self::new(window, root, Box::new(NoFilter))
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
#[allow(crown::unrooted_must_root)]
|
||||
pub fn new(
|
||||
window: &Window,
|
||||
root: &Node,
|
||||
|
|
|
@ -29,7 +29,7 @@ impl HTMLDataElement {
|
|||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
#[allow(crown::unrooted_must_root)]
|
||||
pub fn new(
|
||||
local_name: LocalName,
|
||||
prefix: Option<Prefix>,
|
||||
|
|
|
@ -32,7 +32,7 @@ impl HTMLDataListElement {
|
|||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
#[allow(crown::unrooted_must_root)]
|
||||
pub fn new(
|
||||
local_name: LocalName,
|
||||
prefix: Option<Prefix>,
|
||||
|
|
|
@ -39,7 +39,7 @@ impl HTMLDetailsElement {
|
|||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
#[allow(crown::unrooted_must_root)]
|
||||
pub fn new(
|
||||
local_name: LocalName,
|
||||
prefix: Option<Prefix>,
|
||||
|
|
|
@ -35,7 +35,7 @@ impl HTMLDialogElement {
|
|||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
#[allow(crown::unrooted_must_root)]
|
||||
pub fn new(
|
||||
local_name: LocalName,
|
||||
prefix: Option<Prefix>,
|
||||
|
|
|
@ -27,7 +27,7 @@ impl HTMLDirectoryElement {
|
|||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
#[allow(crown::unrooted_must_root)]
|
||||
pub fn new(
|
||||
local_name: LocalName,
|
||||
prefix: Option<Prefix>,
|
||||
|
|
|
@ -29,7 +29,7 @@ impl HTMLDivElement {
|
|||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
#[allow(crown::unrooted_must_root)]
|
||||
pub fn new(
|
||||
local_name: LocalName,
|
||||
prefix: Option<Prefix>,
|
||||
|
|
|
@ -27,7 +27,7 @@ impl HTMLDListElement {
|
|||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
#[allow(crown::unrooted_must_root)]
|
||||
pub fn new(
|
||||
local_name: LocalName,
|
||||
prefix: Option<Prefix>,
|
||||
|
|
|
@ -80,7 +80,7 @@ impl HTMLElement {
|
|||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
#[allow(crown::unrooted_must_root)]
|
||||
pub fn new(
|
||||
local_name: LocalName,
|
||||
prefix: Option<Prefix>,
|
||||
|
|
|
@ -27,7 +27,7 @@ impl HTMLEmbedElement {
|
|||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
#[allow(crown::unrooted_must_root)]
|
||||
pub fn new(
|
||||
local_name: LocalName,
|
||||
prefix: Option<Prefix>,
|
||||
|
|
|
@ -50,7 +50,7 @@ impl HTMLFieldSetElement {
|
|||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
#[allow(crown::unrooted_must_root)]
|
||||
pub fn new(
|
||||
local_name: LocalName,
|
||||
prefix: Option<Prefix>,
|
||||
|
|
|
@ -37,7 +37,7 @@ impl HTMLFontElement {
|
|||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
#[allow(crown::unrooted_must_root)]
|
||||
pub fn new(
|
||||
local_name: LocalName,
|
||||
prefix: Option<Prefix>,
|
||||
|
|
|
@ -123,7 +123,7 @@ impl HTMLFormElement {
|
|||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
#[allow(crown::unrooted_must_root)]
|
||||
pub fn new(
|
||||
local_name: LocalName,
|
||||
prefix: Option<Prefix>,
|
||||
|
|
|
@ -27,7 +27,7 @@ impl HTMLFrameElement {
|
|||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
#[allow(crown::unrooted_must_root)]
|
||||
pub fn new(
|
||||
local_name: LocalName,
|
||||
prefix: Option<Prefix>,
|
||||
|
|
|
@ -30,7 +30,7 @@ impl HTMLFrameSetElement {
|
|||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
#[allow(crown::unrooted_must_root)]
|
||||
pub fn new(
|
||||
local_name: LocalName,
|
||||
prefix: Option<Prefix>,
|
||||
|
|
|
@ -33,7 +33,7 @@ impl HTMLHeadElement {
|
|||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
#[allow(crown::unrooted_must_root)]
|
||||
pub fn new(
|
||||
local_name: LocalName,
|
||||
prefix: Option<Prefix>,
|
||||
|
|
|
@ -40,7 +40,7 @@ impl HTMLHeadingElement {
|
|||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
#[allow(crown::unrooted_must_root)]
|
||||
pub fn new(
|
||||
local_name: LocalName,
|
||||
prefix: Option<Prefix>,
|
||||
|
|
|
@ -34,7 +34,7 @@ impl HTMLHRElement {
|
|||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
#[allow(crown::unrooted_must_root)]
|
||||
pub fn new(
|
||||
local_name: LocalName,
|
||||
prefix: Option<Prefix>,
|
||||
|
|
|
@ -29,7 +29,7 @@ impl HTMLHtmlElement {
|
|||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
#[allow(crown::unrooted_must_root)]
|
||||
pub fn new(
|
||||
localName: LocalName,
|
||||
prefix: Option<Prefix>,
|
||||
|
|
|
@ -446,7 +446,7 @@ impl HTMLIFrameElement {
|
|||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
#[allow(crown::unrooted_must_root)]
|
||||
pub fn new(
|
||||
local_name: LocalName,
|
||||
prefix: Option<Prefix>,
|
||||
|
|
|
@ -141,7 +141,7 @@ enum ImageRequestPhase {
|
|||
Current,
|
||||
}
|
||||
#[derive(JSTraceable, MallocSizeOf)]
|
||||
#[unrooted_must_root_lint::must_root]
|
||||
#[crown::unrooted_must_root_lint::must_root]
|
||||
struct ImageRequest {
|
||||
state: State,
|
||||
#[no_trace]
|
||||
|
@ -1249,7 +1249,7 @@ impl HTMLImageElement {
|
|||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
#[allow(crown::unrooted_must_root)]
|
||||
pub fn new(
|
||||
local_name: LocalName,
|
||||
prefix: Option<Prefix>,
|
||||
|
|
|
@ -327,7 +327,7 @@ impl HTMLInputElement {
|
|||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
#[allow(crown::unrooted_must_root)]
|
||||
pub fn new(
|
||||
local_name: LocalName,
|
||||
prefix: Option<Prefix>,
|
||||
|
@ -2066,7 +2066,7 @@ impl HTMLInputElement {
|
|||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
#[allow(crown::unrooted_must_root)]
|
||||
fn selection(&self) -> TextControlSelection<Self> {
|
||||
TextControlSelection::new(&self, &self.textinput)
|
||||
}
|
||||
|
|
|
@ -42,7 +42,7 @@ impl HTMLLabelElement {
|
|||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
#[allow(crown::unrooted_must_root)]
|
||||
pub fn new(
|
||||
local_name: LocalName,
|
||||
prefix: Option<Prefix>,
|
||||
|
|
|
@ -36,7 +36,7 @@ impl HTMLLegendElement {
|
|||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
#[allow(crown::unrooted_must_root)]
|
||||
pub fn new(
|
||||
local_name: LocalName,
|
||||
prefix: Option<Prefix>,
|
||||
|
|
|
@ -32,7 +32,7 @@ impl HTMLLIElement {
|
|||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
#[allow(crown::unrooted_must_root)]
|
||||
pub fn new(
|
||||
local_name: LocalName,
|
||||
prefix: Option<Prefix>,
|
||||
|
|
|
@ -92,7 +92,7 @@ impl HTMLLinkElement {
|
|||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
#[allow(crown::unrooted_must_root)]
|
||||
pub fn new(
|
||||
local_name: LocalName,
|
||||
prefix: Option<Prefix>,
|
||||
|
@ -115,7 +115,7 @@ impl HTMLLinkElement {
|
|||
|
||||
// FIXME(emilio): These methods are duplicated with
|
||||
// HTMLStyleElement::set_stylesheet.
|
||||
#[allow(unrooted_must_root)]
|
||||
#[allow(crown::unrooted_must_root)]
|
||||
pub fn set_stylesheet(&self, s: Arc<Stylesheet>) {
|
||||
let stylesheets_owner = stylesheets_owner_from_node(self);
|
||||
if let Some(ref s) = *self.stylesheet.borrow() {
|
||||
|
|
|
@ -29,7 +29,7 @@ impl HTMLMapElement {
|
|||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
#[allow(crown::unrooted_must_root)]
|
||||
pub fn new(
|
||||
local_name: LocalName,
|
||||
prefix: Option<Prefix>,
|
||||
|
|
|
@ -282,7 +282,7 @@ impl VideoFrameRenderer for MediaFrameRenderer {
|
|||
}
|
||||
}
|
||||
|
||||
#[unrooted_must_root_lint::must_root]
|
||||
#[crown::unrooted_must_root_lint::must_root]
|
||||
#[derive(JSTraceable, MallocSizeOf)]
|
||||
enum SrcObject {
|
||||
MediaStream(Dom<MediaStream>),
|
||||
|
@ -290,7 +290,7 @@ enum SrcObject {
|
|||
}
|
||||
|
||||
impl From<MediaStreamOrBlob> for SrcObject {
|
||||
#[allow(unrooted_must_root)]
|
||||
#[allow(crown::unrooted_must_root)]
|
||||
fn from(src_object: MediaStreamOrBlob) -> SrcObject {
|
||||
match src_object {
|
||||
MediaStreamOrBlob::Blob(blob) => SrcObject::Blob(Dom::from_ref(&*blob)),
|
||||
|
@ -1207,9 +1207,9 @@ impl HTMLMediaElement {
|
|||
/// does not take a list of promises to fulfill. Callers cannot just pop
|
||||
/// the front list off of `in_flight_play_promises_queue` and later fulfill
|
||||
/// the promises because that would mean putting
|
||||
/// `#[allow(unrooted_must_root)]` on even more functions, potentially
|
||||
/// `#[allow(crown::unrooted_must_root)]` on even more functions, potentially
|
||||
/// hiding actual safety bugs.
|
||||
#[allow(unrooted_must_root)]
|
||||
#[allow(crown::unrooted_must_root)]
|
||||
fn fulfill_in_flight_play_promises<F>(&self, f: F)
|
||||
where
|
||||
F: FnOnce(),
|
||||
|
|
|
@ -28,7 +28,7 @@ impl HTMLMenuElement {
|
|||
}
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
#[allow(crown::unrooted_must_root)]
|
||||
pub fn new(
|
||||
local_name: LocalName,
|
||||
prefix: Option<Prefix>,
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue