Add trait DomObjectWrap to provide WRAP function

This commit is contained in:
YUAN LYU 2020-03-20 22:14:18 -04:00
parent ca29399bab
commit 3ea6d87bcc
No known key found for this signature in database
GPG key ID: 63A93E6A451DD166
353 changed files with 327 additions and 1236 deletions

View file

@ -6,7 +6,7 @@ use crate::dom::audionode::AudioNode;
use crate::dom::baseaudiocontext::BaseAudioContext;
use crate::dom::bindings::cell::DomRefCell;
use crate::dom::bindings::codegen::Bindings::AnalyserNodeBinding::{
self, AnalyserNodeMethods, AnalyserOptions,
AnalyserNodeMethods, AnalyserOptions,
};
use crate::dom::bindings::codegen::Bindings::AudioNodeBinding::{
ChannelCountMode, ChannelInterpretation,
@ -96,7 +96,7 @@ impl AnalyserNode {
options: &AnalyserOptions,
) -> Fallible<DomRoot<AnalyserNode>> {
let (node, recv) = AnalyserNode::new_inherited(window, context, options)?;
let object = reflect_dom_object(Box::new(node), window, AnalyserNodeBinding::Wrap);
let object = reflect_dom_object(Box::new(node), window);
let (source, canceller) = window
.task_manager()
.dom_manipulation_task_source_with_canceller();

View file

@ -3,7 +3,7 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
use crate::dom::bindings::cell::{DomRefCell, Ref};
use crate::dom::bindings::codegen::Bindings::AttrBinding::{self, AttrMethods};
use crate::dom::bindings::codegen::Bindings::AttrBinding::AttrMethods;
use crate::dom::bindings::inheritance::Castable;
use crate::dom::bindings::root::{DomRoot, LayoutDom, MutNullableDom};
use crate::dom::bindings::str::DOMString;
@ -70,7 +70,6 @@ impl Attr {
document, local_name, value, name, namespace, prefix, owner,
)),
document,
AttrBinding::Wrap,
)
}

View file

@ -5,7 +5,7 @@
use crate::dom::audionode::MAX_CHANNEL_COUNT;
use crate::dom::bindings::cell::{DomRefCell, Ref};
use crate::dom::bindings::codegen::Bindings::AudioBufferBinding::{
self, AudioBufferMethods, AudioBufferOptions,
AudioBufferMethods, AudioBufferOptions,
};
use crate::dom::bindings::error::{Error, Fallible};
use crate::dom::bindings::num::Finite;
@ -84,7 +84,7 @@ impl AudioBuffer {
initial_data: Option<&[Vec<f32>]>,
) -> DomRoot<AudioBuffer> {
let buffer = AudioBuffer::new_inherited(number_of_channels, length, sample_rate);
let buffer = reflect_dom_object(Box::new(buffer), global, AudioBufferBinding::Wrap);
let buffer = reflect_dom_object(Box::new(buffer), global);
buffer.set_initial_data(initial_data);
buffer
}

View file

@ -6,7 +6,6 @@ use crate::dom::audiobuffer::AudioBuffer;
use crate::dom::audioparam::AudioParam;
use crate::dom::audioscheduledsourcenode::AudioScheduledSourceNode;
use crate::dom::baseaudiocontext::BaseAudioContext;
use crate::dom::bindings::codegen::Bindings::AudioBufferSourceNodeBinding;
use crate::dom::bindings::codegen::Bindings::AudioBufferSourceNodeBinding::AudioBufferSourceNodeMethods;
use crate::dom::bindings::codegen::Bindings::AudioBufferSourceNodeBinding::AudioBufferSourceOptions;
use crate::dom::bindings::codegen::Bindings::AudioParamBinding::AutomationRate;
@ -100,11 +99,7 @@ impl AudioBufferSourceNode {
options: &AudioBufferSourceOptions,
) -> Fallible<DomRoot<AudioBufferSourceNode>> {
let node = AudioBufferSourceNode::new_inherited(window, context, options)?;
Ok(reflect_dom_object(
Box::new(node),
window,
AudioBufferSourceNodeBinding::Wrap,
))
Ok(reflect_dom_object(Box::new(node), window))
}
#[allow(non_snake_case)]

View file

@ -3,7 +3,6 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
use crate::dom::baseaudiocontext::{BaseAudioContext, BaseAudioContextOptions};
use crate::dom::bindings::codegen::Bindings::AudioContextBinding;
use crate::dom::bindings::codegen::Bindings::AudioContextBinding::{
AudioContextLatencyCategory, AudioContextMethods,
};
@ -77,7 +76,7 @@ impl AudioContext {
pub fn new(window: &Window, options: &AudioContextOptions) -> DomRoot<AudioContext> {
let pipeline_id = window.pipeline_id();
let context = AudioContext::new_inherited(options, pipeline_id);
let context = reflect_dom_object(Box::new(context), window, AudioContextBinding::Wrap);
let context = reflect_dom_object(Box::new(context), window);
context.resume();
context
}

View file

@ -4,9 +4,7 @@
use crate::dom::audionode::{AudioNode, MAX_CHANNEL_COUNT};
use crate::dom::baseaudiocontext::BaseAudioContext;
use crate::dom::bindings::codegen::Bindings::AudioDestinationNodeBinding::{
self, AudioDestinationNodeMethods,
};
use crate::dom::bindings::codegen::Bindings::AudioDestinationNodeBinding::AudioDestinationNodeMethods;
use crate::dom::bindings::codegen::Bindings::AudioNodeBinding::AudioNodeOptions;
use crate::dom::bindings::codegen::Bindings::AudioNodeBinding::{
ChannelCountMode, ChannelInterpretation,
@ -46,7 +44,7 @@ impl AudioDestinationNode {
options: &AudioNodeOptions,
) -> DomRoot<AudioDestinationNode> {
let node = AudioDestinationNode::new_inherited(context, options);
reflect_dom_object(Box::new(node), global, AudioDestinationNodeBinding::Wrap)
reflect_dom_object(Box::new(node), global)
}
}

View file

@ -4,7 +4,7 @@
use crate::dom::audioparam::AudioParam;
use crate::dom::baseaudiocontext::BaseAudioContext;
use crate::dom::bindings::codegen::Bindings::AudioListenerBinding::{self, AudioListenerMethods};
use crate::dom::bindings::codegen::Bindings::AudioListenerBinding::AudioListenerMethods;
use crate::dom::bindings::codegen::Bindings::AudioParamBinding::AutomationRate;
use crate::dom::bindings::error::Fallible;
use crate::dom::bindings::num::Finite;
@ -143,7 +143,7 @@ impl AudioListener {
#[allow(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, AudioListenerBinding::Wrap)
reflect_dom_object(Box::new(node), window)
}
}

View file

@ -3,7 +3,6 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
use crate::dom::baseaudiocontext::BaseAudioContext;
use crate::dom::bindings::codegen::Bindings::AudioParamBinding;
use crate::dom::bindings::codegen::Bindings::AudioParamBinding::{
AudioParamMethods, AutomationRate,
};
@ -75,7 +74,7 @@ impl AudioParam {
min_value,
max_value,
);
reflect_dom_object(Box::new(audio_param), window, AudioParamBinding::Wrap)
reflect_dom_object(Box::new(audio_param), window)
}
fn message_node(&self, message: AudioNodeMessage) {

View file

@ -4,7 +4,7 @@
use crate::dom::audiotracklist::AudioTrackList;
use crate::dom::bindings::cell::DomRefCell;
use crate::dom::bindings::codegen::Bindings::AudioTrackBinding::{self, AudioTrackMethods};
use crate::dom::bindings::codegen::Bindings::AudioTrackBinding::AudioTrackMethods;
use crate::dom::bindings::reflector::{reflect_dom_object, Reflector};
use crate::dom::bindings::root::{Dom, DomRoot};
use crate::dom::bindings::str::DOMString;
@ -55,7 +55,6 @@ impl AudioTrack {
id, kind, label, language, track_list,
)),
window,
AudioTrackBinding::Wrap,
)
}

View file

@ -4,7 +4,7 @@
use crate::dom::audiotrack::AudioTrack;
use crate::dom::bindings::cell::DomRefCell;
use crate::dom::bindings::codegen::Bindings::AudioTrackListBinding::{self, AudioTrackListMethods};
use crate::dom::bindings::codegen::Bindings::AudioTrackListBinding::AudioTrackListMethods;
use crate::dom::bindings::inheritance::Castable;
use crate::dom::bindings::refcounted::Trusted;
use crate::dom::bindings::reflector::{reflect_dom_object, DomObject};
@ -43,7 +43,6 @@ impl AudioTrackList {
reflect_dom_object(
Box::new(AudioTrackList::new_inherited(tracks, media_element)),
window,
AudioTrackListBinding::Wrap,
)
}

View file

