mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
Add trait DomObjectWrap to provide WRAP function
This commit is contained in:
parent
ca29399bab
commit
3ea6d87bcc
353 changed files with 327 additions and 1236 deletions
|
@ -6,7 +6,7 @@ use crate::dom::audionode::AudioNode;
|
||||||
use crate::dom::baseaudiocontext::BaseAudioContext;
|
use crate::dom::baseaudiocontext::BaseAudioContext;
|
||||||
use crate::dom::bindings::cell::DomRefCell;
|
use crate::dom::bindings::cell::DomRefCell;
|
||||||
use crate::dom::bindings::codegen::Bindings::AnalyserNodeBinding::{
|
use crate::dom::bindings::codegen::Bindings::AnalyserNodeBinding::{
|
||||||
self, AnalyserNodeMethods, AnalyserOptions,
|
AnalyserNodeMethods, AnalyserOptions,
|
||||||
};
|
};
|
||||||
use crate::dom::bindings::codegen::Bindings::AudioNodeBinding::{
|
use crate::dom::bindings::codegen::Bindings::AudioNodeBinding::{
|
||||||
ChannelCountMode, ChannelInterpretation,
|
ChannelCountMode, ChannelInterpretation,
|
||||||
|
@ -96,7 +96,7 @@ impl AnalyserNode {
|
||||||
options: &AnalyserOptions,
|
options: &AnalyserOptions,
|
||||||
) -> Fallible<DomRoot<AnalyserNode>> {
|
) -> Fallible<DomRoot<AnalyserNode>> {
|
||||||
let (node, recv) = AnalyserNode::new_inherited(window, context, options)?;
|
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
|
let (source, canceller) = window
|
||||||
.task_manager()
|
.task_manager()
|
||||||
.dom_manipulation_task_source_with_canceller();
|
.dom_manipulation_task_source_with_canceller();
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
use crate::dom::bindings::cell::{DomRefCell, Ref};
|
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::inheritance::Castable;
|
||||||
use crate::dom::bindings::root::{DomRoot, LayoutDom, MutNullableDom};
|
use crate::dom::bindings::root::{DomRoot, LayoutDom, MutNullableDom};
|
||||||
use crate::dom::bindings::str::DOMString;
|
use crate::dom::bindings::str::DOMString;
|
||||||
|
@ -70,7 +70,6 @@ impl Attr {
|
||||||
document, local_name, value, name, namespace, prefix, owner,
|
document, local_name, value, name, namespace, prefix, owner,
|
||||||
)),
|
)),
|
||||||
document,
|
document,
|
||||||
AttrBinding::Wrap,
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
use crate::dom::audionode::MAX_CHANNEL_COUNT;
|
use crate::dom::audionode::MAX_CHANNEL_COUNT;
|
||||||
use crate::dom::bindings::cell::{DomRefCell, Ref};
|
use crate::dom::bindings::cell::{DomRefCell, Ref};
|
||||||
use crate::dom::bindings::codegen::Bindings::AudioBufferBinding::{
|
use crate::dom::bindings::codegen::Bindings::AudioBufferBinding::{
|
||||||
self, AudioBufferMethods, AudioBufferOptions,
|
AudioBufferMethods, AudioBufferOptions,
|
||||||
};
|
};
|
||||||
use crate::dom::bindings::error::{Error, Fallible};
|
use crate::dom::bindings::error::{Error, Fallible};
|
||||||
use crate::dom::bindings::num::Finite;
|
use crate::dom::bindings::num::Finite;
|
||||||
|
@ -84,7 +84,7 @@ impl AudioBuffer {
|
||||||
initial_data: Option<&[Vec<f32>]>,
|
initial_data: Option<&[Vec<f32>]>,
|
||||||
) -> DomRoot<AudioBuffer> {
|
) -> DomRoot<AudioBuffer> {
|
||||||
let buffer = AudioBuffer::new_inherited(number_of_channels, length, sample_rate);
|
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.set_initial_data(initial_data);
|
||||||
buffer
|
buffer
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,7 +6,6 @@ use crate::dom::audiobuffer::AudioBuffer;
|
||||||
use crate::dom::audioparam::AudioParam;
|
use crate::dom::audioparam::AudioParam;
|
||||||
use crate::dom::audioscheduledsourcenode::AudioScheduledSourceNode;
|
use crate::dom::audioscheduledsourcenode::AudioScheduledSourceNode;
|
||||||
use crate::dom::baseaudiocontext::BaseAudioContext;
|
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::AudioBufferSourceNodeMethods;
|
||||||
use crate::dom::bindings::codegen::Bindings::AudioBufferSourceNodeBinding::AudioBufferSourceOptions;
|
use crate::dom::bindings::codegen::Bindings::AudioBufferSourceNodeBinding::AudioBufferSourceOptions;
|
||||||
use crate::dom::bindings::codegen::Bindings::AudioParamBinding::AutomationRate;
|
use crate::dom::bindings::codegen::Bindings::AudioParamBinding::AutomationRate;
|
||||||
|
@ -100,11 +99,7 @@ impl AudioBufferSourceNode {
|
||||||
options: &AudioBufferSourceOptions,
|
options: &AudioBufferSourceOptions,
|
||||||
) -> Fallible<DomRoot<AudioBufferSourceNode>> {
|
) -> Fallible<DomRoot<AudioBufferSourceNode>> {
|
||||||
let node = AudioBufferSourceNode::new_inherited(window, context, options)?;
|
let node = AudioBufferSourceNode::new_inherited(window, context, options)?;
|
||||||
Ok(reflect_dom_object(
|
Ok(reflect_dom_object(Box::new(node), window))
|
||||||
Box::new(node),
|
|
||||||
window,
|
|
||||||
AudioBufferSourceNodeBinding::Wrap,
|
|
||||||
))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(non_snake_case)]
|
#[allow(non_snake_case)]
|
||||||
|
|
|
@ -3,7 +3,6 @@
|
||||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
use crate::dom::baseaudiocontext::{BaseAudioContext, BaseAudioContextOptions};
|
use crate::dom::baseaudiocontext::{BaseAudioContext, BaseAudioContextOptions};
|
||||||
use crate::dom::bindings::codegen::Bindings::AudioContextBinding;
|
|
||||||
use crate::dom::bindings::codegen::Bindings::AudioContextBinding::{
|
use crate::dom::bindings::codegen::Bindings::AudioContextBinding::{
|
||||||
AudioContextLatencyCategory, AudioContextMethods,
|
AudioContextLatencyCategory, AudioContextMethods,
|
||||||
};
|
};
|
||||||
|
@ -77,7 +76,7 @@ impl AudioContext {
|
||||||
pub fn new(window: &Window, options: &AudioContextOptions) -> DomRoot<AudioContext> {
|
pub fn new(window: &Window, options: &AudioContextOptions) -> DomRoot<AudioContext> {
|
||||||
let pipeline_id = window.pipeline_id();
|
let pipeline_id = window.pipeline_id();
|
||||||
let context = AudioContext::new_inherited(options, 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.resume();
|
||||||
context
|
context
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,9 +4,7 @@
|
||||||
|
|
||||||
use crate::dom::audionode::{AudioNode, MAX_CHANNEL_COUNT};
|
use crate::dom::audionode::{AudioNode, MAX_CHANNEL_COUNT};
|
||||||
use crate::dom::baseaudiocontext::BaseAudioContext;
|
use crate::dom::baseaudiocontext::BaseAudioContext;
|
||||||
use crate::dom::bindings::codegen::Bindings::AudioDestinationNodeBinding::{
|
use crate::dom::bindings::codegen::Bindings::AudioDestinationNodeBinding::AudioDestinationNodeMethods;
|
||||||
self, AudioDestinationNodeMethods,
|
|
||||||
};
|
|
||||||
use crate::dom::bindings::codegen::Bindings::AudioNodeBinding::AudioNodeOptions;
|
use crate::dom::bindings::codegen::Bindings::AudioNodeBinding::AudioNodeOptions;
|
||||||
use crate::dom::bindings::codegen::Bindings::AudioNodeBinding::{
|
use crate::dom::bindings::codegen::Bindings::AudioNodeBinding::{
|
||||||
ChannelCountMode, ChannelInterpretation,
|
ChannelCountMode, ChannelInterpretation,
|
||||||
|
@ -46,7 +44,7 @@ impl AudioDestinationNode {
|
||||||
options: &AudioNodeOptions,
|
options: &AudioNodeOptions,
|
||||||
) -> DomRoot<AudioDestinationNode> {
|
) -> DomRoot<AudioDestinationNode> {
|
||||||
let node = AudioDestinationNode::new_inherited(context, options);
|
let node = AudioDestinationNode::new_inherited(context, options);
|
||||||
reflect_dom_object(Box::new(node), global, AudioDestinationNodeBinding::Wrap)
|
reflect_dom_object(Box::new(node), global)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
use crate::dom::audioparam::AudioParam;
|
use crate::dom::audioparam::AudioParam;
|
||||||
use crate::dom::baseaudiocontext::BaseAudioContext;
|
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::codegen::Bindings::AudioParamBinding::AutomationRate;
|
||||||
use crate::dom::bindings::error::Fallible;
|
use crate::dom::bindings::error::Fallible;
|
||||||
use crate::dom::bindings::num::Finite;
|
use crate::dom::bindings::num::Finite;
|
||||||
|
@ -143,7 +143,7 @@ impl AudioListener {
|
||||||
#[allow(unrooted_must_root)]
|
#[allow(unrooted_must_root)]
|
||||||
pub fn new(window: &Window, context: &BaseAudioContext) -> DomRoot<AudioListener> {
|
pub fn new(window: &Window, context: &BaseAudioContext) -> DomRoot<AudioListener> {
|
||||||
let node = AudioListener::new_inherited(window, context);
|
let node = AudioListener::new_inherited(window, context);
|
||||||
reflect_dom_object(Box::new(node), window, AudioListenerBinding::Wrap)
|
reflect_dom_object(Box::new(node), window)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,6 @@
|
||||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
use crate::dom::baseaudiocontext::BaseAudioContext;
|
use crate::dom::baseaudiocontext::BaseAudioContext;
|
||||||
use crate::dom::bindings::codegen::Bindings::AudioParamBinding;
|
|
||||||
use crate::dom::bindings::codegen::Bindings::AudioParamBinding::{
|
use crate::dom::bindings::codegen::Bindings::AudioParamBinding::{
|
||||||
AudioParamMethods, AutomationRate,
|
AudioParamMethods, AutomationRate,
|
||||||
};
|
};
|
||||||
|
@ -75,7 +74,7 @@ impl AudioParam {
|
||||||
min_value,
|
min_value,
|
||||||
max_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) {
|
fn message_node(&self, message: AudioNodeMessage) {
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
use crate::dom::audiotracklist::AudioTrackList;
|
use crate::dom::audiotracklist::AudioTrackList;
|
||||||
use crate::dom::bindings::cell::DomRefCell;
|
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::reflector::{reflect_dom_object, Reflector};
|
||||||
use crate::dom::bindings::root::{Dom, DomRoot};
|
use crate::dom::bindings::root::{Dom, DomRoot};
|
||||||
use crate::dom::bindings::str::DOMString;
|
use crate::dom::bindings::str::DOMString;
|
||||||
|
@ -55,7 +55,6 @@ impl AudioTrack {
|
||||||
id, kind, label, language, track_list,
|
id, kind, label, language, track_list,
|
||||||
)),
|
)),
|
||||||
window,
|
window,
|
||||||
AudioTrackBinding::Wrap,
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
use crate::dom::audiotrack::AudioTrack;
|
use crate::dom::audiotrack::AudioTrack;
|
||||||
use crate::dom::bindings::cell::DomRefCell;
|
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::inheritance::Castable;
|
||||||
use crate::dom::bindings::refcounted::Trusted;
|
use crate::dom::bindings::refcounted::Trusted;
|
||||||
use crate::dom::bindings::reflector::{reflect_dom_object, DomObject};
|
use crate::dom::bindings::reflector::{reflect_dom_object, DomObject};
|
||||||
|
@ -43,7 +43,6 @@ impl AudioTrackList {
|
||||||
reflect_dom_object(
|
reflect_dom_object(
|
||||||
Box::new(AudioTrackList::new_inherited(tracks, media_element)),
|
Box::new(AudioTrackList::new_inherited(tracks, media_element)),
|
||||||
window,
|
window,
|
||||||
AudioTrackListBinding::Wrap,
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,6 @@
|
||||||
#![allow(dead_code)]
|
#![allow(dead_code)]
|
||||||
|
|
||||||
use crate::dom::bindings::cell::DomRefCell;
|
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::BeforeUnloadEventBinding::BeforeUnloadEventMethods;
|
||||||
use crate::dom::bindings::codegen::Bindings::EventBinding::EventMethods;
|
use crate::dom::bindings::codegen::Bindings::EventBinding::EventMethods;
|
||||||
use crate::dom::bindings::inheritance::Castable;
|
use crate::dom::bindings::inheritance::Castable;
|
||||||
|
@ -33,11 +32,7 @@ impl BeforeUnloadEvent {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn new_uninitialized(window: &Window) -> DomRoot<BeforeUnloadEvent> {
|
pub fn new_uninitialized(window: &Window) -> DomRoot<BeforeUnloadEvent> {
|
||||||
reflect_dom_object(
|
reflect_dom_object(Box::new(BeforeUnloadEvent::new_inherited()), window)
|
||||||
Box::new(BeforeUnloadEvent::new_inherited()),
|
|
||||||
window,
|
|
||||||
BeforeUnloadEventBinding::Wrap,
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn new(
|
pub fn new(
|
||||||
|
|
|
@ -2858,6 +2858,50 @@ impl PartialEq for %(name)s {
|
||||||
""" % {'check': check, 'name': name}
|
""" % {'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):
|
class CGAbstractExternMethod(CGAbstractMethod):
|
||||||
"""
|
"""
|
||||||
Abstract base class for codegen of implementation-only (no
|
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::namespace::create_namespace_object',
|
||||||
'crate::dom::bindings::reflector::MutDomObject',
|
'crate::dom::bindings::reflector::MutDomObject',
|
||||||
'crate::dom::bindings::reflector::DomObject',
|
'crate::dom::bindings::reflector::DomObject',
|
||||||
|
'crate::dom::bindings::reflector::DomObjectWrap',
|
||||||
|
'crate::dom::bindings::reflector::DomObjectIteratorWrap',
|
||||||
'crate::dom::bindings::root::Dom',
|
'crate::dom::bindings::root::Dom',
|
||||||
'crate::dom::bindings::root::DomRoot',
|
'crate::dom::bindings::root::DomRoot',
|
||||||
'crate::dom::bindings::root::DomSlice',
|
'crate::dom::bindings::root::DomSlice',
|
||||||
|
@ -6286,6 +6332,10 @@ class CGDescriptor(CGThing):
|
||||||
cgThings.append(CGWrapGlobalMethod(descriptor, properties))
|
cgThings.append(CGWrapGlobalMethod(descriptor, properties))
|
||||||
else:
|
else:
|
||||||
cgThings.append(CGWrapMethod(descriptor))
|
cgThings.append(CGWrapMethod(descriptor))
|
||||||
|
if descriptor.interface.isIteratorInterface():
|
||||||
|
cgThings.append(CGDomObjectIteratorWrap(descriptor))
|
||||||
|
else:
|
||||||
|
cgThings.append(CGDomObjectWrap(descriptor))
|
||||||
reexports.append('Wrap')
|
reexports.append('Wrap')
|
||||||
|
|
||||||
haveUnscopables = False
|
haveUnscopables = False
|
||||||
|
@ -7445,9 +7495,7 @@ class CGIterableMethodGenerator(CGGeneric):
|
||||||
return
|
return
|
||||||
CGGeneric.__init__(self, fill(
|
CGGeneric.__init__(self, fill(
|
||||||
"""
|
"""
|
||||||
let result = ${iterClass}::new(&*this,
|
let result = ${iterClass}::new(&*this, IteratorType::${itrMethod});
|
||||||
IteratorType::${itrMethod},
|
|
||||||
super::${ifaceName}IteratorBinding::Wrap);
|
|
||||||
""",
|
""",
|
||||||
iterClass=iteratorNativeType(descriptor, True),
|
iterClass=iteratorNativeType(descriptor, True),
|
||||||
ifaceName=descriptor.interface.identifier.name,
|
ifaceName=descriptor.interface.identifier.name,
|
||||||
|
|
|
@ -9,8 +9,10 @@
|
||||||
use crate::dom::bindings::codegen::Bindings::IterableIteratorBinding::IterableKeyAndValueResult;
|
use crate::dom::bindings::codegen::Bindings::IterableIteratorBinding::IterableKeyAndValueResult;
|
||||||
use crate::dom::bindings::codegen::Bindings::IterableIteratorBinding::IterableKeyOrValueResult;
|
use crate::dom::bindings::codegen::Bindings::IterableIteratorBinding::IterableKeyOrValueResult;
|
||||||
use crate::dom::bindings::error::Fallible;
|
use crate::dom::bindings::error::Fallible;
|
||||||
use crate::dom::bindings::reflector::{reflect_dom_object, DomObject, Reflector};
|
use crate::dom::bindings::reflector::{
|
||||||
use crate::dom::bindings::root::{Dom, DomRoot};
|
reflect_dom_object, DomObjectIteratorWrap, DomObjectWrap, Reflector,
|
||||||
|
};
|
||||||
|
use crate::dom::bindings::root::{Dom, DomRoot, Root};
|
||||||
use crate::dom::bindings::trace::{JSTraceable, RootedTraceableBox};
|
use crate::dom::bindings::trace::{JSTraceable, RootedTraceableBox};
|
||||||
use crate::dom::globalscope::GlobalScope;
|
use crate::dom::globalscope::GlobalScope;
|
||||||
use crate::script_runtime::JSContext;
|
use crate::script_runtime::JSContext;
|
||||||
|
@ -51,27 +53,23 @@ pub trait Iterable {
|
||||||
/// An iterator over the iterable entries of a given DOM interface.
|
/// An iterator over the iterable entries of a given DOM interface.
|
||||||
//FIXME: #12811 prevents dom_struct with type parameters
|
//FIXME: #12811 prevents dom_struct with type parameters
|
||||||
#[dom_struct]
|
#[dom_struct]
|
||||||
pub struct IterableIterator<T: DomObject + JSTraceable + Iterable> {
|
pub struct IterableIterator<T: DomObjectIteratorWrap + JSTraceable + Iterable> {
|
||||||
reflector: Reflector,
|
reflector: Reflector,
|
||||||
iterable: Dom<T>,
|
iterable: Dom<T>,
|
||||||
type_: IteratorType,
|
type_: IteratorType,
|
||||||
index: Cell<u32>,
|
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.
|
/// Create a new iterator instance for the provided iterable DOM interface.
|
||||||
pub fn new(
|
pub fn new(iterable: &T, type_: IteratorType) -> DomRoot<Self> {
|
||||||
iterable: &T,
|
|
||||||
type_: IteratorType,
|
|
||||||
wrap: unsafe fn(JSContext, &GlobalScope, Box<IterableIterator<T>>) -> DomRoot<Self>,
|
|
||||||
) -> DomRoot<Self> {
|
|
||||||
let iterator = Box::new(IterableIterator {
|
let iterator = Box::new(IterableIterator {
|
||||||
reflector: Reflector::new(),
|
reflector: Reflector::new(),
|
||||||
type_: type_,
|
type_: type_,
|
||||||
iterable: Dom::from_ref(iterable),
|
iterable: Dom::from_ref(iterable),
|
||||||
index: Cell::new(0),
|
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.
|
/// 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(
|
fn dict_return(
|
||||||
cx: JSContext,
|
cx: JSContext,
|
||||||
mut result: MutableHandleObject,
|
mut result: MutableHandleObject,
|
||||||
|
|
|
@ -5,7 +5,8 @@
|
||||||
//! The `Reflector` struct.
|
//! The `Reflector` struct.
|
||||||
|
|
||||||
use crate::dom::bindings::conversions::DerivedFrom;
|
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::bindings::trace::JSTraceable;
|
||||||
use crate::dom::globalscope::GlobalScope;
|
use crate::dom::globalscope::GlobalScope;
|
||||||
use crate::script_runtime::JSContext;
|
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
|
/// Create the reflector for a new DOM object and yield ownership to the
|
||||||
/// reflector.
|
/// reflector.
|
||||||
pub fn reflect_dom_object<T, U>(
|
pub fn reflect_dom_object<T, U>(obj: Box<T>, global: &U) -> DomRoot<T>
|
||||||
obj: Box<T>,
|
|
||||||
global: &U,
|
|
||||||
wrap_fn: unsafe fn(JSContext, &GlobalScope, Box<T>) -> DomRoot<T>,
|
|
||||||
) -> DomRoot<T>
|
|
||||||
where
|
where
|
||||||
T: DomObject,
|
T: DomObject + DomObjectWrap,
|
||||||
U: DerivedFrom<GlobalScope>,
|
U: DerivedFrom<GlobalScope>,
|
||||||
{
|
{
|
||||||
let global_scope = global.upcast();
|
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.
|
/// 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)
|
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>>>;
|
||||||
|
}
|
||||||
|
|
|
@ -9,11 +9,9 @@ use crate::dom::bindings::codegen::Bindings::AudioNodeBinding::{
|
||||||
ChannelCountMode, ChannelInterpretation,
|
ChannelCountMode, ChannelInterpretation,
|
||||||
};
|
};
|
||||||
use crate::dom::bindings::codegen::Bindings::AudioParamBinding::AutomationRate;
|
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::BiquadFilterOptions;
|
||||||
use crate::dom::bindings::codegen::Bindings::BiquadFilterNodeBinding::BiquadFilterType;
|
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::error::Fallible;
|
||||||
use crate::dom::bindings::reflector::reflect_dom_object;
|
use crate::dom::bindings::reflector::reflect_dom_object;
|
||||||
use crate::dom::bindings::root::{Dom, DomRoot};
|
use crate::dom::bindings::root::{Dom, DomRoot};
|
||||||
|
@ -113,11 +111,7 @@ impl BiquadFilterNode {
|
||||||
options: &BiquadFilterOptions,
|
options: &BiquadFilterOptions,
|
||||||
) -> Fallible<DomRoot<BiquadFilterNode>> {
|
) -> Fallible<DomRoot<BiquadFilterNode>> {
|
||||||
let node = BiquadFilterNode::new_inherited(window, context, options)?;
|
let node = BiquadFilterNode::new_inherited(window, context, options)?;
|
||||||
Ok(reflect_dom_object(
|
Ok(reflect_dom_object(Box::new(node), window))
|
||||||
Box::new(node),
|
|
||||||
window,
|
|
||||||
BiquadFilterNodeBinding::Wrap,
|
|
||||||
))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(non_snake_case)]
|
#[allow(non_snake_case)]
|
||||||
|
|
|
@ -40,7 +40,6 @@ impl Blob {
|
||||||
blob_id: blob_impl.blob_id(),
|
blob_id: blob_impl.blob_id(),
|
||||||
}),
|
}),
|
||||||
global,
|
global,
|
||||||
BlobBinding::Wrap,
|
|
||||||
);
|
);
|
||||||
global.track_blob(&dom_blob, blob_impl);
|
global.track_blob(&dom_blob, blob_impl);
|
||||||
dom_blob
|
dom_blob
|
||||||
|
|
|
@ -9,7 +9,7 @@ use bluetooth_traits::scanfilter::{BluetoothScanfilter, BluetoothScanfilterSeque
|
||||||
use bluetooth_traits::scanfilter::{RequestDeviceoptions, ServiceUUIDSequence};
|
use bluetooth_traits::scanfilter::{RequestDeviceoptions, ServiceUUIDSequence};
|
||||||
use crate::realms::{AlreadyInRealm, InRealm};
|
use crate::realms::{AlreadyInRealm, InRealm};
|
||||||
use crate::dom::bindings::cell::{DomRefCell, Ref};
|
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::{BluetoothMethods, RequestDeviceOptions};
|
||||||
use crate::dom::bindings::codegen::Bindings::BluetoothBinding::BluetoothLEScanFilterInit;
|
use crate::dom::bindings::codegen::Bindings::BluetoothBinding::BluetoothLEScanFilterInit;
|
||||||
use crate::dom::bindings::codegen::Bindings::BluetoothPermissionResultBinding::BluetoothPermissionDescriptor;
|
use crate::dom::bindings::codegen::Bindings::BluetoothPermissionResultBinding::BluetoothPermissionDescriptor;
|
||||||
|
@ -144,11 +144,7 @@ impl Bluetooth {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn new(global: &GlobalScope) -> DomRoot<Bluetooth> {
|
pub fn new(global: &GlobalScope) -> DomRoot<Bluetooth> {
|
||||||
reflect_dom_object(
|
reflect_dom_object(Box::new(Bluetooth::new_inherited()), global)
|
||||||
Box::new(Bluetooth::new_inherited()),
|
|
||||||
global,
|
|
||||||
BluetoothBinding::Wrap,
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn get_bluetooth_thread(&self) -> IpcSender<BluetoothRequest> {
|
fn get_bluetooth_thread(&self) -> IpcSender<BluetoothRequest> {
|
||||||
|
|
|
@ -2,10 +2,8 @@
|
||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
* 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/. */
|
* 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::BluetoothAdvertisingEventMethods;
|
||||||
use crate::dom::bindings::codegen::Bindings::BluetoothAdvertisingEventBinding::{
|
|
||||||
self, BluetoothAdvertisingEventInit,
|
|
||||||
};
|
|
||||||
use crate::dom::bindings::codegen::Bindings::EventBinding::EventBinding::EventMethods;
|
use crate::dom::bindings::codegen::Bindings::EventBinding::EventBinding::EventMethods;
|
||||||
use crate::dom::bindings::error::Fallible;
|
use crate::dom::bindings::error::Fallible;
|
||||||
use crate::dom::bindings::inheritance::Castable;
|
use crate::dom::bindings::inheritance::Castable;
|
||||||
|
@ -65,7 +63,6 @@ impl BluetoothAdvertisingEvent {
|
||||||
device, name, appearance, txPower, rssi,
|
device, name, appearance, txPower, rssi,
|
||||||
)),
|
)),
|
||||||
global,
|
global,
|
||||||
BluetoothAdvertisingEventBinding::Wrap,
|
|
||||||
);
|
);
|
||||||
{
|
{
|
||||||
let event = ev.upcast::<Event>();
|
let event = ev.upcast::<Event>();
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
* 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/. */
|
* 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::codegen::Bindings::BluetoothCharacteristicPropertiesBinding::BluetoothCharacteristicPropertiesMethods;
|
||||||
use crate::dom::bindings::reflector::{reflect_dom_object, Reflector};
|
use crate::dom::bindings::reflector::{reflect_dom_object, Reflector};
|
||||||
use crate::dom::bindings::root::DomRoot;
|
use crate::dom::bindings::root::DomRoot;
|
||||||
|
@ -76,7 +75,6 @@ impl BluetoothCharacteristicProperties {
|
||||||
writableAuxiliaries,
|
writableAuxiliaries,
|
||||||
)),
|
)),
|
||||||
global,
|
global,
|
||||||
BluetoothCharacteristicPropertiesBinding::Wrap,
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,7 +3,6 @@
|
||||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
use crate::dom::bindings::cell::DomRefCell;
|
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::BluetoothDeviceBinding::BluetoothDeviceMethods;
|
||||||
use crate::dom::bindings::codegen::Bindings::BluetoothRemoteGATTServerBinding::BluetoothRemoteGATTServerMethods;
|
use crate::dom::bindings::codegen::Bindings::BluetoothRemoteGATTServerBinding::BluetoothRemoteGATTServerMethods;
|
||||||
use crate::dom::bindings::error::Error;
|
use crate::dom::bindings::error::Error;
|
||||||
|
@ -77,7 +76,6 @@ impl BluetoothDevice {
|
||||||
reflect_dom_object(
|
reflect_dom_object(
|
||||||
Box::new(BluetoothDevice::new_inherited(id, name, context)),
|
Box::new(BluetoothDevice::new_inherited(id, name, context)),
|
||||||
global,
|
global,
|
||||||
BluetoothDeviceBinding::Wrap,
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3,9 +3,7 @@
|
||||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
use crate::dom::bindings::cell::DomRefCell;
|
use crate::dom::bindings::cell::DomRefCell;
|
||||||
use crate::dom::bindings::codegen::Bindings::BluetoothPermissionResultBinding::{
|
use crate::dom::bindings::codegen::Bindings::BluetoothPermissionResultBinding::BluetoothPermissionResultMethods;
|
||||||
self, BluetoothPermissionResultMethods,
|
|
||||||
};
|
|
||||||
use crate::dom::bindings::codegen::Bindings::NavigatorBinding::NavigatorBinding::NavigatorMethods;
|
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::PermissionStatusBinding::PermissionStatusMethods;
|
||||||
use crate::dom::bindings::codegen::Bindings::PermissionStatusBinding::{
|
use crate::dom::bindings::codegen::Bindings::PermissionStatusBinding::{
|
||||||
|
@ -51,7 +49,6 @@ impl BluetoothPermissionResult {
|
||||||
reflect_dom_object(
|
reflect_dom_object(
|
||||||
Box::new(BluetoothPermissionResult::new_inherited(status)),
|
Box::new(BluetoothPermissionResult::new_inherited(status)),
|
||||||
global,
|
global,
|
||||||
BluetoothPermissionResultBinding::Wrap,
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,6 @@
|
||||||
|
|
||||||
use crate::dom::bindings::cell::DomRefCell;
|
use crate::dom::bindings::cell::DomRefCell;
|
||||||
use crate::dom::bindings::codegen::Bindings::BluetoothCharacteristicPropertiesBinding::BluetoothCharacteristicPropertiesMethods;
|
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::BluetoothRemoteGATTCharacteristicBinding::BluetoothRemoteGATTCharacteristicMethods;
|
||||||
use crate::dom::bindings::codegen::Bindings::BluetoothRemoteGATTServerBinding::BluetoothRemoteGATTServerMethods;
|
use crate::dom::bindings::codegen::Bindings::BluetoothRemoteGATTServerBinding::BluetoothRemoteGATTServerMethods;
|
||||||
use crate::dom::bindings::codegen::Bindings::BluetoothRemoteGATTServiceBinding::BluetoothRemoteGATTServiceMethods;
|
use crate::dom::bindings::codegen::Bindings::BluetoothRemoteGATTServiceBinding::BluetoothRemoteGATTServiceMethods;
|
||||||
|
@ -77,7 +76,6 @@ impl BluetoothRemoteGATTCharacteristic {
|
||||||
instance_id,
|
instance_id,
|
||||||
)),
|
)),
|
||||||
global,
|
global,
|
||||||
BluetoothRemoteGATTCharacteristicBinding::Wrap,
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,6 @@
|
||||||
|
|
||||||
use crate::dom::bindings::cell::DomRefCell;
|
use crate::dom::bindings::cell::DomRefCell;
|
||||||
use crate::dom::bindings::codegen::Bindings::BluetoothRemoteGATTCharacteristicBinding::BluetoothRemoteGATTCharacteristicMethods;
|
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::BluetoothRemoteGATTDescriptorBinding::BluetoothRemoteGATTDescriptorMethods;
|
||||||
use crate::dom::bindings::codegen::Bindings::BluetoothRemoteGATTServerBinding::BluetoothRemoteGATTServerMethods;
|
use crate::dom::bindings::codegen::Bindings::BluetoothRemoteGATTServerBinding::BluetoothRemoteGATTServerMethods;
|
||||||
use crate::dom::bindings::codegen::Bindings::BluetoothRemoteGATTServiceBinding::BluetoothRemoteGATTServiceMethods;
|
use crate::dom::bindings::codegen::Bindings::BluetoothRemoteGATTServiceBinding::BluetoothRemoteGATTServiceMethods;
|
||||||
|
@ -64,7 +63,6 @@ impl BluetoothRemoteGATTDescriptor {
|
||||||
instance_id,
|
instance_id,
|
||||||
)),
|
)),
|
||||||
global,
|
global,
|
||||||
BluetoothRemoteGATTDescriptorBinding::Wrap,
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,6 @@
|
||||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
* 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::BluetoothDeviceBinding::BluetoothDeviceMethods;
|
||||||
use crate::dom::bindings::codegen::Bindings::BluetoothRemoteGATTServerBinding;
|
|
||||||
use crate::dom::bindings::codegen::Bindings::BluetoothRemoteGATTServerBinding::BluetoothRemoteGATTServerMethods;
|
use crate::dom::bindings::codegen::Bindings::BluetoothRemoteGATTServerBinding::BluetoothRemoteGATTServerMethods;
|
||||||
use crate::dom::bindings::error::Error;
|
use crate::dom::bindings::error::Error;
|
||||||
use crate::dom::bindings::error::ErrorResult;
|
use crate::dom::bindings::error::ErrorResult;
|
||||||
|
@ -45,7 +44,6 @@ impl BluetoothRemoteGATTServer {
|
||||||
reflect_dom_object(
|
reflect_dom_object(
|
||||||
Box::new(BluetoothRemoteGATTServer::new_inherited(device)),
|
Box::new(BluetoothRemoteGATTServer::new_inherited(device)),
|
||||||
global,
|
global,
|
||||||
BluetoothRemoteGATTServerBinding::Wrap,
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,6 @@
|
||||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
* 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::BluetoothRemoteGATTServerBinding::BluetoothRemoteGATTServerMethods;
|
||||||
use crate::dom::bindings::codegen::Bindings::BluetoothRemoteGATTServiceBinding;
|
|
||||||
use crate::dom::bindings::codegen::Bindings::BluetoothRemoteGATTServiceBinding::BluetoothRemoteGATTServiceMethods;
|
use crate::dom::bindings::codegen::Bindings::BluetoothRemoteGATTServiceBinding::BluetoothRemoteGATTServiceMethods;
|
||||||
use crate::dom::bindings::error::Error;
|
use crate::dom::bindings::error::Error;
|
||||||
use crate::dom::bindings::reflector::reflect_dom_object;
|
use crate::dom::bindings::reflector::reflect_dom_object;
|
||||||
|
@ -58,7 +57,6 @@ impl BluetoothRemoteGATTService {
|
||||||
device, uuid, isPrimary, instanceID,
|
device, uuid, isPrimary, instanceID,
|
||||||
)),
|
)),
|
||||||
global,
|
global,
|
||||||
BluetoothRemoteGATTServiceBinding::Wrap,
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2,9 +2,7 @@
|
||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
* 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/. */
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
use crate::dom::bindings::codegen::Bindings::BroadcastChannelBinding::{
|
use crate::dom::bindings::codegen::Bindings::BroadcastChannelBinding::BroadcastChannelMethods;
|
||||||
BroadcastChannelMethods, Wrap,
|
|
||||||
};
|
|
||||||
use crate::dom::bindings::error::{Error, ErrorResult};
|
use crate::dom::bindings::error::{Error, ErrorResult};
|
||||||
use crate::dom::bindings::reflector::{reflect_dom_object, DomObject};
|
use crate::dom::bindings::reflector::{reflect_dom_object, DomObject};
|
||||||
use crate::dom::bindings::root::DomRoot;
|
use crate::dom::bindings::root::DomRoot;
|
||||||
|
@ -35,11 +33,7 @@ impl BroadcastChannel {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn new(global: &GlobalScope, name: DOMString) -> DomRoot<BroadcastChannel> {
|
pub fn new(global: &GlobalScope, name: DOMString) -> DomRoot<BroadcastChannel> {
|
||||||
let channel = reflect_dom_object(
|
let channel = reflect_dom_object(Box::new(BroadcastChannel::new_inherited(name)), global);
|
||||||
Box::new(BroadcastChannel::new_inherited(name)),
|
|
||||||
global,
|
|
||||||
Wrap,
|
|
||||||
);
|
|
||||||
global.track_broadcast_channel(&*channel);
|
global.track_broadcast_channel(&*channel);
|
||||||
channel
|
channel
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,7 +3,6 @@
|
||||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
use crate::dom::bindings::cell::DomRefCell;
|
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::codegen::Bindings::CanvasGradientBinding::CanvasGradientMethods;
|
||||||
use crate::dom::bindings::error::{Error, ErrorResult};
|
use crate::dom::bindings::error::{Error, ErrorResult};
|
||||||
use crate::dom::bindings::num::Finite;
|
use crate::dom::bindings::num::Finite;
|
||||||
|
@ -42,11 +41,7 @@ impl CanvasGradient {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn new(global: &GlobalScope, style: CanvasGradientStyle) -> DomRoot<CanvasGradient> {
|
pub fn new(global: &GlobalScope, style: CanvasGradientStyle) -> DomRoot<CanvasGradient> {
|
||||||
reflect_dom_object(
|
reflect_dom_object(Box::new(CanvasGradient::new_inherited(style)), global)
|
||||||
Box::new(CanvasGradient::new_inherited(style)),
|
|
||||||
global,
|
|
||||||
CanvasGradientBinding::Wrap,
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
* 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/. */
|
* 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::reflector::{reflect_dom_object, Reflector};
|
||||||
use crate::dom::bindings::root::DomRoot;
|
use crate::dom::bindings::root::DomRoot;
|
||||||
use crate::dom::canvasgradient::ToFillOrStrokeStyle;
|
use crate::dom::canvasgradient::ToFillOrStrokeStyle;
|
||||||
|
@ -60,7 +59,6 @@ impl CanvasPattern {
|
||||||
origin_clean,
|
origin_clean,
|
||||||
)),
|
)),
|
||||||
global,
|
global,
|
||||||
CanvasPatternBinding::Wrap,
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
pub fn origin_is_clean(&self) -> bool {
|
pub fn origin_is_clean(&self) -> bool {
|
||||||
|
|
|
@ -4,7 +4,6 @@
|
||||||
|
|
||||||
use crate::canvas_state::{CanvasContextState, CanvasState};
|
use crate::canvas_state::{CanvasContextState, CanvasState};
|
||||||
use crate::dom::bindings::cell::DomRefCell;
|
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::CanvasFillRule;
|
||||||
use crate::dom::bindings::codegen::Bindings::CanvasRenderingContext2DBinding::CanvasImageSource;
|
use crate::dom::bindings::codegen::Bindings::CanvasRenderingContext2DBinding::CanvasImageSource;
|
||||||
use crate::dom::bindings::codegen::Bindings::CanvasRenderingContext2DBinding::CanvasLineCap;
|
use crate::dom::bindings::codegen::Bindings::CanvasRenderingContext2DBinding::CanvasLineCap;
|
||||||
|
@ -67,7 +66,7 @@ impl CanvasRenderingContext2D {
|
||||||
Some(canvas),
|
Some(canvas),
|
||||||
size,
|
size,
|
||||||
));
|
));
|
||||||
reflect_dom_object(boxed, global, CanvasRenderingContext2DBinding::Wrap)
|
reflect_dom_object(boxed, global)
|
||||||
}
|
}
|
||||||
|
|
||||||
// https://html.spec.whatwg.org/multipage/#concept-canvas-set-bitmap-dimensions
|
// https://html.spec.whatwg.org/multipage/#concept-canvas-set-bitmap-dimensions
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
* 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/. */
|
* 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::root::DomRoot;
|
||||||
use crate::dom::bindings::str::DOMString;
|
use crate::dom::bindings::str::DOMString;
|
||||||
use crate::dom::document::Document;
|
use crate::dom::document::Document;
|
||||||
|
@ -26,7 +25,6 @@ impl CDATASection {
|
||||||
Node::reflect_node(
|
Node::reflect_node(
|
||||||
Box::new(CDATASection::new_inherited(text, document)),
|
Box::new(CDATASection::new_inherited(text, document)),
|
||||||
document,
|
document,
|
||||||
CDATASectionBinding::Wrap,
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,9 +7,7 @@ use crate::dom::baseaudiocontext::BaseAudioContext;
|
||||||
use crate::dom::bindings::codegen::Bindings::AudioNodeBinding::{
|
use crate::dom::bindings::codegen::Bindings::AudioNodeBinding::{
|
||||||
ChannelCountMode, ChannelInterpretation,
|
ChannelCountMode, ChannelInterpretation,
|
||||||
};
|
};
|
||||||
use crate::dom::bindings::codegen::Bindings::ChannelMergerNodeBinding::{
|
use crate::dom::bindings::codegen::Bindings::ChannelMergerNodeBinding::ChannelMergerOptions;
|
||||||
self, ChannelMergerOptions,
|
|
||||||
};
|
|
||||||
use crate::dom::bindings::error::{Error, Fallible};
|
use crate::dom::bindings::error::{Error, Fallible};
|
||||||
use crate::dom::bindings::reflector::reflect_dom_object;
|
use crate::dom::bindings::reflector::reflect_dom_object;
|
||||||
use crate::dom::bindings::root::DomRoot;
|
use crate::dom::bindings::root::DomRoot;
|
||||||
|
@ -61,11 +59,7 @@ impl ChannelMergerNode {
|
||||||
options: &ChannelMergerOptions,
|
options: &ChannelMergerOptions,
|
||||||
) -> Fallible<DomRoot<ChannelMergerNode>> {
|
) -> Fallible<DomRoot<ChannelMergerNode>> {
|
||||||
let node = ChannelMergerNode::new_inherited(window, context, options)?;
|
let node = ChannelMergerNode::new_inherited(window, context, options)?;
|
||||||
Ok(reflect_dom_object(
|
Ok(reflect_dom_object(Box::new(node), window))
|
||||||
Box::new(node),
|
|
||||||
window,
|
|
||||||
ChannelMergerNodeBinding::Wrap,
|
|
||||||
))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(non_snake_case)]
|
#[allow(non_snake_case)]
|
||||||
|
|
|
@ -7,9 +7,7 @@ use crate::dom::baseaudiocontext::BaseAudioContext;
|
||||||
use crate::dom::bindings::codegen::Bindings::AudioNodeBinding::{
|
use crate::dom::bindings::codegen::Bindings::AudioNodeBinding::{
|
||||||
ChannelCountMode, ChannelInterpretation,
|
ChannelCountMode, ChannelInterpretation,
|
||||||
};
|
};
|
||||||
use crate::dom::bindings::codegen::Bindings::ChannelSplitterNodeBinding::{
|
use crate::dom::bindings::codegen::Bindings::ChannelSplitterNodeBinding::ChannelSplitterOptions;
|
||||||
self, ChannelSplitterOptions,
|
|
||||||
};
|
|
||||||
use crate::dom::bindings::error::{Error, Fallible};
|
use crate::dom::bindings::error::{Error, Fallible};
|
||||||
use crate::dom::bindings::reflector::reflect_dom_object;
|
use crate::dom::bindings::reflector::reflect_dom_object;
|
||||||
use crate::dom::bindings::root::DomRoot;
|
use crate::dom::bindings::root::DomRoot;
|
||||||
|
@ -63,11 +61,7 @@ impl ChannelSplitterNode {
|
||||||
options: &ChannelSplitterOptions,
|
options: &ChannelSplitterOptions,
|
||||||
) -> Fallible<DomRoot<ChannelSplitterNode>> {
|
) -> Fallible<DomRoot<ChannelSplitterNode>> {
|
||||||
let node = ChannelSplitterNode::new_inherited(window, context, options)?;
|
let node = ChannelSplitterNode::new_inherited(window, context, options)?;
|
||||||
Ok(reflect_dom_object(
|
Ok(reflect_dom_object(Box::new(node), window))
|
||||||
Box::new(node),
|
|
||||||
window,
|
|
||||||
ChannelSplitterNodeBinding::Wrap,
|
|
||||||
))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(non_snake_case)]
|
#[allow(non_snake_case)]
|
||||||
|
|
|
@ -2,8 +2,8 @@
|
||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
* 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/. */
|
* 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::FrameType;
|
||||||
use crate::dom::bindings::codegen::Bindings::ClientBinding::{ClientMethods, Wrap};
|
|
||||||
use crate::dom::bindings::reflector::{reflect_dom_object, Reflector};
|
use crate::dom::bindings::reflector::{reflect_dom_object, Reflector};
|
||||||
use crate::dom::bindings::root::{DomRoot, MutNullableDom};
|
use crate::dom::bindings::root::{DomRoot, MutNullableDom};
|
||||||
use crate::dom::bindings::str::{DOMString, USVString};
|
use crate::dom::bindings::str::{DOMString, USVString};
|
||||||
|
@ -36,11 +36,7 @@ impl Client {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn new(window: &Window) -> DomRoot<Client> {
|
pub fn new(window: &Window) -> DomRoot<Client> {
|
||||||
reflect_dom_object(
|
reflect_dom_object(Box::new(Client::new_inherited(window.get_url())), window)
|
||||||
Box::new(Client::new_inherited(window.get_url())),
|
|
||||||
window,
|
|
||||||
Wrap,
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn creation_url(&self) -> ServoUrl {
|
pub fn creation_url(&self) -> ServoUrl {
|
||||||
|
|
|
@ -44,7 +44,7 @@ impl CloseEvent {
|
||||||
reason: DOMString,
|
reason: DOMString,
|
||||||
) -> DomRoot<CloseEvent> {
|
) -> DomRoot<CloseEvent> {
|
||||||
let event = Box::new(CloseEvent::new_inherited(wasClean, code, reason));
|
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>();
|
let event = ev.upcast::<Event>();
|
||||||
event.init_event(type_, bool::from(bubbles), bool::from(cancelable));
|
event.init_event(type_, bool::from(bubbles), bool::from(cancelable));
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
* 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/. */
|
* 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::codegen::Bindings::WindowBinding::WindowMethods;
|
||||||
use crate::dom::bindings::error::Fallible;
|
use crate::dom::bindings::error::Fallible;
|
||||||
use crate::dom::bindings::root::DomRoot;
|
use crate::dom::bindings::root::DomRoot;
|
||||||
|
@ -27,11 +26,7 @@ impl Comment {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn new(text: DOMString, document: &Document) -> DomRoot<Comment> {
|
pub fn new(text: DOMString, document: &Document) -> DomRoot<Comment> {
|
||||||
Node::reflect_node(
|
Node::reflect_node(Box::new(Comment::new_inherited(text, document)), document)
|
||||||
Box::new(Comment::new_inherited(text, document)),
|
|
||||||
document,
|
|
||||||
CommentBinding::Wrap,
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(non_snake_case)]
|
#[allow(non_snake_case)]
|
||||||
|
|
|
@ -29,11 +29,7 @@ impl CompositionEvent {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn new_uninitialized(window: &Window) -> DomRoot<CompositionEvent> {
|
pub fn new_uninitialized(window: &Window) -> DomRoot<CompositionEvent> {
|
||||||
reflect_dom_object(
|
reflect_dom_object(Box::new(CompositionEvent::new_inherited()), window)
|
||||||
Box::new(CompositionEvent::new_inherited()),
|
|
||||||
window,
|
|
||||||
CompositionEventBinding::Wrap,
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn new(
|
pub fn new(
|
||||||
|
@ -51,7 +47,6 @@ impl CompositionEvent {
|
||||||
data: data,
|
data: data,
|
||||||
}),
|
}),
|
||||||
window,
|
window,
|
||||||
CompositionEventBinding::Wrap,
|
|
||||||
);
|
);
|
||||||
ev.uievent
|
ev.uievent
|
||||||
.InitUIEvent(type_, can_bubble, cancelable, view, detail);
|
.InitUIEvent(type_, can_bubble, cancelable, view, detail);
|
||||||
|
|
|
@ -7,9 +7,7 @@ use crate::dom::audioscheduledsourcenode::AudioScheduledSourceNode;
|
||||||
use crate::dom::baseaudiocontext::BaseAudioContext;
|
use crate::dom::baseaudiocontext::BaseAudioContext;
|
||||||
use crate::dom::bindings::codegen::Bindings::AudioParamBinding::AutomationRate;
|
use crate::dom::bindings::codegen::Bindings::AudioParamBinding::AutomationRate;
|
||||||
use crate::dom::bindings::codegen::Bindings::ConstantSourceNodeBinding::ConstantSourceNodeMethods;
|
use crate::dom::bindings::codegen::Bindings::ConstantSourceNodeBinding::ConstantSourceNodeMethods;
|
||||||
use crate::dom::bindings::codegen::Bindings::ConstantSourceNodeBinding::{
|
use crate::dom::bindings::codegen::Bindings::ConstantSourceNodeBinding::ConstantSourceOptions;
|
||||||
self, ConstantSourceOptions,
|
|
||||||
};
|
|
||||||
use crate::dom::bindings::error::Fallible;
|
use crate::dom::bindings::error::Fallible;
|
||||||
use crate::dom::bindings::reflector::reflect_dom_object;
|
use crate::dom::bindings::reflector::reflect_dom_object;
|
||||||
use crate::dom::bindings::root::{Dom, DomRoot};
|
use crate::dom::bindings::root::{Dom, DomRoot};
|
||||||
|
@ -66,11 +64,7 @@ impl ConstantSourceNode {
|
||||||
options: &ConstantSourceOptions,
|
options: &ConstantSourceOptions,
|
||||||
) -> Fallible<DomRoot<ConstantSourceNode>> {
|
) -> Fallible<DomRoot<ConstantSourceNode>> {
|
||||||
let node = ConstantSourceNode::new_inherited(window, context, options)?;
|
let node = ConstantSourceNode::new_inherited(window, context, options)?;
|
||||||
Ok(reflect_dom_object(
|
Ok(reflect_dom_object(Box::new(node), window))
|
||||||
Box::new(node),
|
|
||||||
window,
|
|
||||||
ConstantSourceNodeBinding::Wrap,
|
|
||||||
))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(non_snake_case)]
|
#[allow(non_snake_case)]
|
||||||
|
|
|
@ -3,7 +3,6 @@
|
||||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
use crate::dom::bindings::cell::DomRefCell;
|
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::codegen::Bindings::CryptoBinding::CryptoMethods;
|
||||||
use crate::dom::bindings::error::{Error, Fallible};
|
use crate::dom::bindings::error::{Error, Fallible};
|
||||||
use crate::dom::bindings::reflector::{reflect_dom_object, Reflector};
|
use crate::dom::bindings::reflector::{reflect_dom_object, Reflector};
|
||||||
|
@ -37,11 +36,7 @@ impl Crypto {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn new(global: &GlobalScope) -> DomRoot<Crypto> {
|
pub fn new(global: &GlobalScope) -> DomRoot<Crypto> {
|
||||||
reflect_dom_object(
|
reflect_dom_object(Box::new(Crypto::new_inherited()), global)
|
||||||
Box::new(Crypto::new_inherited()),
|
|
||||||
global,
|
|
||||||
CryptoBinding::Wrap,
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
* 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/. */
|
* 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::reflector::reflect_dom_object;
|
||||||
use crate::dom::bindings::root::DomRoot;
|
use crate::dom::bindings::root::DomRoot;
|
||||||
use crate::dom::bindings::str::DOMString;
|
use crate::dom::bindings::str::DOMString;
|
||||||
|
@ -44,7 +43,6 @@ impl CSSFontFaceRule {
|
||||||
fontfacerule,
|
fontfacerule,
|
||||||
)),
|
)),
|
||||||
window,
|
window,
|
||||||
CSSFontFaceRuleBinding::Wrap,
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
* 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/. */
|
* 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::reflector::reflect_dom_object;
|
||||||
use crate::dom::bindings::root::DomRoot;
|
use crate::dom::bindings::root::DomRoot;
|
||||||
use crate::dom::bindings::str::DOMString;
|
use crate::dom::bindings::str::DOMString;
|
||||||
|
@ -41,7 +40,6 @@ impl CSSImportRule {
|
||||||
reflect_dom_object(
|
reflect_dom_object(
|
||||||
Box::new(Self::new_inherited(parent_stylesheet, import_rule)),
|
Box::new(Self::new_inherited(parent_stylesheet, import_rule)),
|
||||||
window,
|
window,
|
||||||
CSSImportRuleBinding::Wrap,
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,9 +2,7 @@
|
||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
* 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/. */
|
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
use crate::dom::bindings::codegen::Bindings::CSSKeyframeRuleBinding::{
|
use crate::dom::bindings::codegen::Bindings::CSSKeyframeRuleBinding::CSSKeyframeRuleMethods;
|
||||||
self, CSSKeyframeRuleMethods,
|
|
||||||
};
|
|
||||||
use crate::dom::bindings::inheritance::Castable;
|
use crate::dom::bindings::inheritance::Castable;
|
||||||
use crate::dom::bindings::reflector::{reflect_dom_object, DomObject};
|
use crate::dom::bindings::reflector::{reflect_dom_object, DomObject};
|
||||||
use crate::dom::bindings::root::{Dom, DomRoot, MutNullableDom};
|
use crate::dom::bindings::root::{Dom, DomRoot, MutNullableDom};
|
||||||
|
@ -50,7 +48,6 @@ impl CSSKeyframeRule {
|
||||||
keyframerule,
|
keyframerule,
|
||||||
)),
|
)),
|
||||||
window,
|
window,
|
||||||
CSSKeyframeRuleBinding::Wrap,
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
* 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/. */
|
* 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::codegen::Bindings::CSSKeyframesRuleBinding::CSSKeyframesRuleMethods;
|
||||||
use crate::dom::bindings::error::ErrorResult;
|
use crate::dom::bindings::error::ErrorResult;
|
||||||
use crate::dom::bindings::inheritance::Castable;
|
use crate::dom::bindings::inheritance::Castable;
|
||||||
|
@ -53,7 +52,6 @@ impl CSSKeyframesRule {
|
||||||
keyframesrule,
|
keyframesrule,
|
||||||
)),
|
)),
|
||||||
window,
|
window,
|
||||||
CSSKeyframesRuleBinding::Wrap,
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
* 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/. */
|
* 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::CSSMediaRuleBinding::CSSMediaRuleMethods;
|
||||||
use crate::dom::bindings::codegen::Bindings::WindowBinding::WindowBinding::WindowMethods;
|
use crate::dom::bindings::codegen::Bindings::WindowBinding::WindowBinding::WindowMethods;
|
||||||
use crate::dom::bindings::reflector::{reflect_dom_object, DomObject};
|
use crate::dom::bindings::reflector::{reflect_dom_object, DomObject};
|
||||||
|
@ -53,7 +52,6 @@ impl CSSMediaRule {
|
||||||
reflect_dom_object(
|
reflect_dom_object(
|
||||||
Box::new(CSSMediaRule::new_inherited(parent_stylesheet, mediarule)),
|
Box::new(CSSMediaRule::new_inherited(parent_stylesheet, mediarule)),
|
||||||
window,
|
window,
|
||||||
CSSMediaRuleBinding::Wrap,
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
* 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/. */
|
* 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::codegen::Bindings::CSSNamespaceRuleBinding::CSSNamespaceRuleMethods;
|
||||||
use crate::dom::bindings::reflector::reflect_dom_object;
|
use crate::dom::bindings::reflector::reflect_dom_object;
|
||||||
use crate::dom::bindings::root::DomRoot;
|
use crate::dom::bindings::root::DomRoot;
|
||||||
|
@ -45,7 +44,6 @@ impl CSSNamespaceRule {
|
||||||
namespacerule,
|
namespacerule,
|
||||||
)),
|
)),
|
||||||
window,
|
window,
|
||||||
CSSNamespaceRuleBinding::Wrap,
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,7 +3,6 @@
|
||||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
use crate::dom::bindings::cell::DomRefCell;
|
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::codegen::Bindings::CSSRuleListBinding::CSSRuleListMethods;
|
||||||
use crate::dom::bindings::error::{Error, ErrorResult, Fallible};
|
use crate::dom::bindings::error::{Error, ErrorResult, Fallible};
|
||||||
use crate::dom::bindings::inheritance::Castable;
|
use crate::dom::bindings::inheritance::Castable;
|
||||||
|
@ -86,7 +85,6 @@ impl CSSRuleList {
|
||||||
reflect_dom_object(
|
reflect_dom_object(
|
||||||
Box::new(CSSRuleList::new_inherited(parent_stylesheet, rules)),
|
Box::new(CSSRuleList::new_inherited(parent_stylesheet, rules)),
|
||||||
window,
|
window,
|
||||||
CSSRuleListBinding::Wrap,
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2,9 +2,7 @@
|
||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
* 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/. */
|
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
use crate::dom::bindings::codegen::Bindings::CSSStyleDeclarationBinding::{
|
use crate::dom::bindings::codegen::Bindings::CSSStyleDeclarationBinding::CSSStyleDeclarationMethods;
|
||||||
self, CSSStyleDeclarationMethods,
|
|
||||||
};
|
|
||||||
use crate::dom::bindings::codegen::Bindings::WindowBinding::WindowMethods;
|
use crate::dom::bindings::codegen::Bindings::WindowBinding::WindowMethods;
|
||||||
use crate::dom::bindings::error::{Error, ErrorResult, Fallible};
|
use crate::dom::bindings::error::{Error, ErrorResult, Fallible};
|
||||||
use crate::dom::bindings::inheritance::Castable;
|
use crate::dom::bindings::inheritance::Castable;
|
||||||
|
@ -233,7 +231,6 @@ impl CSSStyleDeclaration {
|
||||||
modification_access,
|
modification_access,
|
||||||
)),
|
)),
|
||||||
global,
|
global,
|
||||||
CSSStyleDeclarationBinding::Wrap,
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
* 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/. */
|
* 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::inheritance::Castable;
|
||||||
use crate::dom::bindings::reflector::{reflect_dom_object, DomObject};
|
use crate::dom::bindings::reflector::{reflect_dom_object, DomObject};
|
||||||
use crate::dom::bindings::root::{Dom, DomRoot, MutNullableDom};
|
use crate::dom::bindings::root::{Dom, DomRoot, MutNullableDom};
|
||||||
|
@ -51,7 +51,6 @@ impl CSSStyleRule {
|
||||||
reflect_dom_object(
|
reflect_dom_object(
|
||||||
Box::new(CSSStyleRule::new_inherited(parent_stylesheet, stylerule)),
|
Box::new(CSSStyleRule::new_inherited(parent_stylesheet, stylerule)),
|
||||||
window,
|
window,
|
||||||
CSSStyleRuleBinding::Wrap,
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
* 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/. */
|
* 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::codegen::Bindings::CSSStyleSheetBinding::CSSStyleSheetMethods;
|
||||||
use crate::dom::bindings::error::{Error, ErrorResult, Fallible};
|
use crate::dom::bindings::error::{Error, ErrorResult, Fallible};
|
||||||
use crate::dom::bindings::inheritance::Castable;
|
use crate::dom::bindings::inheritance::Castable;
|
||||||
|
@ -61,7 +60,6 @@ impl CSSStyleSheet {
|
||||||
owner, type_, href, title, stylesheet,
|
owner, type_, href, title, stylesheet,
|
||||||
)),
|
)),
|
||||||
window,
|
window,
|
||||||
CSSStyleSheetBinding::Wrap,
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,6 @@
|
||||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
* 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::CSSStyleValueMethods;
|
||||||
use crate::dom::bindings::codegen::Bindings::CSSStyleValueBinding::Wrap;
|
|
||||||
use crate::dom::bindings::reflector::reflect_dom_object;
|
use crate::dom::bindings::reflector::reflect_dom_object;
|
||||||
use crate::dom::bindings::reflector::Reflector;
|
use crate::dom::bindings::reflector::Reflector;
|
||||||
use crate::dom::bindings::root::DomRoot;
|
use crate::dom::bindings::root::DomRoot;
|
||||||
|
@ -29,7 +28,7 @@ impl CSSStyleValue {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn new(global: &GlobalScope, value: String) -> DomRoot<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)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
* 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/. */
|
* 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::codegen::Bindings::WindowBinding::WindowBinding::WindowMethods;
|
||||||
use crate::dom::bindings::reflector::{reflect_dom_object, DomObject};
|
use crate::dom::bindings::reflector::{reflect_dom_object, DomObject};
|
||||||
use crate::dom::bindings::root::DomRoot;
|
use crate::dom::bindings::root::DomRoot;
|
||||||
|
@ -52,7 +51,6 @@ impl CSSSupportsRule {
|
||||||
supportsrule,
|
supportsrule,
|
||||||
)),
|
)),
|
||||||
window,
|
window,
|
||||||
CSSSupportsRuleBinding::Wrap,
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
* 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/. */
|
* 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::reflector::reflect_dom_object;
|
||||||
use crate::dom::bindings::root::DomRoot;
|
use crate::dom::bindings::root::DomRoot;
|
||||||
use crate::dom::bindings::str::DOMString;
|
use crate::dom::bindings::str::DOMString;
|
||||||
|
@ -44,7 +43,6 @@ impl CSSViewportRule {
|
||||||
viewportrule,
|
viewportrule,
|
||||||
)),
|
)),
|
||||||
window,
|
window,
|
||||||
CSSViewportRuleBinding::Wrap,
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,7 +4,6 @@
|
||||||
|
|
||||||
use crate::dom::bindings::callback::{CallbackContainer, ExceptionHandling};
|
use crate::dom::bindings::callback::{CallbackContainer, ExceptionHandling};
|
||||||
use crate::dom::bindings::cell::DomRefCell;
|
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::CustomElementConstructor;
|
||||||
use crate::dom::bindings::codegen::Bindings::CustomElementRegistryBinding::CustomElementRegistryMethods;
|
use crate::dom::bindings::codegen::Bindings::CustomElementRegistryBinding::CustomElementRegistryMethods;
|
||||||
use crate::dom::bindings::codegen::Bindings::CustomElementRegistryBinding::ElementDefinitionOptions;
|
use crate::dom::bindings::codegen::Bindings::CustomElementRegistryBinding::ElementDefinitionOptions;
|
||||||
|
@ -96,7 +95,6 @@ impl CustomElementRegistry {
|
||||||
reflect_dom_object(
|
reflect_dom_object(
|
||||||
Box::new(CustomElementRegistry::new_inherited(window)),
|
Box::new(CustomElementRegistry::new_inherited(window)),
|
||||||
window,
|
window,
|
||||||
CustomElementRegistryBinding::Wrap,
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -37,11 +37,7 @@ impl CustomEvent {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn new_uninitialized(global: &GlobalScope) -> DomRoot<CustomEvent> {
|
pub fn new_uninitialized(global: &GlobalScope) -> DomRoot<CustomEvent> {
|
||||||
reflect_dom_object(
|
reflect_dom_object(Box::new(CustomEvent::new_inherited()), global)
|
||||||
Box::new(CustomEvent::new_inherited()),
|
|
||||||
global,
|
|
||||||
CustomEventBinding::Wrap,
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
pub fn new(
|
pub fn new(
|
||||||
global: &GlobalScope,
|
global: &GlobalScope,
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
* 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/. */
|
* 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::codegen::Bindings::DissimilarOriginLocationBinding::DissimilarOriginLocationMethods;
|
||||||
use crate::dom::bindings::error::{Error, ErrorResult, Fallible};
|
use crate::dom::bindings::error::{Error, ErrorResult, Fallible};
|
||||||
use crate::dom::bindings::reflector::reflect_dom_object;
|
use crate::dom::bindings::reflector::reflect_dom_object;
|
||||||
|
@ -42,7 +41,6 @@ impl DissimilarOriginLocation {
|
||||||
reflect_dom_object(
|
reflect_dom_object(
|
||||||
Box::new(DissimilarOriginLocation::new_inherited(window)),
|
Box::new(DissimilarOriginLocation::new_inherited(window)),
|
||||||
window,
|
window,
|
||||||
DissimilarOriginLocationBinding::Wrap,
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,7 +8,6 @@ use crate::dom::beforeunloadevent::BeforeUnloadEvent;
|
||||||
use crate::dom::bindings::callback::ExceptionHandling;
|
use crate::dom::bindings::callback::ExceptionHandling;
|
||||||
use crate::dom::bindings::cell::{ref_filter_map, DomRefCell, Ref, RefMut};
|
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::BeforeUnloadEventBinding::BeforeUnloadEventBinding::BeforeUnloadEventMethods;
|
||||||
use crate::dom::bindings::codegen::Bindings::DocumentBinding;
|
|
||||||
use crate::dom::bindings::codegen::Bindings::DocumentBinding::{
|
use crate::dom::bindings::codegen::Bindings::DocumentBinding::{
|
||||||
DocumentMethods, DocumentReadyState,
|
DocumentMethods, DocumentReadyState,
|
||||||
};
|
};
|
||||||
|
@ -3044,7 +3043,6 @@ impl Document {
|
||||||
canceller,
|
canceller,
|
||||||
)),
|
)),
|
||||||
window,
|
window,
|
||||||
DocumentBinding::Wrap,
|
|
||||||
);
|
);
|
||||||
{
|
{
|
||||||
let node = document.upcast::<Node>();
|
let node = document.upcast::<Node>();
|
||||||
|
|
|
@ -3,7 +3,6 @@
|
||||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
use crate::dom::bindings::cell::DomRefCell;
|
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::DocumentFragmentBinding::DocumentFragmentMethods;
|
||||||
use crate::dom::bindings::codegen::Bindings::WindowBinding::WindowMethods;
|
use crate::dom::bindings::codegen::Bindings::WindowBinding::WindowMethods;
|
||||||
use crate::dom::bindings::codegen::UnionTypes::NodeOrString;
|
use crate::dom::bindings::codegen::UnionTypes::NodeOrString;
|
||||||
|
@ -42,7 +41,6 @@ impl DocumentFragment {
|
||||||
Node::reflect_node(
|
Node::reflect_node(
|
||||||
Box::new(DocumentFragment::new_inherited(document)),
|
Box::new(DocumentFragment::new_inherited(document)),
|
||||||
document,
|
document,
|
||||||
DocumentFragmentBinding::Wrap,
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
* 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/. */
|
* 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::Bindings::DocumentTypeBinding::DocumentTypeMethods;
|
||||||
use crate::dom::bindings::codegen::UnionTypes::NodeOrString;
|
use crate::dom::bindings::codegen::UnionTypes::NodeOrString;
|
||||||
use crate::dom::bindings::error::ErrorResult;
|
use crate::dom::bindings::error::ErrorResult;
|
||||||
|
@ -49,7 +48,6 @@ impl DocumentType {
|
||||||
name, public_id, system_id, document,
|
name, public_id, system_id, document,
|
||||||
)),
|
)),
|
||||||
document,
|
document,
|
||||||
DocumentTypeBinding::Wrap,
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
* 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/. */
|
* 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::DOMExceptionConstants;
|
||||||
use crate::dom::bindings::codegen::Bindings::DOMExceptionBinding::DOMExceptionMethods;
|
use crate::dom::bindings::codegen::Bindings::DOMExceptionBinding::DOMExceptionMethods;
|
||||||
use crate::dom::bindings::error::Error;
|
use crate::dom::bindings::error::Error;
|
||||||
|
@ -134,11 +133,7 @@ impl DOMException {
|
||||||
pub fn new(global: &GlobalScope, code: DOMErrorName) -> DomRoot<DOMException> {
|
pub fn new(global: &GlobalScope, code: DOMErrorName) -> DomRoot<DOMException> {
|
||||||
let (message, name) = DOMException::get_error_data_by_code(code);
|
let (message, name) = DOMException::get_error_data_by_code(code);
|
||||||
|
|
||||||
reflect_dom_object(
|
reflect_dom_object(Box::new(DOMException::new_inherited(message, name)), global)
|
||||||
Box::new(DOMException::new_inherited(message, name)),
|
|
||||||
global,
|
|
||||||
DOMExceptionBinding::Wrap,
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(non_snake_case)]
|
#[allow(non_snake_case)]
|
||||||
|
@ -150,7 +145,6 @@ impl DOMException {
|
||||||
Ok(reflect_dom_object(
|
Ok(reflect_dom_object(
|
||||||
Box::new(DOMException::new_inherited(message, name)),
|
Box::new(DOMException::new_inherited(message, name)),
|
||||||
global,
|
global,
|
||||||
DOMExceptionBinding::Wrap,
|
|
||||||
))
|
))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,6 @@
|
||||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
use crate::document_loader::DocumentLoader;
|
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::DOMImplementationBinding::DOMImplementationMethods;
|
||||||
use crate::dom::bindings::codegen::Bindings::DocumentBinding::{
|
use crate::dom::bindings::codegen::Bindings::DocumentBinding::{
|
||||||
DocumentMethods, ElementCreationOptions,
|
DocumentMethods, ElementCreationOptions,
|
||||||
|
@ -46,11 +45,7 @@ impl DOMImplementation {
|
||||||
|
|
||||||
pub fn new(document: &Document) -> DomRoot<DOMImplementation> {
|
pub fn new(document: &Document) -> DomRoot<DOMImplementation> {
|
||||||
let window = document.window();
|
let window = document.window();
|
||||||
reflect_dom_object(
|
reflect_dom_object(Box::new(DOMImplementation::new_inherited(document)), window)
|
||||||
Box::new(DOMImplementation::new_inherited(document)),
|
|
||||||
window,
|
|
||||||
DOMImplementationBinding::Wrap,
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2,9 +2,7 @@
|
||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
* 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/. */
|
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
use crate::dom::bindings::codegen::Bindings::DOMMatrixBinding::{
|
use crate::dom::bindings::codegen::Bindings::DOMMatrixBinding::{DOMMatrixInit, DOMMatrixMethods};
|
||||||
DOMMatrixInit, DOMMatrixMethods, Wrap,
|
|
||||||
};
|
|
||||||
use crate::dom::bindings::codegen::Bindings::DOMMatrixReadOnlyBinding::DOMMatrixReadOnlyMethods;
|
use crate::dom::bindings::codegen::Bindings::DOMMatrixReadOnlyBinding::DOMMatrixReadOnlyMethods;
|
||||||
use crate::dom::bindings::codegen::UnionTypes::StringOrUnrestrictedDoubleSequence;
|
use crate::dom::bindings::codegen::UnionTypes::StringOrUnrestrictedDoubleSequence;
|
||||||
use crate::dom::bindings::error;
|
use crate::dom::bindings::error;
|
||||||
|
@ -32,7 +30,7 @@ impl DOMMatrix {
|
||||||
#[allow(unrooted_must_root)]
|
#[allow(unrooted_must_root)]
|
||||||
pub fn new(global: &GlobalScope, is2D: bool, matrix: Transform3D<f64>) -> DomRoot<Self> {
|
pub fn new(global: &GlobalScope, is2D: bool, matrix: Transform3D<f64>) -> DomRoot<Self> {
|
||||||
let dommatrix = Self::new_inherited(is2D, matrix);
|
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 {
|
pub fn new_inherited(is2D: bool, matrix: Transform3D<f64>) -> Self {
|
||||||
|
|
|
@ -4,9 +4,7 @@
|
||||||
|
|
||||||
use crate::dom::bindings::cell::{DomRefCell, Ref};
|
use crate::dom::bindings::cell::{DomRefCell, Ref};
|
||||||
use crate::dom::bindings::codegen::Bindings::DOMMatrixBinding::{DOMMatrixInit, DOMMatrixMethods};
|
use crate::dom::bindings::codegen::Bindings::DOMMatrixBinding::{DOMMatrixInit, DOMMatrixMethods};
|
||||||
use crate::dom::bindings::codegen::Bindings::DOMMatrixReadOnlyBinding::{
|
use crate::dom::bindings::codegen::Bindings::DOMMatrixReadOnlyBinding::DOMMatrixReadOnlyMethods;
|
||||||
DOMMatrixReadOnlyMethods, Wrap,
|
|
||||||
};
|
|
||||||
use crate::dom::bindings::codegen::Bindings::DOMPointBinding::DOMPointInit;
|
use crate::dom::bindings::codegen::Bindings::DOMPointBinding::DOMPointInit;
|
||||||
use crate::dom::bindings::codegen::UnionTypes::StringOrUnrestrictedDoubleSequence;
|
use crate::dom::bindings::codegen::UnionTypes::StringOrUnrestrictedDoubleSequence;
|
||||||
use crate::dom::bindings::error;
|
use crate::dom::bindings::error;
|
||||||
|
@ -45,7 +43,7 @@ impl DOMMatrixReadOnly {
|
||||||
#[allow(unrooted_must_root)]
|
#[allow(unrooted_must_root)]
|
||||||
pub fn new(global: &GlobalScope, is2D: bool, matrix: Transform3D<f64>) -> DomRoot<Self> {
|
pub fn new(global: &GlobalScope, is2D: bool, matrix: Transform3D<f64>) -> DomRoot<Self> {
|
||||||
let dommatrix = Self::new_inherited(is2D, matrix);
|
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 {
|
pub fn new_inherited(is2D: bool, matrix: Transform3D<f64>) -> Self {
|
||||||
|
|
|
@ -37,11 +37,7 @@ impl DOMParser {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn new(window: &Window) -> DomRoot<DOMParser> {
|
pub fn new(window: &Window) -> DomRoot<DOMParser> {
|
||||||
reflect_dom_object(
|
reflect_dom_object(Box::new(DOMParser::new_inherited(window)), window)
|
||||||
Box::new(DOMParser::new_inherited(window)),
|
|
||||||
window,
|
|
||||||
DOMParserBinding::Wrap,
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(non_snake_case)]
|
#[allow(non_snake_case)]
|
||||||
|
|
|
@ -2,9 +2,7 @@
|
||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
* 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/. */
|
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
use crate::dom::bindings::codegen::Bindings::DOMPointBinding::{
|
use crate::dom::bindings::codegen::Bindings::DOMPointBinding::{DOMPointInit, DOMPointMethods};
|
||||||
DOMPointInit, DOMPointMethods, Wrap,
|
|
||||||
};
|
|
||||||
use crate::dom::bindings::codegen::Bindings::DOMPointReadOnlyBinding::DOMPointReadOnlyMethods;
|
use crate::dom::bindings::codegen::Bindings::DOMPointReadOnlyBinding::DOMPointReadOnlyMethods;
|
||||||
use crate::dom::bindings::error::Fallible;
|
use crate::dom::bindings::error::Fallible;
|
||||||
use crate::dom::bindings::reflector::reflect_dom_object;
|
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> {
|
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(
|
pub fn Constructor(
|
||||||
|
|
|
@ -3,9 +3,7 @@
|
||||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
* 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::DOMPointBinding::DOMPointInit;
|
||||||
use crate::dom::bindings::codegen::Bindings::DOMPointReadOnlyBinding::{
|
use crate::dom::bindings::codegen::Bindings::DOMPointReadOnlyBinding::DOMPointReadOnlyMethods;
|
||||||
DOMPointReadOnlyMethods, Wrap,
|
|
||||||
};
|
|
||||||
use crate::dom::bindings::error::Fallible;
|
use crate::dom::bindings::error::Fallible;
|
||||||
use crate::dom::bindings::reflector::{reflect_dom_object, Reflector};
|
use crate::dom::bindings::reflector::{reflect_dom_object, Reflector};
|
||||||
use crate::dom::bindings::root::DomRoot;
|
use crate::dom::bindings::root::DomRoot;
|
||||||
|
@ -39,7 +37,6 @@ impl DOMPointReadOnly {
|
||||||
reflect_dom_object(
|
reflect_dom_object(
|
||||||
Box::new(DOMPointReadOnly::new_inherited(x, y, z, w)),
|
Box::new(DOMPointReadOnly::new_inherited(x, y, z, w)),
|
||||||
global,
|
global,
|
||||||
Wrap,
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
* 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::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::codegen::Bindings::DOMRectReadOnlyBinding::DOMRectInit;
|
||||||
use crate::dom::bindings::error::Fallible;
|
use crate::dom::bindings::error::Fallible;
|
||||||
use crate::dom::bindings::reflector::{reflect_dom_object, DomObject, Reflector};
|
use crate::dom::bindings::reflector::{reflect_dom_object, DomObject, Reflector};
|
||||||
|
@ -42,11 +42,7 @@ impl DOMQuad {
|
||||||
p3: &DOMPoint,
|
p3: &DOMPoint,
|
||||||
p4: &DOMPoint,
|
p4: &DOMPoint,
|
||||||
) -> DomRoot<DOMQuad> {
|
) -> DomRoot<DOMQuad> {
|
||||||
reflect_dom_object(
|
reflect_dom_object(Box::new(DOMQuad::new_inherited(p1, p2, p3, p4)), global)
|
||||||
Box::new(DOMQuad::new_inherited(p1, p2, p3, p4)),
|
|
||||||
global,
|
|
||||||
Wrap,
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn Constructor(
|
pub fn Constructor(
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
* 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/. */
|
* 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::DOMRectBinding::DOMRectMethods;
|
||||||
use crate::dom::bindings::codegen::Bindings::DOMRectReadOnlyBinding::DOMRectReadOnlyMethods;
|
use crate::dom::bindings::codegen::Bindings::DOMRectReadOnlyBinding::DOMRectReadOnlyMethods;
|
||||||
use crate::dom::bindings::error::Fallible;
|
use crate::dom::bindings::error::Fallible;
|
||||||
|
@ -28,7 +27,6 @@ impl DOMRect {
|
||||||
reflect_dom_object(
|
reflect_dom_object(
|
||||||
Box::new(DOMRect::new_inherited(x, y, width, height)),
|
Box::new(DOMRect::new_inherited(x, y, width, height)),
|
||||||
global,
|
global,
|
||||||
DOMRectBinding::Wrap,
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2,9 +2,7 @@
|
||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
* 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/. */
|
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
use crate::dom::bindings::codegen::Bindings::DOMRectReadOnlyBinding::{
|
use crate::dom::bindings::codegen::Bindings::DOMRectReadOnlyBinding::DOMRectReadOnlyMethods;
|
||||||
DOMRectReadOnlyMethods, Wrap,
|
|
||||||
};
|
|
||||||
use crate::dom::bindings::error::Fallible;
|
use crate::dom::bindings::error::Fallible;
|
||||||
use crate::dom::bindings::reflector::{reflect_dom_object, Reflector};
|
use crate::dom::bindings::reflector::{reflect_dom_object, Reflector};
|
||||||
use crate::dom::bindings::root::DomRoot;
|
use crate::dom::bindings::root::DomRoot;
|
||||||
|
@ -42,7 +40,6 @@ impl DOMRectReadOnly {
|
||||||
reflect_dom_object(
|
reflect_dom_object(
|
||||||
Box::new(DOMRectReadOnly::new_inherited(x, y, width, height)),
|
Box::new(DOMRectReadOnly::new_inherited(x, y, width, height)),
|
||||||
global,
|
global,
|
||||||
Wrap,
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
* 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/. */
|
* 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::codegen::Bindings::DOMStringListBinding::DOMStringListMethods;
|
||||||
use crate::dom::bindings::reflector::{reflect_dom_object, Reflector};
|
use crate::dom::bindings::reflector::{reflect_dom_object, Reflector};
|
||||||
use crate::dom::bindings::root::DomRoot;
|
use crate::dom::bindings::root::DomRoot;
|
||||||
|
@ -27,11 +26,7 @@ impl DOMStringList {
|
||||||
|
|
||||||
#[allow(unused)]
|
#[allow(unused)]
|
||||||
pub fn new(window: &Window, strings: Vec<DOMString>) -> DomRoot<DOMStringList> {
|
pub fn new(window: &Window, strings: Vec<DOMString>) -> DomRoot<DOMStringList> {
|
||||||
reflect_dom_object(
|
reflect_dom_object(Box::new(DOMStringList::new_inherited(strings)), window)
|
||||||
Box::new(DOMStringList::new_inherited(strings)),
|
|
||||||
window,
|
|
||||||
DOMStringListBinding::Wrap,
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
* 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/. */
|
* 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::codegen::Bindings::DOMStringMapBinding::DOMStringMapMethods;
|
||||||
use crate::dom::bindings::error::ErrorResult;
|
use crate::dom::bindings::error::ErrorResult;
|
||||||
use crate::dom::bindings::reflector::{reflect_dom_object, Reflector};
|
use crate::dom::bindings::reflector::{reflect_dom_object, Reflector};
|
||||||
|
@ -28,11 +27,7 @@ impl DOMStringMap {
|
||||||
|
|
||||||
pub fn new(element: &HTMLElement) -> DomRoot<DOMStringMap> {
|
pub fn new(element: &HTMLElement) -> DomRoot<DOMStringMap> {
|
||||||
let window = window_from_node(element);
|
let window = window_from_node(element);
|
||||||
reflect_dom_object(
|
reflect_dom_object(Box::new(DOMStringMap::new_inherited(element)), &*window)
|
||||||
Box::new(DOMStringMap::new_inherited(element)),
|
|
||||||
&*window,
|
|
||||||
DOMStringMapBinding::Wrap,
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,6 @@
|
||||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
use crate::dom::attr::Attr;
|
use crate::dom::attr::Attr;
|
||||||
use crate::dom::bindings::codegen::Bindings::DOMTokenListBinding;
|
|
||||||
use crate::dom::bindings::codegen::Bindings::DOMTokenListBinding::DOMTokenListMethods;
|
use crate::dom::bindings::codegen::Bindings::DOMTokenListBinding::DOMTokenListMethods;
|
||||||
use crate::dom::bindings::error::{Error, ErrorResult, Fallible};
|
use crate::dom::bindings::error::{Error, ErrorResult, Fallible};
|
||||||
use crate::dom::bindings::reflector::{reflect_dom_object, Reflector};
|
use crate::dom::bindings::reflector::{reflect_dom_object, Reflector};
|
||||||
|
@ -37,7 +36,6 @@ impl DOMTokenList {
|
||||||
reflect_dom_object(
|
reflect_dom_object(
|
||||||
Box::new(DOMTokenList::new_inherited(element, local_name.clone())),
|
Box::new(DOMTokenList::new_inherited(element, local_name.clone())),
|
||||||
&*window,
|
&*window,
|
||||||
DOMTokenListBinding::Wrap,
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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::cell::{ref_filter_map, DomRefCell, Ref, RefMut};
|
||||||
use crate::dom::bindings::codegen::Bindings::AttrBinding::AttrMethods;
|
use crate::dom::bindings::codegen::Bindings::AttrBinding::AttrMethods;
|
||||||
use crate::dom::bindings::codegen::Bindings::DocumentBinding::DocumentMethods;
|
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::ElementBinding::ElementMethods;
|
||||||
use crate::dom::bindings::codegen::Bindings::FunctionBinding::Function;
|
use crate::dom::bindings::codegen::Bindings::FunctionBinding::Function;
|
||||||
use crate::dom::bindings::codegen::Bindings::HTMLTemplateElementBinding::HTMLTemplateElementMethods;
|
use crate::dom::bindings::codegen::Bindings::HTMLTemplateElementBinding::HTMLTemplateElementMethods;
|
||||||
|
@ -294,7 +293,6 @@ impl Element {
|
||||||
local_name, namespace, prefix, document,
|
local_name, namespace, prefix, document,
|
||||||
)),
|
)),
|
||||||
document,
|
document,
|
||||||
ElementBinding::Wrap,
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -46,11 +46,7 @@ impl ErrorEvent {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn new_uninitialized(global: &GlobalScope) -> DomRoot<ErrorEvent> {
|
pub fn new_uninitialized(global: &GlobalScope) -> DomRoot<ErrorEvent> {
|
||||||
reflect_dom_object(
|
reflect_dom_object(Box::new(ErrorEvent::new_inherited()), global)
|
||||||
Box::new(ErrorEvent::new_inherited()),
|
|
||||||
global,
|
|
||||||
ErrorEventBinding::Wrap,
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn new(
|
pub fn new(
|
||||||
|
|
|
@ -72,7 +72,7 @@ impl Event {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn new_uninitialized(global: &GlobalScope) -> DomRoot<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(
|
pub fn new(
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
use crate::dom::bindings::cell::DomRefCell;
|
use crate::dom::bindings::cell::DomRefCell;
|
||||||
use crate::dom::bindings::codegen::Bindings::EventSourceBinding::{
|
use crate::dom::bindings::codegen::Bindings::EventSourceBinding::{
|
||||||
EventSourceInit, EventSourceMethods, Wrap,
|
EventSourceInit, EventSourceMethods,
|
||||||
};
|
};
|
||||||
use crate::dom::bindings::error::{Error, Fallible};
|
use crate::dom::bindings::error::{Error, Fallible};
|
||||||
use crate::dom::bindings::inheritance::Castable;
|
use crate::dom::bindings::inheritance::Castable;
|
||||||
|
@ -463,7 +463,6 @@ impl EventSource {
|
||||||
reflect_dom_object(
|
reflect_dom_object(
|
||||||
Box::new(EventSource::new_inherited(url, with_credentials)),
|
Box::new(EventSource::new_inherited(url, with_credentials)),
|
||||||
global,
|
global,
|
||||||
Wrap,
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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::AddEventListenerOptions;
|
||||||
use crate::dom::bindings::codegen::Bindings::EventTargetBinding::EventListenerOptions;
|
use crate::dom::bindings::codegen::Bindings::EventTargetBinding::EventListenerOptions;
|
||||||
use crate::dom::bindings::codegen::Bindings::EventTargetBinding::EventTargetMethods;
|
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::Bindings::WindowBinding::WindowMethods;
|
||||||
use crate::dom::bindings::codegen::UnionTypes::AddEventListenerOptionsOrBoolean;
|
use crate::dom::bindings::codegen::UnionTypes::AddEventListenerOptionsOrBoolean;
|
||||||
use crate::dom::bindings::codegen::UnionTypes::EventListenerOptionsOrBoolean;
|
use crate::dom::bindings::codegen::UnionTypes::EventListenerOptionsOrBoolean;
|
||||||
|
@ -340,7 +339,7 @@ impl EventTarget {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn new(global: &GlobalScope) -> DomRoot<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)]
|
#[allow(non_snake_case)]
|
||||||
|
|
|
@ -37,11 +37,7 @@ impl ExtendableEvent {
|
||||||
bubbles: bool,
|
bubbles: bool,
|
||||||
cancelable: bool,
|
cancelable: bool,
|
||||||
) -> DomRoot<ExtendableEvent> {
|
) -> DomRoot<ExtendableEvent> {
|
||||||
let ev = reflect_dom_object(
|
let ev = reflect_dom_object(Box::new(ExtendableEvent::new_inherited()), worker);
|
||||||
Box::new(ExtendableEvent::new_inherited()),
|
|
||||||
worker,
|
|
||||||
ExtendableEventBinding::Wrap,
|
|
||||||
);
|
|
||||||
{
|
{
|
||||||
let event = ev.upcast::<Event>();
|
let event = ev.upcast::<Event>();
|
||||||
event.init_event(type_, bubbles, cancelable);
|
event.init_event(type_, bubbles, cancelable);
|
||||||
|
|
|
@ -73,7 +73,7 @@ impl ExtendableMessageEvent {
|
||||||
lastEventId,
|
lastEventId,
|
||||||
ports,
|
ports,
|
||||||
));
|
));
|
||||||
let ev = reflect_dom_object(ev, global, ExtendableMessageEventBinding::Wrap);
|
let ev = reflect_dom_object(ev, global);
|
||||||
{
|
{
|
||||||
let event = ev.upcast::<Event>();
|
let event = ev.upcast::<Event>();
|
||||||
event.init_event(type_, bubbles, cancelable);
|
event.init_event(type_, bubbles, cancelable);
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
use crate::dom::bindings::codegen::Bindings::FakeXRDeviceBinding::{
|
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::FakeXRInputControllerBinding::FakeXRInputSourceInit;
|
||||||
use crate::dom::bindings::codegen::Bindings::XRInputSourceBinding::{
|
use crate::dom::bindings::codegen::Bindings::XRInputSourceBinding::{
|
||||||
|
@ -51,11 +51,7 @@ impl FakeXRDevice {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn new(global: &GlobalScope, sender: IpcSender<MockDeviceMsg>) -> DomRoot<FakeXRDevice> {
|
pub fn new(global: &GlobalScope, sender: IpcSender<MockDeviceMsg>) -> DomRoot<FakeXRDevice> {
|
||||||
reflect_dom_object(
|
reflect_dom_object(Box::new(FakeXRDevice::new_inherited(sender)), global)
|
||||||
Box::new(FakeXRDevice::new_inherited(sender)),
|
|
||||||
global,
|
|
||||||
FakeXRDeviceBinding::Wrap,
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn disconnect(&self, sender: IpcSender<()>) {
|
pub fn disconnect(&self, sender: IpcSender<()>) {
|
||||||
|
|
|
@ -3,9 +3,7 @@
|
||||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
* 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::FakeXRDeviceBinding::FakeXRRigidTransformInit;
|
||||||
use crate::dom::bindings::codegen::Bindings::FakeXRInputControllerBinding::{
|
use crate::dom::bindings::codegen::Bindings::FakeXRInputControllerBinding::FakeXRInputControllerMethods;
|
||||||
self, FakeXRInputControllerMethods,
|
|
||||||
};
|
|
||||||
use crate::dom::bindings::codegen::Bindings::XRInputSourceBinding::{
|
use crate::dom::bindings::codegen::Bindings::XRInputSourceBinding::{
|
||||||
XRHandedness, XRTargetRayMode,
|
XRHandedness, XRTargetRayMode,
|
||||||
};
|
};
|
||||||
|
@ -47,7 +45,6 @@ impl FakeXRInputController {
|
||||||
reflect_dom_object(
|
reflect_dom_object(
|
||||||
Box::new(FakeXRInputController::new_inherited(sender, id)),
|
Box::new(FakeXRInputController::new_inherited(sender, id)),
|
||||||
global,
|
global,
|
||||||
FakeXRInputControllerBinding::Wrap,
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -51,7 +51,6 @@ impl File {
|
||||||
let file = reflect_dom_object(
|
let file = reflect_dom_object(
|
||||||
Box::new(File::new_inherited(&blob_impl, name, modified)),
|
Box::new(File::new_inherited(&blob_impl, name, modified)),
|
||||||
global,
|
global,
|
||||||
FileBinding::Wrap,
|
|
||||||
);
|
);
|
||||||
global.track_file(&file, blob_impl);
|
global.track_file(&file, blob_impl);
|
||||||
file
|
file
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
* 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/. */
|
* 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::codegen::Bindings::FileListBinding::FileListMethods;
|
||||||
use crate::dom::bindings::reflector::{reflect_dom_object, Reflector};
|
use crate::dom::bindings::reflector::{reflect_dom_object, Reflector};
|
||||||
use crate::dom::bindings::root::{Dom, DomRoot};
|
use crate::dom::bindings::root::{Dom, DomRoot};
|
||||||
|
@ -34,7 +33,6 @@ impl FileList {
|
||||||
files.iter().map(|r| Dom::from_ref(&**r)).collect(),
|
files.iter().map(|r| Dom::from_ref(&**r)).collect(),
|
||||||
)),
|
)),
|
||||||
window,
|
window,
|
||||||
FileListBinding::Wrap,
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
use crate::dom::bindings::cell::DomRefCell;
|
use crate::dom::bindings::cell::DomRefCell;
|
||||||
use crate::dom::bindings::codegen::Bindings::BlobBinding::BlobMethods;
|
use crate::dom::bindings::codegen::Bindings::BlobBinding::BlobMethods;
|
||||||
use crate::dom::bindings::codegen::Bindings::FileReaderBinding::{
|
use crate::dom::bindings::codegen::Bindings::FileReaderBinding::{
|
||||||
self, FileReaderConstants, FileReaderMethods,
|
FileReaderConstants, FileReaderMethods,
|
||||||
};
|
};
|
||||||
use crate::dom::bindings::codegen::UnionTypes::StringOrObject;
|
use crate::dom::bindings::codegen::UnionTypes::StringOrObject;
|
||||||
use crate::dom::bindings::error::{Error, ErrorResult, Fallible};
|
use crate::dom::bindings::error::{Error, ErrorResult, Fallible};
|
||||||
|
@ -152,11 +152,7 @@ impl FileReader {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn new(global: &GlobalScope) -> DomRoot<FileReader> {
|
pub fn new(global: &GlobalScope) -> DomRoot<FileReader> {
|
||||||
reflect_dom_object(
|
reflect_dom_object(Box::new(FileReader::new_inherited()), global)
|
||||||
Box::new(FileReader::new_inherited()),
|
|
||||||
global,
|
|
||||||
FileReaderBinding::Wrap,
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(non_snake_case)]
|
#[allow(non_snake_case)]
|
||||||
|
|
|
@ -3,9 +3,7 @@
|
||||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
* 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::BlobBinding::BlobMethods;
|
||||||
use crate::dom::bindings::codegen::Bindings::FileReaderSyncBinding::{
|
use crate::dom::bindings::codegen::Bindings::FileReaderSyncBinding::FileReaderSyncMethods;
|
||||||
FileReaderSyncBinding, FileReaderSyncMethods,
|
|
||||||
};
|
|
||||||
use crate::dom::bindings::error::{Error, Fallible};
|
use crate::dom::bindings::error::{Error, Fallible};
|
||||||
use crate::dom::bindings::reflector::{reflect_dom_object, Reflector};
|
use crate::dom::bindings::reflector::{reflect_dom_object, Reflector};
|
||||||
use crate::dom::bindings::root::DomRoot;
|
use crate::dom::bindings::root::DomRoot;
|
||||||
|
@ -33,11 +31,7 @@ impl FileReaderSync {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn new(global: &GlobalScope) -> DomRoot<FileReaderSync> {
|
pub fn new(global: &GlobalScope) -> DomRoot<FileReaderSync> {
|
||||||
reflect_dom_object(
|
reflect_dom_object(Box::new(FileReaderSync::new_inherited()), global)
|
||||||
Box::new(FileReaderSync::new_inherited()),
|
|
||||||
global,
|
|
||||||
FileReaderSyncBinding::Wrap,
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(non_snake_case)]
|
#[allow(non_snake_case)]
|
||||||
|
|
|
@ -32,11 +32,7 @@ impl FocusEvent {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn new_uninitialized(window: &Window) -> DomRoot<FocusEvent> {
|
pub fn new_uninitialized(window: &Window) -> DomRoot<FocusEvent> {
|
||||||
reflect_dom_object(
|
reflect_dom_object(Box::new(FocusEvent::new_inherited()), window)
|
||||||
Box::new(FocusEvent::new_inherited()),
|
|
||||||
window,
|
|
||||||
FocusEventBinding::Wrap,
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn new(
|
pub fn new(
|
||||||
|
|
|
@ -4,7 +4,6 @@
|
||||||
|
|
||||||
use crate::dom::bindings::cell::DomRefCell;
|
use crate::dom::bindings::cell::DomRefCell;
|
||||||
use crate::dom::bindings::codegen::Bindings::FormDataBinding::FormDataMethods;
|
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::codegen::UnionTypes::FileOrUSVString;
|
||||||
use crate::dom::bindings::error::{Error, Fallible};
|
use crate::dom::bindings::error::{Error, Fallible};
|
||||||
use crate::dom::bindings::inheritance::Castable;
|
use crate::dom::bindings::inheritance::Castable;
|
||||||
|
@ -43,11 +42,7 @@ impl FormData {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn new(form_datums: Option<Vec<FormDatum>>, global: &GlobalScope) -> DomRoot<FormData> {
|
pub fn new(form_datums: Option<Vec<FormDatum>>, global: &GlobalScope) -> DomRoot<FormData> {
|
||||||
reflect_dom_object(
|
reflect_dom_object(Box::new(FormData::new_inherited(form_datums)), global)
|
||||||
Box::new(FormData::new_inherited(form_datums)),
|
|
||||||
global,
|
|
||||||
FormDataWrap,
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// https://xhr.spec.whatwg.org/#dom-formdata
|
// https://xhr.spec.whatwg.org/#dom-formdata
|
||||||
|
|
|
@ -38,7 +38,6 @@ impl FormDataEvent {
|
||||||
form_data: Dom::from_ref(form_data),
|
form_data: Dom::from_ref(form_data),
|
||||||
}),
|
}),
|
||||||
global,
|
global,
|
||||||
FormDataEventBinding::Wrap,
|
|
||||||
);
|
);
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|
|
@ -9,9 +9,7 @@ use crate::dom::bindings::codegen::Bindings::AudioNodeBinding::{
|
||||||
ChannelCountMode, ChannelInterpretation,
|
ChannelCountMode, ChannelInterpretation,
|
||||||
};
|
};
|
||||||
use crate::dom::bindings::codegen::Bindings::AudioParamBinding::AutomationRate;
|
use crate::dom::bindings::codegen::Bindings::AudioParamBinding::AutomationRate;
|
||||||
use crate::dom::bindings::codegen::Bindings::GainNodeBinding::{
|
use crate::dom::bindings::codegen::Bindings::GainNodeBinding::{GainNodeMethods, GainOptions};
|
||||||
self, GainNodeMethods, GainOptions,
|
|
||||||
};
|
|
||||||
use crate::dom::bindings::error::Fallible;
|
use crate::dom::bindings::error::Fallible;
|
||||||
use crate::dom::bindings::reflector::reflect_dom_object;
|
use crate::dom::bindings::reflector::reflect_dom_object;
|
||||||
use crate::dom::bindings::root::{Dom, DomRoot};
|
use crate::dom::bindings::root::{Dom, DomRoot};
|
||||||
|
@ -69,11 +67,7 @@ impl GainNode {
|
||||||
options: &GainOptions,
|
options: &GainOptions,
|
||||||
) -> Fallible<DomRoot<GainNode>> {
|
) -> Fallible<DomRoot<GainNode>> {
|
||||||
let node = GainNode::new_inherited(window, context, options)?;
|
let node = GainNode::new_inherited(window, context, options)?;
|
||||||
Ok(reflect_dom_object(
|
Ok(reflect_dom_object(Box::new(node), window))
|
||||||
Box::new(node),
|
|
||||||
window,
|
|
||||||
GainNodeBinding::Wrap,
|
|
||||||
))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(non_snake_case)]
|
#[allow(non_snake_case)]
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
* 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/. */
|
* 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::codegen::Bindings::GamepadBinding::GamepadMethods;
|
||||||
use crate::dom::bindings::inheritance::Castable;
|
use crate::dom::bindings::inheritance::Castable;
|
||||||
use crate::dom::bindings::num::Finite;
|
use crate::dom::bindings::num::Finite;
|
||||||
|
@ -95,7 +94,6 @@ impl Gamepad {
|
||||||
data.display_id,
|
data.display_id,
|
||||||
)),
|
)),
|
||||||
global,
|
global,
|
||||||
GamepadBinding::Wrap,
|
|
||||||
);
|
);
|
||||||
|
|
||||||
let cx = global.get_cx();
|
let cx = global.get_cx();
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
* 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/. */
|
* 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::codegen::Bindings::GamepadButtonBinding::GamepadButtonMethods;
|
||||||
use crate::dom::bindings::num::Finite;
|
use crate::dom::bindings::num::Finite;
|
||||||
use crate::dom::bindings::reflector::{reflect_dom_object, Reflector};
|
use crate::dom::bindings::reflector::{reflect_dom_object, Reflector};
|
||||||
|
@ -33,7 +32,6 @@ impl GamepadButton {
|
||||||
reflect_dom_object(
|
reflect_dom_object(
|
||||||
Box::new(GamepadButton::new_inherited(pressed, touched)),
|
Box::new(GamepadButton::new_inherited(pressed, touched)),
|
||||||
global,
|
global,
|
||||||
GamepadButtonBinding::Wrap,
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
* 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/. */
|
* 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::codegen::Bindings::GamepadButtonListBinding::GamepadButtonListMethods;
|
||||||
use crate::dom::bindings::reflector::{reflect_dom_object, Reflector};
|
use crate::dom::bindings::reflector::{reflect_dom_object, Reflector};
|
||||||
use crate::dom::bindings::root::{Dom, DomRoot, DomSlice};
|
use crate::dom::bindings::root::{Dom, DomRoot, DomSlice};
|
||||||
|
@ -34,11 +33,7 @@ impl GamepadButtonList {
|
||||||
rooted_vec!(let list <- buttons.iter()
|
rooted_vec!(let list <- buttons.iter()
|
||||||
.map(|btn| GamepadButton::new(&global, btn.pressed, btn.touched)));
|
.map(|btn| GamepadButton::new(&global, btn.pressed, btn.touched)));
|
||||||
|
|
||||||
reflect_dom_object(
|
reflect_dom_object(Box::new(GamepadButtonList::new_inherited(list.r())), global)
|
||||||
Box::new(GamepadButtonList::new_inherited(list.r())),
|
|
||||||
global,
|
|
||||||
GamepadButtonListBinding::Wrap,
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn sync_from_vr(&self, vr_buttons: &[WebVRGamepadButton]) {
|
pub fn sync_from_vr(&self, vr_buttons: &[WebVRGamepadButton]) {
|
||||||
|
|
|
@ -43,11 +43,7 @@ impl GamepadEvent {
|
||||||
cancelable: bool,
|
cancelable: bool,
|
||||||
gamepad: &Gamepad,
|
gamepad: &Gamepad,
|
||||||
) -> DomRoot<GamepadEvent> {
|
) -> DomRoot<GamepadEvent> {
|
||||||
let ev = reflect_dom_object(
|
let ev = reflect_dom_object(Box::new(GamepadEvent::new_inherited(&gamepad)), global);
|
||||||
Box::new(GamepadEvent::new_inherited(&gamepad)),
|
|
||||||
global,
|
|
||||||
GamepadEventBinding::Wrap,
|
|
||||||
);
|
|
||||||
{
|
{
|
||||||
let event = ev.upcast::<Event>();
|
let event = ev.upcast::<Event>();
|
||||||
event.init_event(type_, bubbles, cancelable);
|
event.init_event(type_, bubbles, cancelable);
|
||||||
|
|
|
@ -3,7 +3,6 @@
|
||||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
use crate::dom::bindings::cell::DomRefCell;
|
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::codegen::Bindings::GamepadListBinding::GamepadListMethods;
|
||||||
use crate::dom::bindings::reflector::{reflect_dom_object, Reflector};
|
use crate::dom::bindings::reflector::{reflect_dom_object, Reflector};
|
||||||
use crate::dom::bindings::root::{Dom, DomRoot};
|
use crate::dom::bindings::root::{Dom, DomRoot};
|
||||||
|
@ -27,11 +26,7 @@ impl GamepadList {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn new(global: &GlobalScope, list: &[&Gamepad]) -> DomRoot<GamepadList> {
|
pub fn new(global: &GlobalScope, list: &[&Gamepad]) -> DomRoot<GamepadList> {
|
||||||
reflect_dom_object(
|
reflect_dom_object(Box::new(GamepadList::new_inherited(list)), global)
|
||||||
Box::new(GamepadList::new_inherited(list)),
|
|
||||||
global,
|
|
||||||
GamepadListBinding::Wrap,
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn add_if_not_exists(&self, gamepads: &[DomRoot<Gamepad>]) {
|
pub fn add_if_not_exists(&self, gamepads: &[DomRoot<Gamepad>]) {
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
* 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::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::error::Error;
|
||||||
use crate::dom::bindings::refcounted::{Trusted, TrustedPromise};
|
use crate::dom::bindings::refcounted::{Trusted, TrustedPromise};
|
||||||
use crate::dom::bindings::reflector::{reflect_dom_object, DomObject, Reflector};
|
use crate::dom::bindings::reflector::{reflect_dom_object, DomObject, Reflector};
|
||||||
|
@ -36,7 +36,7 @@ impl GPU {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn new(global: &GlobalScope) -> DomRoot<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)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
use crate::dom::bindings::codegen::Bindings::GPUAdapterBinding::{
|
use crate::dom::bindings::codegen::Bindings::GPUAdapterBinding::{
|
||||||
self, GPUAdapterMethods, GPUDeviceDescriptor,
|
GPUAdapterMethods, GPUDeviceDescriptor,
|
||||||
};
|
};
|
||||||
use crate::dom::bindings::error::Error;
|
use crate::dom::bindings::error::Error;
|
||||||
use crate::dom::bindings::reflector::{reflect_dom_object, DomObject, Reflector};
|
use crate::dom::bindings::reflector::{reflect_dom_object, DomObject, Reflector};
|
||||||
|
@ -61,7 +61,6 @@ impl GPUAdapter {
|
||||||
channel, name, extensions, adapter,
|
channel, name, extensions, adapter,
|
||||||
)),
|
)),
|
||||||
global,
|
global,
|
||||||
GPUAdapterBinding::Wrap,
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,9 +3,7 @@
|
||||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
use crate::dom::bindings::cell::DomRefCell;
|
use crate::dom::bindings::cell::DomRefCell;
|
||||||
use crate::dom::bindings::codegen::Bindings::GPUBindGroupBinding::{
|
use crate::dom::bindings::codegen::Bindings::GPUBindGroupBinding::GPUBindGroupMethods;
|
||||||
GPUBindGroupBinding, GPUBindGroupMethods,
|
|
||||||
};
|
|
||||||
use crate::dom::bindings::reflector::{reflect_dom_object, Reflector};
|
use crate::dom::bindings::reflector::{reflect_dom_object, Reflector};
|
||||||
use crate::dom::bindings::root::DomRoot;
|
use crate::dom::bindings::root::DomRoot;
|
||||||
use crate::dom::bindings::str::DOMString;
|
use crate::dom::bindings::str::DOMString;
|
||||||
|
@ -40,7 +38,6 @@ impl GPUBindGroup {
|
||||||
reflect_dom_object(
|
reflect_dom_object(
|
||||||
Box::new(GPUBindGroup::new_inherited(bind_group, valid)),
|
Box::new(GPUBindGroup::new_inherited(bind_group, valid)),
|
||||||
global,
|
global,
|
||||||
GPUBindGroupBinding::Wrap,
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
use crate::dom::bindings::cell::DomRefCell;
|
use crate::dom::bindings::cell::DomRefCell;
|
||||||
use crate::dom::bindings::codegen::Bindings::GPUBindGroupLayoutBinding::{
|
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::reflector::{reflect_dom_object, Reflector};
|
||||||
use crate::dom::bindings::root::DomRoot;
|
use crate::dom::bindings::root::DomRoot;
|
||||||
|
@ -58,7 +58,6 @@ impl GPUBindGroupLayout {
|
||||||
valid,
|
valid,
|
||||||
)),
|
)),
|
||||||
global,
|
global,
|
||||||
GPUBindGroupLayoutBinding::Wrap,
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,9 +3,7 @@
|
||||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
use crate::dom::bindings::cell::{DomRefCell, Ref};
|
use crate::dom::bindings::cell::{DomRefCell, Ref};
|
||||||
use crate::dom::bindings::codegen::Bindings::GPUBufferBinding::{
|
use crate::dom::bindings::codegen::Bindings::GPUBufferBinding::{GPUBufferMethods, GPUBufferSize};
|
||||||
self, GPUBufferMethods, GPUBufferSize,
|
|
||||||
};
|
|
||||||
use crate::dom::bindings::error::Error;
|
use crate::dom::bindings::error::Error;
|
||||||
use crate::dom::bindings::reflector::DomObject;
|
use crate::dom::bindings::reflector::DomObject;
|
||||||
use crate::dom::bindings::reflector::{reflect_dom_object, Reflector};
|
use crate::dom::bindings::reflector::{reflect_dom_object, Reflector};
|
||||||
|
@ -98,7 +96,6 @@ impl GPUBuffer {
|
||||||
channel, buffer, device, state, size, usage, valid, mapping,
|
channel, buffer, device, state, size, usage, valid, mapping,
|
||||||
)),
|
)),
|
||||||
global,
|
global,
|
||||||
GPUBufferBinding::Wrap,
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,9 +3,7 @@
|
||||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
use crate::dom::bindings::cell::{DomRefCell, Ref};
|
use crate::dom::bindings::cell::{DomRefCell, Ref};
|
||||||
use crate::dom::bindings::codegen::Bindings::GPUCommandBufferBinding::{
|
use crate::dom::bindings::codegen::Bindings::GPUCommandBufferBinding::GPUCommandBufferMethods;
|
||||||
self, GPUCommandBufferMethods,
|
|
||||||
};
|
|
||||||
use crate::dom::bindings::reflector::{reflect_dom_object, Reflector};
|
use crate::dom::bindings::reflector::{reflect_dom_object, Reflector};
|
||||||
use crate::dom::bindings::root::Dom;
|
use crate::dom::bindings::root::Dom;
|
||||||
use crate::dom::bindings::root::DomRoot;
|
use crate::dom::bindings::root::DomRoot;
|
||||||
|
@ -62,7 +60,6 @@ impl GPUCommandBuffer {
|
||||||
buffers,
|
buffers,
|
||||||
)),
|
)),
|
||||||
global,
|
global,
|
||||||
GPUCommandBufferBinding::Wrap,
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
use crate::dom::bindings::cell::DomRefCell;
|
use crate::dom::bindings::cell::DomRefCell;
|
||||||
use crate::dom::bindings::codegen::Bindings::GPUCommandEncoderBinding::{
|
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::DomObject;
|
||||||
use crate::dom::bindings::reflector::{reflect_dom_object, Reflector};
|
use crate::dom::bindings::reflector::{reflect_dom_object, Reflector};
|
||||||
|
@ -48,7 +48,6 @@ impl GPUCommandEncoder {
|
||||||
reflect_dom_object(
|
reflect_dom_object(
|
||||||
Box::new(GPUCommandEncoder::new_inherited(channel, encoder)),
|
Box::new(GPUCommandEncoder::new_inherited(channel, encoder)),
|
||||||
global,
|
global,
|
||||||
GPUCommandEncoderBinding::Wrap,
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,9 +3,7 @@
|
||||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
use crate::dom::bindings::cell::DomRefCell;
|
use crate::dom::bindings::cell::DomRefCell;
|
||||||
use crate::dom::bindings::codegen::Bindings::GPUComputePassEncoderBinding::{
|
use crate::dom::bindings::codegen::Bindings::GPUComputePassEncoderBinding::GPUComputePassEncoderMethods;
|
||||||
self, GPUComputePassEncoderMethods,
|
|
||||||
};
|
|
||||||
use crate::dom::bindings::reflector::{reflect_dom_object, Reflector};
|
use crate::dom::bindings::reflector::{reflect_dom_object, Reflector};
|
||||||
use crate::dom::bindings::root::DomRoot;
|
use crate::dom::bindings::root::DomRoot;
|
||||||
use crate::dom::bindings::str::DOMString;
|
use crate::dom::bindings::str::DOMString;
|
||||||
|
@ -53,7 +51,6 @@ impl GPUComputePassEncoder {
|
||||||
reflect_dom_object(
|
reflect_dom_object(
|
||||||
Box::new(GPUComputePassEncoder::new_inherited(channel, parent)),
|
Box::new(GPUComputePassEncoder::new_inherited(channel, parent)),
|
||||||
global,
|
global,
|
||||||
GPUComputePassEncoderBinding::Wrap,
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue