script: Feature-gate all crown support. (#35055)

* script: Feature-gate all crown support.

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

* script: Use cfg(crown) instead of a cargo feature.

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

---------

Signed-off-by: Josh Matthews <josh@joshmatthews.net>
This commit is contained in:
Josh Matthews 2025-01-18 16:36:15 -05:00 committed by GitHub
parent 1bd34a5781
commit 875e387004
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
223 changed files with 442 additions and 417 deletions

View file

@ -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)]
#[crown::unrooted_must_root_lint::must_root]
#[cfg_attr(crown, crown::unrooted_must_root_lint::must_root)]
#[repr(C)]
};

View file

@ -13,6 +13,7 @@ name = "script"
path = "lib.rs"
[features]
crown = ['js/crown']
debugmozjs = ['js/debugmozjs']
jitspew = ['js/jitspew']
profilemozjs = ['js/profilemozjs']
@ -23,6 +24,9 @@ refcell_backtrace = ["accountable-refcell"]
webxr = ["webxr-api"]
webgpu = []
[lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(crown)'] }
[build-dependencies]
phf_codegen = "0.11"
phf_shared = "0.11"
@ -72,7 +76,7 @@ image = { workspace = true }
indexmap = { workspace = true }
ipc-channel = { workspace = true }
itertools = { workspace = true }
js = { package = "mozjs", git = "https://github.com/servo/mozjs", features = ["crown"] }
js = { package = "mozjs", git = "https://github.com/servo/mozjs" }
jstraceable_derive = { path = "../jstraceable_derive" }
keyboard-types = { workspace = true }
libc = { workspace = true }

View file

@ -37,7 +37,7 @@ use crate::script_runtime::CanGc;
/// The set of animations for a document.
#[derive(Default, JSTraceable, MallocSizeOf)]
#[crown::unrooted_must_root_lint::must_root]
#[cfg_attr(crown, crown::unrooted_must_root_lint::must_root)]
pub(crate) struct Animations {
/// The map of nodes to their animation states.
#[no_trace]

View file

@ -267,7 +267,7 @@ impl TransmitBodyConnectHandler {
/// The handler of read promises of body streams used in
/// <https://fetch.spec.whatwg.org/#concept-request-transmit-body>.
#[derive(Clone, JSTraceable, MallocSizeOf)]
#[crown::unrooted_must_root_lint::must_root]
#[cfg_attr(crown, crown::unrooted_must_root_lint::must_root)]
struct TransmitBodyPromiseHandler {
#[ignore_malloc_size_of = "Channels are hard"]
#[no_trace]
@ -605,7 +605,7 @@ impl Callback for ConsumeBodyPromiseRejectionHandler {
impl js::gc::Rootable for ConsumeBodyPromiseHandler {}
#[derive(Clone, JSTraceable, MallocSizeOf)]
#[crown::unrooted_must_root_lint::must_root]
#[cfg_attr(crown, crown::unrooted_must_root_lint::must_root)]
/// The promise handler used to consume the body,
/// <https://fetch.spec.whatwg.org/#concept-body-consume-body>
struct ConsumeBodyPromiseHandler {
@ -645,7 +645,7 @@ impl ConsumeBodyPromiseHandler {
impl Callback for ConsumeBodyPromiseHandler {
/// Continuing Step 4 of <https://fetch.spec.whatwg.org/#concept-body-consume-body>
/// Step 3 of <https://fetch.spec.whatwg.org/#concept-read-all-bytes-from-readablestream>.
#[allow(crown::unrooted_must_root)]
#[cfg_attr(crown, allow(crown::unrooted_must_root))]
fn callback(&self, cx: JSContext, v: HandleValue, _realm: InRealm, can_gc: CanGc) {
let stream = self
.stream
@ -711,7 +711,7 @@ impl Callback for ConsumeBodyPromiseHandler {
}
// https://fetch.spec.whatwg.org/#concept-body-consume-body
#[allow(crown::unrooted_must_root)]
#[cfg_attr(crown, allow(crown::unrooted_must_root))]
pub(crate) fn consume_body<T: BodyMixin + DomObject>(
object: &T,
body_type: BodyType,

View file

@ -60,7 +60,7 @@ use crate::dom::textmetrics::TextMetrics;
use crate::script_runtime::CanGc;
use crate::unpremultiplytable::UNPREMULTIPLY_TABLE;
#[crown::unrooted_must_root_lint::must_root]
#[cfg_attr(crown, crown::unrooted_must_root_lint::must_root)]
#[derive(Clone, JSTraceable, MallocSizeOf)]
#[allow(dead_code)]
pub(crate) enum CanvasFillOrStrokeStyle {
@ -79,7 +79,7 @@ impl CanvasFillOrStrokeStyle {
}
}
#[crown::unrooted_must_root_lint::must_root]
#[cfg_attr(crown, crown::unrooted_must_root_lint::must_root)]
#[derive(Clone, JSTraceable, MallocSizeOf)]
pub(crate) struct CanvasContextState {
global_alpha: f64,
@ -138,7 +138,7 @@ impl CanvasContextState {
}
}
#[crown::unrooted_must_root_lint::must_root]
#[cfg_attr(crown, crown::unrooted_must_root_lint::must_root)]
#[derive(JSTraceable, MallocSizeOf)]
pub(crate) struct CanvasState {
#[ignore_malloc_size_of = "Defined in ipc-channel"]
@ -959,7 +959,7 @@ impl CanvasState {
self.send_canvas_2d_msg(Canvas2dMsg::SaveContext);
}
#[allow(crown::unrooted_must_root)]
#[cfg_attr(crown, allow(crown::unrooted_must_root))]
// https://html.spec.whatwg.org/multipage/#dom-context-2d-restore
pub(crate) fn restore(&self) {
let mut saved_states = self.saved_states.borrow_mut();

View file

@ -216,7 +216,7 @@ pub(crate) fn handle_get_attribute_style(
reply.send(Some(msg)).unwrap();
}
#[allow(crown::unrooted_must_root)]
#[cfg_attr(crown, allow(crown::unrooted_must_root))]
pub(crate) fn handle_get_stylesheet_style(
documents: &DocumentCollection,
pipeline: PipelineId,
@ -263,7 +263,7 @@ pub(crate) fn handle_get_stylesheet_style(
reply.send(msg).unwrap();
}
#[allow(crown::unrooted_must_root)]
#[cfg_attr(crown, allow(crown::unrooted_must_root))]
pub(crate) fn handle_get_selectors(
documents: &DocumentCollection,
pipeline: PipelineId,

View file

@ -18,7 +18,7 @@ use crate::dom::window::Window;
/// This is stored as a mapping of [`PipelineId`] to [`Document`], but for updating the
/// rendering, [`Document`]s should be processed in order via [`Self::documents_in_order`].
#[derive(JSTraceable)]
#[crown::unrooted_must_root_lint::must_root]
#[cfg_attr(crown, crown::unrooted_must_root_lint::must_root)]
pub(crate) struct DocumentCollection {
map: HashMapTracedValues<PipelineId, Dom<Document>>,
}
@ -92,7 +92,7 @@ impl DocumentCollection {
}
impl Default for DocumentCollection {
#[allow(crown::unrooted_must_root)]
#[cfg_attr(crown, allow(crown::unrooted_must_root))]
fn default() -> Self {
Self {
map: HashMapTracedValues::new(),
@ -100,7 +100,7 @@ impl Default for DocumentCollection {
}
}
#[allow(crown::unrooted_must_root)]
#[cfg_attr(crown, allow(crown::unrooted_must_root))]
pub(crate) struct DocumentsIter<'a> {
iter: hash_map::Iter<'a, PipelineId, Dom<Document>>,
}

View file

@ -30,7 +30,7 @@ pub(crate) enum LoadType {
/// created via DocumentLoader::fetch_async) are always removed by the time
/// that the owner is destroyed.
#[derive(JSTraceable, MallocSizeOf)]
#[crown::unrooted_must_root_lint::must_root]
#[cfg_attr(crown, crown::unrooted_must_root_lint::must_root)]
pub(crate) struct LoadBlocker {
/// The document whose load event is blocked by this object existing.
doc: Dom<Document>,

View file

@ -94,7 +94,7 @@ impl AbstractRangeMethods<crate::DomTypeHolder> for AbstractRange {
}
#[derive(DenyPublicFields, JSTraceable, MallocSizeOf)]
#[crown::unrooted_must_root_lint::must_root]
#[cfg_attr(crown, crown::unrooted_must_root_lint::must_root)]
pub(crate) struct BoundaryPoint {
node: MutDom<Node>,
offset: Cell<u32>,
@ -123,7 +123,7 @@ impl BoundaryPoint {
}
}
#[allow(crown::unrooted_must_root)]
#[cfg_attr(crown, allow(crown::unrooted_must_root))]
impl PartialOrd for BoundaryPoint {
fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
bp_position(
@ -135,7 +135,7 @@ impl PartialOrd for BoundaryPoint {
}
}
#[allow(crown::unrooted_must_root)]
#[cfg_attr(crown, allow(crown::unrooted_must_root))]
impl PartialEq for BoundaryPoint {
fn eq(&self, other: &Self) -> bool {
self.node.get() == other.node.get() && self.offset.get() == other.offset.get()

View file

@ -37,7 +37,7 @@ pub(crate) struct AnalyserNode {
}
impl AnalyserNode {
#[allow(crown::unrooted_must_root)]
#[cfg_attr(crown, allow(crown::unrooted_must_root))]
pub(crate) fn new_inherited(
_: &Window,
context: &BaseAudioContext,
@ -100,7 +100,7 @@ impl AnalyserNode {
Self::new_with_proto(window, None, context, options, can_gc)
}
#[allow(crown::unrooted_must_root)]
#[cfg_attr(crown, allow(crown::unrooted_must_root))]
pub(crate) fn new_with_proto(
window: &Window,
proto: Option<HandleObject>,

View file

@ -59,7 +59,7 @@ pub(crate) struct AudioBuffer {
}
impl AudioBuffer {
#[allow(crown::unrooted_must_root)]
#[cfg_attr(crown, allow(crown::unrooted_must_root))]
pub(crate) fn new_inherited(
number_of_channels: u32,
length: u32,
@ -98,7 +98,7 @@ impl AudioBuffer {
)
}
#[allow(crown::unrooted_must_root)]
#[cfg_attr(crown, allow(crown::unrooted_must_root))]
fn new_with_proto(
global: &Window,
proto: Option<HandleObject>,

View file

@ -43,7 +43,7 @@ pub(crate) struct AudioBufferSourceNode {
}
impl AudioBufferSourceNode {
#[allow(crown::unrooted_must_root)]
#[cfg_attr(crown, 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, can_gc)
}
#[allow(crown::unrooted_must_root)]
#[cfg_attr(crown, allow(crown::unrooted_must_root))]
fn new_with_proto(
window: &Window,
proto: Option<HandleObject>,

View file

@ -47,7 +47,7 @@ pub(crate) struct AudioContext {
}
impl AudioContext {
#[allow(crown::unrooted_must_root)]
#[cfg_attr(crown, allow(crown::unrooted_must_root))]
// https://webaudio.github.io/web-audio-api/#AudioContext-constructors
fn new_inherited(
options: &AudioContextOptions,
@ -82,7 +82,7 @@ impl AudioContext {
})
}
#[allow(crown::unrooted_must_root)]
#[cfg_attr(crown, allow(crown::unrooted_must_root))]
fn new(
window: &Window,
proto: Option<HandleObject>,

View file

@ -38,7 +38,7 @@ impl AudioDestinationNode {
}
}
#[allow(crown::unrooted_must_root)]
#[cfg_attr(crown, allow(crown::unrooted_must_root))]
pub(crate) fn new(
global: &GlobalScope,
context: &BaseAudioContext,

View file

@ -153,7 +153,7 @@ impl AudioListener {
}
}
#[allow(crown::unrooted_must_root)]
#[cfg_attr(crown, allow(crown::unrooted_must_root))]
pub(crate) fn new(
window: &Window,
context: &BaseAudioContext,

View file

@ -66,7 +66,8 @@ impl AudioParam {
}
}
#[allow(crown::unrooted_must_root, clippy::too_many_arguments)]
#[allow(clippy::too_many_arguments)]
#[cfg_attr(crown, allow(crown::unrooted_must_root))]
pub(crate) fn new(
window: &Window,
context: &BaseAudioContext,

View file

@ -26,7 +26,7 @@ pub(crate) struct AudioScheduledSourceNode {
}
impl AudioScheduledSourceNode {
#[allow(crown::unrooted_must_root)]
#[cfg_attr(crown, allow(crown::unrooted_must_root))]
pub(crate) fn new_inherited(
node_type: AudioNodeInit,
context: &BaseAudioContext,

View file

@ -112,7 +112,7 @@ pub(crate) struct BaseAudioContext {
}
impl BaseAudioContext {
#[allow(crown::unrooted_must_root)]
#[cfg_attr(crown, allow(crown::unrooted_must_root))]
pub(crate) fn new_inherited(
options: BaseAudioContextOptions,
pipeline_id: PipelineId,
@ -196,9 +196,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(crown::unrooted_must_root)]` on even more functions, potentially
/// `#[cfg_attr(crown, allow(crown::unrooted_must_root))]` on even more functions, potentially
/// hiding actual safety bugs.
#[allow(crown::unrooted_must_root)]
#[cfg_attr(crown, allow(crown::unrooted_must_root))]
fn fulfill_in_flight_resume_promises<F>(&self, f: F)
where
F: FnOnce(),

View file

@ -41,7 +41,7 @@ pub(crate) enum ExceptionHandling {
/// A common base class for representing IDL callback function and
/// callback interface types.
#[derive(JSTraceable)]
#[crown::unrooted_must_root_lint::must_root]
#[cfg_attr(crown, crown::unrooted_must_root_lint::must_root)]
pub(crate) struct CallbackObject {
/// The underlying `JSObject`.
callback: Heap<*mut JSObject>,
@ -62,7 +62,7 @@ pub(crate) struct CallbackObject {
}
impl CallbackObject {
#[allow(crown::unrooted_must_root)]
#[cfg_attr(crown, allow(crown::unrooted_must_root))]
// These are used by the bindings and do not need `default()` functions.
#[allow(clippy::new_without_default)]
fn new() -> CallbackObject {
@ -128,14 +128,14 @@ pub(crate) trait CallbackContainer {
/// A common base class for representing IDL callback function types.
#[derive(JSTraceable, PartialEq)]
#[crown::unrooted_must_root_lint::must_root]
#[cfg_attr(crown, crown::unrooted_must_root_lint::must_root)]
pub(crate) struct CallbackFunction {
object: CallbackObject,
}
impl CallbackFunction {
/// Create a new `CallbackFunction` for this object.
#[allow(crown::unrooted_must_root)]
#[cfg_attr(crown, allow(crown::unrooted_must_root))]
// These are used by the bindings and do not need `default()` functions.
#[allow(clippy::new_without_default)]
pub(crate) fn new() -> CallbackFunction {
@ -158,7 +158,7 @@ impl CallbackFunction {
/// A common base class for representing IDL callback interface types.
#[derive(JSTraceable, PartialEq)]
#[crown::unrooted_must_root_lint::must_root]
#[cfg_attr(crown, crown::unrooted_must_root_lint::must_root)]
pub(crate) struct CallbackInterface {
object: CallbackObject,
}
@ -260,7 +260,7 @@ pub(crate) struct CallSetup {
impl CallSetup {
/// Performs the setup needed to make a call.
#[allow(crown::unrooted_must_root)]
#[cfg_attr(crown, allow(crown::unrooted_must_root))]
pub(crate) fn new<T: CallbackContainer>(
callback: &T,
handling: ExceptionHandling,

View file

@ -2725,8 +2725,11 @@ def DomTypes(descriptors, descriptorProvider, dictionaries, callbacks, typedefs,
traits += [f"crate::dom::bindings::codegen::Bindings::{namespace}::{iface_name}Methods<Self>"]
isPromise = firstCap(iface_name) == "Promise"
elements += [
CGGeneric(" #[crown::unrooted_must_root_lint::must_root]\n"),
CGGeneric(" #[crown::unrooted_must_root_lint::allow_unrooted_in_rc]\n" if isPromise else ""),
CGGeneric(" #[cfg_attr(crown, crown::unrooted_must_root_lint::must_root)]\n"),
CGGeneric(
" #[cfg_attr(crown, crown::unrooted_must_root_lint::allow_unrooted_in_rc)]\n"
if isPromise else ""
),
CGGeneric(f" type {firstCap(iface_name)}: {' + '.join(traits)};\n")
]
elements += [CGGeneric("}\n")]
@ -3017,7 +3020,8 @@ class CGWrapMethod(CGAbstractMethod):
Argument('CanGc', '_can_gc')]
retval = f'DomRoot<{descriptor.concreteType}>'
CGAbstractMethod.__init__(self, descriptor, 'Wrap', retval, args,
pub=True, unsafe=True, extra_decorators=['#[allow(crown::unrooted_must_root)]'])
pub=True, unsafe=True,
extra_decorators=['#[cfg_attr(crown, allow(crown::unrooted_must_root))]'])
def definition_body(self):
unforgeable = CopyLegacyUnforgeablePropertiesToInstance(self.descriptor)
@ -3109,7 +3113,8 @@ class CGWrapGlobalMethod(CGAbstractMethod):
Argument(f"Box<{descriptor.concreteType}>", 'object')]
retval = f'DomRoot<{descriptor.concreteType}>'
CGAbstractMethod.__init__(self, descriptor, 'Wrap', retval, args,
pub=True, unsafe=True, extra_decorators=['#[allow(crown::unrooted_must_root)]'])
pub=True, unsafe=True,
extra_decorators=['#[cfg_attr(crown, allow(crown::unrooted_must_root))]'])
self.properties = properties
def definition_body(self):
@ -7037,7 +7042,7 @@ class CGDictionary(CGThing):
default = ""
mustRoot = ""
if self.membersNeedTracing():
mustRoot = "#[crown::unrooted_must_root_lint::must_root]\n"
mustRoot = "#[cfg_attr(crown, crown::unrooted_must_root_lint::must_root)]\n"
# We can't unconditionally derive Default here, because union types can have unique
# default values provided for each usage. Instead, whenever possible we re-use the empty()
@ -7628,8 +7633,8 @@ class CGCallback(CGClass):
constructors=self.getConstructors(),
methods=realMethods,
decorators="#[derive(JSTraceable, PartialEq)]\n"
"#[allow(crown::unrooted_must_root)]\n"
"#[crown::unrooted_must_root_lint::allow_unrooted_interior]")
"#[cfg_attr(crown, allow(crown::unrooted_must_root))]\n"
"#[cfg_attr(crown, crown::unrooted_must_root_lint::allow_unrooted_interior)]")
def getConstructors(self):
return [ClassConstructor(

View file

@ -55,7 +55,7 @@ pub(crate) trait Castable: IDLInterface + DomObject + Sized {
#[allow(missing_docs)]
pub(crate) trait HasParent {
#[crown::unrooted_must_root_lint::must_root]
#[cfg_attr(crown, crown::unrooted_must_root_lint::must_root)]
type Parent;
fn as_parent(&self) -> &Self::Parent;
}

View file

@ -83,7 +83,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(crown::unrooted_must_root)]
#[cfg_attr(crown, allow(crown::unrooted_must_root))]
pub(crate) fn new(promise: Rc<Promise>) -> TrustedPromise {
LIVE_REFERENCES.with(|r| {
let r = r.borrow();
@ -133,7 +133,7 @@ impl TrustedPromise {
}
/// A task which will reject the promise.
#[allow(crown::unrooted_must_root)]
#[cfg_attr(crown, allow(crown::unrooted_must_root))]
pub(crate) fn reject_task(self, error: Error) -> impl TaskOnce {
let this = self;
task!(reject_promise: move || {
@ -143,7 +143,7 @@ impl TrustedPromise {
}
/// A task which will resolve the promise.
#[allow(crown::unrooted_must_root)]
#[cfg_attr(crown, allow(crown::unrooted_must_root))]
pub(crate) fn resolve_task<T>(self, value: T) -> impl TaskOnce
where
T: ToJSValConvertible + Send,
@ -160,7 +160,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.
#[crown::unrooted_must_root_lint::allow_unrooted_interior]
#[cfg_attr(crown, crown::unrooted_must_root_lint::allow_unrooted_interior)]
#[derive(MallocSizeOf)]
pub(crate) struct Trusted<T: DomObject> {
/// A pointer to the Rust DOM object of type T, but void to allow
@ -226,7 +226,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(crown::unrooted_must_root)]
#[cfg_attr(crown, allow(crown::unrooted_must_root))]
pub(crate) struct LiveDOMReferences {
// keyed on pointer to Rust DOM object
reflectable_table: RefCell<HashMap<*const libc::c_void, Weak<TrustedReference>>>,
@ -250,7 +250,7 @@ impl LiveDOMReferences {
});
}
#[allow(crown::unrooted_must_root)]
#[cfg_attr(crown, allow(crown::unrooted_must_root))]
fn addref_promise(&self, promise: Rc<Promise>) {
let mut table = self.promise_table.borrow_mut();
table.entry(&*promise).or_default().push(promise)
@ -301,7 +301,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(crown::unrooted_must_root)]
#[cfg_attr(crown, allow(crown::unrooted_must_root))]
pub(crate) unsafe fn trace_refcounted_objects(tracer: *mut JSTracer) {
trace!("tracing live refcounted references");
LIVE_REFERENCES.with(|r| {

View file

@ -43,16 +43,16 @@ where
}
/// A struct to store a reference to the reflector of a DOM object.
#[allow(crown::unrooted_must_root)]
#[cfg_attr(crown, allow(crown::unrooted_must_root))]
#[derive(MallocSizeOf)]
#[crown::unrooted_must_root_lint::must_root]
#[cfg_attr(crown, crown::unrooted_must_root_lint::must_root)]
// If you're renaming or moving this field, update the path in plugins::reflector as well
pub(crate) struct Reflector {
#[ignore_malloc_size_of = "defined and measured in rust-mozjs"]
object: Heap<*mut JSObject>,
}
#[allow(crown::unrooted_must_root)]
#[cfg_attr(crown, allow(crown::unrooted_must_root))]
impl PartialEq for Reflector {
fn eq(&self, other: &Reflector) -> bool {
self.object.get() == other.object.get()

View file

@ -43,8 +43,8 @@ use crate::dom::bindings::trace::{trace_reflector, JSTraceable};
use crate::dom::node::Node;
/// A rooted value.
#[allow(crown::unrooted_must_root)]
#[crown::unrooted_must_root_lint::allow_unrooted_interior]
#[cfg_attr(crown, allow(crown::unrooted_must_root))]
#[cfg_attr(crown, crown::unrooted_must_root_lint::allow_unrooted_interior)]
pub(crate) struct Root<T: StableTraceObject> {
/// The value to root.
value: T,
@ -59,7 +59,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(crown::unrooted_must_root)]
#[cfg_attr(crown, allow(crown::unrooted_must_root))]
pub(crate) unsafe fn new(value: T) -> Self {
unsafe fn add_to_root_list(object: *const dyn JSTraceable) -> *const RootCollection {
assert_in_script();
@ -99,7 +99,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(crown::unrooted_must_root)]
#[cfg_attr(crown, allow(crown::unrooted_must_root))]
struct ReflectorStackRoot(Reflector);
unsafe impl JSTraceable for ReflectorStackRoot {
unsafe fn trace(&self, tracer: *mut JSTracer) {
@ -118,7 +118,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(crown::unrooted_must_root)]
#[cfg_attr(crown, allow(crown::unrooted_must_root))]
struct MaybeUnreflectedStackRoot<T>(T);
unsafe impl<T> JSTraceable for MaybeUnreflectedStackRoot<T>
where
@ -197,7 +197,7 @@ impl<T: DomObject> DomRoot<T> {
///
/// This should never be used to create on-stack values. Instead these values should always
/// end up as members of other DOM objects.
#[allow(crown::unrooted_must_root)]
#[cfg_attr(crown, allow(crown::unrooted_must_root))]
pub(crate) fn as_traced(&self) -> Dom<T> {
Dom::from_ref(self)
}
@ -335,7 +335,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.
#[crown::unrooted_must_root_lint::must_root]
#[cfg_attr(crown, crown::unrooted_must_root_lint::must_root)]
pub(crate) struct Dom<T> {
ptr: ptr::NonNull<T>,
}
@ -364,7 +364,7 @@ impl<T> Dom<T> {
impl<T: DomObject> Dom<T> {
/// Create a `Dom<T>` from a `&T`
#[allow(crown::unrooted_must_root)]
#[cfg_attr(crown, allow(crown::unrooted_must_root))]
pub(crate) fn from_ref(obj: &T) -> Dom<T> {
assert_in_script();
Dom {
@ -403,7 +403,7 @@ unsafe impl<T: DomObject> JSTraceable for Dom<T> {
}
/// A traced reference to a DOM object that may not be reflected yet.
#[crown::unrooted_must_root_lint::must_root]
#[cfg_attr(crown, crown::unrooted_must_root_lint::must_root)]
pub(crate) struct MaybeUnreflectedDom<T> {
ptr: ptr::NonNull<T>,
}
@ -412,7 +412,7 @@ impl<T> MaybeUnreflectedDom<T>
where
T: DomObject,
{
#[allow(crown::unrooted_must_root)]
#[cfg_attr(crown, allow(crown::unrooted_must_root))]
pub(crate) unsafe fn from_box(value: Box<T>) -> Self {
Self {
ptr: Box::leak(value).into(),
@ -444,7 +444,7 @@ where
/// An unrooted reference to a DOM object for use in layout. `Layout*Helpers`
/// traits must be implemented on this.
#[crown::unrooted_must_root_lint::allow_unrooted_interior]
#[cfg_attr(crown, crown::unrooted_must_root_lint::allow_unrooted_interior)]
pub(crate) struct LayoutDom<'dom, T> {
value: &'dom T,
}
@ -533,7 +533,7 @@ impl<T> Hash for LayoutDom<'_, T> {
impl<T> Clone for Dom<T> {
#[inline]
#[allow(crown::unrooted_must_root)]
#[cfg_attr(crown, allow(crown::unrooted_must_root))]
fn clone(&self) -> Self {
assert_in_script();
Dom { ptr: self.ptr }
@ -566,7 +566,7 @@ impl LayoutDom<'_, Node> {
///
/// This should only be used as a field in other DOM objects; see warning
/// on `Dom<T>`.
#[crown::unrooted_must_root_lint::must_root]
#[cfg_attr(crown, crown::unrooted_must_root_lint::must_root)]
#[derive(JSTraceable)]
pub(crate) struct MutDom<T: DomObject> {
val: UnsafeCell<Dom<T>>,
@ -629,7 +629,7 @@ pub(crate) fn assert_in_layout() {
///
/// This should only be used as a field in other DOM objects; see warning
/// on `Dom<T>`.
#[crown::unrooted_must_root_lint::must_root]
#[cfg_attr(crown, crown::unrooted_must_root_lint::must_root)]
#[derive(JSTraceable)]
pub(crate) struct MutNullableDom<T: DomObject> {
ptr: UnsafeCell<Option<Dom<T>>>,
@ -663,14 +663,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(crown::unrooted_must_root)]
#[cfg_attr(crown, allow(crown::unrooted_must_root))]
pub(crate) 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(crown::unrooted_must_root)]
#[cfg_attr(crown, allow(crown::unrooted_must_root))]
pub(crate) fn get(&self) -> Option<DomRoot<T>> {
assert_in_script();
unsafe { ptr::read(self.ptr.get()).map(|o| DomRoot::from_ref(&*o)) }
@ -705,7 +705,7 @@ impl<T: DomObject> PartialEq<Option<&T>> for MutNullableDom<T> {
}
impl<T: DomObject> Default for MutNullableDom<T> {
#[allow(crown::unrooted_must_root)]
#[cfg_attr(crown, allow(crown::unrooted_must_root))]
fn default() -> MutNullableDom<T> {
assert_in_script();
MutNullableDom {
@ -727,7 +727,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>`.
#[crown::unrooted_must_root_lint::must_root]
#[cfg_attr(crown, crown::unrooted_must_root_lint::must_root)]
pub(crate) struct DomOnceCell<T: DomObject> {
ptr: OnceCell<Dom<T>>,
}
@ -738,7 +738,7 @@ where
{
/// Retrieve a copy of the current inner value. If it is `None`, it is
/// initialized with the result of `cb` first.
#[allow(crown::unrooted_must_root)]
#[cfg_attr(crown, allow(crown::unrooted_must_root))]
pub(crate) fn init_once<F>(&self, cb: F) -> &T
where
F: FnOnce() -> DomRoot<T>,
@ -749,7 +749,7 @@ where
}
impl<T: DomObject> Default for DomOnceCell<T> {
#[allow(crown::unrooted_must_root)]
#[cfg_attr(crown, allow(crown::unrooted_must_root))]
fn default() -> DomOnceCell<T> {
assert_in_script();
DomOnceCell {
@ -765,7 +765,7 @@ impl<T: DomObject> MallocSizeOf for DomOnceCell<T> {
}
}
#[allow(crown::unrooted_must_root)]
#[cfg_attr(crown, 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() {

View file

@ -21,7 +21,7 @@ enum StackEntryKind {
Entry,
}
#[allow(crown::unrooted_must_root)]
#[cfg_attr(crown, allow(crown::unrooted_must_root))]
#[derive(JSTraceable)]
struct StackEntry {
global: Dom<GlobalScope>,

View file

@ -116,7 +116,7 @@ unsafe impl<T> CustomTraceable for Sender<T> {
///
/// SAFETY: Inner type must not impl JSTraceable
#[derive(Clone, Copy, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[crown::trace_in_no_trace_lint::must_not_have_traceable]
#[cfg_attr(crown, crown::trace_in_no_trace_lint::must_not_have_traceable)]
pub(crate) struct NoTrace<T>(pub(crate) T);
impl<T: Display> Display for NoTrace<T> {
@ -146,7 +146,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
#[crown::trace_in_no_trace_lint::must_not_have_traceable(0)]
#[cfg_attr(crown, crown::trace_in_no_trace_lint::must_not_have_traceable(0))]
#[derive(Clone, Debug)]
pub(crate) struct HashMapTracedValues<K, V, S = RandomState>(pub(crate) HashMap<K, V, S>);
@ -289,7 +289,7 @@ pub(crate) fn trace_jsval(tracer: *mut JSTracer, description: &str, val: &Heap<J
}
/// Trace the `JSObject` held by `reflector`.
#[allow(crown::unrooted_must_root)]
#[cfg_attr(crown, allow(crown::unrooted_must_root))]
pub(crate) fn trace_reflector(tracer: *mut JSTracer, description: &str, reflector: &Reflector) {
trace!("tracing reflector {}", description);
trace_object(tracer, description, reflector.rootable())
@ -490,7 +490,7 @@ where
/// 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.
#[crown::unrooted_must_root_lint::allow_unrooted_interior]
#[cfg_attr(crown, crown::unrooted_must_root_lint::allow_unrooted_interior)]
pub(crate) struct RootedTraceableBox<T: JSTraceable + 'static>(js::gc::RootedTraceableBox<T>);
unsafe impl<T: JSTraceable + 'static> JSTraceable for RootedTraceableBox<T> {

View file

@ -33,14 +33,14 @@ use crate::dom::bindings::trace::JSTraceable;
pub(crate) const DOM_WEAK_SLOT: u32 = 1;
/// A weak reference to a JS-managed DOM object.
#[allow(crown::unrooted_must_root)]
#[crown::unrooted_must_root_lint::allow_unrooted_interior]
#[cfg_attr(crown, allow(crown::unrooted_must_root))]
#[cfg_attr(crown, crown::unrooted_must_root_lint::allow_unrooted_interior)]
pub(crate) struct WeakRef<T: WeakReferenceable> {
ptr: ptr::NonNull<WeakBox<T>>,
}
/// The inner box of weak references, public for the finalization in codegen.
#[crown::unrooted_must_root_lint::must_root]
#[cfg_attr(crown, crown::unrooted_must_root_lint::must_root)]
pub(crate) 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.
#[crown::unrooted_must_root_lint::allow_unrooted_interior]
#[cfg_attr(crown, crown::unrooted_must_root_lint::allow_unrooted_interior)]
#[derive(MallocSizeOf)]
pub(crate) 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`.
#[crown::unrooted_must_root_lint::allow_unrooted_interior]
#[cfg_attr(crown, crown::unrooted_must_root_lint::allow_unrooted_interior)]
pub(crate) struct WeakRefEntry<'a, T: WeakReferenceable> {
vec: &'a mut WeakRefVec<T>,
index: &'a mut usize,

View file

@ -41,7 +41,7 @@ pub(crate) struct BiquadFilterNode {
}
impl BiquadFilterNode {
#[allow(crown::unrooted_must_root)]
#[cfg_attr(crown, allow(crown::unrooted_must_root))]
pub(crate) fn new_inherited(
window: &Window,
context: &BaseAudioContext,
@ -123,7 +123,7 @@ impl BiquadFilterNode {
Self::new_with_proto(window, None, context, options, can_gc)
}
#[allow(crown::unrooted_must_root)]
#[cfg_attr(crown, allow(crown::unrooted_must_root))]
fn new_with_proto(
window: &Window,
proto: Option<HandleObject>,

View file

@ -59,7 +59,7 @@ impl Blob {
dom_blob
}
#[allow(crown::unrooted_must_root)]
#[cfg_attr(crown, allow(crown::unrooted_must_root))]
pub(crate) fn new_inherited(blob_impl: &BlobImpl) -> Blob {
Blob {
reflector_: Reflector::new(),

View file

@ -118,7 +118,7 @@ impl<T> BluetoothContext<T>
where
T: AsyncBluetoothListener + DomObject,
{
#[allow(crown::unrooted_must_root)]
#[cfg_attr(crown, allow(crown::unrooted_must_root))]
fn response(&mut self, response: BluetoothResponseResult, can_gc: CanGc) {
let promise = self.promise.take().expect("bt promise is missing").root();
@ -753,7 +753,7 @@ impl PermissionAlgorithm for Bluetooth {
// NOTE: Step 3. is in BluetoothPermissionResult's `handle_response` function.
}
#[allow(crown::unrooted_must_root)]
#[cfg_attr(crown, allow(crown::unrooted_must_root))]
// https://webbluetoothcg.github.io/web-bluetooth/#revoke-bluetooth-access
fn permission_revoke(
_descriptor: &BluetoothPermissionDescriptor,

View file

@ -35,7 +35,7 @@ use crate::dom::promise::Promise;
use crate::realms::InRealm;
use crate::script_runtime::CanGc;
#[crown::unrooted_must_root_lint::must_root]
#[cfg_attr(crown, crown::unrooted_must_root_lint::must_root)]
#[derive(JSTraceable, MallocSizeOf)]
struct AttributeInstanceMap {
service_map: DomRefCell<HashMap<String, Dom<BluetoothRemoteGATTService>>>,
@ -194,7 +194,7 @@ impl BluetoothDevice {
}
// https://webbluetoothcg.github.io/web-bluetooth/#clean-up-the-disconnected-device
#[allow(crown::unrooted_must_root)]
#[cfg_attr(crown, allow(crown::unrooted_must_root))]
pub(crate) fn clean_up_disconnected_device(&self, can_gc: CanGc) {
// Step 1.
self.get_gatt().set_connected(false);
@ -230,7 +230,7 @@ impl BluetoothDevice {
}
// https://webbluetoothcg.github.io/web-bluetooth/#garbage-collect-the-connection
#[allow(crown::unrooted_must_root)]
#[cfg_attr(crown, allow(crown::unrooted_must_root))]
pub(crate) fn garbage_collect_the_connection(&self) -> ErrorResult {
// Step 1: TODO: Check if other systems using this device.

View file

@ -35,7 +35,7 @@ pub(crate) struct BluetoothPermissionResult {
}
impl BluetoothPermissionResult {
#[allow(crown::unrooted_must_root)]
#[cfg_attr(crown, allow(crown::unrooted_must_root))]
fn new_inherited(status: &PermissionStatus) -> BluetoothPermissionResult {
let result = BluetoothPermissionResult {
status: PermissionStatus::new_inherited(status.get_query()),
@ -76,7 +76,7 @@ impl BluetoothPermissionResult {
self.status.State()
}
#[allow(crown::unrooted_must_root)]
#[cfg_attr(crown, allow(crown::unrooted_must_root))]
pub(crate) fn set_devices(&self, devices: Vec<Dom<BluetoothDevice>>) {
*self.devices.borrow_mut() = devices;
}

View file

@ -167,7 +167,7 @@ impl CanvasRenderingContext2DMethods<crate::DomTypeHolder> for CanvasRenderingCo
self.canvas_state.save()
}
#[allow(crown::unrooted_must_root)]
#[cfg_attr(crown, allow(crown::unrooted_must_root))]
// https://html.spec.whatwg.org/multipage/#dom-context-2d-restore
fn Restore(&self) {
self.canvas_state.restore()

View file

@ -27,7 +27,7 @@ pub(crate) struct ChannelMergerNode {
}
impl ChannelMergerNode {
#[allow(crown::unrooted_must_root)]
#[cfg_attr(crown, allow(crown::unrooted_must_root))]
pub(crate) fn new_inherited(
_: &Window,
context: &BaseAudioContext,
@ -66,7 +66,7 @@ impl ChannelMergerNode {
Self::new_with_proto(window, None, context, options, can_gc)
}
#[allow(crown::unrooted_must_root)]
#[cfg_attr(crown, allow(crown::unrooted_must_root))]
fn new_with_proto(
window: &Window,
proto: Option<HandleObject>,

View file

@ -26,7 +26,7 @@ pub(crate) struct ChannelSplitterNode {
}
impl ChannelSplitterNode {
#[allow(crown::unrooted_must_root)]
#[cfg_attr(crown, allow(crown::unrooted_must_root))]
pub(crate) fn new_inherited(
_: &Window,
context: &BaseAudioContext,
@ -68,7 +68,7 @@ impl ChannelSplitterNode {
Self::new_with_proto(window, None, context, options, can_gc)
}
#[allow(crown::unrooted_must_root)]
#[cfg_attr(crown, allow(crown::unrooted_must_root))]
fn new_with_proto(
window: &Window,
proto: Option<HandleObject>,

View file

@ -31,7 +31,7 @@ const MAX_LOG_DEPTH: usize = 10;
const MAX_LOG_CHILDREN: usize = 15;
/// <https://developer.mozilla.org/en-US/docs/Web/API/Console>
#[crown::unrooted_must_root_lint::must_root]
#[cfg_attr(crown, crown::unrooted_must_root_lint::must_root)]
pub(crate) struct Console;
impl Console {

View file

@ -30,7 +30,7 @@ pub(crate) struct ConstantSourceNode {
}
impl ConstantSourceNode {
#[allow(crown::unrooted_must_root)]
#[cfg_attr(crown, allow(crown::unrooted_must_root))]
fn new_inherited(
window: &Window,
context: &BaseAudioContext,
@ -72,7 +72,7 @@ impl ConstantSourceNode {
Self::new_with_proto(window, None, context, options, can_gc)
}
#[allow(crown::unrooted_must_root)]
#[cfg_attr(crown, allow(crown::unrooted_must_root))]
fn new_with_proto(
window: &Window,
proto: Option<HandleObject>,

View file

@ -34,7 +34,7 @@ impl CSSFontFaceRule {
}
}
#[allow(crown::unrooted_must_root)]
#[cfg_attr(crown, allow(crown::unrooted_must_root))]
pub(crate) fn new(
window: &Window,
parent_stylesheet: &CSSStyleSheet,

View file

@ -37,7 +37,7 @@ impl CSSImportRule {
}
}
#[allow(crown::unrooted_must_root)]
#[cfg_attr(crown, allow(crown::unrooted_must_root))]
pub(crate) fn new(
window: &Window,
parent_stylesheet: &CSSStyleSheet,

View file

@ -40,7 +40,7 @@ impl CSSKeyframeRule {
}
}
#[allow(crown::unrooted_must_root)]
#[cfg_attr(crown, allow(crown::unrooted_must_root))]
pub(crate) fn new(
window: &Window,
parent_stylesheet: &CSSStyleSheet,

View file

@ -44,7 +44,7 @@ impl CSSKeyframesRule {
}
}
#[allow(crown::unrooted_must_root)]
#[cfg_attr(crown, allow(crown::unrooted_must_root))]
pub(crate) fn new(
window: &Window,
parent_stylesheet: &CSSStyleSheet,

View file

@ -40,7 +40,7 @@ impl CSSLayerBlockRule {
}
}
#[allow(crown::unrooted_must_root)]
#[cfg_attr(crown, allow(crown::unrooted_must_root))]
pub(crate) fn new(
window: &Window,
parent_stylesheet: &CSSStyleSheet,

View file

@ -38,7 +38,7 @@ impl CSSLayerStatementRule {
}
}
#[allow(crown::unrooted_must_root)]
#[cfg_attr(crown, allow(crown::unrooted_must_root))]
pub(crate) fn new(
window: &Window,
parent_stylesheet: &CSSStyleSheet,

View file

@ -38,7 +38,7 @@ impl CSSMediaRule {
}
}
#[allow(crown::unrooted_must_root)]
#[cfg_attr(crown, allow(crown::unrooted_must_root))]
pub(crate) fn new(
window: &Window,
parent_stylesheet: &CSSStyleSheet,

View file

@ -35,7 +35,7 @@ impl CSSNamespaceRule {
}
}
#[allow(crown::unrooted_must_root)]
#[cfg_attr(crown, allow(crown::unrooted_must_root))]
pub(crate) fn new(
window: &Window,
parent_stylesheet: &CSSStyleSheet,

View file

@ -38,7 +38,7 @@ pub(crate) struct CSSRule {
}
impl CSSRule {
#[allow(crown::unrooted_must_root)]
#[cfg_attr(crown, allow(crown::unrooted_must_root))]
pub(crate) fn new_inherited(parent_stylesheet: &CSSStyleSheet) -> CSSRule {
CSSRule {
reflector_: Reflector::new(),

View file

@ -53,7 +53,7 @@ pub(crate) enum RulesSource {
}
impl CSSRuleList {
#[allow(crown::unrooted_must_root)]
#[cfg_attr(crown, allow(crown::unrooted_must_root))]
pub(crate) fn new_inherited(
parent_stylesheet: &CSSStyleSheet,
rules: RulesSource,
@ -82,7 +82,7 @@ impl CSSRuleList {
}
}
#[allow(crown::unrooted_must_root)]
#[cfg_attr(crown, allow(crown::unrooted_must_root))]
pub(crate) fn new(
window: &Window,
parent_stylesheet: &CSSStyleSheet,

View file

@ -43,7 +43,7 @@ pub(crate) struct CSSStyleDeclaration {
}
#[derive(JSTraceable, MallocSizeOf)]
#[crown::unrooted_must_root_lint::must_root]
#[cfg_attr(crown, crown::unrooted_must_root_lint::must_root)]
pub(crate) enum CSSStyleOwner {
Element(Dom<Element>),
CSSRule(
@ -215,7 +215,7 @@ fn remove_property(decls: &mut PropertyDeclarationBlock, id: &PropertyId) -> boo
}
impl CSSStyleDeclaration {
#[allow(crown::unrooted_must_root)]
#[cfg_attr(crown, allow(crown::unrooted_must_root))]
pub(crate) fn new_inherited(
owner: CSSStyleOwner,
pseudo: Option<PseudoElement>,
@ -229,7 +229,7 @@ impl CSSStyleDeclaration {
}
}
#[allow(crown::unrooted_must_root)]
#[cfg_attr(crown, allow(crown::unrooted_must_root))]
pub(crate) fn new(
global: &Window,
owner: CSSStyleOwner,

View file

@ -45,7 +45,7 @@ impl CSSStyleRule {
}
}
#[allow(crown::unrooted_must_root)]
#[cfg_attr(crown, allow(crown::unrooted_must_root))]
pub(crate) fn new(
window: &Window,
parent_stylesheet: &CSSStyleSheet,

View file

@ -50,7 +50,7 @@ impl CSSStyleSheet {
}
}
#[allow(crown::unrooted_must_root)]
#[cfg_attr(crown, allow(crown::unrooted_must_root))]
pub(crate) fn new(
window: &Window,
owner: &Element,

View file

@ -37,7 +37,7 @@ impl CSSSupportsRule {
}
}
#[allow(crown::unrooted_must_root)]
#[cfg_attr(crown, allow(crown::unrooted_must_root))]
pub(crate) fn new(
window: &Window,
parent_stylesheet: &CSSStyleSheet,

View file

@ -334,7 +334,8 @@ fn get_callback(
}
impl CustomElementRegistryMethods<crate::DomTypeHolder> for CustomElementRegistry {
#[allow(unsafe_code, crown::unrooted_must_root)]
#[allow(unsafe_code)]
#[cfg_attr(crown, allow(crown::unrooted_must_root))]
/// <https://html.spec.whatwg.org/multipage/#dom-customelementregistry-define>
fn Define(
&self,
@ -973,7 +974,7 @@ pub(crate) fn try_upgrade_element(element: &Element) {
}
#[derive(JSTraceable, MallocSizeOf)]
#[crown::unrooted_must_root_lint::must_root]
#[cfg_attr(crown, crown::unrooted_must_root_lint::must_root)]
pub(crate) enum CustomElementReaction {
Upgrade(#[ignore_malloc_size_of = "Rc"] Rc<CustomElementDefinition>),
Callback(
@ -1028,7 +1029,7 @@ enum BackupElementQueueFlag {
/// <https://html.spec.whatwg.org/multipage/#custom-element-reactions-stack>
#[derive(JSTraceable, MallocSizeOf)]
#[crown::unrooted_must_root_lint::must_root]
#[cfg_attr(crown, crown::unrooted_must_root_lint::must_root)]
pub(crate) struct CustomElementReactionStack {
stack: DomRefCell<Vec<ElementQueue>>,
backup_queue: ElementQueue,
@ -1233,7 +1234,7 @@ impl CustomElementReactionStack {
/// <https://html.spec.whatwg.org/multipage/#element-queue>
#[derive(JSTraceable, MallocSizeOf)]
#[crown::unrooted_must_root_lint::must_root]
#[cfg_attr(crown, crown::unrooted_must_root_lint::must_root)]
struct ElementQueue {
queue: DomRefCell<VecDeque<Dom<Element>>>,
}

View file

@ -24,7 +24,7 @@ use crate::microtask::Microtask;
use crate::script_runtime::CanGc;
#[derive(JSTraceable, MallocSizeOf)]
#[allow(crown::unrooted_must_root)]
#[cfg_attr(crown, allow(crown::unrooted_must_root))]
pub(crate) struct DefaultTeeReadRequestMicrotask {
#[ignore_malloc_size_of = "mozjs"]
chunk: Box<Heap<JSVal>>,
@ -60,7 +60,7 @@ pub(crate) struct DefaultTeeReadRequest {
}
impl DefaultTeeReadRequest {
#[allow(clippy::too_many_arguments)]
#[allow(crown::unrooted_must_root)]
#[cfg_attr(crown, allow(crown::unrooted_must_root))]
pub(crate) fn new(
stream: &ReadableStream,
branch_1: &ReadableStream,

View file

@ -59,7 +59,7 @@ pub(crate) struct DefaultTeeUnderlyingSource {
impl DefaultTeeUnderlyingSource {
#[allow(clippy::too_many_arguments)]
#[allow(clippy::redundant_allocation)]
#[allow(crown::unrooted_must_root)]
#[cfg_attr(crown, allow(crown::unrooted_must_root))]
pub(crate) fn new(
reader: &ReadableStreamDefaultReader,
stream: &ReadableStream,
@ -106,7 +106,7 @@ impl DefaultTeeUnderlyingSource {
/// <https://streams.spec.whatwg.org/#abstract-opdef-readablestreamdefaulttee>
/// Let pullAlgorithm be the following steps:
#[allow(crown::unrooted_must_root)]
#[cfg_attr(crown, allow(crown::unrooted_must_root))]
pub(crate) fn pull_algorithm(&self, can_gc: CanGc) -> Option<Result<Rc<Promise>, Error>> {
// If reading is true,
if self.reading.get() {

View file

@ -29,7 +29,7 @@ pub(crate) struct DissimilarOriginLocation {
}
impl DissimilarOriginLocation {
#[allow(crown::unrooted_must_root)]
#[cfg_attr(crown, allow(crown::unrooted_must_root))]
fn new_inherited(window: &DissimilarOriginWindow) -> DissimilarOriginLocation {
DissimilarOriginLocation {
reflector: Reflector::new(),

View file

@ -240,7 +240,7 @@ pub(crate) enum IsHTMLDocument {
}
#[derive(JSTraceable, MallocSizeOf)]
#[crown::unrooted_must_root_lint::must_root]
#[cfg_attr(crown, crown::unrooted_must_root_lint::must_root)]
enum FocusTransaction {
/// No focus operation is in effect.
NotInTransaction,
@ -3152,7 +3152,7 @@ impl Document {
self.webgpu_contexts.clone()
}
#[allow(crown::unrooted_must_root)]
#[cfg_attr(crown, allow(crown::unrooted_must_root))]
#[cfg(feature = "webgpu")]
pub(crate) fn update_rendering_of_webgpu_canvases(&self) {
self.webgpu_contexts
@ -4178,7 +4178,7 @@ impl Document {
/// Add a stylesheet owned by `owner` to the list of document sheets, in the
/// correct tree position.
#[allow(crown::unrooted_must_root)] // Owner needs to be rooted already necessarily.
#[cfg_attr(crown, allow(crown::unrooted_must_root))] // Owner needs to be rooted already necessarily.
pub(crate) fn add_stylesheet(&self, owner: &Element, sheet: Arc<Stylesheet>) {
let stylesheets = &mut *self.stylesheets.borrow_mut();
let insertion_point = stylesheets
@ -4215,7 +4215,7 @@ impl Document {
}
/// Remove a stylesheet owned by `owner` from the list of document sheets.
#[allow(crown::unrooted_must_root)] // Owner needs to be rooted already necessarily.
#[cfg_attr(crown, allow(crown::unrooted_must_root))] // Owner needs to be rooted already necessarily.
pub(crate) fn remove_stylesheet(&self, owner: &Element, stylesheet: &Arc<Stylesheet>) {
let cloned_stylesheet = stylesheet.clone();
self.window
@ -4241,7 +4241,7 @@ impl Document {
})
}
#[allow(crown::unrooted_must_root)]
#[cfg_attr(crown, allow(crown::unrooted_must_root))]
pub(crate) fn drain_pending_restyles(&self) -> Vec<(TrustedNodeAddress, PendingRestyle)> {
self.pending_restyles
.borrow_mut()
@ -5878,7 +5878,7 @@ impl AnimationFrameCallback {
}
#[derive(Default, JSTraceable, MallocSizeOf)]
#[crown::unrooted_must_root_lint::must_root]
#[cfg_attr(crown, crown::unrooted_must_root_lint::must_root)]
struct PendingInOrderScriptVec {
scripts: DomRefCell<VecDeque<PendingScript>>,
}
@ -5916,7 +5916,7 @@ impl PendingInOrderScriptVec {
}
#[derive(JSTraceable, MallocSizeOf)]
#[crown::unrooted_must_root_lint::must_root]
#[cfg_attr(crown, crown::unrooted_must_root_lint::must_root)]
struct PendingScript {
element: Dom<HTMLScriptElement>,
// TODO(sagudev): could this be all no_trace?

View file

@ -29,7 +29,7 @@ use crate::script_runtime::CanGc;
use crate::stylesheet_set::StylesheetSetRef;
#[derive(Clone, JSTraceable, MallocSizeOf)]
#[crown::unrooted_must_root_lint::must_root]
#[cfg_attr(crown, crown::unrooted_must_root_lint::must_root)]
pub(crate) struct StyleSheetInDocument {
#[ignore_malloc_size_of = "Arc"]
#[no_trace]
@ -82,7 +82,7 @@ impl ::style::stylesheets::StylesheetInDocument for StyleSheetInDocument {
}
// https://w3c.github.io/webcomponents/spec/shadow/#extensions-to-the-documentorshadowroot-mixin
#[crown::unrooted_must_root_lint::must_root]
#[cfg_attr(crown, crown::unrooted_must_root_lint::must_root)]
#[derive(JSTraceable, MallocSizeOf)]
pub(crate) struct DocumentOrShadowRoot {
window: Dom<Window>,
@ -218,7 +218,7 @@ impl DocumentOrShadowRoot {
}
/// Remove a stylesheet owned by `owner` from the list of document sheets.
#[allow(crown::unrooted_must_root)] // Owner needs to be rooted already necessarily.
#[cfg_attr(crown, allow(crown::unrooted_must_root))] // Owner needs to be rooted already necessarily.
pub(crate) fn remove_stylesheet(
owner: &Element,
s: &Arc<Stylesheet>,
@ -239,7 +239,7 @@ impl DocumentOrShadowRoot {
/// Add a stylesheet owned by `owner` to the list of document sheets, in the
/// correct tree position.
#[allow(crown::unrooted_must_root)] // Owner needs to be rooted already necessarily.
#[cfg_attr(crown, allow(crown::unrooted_must_root))] // Owner needs to be rooted already necessarily.
pub(crate) fn add_stylesheet(
owner: &Element,
mut stylesheets: StylesheetSetRef<StyleSheetInDocument>,

View file

@ -38,7 +38,7 @@ impl DocumentType {
system_id: system_id.unwrap_or_default(),
}
}
#[allow(crown::unrooted_must_root)]
#[cfg_attr(crown, allow(crown::unrooted_must_root))]
pub(crate) fn new(
name: DOMString,
public_id: Option<DOMString>,

View file

@ -38,7 +38,7 @@ impl DOMMatrix {
Self::new_with_proto(global, None, is2D, matrix, can_gc)
}
#[allow(crown::unrooted_must_root)]
#[cfg_attr(crown, allow(crown::unrooted_must_root))]
fn new_with_proto(
global: &GlobalScope,
proto: Option<HandleObject>,

View file

@ -55,7 +55,7 @@ impl DOMMatrixReadOnly {
Self::new_with_proto(global, None, is2D, matrix, can_gc)
}
#[allow(crown::unrooted_must_root)]
#[cfg_attr(crown, allow(crown::unrooted_must_root))]
fn new_with_proto(
global: &GlobalScope,
proto: Option<HandleObject>,

View file

@ -74,7 +74,7 @@ impl DOMRectMethods<crate::DomTypeHolder> for DOMRect {
}
// https://drafts.fxtf.org/geometry/#dom-domrect-fromrect
#[allow(crown::unrooted_must_root)]
#[cfg_attr(crown, allow(crown::unrooted_must_root))]
fn FromRect(global: &GlobalScope, other: &DOMRectInit) -> DomRoot<DOMRect> {
let rect = create_a_domrectreadonly_from_the_dictionary(other);

View file

@ -89,7 +89,7 @@ impl DOMRectReadOnlyMethods<crate::DomTypeHolder> for DOMRectReadOnly {
}
// https://drafts.fxtf.org/geometry/#dom-domrectreadonly-fromrect
#[allow(crown::unrooted_must_root)]
#[cfg_attr(crown, allow(crown::unrooted_must_root))]
fn FromRect(global: &GlobalScope, other: &DOMRectInit) -> DomRoot<DOMRectReadOnly> {
let dom_rect = create_a_domrectreadonly_from_the_dictionary(other);
@ -158,7 +158,7 @@ impl DOMRectReadOnlyMethods<crate::DomTypeHolder> for DOMRectReadOnly {
}
/// <https://drafts.fxtf.org/geometry/#ref-for-create-a-domrectreadonly-from-the-dictionary>
#[allow(crown::unrooted_must_root)]
#[cfg_attr(crown, allow(crown::unrooted_must_root))]
pub(super) fn create_a_domrectreadonly_from_the_dictionary(other: &DOMRectInit) -> DOMRectReadOnly {
// NOTE: We trivially combine all three steps into one

View file

@ -31,7 +31,7 @@ pub(crate) struct DynamicModuleOwner {
}
impl DynamicModuleOwner {
#[allow(crown::unrooted_must_root)]
#[cfg_attr(crown, allow(crown::unrooted_must_root))]
fn new_inherited(promise: Rc<Promise>, id: DynamicModuleId) -> Self {
DynamicModuleOwner {
reflector_: Reflector::new(),
@ -40,7 +40,7 @@ impl DynamicModuleOwner {
}
}
#[allow(crown::unrooted_must_root)]
#[cfg_attr(crown, allow(crown::unrooted_must_root))]
pub(crate) fn new(
global: &GlobalScope,
promise: Rc<Promise>,

View file

@ -4462,7 +4462,7 @@ impl ElementPerformFullscreenEnter {
}
impl TaskOnce for ElementPerformFullscreenEnter {
#[allow(crown::unrooted_must_root)]
#[cfg_attr(crown, allow(crown::unrooted_must_root))]
fn run_once(self) {
let element = self.element.root();
let promise = self.promise.root();
@ -4507,7 +4507,7 @@ impl ElementPerformFullscreenExit {
}
impl TaskOnce for ElementPerformFullscreenExit {
#[allow(crown::unrooted_must_root)]
#[cfg_attr(crown, allow(crown::unrooted_must_root))]
fn run_once(self) {
let element = self.element.root();
let document = element.owner_document();

View file

@ -95,7 +95,7 @@ pub(crate) struct Event {
/// An element on an [event path](https://dom.spec.whatwg.org/#event-path)
#[derive(JSTraceable, MallocSizeOf)]
#[crown::unrooted_must_root_lint::must_root]
#[cfg_attr(crown, crown::unrooted_must_root_lint::must_root)]
pub(crate) struct EventPathSegment {
/// <https://dom.spec.whatwg.org/#event-path-invocation-target>
invocation_target: Dom<EventTarget>,
@ -211,7 +211,7 @@ impl Event {
}
/// <https://dom.spec.whatwg.org/#concept-event-path-append>
#[allow(crown::unrooted_must_root)]
#[cfg_attr(crown, allow(crown::unrooted_must_root))]
pub(crate) fn append_to_path(
&self,
invocation_target: &EventTarget,

View file

@ -31,7 +31,7 @@ pub(crate) struct File {
}
impl File {
#[allow(crown::unrooted_must_root)]
#[cfg_attr(crown, allow(crown::unrooted_must_root))]
fn new_inherited(blob_impl: &BlobImpl, name: DOMString, modified: Option<SystemTime>) -> File {
File {
blob: Blob::new_inherited(blob_impl),
@ -51,7 +51,7 @@ impl File {
Self::new_with_proto(global, None, blob_impl, name, modified, can_gc)
}
#[allow(crown::unrooted_must_root)]
#[cfg_attr(crown, allow(crown::unrooted_must_root))]
fn new_with_proto(
global: &GlobalScope,
proto: Option<HandleObject>,

View file

@ -21,7 +21,7 @@ pub(crate) struct FileList {
}
impl FileList {
#[allow(crown::unrooted_must_root)]
#[cfg_attr(crown, allow(crown::unrooted_must_root))]
fn new_inherited(files: Vec<Dom<File>>) -> FileList {
FileList {
reflector_: Reflector::new(),
@ -29,7 +29,7 @@ impl FileList {
}
}
#[allow(crown::unrooted_must_root)]
#[cfg_attr(crown, allow(crown::unrooted_must_root))]
pub(crate) fn new(window: &Window, files: Vec<DomRoot<File>>) -> DomRoot<FileList> {
reflect_dom_object(
Box::new(FileList::new_inherited(

View file

@ -104,7 +104,7 @@ impl FormDataMethods<crate::DomTypeHolder> for FormData {
.push((NoTrace(LocalName::from(name.0)), datum));
}
#[allow(crown::unrooted_must_root)]
#[cfg_attr(crown, 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 {
@ -188,7 +188,7 @@ impl FormDataMethods<crate::DomTypeHolder> for FormData {
));
}
#[allow(crown::unrooted_must_root)]
#[cfg_attr(crown, allow(crown::unrooted_must_root))]
// https://xhr.spec.whatwg.org/#dom-formdata-set
fn Set_(&self, name: USVString, blob: &Blob, filename: Option<USVString>) {
let file = self.create_an_entry(blob, filename, CanGc::note());

View file

@ -31,7 +31,7 @@ pub(crate) struct GainNode {
}
impl GainNode {
#[allow(crown::unrooted_must_root)]
#[cfg_attr(crown, allow(crown::unrooted_must_root))]
pub(crate) fn new_inherited(
window: &Window,
context: &BaseAudioContext,
@ -74,7 +74,7 @@ impl GainNode {
Self::new_with_proto(window, None, context, options, can_gc)
}
#[allow(crown::unrooted_must_root)]
#[cfg_attr(crown, allow(crown::unrooted_must_root))]
fn new_with_proto(
window: &Window,
proto: Option<HandleObject>,

View file

@ -19,7 +19,7 @@ pub(crate) struct GamepadButtonList {
}
impl GamepadButtonList {
#[allow(crown::unrooted_must_root)]
#[cfg_attr(crown, allow(crown::unrooted_must_root))]
fn new_inherited(list: &[&GamepadButton]) -> GamepadButtonList {
GamepadButtonList {
reflector_: Reflector::new(),

View file

@ -447,7 +447,7 @@ enum BlobResult {
/// Data representing a message-port managed by this global.
#[derive(JSTraceable, MallocSizeOf)]
#[crown::unrooted_must_root_lint::must_root]
#[cfg_attr(crown, crown::unrooted_must_root_lint::must_root)]
pub(crate) struct ManagedMessagePort {
/// The DOM port.
dom_port: Dom<MessagePort>,
@ -467,7 +467,7 @@ pub(crate) struct ManagedMessagePort {
/// State representing whether this global is currently managing broadcast channels.
#[derive(JSTraceable, MallocSizeOf)]
#[crown::unrooted_must_root_lint::must_root]
#[cfg_attr(crown, crown::unrooted_must_root_lint::must_root)]
pub(crate) enum BroadcastChannelState {
/// The broadcast-channel router id for this global, and a queue of managed channels.
/// Step 9, "sort destinations"
@ -484,7 +484,7 @@ pub(crate) enum BroadcastChannelState {
/// State representing whether this global is currently managing messageports.
#[derive(JSTraceable, MallocSizeOf)]
#[crown::unrooted_must_root_lint::must_root]
#[cfg_attr(crown, crown::unrooted_must_root_lint::must_root)]
pub(crate) enum MessagePortState {
/// The message-port router id for this global, and a map of managed ports.
Managed(

View file

@ -61,7 +61,7 @@ impl HTMLAnchorElement {
}
}
#[allow(crown::unrooted_must_root)]
#[cfg_attr(crown, allow(crown::unrooted_must_root))]
pub(crate) fn new(
local_name: LocalName,
prefix: Option<Prefix>,

View file

@ -258,7 +258,7 @@ impl HTMLAreaElement {
}
}
#[allow(crown::unrooted_must_root)]
#[cfg_attr(crown, allow(crown::unrooted_must_root))]
pub(crate) fn new(
local_name: LocalName,
prefix: Option<Prefix>,

View file

@ -36,7 +36,7 @@ impl HTMLAudioElement {
}
}
#[allow(crown::unrooted_must_root)]
#[cfg_attr(crown, allow(crown::unrooted_must_root))]
pub(crate) fn new(
local_name: LocalName,
prefix: Option<Prefix>,

View file

@ -35,7 +35,7 @@ impl HTMLBaseElement {
}
}
#[allow(crown::unrooted_must_root)]
#[cfg_attr(crown, allow(crown::unrooted_must_root))]
pub(crate) fn new(
local_name: LocalName,
prefix: Option<Prefix>,

View file

@ -40,7 +40,7 @@ impl HTMLBodyElement {
}
}
#[allow(crown::unrooted_must_root)]
#[cfg_attr(crown, allow(crown::unrooted_must_root))]
pub(crate) fn new(
local_name: LocalName,
prefix: Option<Prefix>,

View file

@ -28,7 +28,7 @@ impl HTMLBRElement {
}
}
#[allow(crown::unrooted_must_root)]
#[cfg_attr(crown, allow(crown::unrooted_must_root))]
pub(crate) fn new(
local_name: LocalName,
prefix: Option<Prefix>,

View file

@ -69,7 +69,7 @@ impl HTMLButtonElement {
}
}
#[allow(crown::unrooted_must_root)]
#[cfg_attr(crown, allow(crown::unrooted_must_root))]
pub(crate) fn new(
local_name: LocalName,
prefix: Option<Prefix>,

View file

@ -105,7 +105,7 @@ impl EncodedImageType {
}
}
#[crown::unrooted_must_root_lint::must_root]
#[cfg_attr(crown, crown::unrooted_must_root_lint::must_root)]
#[derive(Clone, JSTraceable, MallocSizeOf)]
pub(crate) enum CanvasContext {
Placeholder(Dom<OffscreenCanvasRenderingContext2D>),
@ -140,7 +140,7 @@ impl HTMLCanvasElement {
}
}
#[allow(crown::unrooted_must_root)]
#[cfg_attr(crown, allow(crown::unrooted_must_root))]
pub(crate) fn new(
local_name: LocalName,
prefix: Option<Prefix>,

View file

@ -69,7 +69,7 @@ pub(crate) struct HTMLCollection {
}
impl HTMLCollection {
#[allow(crown::unrooted_must_root)]
#[cfg_attr(crown, allow(crown::unrooted_must_root))]
pub(crate) fn new_inherited(
root: &Node,
filter: Box<dyn CollectionFilter + 'static>,
@ -99,7 +99,7 @@ impl HTMLCollection {
Self::new(window, root, Box::new(NoFilter))
}
#[allow(crown::unrooted_must_root)]
#[cfg_attr(crown, allow(crown::unrooted_must_root))]
pub(crate) fn new(
window: &Window,
root: &Node,

View file

@ -30,7 +30,7 @@ impl HTMLDataElement {
}
}
#[allow(crown::unrooted_must_root)]
#[cfg_attr(crown, allow(crown::unrooted_must_root))]
pub(crate) fn new(
local_name: LocalName,
prefix: Option<Prefix>,

View file

@ -32,7 +32,7 @@ impl HTMLDataListElement {
}
}
#[allow(crown::unrooted_must_root)]
#[cfg_attr(crown, allow(crown::unrooted_must_root))]
pub(crate) fn new(
local_name: LocalName,
prefix: Option<Prefix>,

View file

@ -39,7 +39,7 @@ impl HTMLDetailsElement {
}
}
#[allow(crown::unrooted_must_root)]
#[cfg_attr(crown, allow(crown::unrooted_must_root))]
pub(crate) fn new(
local_name: LocalName,
prefix: Option<Prefix>,

View file

@ -36,7 +36,7 @@ impl HTMLDialogElement {
}
}
#[allow(crown::unrooted_must_root)]
#[cfg_attr(crown, allow(crown::unrooted_must_root))]
pub(crate) fn new(
local_name: LocalName,
prefix: Option<Prefix>,

View file

@ -28,7 +28,7 @@ impl HTMLDirectoryElement {
}
}
#[allow(crown::unrooted_must_root)]
#[cfg_attr(crown, allow(crown::unrooted_must_root))]
pub(crate) fn new(
local_name: LocalName,
prefix: Option<Prefix>,

View file

@ -30,7 +30,7 @@ impl HTMLDivElement {
}
}
#[allow(crown::unrooted_must_root)]
#[cfg_attr(crown, allow(crown::unrooted_must_root))]
pub(crate) fn new(
local_name: LocalName,
prefix: Option<Prefix>,

View file

@ -28,7 +28,7 @@ impl HTMLDListElement {
}
}
#[allow(crown::unrooted_must_root)]
#[cfg_attr(crown, allow(crown::unrooted_must_root))]
pub(crate) fn new(
local_name: LocalName,
prefix: Option<Prefix>,

View file

@ -87,7 +87,7 @@ impl HTMLElement {
}
}
#[allow(crown::unrooted_must_root)]
#[cfg_attr(crown, allow(crown::unrooted_must_root))]
pub(crate) fn new(
local_name: LocalName,
prefix: Option<Prefix>,

View file

@ -28,7 +28,7 @@ impl HTMLEmbedElement {
}
}
#[allow(crown::unrooted_must_root)]
#[cfg_attr(crown, allow(crown::unrooted_must_root))]
pub(crate) fn new(
local_name: LocalName,
prefix: Option<Prefix>,

View file

@ -53,7 +53,7 @@ impl HTMLFieldSetElement {
}
}
#[allow(crown::unrooted_must_root)]
#[cfg_attr(crown, allow(crown::unrooted_must_root))]
pub(crate) fn new(
local_name: LocalName,
prefix: Option<Prefix>,

View file

@ -42,7 +42,7 @@ impl HTMLFontElement {
}
}
#[allow(crown::unrooted_must_root)]
#[cfg_attr(crown, allow(crown::unrooted_must_root))]
pub(crate) fn new(
local_name: LocalName,
prefix: Option<Prefix>,

View file

@ -131,7 +131,7 @@ impl HTMLFormElement {
}
}
#[allow(crown::unrooted_must_root)]
#[cfg_attr(crown, allow(crown::unrooted_must_root))]
pub(crate) fn new(
local_name: LocalName,
prefix: Option<Prefix>,

View file

@ -28,7 +28,7 @@ impl HTMLFrameElement {
}
}
#[allow(crown::unrooted_must_root)]
#[cfg_attr(crown, allow(crown::unrooted_must_root))]
pub(crate) fn new(
local_name: LocalName,
prefix: Option<Prefix>,

View file

@ -31,7 +31,7 @@ impl HTMLFrameSetElement {
}
}
#[allow(crown::unrooted_must_root)]
#[cfg_attr(crown, allow(crown::unrooted_must_root))]
pub(crate) fn new(
local_name: LocalName,
prefix: Option<Prefix>,

View file

@ -35,7 +35,7 @@ impl HTMLHeadElement {
}
}
#[allow(crown::unrooted_must_root)]
#[cfg_attr(crown, allow(crown::unrooted_must_root))]
pub(crate) fn new(
local_name: LocalName,
prefix: Option<Prefix>,

View file

@ -41,7 +41,7 @@ impl HTMLHeadingElement {
}
}
#[allow(crown::unrooted_must_root)]
#[cfg_attr(crown, allow(crown::unrooted_must_root))]
pub(crate) fn new(
local_name: LocalName,
prefix: Option<Prefix>,

View file

@ -35,7 +35,7 @@ impl HTMLHRElement {
}
}
#[allow(crown::unrooted_must_root)]
#[cfg_attr(crown, allow(crown::unrooted_must_root))]
pub(crate) fn new(
local_name: LocalName,
prefix: Option<Prefix>,

View file

@ -30,7 +30,7 @@ impl HTMLHtmlElement {
}
}
#[allow(crown::unrooted_must_root)]
#[cfg_attr(crown, allow(crown::unrooted_must_root))]
pub(crate) fn new(
localName: LocalName,
prefix: Option<Prefix>,

View file

@ -468,7 +468,7 @@ impl HTMLIFrameElement {
}
}
#[allow(crown::unrooted_must_root)]
#[cfg_attr(crown, allow(crown::unrooted_must_root))]
pub(crate) fn new(
local_name: LocalName,
prefix: Option<Prefix>,

View file

@ -144,7 +144,7 @@ enum ImageRequestPhase {
Current,
}
#[derive(JSTraceable, MallocSizeOf)]
#[crown::unrooted_must_root_lint::must_root]
#[cfg_attr(crown, crown::unrooted_must_root_lint::must_root)]
struct ImageRequest {
state: State,
#[no_trace]
@ -1324,7 +1324,7 @@ impl HTMLImageElement {
}
}
#[allow(crown::unrooted_must_root)]
#[cfg_attr(crown, allow(crown::unrooted_must_root))]
pub(crate) fn new(
local_name: LocalName,
prefix: Option<Prefix>,

Some files were not shown because too many files have changed in this diff Show more