@ -5,7 +5,6 @@
#![allow(dead_code)]
use crate::dom::bindings::cell::DomRefCell;
use crate::dom::bindings::codegen::Bindings::BeforeUnloadEventBinding;
use crate::dom::bindings::codegen::Bindings::BeforeUnloadEventBinding::BeforeUnloadEventMethods;
use crate::dom::bindings::codegen::Bindings::EventBinding::EventMethods;
use crate::dom::bindings::inheritance::Castable;
@ -33,11 +32,7 @@ impl BeforeUnloadEvent {
}
pub fn new_uninitialized(window: &Window) -> DomRoot<BeforeUnloadEvent> {
reflect_dom_object(
Box::new(BeforeUnloadEvent::new_inherited()),
window,
BeforeUnloadEventBinding::Wrap,
)
reflect_dom_object(Box::new(BeforeUnloadEvent::new_inherited()), window)
}
pub fn new(

View file

@ -2858,6 +2858,50 @@ impl PartialEq for %(name)s {
""" % {'check': check, 'name': name}
class CGDomObjectWrap(CGThing):
"""
Class for codegen of an implementation of the DomObjectWrap trait.
"""
def __init__(self, descriptor):
CGThing.__init__(self)
self.descriptor = descriptor
def define(self):
name = self.descriptor.concreteType
name = "dom::%s::%s" % (name.lower(), name)
return """\
impl DomObjectWrap for %s {
const WRAP: unsafe fn(
SafeJSContext,
&GlobalScope,
Box<Self>,
) -> Root<Dom<Self>> = Wrap;
}
""" % (name)
class CGDomObjectIteratorWrap(CGThing):
"""
Class for codegen of an implementation of the DomObjectIteratorWrap trait.
"""
def __init__(self, descriptor):
CGThing.__init__(self)
self.descriptor = descriptor
def define(self):
assert self.descriptor.interface.isIteratorInterface()
name = self.descriptor.interface.iterableInterface.identifier.name
return """\
impl DomObjectIteratorWrap for %s {
const ITER_WRAP: unsafe fn(
SafeJSContext,
&GlobalScope,
Box<IterableIterator<Self>>,
) -> Root<Dom<IterableIterator<Self>>> = Wrap;
}
""" % (name)
class CGAbstractExternMethod(CGAbstractMethod):
"""
Abstract base class for codegen of implementation-only (no
@ -6067,6 +6111,8 @@ def generate_imports(config, cgthings, descriptors, callbacks=None, dictionaries
'crate::dom::bindings::namespace::create_namespace_object',
'crate::dom::bindings::reflector::MutDomObject',
'crate::dom::bindings::reflector::DomObject',
'crate::dom::bindings::reflector::DomObjectWrap',
'crate::dom::bindings::reflector::DomObjectIteratorWrap',
'crate::dom::bindings::root::Dom',
'crate::dom::bindings::root::DomRoot',
'crate::dom::bindings::root::DomSlice',
@ -6286,6 +6332,10 @@ class CGDescriptor(CGThing):
cgThings.append(CGWrapGlobalMethod(descriptor, properties))
else:
cgThings.append(CGWrapMethod(descriptor))
if descriptor.interface.isIteratorInterface():
cgThings.append(CGDomObjectIteratorWrap(descriptor))
else:
cgThings.append(CGDomObjectWrap(descriptor))
reexports.append('Wrap')
haveUnscopables = False
@ -7445,9 +7495,7 @@ class CGIterableMethodGenerator(CGGeneric):
return
CGGeneric.__init__(self, fill(
"""
let result = ${iterClass}::new(&*this,
IteratorType::${itrMethod},
super::${ifaceName}IteratorBinding::Wrap);
let result = ${iterClass}::new(&*this, IteratorType::${itrMethod});
""",
iterClass=iteratorNativeType(descriptor, True),
ifaceName=descriptor.interface.identifier.name,

View file

@ -9,8 +9,10 @@
use crate::dom::bindings::codegen::Bindings::IterableIteratorBinding::IterableKeyAndValueResult;
use crate::dom::bindings::codegen::Bindings::IterableIteratorBinding::IterableKeyOrValueResult;
use crate::dom::bindings::error::Fallible;
use crate::dom::bindings::reflector::{reflect_dom_object, DomObject, Reflector};
use crate::dom::bindings::root::{Dom, DomRoot};
use crate::dom::bindings::reflector::{
reflect_dom_object, DomObjectIteratorWrap, DomObjectWrap, Reflector,
};
use crate::dom::bindings::root::{Dom, DomRoot, Root};
use crate::dom::bindings::trace::{JSTraceable, RootedTraceableBox};
use crate::dom::globalscope::GlobalScope;
use crate::script_runtime::JSContext;
@ -51,27 +53,23 @@ pub trait Iterable {
/// An iterator over the iterable entries of a given DOM interface.
//FIXME: #12811 prevents dom_struct with type parameters
#[dom_struct]
pub struct IterableIterator<T: DomObject + JSTraceable + Iterable> {
pub struct IterableIterator<T: DomObjectIteratorWrap + JSTraceable + Iterable> {
reflector: Reflector,
iterable: Dom<T>,
type_: IteratorType,
index: Cell<u32>,
}
impl<T: DomObject + JSTraceable + Iterable> IterableIterator<T> {
impl<T: DomObjectIteratorWrap + JSTraceable + Iterable> IterableIterator<T> {
/// Create a new iterator instance for the provided iterable DOM interface.
pub fn new(
iterable: &T,
type_: IteratorType,
wrap: unsafe fn(JSContext, &GlobalScope, Box<IterableIterator<T>>) -> DomRoot<Self>,
) -> DomRoot<Self> {
pub fn new(iterable: &T, type_: IteratorType) -> DomRoot<Self> {
let iterator = Box::new(IterableIterator {
reflector: Reflector::new(),
type_: type_,
iterable: Dom::from_ref(iterable),
index: Cell::new(0),
});
reflect_dom_object(iterator, &*iterable.global(), wrap)
reflect_dom_object(iterator, &*iterable.global())
}
/// Return the next value from the iterable object.
@ -119,6 +117,10 @@ impl<T: DomObject + JSTraceable + Iterable> IterableIterator<T> {
}
}
impl<T: DomObjectIteratorWrap + JSTraceable + Iterable> DomObjectWrap for IterableIterator<T> {
const WRAP: unsafe fn(JSContext, &GlobalScope, Box<Self>) -> Root<Dom<Self>> = T::ITER_WRAP;
}
fn dict_return(
cx: JSContext,
mut result: MutableHandleObject,

View file

@ -5,7 +5,8 @@
//! The `Reflector` struct.
use crate::dom::bindings::conversions::DerivedFrom;
use crate::dom::bindings::root::DomRoot;
use crate::dom::bindings::iterable::{Iterable, IterableIterator};
use crate::dom::bindings::root::{Dom, DomRoot, Root};
use crate::dom::bindings::trace::JSTraceable;
use crate::dom::globalscope::GlobalScope;
use crate::script_runtime::JSContext;
@ -15,17 +16,13 @@ use std::default::Default;
/// Create the reflector for a new DOM object and yield ownership to the
/// reflector.
pub fn reflect_dom_object<T, U>(
obj: Box<T>,
global: &U,
wrap_fn: unsafe fn(JSContext, &GlobalScope, Box<T>) -> DomRoot<T>,
) -> DomRoot<T>
pub fn reflect_dom_object<T, U>(obj: Box<T>, global: &U) -> DomRoot<T>
where
T: DomObject,
T: DomObject + DomObjectWrap,
U: DerivedFrom<GlobalScope>,
{
let global_scope = global.upcast();
unsafe { wrap_fn(global_scope.get_cx(), global_scope, obj) }
unsafe { T::WRAP(global_scope.get_cx(), global_scope, obj) }
}
/// A struct to store a reference to the reflector of a DOM object.
@ -106,3 +103,20 @@ impl MutDomObject for Reflector {
self.set_jsobject(obj)
}
}
/// A trait to provide a function pointer to wrap function for DOM objects.
pub trait DomObjectWrap: Sized + DomObject {
/// Function pointer to the general wrap function type
const WRAP: unsafe fn(JSContext, &GlobalScope, Box<Self>) -> Root<Dom<Self>>;
}
/// A trait to provide a function pointer to wrap function for
/// DOM iterator interfaces.
pub trait DomObjectIteratorWrap: DomObjectWrap + JSTraceable + Iterable {
/// Function pointer to the wrap function for IterableIterator<T>
const ITER_WRAP: unsafe fn(
JSContext,
&GlobalScope,
Box<IterableIterator<Self>>,
) -> Root<Dom<IterableIterator<Self>>>;
}

View file

@ -9,11 +9,9 @@ use crate::dom::bindings::codegen::Bindings::AudioNodeBinding::{
ChannelCountMode, ChannelInterpretation,
};
use crate::dom::bindings::codegen::Bindings::AudioParamBinding::AutomationRate;
use crate::dom::bindings::codegen::Bindings::BiquadFilterNodeBinding::BiquadFilterNodeMethods;
use crate::dom::bindings::codegen::Bindings::BiquadFilterNodeBinding::BiquadFilterOptions;
use crate::dom::bindings::codegen::Bindings::BiquadFilterNodeBinding::BiquadFilterType;
use crate::dom::bindings::codegen::Bindings::BiquadFilterNodeBinding::{
self, BiquadFilterNodeMethods,
};
use crate::dom::bindings::error::Fallible;
use crate::dom::bindings::reflector::reflect_dom_object;
use crate::dom::bindings::root::{Dom, DomRoot};
@ -113,11 +111,7 @@ impl BiquadFilterNode {
options: &BiquadFilterOptions,
) -> Fallible<DomRoot<BiquadFilterNode>> {
let node = BiquadFilterNode::new_inherited(window, context, options)?;
Ok(reflect_dom_object(
Box::new(node),
window,
BiquadFilterNodeBinding::Wrap,
))
Ok(reflect_dom_object(Box::new(node), window))
}
#[allow(non_snake_case)]

View file

@ -40,7 +40,6 @@ impl Blob {
blob_id: blob_impl.blob_id(),
}),
global,
BlobBinding::Wrap,
);
global.track_blob(&dom_blob, blob_impl);
dom_blob

View file

@ -9,7 +9,7 @@ use bluetooth_traits::scanfilter::{BluetoothScanfilter, BluetoothScanfilterSeque
use bluetooth_traits::scanfilter::{RequestDeviceoptions, ServiceUUIDSequence};
use crate::realms::{AlreadyInRealm, InRealm};
use crate::dom::bindings::cell::{DomRefCell, Ref};
use crate::dom::bindings::codegen::Bindings::BluetoothBinding::{self, BluetoothDataFilterInit};
use crate::dom::bindings::codegen::Bindings::BluetoothBinding::BluetoothDataFilterInit;
use crate::dom::bindings::codegen::Bindings::BluetoothBinding::{BluetoothMethods, RequestDeviceOptions};
use crate::dom::bindings::codegen::Bindings::BluetoothBinding::BluetoothLEScanFilterInit;
use crate::dom::bindings::codegen::Bindings::BluetoothPermissionResultBinding::BluetoothPermissionDescriptor;
@ -144,11 +144,7 @@ impl Bluetooth {
}
pub fn new(global: &GlobalScope) -> DomRoot<Bluetooth> {
reflect_dom_object(
Box::new(Bluetooth::new_inherited()),
global,
BluetoothBinding::Wrap,
)
reflect_dom_object(Box::new(Bluetooth::new_inherited()), global)
}
fn get_bluetooth_thread(&self) -> IpcSender<BluetoothRequest> {

View file

@ -2,10 +2,8 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
use crate::dom::bindings::codegen::Bindings::BluetoothAdvertisingEventBinding::BluetoothAdvertisingEventInit;
use crate::dom::bindings::codegen::Bindings::BluetoothAdvertisingEventBinding::BluetoothAdvertisingEventMethods;
use crate::dom::bindings::codegen::Bindings::BluetoothAdvertisingEventBinding::{
self, BluetoothAdvertisingEventInit,
};
use crate::dom::bindings::codegen::Bindings::EventBinding::EventBinding::EventMethods;
use crate::dom::bindings::error::Fallible;
use crate::dom::bindings::inheritance::Castable;
@ -65,7 +63,6 @@ impl BluetoothAdvertisingEvent {
device, name, appearance, txPower, rssi,
)),
global,
BluetoothAdvertisingEventBinding::Wrap,
);
{
let event = ev.upcast::<Event>();

View file

@ -2,7 +2,6 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
use crate::dom::bindings::codegen::Bindings::BluetoothCharacteristicPropertiesBinding;
use crate::dom::bindings::codegen::Bindings::BluetoothCharacteristicPropertiesBinding::BluetoothCharacteristicPropertiesMethods;
use crate::dom::bindings::reflector::{reflect_dom_object, Reflector};
use crate::dom::bindings::root::DomRoot;
@ -76,7 +75,6 @@ impl BluetoothCharacteristicProperties {
writableAuxiliaries,
)),
global,
BluetoothCharacteristicPropertiesBinding::Wrap,
)
}
}

View file

@ -3,7 +3,6 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
use crate::dom::bindings::cell::DomRefCell;
use crate::dom::bindings::codegen::Bindings::BluetoothDeviceBinding;
use crate::dom::bindings::codegen::Bindings::BluetoothDeviceBinding::BluetoothDeviceMethods;
use crate::dom::bindings::codegen::Bindings::BluetoothRemoteGATTServerBinding::BluetoothRemoteGATTServerMethods;
use crate::dom::bindings::error::Error;
@ -77,7 +76,6 @@ impl BluetoothDevice {
reflect_dom_object(
Box::new(BluetoothDevice::new_inherited(id, name, context)),
global,
BluetoothDeviceBinding::Wrap,
)
}

View file

@ -3,9 +3,7 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
use crate::dom::bindings::cell::DomRefCell;
use crate::dom::bindings::codegen::Bindings::BluetoothPermissionResultBinding::{
self, BluetoothPermissionResultMethods,
};
use crate::dom::bindings::codegen::Bindings::BluetoothPermissionResultBinding::BluetoothPermissionResultMethods;
use crate::dom::bindings::codegen::Bindings::NavigatorBinding::NavigatorBinding::NavigatorMethods;
use crate::dom::bindings::codegen::Bindings::PermissionStatusBinding::PermissionStatusBinding::PermissionStatusMethods;
use crate::dom::bindings::codegen::Bindings::PermissionStatusBinding::{
@ -51,7 +49,6 @@ impl BluetoothPermissionResult {
reflect_dom_object(
Box::new(BluetoothPermissionResult::new_inherited(status)),
global,
BluetoothPermissionResultBinding::Wrap,
)
}

View file

@ -4,7 +4,6 @@
use crate::dom::bindings::cell::DomRefCell;
use crate::dom::bindings::codegen::Bindings::BluetoothCharacteristicPropertiesBinding::BluetoothCharacteristicPropertiesMethods;
use crate::dom::bindings::codegen::Bindings::BluetoothRemoteGATTCharacteristicBinding;
use crate::dom::bindings::codegen::Bindings::BluetoothRemoteGATTCharacteristicBinding::BluetoothRemoteGATTCharacteristicMethods;
use crate::dom::bindings::codegen::Bindings::BluetoothRemoteGATTServerBinding::BluetoothRemoteGATTServerMethods;
use crate::dom::bindings::codegen::Bindings::BluetoothRemoteGATTServiceBinding::BluetoothRemoteGATTServiceMethods;
@ -77,7 +76,6 @@ impl BluetoothRemoteGATTCharacteristic {
instance_id,
)),
global,
BluetoothRemoteGATTCharacteristicBinding::Wrap,
)
}

View file

@ -4,7 +4,6 @@
use crate::dom::bindings::cell::DomRefCell;
use crate::dom::bindings::codegen::Bindings::BluetoothRemoteGATTCharacteristicBinding::BluetoothRemoteGATTCharacteristicMethods;
use crate::dom::bindings::codegen::Bindings::BluetoothRemoteGATTDescriptorBinding;
use crate::dom::bindings::codegen::Bindings::BluetoothRemoteGATTDescriptorBinding::BluetoothRemoteGATTDescriptorMethods;
use crate::dom::bindings::codegen::Bindings::BluetoothRemoteGATTServerBinding::BluetoothRemoteGATTServerMethods;
use crate::dom::bindings::codegen::Bindings::BluetoothRemoteGATTServiceBinding::BluetoothRemoteGATTServiceMethods;
@ -64,7 +63,6 @@ impl BluetoothRemoteGATTDescriptor {
instance_id,
)),
global,
BluetoothRemoteGATTDescriptorBinding::Wrap,
)
}

View file

@ -3,7 +3,6 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
use crate::dom::bindings::codegen::Bindings::BluetoothDeviceBinding::BluetoothDeviceMethods;
use crate::dom::bindings::codegen::Bindings::BluetoothRemoteGATTServerBinding;
use crate::dom::bindings::codegen::Bindings::BluetoothRemoteGATTServerBinding::BluetoothRemoteGATTServerMethods;
use crate::dom::bindings::error::Error;
use crate::dom::bindings::error::ErrorResult;
@ -45,7 +44,6 @@ impl BluetoothRemoteGATTServer {
reflect_dom_object(
Box::new(BluetoothRemoteGATTServer::new_inherited(device)),
global,
BluetoothRemoteGATTServerBinding::Wrap,
)
}

View file

@ -3,7 +3,6 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
use crate::dom::bindings::codegen::Bindings::BluetoothRemoteGATTServerBinding::BluetoothRemoteGATTServerMethods;
use crate::dom::bindings::codegen::Bindings::BluetoothRemoteGATTServiceBinding;
use crate::dom::bindings::codegen::Bindings::BluetoothRemoteGATTServiceBinding::BluetoothRemoteGATTServiceMethods;
use crate::dom::bindings::error::Error;
use crate::dom::bindings::reflector::reflect_dom_object;
@ -58,7 +57,6 @@ impl BluetoothRemoteGATTService {
device, uuid, isPrimary, instanceID,
)),
global,
BluetoothRemoteGATTServiceBinding::Wrap,
)
}

View file

@ -2,9 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use crate::dom::bindings::codegen::Bindings::BroadcastChannelBinding::{
BroadcastChannelMethods, Wrap,
};
use crate::dom::bindings::codegen::Bindings::BroadcastChannelBinding::BroadcastChannelMethods;
use crate::dom::bindings::error::{Error, ErrorResult};
use crate::dom::bindings::reflector::{reflect_dom_object, DomObject};
use crate::dom::bindings::root::DomRoot;
@ -35,11 +33,7 @@ impl BroadcastChannel {
}
pub fn new(global: &GlobalScope, name: DOMString) -> DomRoot<BroadcastChannel> {
let channel = reflect_dom_object(
Box::new(BroadcastChannel::new_inherited(name)),
global,
Wrap,
);
let channel = reflect_dom_object(Box::new(BroadcastChannel::new_inherited(name)), global);
global.track_broadcast_channel(&*channel);
channel
}

View file

@ -3,7 +3,6 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
use crate::dom::bindings::cell::DomRefCell;
use crate::dom::bindings::codegen::Bindings::CanvasGradientBinding;
use crate::dom::bindings::codegen::Bindings::CanvasGradientBinding::CanvasGradientMethods;
use crate::dom::bindings::error::{Error, ErrorResult};
use crate::dom::bindings::num::Finite;
@ -42,11 +41,7 @@ impl CanvasGradient {
}
pub fn new(global: &GlobalScope, style: CanvasGradientStyle) -> DomRoot<CanvasGradient> {
reflect_dom_object(
Box::new(CanvasGradient::new_inherited(style)),
global,
CanvasGradientBinding::Wrap,
)
reflect_dom_object(Box::new(CanvasGradient::new_inherited(style)), global)
}
}

View file

@ -2,7 +2,6 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
use crate::dom::bindings::codegen::Bindings::CanvasPatternBinding;
use crate::dom::bindings::reflector::{reflect_dom_object, Reflector};
use crate::dom::bindings::root::DomRoot;
use crate::dom::canvasgradient::ToFillOrStrokeStyle;
@ -60,7 +59,6 @@ impl CanvasPattern {
origin_clean,
)),
global,
CanvasPatternBinding::Wrap,
)
}
pub fn origin_is_clean(&self) -> bool {

View file

@ -4,7 +4,6 @@
use crate::canvas_state::{CanvasContextState, CanvasState};
use crate::dom::bindings::cell::DomRefCell;
use crate::dom::bindings::codegen::Bindings::CanvasRenderingContext2DBinding;
use crate::dom::bindings::codegen::Bindings::CanvasRenderingContext2DBinding::CanvasFillRule;
use crate::dom::bindings::codegen::Bindings::CanvasRenderingContext2DBinding::CanvasImageSource;
use crate::dom::bindings::codegen::Bindings::CanvasRenderingContext2DBinding::CanvasLineCap;
@ -67,7 +66,7 @@ impl CanvasRenderingContext2D {
Some(canvas),
size,
));
reflect_dom_object(boxed, global, CanvasRenderingContext2DBinding::Wrap)
reflect_dom_object(boxed, global)
}
// https://html.spec.whatwg.org/multipage/#concept-canvas-set-bitmap-dimensions

View file

@ -2,7 +2,6 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
use crate::dom::bindings::codegen::Bindings::CDATASectionBinding;
use crate::dom::bindings::root::DomRoot;
use crate::dom::bindings::str::DOMString;
use crate::dom::document::Document;
@ -26,7 +25,6 @@ impl CDATASection {
Node::reflect_node(
Box::new(CDATASection::new_inherited(text, document)),
document,
CDATASectionBinding::Wrap,
)
}
}

View file

@ -7,9 +7,7 @@ use crate::dom::baseaudiocontext::BaseAudioContext;
use crate::dom::bindings::codegen::Bindings::AudioNodeBinding::{
ChannelCountMode, ChannelInterpretation,
};
use crate::dom::bindings::codegen::Bindings::ChannelMergerNodeBinding::{
self, ChannelMergerOptions,
};
use crate::dom::bindings::codegen::Bindings::ChannelMergerNodeBinding::ChannelMergerOptions;
use crate::dom::bindings::error::{Error, Fallible};
use crate::dom::bindings::reflector::reflect_dom_object;
use crate::dom::bindings::root::DomRoot;
@ -61,11 +59,7 @@ impl ChannelMergerNode {
options: &ChannelMergerOptions,
) -> Fallible<DomRoot<ChannelMergerNode>> {
let node = ChannelMergerNode::new_inherited(window, context, options)?;
Ok(reflect_dom_object(
Box::new(node),
window,
ChannelMergerNodeBinding::Wrap,
))
Ok(reflect_dom_object(Box::new(node), window))
}
#[allow(non_snake_case)]

View file

@ -7,9 +7,7 @@ use crate::dom::baseaudiocontext::BaseAudioContext;
use crate::dom::bindings::codegen::Bindings::AudioNodeBinding::{
ChannelCountMode, ChannelInterpretation,
};
use crate::dom::bindings::codegen::Bindings::ChannelSplitterNodeBinding::{
self, ChannelSplitterOptions,
};
use crate::dom::bindings::codegen::Bindings::ChannelSplitterNodeBinding::ChannelSplitterOptions;
use crate::dom::bindings::error::{Error, Fallible};
use crate::dom::bindings::reflector::reflect_dom_object;
use crate::dom::bindings::root::DomRoot;
@ -63,11 +61,7 @@ impl ChannelSplitterNode {
options: &ChannelSplitterOptions,
) -> Fallible<DomRoot<ChannelSplitterNode>> {
let node = ChannelSplitterNode::new_inherited(window, context, options)?;
Ok(reflect_dom_object(
Box::new(node),
window,
ChannelSplitterNodeBinding::Wrap,
))
Ok(reflect_dom_object(Box::new(node), window))
}
#[allow(non_snake_case)]

View file

@ -2,8 +2,8 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
use crate::dom::bindings::codegen::Bindings::ClientBinding::ClientMethods;
use crate::dom::bindings::codegen::Bindings::ClientBinding::FrameType;
use crate::dom::bindings::codegen::Bindings::ClientBinding::{ClientMethods, Wrap};
use crate::dom::bindings::reflector::{reflect_dom_object, Reflector};
use crate::dom::bindings::root::{DomRoot, MutNullableDom};
use crate::dom::bindings::str::{DOMString, USVString};
@ -36,11 +36,7 @@ impl Client {
}
pub fn new(window: &Window) -> DomRoot<Client> {
reflect_dom_object(
Box::new(Client::new_inherited(window.get_url())),
window,
Wrap,
)
reflect_dom_object(Box::new(Client::new_inherited(window.get_url())), window)
}
pub fn creation_url(&self) -> ServoUrl {

View file

@ -44,7 +44,7 @@ impl CloseEvent {
reason: DOMString,
) -> DomRoot<CloseEvent> {
let event = Box::new(CloseEvent::new_inherited(wasClean, code, reason));
let ev = reflect_dom_object(event, global, CloseEventBinding::Wrap);
let ev = reflect_dom_object(event, global);
{
let event = ev.upcast::<Event>();
event.init_event(type_, bool::from(bubbles), bool::from(cancelable));

View file

@ -2,7 +2,6 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
use crate::dom::bindings::codegen::Bindings::CommentBinding;
use crate::dom::bindings::codegen::Bindings::WindowBinding::WindowMethods;
use crate::dom::bindings::error::Fallible;
use crate::dom::bindings::root::DomRoot;
@ -27,11 +26,7 @@ impl Comment {
}
pub fn new(text: DOMString, document: &Document) -> DomRoot<Comment> {
Node::reflect_node(
Box::new(Comment::new_inherited(text, document)),
document,
CommentBinding::Wrap,
)
Node::reflect_node(Box::new(Comment::new_inherited(text, document)), document)
}
#[allow(non_snake_case)]

View file

@ -29,11 +29,7 @@ impl CompositionEvent {
}
pub fn new_uninitialized(window: &Window) -> DomRoot<CompositionEvent> {
reflect_dom_object(
Box::new(CompositionEvent::new_inherited()),
window,
CompositionEventBinding::Wrap,
)
reflect_dom_object(Box::new(CompositionEvent::new_inherited()), window)
}
pub fn new(
@ -51,7 +47,6 @@ impl CompositionEvent {
data: data,
}),
window,
CompositionEventBinding::Wrap,
);
ev.uievent
.InitUIEvent(type_, can_bubble, cancelable, view, detail);

View file

@ -7,9 +7,7 @@ use crate::dom::audioscheduledsourcenode::AudioScheduledSourceNode;
use crate::dom::baseaudiocontext::BaseAudioContext;
use crate::dom::bindings::codegen::Bindings::AudioParamBinding::AutomationRate;
use crate::dom::bindings::codegen::Bindings::ConstantSourceNodeBinding::ConstantSourceNodeMethods;
use crate::dom::bindings::codegen::Bindings::ConstantSourceNodeBinding::{
self, ConstantSourceOptions,
};
use crate::dom::bindings::codegen::Bindings::ConstantSourceNodeBinding::ConstantSourceOptions;
use crate::dom::bindings::error::Fallible;
use crate::dom::bindings::reflector::reflect_dom_object;
use crate::dom::bindings::root::{Dom, DomRoot};
@ -66,11 +64,7 @@ impl ConstantSourceNode {
options: &ConstantSourceOptions,
) -> Fallible<DomRoot<ConstantSourceNode>> {
let node = ConstantSourceNode::new_inherited(window, context, options)?;
Ok(reflect_dom_object(
Box::new(node),
window,
ConstantSourceNodeBinding::Wrap,
))
Ok(reflect_dom_object(Box::new(node), window))
}
#[allow(non_snake_case)]

View file

@ -3,7 +3,6 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
use crate::dom::bindings::cell::DomRefCell;
use crate::dom::bindings::codegen::Bindings::CryptoBinding;
use crate::dom::bindings::codegen::Bindings::CryptoBinding::CryptoMethods;
use crate::dom::bindings::error::{Error, Fallible};
use crate::dom::bindings::reflector::{reflect_dom_object, Reflector};
@ -37,11 +36,7 @@ impl Crypto {
}
pub fn new(global: &GlobalScope) -> DomRoot<Crypto> {
reflect_dom_object(
Box::new(Crypto::new_inherited()),
global,
CryptoBinding::Wrap,
)
reflect_dom_object(Box::new(Crypto::new_inherited()), global)
}
}

View file

@ -2,7 +2,6 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
use crate::dom::bindings::codegen::Bindings::CSSFontFaceRuleBinding;
use crate::dom::bindings::reflector::reflect_dom_object;
use crate::dom::bindings::root::DomRoot;
use crate::dom::bindings::str::DOMString;
@ -44,7 +43,6 @@ impl CSSFontFaceRule {
fontfacerule,
)),
window,
CSSFontFaceRuleBinding::Wrap,
)
}
}

View file

@ -2,7 +2,6 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
use crate::dom::bindings::codegen::Bindings::CSSImportRuleBinding;
use crate::dom::bindings::reflector::reflect_dom_object;
use crate::dom::bindings::root::DomRoot;
use crate::dom::bindings::str::DOMString;
@ -41,7 +40,6 @@ impl CSSImportRule {
reflect_dom_object(
Box::new(Self::new_inherited(parent_stylesheet, import_rule)),
window,
CSSImportRuleBinding::Wrap,
)
}
}

View file

@ -2,9 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
use crate::dom::bindings::codegen::Bindings::CSSKeyframeRuleBinding::{
self, CSSKeyframeRuleMethods,
};
use crate::dom::bindings::codegen::Bindings::CSSKeyframeRuleBinding::CSSKeyframeRuleMethods;
use crate::dom::bindings::inheritance::Castable;
use crate::dom::bindings::reflector::{reflect_dom_object, DomObject};
use crate::dom::bindings::root::{Dom, DomRoot, MutNullableDom};
@ -50,7 +48,6 @@ impl CSSKeyframeRule {
keyframerule,
)),
window,
CSSKeyframeRuleBinding::Wrap,
)
}
}

View file

@ -2,7 +2,6 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
use crate::dom::bindings::codegen::Bindings::CSSKeyframesRuleBinding;
use crate::dom::bindings::codegen::Bindings::CSSKeyframesRuleBinding::CSSKeyframesRuleMethods;
use crate::dom::bindings::error::ErrorResult;
use crate::dom::bindings::inheritance::Castable;
@ -53,7 +52,6 @@ impl CSSKeyframesRule {
keyframesrule,
)),
window,
CSSKeyframesRuleBinding::Wrap,
)
}

View file

@ -2,7 +2,6 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
use crate::dom::bindings::codegen::Bindings::CSSMediaRuleBinding;
use crate::dom::bindings::codegen::Bindings::CSSMediaRuleBinding::CSSMediaRuleMethods;
use crate::dom::bindings::codegen::Bindings::WindowBinding::WindowBinding::WindowMethods;
use crate::dom::bindings::reflector::{reflect_dom_object, DomObject};
@ -53,7 +52,6 @@ impl CSSMediaRule {
reflect_dom_object(
Box::new(CSSMediaRule::new_inherited(parent_stylesheet, mediarule)),
window,
CSSMediaRuleBinding::Wrap,
)
}

