зеркало из https://github.com/mozilla/gecko-dev.git
servo: Merge #18900 - Remove use of unstable box syntax (from servo:box_syntax); r=emilio
http://www.robohornet.org gives a score of 101.36 on master, and 102.68 with this PR. The latter is slightly better, but probably within noise level. So it looks like this PR does not affect DOM performance. This is expected since `Box::new` is defined as: ```rust impl<T> Box<T> { #[inline(always)] pub fn new(x: T) -> Box<T> { box x } } ``` With inlining, it should compile to the same as box syntax. Source-Repo: https://github.com/servo/servo Source-Revision: a9022be0c3e30249845ca5947ac0c0a6743c7991 --HG-- extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear extra : subtree_revision : 97a17674f72dbfcb99552fe4877789f149ccfc84
This commit is contained in:
Родитель
ab5eb49d69
Коммит
c08c32ca01
|
@ -24,10 +24,10 @@ impl<T: JSTraceable + DomObject + 'static> ScriptChan for SendableWorkerScriptCh
|
|||
}
|
||||
|
||||
fn clone(&self) -> Box<ScriptChan + Send> {
|
||||
box SendableWorkerScriptChan {
|
||||
Box::new(SendableWorkerScriptChan {
|
||||
sender: self.sender.clone(),
|
||||
worker: self.worker.clone(),
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -48,10 +48,10 @@ impl<T: JSTraceable + DomObject + 'static> ScriptChan for WorkerThreadWorkerChan
|
|||
}
|
||||
|
||||
fn clone(&self) -> Box<ScriptChan + Send> {
|
||||
box WorkerThreadWorkerChan {
|
||||
Box::new(WorkerThreadWorkerChan {
|
||||
sender: self.sender.clone(),
|
||||
worker: self.worker.clone(),
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -64,14 +64,18 @@ impl Attr {
|
|||
prefix: Option<Prefix>,
|
||||
owner: Option<&Element>)
|
||||
-> DomRoot<Attr> {
|
||||
reflect_dom_object(box Attr::new_inherited(local_name,
|
||||
value,
|
||||
name,
|
||||
namespace,
|
||||
prefix,
|
||||
owner),
|
||||
window,
|
||||
AttrBinding::Wrap)
|
||||
reflect_dom_object(
|
||||
Box::new(Attr::new_inherited(
|
||||
local_name,
|
||||
value,
|
||||
name,
|
||||
namespace,
|
||||
prefix,
|
||||
owner
|
||||
)),
|
||||
window,
|
||||
AttrBinding::Wrap
|
||||
)
|
||||
}
|
||||
|
||||
#[inline]
|
||||
|
|
|
@ -33,7 +33,7 @@ impl BeforeUnloadEvent {
|
|||
}
|
||||
|
||||
pub fn new_uninitialized(window: &Window) -> DomRoot<BeforeUnloadEvent> {
|
||||
reflect_dom_object(box BeforeUnloadEvent::new_inherited(),
|
||||
reflect_dom_object(Box::new(BeforeUnloadEvent::new_inherited()),
|
||||
window,
|
||||
BeforeUnloadEventBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -226,7 +226,7 @@ pub unsafe fn create_global_object(
|
|||
// avoid getting trace hooks called on a partially initialized object.
|
||||
JS_SetReservedSlot(rval.get(), DOM_OBJECT_SLOT, PrivateValue(private));
|
||||
let proto_array: Box<ProtoOrIfaceArray> =
|
||||
box [0 as *mut JSObject; PrototypeList::PROTO_OR_IFACE_LENGTH];
|
||||
Box::new([0 as *mut JSObject; PrototypeList::PROTO_OR_IFACE_LENGTH]);
|
||||
JS_SetReservedSlot(rval.get(),
|
||||
DOM_PROTOTYPE_SLOT,
|
||||
PrivateValue(Box::into_raw(proto_array) as *const libc::c_void));
|
||||
|
|
|
@ -62,12 +62,12 @@ impl<T: DomObject + JSTraceable + Iterable> IterableIterator<T> {
|
|||
type_: IteratorType,
|
||||
wrap: unsafe fn(*mut JSContext, &GlobalScope, Box<IterableIterator<T>>)
|
||||
-> DomRoot<Self>) -> DomRoot<Self> {
|
||||
let iterator = box IterableIterator {
|
||||
let iterator = Box::new(IterableIterator {
|
||||
reflector: Reflector::new(),
|
||||
type_: type_,
|
||||
iterable: Dom::from_ref(iterable),
|
||||
index: Cell::new(0),
|
||||
};
|
||||
});
|
||||
reflect_dom_object(iterator, &*iterable.global(), wrap)
|
||||
}
|
||||
|
||||
|
|
|
@ -759,7 +759,7 @@ unsafe impl<T: JSTraceable + 'static> JSTraceable for RootedTraceableBox<T> {
|
|||
impl<T: JSTraceable + 'static> RootedTraceableBox<T> {
|
||||
/// DomRoot a JSTraceable thing for the life of this RootedTraceable
|
||||
pub fn new(traceable: T) -> RootedTraceableBox<T> {
|
||||
let traceable = Box::into_raw(box traceable);
|
||||
let traceable = Box::into_raw(Box::new(traceable));
|
||||
unsafe {
|
||||
RootedTraceableSet::add(traceable);
|
||||
}
|
||||
|
|
|
@ -56,10 +56,10 @@ pub trait WeakReferenceable: DomObject + Sized {
|
|||
.to_private() as *mut WeakBox<Self>;
|
||||
if ptr.is_null() {
|
||||
trace!("Creating new WeakBox holder for {:p}.", self);
|
||||
ptr = Box::into_raw(box WeakBox {
|
||||
ptr = Box::into_raw(Box::new(WeakBox {
|
||||
count: Cell::new(1),
|
||||
value: Cell::new(Some(NonZero::new_unchecked(self))),
|
||||
});
|
||||
}));
|
||||
JS_SetReservedSlot(object, DOM_WEAK_SLOT, PrivateValue(ptr as *const c_void));
|
||||
}
|
||||
let box_ = &*ptr;
|
||||
|
|
|
@ -80,7 +80,7 @@ impl Blob {
|
|||
pub fn new(
|
||||
global: &GlobalScope, blob_impl: BlobImpl, typeString: String)
|
||||
-> DomRoot<Blob> {
|
||||
let boxed_blob = box Blob::new_inherited(blob_impl, typeString);
|
||||
let boxed_blob = Box::new(Blob::new_inherited(blob_impl, typeString));
|
||||
reflect_dom_object(boxed_blob, global, BlobBinding::Wrap)
|
||||
}
|
||||
|
||||
|
|
|
@ -132,7 +132,7 @@ impl Bluetooth {
|
|||
}
|
||||
|
||||
pub fn new(global: &GlobalScope) -> DomRoot<Bluetooth> {
|
||||
reflect_dom_object(box Bluetooth::new_inherited(),
|
||||
reflect_dom_object(Box::new(Bluetooth::new_inherited()),
|
||||
global,
|
||||
BluetoothBinding::Wrap)
|
||||
}
|
||||
|
@ -224,7 +224,7 @@ pub fn response_async<T: AsyncBluetoothListener + DomObject + 'static>(
|
|||
promise: Some(TrustedPromise::new(promise.clone())),
|
||||
receiver: Trusted::new(receiver),
|
||||
}));
|
||||
ROUTER.add_route(action_receiver.to_opaque(), box move |message| {
|
||||
ROUTER.add_route(action_receiver.to_opaque(), Box::new(move |message| {
|
||||
struct ListenerTask<T: AsyncBluetoothListener + DomObject> {
|
||||
context: Arc<Mutex<BluetoothContext<T>>>,
|
||||
action: BluetoothResponseResult,
|
||||
|
@ -249,7 +249,7 @@ pub fn response_async<T: AsyncBluetoothListener + DomObject + 'static>(
|
|||
if let Err(err) = result {
|
||||
warn!("failed to deliver network data: {:?}", err);
|
||||
}
|
||||
});
|
||||
}));
|
||||
action_sender
|
||||
}
|
||||
|
||||
|
|
|
@ -55,13 +55,17 @@ impl BluetoothAdvertisingEvent {
|
|||
txPower: Option<i8>,
|
||||
rssi: Option<i8>)
|
||||
-> DomRoot<BluetoothAdvertisingEvent> {
|
||||
let ev = reflect_dom_object(box BluetoothAdvertisingEvent::new_inherited(device,
|
||||
name,
|
||||
appearance,
|
||||
txPower,
|
||||
rssi),
|
||||
global,
|
||||
BluetoothAdvertisingEventBinding::Wrap);
|
||||
let ev = reflect_dom_object(
|
||||
Box::new(BluetoothAdvertisingEvent::new_inherited(
|
||||
device,
|
||||
name,
|
||||
appearance,
|
||||
txPower,
|
||||
rssi
|
||||
)),
|
||||
global,
|
||||
BluetoothAdvertisingEventBinding::Wrap
|
||||
);
|
||||
{
|
||||
let event = ev.upcast::<Event>();
|
||||
event.init_event(type_, bool::from(bubbles), bool::from(cancelable));
|
||||
|
|
|
@ -61,19 +61,23 @@ impl BluetoothCharacteristicProperties {
|
|||
reliableWrite: bool,
|
||||
writableAuxiliaries: bool)
|
||||
-> DomRoot<BluetoothCharacteristicProperties> {
|
||||
reflect_dom_object(box BluetoothCharacteristicProperties::new_inherited(broadcast,
|
||||
read,
|
||||
writeWithoutResponse,
|
||||
write,
|
||||
notify,
|
||||
indicate,
|
||||
authenticatedSignedWrites,
|
||||
reliableWrite,
|
||||
writableAuxiliaries),
|
||||
global,
|
||||
BluetoothCharacteristicPropertiesBinding::Wrap)
|
||||
}
|
||||
reflect_dom_object(
|
||||
Box::new(BluetoothCharacteristicProperties::new_inherited(
|
||||
broadcast,
|
||||
read,
|
||||
writeWithoutResponse,
|
||||
write,
|
||||
notify,
|
||||
indicate,
|
||||
authenticatedSignedWrites,
|
||||
reliableWrite,
|
||||
writableAuxiliaries
|
||||
)),
|
||||
global,
|
||||
BluetoothCharacteristicPropertiesBinding::Wrap
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
impl BluetoothCharacteristicPropertiesMethods for BluetoothCharacteristicProperties {
|
||||
// https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetoothcharacteristicproperties-broadcast
|
||||
|
|
|
@ -66,9 +66,7 @@ impl BluetoothDevice {
|
|||
name: Option<DOMString>,
|
||||
context: &Bluetooth)
|
||||
-> DomRoot<BluetoothDevice> {
|
||||
reflect_dom_object(box BluetoothDevice::new_inherited(id,
|
||||
name,
|
||||
context),
|
||||
reflect_dom_object(Box::new(BluetoothDevice::new_inherited(id, name, context)),
|
||||
global,
|
||||
BluetoothDeviceBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -41,7 +41,7 @@ impl BluetoothPermissionResult {
|
|||
}
|
||||
|
||||
pub fn new(global: &GlobalScope, status: &PermissionStatus) -> DomRoot<BluetoothPermissionResult> {
|
||||
reflect_dom_object(box BluetoothPermissionResult::new_inherited(status),
|
||||
reflect_dom_object(Box::new(BluetoothPermissionResult::new_inherited(status)),
|
||||
global,
|
||||
BluetoothPermissionResultBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -65,12 +65,13 @@ impl BluetoothRemoteGATTCharacteristic {
|
|||
properties: &BluetoothCharacteristicProperties,
|
||||
instanceID: String)
|
||||
-> DomRoot<BluetoothRemoteGATTCharacteristic> {
|
||||
reflect_dom_object(box BluetoothRemoteGATTCharacteristic::new_inherited(service,
|
||||
uuid,
|
||||
properties,
|
||||
instanceID),
|
||||
global,
|
||||
BluetoothRemoteGATTCharacteristicBinding::Wrap)
|
||||
reflect_dom_object(
|
||||
Box::new(BluetoothRemoteGATTCharacteristic::new_inherited(
|
||||
service, uuid, properties, instanceID
|
||||
)),
|
||||
global,
|
||||
BluetoothRemoteGATTCharacteristicBinding::Wrap
|
||||
)
|
||||
}
|
||||
|
||||
fn get_bluetooth_thread(&self) -> IpcSender<BluetoothRequest> {
|
||||
|
|
|
@ -52,11 +52,13 @@ impl BluetoothRemoteGATTDescriptor {
|
|||
uuid: DOMString,
|
||||
instanceID: String)
|
||||
-> DomRoot<BluetoothRemoteGATTDescriptor>{
|
||||
reflect_dom_object(box BluetoothRemoteGATTDescriptor::new_inherited(characteristic,
|
||||
uuid,
|
||||
instanceID),
|
||||
global,
|
||||
BluetoothRemoteGATTDescriptorBinding::Wrap)
|
||||
reflect_dom_object(
|
||||
Box::new(BluetoothRemoteGATTDescriptor::new_inherited(
|
||||
characteristic, uuid, instanceID
|
||||
)),
|
||||
global,
|
||||
BluetoothRemoteGATTDescriptorBinding::Wrap
|
||||
)
|
||||
}
|
||||
|
||||
fn get_bluetooth_thread(&self) -> IpcSender<BluetoothRequest> {
|
||||
|
|
|
@ -38,7 +38,7 @@ impl BluetoothRemoteGATTServer {
|
|||
}
|
||||
|
||||
pub fn new(global: &GlobalScope, device: &BluetoothDevice) -> DomRoot<BluetoothRemoteGATTServer> {
|
||||
reflect_dom_object(box BluetoothRemoteGATTServer::new_inherited(device),
|
||||
reflect_dom_object(Box::new(BluetoothRemoteGATTServer::new_inherited(device)),
|
||||
global,
|
||||
BluetoothRemoteGATTServerBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -50,12 +50,13 @@ impl BluetoothRemoteGATTService {
|
|||
isPrimary: bool,
|
||||
instanceID: String)
|
||||
-> DomRoot<BluetoothRemoteGATTService> {
|
||||
reflect_dom_object(box BluetoothRemoteGATTService::new_inherited(device,
|
||||
uuid,
|
||||
isPrimary,
|
||||
instanceID),
|
||||
global,
|
||||
BluetoothRemoteGATTServiceBinding::Wrap)
|
||||
reflect_dom_object(
|
||||
Box::new(BluetoothRemoteGATTService::new_inherited(
|
||||
device, uuid, isPrimary, instanceID
|
||||
)),
|
||||
global,
|
||||
BluetoothRemoteGATTServiceBinding::Wrap
|
||||
)
|
||||
}
|
||||
|
||||
fn get_instance_id(&self) -> String {
|
||||
|
|
|
@ -40,7 +40,7 @@ impl CanvasGradient {
|
|||
}
|
||||
|
||||
pub fn new(global: &GlobalScope, style: CanvasGradientStyle) -> DomRoot<CanvasGradient> {
|
||||
reflect_dom_object(box CanvasGradient::new_inherited(style),
|
||||
reflect_dom_object(Box::new(CanvasGradient::new_inherited(style)),
|
||||
global,
|
||||
CanvasGradientBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -50,10 +50,13 @@ impl CanvasPattern {
|
|||
repeat: RepetitionStyle,
|
||||
origin_clean: bool)
|
||||
-> DomRoot<CanvasPattern> {
|
||||
reflect_dom_object(box CanvasPattern::new_inherited(surface_data, surface_size,
|
||||
repeat, origin_clean),
|
||||
global,
|
||||
CanvasPatternBinding::Wrap)
|
||||
reflect_dom_object(
|
||||
Box::new(CanvasPattern::new_inherited(
|
||||
surface_data, surface_size, repeat, origin_clean
|
||||
)),
|
||||
global,
|
||||
CanvasPatternBinding::Wrap
|
||||
)
|
||||
}
|
||||
pub fn origin_is_clean(&self) -> bool {
|
||||
self.origin_clean
|
||||
|
|
|
@ -155,7 +155,9 @@ impl CanvasRenderingContext2D {
|
|||
let window = window_from_node(canvas);
|
||||
let image_cache = window.image_cache();
|
||||
let base_url = window.get_url();
|
||||
let boxed = box CanvasRenderingContext2D::new_inherited(global, Some(canvas), image_cache, base_url, size);
|
||||
let boxed = Box::new(CanvasRenderingContext2D::new_inherited(
|
||||
global, Some(canvas), image_cache, base_url, size
|
||||
));
|
||||
reflect_dom_object(boxed, global, CanvasRenderingContext2DBinding::Wrap)
|
||||
}
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@ impl Client {
|
|||
}
|
||||
|
||||
pub fn new(window: &Window) -> DomRoot<Client> {
|
||||
reflect_dom_object(box Client::new_inherited(window.get_url()),
|
||||
reflect_dom_object(Box::new(Client::new_inherited(window.get_url())),
|
||||
window,
|
||||
Wrap)
|
||||
}
|
||||
|
|
|
@ -34,7 +34,7 @@ impl CloseEvent {
|
|||
}
|
||||
|
||||
pub fn new_uninitialized(global: &GlobalScope) -> DomRoot<CloseEvent> {
|
||||
reflect_dom_object(box CloseEvent::new_inherited(false, 0, DOMString::new()),
|
||||
reflect_dom_object(Box::new(CloseEvent::new_inherited(false, 0, DOMString::new())),
|
||||
global,
|
||||
CloseEventBinding::Wrap)
|
||||
}
|
||||
|
@ -47,7 +47,7 @@ impl CloseEvent {
|
|||
code: u16,
|
||||
reason: DOMString)
|
||||
-> DomRoot<CloseEvent> {
|
||||
let event = box 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 event = ev.upcast::<Event>();
|
||||
|
|
|
@ -27,7 +27,7 @@ impl Comment {
|
|||
}
|
||||
|
||||
pub fn new(text: DOMString, document: &Document) -> DomRoot<Comment> {
|
||||
Node::reflect_node(box Comment::new_inherited(text, document),
|
||||
Node::reflect_node(Box::new(Comment::new_inherited(text, document)),
|
||||
document,
|
||||
CommentBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -26,10 +26,10 @@ impl CompositionEvent {
|
|||
view: Option<&Window>,
|
||||
detail: i32,
|
||||
data: DOMString) -> DomRoot<CompositionEvent> {
|
||||
let ev = reflect_dom_object(box CompositionEvent {
|
||||
let ev = reflect_dom_object(Box::new(CompositionEvent {
|
||||
uievent: UIEvent::new_inherited(),
|
||||
data: data,
|
||||
},
|
||||
}),
|
||||
window,
|
||||
CompositionEventBinding::Wrap);
|
||||
ev.uievent.InitUIEvent(type_, can_bubble, cancelable, view, detail);
|
||||
|
|
|
@ -34,7 +34,7 @@ impl Crypto {
|
|||
}
|
||||
|
||||
pub fn new(global: &GlobalScope) -> DomRoot<Crypto> {
|
||||
reflect_dom_object(box Crypto::new_inherited(), global, CryptoBinding::Wrap)
|
||||
reflect_dom_object(Box::new(Crypto::new_inherited()), global, CryptoBinding::Wrap)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@ impl CSSFontFaceRule {
|
|||
#[allow(unrooted_must_root)]
|
||||
pub fn new(window: &Window, parent_stylesheet: &CSSStyleSheet,
|
||||
fontfacerule: Arc<Locked<FontFaceRule>>) -> DomRoot<CSSFontFaceRule> {
|
||||
reflect_dom_object(box CSSFontFaceRule::new_inherited(parent_stylesheet, fontfacerule),
|
||||
reflect_dom_object(Box::new(CSSFontFaceRule::new_inherited(parent_stylesheet, fontfacerule)),
|
||||
window,
|
||||
CSSFontFaceRuleBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -35,7 +35,7 @@ impl CSSImportRule {
|
|||
pub fn new(window: &Window,
|
||||
parent_stylesheet: &CSSStyleSheet,
|
||||
import_rule: Arc<Locked<ImportRule>>) -> DomRoot<Self> {
|
||||
reflect_dom_object(box Self::new_inherited(parent_stylesheet, import_rule),
|
||||
reflect_dom_object(Box::new(Self::new_inherited(parent_stylesheet, import_rule)),
|
||||
window,
|
||||
CSSImportRuleBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -37,7 +37,7 @@ impl CSSKeyframeRule {
|
|||
#[allow(unrooted_must_root)]
|
||||
pub fn new(window: &Window, parent_stylesheet: &CSSStyleSheet,
|
||||
keyframerule: Arc<Locked<Keyframe>>) -> DomRoot<CSSKeyframeRule> {
|
||||
reflect_dom_object(box CSSKeyframeRule::new_inherited(parent_stylesheet, keyframerule),
|
||||
reflect_dom_object(Box::new(CSSKeyframeRule::new_inherited(parent_stylesheet, keyframerule)),
|
||||
window,
|
||||
CSSKeyframeRuleBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -42,7 +42,7 @@ impl CSSKeyframesRule {
|
|||
#[allow(unrooted_must_root)]
|
||||
pub fn new(window: &Window, parent_stylesheet: &CSSStyleSheet,
|
||||
keyframesrule: Arc<Locked<KeyframesRule>>) -> DomRoot<CSSKeyframesRule> {
|
||||
reflect_dom_object(box CSSKeyframesRule::new_inherited(parent_stylesheet, keyframesrule),
|
||||
reflect_dom_object(Box::new(CSSKeyframesRule::new_inherited(parent_stylesheet, keyframesrule)),
|
||||
window,
|
||||
CSSKeyframesRuleBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -45,7 +45,7 @@ impl CSSMediaRule {
|
|||
#[allow(unrooted_must_root)]
|
||||
pub fn new(window: &Window, parent_stylesheet: &CSSStyleSheet,
|
||||
mediarule: Arc<Locked<MediaRule>>) -> DomRoot<CSSMediaRule> {
|
||||
reflect_dom_object(box CSSMediaRule::new_inherited(parent_stylesheet, mediarule),
|
||||
reflect_dom_object(Box::new(CSSMediaRule::new_inherited(parent_stylesheet, mediarule)),
|
||||
window,
|
||||
CSSMediaRuleBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -34,7 +34,7 @@ impl CSSNamespaceRule {
|
|||
#[allow(unrooted_must_root)]
|
||||
pub fn new(window: &Window, parent_stylesheet: &CSSStyleSheet,
|
||||
namespacerule: Arc<Locked<NamespaceRule>>) -> DomRoot<CSSNamespaceRule> {
|
||||
reflect_dom_object(box CSSNamespaceRule::new_inherited(parent_stylesheet, namespacerule),
|
||||
reflect_dom_object(Box::new(CSSNamespaceRule::new_inherited(parent_stylesheet, namespacerule)),
|
||||
window,
|
||||
CSSNamespaceRuleBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -71,7 +71,7 @@ impl CSSRuleList {
|
|||
#[allow(unrooted_must_root)]
|
||||
pub fn new(window: &Window, parent_stylesheet: &CSSStyleSheet,
|
||||
rules: RulesSource) -> DomRoot<CSSRuleList> {
|
||||
reflect_dom_object(box CSSRuleList::new_inherited(parent_stylesheet, rules),
|
||||
reflect_dom_object(Box::new(CSSRuleList::new_inherited(parent_stylesheet, rules)),
|
||||
window,
|
||||
CSSRuleListBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -193,11 +193,11 @@ impl CSSStyleDeclaration {
|
|||
pseudo: Option<PseudoElement>,
|
||||
modification_access: CSSModificationAccess)
|
||||
-> DomRoot<CSSStyleDeclaration> {
|
||||
reflect_dom_object(box CSSStyleDeclaration::new_inherited(owner,
|
||||
pseudo,
|
||||
modification_access),
|
||||
global,
|
||||
CSSStyleDeclarationBinding::Wrap)
|
||||
reflect_dom_object(
|
||||
Box::new(CSSStyleDeclaration::new_inherited(owner, pseudo, modification_access)),
|
||||
global,
|
||||
CSSStyleDeclarationBinding::Wrap
|
||||
)
|
||||
}
|
||||
|
||||
fn get_computed_style(&self, property: PropertyId) -> DOMString {
|
||||
|
|
|
@ -43,7 +43,7 @@ impl CSSStyleRule {
|
|||
#[allow(unrooted_must_root)]
|
||||
pub fn new(window: &Window, parent_stylesheet: &CSSStyleSheet,
|
||||
stylerule: Arc<Locked<StyleRule>>) -> DomRoot<CSSStyleRule> {
|
||||
reflect_dom_object(box CSSStyleRule::new_inherited(parent_stylesheet, stylerule),
|
||||
reflect_dom_object(Box::new(CSSStyleRule::new_inherited(parent_stylesheet, stylerule)),
|
||||
window,
|
||||
CSSStyleRuleBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -51,7 +51,7 @@ impl CSSStyleSheet {
|
|||
href: Option<DOMString>,
|
||||
title: Option<DOMString>,
|
||||
stylesheet: Arc<StyleStyleSheet>) -> DomRoot<CSSStyleSheet> {
|
||||
reflect_dom_object(box CSSStyleSheet::new_inherited(owner, type_, href, title, stylesheet),
|
||||
reflect_dom_object(Box::new(CSSStyleSheet::new_inherited(owner, type_, href, title, stylesheet)),
|
||||
window,
|
||||
CSSStyleSheetBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -29,7 +29,7 @@ impl CSSStyleValue {
|
|||
}
|
||||
|
||||
pub fn new(global: &GlobalScope, value: String) -> DomRoot<CSSStyleValue> {
|
||||
reflect_dom_object(box CSSStyleValue::new_inherited(value), global, Wrap)
|
||||
reflect_dom_object(Box::new(CSSStyleValue::new_inherited(value)), global, Wrap)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -41,7 +41,7 @@ impl CSSSupportsRule {
|
|||
#[allow(unrooted_must_root)]
|
||||
pub fn new(window: &Window, parent_stylesheet: &CSSStyleSheet,
|
||||
supportsrule: Arc<Locked<SupportsRule>>) -> DomRoot<CSSSupportsRule> {
|
||||
reflect_dom_object(box CSSSupportsRule::new_inherited(parent_stylesheet, supportsrule),
|
||||
reflect_dom_object(Box::new(CSSSupportsRule::new_inherited(parent_stylesheet, supportsrule)),
|
||||
window,
|
||||
CSSSupportsRuleBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -32,7 +32,7 @@ impl CSSViewportRule {
|
|||
#[allow(unrooted_must_root)]
|
||||
pub fn new(window: &Window, parent_stylesheet: &CSSStyleSheet,
|
||||
viewportrule: Arc<Locked<ViewportRule>>) -> DomRoot<CSSViewportRule> {
|
||||
reflect_dom_object(box CSSViewportRule::new_inherited(parent_stylesheet, viewportrule),
|
||||
reflect_dom_object(Box::new(CSSViewportRule::new_inherited(parent_stylesheet, viewportrule)),
|
||||
window,
|
||||
CSSViewportRuleBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -68,7 +68,7 @@ impl CustomElementRegistry {
|
|||
}
|
||||
|
||||
pub fn new(window: &Window) -> DomRoot<CustomElementRegistry> {
|
||||
reflect_dom_object(box CustomElementRegistry::new_inherited(window),
|
||||
reflect_dom_object(Box::new(CustomElementRegistry::new_inherited(window)),
|
||||
window,
|
||||
CustomElementRegistryBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -35,7 +35,7 @@ impl CustomEvent {
|
|||
}
|
||||
|
||||
pub fn new_uninitialized(global: &GlobalScope) -> DomRoot<CustomEvent> {
|
||||
reflect_dom_object(box CustomEvent::new_inherited(),
|
||||
reflect_dom_object(Box::new(CustomEvent::new_inherited()),
|
||||
global,
|
||||
CustomEventBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -133,16 +133,18 @@ impl DedicatedWorkerGlobalScope {
|
|||
closing: Arc<AtomicBool>)
|
||||
-> DomRoot<DedicatedWorkerGlobalScope> {
|
||||
let cx = runtime.cx();
|
||||
let scope = box DedicatedWorkerGlobalScope::new_inherited(init,
|
||||
worker_url,
|
||||
from_devtools_receiver,
|
||||
runtime,
|
||||
parent_sender,
|
||||
own_sender,
|
||||
receiver,
|
||||
timer_event_chan,
|
||||
timer_event_port,
|
||||
closing);
|
||||
let scope = Box::new(DedicatedWorkerGlobalScope::new_inherited(
|
||||
init,
|
||||
worker_url,
|
||||
from_devtools_receiver,
|
||||
runtime,
|
||||
parent_sender,
|
||||
own_sender,
|
||||
receiver,
|
||||
timer_event_chan,
|
||||
timer_event_port,
|
||||
closing
|
||||
));
|
||||
unsafe {
|
||||
DedicatedWorkerGlobalScopeBinding::Wrap(cx, scope)
|
||||
}
|
||||
|
@ -193,8 +195,10 @@ impl DedicatedWorkerGlobalScope {
|
|||
&init.resource_threads.sender()) {
|
||||
Err(_) => {
|
||||
println!("error loading script {}", serialized_worker_url);
|
||||
parent_sender.send(CommonScriptMsg::Task(WorkerEvent,
|
||||
box SimpleWorkerErrorHandler::new(worker))).unwrap();
|
||||
parent_sender.send(CommonScriptMsg::Task(
|
||||
WorkerEvent,
|
||||
Box::new(SimpleWorkerErrorHandler::new(worker))
|
||||
)).unwrap();
|
||||
return;
|
||||
}
|
||||
Ok((metadata, bytes)) => (metadata, bytes)
|
||||
|
@ -211,10 +215,10 @@ impl DedicatedWorkerGlobalScope {
|
|||
let (timer_tx, timer_rx) = channel();
|
||||
let (timer_ipc_chan, timer_ipc_port) = ipc::channel().unwrap();
|
||||
let worker_for_route = worker.clone();
|
||||
ROUTER.add_route(timer_ipc_port.to_opaque(), box move |message| {
|
||||
ROUTER.add_route(timer_ipc_port.to_opaque(), Box::new(move |message| {
|
||||
let event = message.to().unwrap();
|
||||
timer_tx.send((worker_for_route.clone(), event)).unwrap();
|
||||
});
|
||||
}));
|
||||
|
||||
let global = DedicatedWorkerGlobalScope::new(
|
||||
init, url, devtools_mpsc_port, runtime,
|
||||
|
@ -257,19 +261,19 @@ impl DedicatedWorkerGlobalScope {
|
|||
}
|
||||
|
||||
pub fn script_chan(&self) -> Box<ScriptChan + Send> {
|
||||
box WorkerThreadWorkerChan {
|
||||
Box::new(WorkerThreadWorkerChan {
|
||||
sender: self.own_sender.clone(),
|
||||
worker: self.worker.borrow().as_ref().unwrap().clone(),
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
pub fn new_script_pair(&self) -> (Box<ScriptChan + Send>, Box<ScriptPort + Send>) {
|
||||
let (tx, rx) = channel();
|
||||
let chan = box SendableWorkerScriptChan {
|
||||
let chan = Box::new(SendableWorkerScriptChan {
|
||||
sender: tx,
|
||||
worker: self.worker.borrow().as_ref().unwrap().clone(),
|
||||
};
|
||||
(chan, box rx)
|
||||
});
|
||||
(chan, Box::new(rx))
|
||||
}
|
||||
|
||||
#[allow(unsafe_code)]
|
||||
|
@ -355,7 +359,7 @@ impl DedicatedWorkerGlobalScope {
|
|||
#[allow(unsafe_code)]
|
||||
pub fn forward_error_to_worker_object(&self, error_info: ErrorInfo) {
|
||||
let worker = self.worker.borrow().as_ref().unwrap().clone();
|
||||
let task = box task!(forward_error_to_worker_object: move || {
|
||||
let task = Box::new(task!(forward_error_to_worker_object: move || {
|
||||
let worker = worker.root();
|
||||
let global = worker.global();
|
||||
|
||||
|
@ -378,7 +382,7 @@ impl DedicatedWorkerGlobalScope {
|
|||
if event_status == EventStatus::NotCanceled {
|
||||
global.report_an_error(error_info, unsafe { NullHandleValue });
|
||||
}
|
||||
});
|
||||
}));
|
||||
// TODO: Should use the DOM manipulation task source.
|
||||
self.parent_sender.send(CommonScriptMsg::Task(WorkerEvent, task)).unwrap();
|
||||
}
|
||||
|
@ -401,9 +405,9 @@ impl DedicatedWorkerGlobalScopeMethods for DedicatedWorkerGlobalScope {
|
|||
unsafe fn PostMessage(&self, cx: *mut JSContext, message: HandleValue) -> ErrorResult {
|
||||
let data = StructuredCloneData::write(cx, message)?;
|
||||
let worker = self.worker.borrow().as_ref().unwrap().clone();
|
||||
let task = box task!(post_worker_message: move || {
|
||||
let task = Box::new(task!(post_worker_message: move || {
|
||||
Worker::handle_message(worker, data);
|
||||
});
|
||||
}));
|
||||
self.parent_sender.send(CommonScriptMsg::Task(WorkerEvent, task)).unwrap();
|
||||
Ok(())
|
||||
}
|
||||
|
|
|
@ -40,7 +40,7 @@ impl DissimilarOriginLocation {
|
|||
}
|
||||
|
||||
pub fn new(window: &DissimilarOriginWindow) -> DomRoot<DissimilarOriginLocation> {
|
||||
reflect_dom_object(box DissimilarOriginLocation::new_inherited(window),
|
||||
reflect_dom_object(Box::new(DissimilarOriginLocation::new_inherited(window)),
|
||||
window,
|
||||
DissimilarOriginLocationBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -52,7 +52,7 @@ impl DissimilarOriginWindow {
|
|||
let cx = global_to_clone_from.get_cx();
|
||||
// Any timer events fired on this window are ignored.
|
||||
let (timer_event_chan, _) = ipc::channel().unwrap();
|
||||
let win = box Self {
|
||||
let win = Box::new(Self {
|
||||
globalscope: GlobalScope::new_inherited(
|
||||
PipelineId::new(),
|
||||
global_to_clone_from.devtools_chan().cloned(),
|
||||
|
@ -69,7 +69,7 @@ impl DissimilarOriginWindow {
|
|||
),
|
||||
window_proxy: Dom::from_ref(window_proxy),
|
||||
location: Default::default(),
|
||||
};
|
||||
});
|
||||
unsafe { DissimilarOriginWindowBinding::Wrap(cx, win) }
|
||||
}
|
||||
|
||||
|
|
|
@ -2312,20 +2312,24 @@ impl Document {
|
|||
referrer: Option<String>,
|
||||
referrer_policy: Option<ReferrerPolicy>)
|
||||
-> DomRoot<Document> {
|
||||
let document = reflect_dom_object(box Document::new_inherited(window,
|
||||
has_browsing_context,
|
||||
url,
|
||||
origin,
|
||||
doctype,
|
||||
content_type,
|
||||
last_modified,
|
||||
activity,
|
||||
source,
|
||||
doc_loader,
|
||||
referrer,
|
||||
referrer_policy),
|
||||
window,
|
||||
DocumentBinding::Wrap);
|
||||
let document = reflect_dom_object(
|
||||
Box::new(Document::new_inherited(
|
||||
window,
|
||||
has_browsing_context,
|
||||
url,
|
||||
origin,
|
||||
doctype,
|
||||
content_type,
|
||||
last_modified,
|
||||
activity,
|
||||
source,
|
||||
doc_loader,
|
||||
referrer,
|
||||
referrer_policy
|
||||
)),
|
||||
window,
|
||||
DocumentBinding::Wrap
|
||||
);
|
||||
{
|
||||
let node = document.upcast::<Node>();
|
||||
node.set_owner_doc(&document);
|
||||
|
@ -3344,7 +3348,7 @@ impl DocumentMethods for Document {
|
|||
// https://html.spec.whatwg.org/multipage/#dom-document-images
|
||||
fn Images(&self) -> DomRoot<HTMLCollection> {
|
||||
self.images.or_init(|| {
|
||||
let filter = box ImagesFilter;
|
||||
let filter = Box::new(ImagesFilter);
|
||||
HTMLCollection::create(&self.window, self.upcast(), filter)
|
||||
})
|
||||
}
|
||||
|
@ -3352,7 +3356,7 @@ impl DocumentMethods for Document {
|
|||
// https://html.spec.whatwg.org/multipage/#dom-document-embeds
|
||||
fn Embeds(&self) -> DomRoot<HTMLCollection> {
|
||||
self.embeds.or_init(|| {
|
||||
let filter = box EmbedsFilter;
|
||||
let filter = Box::new(EmbedsFilter);
|
||||
HTMLCollection::create(&self.window, self.upcast(), filter)
|
||||
})
|
||||
}
|
||||
|
@ -3365,7 +3369,7 @@ impl DocumentMethods for Document {
|
|||
// https://html.spec.whatwg.org/multipage/#dom-document-links
|
||||
fn Links(&self) -> DomRoot<HTMLCollection> {
|
||||
self.links.or_init(|| {
|
||||
let filter = box LinksFilter;
|
||||
let filter = Box::new(LinksFilter);
|
||||
HTMLCollection::create(&self.window, self.upcast(), filter)
|
||||
})
|
||||
}
|
||||
|
@ -3373,7 +3377,7 @@ impl DocumentMethods for Document {
|
|||
// https://html.spec.whatwg.org/multipage/#dom-document-forms
|
||||
fn Forms(&self) -> DomRoot<HTMLCollection> {
|
||||
self.forms.or_init(|| {
|
||||
let filter = box FormsFilter;
|
||||
let filter = Box::new(FormsFilter);
|
||||
HTMLCollection::create(&self.window, self.upcast(), filter)
|
||||
})
|
||||
}
|
||||
|
@ -3381,7 +3385,7 @@ impl DocumentMethods for Document {
|
|||
// https://html.spec.whatwg.org/multipage/#dom-document-scripts
|
||||
fn Scripts(&self) -> DomRoot<HTMLCollection> {
|
||||
self.scripts.or_init(|| {
|
||||
let filter = box ScriptsFilter;
|
||||
let filter = Box::new(ScriptsFilter);
|
||||
HTMLCollection::create(&self.window, self.upcast(), filter)
|
||||
})
|
||||
}
|
||||
|
@ -3389,7 +3393,7 @@ impl DocumentMethods for Document {
|
|||
// https://html.spec.whatwg.org/multipage/#dom-document-anchors
|
||||
fn Anchors(&self) -> DomRoot<HTMLCollection> {
|
||||
self.anchors.or_init(|| {
|
||||
let filter = box AnchorsFilter;
|
||||
let filter = Box::new(AnchorsFilter);
|
||||
HTMLCollection::create(&self.window, self.upcast(), filter)
|
||||
})
|
||||
}
|
||||
|
@ -3398,7 +3402,7 @@ impl DocumentMethods for Document {
|
|||
fn Applets(&self) -> DomRoot<HTMLCollection> {
|
||||
// FIXME: This should be return OBJECT elements containing applets.
|
||||
self.applets.or_init(|| {
|
||||
let filter = box AppletsFilter;
|
||||
let filter = Box::new(AppletsFilter);
|
||||
HTMLCollection::create(&self.window, self.upcast(), filter)
|
||||
})
|
||||
}
|
||||
|
@ -3610,7 +3614,7 @@ impl DocumentMethods for Document {
|
|||
let filter = NamedElementFilter {
|
||||
name: name,
|
||||
};
|
||||
let collection = HTMLCollection::create(self.window(), root, box filter);
|
||||
let collection = HTMLCollection::create(self.window(), root, Box::new(filter));
|
||||
Some(NonZero::new_unchecked(collection.reflector().get_jsobject().get()))
|
||||
}
|
||||
|
||||
|
|
|
@ -34,7 +34,7 @@ impl DocumentFragment {
|
|||
}
|
||||
|
||||
pub fn new(document: &Document) -> DomRoot<DocumentFragment> {
|
||||
Node::reflect_node(box DocumentFragment::new_inherited(document),
|
||||
Node::reflect_node(Box::new(DocumentFragment::new_inherited(document)),
|
||||
document,
|
||||
DocumentFragmentBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -42,7 +42,7 @@ impl DocumentType {
|
|||
system_id: Option<DOMString>,
|
||||
document: &Document)
|
||||
-> DomRoot<DocumentType> {
|
||||
Node::reflect_node(box DocumentType::new_inherited(name, public_id, system_id, document),
|
||||
Node::reflect_node(Box::new(DocumentType::new_inherited(name, public_id, system_id, document)),
|
||||
document,
|
||||
DocumentTypeBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -52,7 +52,7 @@ impl DOMException {
|
|||
}
|
||||
|
||||
pub fn new(global: &GlobalScope, code: DOMErrorName) -> DomRoot<DOMException> {
|
||||
reflect_dom_object(box DOMException::new_inherited(code),
|
||||
reflect_dom_object(Box::new(DOMException::new_inherited(code)),
|
||||
global,
|
||||
DOMExceptionBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -43,7 +43,7 @@ impl DOMImplementation {
|
|||
|
||||
pub fn new(document: &Document) -> DomRoot<DOMImplementation> {
|
||||
let window = document.window();
|
||||
reflect_dom_object(box DOMImplementation::new_inherited(document),
|
||||
reflect_dom_object(Box::new(DOMImplementation::new_inherited(document)),
|
||||
window,
|
||||
DOMImplementationBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -23,7 +23,7 @@ impl DOMMatrix {
|
|||
#[allow(unrooted_must_root)]
|
||||
pub fn new(global: &GlobalScope, is2D: bool, matrix: Transform3D<f64>) -> DomRoot<Self> {
|
||||
let dommatrix = Self::new_inherited(is2D, matrix);
|
||||
reflect_dom_object(box dommatrix, global, Wrap)
|
||||
reflect_dom_object(Box::new(dommatrix), global, Wrap)
|
||||
}
|
||||
|
||||
pub fn new_inherited(is2D: bool, matrix: Transform3D<f64>) -> Self {
|
||||
|
|
|
@ -29,7 +29,7 @@ impl DOMMatrixReadOnly {
|
|||
#[allow(unrooted_must_root)]
|
||||
pub fn new(global: &GlobalScope, is2D: bool, matrix: Transform3D<f64>) -> DomRoot<Self> {
|
||||
let dommatrix = Self::new_inherited(is2D, matrix);
|
||||
reflect_dom_object(box dommatrix, global, Wrap)
|
||||
reflect_dom_object(Box::new(dommatrix), global, Wrap)
|
||||
}
|
||||
|
||||
pub fn new_inherited(is2D: bool, matrix: Transform3D<f64>) -> Self {
|
||||
|
|
|
@ -37,7 +37,7 @@ impl DOMParser {
|
|||
}
|
||||
|
||||
pub fn new(window: &Window) -> DomRoot<DOMParser> {
|
||||
reflect_dom_object(box DOMParser::new_inherited(window),
|
||||
reflect_dom_object(Box::new(DOMParser::new_inherited(window)),
|
||||
window,
|
||||
DOMParserBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -25,7 +25,7 @@ impl DOMPoint {
|
|||
}
|
||||
|
||||
pub fn new(global: &GlobalScope, x: f64, y: f64, z: f64, w: f64) -> DomRoot<DOMPoint> {
|
||||
reflect_dom_object(box DOMPoint::new_inherited(x, y, z, w), global, Wrap)
|
||||
reflect_dom_object(Box::new(DOMPoint::new_inherited(x, y, z, w)), global, Wrap)
|
||||
}
|
||||
|
||||
pub fn Constructor(global: &GlobalScope,
|
||||
|
|
|
@ -32,7 +32,7 @@ impl DOMPointReadOnly {
|
|||
}
|
||||
|
||||
pub fn new(global: &GlobalScope, x: f64, y: f64, z: f64, w: f64) -> DomRoot<DOMPointReadOnly> {
|
||||
reflect_dom_object(box DOMPointReadOnly::new_inherited(x, y, z, w),
|
||||
reflect_dom_object(Box::new(DOMPointReadOnly::new_inherited(x, y, z, w)),
|
||||
global,
|
||||
Wrap)
|
||||
}
|
||||
|
|
|
@ -43,7 +43,7 @@ impl DOMQuad {
|
|||
p2: &DOMPoint,
|
||||
p3: &DOMPoint,
|
||||
p4: &DOMPoint) -> DomRoot<DOMQuad> {
|
||||
reflect_dom_object(box DOMQuad::new_inherited(p1, p2, p3, p4),
|
||||
reflect_dom_object(Box::new(DOMQuad::new_inherited(p1, p2, p3, p4)),
|
||||
global,
|
||||
Wrap)
|
||||
}
|
||||
|
|
|
@ -25,7 +25,7 @@ impl DOMRect {
|
|||
}
|
||||
|
||||
pub fn new(global: &GlobalScope, x: f64, y: f64, width: f64, height: f64) -> DomRoot<DOMRect> {
|
||||
reflect_dom_object(box DOMRect::new_inherited(x, y, width, height),
|
||||
reflect_dom_object(Box::new(DOMRect::new_inherited(x, y, width, height)),
|
||||
global,
|
||||
DOMRectBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -36,7 +36,7 @@ impl DOMRectReadOnly {
|
|||
width: f64,
|
||||
height: f64)
|
||||
-> DomRoot<DOMRectReadOnly> {
|
||||
reflect_dom_object(box DOMRectReadOnly::new_inherited(x, y, width, height),
|
||||
reflect_dom_object(Box::new(DOMRectReadOnly::new_inherited(x, y, width, height)),
|
||||
global,
|
||||
Wrap)
|
||||
}
|
||||
|
|
|
@ -28,7 +28,7 @@ impl DOMStringMap {
|
|||
|
||||
pub fn new(element: &HTMLElement) -> DomRoot<DOMStringMap> {
|
||||
let window = window_from_node(element);
|
||||
reflect_dom_object(box DOMStringMap::new_inherited(element),
|
||||
reflect_dom_object(Box::new(DOMStringMap::new_inherited(element)),
|
||||
&*window,
|
||||
DOMStringMapBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -34,7 +34,7 @@ impl DOMTokenList {
|
|||
|
||||
pub fn new(element: &Element, local_name: &LocalName) -> DomRoot<DOMTokenList> {
|
||||
let window = window_from_node(element);
|
||||
reflect_dom_object(box DOMTokenList::new_inherited(element, local_name.clone()),
|
||||
reflect_dom_object(Box::new(DOMTokenList::new_inherited(element, local_name.clone())),
|
||||
&*window,
|
||||
DOMTokenListBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -281,7 +281,7 @@ impl Element {
|
|||
prefix: Option<Prefix>,
|
||||
document: &Document) -> DomRoot<Element> {
|
||||
Node::reflect_node(
|
||||
box Element::new_inherited(local_name, namespace, prefix, document),
|
||||
Box::new(Element::new_inherited(local_name, namespace, prefix, document)),
|
||||
document,
|
||||
ElementBinding::Wrap)
|
||||
}
|
||||
|
@ -3065,11 +3065,11 @@ pub struct ElementPerformFullscreenEnter {
|
|||
|
||||
impl ElementPerformFullscreenEnter {
|
||||
pub fn new(element: Trusted<Element>, promise: TrustedPromise, error: bool) -> Box<ElementPerformFullscreenEnter> {
|
||||
box ElementPerformFullscreenEnter {
|
||||
Box::new(ElementPerformFullscreenEnter {
|
||||
element: element,
|
||||
promise: promise,
|
||||
error: error,
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3108,10 +3108,10 @@ pub struct ElementPerformFullscreenExit {
|
|||
|
||||
impl ElementPerformFullscreenExit {
|
||||
pub fn new(element: Trusted<Element>, promise: TrustedPromise) -> Box<ElementPerformFullscreenExit> {
|
||||
box ElementPerformFullscreenExit {
|
||||
Box::new(ElementPerformFullscreenExit {
|
||||
element: element,
|
||||
promise: promise,
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -44,7 +44,7 @@ impl ErrorEvent {
|
|||
}
|
||||
|
||||
pub fn new_uninitialized(global: &GlobalScope) -> DomRoot<ErrorEvent> {
|
||||
reflect_dom_object(box ErrorEvent::new_inherited(),
|
||||
reflect_dom_object(Box::new(ErrorEvent::new_inherited()),
|
||||
global,
|
||||
ErrorEventBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -65,7 +65,7 @@ impl Event {
|
|||
}
|
||||
|
||||
pub fn new_uninitialized(global: &GlobalScope) -> DomRoot<Event> {
|
||||
reflect_dom_object(box Event::new_inherited(),
|
||||
reflect_dom_object(Box::new(Event::new_inherited()),
|
||||
global,
|
||||
EventBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -413,7 +413,7 @@ impl EventSource {
|
|||
}
|
||||
|
||||
fn new(global: &GlobalScope, url: ServoUrl, with_credentials: bool) -> DomRoot<EventSource> {
|
||||
reflect_dom_object(box EventSource::new_inherited(url, with_credentials),
|
||||
reflect_dom_object(Box::new(EventSource::new_inherited(url, with_credentials)),
|
||||
global,
|
||||
Wrap)
|
||||
}
|
||||
|
@ -486,9 +486,9 @@ impl EventSource {
|
|||
task_source: global.networking_task_source(),
|
||||
canceller: Some(global.task_canceller())
|
||||
};
|
||||
ROUTER.add_route(action_receiver.to_opaque(), box move |message| {
|
||||
ROUTER.add_route(action_receiver.to_opaque(), Box::new(move |message| {
|
||||
listener.notify_fetch(message.to().unwrap());
|
||||
});
|
||||
}));
|
||||
global.core_resource_thread().send(CoreResourceMsg::Fetch(request, action_sender)).unwrap();
|
||||
// Step 13
|
||||
Ok(ev)
|
||||
|
|
|
@ -34,7 +34,11 @@ impl ExtendableEvent {
|
|||
bubbles: bool,
|
||||
cancelable: bool)
|
||||
-> DomRoot<ExtendableEvent> {
|
||||
let ev = reflect_dom_object(box ExtendableEvent::new_inherited(), worker, ExtendableEventBinding::Wrap);
|
||||
let ev = reflect_dom_object(
|
||||
Box::new(ExtendableEvent::new_inherited()),
|
||||
worker,
|
||||
ExtendableEventBinding::Wrap
|
||||
);
|
||||
{
|
||||
let event = ev.upcast::<Event>();
|
||||
event.init_event(type_, bubbles, cancelable);
|
||||
|
|
|
@ -33,12 +33,12 @@ impl ExtendableMessageEvent {
|
|||
bubbles: bool, cancelable: bool,
|
||||
data: HandleValue, origin: DOMString, lastEventId: DOMString)
|
||||
-> DomRoot<ExtendableMessageEvent> {
|
||||
let ev = box ExtendableMessageEvent {
|
||||
let ev = Box::new(ExtendableMessageEvent {
|
||||
event: ExtendableEvent::new_inherited(),
|
||||
data: Heap::default(),
|
||||
origin: origin,
|
||||
lastEventId: lastEventId,
|
||||
};
|
||||
});
|
||||
let ev = reflect_dom_object(ev, global, ExtendableMessageEventBinding::Wrap);
|
||||
{
|
||||
let event = ev.upcast::<Event>();
|
||||
|
|
|
@ -45,7 +45,7 @@ impl File {
|
|||
#[allow(unrooted_must_root)]
|
||||
pub fn new(global: &GlobalScope, blob_impl: BlobImpl,
|
||||
name: DOMString, modified: Option<i64>, typeString: &str) -> DomRoot<File> {
|
||||
reflect_dom_object(box File::new_inherited(blob_impl, name, modified, typeString),
|
||||
reflect_dom_object(Box::new(File::new_inherited(blob_impl, name, modified, typeString)),
|
||||
global,
|
||||
FileBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -29,7 +29,7 @@ impl FileList {
|
|||
|
||||
#[allow(unrooted_must_root)]
|
||||
pub fn new(window: &Window, files: Vec<DomRoot<File>>) -> DomRoot<FileList> {
|
||||
reflect_dom_object(box FileList::new_inherited(files.iter().map(|r| Dom::from_ref(&**r)).collect()),
|
||||
reflect_dom_object(Box::new(FileList::new_inherited(files.iter().map(|r| Dom::from_ref(&**r)).collect())),
|
||||
window,
|
||||
FileListBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -104,7 +104,7 @@ impl FileReader {
|
|||
}
|
||||
|
||||
pub fn new(global: &GlobalScope) -> DomRoot<FileReader> {
|
||||
reflect_dom_object(box FileReader::new_inherited(),
|
||||
reflect_dom_object(Box::new(FileReader::new_inherited()),
|
||||
global, FileReaderBinding::Wrap)
|
||||
}
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@ impl FileReaderSync {
|
|||
}
|
||||
|
||||
pub fn new(global: &GlobalScope) -> DomRoot<FileReaderSync> {
|
||||
reflect_dom_object(box FileReaderSync::new_inherited(),
|
||||
reflect_dom_object(Box::new(FileReaderSync::new_inherited()),
|
||||
global, FileReaderSyncBinding::Wrap)
|
||||
}
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@ impl FocusEvent {
|
|||
}
|
||||
|
||||
pub fn new_uninitialized(window: &Window) -> DomRoot<FocusEvent> {
|
||||
reflect_dom_object(box FocusEvent::new_inherited(),
|
||||
reflect_dom_object(Box::new(FocusEvent::new_inherited()),
|
||||
window,
|
||||
FocusEventBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -31,7 +31,7 @@ impl ForceTouchEvent {
|
|||
pub fn new(window: &Window,
|
||||
type_: DOMString,
|
||||
force: f32) -> DomRoot<ForceTouchEvent> {
|
||||
let event = box ForceTouchEvent::new_inherited(force);
|
||||
let event = Box::new(ForceTouchEvent::new_inherited(force));
|
||||
let ev = reflect_dom_object(event, window, ForceTouchEventBinding::Wrap);
|
||||
ev.upcast::<UIEvent>().InitUIEvent(type_, true, true, Some(window), 0);
|
||||
ev
|
||||
|
|
|
@ -48,7 +48,7 @@ impl FormData {
|
|||
}
|
||||
|
||||
pub fn new(form: Option<&HTMLFormElement>, global: &GlobalScope) -> DomRoot<FormData> {
|
||||
reflect_dom_object(box FormData::new_inherited(form),
|
||||
reflect_dom_object(Box::new(FormData::new_inherited(form)),
|
||||
global, FormDataWrap)
|
||||
}
|
||||
|
||||
|
|
|
@ -75,18 +75,22 @@ impl Gamepad {
|
|||
let buttons = GamepadButtonList::new_from_vr(&global, &state.buttons);
|
||||
let pose = VRPose::new(&global, &state.pose);
|
||||
|
||||
let gamepad = reflect_dom_object(box Gamepad::new_inherited(state.gamepad_id,
|
||||
data.name.clone(),
|
||||
index,
|
||||
state.connected,
|
||||
state.timestamp,
|
||||
"".into(),
|
||||
&buttons,
|
||||
Some(&pose),
|
||||
data.hand.clone(),
|
||||
data.display_id),
|
||||
global,
|
||||
GamepadBinding::Wrap);
|
||||
let gamepad = reflect_dom_object(
|
||||
Box::new(Gamepad::new_inherited(
|
||||
state.gamepad_id,
|
||||
data.name.clone(),
|
||||
index,
|
||||
state.connected,
|
||||
state.timestamp,
|
||||
"".into(),
|
||||
&buttons,
|
||||
Some(&pose),
|
||||
data.hand.clone(),
|
||||
data.display_id
|
||||
)),
|
||||
global,
|
||||
GamepadBinding::Wrap
|
||||
);
|
||||
|
||||
let cx = global.get_cx();
|
||||
rooted!(in (cx) let mut array = ptr::null_mut());
|
||||
|
|
|
@ -30,7 +30,7 @@ impl GamepadButton {
|
|||
}
|
||||
|
||||
pub fn new(global: &GlobalScope, pressed: bool, touched: bool) -> DomRoot<GamepadButton> {
|
||||
reflect_dom_object(box GamepadButton::new_inherited(pressed, touched),
|
||||
reflect_dom_object(Box::new(GamepadButton::new_inherited(pressed, touched)),
|
||||
global,
|
||||
GamepadButtonBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -31,7 +31,7 @@ impl GamepadButtonList {
|
|||
rooted_vec!(let list <- buttons.iter()
|
||||
.map(|btn| GamepadButton::new(&global, btn.pressed, btn.touched)));
|
||||
|
||||
reflect_dom_object(box GamepadButtonList::new_inherited(list.r()),
|
||||
reflect_dom_object(Box::new(GamepadButtonList::new_inherited(list.r())),
|
||||
global,
|
||||
GamepadButtonListBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -42,9 +42,9 @@ impl GamepadEvent {
|
|||
cancelable: bool,
|
||||
gamepad: &Gamepad)
|
||||
-> DomRoot<GamepadEvent> {
|
||||
let ev = reflect_dom_object(box GamepadEvent::new_inherited(&gamepad),
|
||||
global,
|
||||
GamepadEventBinding::Wrap);
|
||||
let ev = reflect_dom_object(
|
||||
Box::new(GamepadEvent::new_inherited(&gamepad)), global, GamepadEventBinding::Wrap
|
||||
);
|
||||
{
|
||||
let event = ev.upcast::<Event>();
|
||||
event.init_event(type_, bubbles, cancelable);
|
||||
|
|
|
@ -27,7 +27,7 @@ impl GamepadList {
|
|||
}
|
||||
|
||||
pub fn new(global: &GlobalScope, list: &[&Gamepad]) -> DomRoot<GamepadList> {
|
||||
reflect_dom_object(box GamepadList::new_inherited(list),
|
||||
reflect_dom_object(Box::new(GamepadList::new_inherited(list)),
|
||||
global,
|
||||
GamepadListBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -33,7 +33,7 @@ impl HashChangeEvent {
|
|||
}
|
||||
|
||||
pub fn new_uninitialized(window: &Window) -> DomRoot<HashChangeEvent> {
|
||||
reflect_dom_object(box HashChangeEvent::new_inherited(String::new(), String::new()),
|
||||
reflect_dom_object(Box::new(HashChangeEvent::new_inherited(String::new(), String::new())),
|
||||
window,
|
||||
HashChangeEventBinding::Wrap)
|
||||
}
|
||||
|
@ -45,7 +45,7 @@ impl HashChangeEvent {
|
|||
old_url: String,
|
||||
new_url: String)
|
||||
-> DomRoot<HashChangeEvent> {
|
||||
let ev = reflect_dom_object(box HashChangeEvent::new_inherited(old_url, new_url),
|
||||
let ev = reflect_dom_object(Box::new(HashChangeEvent::new_inherited(old_url, new_url)),
|
||||
window,
|
||||
HashChangeEventBinding::Wrap);
|
||||
{
|
||||
|
|
|
@ -45,7 +45,7 @@ impl Headers {
|
|||
}
|
||||
|
||||
pub fn new(global: &GlobalScope) -> DomRoot<Headers> {
|
||||
reflect_dom_object(box Headers::new_inherited(), global, HeadersWrap)
|
||||
reflect_dom_object(Box::new(Headers::new_inherited()), global, HeadersWrap)
|
||||
}
|
||||
|
||||
// https://fetch.spec.whatwg.org/#dom-headers
|
||||
|
|
|
@ -33,7 +33,7 @@ impl History {
|
|||
}
|
||||
|
||||
pub fn new(window: &Window) -> DomRoot<History> {
|
||||
reflect_dom_object(box History::new_inherited(window),
|
||||
reflect_dom_object(Box::new(History::new_inherited(window)),
|
||||
window,
|
||||
HistoryBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -57,7 +57,7 @@ impl HTMLAnchorElement {
|
|||
pub fn new(local_name: LocalName,
|
||||
prefix: Option<Prefix>,
|
||||
document: &Document) -> DomRoot<HTMLAnchorElement> {
|
||||
Node::reflect_node(box HTMLAnchorElement::new_inherited(local_name, prefix, document),
|
||||
Node::reflect_node(Box::new(HTMLAnchorElement::new_inherited(local_name, prefix, document)),
|
||||
document,
|
||||
HTMLAnchorElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -34,7 +34,7 @@ impl HTMLAppletElement {
|
|||
pub fn new(local_name: LocalName,
|
||||
prefix: Option<Prefix>,
|
||||
document: &Document) -> DomRoot<HTMLAppletElement> {
|
||||
Node::reflect_node(box HTMLAppletElement::new_inherited(local_name, prefix, document),
|
||||
Node::reflect_node(Box::new(HTMLAppletElement::new_inherited(local_name, prefix, document)),
|
||||
document,
|
||||
HTMLAppletElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -232,7 +232,7 @@ impl HTMLAreaElement {
|
|||
pub fn new(local_name: LocalName,
|
||||
prefix: Option<Prefix>,
|
||||
document: &Document) -> DomRoot<HTMLAreaElement> {
|
||||
Node::reflect_node(box HTMLAreaElement::new_inherited(local_name, prefix, document),
|
||||
Node::reflect_node(Box::new(HTMLAreaElement::new_inherited(local_name, prefix, document)),
|
||||
document,
|
||||
HTMLAreaElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -29,7 +29,7 @@ impl HTMLAudioElement {
|
|||
pub fn new(local_name: LocalName,
|
||||
prefix: Option<Prefix>,
|
||||
document: &Document) -> DomRoot<HTMLAudioElement> {
|
||||
Node::reflect_node(box HTMLAudioElement::new_inherited(local_name, prefix, document),
|
||||
Node::reflect_node(Box::new(HTMLAudioElement::new_inherited(local_name, prefix, document)),
|
||||
document,
|
||||
HTMLAudioElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -33,7 +33,7 @@ impl HTMLBaseElement {
|
|||
pub fn new(local_name: LocalName,
|
||||
prefix: Option<Prefix>,
|
||||
document: &Document) -> DomRoot<HTMLBaseElement> {
|
||||
Node::reflect_node(box HTMLBaseElement::new_inherited(local_name, prefix, document),
|
||||
Node::reflect_node(Box::new(HTMLBaseElement::new_inherited(local_name, prefix, document)),
|
||||
document,
|
||||
HTMLBaseElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -43,7 +43,7 @@ impl HTMLBodyElement {
|
|||
#[allow(unrooted_must_root)]
|
||||
pub fn new(local_name: LocalName, prefix: Option<Prefix>, document: &Document)
|
||||
-> DomRoot<HTMLBodyElement> {
|
||||
Node::reflect_node(box HTMLBodyElement::new_inherited(local_name, prefix, document),
|
||||
Node::reflect_node(Box::new(HTMLBodyElement::new_inherited(local_name, prefix, document)),
|
||||
document,
|
||||
HTMLBodyElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -26,7 +26,7 @@ impl HTMLBRElement {
|
|||
pub fn new(local_name: LocalName,
|
||||
prefix: Option<Prefix>,
|
||||
document: &Document) -> DomRoot<HTMLBRElement> {
|
||||
Node::reflect_node(box HTMLBRElement::new_inherited(local_name, prefix, document),
|
||||
Node::reflect_node(Box::new(HTMLBRElement::new_inherited(local_name, prefix, document)),
|
||||
document,
|
||||
HTMLBRElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -62,7 +62,7 @@ impl HTMLButtonElement {
|
|||
pub fn new(local_name: LocalName,
|
||||
prefix: Option<Prefix>,
|
||||
document: &Document) -> DomRoot<HTMLButtonElement> {
|
||||
Node::reflect_node(box HTMLButtonElement::new_inherited(local_name, prefix, document),
|
||||
Node::reflect_node(Box::new(HTMLButtonElement::new_inherited(local_name, prefix, document)),
|
||||
document,
|
||||
HTMLButtonElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -68,7 +68,7 @@ impl HTMLCanvasElement {
|
|||
pub fn new(local_name: LocalName,
|
||||
prefix: Option<Prefix>,
|
||||
document: &Document) -> DomRoot<HTMLCanvasElement> {
|
||||
Node::reflect_node(box HTMLCanvasElement::new_inherited(local_name, prefix, document),
|
||||
Node::reflect_node(Box::new(HTMLCanvasElement::new_inherited(local_name, prefix, document)),
|
||||
document,
|
||||
HTMLCanvasElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -82,7 +82,7 @@ impl HTMLCollection {
|
|||
|
||||
#[allow(unrooted_must_root)]
|
||||
pub fn new(window: &Window, root: &Node, filter: Box<CollectionFilter + 'static>) -> DomRoot<HTMLCollection> {
|
||||
reflect_dom_object(box HTMLCollection::new_inherited(root, filter),
|
||||
reflect_dom_object(Box::new(HTMLCollection::new_inherited(root, filter)),
|
||||
window, HTMLCollectionBinding::Wrap)
|
||||
}
|
||||
|
||||
|
@ -126,7 +126,7 @@ impl HTMLCollection {
|
|||
true
|
||||
}
|
||||
}
|
||||
return HTMLCollection::create(window, root, box AllFilter);
|
||||
return HTMLCollection::create(window, root, Box::new(AllFilter));
|
||||
}
|
||||
|
||||
#[derive(HeapSizeOf, JSTraceable)]
|
||||
|
@ -148,7 +148,7 @@ impl HTMLCollection {
|
|||
ascii_lower_qualified_name: qualified_name.to_ascii_lowercase(),
|
||||
qualified_name: qualified_name,
|
||||
};
|
||||
HTMLCollection::create(window, root, box filter)
|
||||
HTMLCollection::create(window, root, Box::new(filter))
|
||||
}
|
||||
|
||||
fn match_element(elem: &Element, qualified_name: &LocalName) -> bool {
|
||||
|
@ -182,7 +182,7 @@ impl HTMLCollection {
|
|||
let filter = TagNameNSFilter {
|
||||
qname: qname
|
||||
};
|
||||
HTMLCollection::create(window, root, box filter)
|
||||
HTMLCollection::create(window, root, Box::new(filter))
|
||||
}
|
||||
|
||||
pub fn by_class_name(window: &Window, root: &Node, classes: DOMString)
|
||||
|
@ -208,7 +208,7 @@ impl HTMLCollection {
|
|||
let filter = ClassNameFilter {
|
||||
classes: classes
|
||||
};
|
||||
HTMLCollection::create(window, root, box filter)
|
||||
HTMLCollection::create(window, root, Box::new(filter))
|
||||
}
|
||||
|
||||
pub fn children(window: &Window, root: &Node) -> DomRoot<HTMLCollection> {
|
||||
|
@ -219,7 +219,7 @@ impl HTMLCollection {
|
|||
root.is_parent_of(elem.upcast())
|
||||
}
|
||||
}
|
||||
HTMLCollection::create(window, root, box ElementChildFilter)
|
||||
HTMLCollection::create(window, root, Box::new(ElementChildFilter))
|
||||
}
|
||||
|
||||
pub fn elements_iter_after<'a>(&'a self, after: &'a Node) -> impl Iterator<Item=DomRoot<Element>> + 'a {
|
||||
|
|
|
@ -30,7 +30,7 @@ impl HTMLDataElement {
|
|||
pub fn new(local_name: LocalName,
|
||||
prefix: Option<Prefix>,
|
||||
document: &Document) -> DomRoot<HTMLDataElement> {
|
||||
Node::reflect_node(box HTMLDataElement::new_inherited(local_name, prefix, document),
|
||||
Node::reflect_node(Box::new(HTMLDataElement::new_inherited(local_name, prefix, document)),
|
||||
document,
|
||||
HTMLDataElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -34,7 +34,7 @@ impl HTMLDataListElement {
|
|||
pub fn new(local_name: LocalName,
|
||||
prefix: Option<Prefix>,
|
||||
document: &Document) -> DomRoot<HTMLDataListElement> {
|
||||
Node::reflect_node(box HTMLDataListElement::new_inherited(local_name, prefix, document),
|
||||
Node::reflect_node(Box::new(HTMLDataListElement::new_inherited(local_name, prefix, document)),
|
||||
document,
|
||||
HTMLDataListElementBinding::Wrap)
|
||||
}
|
||||
|
@ -50,7 +50,7 @@ impl HTMLDataListElementMethods for HTMLDataListElement {
|
|||
elem.is::<HTMLOptionElement>()
|
||||
}
|
||||
}
|
||||
let filter = box HTMLDataListOptionsFilter;
|
||||
let filter = Box::new(HTMLDataListOptionsFilter);
|
||||
let window = window_from_node(self);
|
||||
HTMLCollection::create(&window, self.upcast(), filter)
|
||||
}
|
||||
|
|
|
@ -40,7 +40,7 @@ impl HTMLDetailsElement {
|
|||
pub fn new(local_name: LocalName,
|
||||
prefix: Option<Prefix>,
|
||||
document: &Document) -> DomRoot<HTMLDetailsElement> {
|
||||
Node::reflect_node(box HTMLDetailsElement::new_inherited(local_name, prefix, document),
|
||||
Node::reflect_node(Box::new(HTMLDetailsElement::new_inherited(local_name, prefix, document)),
|
||||
document,
|
||||
HTMLDetailsElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -37,7 +37,7 @@ impl HTMLDialogElement {
|
|||
pub fn new(local_name: LocalName,
|
||||
prefix: Option<Prefix>,
|
||||
document: &Document) -> DomRoot<HTMLDialogElement> {
|
||||
Node::reflect_node(box HTMLDialogElement::new_inherited(local_name, prefix, document),
|
||||
Node::reflect_node(Box::new(HTMLDialogElement::new_inherited(local_name, prefix, document)),
|
||||
document,
|
||||
HTMLDialogElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -29,7 +29,7 @@ impl HTMLDirectoryElement {
|
|||
pub fn new(local_name: LocalName,
|
||||
prefix: Option<Prefix>,
|
||||
document: &Document) -> DomRoot<HTMLDirectoryElement> {
|
||||
Node::reflect_node(box HTMLDirectoryElement::new_inherited(local_name, prefix, document),
|
||||
Node::reflect_node(Box::new(HTMLDirectoryElement::new_inherited(local_name, prefix, document)),
|
||||
document,
|
||||
HTMLDirectoryElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -29,7 +29,7 @@ impl HTMLDivElement {
|
|||
pub fn new(local_name: LocalName,
|
||||
prefix: Option<Prefix>,
|
||||
document: &Document) -> DomRoot<HTMLDivElement> {
|
||||
Node::reflect_node(box HTMLDivElement::new_inherited(local_name, prefix, document),
|
||||
Node::reflect_node(Box::new(HTMLDivElement::new_inherited(local_name, prefix, document)),
|
||||
document,
|
||||
HTMLDivElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -27,7 +27,7 @@ impl HTMLDListElement {
|
|||
pub fn new(local_name: LocalName,
|
||||
prefix: Option<Prefix>,
|
||||
document: &Document) -> DomRoot<HTMLDListElement> {
|
||||
Node::reflect_node(box HTMLDListElement::new_inherited(local_name, prefix, document),
|
||||
Node::reflect_node(Box::new(HTMLDListElement::new_inherited(local_name, prefix, document)),
|
||||
document,
|
||||
HTMLDListElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -62,7 +62,7 @@ impl HTMLElement {
|
|||
|
||||
#[allow(unrooted_must_root)]
|
||||
pub fn new(local_name: LocalName, prefix: Option<Prefix>, document: &Document) -> DomRoot<HTMLElement> {
|
||||
Node::reflect_node(box HTMLElement::new_inherited(local_name, prefix, document),
|
||||
Node::reflect_node(Box::new(HTMLElement::new_inherited(local_name, prefix, document)),
|
||||
document,
|
||||
HTMLElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -26,7 +26,7 @@ impl HTMLEmbedElement {
|
|||
pub fn new(local_name: LocalName,
|
||||
prefix: Option<Prefix>,
|
||||
document: &Document) -> DomRoot<HTMLEmbedElement> {
|
||||
Node::reflect_node(box HTMLEmbedElement::new_inherited(local_name, prefix, document),
|
||||
Node::reflect_node(Box::new(HTMLEmbedElement::new_inherited(local_name, prefix, document)),
|
||||
document,
|
||||
HTMLEmbedElementBinding::Wrap)
|
||||
}
|
||||
|
|
|
@ -43,7 +43,7 @@ impl HTMLFieldSetElement {
|
|||
pub fn new(local_name: LocalName,
|
||||
prefix: Option<Prefix>,
|
||||
document: &Document) -> DomRoot<HTMLFieldSetElement> {
|
||||
Node::reflect_node(box HTMLFieldSetElement::new_inherited(local_name, prefix, document),
|
||||
Node::reflect_node(Box::new(HTMLFieldSetElement::new_inherited(local_name, prefix, document)),
|
||||
document,
|
||||
HTMLFieldSetElementBinding::Wrap)
|
||||
}
|
||||
|
@ -60,7 +60,7 @@ impl HTMLFieldSetElementMethods for HTMLFieldSetElement {
|
|||
.map_or(false, HTMLElement::is_listed_element)
|
||||
}
|
||||
}
|
||||
let filter = box ElementsFilter;
|
||||
let filter = Box::new(ElementsFilter);
|
||||
let window = window_from_node(self);
|
||||
HTMLCollection::create(&window, self.upcast(), filter)
|
||||
}
|
||||
|
|
|
@ -37,7 +37,7 @@ impl HTMLFontElement {
|
|||
pub fn new(local_name: LocalName,
|
||||
prefix: Option<Prefix>,
|
||||
document: &Document) -> DomRoot<HTMLFontElement> {
|
||||
Node::reflect_node(box HTMLFontElement::new_inherited(local_name, prefix, document),
|
||||
Node::reflect_node(Box::new(HTMLFontElement::new_inherited(local_name, prefix, document)),
|
||||
document,
|
||||
HTMLFontElementBinding::Wrap)
|
||||
}
|
||||
|
|
Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше
Загрузка…
Ссылка в новой задаче