View file

@ -2,7 +2,6 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
use crate::dom::bindings::codegen::Bindings::CSSNamespaceRuleBinding;
use crate::dom::bindings::codegen::Bindings::CSSNamespaceRuleBinding::CSSNamespaceRuleMethods;
use crate::dom::bindings::reflector::reflect_dom_object;
use crate::dom::bindings::root::DomRoot;
@ -45,7 +44,6 @@ impl CSSNamespaceRule {
namespacerule,
)),
window,
CSSNamespaceRuleBinding::Wrap,
)
}
}

View file

@ -3,7 +3,6 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
use crate::dom::bindings::cell::DomRefCell;
use crate::dom::bindings::codegen::Bindings::CSSRuleListBinding;
use crate::dom::bindings::codegen::Bindings::CSSRuleListBinding::CSSRuleListMethods;
use crate::dom::bindings::error::{Error, ErrorResult, Fallible};
use crate::dom::bindings::inheritance::Castable;
@ -86,7 +85,6 @@ impl CSSRuleList {
reflect_dom_object(
Box::new(CSSRuleList::new_inherited(parent_stylesheet, rules)),
window,
CSSRuleListBinding::Wrap,
)
}

View file

@ -2,9 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
use crate::dom::bindings::codegen::Bindings::CSSStyleDeclarationBinding::{
self, CSSStyleDeclarationMethods,
};
use crate::dom::bindings::codegen::Bindings::CSSStyleDeclarationBinding::CSSStyleDeclarationMethods;
use crate::dom::bindings::codegen::Bindings::WindowBinding::WindowMethods;
use crate::dom::bindings::error::{Error, ErrorResult, Fallible};
use crate::dom::bindings::inheritance::Castable;
@ -233,7 +231,6 @@ impl CSSStyleDeclaration {
modification_access,
)),
global,
CSSStyleDeclarationBinding::Wrap,
)
}

View file

@ -2,7 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
use crate::dom::bindings::codegen::Bindings::CSSStyleRuleBinding::{self, CSSStyleRuleMethods};
use crate::dom::bindings::codegen::Bindings::CSSStyleRuleBinding::CSSStyleRuleMethods;
use crate::dom::bindings::inheritance::Castable;
use crate::dom::bindings::reflector::{reflect_dom_object, DomObject};
use crate::dom::bindings::root::{Dom, DomRoot, MutNullableDom};
@ -51,7 +51,6 @@ impl CSSStyleRule {
reflect_dom_object(
Box::new(CSSStyleRule::new_inherited(parent_stylesheet, stylerule)),
window,
CSSStyleRuleBinding::Wrap,
)
}
}

View file

@ -2,7 +2,6 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
use crate::dom::bindings::codegen::Bindings::CSSStyleSheetBinding;
use crate::dom::bindings::codegen::Bindings::CSSStyleSheetBinding::CSSStyleSheetMethods;
use crate::dom::bindings::error::{Error, ErrorResult, Fallible};
use crate::dom::bindings::inheritance::Castable;
@ -61,7 +60,6 @@ impl CSSStyleSheet {
owner, type_, href, title, stylesheet,
)),
window,
CSSStyleSheetBinding::Wrap,
)
}

View file

@ -3,7 +3,6 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
use crate::dom::bindings::codegen::Bindings::CSSStyleValueBinding::CSSStyleValueMethods;
use crate::dom::bindings::codegen::Bindings::CSSStyleValueBinding::Wrap;
use crate::dom::bindings::reflector::reflect_dom_object;
use crate::dom::bindings::reflector::Reflector;
use crate::dom::bindings::root::DomRoot;
@ -29,7 +28,7 @@ impl CSSStyleValue {
}
pub fn new(global: &GlobalScope, value: String) -> DomRoot<CSSStyleValue> {
reflect_dom_object(Box::new(CSSStyleValue::new_inherited(value)), global, Wrap)
reflect_dom_object(Box::new(CSSStyleValue::new_inherited(value)), global)
}
}

View file

@ -2,7 +2,6 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
use crate::dom::bindings::codegen::Bindings::CSSSupportsRuleBinding;
use crate::dom::bindings::codegen::Bindings::WindowBinding::WindowBinding::WindowMethods;
use crate::dom::bindings::reflector::{reflect_dom_object, DomObject};
use crate::dom::bindings::root::DomRoot;
@ -52,7 +51,6 @@ impl CSSSupportsRule {
supportsrule,
)),
window,
CSSSupportsRuleBinding::Wrap,
)
}

View file

@ -2,7 +2,6 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
use crate::dom::bindings::codegen::Bindings::CSSViewportRuleBinding;
use crate::dom::bindings::reflector::reflect_dom_object;
use crate::dom::bindings::root::DomRoot;
use crate::dom::bindings::str::DOMString;
@ -44,7 +43,6 @@ impl CSSViewportRule {
viewportrule,
)),
window,
CSSViewportRuleBinding::Wrap,
)
}
}

View file

@ -4,7 +4,6 @@
use crate::dom::bindings::callback::{CallbackContainer, ExceptionHandling};
use crate::dom::bindings::cell::DomRefCell;
use crate::dom::bindings::codegen::Bindings::CustomElementRegistryBinding;
use crate::dom::bindings::codegen::Bindings::CustomElementRegistryBinding::CustomElementConstructor;
use crate::dom::bindings::codegen::Bindings::CustomElementRegistryBinding::CustomElementRegistryMethods;
use crate::dom::bindings::codegen::Bindings::CustomElementRegistryBinding::ElementDefinitionOptions;
@ -96,7 +95,6 @@ impl CustomElementRegistry {
reflect_dom_object(
Box::new(CustomElementRegistry::new_inherited(window)),
window,
CustomElementRegistryBinding::Wrap,
)
}

View file

@ -37,11 +37,7 @@ impl CustomEvent {
}
pub fn new_uninitialized(global: &GlobalScope) -> DomRoot<CustomEvent> {
reflect_dom_object(
Box::new(CustomEvent::new_inherited()),
global,
CustomEventBinding::Wrap,
)
reflect_dom_object(Box::new(CustomEvent::new_inherited()), global)
}
pub fn new(
global: &GlobalScope,

View file

@ -2,7 +2,6 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
use crate::dom::bindings::codegen::Bindings::DissimilarOriginLocationBinding;
use crate::dom::bindings::codegen::Bindings::DissimilarOriginLocationBinding::DissimilarOriginLocationMethods;
use crate::dom::bindings::error::{Error, ErrorResult, Fallible};
use crate::dom::bindings::reflector::reflect_dom_object;
@ -42,7 +41,6 @@ impl DissimilarOriginLocation {
reflect_dom_object(
Box::new(DissimilarOriginLocation::new_inherited(window)),
window,
DissimilarOriginLocationBinding::Wrap,
)
}
}

View file

@ -8,7 +8,6 @@ use crate::dom::beforeunloadevent::BeforeUnloadEvent;
use crate::dom::bindings::callback::ExceptionHandling;
use crate::dom::bindings::cell::{ref_filter_map, DomRefCell, Ref, RefMut};
use crate::dom::bindings::codegen::Bindings::BeforeUnloadEventBinding::BeforeUnloadEventBinding::BeforeUnloadEventMethods;
use crate::dom::bindings::codegen::Bindings::DocumentBinding;
use crate::dom::bindings::codegen::Bindings::DocumentBinding::{
DocumentMethods, DocumentReadyState,
};
@ -3044,7 +3043,6 @@ impl Document {
canceller,
)),
window,
DocumentBinding::Wrap,
);
{
let node = document.upcast::<Node>();

View file

@ -3,7 +3,6 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
use crate::dom::bindings::cell::DomRefCell;
use crate::dom::bindings::codegen::Bindings::DocumentFragmentBinding;
use crate::dom::bindings::codegen::Bindings::DocumentFragmentBinding::DocumentFragmentMethods;
use crate::dom::bindings::codegen::Bindings::WindowBinding::WindowMethods;
use crate::dom::bindings::codegen::UnionTypes::NodeOrString;
@ -42,7 +41,6 @@ impl DocumentFragment {
Node::reflect_node(
Box::new(DocumentFragment::new_inherited(document)),
document,
DocumentFragmentBinding::Wrap,
)
}

View file

@ -2,7 +2,6 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
use crate::dom::bindings::codegen::Bindings::DocumentTypeBinding;
use crate::dom::bindings::codegen::Bindings::DocumentTypeBinding::DocumentTypeMethods;
use crate::dom::bindings::codegen::UnionTypes::NodeOrString;
use crate::dom::bindings::error::ErrorResult;
@ -49,7 +48,6 @@ impl DocumentType {
name, public_id, system_id, document,
)),
document,
DocumentTypeBinding::Wrap,
)
}

View file

@ -2,7 +2,6 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
use crate::dom::bindings::codegen::Bindings::DOMExceptionBinding;
use crate::dom::bindings::codegen::Bindings::DOMExceptionBinding::DOMExceptionConstants;
use crate::dom::bindings::codegen::Bindings::DOMExceptionBinding::DOMExceptionMethods;
use crate::dom::bindings::error::Error;
@ -134,11 +133,7 @@ impl DOMException {
pub fn new(global: &GlobalScope, code: DOMErrorName) -> DomRoot<DOMException> {
let (message, name) = DOMException::get_error_data_by_code(code);
reflect_dom_object(
Box::new(DOMException::new_inherited(message, name)),
global,
DOMExceptionBinding::Wrap,
)
reflect_dom_object(Box::new(DOMException::new_inherited(message, name)), global)
}
#[allow(non_snake_case)]
@ -150,7 +145,6 @@ impl DOMException {
Ok(reflect_dom_object(
Box::new(DOMException::new_inherited(message, name)),
global,
DOMExceptionBinding::Wrap,
))
}

View file

@ -3,7 +3,6 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
use crate::document_loader::DocumentLoader;
use crate::dom::bindings::codegen::Bindings::DOMImplementationBinding;
use crate::dom::bindings::codegen::Bindings::DOMImplementationBinding::DOMImplementationMethods;
use crate::dom::bindings::codegen::Bindings::DocumentBinding::{
DocumentMethods, ElementCreationOptions,
@ -46,11 +45,7 @@ impl DOMImplementation {
pub fn new(document: &Document) -> DomRoot<DOMImplementation> {
let window = document.window();
reflect_dom_object(
Box::new(DOMImplementation::new_inherited(document)),
window,
DOMImplementationBinding::Wrap,
)
reflect_dom_object(Box::new(DOMImplementation::new_inherited(document)), window)
}
}

View file

@ -2,9 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
use crate::dom::bindings::codegen::Bindings::DOMMatrixBinding::{
DOMMatrixInit, DOMMatrixMethods, Wrap,
};
use crate::dom::bindings::codegen::Bindings::DOMMatrixBinding::{DOMMatrixInit, DOMMatrixMethods};
use crate::dom::bindings::codegen::Bindings::DOMMatrixReadOnlyBinding::DOMMatrixReadOnlyMethods;
use crate::dom::bindings::codegen::UnionTypes::StringOrUnrestrictedDoubleSequence;
use crate::dom::bindings::error;
@ -32,7 +30,7 @@ impl DOMMatrix {
#[allow(unrooted_must_root)]
pub fn new(global: &GlobalScope, is2D: bool, matrix: Transform3D<f64>) -> DomRoot<Self> {
let dommatrix = Self::new_inherited(is2D, matrix);
reflect_dom_object(Box::new(dommatrix), global, Wrap)
reflect_dom_object(Box::new(dommatrix), global)
}
pub fn new_inherited(is2D: bool, matrix: Transform3D<f64>) -> Self {

View file

@ -4,9 +4,7 @@
use crate::dom::bindings::cell::{DomRefCell, Ref};
use crate::dom::bindings::codegen::Bindings::DOMMatrixBinding::{DOMMatrixInit, DOMMatrixMethods};
use crate::dom::bindings::codegen::Bindings::DOMMatrixReadOnlyBinding::{
DOMMatrixReadOnlyMethods, Wrap,
};
use crate::dom::bindings::codegen::Bindings::DOMMatrixReadOnlyBinding::DOMMatrixReadOnlyMethods;
use crate::dom::bindings::codegen::Bindings::DOMPointBinding::DOMPointInit;
use crate::dom::bindings::codegen::UnionTypes::StringOrUnrestrictedDoubleSequence;
use crate::dom::bindings::error;
@ -45,7 +43,7 @@ impl DOMMatrixReadOnly {
#[allow(unrooted_must_root)]
pub fn new(global: &GlobalScope, is2D: bool, matrix: Transform3D<f64>) -> DomRoot<Self> {
let dommatrix = Self::new_inherited(is2D, matrix);
reflect_dom_object(Box::new(dommatrix), global, Wrap)
reflect_dom_object(Box::new(dommatrix), global)
}
pub fn new_inherited(is2D: bool, matrix: Transform3D<f64>) -> Self {

View file

@ -37,11 +37,7 @@ impl DOMParser {
}
pub fn new(window: &Window) -> DomRoot<DOMParser> {
reflect_dom_object(
Box::new(DOMParser::new_inherited(window)),
window,
DOMParserBinding::Wrap,
)
reflect_dom_object(Box::new(DOMParser::new_inherited(window)), window)
}
#[allow(non_snake_case)]

View file

@ -2,9 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
use crate::dom::bindings::codegen::Bindings::DOMPointBinding::{
DOMPointInit, DOMPointMethods, Wrap,
};
use crate::dom::bindings::codegen::Bindings::DOMPointBinding::{DOMPointInit, DOMPointMethods};
use crate::dom::bindings::codegen::Bindings::DOMPointReadOnlyBinding::DOMPointReadOnlyMethods;
use crate::dom::bindings::error::Fallible;
use crate::dom::bindings::reflector::reflect_dom_object;
@ -28,7 +26,7 @@ impl DOMPoint {
}
pub fn new(global: &GlobalScope, x: f64, y: f64, z: f64, w: f64) -> DomRoot<DOMPoint> {
reflect_dom_object(Box::new(DOMPoint::new_inherited(x, y, z, w)), global, Wrap)
reflect_dom_object(Box::new(DOMPoint::new_inherited(x, y, z, w)), global)
}
pub fn Constructor(

View file

@ -3,9 +3,7 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
use crate::dom::bindings::codegen::Bindings::DOMPointBinding::DOMPointInit;
use crate::dom::bindings::codegen::Bindings::DOMPointReadOnlyBinding::{
DOMPointReadOnlyMethods, Wrap,
};
use crate::dom::bindings::codegen::Bindings::DOMPointReadOnlyBinding::DOMPointReadOnlyMethods;
use crate::dom::bindings::error::Fallible;
use crate::dom::bindings::reflector::{reflect_dom_object, Reflector};
use crate::dom::bindings::root::DomRoot;
@ -39,7 +37,6 @@ impl DOMPointReadOnly {
reflect_dom_object(
Box::new(DOMPointReadOnly::new_inherited(x, y, z, w)),
global,
Wrap,
)
}

View file

@ -3,7 +3,7 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
use crate::dom::bindings::codegen::Bindings::DOMPointBinding::{DOMPointInit, DOMPointMethods};
use crate::dom::bindings::codegen::Bindings::DOMQuadBinding::{DOMQuadInit, DOMQuadMethods, Wrap};
use crate::dom::bindings::codegen::Bindings::DOMQuadBinding::{DOMQuadInit, DOMQuadMethods};
use crate::dom::bindings::codegen::Bindings::DOMRectReadOnlyBinding::DOMRectInit;
use crate::dom::bindings::error::Fallible;
use crate::dom::bindings::reflector::{reflect_dom_object, DomObject, Reflector};
@ -42,11 +42,7 @@ impl DOMQuad {
p3: &DOMPoint,
p4: &DOMPoint,
) -> DomRoot<DOMQuad> {
reflect_dom_object(
Box::new(DOMQuad::new_inherited(p1, p2, p3, p4)),
global,
Wrap,
)
reflect_dom_object(Box::new(DOMQuad::new_inherited(p1, p2, p3, p4)), global)
}
pub fn Constructor(

View file

@ -2,7 +2,6 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
use crate::dom::bindings::codegen::Bindings::DOMRectBinding;
use crate::dom::bindings::codegen::Bindings::DOMRectBinding::DOMRectMethods;
use crate::dom::bindings::codegen::Bindings::DOMRectReadOnlyBinding::DOMRectReadOnlyMethods;
use crate::dom::bindings::error::Fallible;
@ -28,7 +27,6 @@ impl DOMRect {
reflect_dom_object(
Box::new(DOMRect::new_inherited(x, y, width, height)),
global,
DOMRectBinding::Wrap,
)
}

View file

@ -2,9 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
use crate::dom::bindings::codegen::Bindings::DOMRectReadOnlyBinding::{
DOMRectReadOnlyMethods, Wrap,
};
use crate::dom::bindings::codegen::Bindings::DOMRectReadOnlyBinding::DOMRectReadOnlyMethods;
use crate::dom::bindings::error::Fallible;
use crate::dom::bindings::reflector::{reflect_dom_object, Reflector};
use crate::dom::bindings::root::DomRoot;
@ -42,7 +40,6 @@ impl DOMRectReadOnly {
reflect_dom_object(
Box::new(DOMRectReadOnly::new_inherited(x, y, width, height)),
global,
Wrap,
)
}

View file

@ -2,7 +2,6 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
use crate::dom::bindings::codegen::Bindings::DOMStringListBinding;
use crate::dom::bindings::codegen::Bindings::DOMStringListBinding::DOMStringListMethods;
use crate::dom::bindings::reflector::{reflect_dom_object, Reflector};
use crate::dom::bindings::root::DomRoot;
@ -27,11 +26,7 @@ impl DOMStringList {
#[allow(unused)]
pub fn new(window: &Window, strings: Vec<DOMString>) -> DomRoot<DOMStringList> {
reflect_dom_object(
Box::new(DOMStringList::new_inherited(strings)),
window,
DOMStringListBinding::Wrap,
)
reflect_dom_object(Box::new(DOMStringList::new_inherited(strings)), window)
}
}

View file

@ -2,7 +2,6 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
use crate::dom::bindings::codegen::Bindings::DOMStringMapBinding;
use crate::dom::bindings::codegen::Bindings::DOMStringMapBinding::DOMStringMapMethods;
use crate::dom::bindings::error::ErrorResult;
use crate::dom::bindings::reflector::{reflect_dom_object, Reflector};
@ -28,11 +27,7 @@ impl DOMStringMap {
pub fn new(element: &HTMLElement) -> DomRoot<DOMStringMap> {
let window = window_from_node(element);
reflect_dom_object(
Box::new(DOMStringMap::new_inherited(element)),
&*window,
DOMStringMapBinding::Wrap,
)
reflect_dom_object(Box::new(DOMStringMap::new_inherited(element)), &*window)
}
}

View file

@ -3,7 +3,6 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
use crate::dom::attr::Attr;
use crate::dom::bindings::codegen::Bindings::DOMTokenListBinding;
use crate::dom::bindings::codegen::Bindings::DOMTokenListBinding::DOMTokenListMethods;
use crate::dom::bindings::error::{Error, ErrorResult, Fallible};
use crate::dom::bindings::reflector::{reflect_dom_object, Reflector};
@ -37,7 +36,6 @@ impl DOMTokenList {
reflect_dom_object(
Box::new(DOMTokenList::new_inherited(element, local_name.clone())),
&*window,
DOMTokenListBinding::Wrap,
)
}

View file

@ -9,7 +9,6 @@ use crate::dom::attr::{Attr, AttrHelpersForLayout};
use crate::dom::bindings::cell::{ref_filter_map, DomRefCell, Ref, RefMut};
use crate::dom::bindings::codegen::Bindings::AttrBinding::AttrMethods;
use crate::dom::bindings::codegen::Bindings::DocumentBinding::DocumentMethods;
use crate::dom::bindings::codegen::Bindings::ElementBinding;
use crate::dom::bindings::codegen::Bindings::ElementBinding::ElementMethods;
use crate::dom::bindings::codegen::Bindings::FunctionBinding::Function;
use crate::dom::bindings::codegen::Bindings::HTMLTemplateElementBinding::HTMLTemplateElementMethods;
@ -294,7 +293,6 @@ impl Element {
local_name, namespace, prefix, document,
)),
document,
ElementBinding::Wrap,
)
}

View file

@ -46,11 +46,7 @@ impl ErrorEvent {
}
pub fn new_uninitialized(global: &GlobalScope) -> DomRoot<ErrorEvent> {
reflect_dom_object(
Box::new(ErrorEvent::new_inherited()),
global,
ErrorEventBinding::Wrap,
)
reflect_dom_object(Box::new(ErrorEvent::new_inherited()), global)
}
pub fn new(

View file

@ -72,7 +72,7 @@ impl Event {
}
pub fn new_uninitialized(global: &GlobalScope) -> DomRoot<Event> {
reflect_dom_object(Box::new(Event::new_inherited()), global, EventBinding::Wrap)
reflect_dom_object(Box::new(Event::new_inherited()), global)
}
pub fn new(

View file

@ -4,7 +4,7 @@
use crate::dom::bindings::cell::DomRefCell;
use crate::dom::bindings::codegen::Bindings::EventSourceBinding::{
EventSourceInit, EventSourceMethods, Wrap,
EventSourceInit, EventSourceMethods,
};
use crate::dom::bindings::error::{Error, Fallible};
use crate::dom::bindings::inheritance::Castable;
@ -463,7 +463,6 @@ impl EventSource {
reflect_dom_object(
Box::new(EventSource::new_inherited(url, with_credentials)),
global,
Wrap,
)
}

View file

@ -15,7 +15,6 @@ use crate::dom::bindings::codegen::Bindings::EventListenerBinding::EventListener
use crate::dom::bindings::codegen::Bindings::EventTargetBinding::AddEventListenerOptions;
use crate::dom::bindings::codegen::Bindings::EventTargetBinding::EventListenerOptions;
use crate::dom::bindings::codegen::Bindings::EventTargetBinding::EventTargetMethods;
use crate::dom::bindings::codegen::Bindings::EventTargetBinding::Wrap;
use crate::dom::bindings::codegen::Bindings::WindowBinding::WindowMethods;
use crate::dom::bindings::codegen::UnionTypes::AddEventListenerOptionsOrBoolean;
use crate::dom::bindings::codegen::UnionTypes::EventListenerOptionsOrBoolean;
@ -340,7 +339,7 @@ impl EventTarget {
}
fn new(global: &GlobalScope) -> DomRoot<EventTarget> {
reflect_dom_object(Box::new(EventTarget::new_inherited()), global, Wrap)
reflect_dom_object(Box::new(EventTarget::new_inherited()), global)
}
#[allow(non_snake_case)]

View file

@ -37,11 +37,7 @@ impl ExtendableEvent {
bubbles: bool,
cancelable: bool,
) -> DomRoot<ExtendableEvent> {
let ev = reflect_dom_object(
Box::new(ExtendableEvent::new_inherited()),
worker,
ExtendableEventBinding::Wrap,
);
let ev = reflect_dom_object(Box::new(ExtendableEvent::new_inherited()), worker);
{
let event = ev.upcast::<Event>();
event.init_event(type_, bubbles, cancelable);

View file

@ -73,7 +73,7 @@ impl ExtendableMessageEvent {
lastEventId,
ports,
));
let ev = reflect_dom_object(ev, global, ExtendableMessageEventBinding::Wrap);
let ev = reflect_dom_object(ev, global);
{
let event = ev.upcast::<Event>();
event.init_event(type_, bubbles, cancelable);

View file

@ -3,7 +3,7 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
use crate::dom::bindings::codegen::Bindings::FakeXRDeviceBinding::{
self, FakeXRDeviceMethods, FakeXRRigidTransformInit, FakeXRViewInit,
FakeXRDeviceMethods, FakeXRRigidTransformInit, FakeXRViewInit,
};
use crate::dom::bindings::codegen::Bindings::FakeXRInputControllerBinding::FakeXRInputSourceInit;
use crate::dom::bindings::codegen::Bindings::XRInputSourceBinding::{
@ -51,11 +51,7 @@ impl FakeXRDevice {
}
pub fn new(global: &GlobalScope, sender: IpcSender<MockDeviceMsg>) -> DomRoot<FakeXRDevice> {
reflect_dom_object(
Box::new(FakeXRDevice::new_inherited(sender)),
global,
FakeXRDeviceBinding::Wrap,
)
reflect_dom_object(Box::new(FakeXRDevice::new_inherited(sender)), global)
}
pub fn disconnect(&self, sender: IpcSender<()>) {

View file

@ -3,9 +3,7 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
use crate::dom::bindings::codegen::Bindings::FakeXRDeviceBinding::FakeXRRigidTransformInit;
use crate::dom::bindings::codegen::Bindings::FakeXRInputControllerBinding::{
self, FakeXRInputControllerMethods,
};
use crate::dom::bindings::codegen::Bindings::FakeXRInputControllerBinding::FakeXRInputControllerMethods;
use crate::dom::bindings::codegen::Bindings::XRInputSourceBinding::{
XRHandedness, XRTargetRayMode,
};
@ -47,7 +45,6 @@ impl FakeXRInputController {
reflect_dom_object(
Box::new(FakeXRInputController::new_inherited(sender, id)),
global,
FakeXRInputControllerBinding::Wrap,
)
}

View file

@ -51,7 +51,6 @@ impl File {
let file = reflect_dom_object(
Box::new(File::new_inherited(&blob_impl, name, modified)),
global,
FileBinding::Wrap,
);
global.track_file(&file, blob_impl);
file

View file

@ -2,7 +2,6 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
use crate::dom::bindings::codegen::Bindings::FileListBinding;
use crate::dom::bindings::codegen::Bindings::FileListBinding::FileListMethods;
use crate::dom::bindings::reflector::{reflect_dom_object, Reflector};
use crate::dom::bindings::root::{Dom, DomRoot};
@ -34,7 +33,6 @@ impl FileList {
files.iter().map(|r| Dom::from_ref(&**r)).collect(),
)),
window,
FileListBinding::Wrap,
)
}

View file

@ -5,7 +5,7 @@
use crate::dom::bindings::cell::DomRefCell;
use crate::dom::bindings::codegen::Bindings::BlobBinding::BlobMethods;
use crate::dom::bindings::codegen::Bindings::FileReaderBinding::{
self, FileReaderConstants, FileReaderMethods,
FileReaderConstants, FileReaderMethods,
};
use crate::dom::bindings::codegen::UnionTypes::StringOrObject;
use crate::dom::bindings::error::{Error, ErrorResult, Fallible};
@ -152,11 +152,7 @@ impl FileReader {
}
pub fn new(global: &GlobalScope) -> DomRoot<FileReader> {
reflect_dom_object(
Box::new(FileReader::new_inherited()),
global,
FileReaderBinding::Wrap,
)
reflect_dom_object(Box::new(FileReader::new_inherited()), global)
}
#[allow(non_snake_case)]

View file

@ -3,9 +3,7 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
use crate::dom::bindings::codegen::Bindings::BlobBinding::BlobMethods;
use crate::dom::bindings::codegen::Bindings::FileReaderSyncBinding::{
FileReaderSyncBinding, FileReaderSyncMethods,
};
use crate::dom::bindings::codegen::Bindings::FileReaderSyncBinding::FileReaderSyncMethods;
use crate::dom::bindings::error::{Error, Fallible};
use crate::dom::bindings::reflector::{reflect_dom_object, Reflector};
use crate::dom::bindings::root::DomRoot;
@ -33,11 +31,7 @@ impl FileReaderSync {
}
pub fn new(global: &GlobalScope) -> DomRoot<FileReaderSync> {
reflect_dom_object(
Box::new(FileReaderSync::new_inherited()),
global,
FileReaderSyncBinding::Wrap,
)
reflect_dom_object(Box::new(FileReaderSync::new_inherited()), global)
}
#[allow(non_snake_case)]

View file

@ -32,11 +32,7 @@ impl FocusEvent {
}
pub fn new_uninitialized(window: &Window) -> DomRoot<FocusEvent> {
reflect_dom_object(
Box::new(FocusEvent::new_inherited()),
window,
FocusEventBinding::Wrap,
)
reflect_dom_object(Box::new(FocusEvent::new_inherited()), window)
}
pub fn new(

View file

@ -4,7 +4,6 @@
use crate::dom::bindings::cell::DomRefCell;
use crate::dom::bindings::codegen::Bindings::FormDataBinding::FormDataMethods;
use crate::dom::bindings::codegen::Bindings::FormDataBinding::FormDataWrap;
use crate::dom::bindings::codegen::UnionTypes::FileOrUSVString;
use crate::dom::bindings::error::{Error, Fallible};
use crate::dom::bindings::inheritance::Castable;
@ -43,11 +42,7 @@ impl FormData {
}
pub fn new(form_datums: Option<Vec<FormDatum>>, global: &GlobalScope) -> DomRoot<FormData> {
reflect_dom_object(
Box::new(FormData::new_inherited(form_datums)),
global,
FormDataWrap,
)
reflect_dom_object(Box::new(FormData::new_inherited(form_datums)), global)
}
// https://xhr.spec.whatwg.org/#dom-formdata

View file

@ -38,7 +38,6 @@ impl FormDataEvent {
form_data: Dom::from_ref(form_data),
}),
global,
FormDataEventBinding::Wrap,
);
{

View file

@ -9,9 +9,7 @@ use crate::dom::bindings::codegen::Bindings::AudioNodeBinding::{
ChannelCountMode, ChannelInterpretation,
};
use crate::dom::bindings::codegen::Bindings::AudioParamBinding::AutomationRate;
use crate::dom::bindings::codegen::Bindings::GainNodeBinding::{
self, GainNodeMethods, GainOptions,
};
use crate::dom::bindings::codegen::Bindings::GainNodeBinding::{GainNodeMethods, GainOptions};
use crate::dom::bindings::error::Fallible;
use crate::dom::bindings::reflector::reflect_dom_object;
use crate::dom::bindings::root::{Dom, DomRoot};
@ -69,11 +67,7 @@ impl GainNode {
options: &GainOptions,
) -> Fallible<DomRoot<GainNode>> {
let node = GainNode::new_inherited(window, context, options)?;
Ok(reflect_dom_object(
Box::new(node),
window,
GainNodeBinding::Wrap,
))
Ok(reflect_dom_object(Box::new(node), window))
}
#[allow(non_snake_case)]

View file

@ -2,7 +2,6 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
use crate::dom::bindings::codegen::Bindings::GamepadBinding;
use crate::dom::bindings::codegen::Bindings::GamepadBinding::GamepadMethods;
use crate::dom::bindings::inheritance::Castable;
use crate::dom::bindings::num::Finite;
@ -95,7 +94,6 @@ impl Gamepad {
data.display_id,
)),
global,
GamepadBinding::Wrap,
);
let cx = global.get_cx();

View file

@ -2,7 +2,6 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
use crate::dom::bindings::codegen::Bindings::GamepadButtonBinding;
use crate::dom::bindings::codegen::Bindings::GamepadButtonBinding::GamepadButtonMethods;
use crate::dom::bindings::num::Finite;
use crate::dom::bindings::reflector::{reflect_dom_object, Reflector};
@ -33,7 +32,6 @@ impl GamepadButton {
reflect_dom_object(
Box::new(GamepadButton::new_inherited(pressed, touched)),
global,
GamepadButtonBinding::Wrap,
)
}
}

View file

@ -2,7 +2,6 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
use crate::dom::bindings::codegen::Bindings::GamepadButtonListBinding;
use crate::dom::bindings::codegen::Bindings::GamepadButtonListBinding::GamepadButtonListMethods;
use crate::dom::bindings::reflector::{reflect_dom_object, Reflector};
use crate::dom::bindings::root::{Dom, DomRoot, DomSlice};
@ -34,11 +33,7 @@ impl GamepadButtonList {
rooted_vec!(let list <- buttons.iter()
.map(|btn| GamepadButton::new(&global, btn.pressed, btn.touched)));
reflect_dom_object(
Box::new(GamepadButtonList::new_inherited(list.r())),
global,
GamepadButtonListBinding::Wrap,
)
reflect_dom_object(Box::new(GamepadButtonList::new_inherited(list.r())), global)
}
pub fn sync_from_vr(&self, vr_buttons: &[WebVRGamepadButton]) {

View file

@ -43,11 +43,7 @@ impl GamepadEvent {
cancelable: bool,
gamepad: &Gamepad,
) -> DomRoot<GamepadEvent> {
let ev = reflect_dom_object(
Box::new(GamepadEvent::new_inherited(&gamepad)),
global,
GamepadEventBinding::Wrap,
);
let ev = reflect_dom_object(Box::new(GamepadEvent::new_inherited(&gamepad)), global);
{
let event = ev.upcast::<Event>();
event.init_event(type_, bubbles, cancelable);

View file

@ -3,7 +3,6 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
use crate::dom::bindings::cell::DomRefCell;
use crate::dom::bindings::codegen::Bindings::GamepadListBinding;
use crate::dom::bindings::codegen::Bindings::GamepadListBinding::GamepadListMethods;
use crate::dom::bindings::reflector::{reflect_dom_object, Reflector};
use crate::dom::bindings::root::{Dom, DomRoot};
@ -27,11 +26,7 @@ impl GamepadList {
}
pub fn new(global: &GlobalScope, list: &[&Gamepad]) -> DomRoot<GamepadList> {
reflect_dom_object(
Box::new(GamepadList::new_inherited(list)),
global,
GamepadListBinding::Wrap,
)
reflect_dom_object(Box::new(GamepadList::new_inherited(list)), global)
}
pub fn add_if_not_exists(&self, gamepads: &[DomRoot<Gamepad>]) {

View file

@ -3,7 +3,7 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
use crate::dom::bindings::codegen::Bindings::GPUBinding::GPURequestAdapterOptions;
use crate::dom::bindings::codegen::Bindings::GPUBinding::{self, GPUMethods, GPUPowerPreference};
use crate::dom::bindings::codegen::Bindings::GPUBinding::{GPUMethods, GPUPowerPreference};
use crate::dom::bindings::error::Error;
use crate::dom::bindings::refcounted::{Trusted, TrustedPromise};
use crate::dom::bindings::reflector::{reflect_dom_object, DomObject, Reflector};
@ -36,7 +36,7 @@ impl GPU {
}
pub fn new(global: &GlobalScope) -> DomRoot<GPU> {
reflect_dom_object(Box::new(GPU::new_inherited()), global, GPUBinding::Wrap)
reflect_dom_object(Box::new(GPU::new_inherited()), global)
}
}

View file

@ -3,7 +3,7 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
use crate::dom::bindings::codegen::Bindings::GPUAdapterBinding::{
self, GPUAdapterMethods, GPUDeviceDescriptor,
GPUAdapterMethods, GPUDeviceDescriptor,
};
use crate::dom::bindings::error::Error;
use crate::dom::bindings::reflector::{reflect_dom_object, DomObject, Reflector};
@ -61,7 +61,6 @@ impl GPUAdapter {
channel, name, extensions, adapter,
)),
global,
GPUAdapterBinding::Wrap,
)
}
}

View file

@ -3,9 +3,7 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
use crate::dom::bindings::cell::DomRefCell;
use crate::dom::bindings::codegen::Bindings::GPUBindGroupBinding::{
GPUBindGroupBinding, GPUBindGroupMethods,
};
use crate::dom::bindings::codegen::Bindings::GPUBindGroupBinding::GPUBindGroupMethods;
use crate::dom::bindings::reflector::{reflect_dom_object, Reflector};
use crate::dom::bindings::root::DomRoot;
use crate::dom::bindings::str::DOMString;
@ -40,7 +38,6 @@ impl GPUBindGroup {
reflect_dom_object(
Box::new(GPUBindGroup::new_inherited(bind_group, valid)),
global,
GPUBindGroupBinding::Wrap,
)
}
}

View file

@ -4,7 +4,7 @@
use crate::dom::bindings::cell::DomRefCell;
use crate::dom::bindings::codegen::Bindings::GPUBindGroupLayoutBinding::{
self, GPUBindGroupLayoutBindings, GPUBindGroupLayoutMethods,
GPUBindGroupLayoutBindings, GPUBindGroupLayoutMethods,
};
use crate::dom::bindings::reflector::{reflect_dom_object, Reflector};
use crate::dom::bindings::root::DomRoot;
@ -58,7 +58,6 @@ impl GPUBindGroupLayout {
valid,
)),
global,
GPUBindGroupLayoutBinding::Wrap,
)
}
}

View file

@ -3,9 +3,7 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
use crate::dom::bindings::cell::{DomRefCell, Ref};
use crate::dom::bindings::codegen::Bindings::GPUBufferBinding::{
self, GPUBufferMethods, GPUBufferSize,
};
use crate::dom::bindings::codegen::Bindings::GPUBufferBinding::{GPUBufferMethods, GPUBufferSize};
use crate::dom::bindings::error::Error;
use crate::dom::bindings::reflector::DomObject;
use crate::dom::bindings::reflector::{reflect_dom_object, Reflector};
@ -98,7 +96,6 @@ impl GPUBuffer {
channel, buffer, device, state, size, usage, valid, mapping,
)),
global,
GPUBufferBinding::Wrap,
)
}
}

View file

@ -3,9 +3,7 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
use crate::dom::bindings::cell::{DomRefCell, Ref};
use crate::dom::bindings::codegen::Bindings::GPUCommandBufferBinding::{
self, GPUCommandBufferMethods,
};
use crate::dom::bindings::codegen::Bindings::GPUCommandBufferBinding::GPUCommandBufferMethods;
use crate::dom::bindings::reflector::{reflect_dom_object, Reflector};
use crate::dom::bindings::root::Dom;
use crate::dom::bindings::root::DomRoot;
@ -62,7 +60,6 @@ impl GPUCommandBuffer {
buffers,
)),
global,
GPUCommandBufferBinding::Wrap,
)
}
}

View file

@ -4,7 +4,7 @@
use crate::dom::bindings::cell::DomRefCell;
use crate::dom::bindings::codegen::Bindings::GPUCommandEncoderBinding::{
self, GPUCommandBufferDescriptor, GPUCommandEncoderMethods, GPUComputePassDescriptor,
GPUCommandBufferDescriptor, GPUCommandEncoderMethods, GPUComputePassDescriptor,
};
use crate::dom::bindings::reflector::DomObject;
use crate::dom::bindings::reflector::{reflect_dom_object, Reflector};
@ -48,7 +48,6 @@ impl GPUCommandEncoder {
reflect_dom_object(
Box::new(GPUCommandEncoder::new_inherited(channel, encoder)),
global,
GPUCommandEncoderBinding::Wrap,
)
}
}

View file

@ -3,9 +3,7 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
use crate::dom::bindings::cell::DomRefCell;
use crate::dom::bindings::codegen::Bindings::GPUComputePassEncoderBinding::{
self, GPUComputePassEncoderMethods,
};
use crate::dom::bindings::codegen::Bindings::GPUComputePassEncoderBinding::GPUComputePassEncoderMethods;
use crate::dom::bindings::reflector::{reflect_dom_object, Reflector};
use crate::dom::bindings::root::DomRoot;
use crate::dom::bindings::str::DOMString;
@ -53,7 +51,6 @@ impl GPUComputePassEncoder {
reflect_dom_object(
Box::new(GPUComputePassEncoder::new_inherited(channel, parent)),
global,
GPUComputePassEncoderBinding::Wrap,
)
}
}

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