From 577370746e2ce3da7fa25a20b8e1bbeed319df65 Mon Sep 17 00:00:00 2001 From: Anthony Ramine Date: Tue, 26 Sep 2017 01:32:40 +0200 Subject: [PATCH] Rename DOMRefCell to DomRefCell I don't want to do such a gratuitous rename, but with all the other types now having "Dom" as part of their name, and especially with "DomOnceCell", I feel like the other cell type that we already have should also follow the convention. That argument loses weight though when we realise there is still DOMString and other things. --- components/script/dom/attr.rs | 6 +-- components/script/dom/beforeunloadevent.rs | 6 +-- components/script/dom/bindings/cell.rs | 18 +++---- components/script/dom/bindings/trace.rs | 4 +- components/script/dom/blob.rs | 14 ++--- components/script/dom/bluetooth.rs | 12 ++--- components/script/dom/bluetoothdevice.rs | 14 ++--- .../script/dom/bluetoothpermissionresult.rs | 6 +-- .../dom/bluetoothremotegattcharacteristic.rs | 6 +-- .../dom/bluetoothremotegattdescriptor.rs | 6 +-- components/script/dom/canvasgradient.rs | 6 +-- .../script/dom/canvasrenderingcontext2d.rs | 14 ++--- components/script/dom/characterdata.rs | 6 +-- components/script/dom/crypto.rs | 6 +-- components/script/dom/cssrulelist.rs | 6 +-- .../script/dom/customelementregistry.rs | 18 +++---- .../script/dom/dedicatedworkerglobalscope.rs | 6 +-- components/script/dom/document.rs | 54 +++++++++---------- components/script/dom/dommatrixreadonly.rs | 6 +-- components/script/dom/element.rs | 32 +++++------ components/script/dom/errorevent.rs | 10 ++-- components/script/dom/event.rs | 6 +-- components/script/dom/eventsource.rs | 10 ++-- components/script/dom/eventtarget.rs | 6 +-- components/script/dom/filereader.rs | 12 ++--- components/script/dom/formdata.rs | 6 +-- components/script/dom/gamepadlist.rs | 6 +-- components/script/dom/globalscope.rs | 6 +-- components/script/dom/headers.rs | 6 +-- components/script/dom/htmlanchorelement.rs | 6 +-- components/script/dom/htmlcanvaselement.rs | 6 +-- components/script/dom/htmldialogelement.rs | 6 +-- components/script/dom/htmlformelement.rs | 6 +-- components/script/dom/htmliframeelement.rs | 6 +-- components/script/dom/htmlimageelement.rs | 10 ++-- components/script/dom/htmlinputelement.rs | 14 ++--- components/script/dom/htmllinkelement.rs | 6 +-- components/script/dom/htmlmediaelement.rs | 16 +++--- components/script/dom/htmlmetaelement.rs | 6 +-- components/script/dom/htmlobjectelement.rs | 6 +-- components/script/dom/htmlstyleelement.rs | 6 +-- components/script/dom/htmltextareaelement.rs | 10 ++-- components/script/dom/keyboardevent.rs | 10 ++-- components/script/dom/mediaquerylist.rs | 6 +-- components/script/dom/mod.rs | 2 +- components/script/dom/mutationobserver.rs | 6 +-- components/script/dom/node.rs | 4 +- .../script/dom/paintworkletglobalscope.rs | 18 +++---- components/script/dom/performance.rs | 10 ++-- components/script/dom/performanceobserver.rs | 8 +-- .../dom/performanceobserverentrylist.rs | 6 +-- components/script/dom/request.rs | 14 ++--- components/script/dom/response.rs | 34 ++++++------ components/script/dom/serviceworker.rs | 6 +-- components/script/dom/servoparser/mod.rs | 18 +++---- components/script/dom/testbindingiterable.rs | 6 +-- .../script/dom/testbindingpairiterable.rs | 6 +-- .../script/dom/testworkletglobalscope.rs | 4 +- components/script/dom/url.rs | 6 +-- components/script/dom/urlsearchparams.rs | 6 +-- components/script/dom/vr.rs | 10 ++-- components/script/dom/vrdisplay.rs | 22 ++++---- .../script/dom/vrdisplaycapabilities.rs | 6 +-- components/script/dom/vreyeparameters.rs | 6 +-- components/script/dom/vrfieldofview.rs | 6 +-- components/script/dom/vrstageparameters.rs | 6 +-- .../ext/webglvertexarrayobjectoes.rs | 6 +-- .../script/dom/webgl_extensions/extensions.rs | 10 ++-- components/script/dom/webglbuffer.rs | 6 +-- components/script/dom/webglframebuffer.rs | 22 ++++---- .../script/dom/webglrenderingcontext.rs | 6 +-- components/script/dom/webglshader.rs | 10 ++-- components/script/dom/webgltexture.rs | 6 +-- components/script/dom/websocket.rs | 10 ++-- components/script/dom/window.rs | 28 +++++----- components/script/dom/xmlhttprequest.rs | 50 ++++++++--------- components/script/microtask.rs | 4 +- components/script/script_thread.rs | 34 ++++++------ components/script/serviceworkerjob.rs | 6 +-- components/script/test.rs | 2 +- components/script/timers.rs | 10 ++-- .../script_plugins/unrooted_must_root.rs | 4 +- python/tidy/servo_tidy/tidy.py | 6 +-- .../tidy/servo_tidy_tests/ban-domrefcell.rs | 6 +-- python/tidy/servo_tidy_tests/test_tidy.py | 2 +- 85 files changed, 436 insertions(+), 436 deletions(-) diff --git a/components/script/dom/attr.rs b/components/script/dom/attr.rs index ea9f1f23a78..36b0c4c8c26 100644 --- a/components/script/dom/attr.rs +++ b/components/script/dom/attr.rs @@ -3,7 +3,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ use devtools_traits::AttrInfo; -use dom::bindings::cell::DOMRefCell; +use dom::bindings::cell::DomRefCell; use dom::bindings::codegen::Bindings::AttrBinding::{self, AttrMethods}; use dom::bindings::inheritance::Castable; use dom::bindings::reflector::{Reflector, reflect_dom_object}; @@ -29,7 +29,7 @@ use style::attr::{AttrIdentifier, AttrValue}; pub struct Attr { reflector_: Reflector, identifier: AttrIdentifier, - value: DOMRefCell, + value: DomRefCell, /// the element that owns this attribute. owner: MutNullableDom, @@ -51,7 +51,7 @@ impl Attr { namespace: namespace, prefix: prefix, }, - value: DOMRefCell::new(value), + value: DomRefCell::new(value), owner: MutNullableDom::new(owner), } } diff --git a/components/script/dom/beforeunloadevent.rs b/components/script/dom/beforeunloadevent.rs index dc435a20620..0f5f476ab59 100644 --- a/components/script/dom/beforeunloadevent.rs +++ b/components/script/dom/beforeunloadevent.rs @@ -4,7 +4,7 @@ #![allow(dead_code)] -use dom::bindings::cell::DOMRefCell; +use dom::bindings::cell::DomRefCell; use dom::bindings::codegen::Bindings::BeforeUnloadEventBinding; use dom::bindings::codegen::Bindings::BeforeUnloadEventBinding::BeforeUnloadEventMethods; use dom::bindings::codegen::Bindings::EventBinding::EventMethods; @@ -21,14 +21,14 @@ use servo_atoms::Atom; #[dom_struct] pub struct BeforeUnloadEvent { event: Event, - return_value: DOMRefCell, + return_value: DomRefCell, } impl BeforeUnloadEvent { fn new_inherited() -> BeforeUnloadEvent { BeforeUnloadEvent { event: Event::new_inherited(), - return_value: DOMRefCell::new(DOMString::new()), + return_value: DomRefCell::new(DOMString::new()), } } diff --git a/components/script/dom/bindings/cell.rs b/components/script/dom/bindings/cell.rs index 8e82de94381..2ae54fce97a 100644 --- a/components/script/dom/bindings/cell.rs +++ b/components/script/dom/bindings/cell.rs @@ -12,14 +12,14 @@ use style::thread_state; /// This extends the API of `core::cell::RefCell` to allow unsafe access in /// certain situations, with dynamic checking in debug builds. #[derive(Clone, Debug, Default, HeapSizeOf, PartialEq)] -pub struct DOMRefCell { +pub struct DomRefCell { value: RefCell, } -// Functionality specific to Servo's `DOMRefCell` type +// Functionality specific to Servo's `DomRefCell` type // =================================================== -impl DOMRefCell { +impl DomRefCell { /// Return a reference to the contents. /// /// For use in the layout thread only. @@ -59,10 +59,10 @@ impl DOMRefCell { // Functionality duplicated with `core::cell::RefCell` // =================================================== -impl DOMRefCell { - /// Create a new `DOMRefCell` containing `value`. - pub fn new(value: T) -> DOMRefCell { - DOMRefCell { +impl DomRefCell { + /// Create a new `DomRefCell` containing `value`. + pub fn new(value: T) -> DomRefCell { + DomRefCell { value: RefCell::new(value), } } @@ -79,7 +79,7 @@ impl DOMRefCell { /// /// Panics if the value is currently mutably borrowed. pub fn borrow(&self) -> Ref { - self.try_borrow().expect("DOMRefCell already mutably borrowed") + self.try_borrow().expect("DomRefCell already mutably borrowed") } /// Mutably borrows the wrapped value. @@ -93,7 +93,7 @@ impl DOMRefCell { /// /// Panics if the value is currently borrowed. pub fn borrow_mut(&self) -> RefMut { - self.try_borrow_mut().expect("DOMRefCell already borrowed") + self.try_borrow_mut().expect("DomRefCell already borrowed") } /// Attempts to immutably borrow the wrapped value. diff --git a/components/script/dom/bindings/trace.rs b/components/script/dom/bindings/trace.rs index 74b78fa013a..56b48b5750c 100644 --- a/components/script/dom/bindings/trace.rs +++ b/components/script/dom/bindings/trace.rs @@ -38,7 +38,7 @@ use canvas_traits::webgl::{WebGLReceiver, WebGLSender, WebGLShaderId, WebGLTextu use cssparser::RGBA; use devtools_traits::{CSSError, TimelineMarkerType, WorkerId}; use dom::abstractworker::SharedRt; -use dom::bindings::cell::DOMRefCell; +use dom::bindings::cell::DomRefCell; use dom::bindings::error::Error; use dom::bindings::refcounted::{Trusted, TrustedPromise}; use dom::bindings::reflector::{DomObject, Reflector}; @@ -202,7 +202,7 @@ unsafe impl JSTraceable for UnsafeCell { } } -unsafe impl JSTraceable for DOMRefCell { +unsafe impl JSTraceable for DomRefCell { unsafe fn trace(&self, trc: *mut JSTracer) { (*self).borrow_for_gc_trace().trace(trc) } diff --git a/components/script/dom/blob.rs b/components/script/dom/blob.rs index 835c17c9334..7317f9f8d56 100644 --- a/components/script/dom/blob.rs +++ b/components/script/dom/blob.rs @@ -2,7 +2,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -use dom::bindings::cell::DOMRefCell; +use dom::bindings::cell::DomRefCell; use dom::bindings::codegen::Bindings::BlobBinding; use dom::bindings::codegen::Bindings::BlobBinding::BlobMethods; use dom::bindings::codegen::UnionTypes::BlobOrString; @@ -27,7 +27,7 @@ use uuid::Uuid; pub struct FileBlob { id: Uuid, name: Option, - cache: DOMRefCell>>, + cache: DomRefCell>>, size: u64, } @@ -59,7 +59,7 @@ impl BlobImpl { BlobImpl::File(FileBlob { id: file_id, name: Some(name), - cache: DOMRefCell::new(None), + cache: DomRefCell::new(None), size: size, }) } @@ -70,7 +70,7 @@ impl BlobImpl { pub struct Blob { reflector_: Reflector, #[ignore_heap_size_of = "No clear owner"] - blob_impl: DOMRefCell, + blob_impl: DomRefCell, /// content-type string type_string: String, } @@ -88,7 +88,7 @@ impl Blob { pub fn new_inherited(blob_impl: BlobImpl, type_string: String) -> Blob { Blob { reflector_: Reflector::new(), - blob_impl: DOMRefCell::new(blob_impl), + blob_impl: DomRefCell::new(blob_impl), // NOTE: Guarding the format correctness here, // https://w3c.github.io/FileAPI/#dfn-type type_string: normalize_type_string(&type_string), @@ -237,7 +237,7 @@ impl Blob { *self.blob_impl.borrow_mut() = BlobImpl::File(FileBlob { id: id.clone(), name: None, - cache: DOMRefCell::new(Some(bytes.to_vec())), + cache: DomRefCell::new(Some(bytes.to_vec())), size: bytes.len() as u64, }); id @@ -262,7 +262,7 @@ impl Blob { *self.blob_impl.borrow_mut() = BlobImpl::File(FileBlob { id: new_id.clone(), name: None, - cache: DOMRefCell::new(None), + cache: DomRefCell::new(None), size: rel_pos.to_abs_range(parent_len as usize).len() as u64, }); diff --git a/components/script/dom/bluetooth.rs b/components/script/dom/bluetooth.rs index 34f5e37ba61..1815a1a07bc 100644 --- a/components/script/dom/bluetooth.rs +++ b/components/script/dom/bluetooth.rs @@ -8,7 +8,7 @@ use bluetooth_traits::blocklist::{Blocklist, uuid_is_blocklisted}; use bluetooth_traits::scanfilter::{BluetoothScanfilter, BluetoothScanfilterSequence}; use bluetooth_traits::scanfilter::{RequestDeviceoptions, ServiceUUIDSequence}; use core::clone::Clone; -use dom::bindings::cell::DOMRefCell; +use dom::bindings::cell::DomRefCell; use dom::bindings::codegen::Bindings::BluetoothBinding::{self, BluetoothDataFilterInit, BluetoothLEScanFilterInit}; use dom::bindings::codegen::Bindings::BluetoothBinding::{BluetoothMethods, RequestDeviceOptions}; use dom::bindings::codegen::Bindings::BluetoothPermissionResultBinding::BluetoothPermissionDescriptor; @@ -65,13 +65,13 @@ pub struct AllowedBluetoothDevice { #[derive(HeapSizeOf, JSTraceable)] pub struct BluetoothExtraPermissionData { - allowed_devices: DOMRefCell>, + allowed_devices: DomRefCell>, } impl BluetoothExtraPermissionData { pub fn new() -> BluetoothExtraPermissionData { BluetoothExtraPermissionData { - allowed_devices: DOMRefCell::new(Vec::new()), + allowed_devices: DomRefCell::new(Vec::new()), } } @@ -120,14 +120,14 @@ where #[dom_struct] pub struct Bluetooth { eventtarget: EventTarget, - device_instance_map: DOMRefCell>>, + device_instance_map: DomRefCell>>, } impl Bluetooth { pub fn new_inherited() -> Bluetooth { Bluetooth { eventtarget: EventTarget::new_inherited(), - device_instance_map: DOMRefCell::new(HashMap::new()), + device_instance_map: DomRefCell::new(HashMap::new()), } } @@ -141,7 +141,7 @@ impl Bluetooth { self.global().as_window().bluetooth_thread() } - pub fn get_device_map(&self) -> &DOMRefCell>> { + pub fn get_device_map(&self) -> &DomRefCell>> { &self.device_instance_map } diff --git a/components/script/dom/bluetoothdevice.rs b/components/script/dom/bluetoothdevice.rs index d98a1ed42f5..ce2f2845b2a 100644 --- a/components/script/dom/bluetoothdevice.rs +++ b/components/script/dom/bluetoothdevice.rs @@ -4,7 +4,7 @@ use bluetooth_traits::{BluetoothCharacteristicMsg, BluetoothDescriptorMsg}; use bluetooth_traits::{BluetoothRequest, BluetoothResponse, BluetoothServiceMsg}; -use dom::bindings::cell::DOMRefCell; +use dom::bindings::cell::DomRefCell; use dom::bindings::codegen::Bindings::BluetoothDeviceBinding; use dom::bindings::codegen::Bindings::BluetoothDeviceBinding::BluetoothDeviceMethods; use dom::bindings::codegen::Bindings::BluetoothRemoteGATTServerBinding::BluetoothRemoteGATTServerMethods; @@ -37,9 +37,9 @@ pub struct BluetoothDevice { name: Option, gatt: MutNullableDom, context: Dom, - attribute_instance_map: (DOMRefCell>>, - DOMRefCell>>, - DOMRefCell>>), + attribute_instance_map: (DomRefCell>>, + DomRefCell>>, + DomRefCell>>), watching_advertisements: Cell, } @@ -54,9 +54,9 @@ impl BluetoothDevice { name: name, gatt: Default::default(), context: Dom::from_ref(context), - attribute_instance_map: (DOMRefCell::new(HashMap::new()), - DOMRefCell::new(HashMap::new()), - DOMRefCell::new(HashMap::new())), + attribute_instance_map: (DomRefCell::new(HashMap::new()), + DomRefCell::new(HashMap::new()), + DomRefCell::new(HashMap::new())), watching_advertisements: Cell::new(false), } } diff --git a/components/script/dom/bluetoothpermissionresult.rs b/components/script/dom/bluetoothpermissionresult.rs index 05aeaf06520..57e22968726 100644 --- a/components/script/dom/bluetoothpermissionresult.rs +++ b/components/script/dom/bluetoothpermissionresult.rs @@ -3,7 +3,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ use bluetooth_traits::{BluetoothRequest, BluetoothResponse}; -use dom::bindings::cell::DOMRefCell; +use dom::bindings::cell::DomRefCell; use dom::bindings::codegen::Bindings::BluetoothPermissionResultBinding::{self, BluetoothPermissionResultMethods}; use dom::bindings::codegen::Bindings::NavigatorBinding::NavigatorBinding::NavigatorMethods; use dom::bindings::codegen::Bindings::PermissionStatusBinding::{PermissionName, PermissionState}; @@ -26,7 +26,7 @@ use std::rc::Rc; #[dom_struct] pub struct BluetoothPermissionResult { status: PermissionStatus, - devices: DOMRefCell>>, + devices: DomRefCell>>, } impl BluetoothPermissionResult { @@ -34,7 +34,7 @@ impl BluetoothPermissionResult { fn new_inherited(status: &PermissionStatus) -> BluetoothPermissionResult { let result = BluetoothPermissionResult { status: PermissionStatus::new_inherited(status.get_query()), - devices: DOMRefCell::new(Vec::new()), + devices: DomRefCell::new(Vec::new()), }; result.status.set_state(status.State()); result diff --git a/components/script/dom/bluetoothremotegattcharacteristic.rs b/components/script/dom/bluetoothremotegattcharacteristic.rs index 276afafa7bc..daefa2dea2f 100644 --- a/components/script/dom/bluetoothremotegattcharacteristic.rs +++ b/components/script/dom/bluetoothremotegattcharacteristic.rs @@ -4,7 +4,7 @@ use bluetooth_traits::{BluetoothRequest, BluetoothResponse, GATTType}; use bluetooth_traits::blocklist::{Blocklist, uuid_is_blocklisted}; -use dom::bindings::cell::DOMRefCell; +use dom::bindings::cell::DomRefCell; use dom::bindings::codegen::Bindings::BluetoothCharacteristicPropertiesBinding:: BluetoothCharacteristicPropertiesMethods; use dom::bindings::codegen::Bindings::BluetoothRemoteGATTCharacteristicBinding; @@ -39,7 +39,7 @@ pub struct BluetoothRemoteGATTCharacteristic { service: Dom, uuid: DOMString, properties: Dom, - value: DOMRefCell>, + value: DomRefCell>, instance_id: String, } @@ -54,7 +54,7 @@ impl BluetoothRemoteGATTCharacteristic { service: Dom::from_ref(service), uuid: uuid, properties: Dom::from_ref(properties), - value: DOMRefCell::new(None), + value: DomRefCell::new(None), instance_id: instance_id, } } diff --git a/components/script/dom/bluetoothremotegattdescriptor.rs b/components/script/dom/bluetoothremotegattdescriptor.rs index b9f33b0313e..66a07e3b4f0 100644 --- a/components/script/dom/bluetoothremotegattdescriptor.rs +++ b/components/script/dom/bluetoothremotegattdescriptor.rs @@ -4,7 +4,7 @@ use bluetooth_traits::{BluetoothRequest, BluetoothResponse}; use bluetooth_traits::blocklist::{Blocklist, uuid_is_blocklisted}; -use dom::bindings::cell::DOMRefCell; +use dom::bindings::cell::DomRefCell; use dom::bindings::codegen::Bindings::BluetoothRemoteGATTCharacteristicBinding:: BluetoothRemoteGATTCharacteristicMethods; use dom::bindings::codegen::Bindings::BluetoothRemoteGATTDescriptorBinding; @@ -29,7 +29,7 @@ pub struct BluetoothRemoteGATTDescriptor { reflector_: Reflector, characteristic: Dom, uuid: DOMString, - value: DOMRefCell>, + value: DomRefCell>, instance_id: String, } @@ -42,7 +42,7 @@ impl BluetoothRemoteGATTDescriptor { reflector_: Reflector::new(), characteristic: Dom::from_ref(characteristic), uuid: uuid, - value: DOMRefCell::new(None), + value: DomRefCell::new(None), instance_id: instance_id, } } diff --git a/components/script/dom/canvasgradient.rs b/components/script/dom/canvasgradient.rs index afa782b6e9d..b6568119cfb 100644 --- a/components/script/dom/canvasgradient.rs +++ b/components/script/dom/canvasgradient.rs @@ -5,7 +5,7 @@ use canvas_traits::canvas::{CanvasGradientStop, FillOrStrokeStyle, LinearGradientStyle, RadialGradientStyle}; use cssparser::{Parser, ParserInput, RGBA}; use cssparser::Color as CSSColor; -use dom::bindings::cell::DOMRefCell; +use dom::bindings::cell::DomRefCell; use dom::bindings::codegen::Bindings::CanvasGradientBinding; use dom::bindings::codegen::Bindings::CanvasGradientBinding::CanvasGradientMethods; use dom::bindings::error::{Error, ErrorResult}; @@ -21,7 +21,7 @@ use dom_struct::dom_struct; pub struct CanvasGradient { reflector_: Reflector, style: CanvasGradientStyle, - stops: DOMRefCell>, + stops: DomRefCell>, } #[derive(Clone, HeapSizeOf, JSTraceable)] @@ -35,7 +35,7 @@ impl CanvasGradient { CanvasGradient { reflector_: Reflector::new(), style: style, - stops: DOMRefCell::new(Vec::new()), + stops: DomRefCell::new(Vec::new()), } } diff --git a/components/script/dom/canvasrenderingcontext2d.rs b/components/script/dom/canvasrenderingcontext2d.rs index cf898b06880..b9e7def9a1c 100644 --- a/components/script/dom/canvasrenderingcontext2d.rs +++ b/components/script/dom/canvasrenderingcontext2d.rs @@ -8,7 +8,7 @@ use canvas_traits::canvas::{LineCapStyle, LineJoinStyle, LinearGradientStyle}; use canvas_traits::canvas::{RadialGradientStyle, RepetitionStyle, byte_swap_and_premultiply}; use cssparser::{Parser, ParserInput, RGBA}; use cssparser::Color as CSSColor; -use dom::bindings::cell::DOMRefCell; +use dom::bindings::cell::DomRefCell; use dom::bindings::codegen::Bindings::CSSStyleDeclarationBinding::CSSStyleDeclarationMethods; use dom::bindings::codegen::Bindings::CanvasRenderingContext2DBinding; use dom::bindings::codegen::Bindings::CanvasRenderingContext2DBinding::CanvasFillRule; @@ -71,12 +71,12 @@ pub struct CanvasRenderingContext2D { #[ignore_heap_size_of = "Arc"] image_cache: Arc, /// Any missing image URLs. - missing_image_urls: DOMRefCell>, + missing_image_urls: DomRefCell>, /// The base URL for resolving CSS image URL values. /// Needed because of https://github.com/servo/servo/issues/17625 base_url: ServoUrl, - state: DOMRefCell, - saved_states: DOMRefCell>, + state: DomRefCell, + saved_states: DomRefCell>, origin_clean: Cell, } @@ -140,10 +140,10 @@ impl CanvasRenderingContext2D { ipc_renderer: ipc_renderer, canvas: canvas.map(Dom::from_ref), image_cache: image_cache, - missing_image_urls: DOMRefCell::new(Vec::new()), + missing_image_urls: DomRefCell::new(Vec::new()), base_url: base_url, - state: DOMRefCell::new(CanvasContextState::new()), - saved_states: DOMRefCell::new(Vec::new()), + state: DomRefCell::new(CanvasContextState::new()), + saved_states: DomRefCell::new(Vec::new()), origin_clean: Cell::new(true), } } diff --git a/components/script/dom/characterdata.rs b/components/script/dom/characterdata.rs index 38a30e8ef50..4d6c3a8f011 100644 --- a/components/script/dom/characterdata.rs +++ b/components/script/dom/characterdata.rs @@ -4,7 +4,7 @@ //! DOM bindings for `CharacterData`. -use dom::bindings::cell::DOMRefCell; +use dom::bindings::cell::DomRefCell; use dom::bindings::codegen::Bindings::CharacterDataBinding::CharacterDataMethods; use dom::bindings::codegen::Bindings::NodeBinding::NodeBinding::NodeMethods; use dom::bindings::codegen::Bindings::ProcessingInstructionBinding::ProcessingInstructionMethods; @@ -29,14 +29,14 @@ use std::cell::Ref; #[dom_struct] pub struct CharacterData { node: Node, - data: DOMRefCell, + data: DomRefCell, } impl CharacterData { pub fn new_inherited(data: DOMString, document: &Document) -> CharacterData { CharacterData { node: Node::new_inherited(document), - data: DOMRefCell::new(data), + data: DomRefCell::new(data), } } diff --git a/components/script/dom/crypto.rs b/components/script/dom/crypto.rs index 117f1ff2b1f..afde6f47be9 100644 --- a/components/script/dom/crypto.rs +++ b/components/script/dom/crypto.rs @@ -3,7 +3,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ use core::nonzero::NonZero; -use dom::bindings::cell::DOMRefCell; +use dom::bindings::cell::DomRefCell; use dom::bindings::codegen::Bindings::CryptoBinding; use dom::bindings::codegen::Bindings::CryptoBinding::CryptoMethods; use dom::bindings::error::{Error, Fallible}; @@ -22,14 +22,14 @@ unsafe_no_jsmanaged_fields!(ServoRng); pub struct Crypto { reflector_: Reflector, #[ignore_heap_size_of = "Defined in rand"] - rng: DOMRefCell, + rng: DomRefCell, } impl Crypto { fn new_inherited() -> Crypto { Crypto { reflector_: Reflector::new(), - rng: DOMRefCell::new(ServoRng::new()), + rng: DomRefCell::new(ServoRng::new()), } } diff --git a/components/script/dom/cssrulelist.rs b/components/script/dom/cssrulelist.rs index 8fdef21c4d0..1690b2f71d1 100644 --- a/components/script/dom/cssrulelist.rs +++ b/components/script/dom/cssrulelist.rs @@ -2,7 +2,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -use dom::bindings::cell::DOMRefCell; +use dom::bindings::cell::DomRefCell; use dom::bindings::codegen::Bindings::CSSRuleListBinding; use dom::bindings::codegen::Bindings::CSSRuleListBinding::CSSRuleListMethods; use dom::bindings::error::{Error, ErrorResult, Fallible}; @@ -39,7 +39,7 @@ pub struct CSSRuleList { parent_stylesheet: Dom, #[ignore_heap_size_of = "Arc"] rules: RulesSource, - dom_rules: DOMRefCell>> + dom_rules: DomRefCell>> } pub enum RulesSource { @@ -64,7 +64,7 @@ impl CSSRuleList { reflector_: Reflector::new(), parent_stylesheet: Dom::from_ref(parent_stylesheet), rules: rules, - dom_rules: DOMRefCell::new(dom_rules), + dom_rules: DomRefCell::new(dom_rules), } } diff --git a/components/script/dom/customelementregistry.rs b/components/script/dom/customelementregistry.rs index 25a824c5d78..503605428ab 100644 --- a/components/script/dom/customelementregistry.rs +++ b/components/script/dom/customelementregistry.rs @@ -3,7 +3,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ use dom::bindings::callback::{CallbackContainer, ExceptionHandling}; -use dom::bindings::cell::DOMRefCell; +use dom::bindings::cell::DomRefCell; use dom::bindings::codegen::Bindings::CustomElementRegistryBinding; use dom::bindings::codegen::Bindings::CustomElementRegistryBinding::CustomElementRegistryMethods; use dom::bindings::codegen::Bindings::CustomElementRegistryBinding::ElementDefinitionOptions; @@ -48,12 +48,12 @@ pub struct CustomElementRegistry { window: Dom, #[ignore_heap_size_of = "Rc"] - when_defined: DOMRefCell>>, + when_defined: DomRefCell>>, element_definition_is_running: Cell, #[ignore_heap_size_of = "Rc"] - definitions: DOMRefCell>>, + definitions: DomRefCell>>, } impl CustomElementRegistry { @@ -61,9 +61,9 @@ impl CustomElementRegistry { CustomElementRegistry { reflector_: Reflector::new(), window: Dom::from_ref(window), - when_defined: DOMRefCell::new(HashMap::new()), + when_defined: DomRefCell::new(HashMap::new()), element_definition_is_running: Cell::new(false), - definitions: DOMRefCell::new(HashMap::new()), + definitions: DomRefCell::new(HashMap::new()), } } @@ -404,7 +404,7 @@ pub struct CustomElementDefinition { pub callbacks: LifecycleCallbacks, - pub construction_stack: DOMRefCell>, + pub construction_stack: DomRefCell>, } impl CustomElementDefinition { @@ -627,7 +627,7 @@ enum BackupElementQueueFlag { #[derive(HeapSizeOf, JSTraceable)] #[must_root] pub struct CustomElementReactionStack { - stack: DOMRefCell>, + stack: DomRefCell>, backup_queue: ElementQueue, processing_backup_element_queue: Cell, } @@ -635,7 +635,7 @@ pub struct CustomElementReactionStack { impl CustomElementReactionStack { pub fn new() -> CustomElementReactionStack { CustomElementReactionStack { - stack: DOMRefCell::new(Vec::new()), + stack: DomRefCell::new(Vec::new()), backup_queue: ElementQueue::new(), processing_backup_element_queue: Cell::new(BackupElementQueueFlag::NotProcessing), } @@ -776,7 +776,7 @@ impl CustomElementReactionStack { #[derive(HeapSizeOf, JSTraceable)] #[must_root] struct ElementQueue { - queue: DOMRefCell>>, + queue: DomRefCell>>, } impl ElementQueue { diff --git a/components/script/dom/dedicatedworkerglobalscope.rs b/components/script/dom/dedicatedworkerglobalscope.rs index c77c857db5f..a5273865283 100644 --- a/components/script/dom/dedicatedworkerglobalscope.rs +++ b/components/script/dom/dedicatedworkerglobalscope.rs @@ -6,7 +6,7 @@ use devtools; use devtools_traits::DevtoolScriptControlMsg; use dom::abstractworker::{SharedRt, SimpleWorkerErrorHandler, WorkerScriptMsg}; use dom::abstractworkerglobalscope::{SendableWorkerScriptChan, WorkerThreadWorkerChan}; -use dom::bindings::cell::DOMRefCell; +use dom::bindings::cell::DomRefCell; use dom::bindings::codegen::Bindings::DedicatedWorkerGlobalScopeBinding; use dom::bindings::codegen::Bindings::DedicatedWorkerGlobalScopeBinding::DedicatedWorkerGlobalScopeMethods; use dom::bindings::error::{ErrorInfo, ErrorResult}; @@ -87,7 +87,7 @@ pub struct DedicatedWorkerGlobalScope { #[ignore_heap_size_of = "Defined in std"] timer_event_port: Receiver<(TrustedWorkerAddress, TimerEvent)>, #[ignore_heap_size_of = "Trusted has unclear ownership like Dom"] - worker: DOMRefCell>, + worker: DomRefCell>, #[ignore_heap_size_of = "Can't measure trait objects"] /// Sender to the parent thread. parent_sender: Box, @@ -116,7 +116,7 @@ impl DedicatedWorkerGlobalScope { own_sender: own_sender, timer_event_port: timer_event_port, parent_sender: parent_sender, - worker: DOMRefCell::new(None), + worker: DomRefCell::new(None), } } diff --git a/components/script/dom/document.rs b/components/script/dom/document.rs index 48e4103e76e..7b6bd5e793c 100644 --- a/components/script/dom/document.rs +++ b/components/script/dom/document.rs @@ -10,7 +10,7 @@ use dom::activation::{ActivationSource, synthetic_click_activation}; use dom::attr::Attr; use dom::beforeunloadevent::BeforeUnloadEvent; use dom::bindings::callback::ExceptionHandling; -use dom::bindings::cell::DOMRefCell; +use dom::bindings::cell::DomRefCell; use dom::bindings::codegen::Bindings::DOMRectBinding::DOMRectMethods; use dom::bindings::codegen::Bindings::DocumentBinding; use dom::bindings::codegen::Bindings::DocumentBinding::{DocumentMethods, DocumentReadyState, ElementCreationOptions}; @@ -231,14 +231,14 @@ pub struct Document { has_browsing_context: bool, is_html_document: bool, activity: Cell, - url: DOMRefCell, + url: DomRefCell, #[ignore_heap_size_of = "defined in selectors"] quirks_mode: Cell, /// Caches for the getElement methods - id_map: DOMRefCell>>>, - tag_map: DOMRefCell>>, - tagns_map: DOMRefCell>>, - classes_map: DOMRefCell, Dom>>, + id_map: DomRefCell>>>, + tag_map: DomRefCell>>, + tagns_map: DomRefCell>>, + classes_map: DomRefCell, Dom>>, images: MutNullableDom, embeds: MutNullableDom, links: MutNullableDom, @@ -250,7 +250,7 @@ pub struct Document { /// Can be acquired once for accessing many objects. style_shared_lock: StyleSharedRwLock, /// List of stylesheets associated with nodes in this document. |None| if the list needs to be refreshed. - stylesheets: DOMRefCell>, + stylesheets: DomRefCell>, stylesheet_list: MutNullableDom, ready_state: Cell, /// Whether the DOMContentLoaded event has already been dispatched. @@ -262,7 +262,7 @@ pub struct Document { /// The script element that is currently executing. current_script: MutNullableDom, /// https://html.spec.whatwg.org/multipage/#pending-parsing-blocking-script - pending_parsing_blocking_script: DOMRefCell>, + pending_parsing_blocking_script: DomRefCell>, /// Number of stylesheets that block executing the next parser-inserted script script_blocking_stylesheets_count: Cell, /// https://html.spec.whatwg.org/multipage/#list-of-scripts-that-will-execute-when-the-document-has-finished-parsing @@ -270,7 +270,7 @@ pub struct Document { /// https://html.spec.whatwg.org/multipage/#list-of-scripts-that-will-execute-in-order-as-soon-as-possible asap_in_order_scripts_list: PendingInOrderScriptVec, /// https://html.spec.whatwg.org/multipage/#set-of-scripts-that-will-execute-as-soon-as-possible - asap_scripts_set: DOMRefCell>>, + asap_scripts_set: DomRefCell>>, /// https://html.spec.whatwg.org/multipage/#concept-n-noscript /// True if scripting is enabled for all scripts in this document scripting_enabled: bool, @@ -279,14 +279,14 @@ pub struct Document { animation_frame_ident: Cell, /// https://html.spec.whatwg.org/multipage/#list-of-animation-frame-callbacks /// List of animation frame callbacks - animation_frame_list: DOMRefCell)>>, + animation_frame_list: DomRefCell)>>, /// Whether we're in the process of running animation callbacks. /// /// Tracking this is not necessary for correctness. Instead, it is an optimization to avoid /// sending needless `ChangeRunningAnimationsState` messages to the compositor. running_animation_callbacks: Cell, /// Tracks all outstanding loads related to this document. - loader: DOMRefCell, + loader: DomRefCell, /// The current active HTML parser, to allow resuming after interruptions. current_parser: MutNullableDom, /// When we should kick off a reflow. This happens during parsing. @@ -298,12 +298,12 @@ pub struct Document { appropriate_template_contents_owner_document: MutNullableDom, /// Information on elements needing restyle to ship over to the layout thread when the /// time comes. - pending_restyles: DOMRefCell, PendingRestyle>>, + pending_restyles: DomRefCell, PendingRestyle>>, /// This flag will be true if layout suppressed a reflow attempt that was /// needed in order for the page to be painted. needs_paint: Cell, /// http://w3c.github.io/touch-events/#dfn-active-touch-point - active_touch_points: DOMRefCell>>, + active_touch_points: DomRefCell>>, /// Navigation Timing properties: /// https://w3c.github.io/navigation-timing/#sec-PerformanceNavigationTiming dom_loading: Cell, @@ -326,7 +326,7 @@ pub struct Document { target_element: MutNullableDom, /// https://w3c.github.io/uievents/#event-type-dblclick #[ignore_heap_size_of = "Defined in std"] - last_click_info: DOMRefCell)>>, + last_click_info: DomRefCell)>>, /// https://html.spec.whatwg.org/multipage/#ignore-destructive-writes-counter ignore_destructive_writes_counter: Cell, /// The number of spurious `requestAnimationFrame()` requests we've received. @@ -347,7 +347,7 @@ pub struct Document { /// whenever any element with the same ID as the form attribute /// is inserted or removed from the document. /// See https://html.spec.whatwg.org/multipage/#form-owner - form_id_listener_map: DOMRefCell>>>, + form_id_listener_map: DomRefCell>>>, } #[derive(HeapSizeOf, JSTraceable)] @@ -2230,17 +2230,17 @@ impl Document { }), }, last_modified: last_modified, - url: DOMRefCell::new(url), + url: DomRefCell::new(url), // https://dom.spec.whatwg.org/#concept-document-quirks quirks_mode: Cell::new(QuirksMode::NoQuirks), // https://dom.spec.whatwg.org/#concept-document-encoding encoding: Cell::new(UTF_8), is_html_document: is_html_document == IsHTMLDocument::HTMLDocument, activity: Cell::new(activity), - id_map: DOMRefCell::new(HashMap::new()), - tag_map: DOMRefCell::new(HashMap::new()), - tagns_map: DOMRefCell::new(HashMap::new()), - classes_map: DOMRefCell::new(HashMap::new()), + id_map: DomRefCell::new(HashMap::new()), + tag_map: DomRefCell::new(HashMap::new()), + tagns_map: DomRefCell::new(HashMap::new()), + classes_map: DomRefCell::new(HashMap::new()), images: Default::default(), embeds: Default::default(), links: Default::default(), @@ -2263,7 +2263,7 @@ impl Document { PER_PROCESS_AUTHOR_SHARED_LOCK.clone() //StyleSharedRwLock::new() }, - stylesheets: DOMRefCell::new(StylesheetSet::new()), + stylesheets: DomRefCell::new(StylesheetSet::new()), stylesheet_list: MutNullableDom::new(None), ready_state: Cell::new(ready_state), domcontentloaded_dispatched: Cell::new(domcontentloaded_dispatched), @@ -2277,16 +2277,16 @@ impl Document { asap_scripts_set: Default::default(), scripting_enabled: has_browsing_context == HasBrowsingContext::Yes, animation_frame_ident: Cell::new(0), - animation_frame_list: DOMRefCell::new(vec![]), + animation_frame_list: DomRefCell::new(vec![]), running_animation_callbacks: Cell::new(false), - loader: DOMRefCell::new(doc_loader), + loader: DomRefCell::new(doc_loader), current_parser: Default::default(), reflow_timeout: Cell::new(None), base_element: Default::default(), appropriate_template_contents_owner_document: Default::default(), - pending_restyles: DOMRefCell::new(HashMap::new()), + pending_restyles: DomRefCell::new(HashMap::new()), needs_paint: Cell::new(false), - active_touch_points: DOMRefCell::new(Vec::new()), + active_touch_points: DomRefCell::new(Vec::new()), dom_loading: Cell::new(Default::default()), dom_interactive: Cell::new(Default::default()), dom_content_loaded_event_start: Cell::new(Default::default()), @@ -2300,7 +2300,7 @@ impl Document { referrer: referrer, referrer_policy: Cell::new(referrer_policy), target_element: MutNullableDom::new(None), - last_click_info: DOMRefCell::new(None), + last_click_info: DomRefCell::new(None), ignore_destructive_writes_counter: Default::default(), spurious_animation_frames: Cell::new(0), dom_count: Cell::new(1), @@ -4081,7 +4081,7 @@ impl AnimationFrameCallback { #[derive(Default, HeapSizeOf, JSTraceable)] #[must_root] struct PendingInOrderScriptVec { - scripts: DOMRefCell>, + scripts: DomRefCell>, } impl PendingInOrderScriptVec { diff --git a/components/script/dom/dommatrixreadonly.rs b/components/script/dom/dommatrixreadonly.rs index df4e0d74dfe..0b6e8be3b6a 100644 --- a/components/script/dom/dommatrixreadonly.rs +++ b/components/script/dom/dommatrixreadonly.rs @@ -2,7 +2,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -use dom::bindings::cell::DOMRefCell; +use dom::bindings::cell::DomRefCell; use dom::bindings::codegen::Bindings::DOMMatrixBinding::{DOMMatrixInit, DOMMatrixMethods}; use dom::bindings::codegen::Bindings::DOMMatrixReadOnlyBinding::{DOMMatrixReadOnlyMethods, Wrap}; use dom::bindings::codegen::Bindings::DOMPointBinding::DOMPointInit; @@ -21,7 +21,7 @@ use std::f64; #[dom_struct] pub struct DOMMatrixReadOnly { reflector_: Reflector, - matrix: DOMRefCell>, + matrix: DomRefCell>, is2D: Cell, } @@ -35,7 +35,7 @@ impl DOMMatrixReadOnly { pub fn new_inherited(is2D: bool, matrix: Transform3D) -> Self { DOMMatrixReadOnly { reflector_: Reflector::new(), - matrix: DOMRefCell::new(matrix), + matrix: DomRefCell::new(matrix), is2D: Cell::new(is2D), } } diff --git a/components/script/dom/element.rs b/components/script/dom/element.rs index 79bbb3b11e3..30fa0b59b4a 100644 --- a/components/script/dom/element.rs +++ b/components/script/dom/element.rs @@ -7,7 +7,7 @@ use devtools_traits::AttrInfo; use dom::activation::Activatable; use dom::attr::{Attr, AttrHelpersForLayout}; -use dom::bindings::cell::DOMRefCell; +use dom::bindings::cell::DomRefCell; use dom::bindings::codegen::Bindings::AttrBinding::AttrMethods; use dom::bindings::codegen::Bindings::DocumentBinding::DocumentMethods; use dom::bindings::codegen::Bindings::ElementBinding; @@ -130,12 +130,12 @@ pub struct Element { local_name: LocalName, tag_name: TagName, namespace: Namespace, - prefix: DOMRefCell>, - attrs: DOMRefCell>>, - id_attribute: DOMRefCell>, - is: DOMRefCell>, + prefix: DomRefCell>, + attrs: DomRefCell>>, + id_attribute: DomRefCell>, + is: DomRefCell>, #[ignore_heap_size_of = "Arc"] - style_attribute: DOMRefCell>>>, + style_attribute: DomRefCell>>>, attr_list: MutNullableDom, class_list: MutNullableDom, state: Cell, @@ -146,10 +146,10 @@ pub struct Element { #[ignore_heap_size_of = "bitflags defined in rust-selectors"] selector_flags: Cell, /// https://html.spec.whatwg.org/multipage/#custom-element-reaction-queue - custom_element_reaction_queue: DOMRefCell>, + custom_element_reaction_queue: DomRefCell>, /// https://dom.spec.whatwg.org/#concept-element-custom-element-definition #[ignore_heap_size_of = "Rc"] - custom_element_definition: DOMRefCell>>, + custom_element_definition: DomRefCell>>, /// https://dom.spec.whatwg.org/#concept-element-custom-element-state custom_element_state: Cell, } @@ -255,11 +255,11 @@ impl Element { local_name: local_name, tag_name: TagName::new(), namespace: namespace, - prefix: DOMRefCell::new(prefix), - attrs: DOMRefCell::new(vec![]), - id_attribute: DOMRefCell::new(None), - is: DOMRefCell::new(None), - style_attribute: DOMRefCell::new(None), + prefix: DomRefCell::new(prefix), + attrs: DomRefCell::new(vec![]), + id_attribute: DomRefCell::new(None), + is: DomRefCell::new(None), + style_attribute: DomRefCell::new(None), attr_list: Default::default(), class_list: Default::default(), state: Cell::new(state), @@ -958,7 +958,7 @@ impl Element { ns!() } - pub fn style_attribute(&self) -> &DOMRefCell>>> { + pub fn style_attribute(&self) -> &DomRefCell>>> { &self.style_attribute } @@ -3006,12 +3006,12 @@ impl<'a> AttributeMutation<'a> { /// owner changes. #[derive(HeapSizeOf, JSTraceable)] struct TagName { - ptr: DOMRefCell>, + ptr: DomRefCell>, } impl TagName { fn new() -> TagName { - TagName { ptr: DOMRefCell::new(None) } + TagName { ptr: DomRefCell::new(None) } } /// Retrieve a copy of the current inner value. If it is `None`, it is diff --git a/components/script/dom/errorevent.rs b/components/script/dom/errorevent.rs index c3f4ac95525..337e4f34fcc 100644 --- a/components/script/dom/errorevent.rs +++ b/components/script/dom/errorevent.rs @@ -2,7 +2,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -use dom::bindings::cell::DOMRefCell; +use dom::bindings::cell::DomRefCell; use dom::bindings::codegen::Bindings::ErrorEventBinding; use dom::bindings::codegen::Bindings::ErrorEventBinding::ErrorEventMethods; use dom::bindings::codegen::Bindings::EventBinding::EventMethods; @@ -23,8 +23,8 @@ use std::cell::Cell; #[dom_struct] pub struct ErrorEvent { event: Event, - message: DOMRefCell, - filename: DOMRefCell, + message: DomRefCell, + filename: DomRefCell, lineno: Cell, colno: Cell, #[ignore_heap_size_of = "Defined in rust-mozjs"] @@ -35,8 +35,8 @@ impl ErrorEvent { fn new_inherited() -> ErrorEvent { ErrorEvent { event: Event::new_inherited(), - message: DOMRefCell::new(DOMString::new()), - filename: DOMRefCell::new(DOMString::new()), + message: DomRefCell::new(DOMString::new()), + filename: DomRefCell::new(DOMString::new()), lineno: Cell::new(0), colno: Cell::new(0), error: Heap::default() diff --git a/components/script/dom/event.rs b/components/script/dom/event.rs index c00ed9a0011..24674147bc5 100644 --- a/components/script/dom/event.rs +++ b/components/script/dom/event.rs @@ -4,7 +4,7 @@ use devtools_traits::{TimelineMarker, TimelineMarkerType}; use dom::bindings::callback::ExceptionHandling; -use dom::bindings::cell::DOMRefCell; +use dom::bindings::cell::DomRefCell; use dom::bindings::codegen::Bindings::EventBinding; use dom::bindings::codegen::Bindings::EventBinding::{EventConstants, EventMethods}; use dom::bindings::error::Fallible; @@ -31,7 +31,7 @@ pub struct Event { reflector_: Reflector, current_target: MutNullableDom, target: MutNullableDom, - type_: DOMRefCell, + type_: DomRefCell, phase: Cell, canceled: Cell, stop_propagation: Cell, @@ -50,7 +50,7 @@ impl Event { reflector_: Reflector::new(), current_target: Default::default(), target: Default::default(), - type_: DOMRefCell::new(atom!("")), + type_: DomRefCell::new(atom!("")), phase: Cell::new(EventPhase::None), canceled: Cell::new(EventDefault::Allowed), stop_propagation: Cell::new(false), diff --git a/components/script/dom/eventsource.rs b/components/script/dom/eventsource.rs index 01f25ec281c..82aa62bba26 100644 --- a/components/script/dom/eventsource.rs +++ b/components/script/dom/eventsource.rs @@ -2,7 +2,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -use dom::bindings::cell::DOMRefCell; +use dom::bindings::cell::DomRefCell; use dom::bindings::codegen::Bindings::EventSourceBinding::{EventSourceInit, EventSourceMethods, Wrap}; use dom::bindings::error::{Error, Fallible}; use dom::bindings::inheritance::Castable; @@ -56,8 +56,8 @@ enum ReadyState { pub struct EventSource { eventtarget: EventTarget, url: ServoUrl, - request: DOMRefCell>, - last_event_id: DOMRefCell, + request: DomRefCell>, + last_event_id: DomRefCell, reconnection_time: Cell, generation_id: Cell, @@ -402,8 +402,8 @@ impl EventSource { EventSource { eventtarget: EventTarget::new_inherited(), url: url, - request: DOMRefCell::new(None), - last_event_id: DOMRefCell::new(DOMString::from("")), + request: DomRefCell::new(None), + last_event_id: DomRefCell::new(DOMString::from("")), reconnection_time: Cell::new(DEFAULT_RECONNECTION_TIME), generation_id: Cell::new(GenerationId(0)), diff --git a/components/script/dom/eventtarget.rs b/components/script/dom/eventtarget.rs index ed9ec8603c1..64c903e4de6 100644 --- a/components/script/dom/eventtarget.rs +++ b/components/script/dom/eventtarget.rs @@ -4,7 +4,7 @@ use dom::beforeunloadevent::BeforeUnloadEvent; use dom::bindings::callback::{CallbackContainer, ExceptionHandling, CallbackFunction}; -use dom::bindings::cell::DOMRefCell; +use dom::bindings::cell::DomRefCell; use dom::bindings::codegen::Bindings::BeforeUnloadEventBinding::BeforeUnloadEventMethods; use dom::bindings::codegen::Bindings::ErrorEventBinding::ErrorEventMethods; use dom::bindings::codegen::Bindings::EventBinding::EventMethods; @@ -276,14 +276,14 @@ impl EventListeners { #[dom_struct] pub struct EventTarget { reflector_: Reflector, - handlers: DOMRefCell>>, + handlers: DomRefCell>>, } impl EventTarget { pub fn new_inherited() -> EventTarget { EventTarget { reflector_: Reflector::new(), - handlers: DOMRefCell::new(Default::default()), + handlers: DomRefCell::new(Default::default()), } } diff --git a/components/script/dom/filereader.rs b/components/script/dom/filereader.rs index 2e5721cc910..d8ed3788f19 100644 --- a/components/script/dom/filereader.rs +++ b/components/script/dom/filereader.rs @@ -3,7 +3,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ use base64; -use dom::bindings::cell::DOMRefCell; +use dom::bindings::cell::DomRefCell; use dom::bindings::codegen::Bindings::BlobBinding::BlobMethods; use dom::bindings::codegen::Bindings::FileReaderBinding::{self, FileReaderConstants, FileReaderMethods}; use dom::bindings::codegen::UnionTypes::StringOrObject; @@ -88,7 +88,7 @@ pub struct FileReader { eventtarget: EventTarget, ready_state: Cell, error: MutNullableDom, - result: DOMRefCell>, + result: DomRefCell>, generation_id: Cell, } @@ -98,7 +98,7 @@ impl FileReader { eventtarget: EventTarget::new_inherited(), ready_state: Cell::new(FileReaderReadyState::Empty), error: MutNullableDom::new(None), - result: DOMRefCell::new(None), + result: DomRefCell::new(None), generation_id: Cell::new(GenerationId(0)), } } @@ -216,7 +216,7 @@ impl FileReader { } // https://w3c.github.io/FileAPI/#dfn-readAsText - fn perform_readastext(result: &DOMRefCell>, data: ReadMetaData, blob_bytes: &[u8]) { + fn perform_readastext(result: &DomRefCell>, data: ReadMetaData, blob_bytes: &[u8]) { let blob_label = &data.label; let blob_type = &data.blobtype; @@ -246,7 +246,7 @@ impl FileReader { } //https://w3c.github.io/FileAPI/#dfn-readAsDataURL - fn perform_readasdataurl(result: &DOMRefCell>, data: ReadMetaData, bytes: &[u8]) { + fn perform_readasdataurl(result: &DomRefCell>, data: ReadMetaData, bytes: &[u8]) { let base64 = base64::encode(bytes); let output = if data.blobtype.is_empty() { @@ -260,7 +260,7 @@ impl FileReader { // https://w3c.github.io/FileAPI/#dfn-readAsArrayBuffer #[allow(unsafe_code)] - fn perform_readasarraybuffer(result: &DOMRefCell>, + fn perform_readasarraybuffer(result: &DomRefCell>, cx: *mut JSContext, _: ReadMetaData, bytes: &[u8]) { unsafe { rooted!(in(cx) let mut array_buffer = ptr::null_mut()); diff --git a/components/script/dom/formdata.rs b/components/script/dom/formdata.rs index 8181fd43d07..100684505dd 100644 --- a/components/script/dom/formdata.rs +++ b/components/script/dom/formdata.rs @@ -2,7 +2,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -use dom::bindings::cell::DOMRefCell; +use dom::bindings::cell::DomRefCell; use dom::bindings::codegen::Bindings::FormDataBinding::FormDataMethods; use dom::bindings::codegen::Bindings::FormDataBinding::FormDataWrap; use dom::bindings::codegen::UnionTypes::FileOrUSVString; @@ -25,7 +25,7 @@ use std::iter; #[dom_struct] pub struct FormData { reflector_: Reflector, - data: DOMRefCell>>, + data: DomRefCell>>, } impl FormData { @@ -43,7 +43,7 @@ impl FormData { FormData { reflector_: Reflector::new(), - data: DOMRefCell::new(hashmap), + data: DomRefCell::new(hashmap), } } diff --git a/components/script/dom/gamepadlist.rs b/components/script/dom/gamepadlist.rs index dec21410c9d..26e78cda654 100644 --- a/components/script/dom/gamepadlist.rs +++ b/components/script/dom/gamepadlist.rs @@ -2,7 +2,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -use dom::bindings::cell::DOMRefCell; +use dom::bindings::cell::DomRefCell; use dom::bindings::codegen::Bindings::GamepadListBinding; use dom::bindings::codegen::Bindings::GamepadListBinding::GamepadListMethods; use dom::bindings::reflector::{Reflector, reflect_dom_object}; @@ -15,14 +15,14 @@ use dom_struct::dom_struct; #[dom_struct] pub struct GamepadList { reflector_: Reflector, - list: DOMRefCell>> + list: DomRefCell>> } impl GamepadList { fn new_inherited(list: &[&Gamepad]) -> GamepadList { GamepadList { reflector_: Reflector::new(), - list: DOMRefCell::new(list.iter().map(|g| Dom::from_ref(&**g)).collect()) + list: DomRefCell::new(list.iter().map(|g| Dom::from_ref(&**g)).collect()) } } diff --git a/components/script/dom/globalscope.rs b/components/script/dom/globalscope.rs index e9854d4f991..ed5ed5cd941 100644 --- a/components/script/dom/globalscope.rs +++ b/components/script/dom/globalscope.rs @@ -3,7 +3,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ use devtools_traits::{ScriptToDevtoolsControlMsg, WorkerId}; -use dom::bindings::cell::DOMRefCell; +use dom::bindings::cell::DomRefCell; use dom::bindings::codegen::Bindings::WindowBinding::WindowMethods; use dom::bindings::codegen::Bindings::WorkerGlobalScopeBinding::WorkerGlobalScopeMethods; use dom::bindings::conversions::root_from_object; @@ -69,7 +69,7 @@ pub struct GlobalScope { devtools_wants_updates: Cell, /// Timers used by the Console API. - console_timers: DOMRefCell>, + console_timers: DomRefCell>, /// For providing instructions to an optional devtools server. #[ignore_heap_size_of = "channels are hard"] @@ -131,7 +131,7 @@ impl GlobalScope { next_worker_id: Cell::new(WorkerId(0)), pipeline_id, devtools_wants_updates: Default::default(), - console_timers: DOMRefCell::new(Default::default()), + console_timers: DomRefCell::new(Default::default()), devtools_chan, mem_profiler_chan, time_profiler_chan, diff --git a/components/script/dom/headers.rs b/components/script/dom/headers.rs index f5ac52e1006..7bd2eeff8e2 100644 --- a/components/script/dom/headers.rs +++ b/components/script/dom/headers.rs @@ -2,7 +2,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -use dom::bindings::cell::DOMRefCell; +use dom::bindings::cell::DomRefCell; use dom::bindings::codegen::Bindings::HeadersBinding::{HeadersInit, HeadersMethods, HeadersWrap}; use dom::bindings::error::{Error, ErrorResult, Fallible}; use dom::bindings::iterable::Iterable; @@ -22,7 +22,7 @@ pub struct Headers { reflector_: Reflector, guard: Cell, #[ignore_heap_size_of = "Defined in hyper"] - header_list: DOMRefCell + header_list: DomRefCell } // https://fetch.spec.whatwg.org/#concept-headers-guard @@ -40,7 +40,7 @@ impl Headers { Headers { reflector_: Reflector::new(), guard: Cell::new(Guard::None), - header_list: DOMRefCell::new(HyperHeaders::new()), + header_list: DomRefCell::new(HyperHeaders::new()), } } diff --git a/components/script/dom/htmlanchorelement.rs b/components/script/dom/htmlanchorelement.rs index bd363e316c6..bb5c1b67d69 100644 --- a/components/script/dom/htmlanchorelement.rs +++ b/components/script/dom/htmlanchorelement.rs @@ -3,7 +3,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ use dom::activation::Activatable; -use dom::bindings::cell::DOMRefCell; +use dom::bindings::cell::DomRefCell; use dom::bindings::codegen::Bindings::AttrBinding::AttrMethods; use dom::bindings::codegen::Bindings::DOMTokenListBinding::DOMTokenListMethods; use dom::bindings::codegen::Bindings::HTMLAnchorElementBinding; @@ -38,7 +38,7 @@ use style::attr::AttrValue; pub struct HTMLAnchorElement { htmlelement: HTMLElement, rel_list: MutNullableDom, - url: DOMRefCell>, + url: DomRefCell>, } impl HTMLAnchorElement { @@ -49,7 +49,7 @@ impl HTMLAnchorElement { htmlelement: HTMLElement::new_inherited(local_name, prefix, document), rel_list: Default::default(), - url: DOMRefCell::new(None), + url: DomRefCell::new(None), } } diff --git a/components/script/dom/htmlcanvaselement.rs b/components/script/dom/htmlcanvaselement.rs index de6fc1b1bd4..d277c85fd8a 100644 --- a/components/script/dom/htmlcanvaselement.rs +++ b/components/script/dom/htmlcanvaselement.rs @@ -5,7 +5,7 @@ use base64; use canvas_traits::canvas::{CanvasMsg, FromScriptMsg}; use dom::attr::Attr; -use dom::bindings::cell::DOMRefCell; +use dom::bindings::cell::DomRefCell; use dom::bindings::codegen::Bindings::CanvasRenderingContext2DBinding::CanvasRenderingContext2DMethods; use dom::bindings::codegen::Bindings::HTMLCanvasElementBinding; use dom::bindings::codegen::Bindings::HTMLCanvasElementBinding::HTMLCanvasElementMethods; @@ -51,7 +51,7 @@ pub enum CanvasContext { #[dom_struct] pub struct HTMLCanvasElement { htmlelement: HTMLElement, - context: DOMRefCell>, + context: DomRefCell>, } impl HTMLCanvasElement { @@ -60,7 +60,7 @@ impl HTMLCanvasElement { document: &Document) -> HTMLCanvasElement { HTMLCanvasElement { htmlelement: HTMLElement::new_inherited(local_name, prefix, document), - context: DOMRefCell::new(None), + context: DomRefCell::new(None), } } diff --git a/components/script/dom/htmldialogelement.rs b/components/script/dom/htmldialogelement.rs index 96671be699d..2d26f150628 100644 --- a/components/script/dom/htmldialogelement.rs +++ b/components/script/dom/htmldialogelement.rs @@ -2,7 +2,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -use dom::bindings::cell::DOMRefCell; +use dom::bindings::cell::DomRefCell; use dom::bindings::codegen::Bindings::HTMLDialogElementBinding; use dom::bindings::codegen::Bindings::HTMLDialogElementBinding::HTMLDialogElementMethods; use dom::bindings::inheritance::Castable; @@ -19,7 +19,7 @@ use html5ever::{LocalName, Prefix}; #[dom_struct] pub struct HTMLDialogElement { htmlelement: HTMLElement, - return_value: DOMRefCell, + return_value: DomRefCell, } impl HTMLDialogElement { @@ -29,7 +29,7 @@ impl HTMLDialogElement { HTMLDialogElement { htmlelement: HTMLElement::new_inherited(local_name, prefix, document), - return_value: DOMRefCell::new(DOMString::new()), + return_value: DomRefCell::new(DOMString::new()), } } diff --git a/components/script/dom/htmlformelement.rs b/components/script/dom/htmlformelement.rs index a062ca3f055..abb064fbb19 100755 --- a/components/script/dom/htmlformelement.rs +++ b/components/script/dom/htmlformelement.rs @@ -2,7 +2,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -use dom::bindings::cell::DOMRefCell; +use dom::bindings::cell::DomRefCell; use dom::bindings::codegen::Bindings::BlobBinding::BlobMethods; use dom::bindings::codegen::Bindings::DocumentBinding::DocumentMethods; use dom::bindings::codegen::Bindings::EventBinding::EventMethods; @@ -66,7 +66,7 @@ pub struct HTMLFormElement { marked_for_reset: Cell, elements: DomOnceCell, generation_id: Cell, - controls: DOMRefCell>>, + controls: DomRefCell>>, } impl HTMLFormElement { @@ -78,7 +78,7 @@ impl HTMLFormElement { marked_for_reset: Cell::new(false), elements: Default::default(), generation_id: Cell::new(GenerationId(0)), - controls: DOMRefCell::new(Vec::new()), + controls: DomRefCell::new(Vec::new()), } } diff --git a/components/script/dom/htmliframeelement.rs b/components/script/dom/htmliframeelement.rs index 923c0fab2df..39bb2e672b4 100644 --- a/components/script/dom/htmliframeelement.rs +++ b/components/script/dom/htmliframeelement.rs @@ -4,7 +4,7 @@ use document_loader::{LoadBlocker, LoadType}; use dom::attr::Attr; -use dom::bindings::cell::DOMRefCell; +use dom::bindings::cell::DomRefCell; use dom::bindings::codegen::Bindings::BrowserElementBinding::BrowserElementErrorEventDetail; use dom::bindings::codegen::Bindings::BrowserElementBinding::BrowserElementIconChangeEventDetail; use dom::bindings::codegen::Bindings::BrowserElementBinding::BrowserElementLocationChangeEventDetail; @@ -90,7 +90,7 @@ pub struct HTMLIFrameElement { pending_pipeline_id: Cell>, sandbox: MutNullableDom, sandbox_allowance: Cell>, - load_blocker: DOMRefCell>, + load_blocker: DomRefCell>, visibility: Cell, } @@ -329,7 +329,7 @@ impl HTMLIFrameElement { pending_pipeline_id: Cell::new(None), sandbox: Default::default(), sandbox_allowance: Cell::new(None), - load_blocker: DOMRefCell::new(None), + load_blocker: DomRefCell::new(None), visibility: Cell::new(true), } } diff --git a/components/script/dom/htmlimageelement.rs b/components/script/dom/htmlimageelement.rs index 3a71f8bda48..dac6c955626 100644 --- a/components/script/dom/htmlimageelement.rs +++ b/components/script/dom/htmlimageelement.rs @@ -6,7 +6,7 @@ use app_units::{Au, AU_PER_PX}; use document_loader::{LoadType, LoadBlocker}; use dom::activation::Activatable; use dom::attr::Attr; -use dom::bindings::cell::DOMRefCell; +use dom::bindings::cell::DomRefCell; use dom::bindings::codegen::Bindings::DOMRectBinding::DOMRectBinding::DOMRectMethods; use dom::bindings::codegen::Bindings::ElementBinding::ElementBinding::ElementMethods; use dom::bindings::codegen::Bindings::HTMLImageElementBinding; @@ -87,8 +87,8 @@ struct ImageRequest { pub struct HTMLImageElement { htmlelement: HTMLElement, image_request: Cell, - current_request: DOMRefCell, - pending_request: DOMRefCell, + current_request: DomRefCell, + pending_request: DomRefCell, form_owner: MutNullableDom, generation: Cell, } @@ -579,7 +579,7 @@ impl HTMLImageElement { HTMLImageElement { htmlelement: HTMLElement::new_inherited(local_name, prefix, document), image_request: Cell::new(ImageRequestPhase::Current), - current_request: DOMRefCell::new(ImageRequest { + current_request: DomRefCell::new(ImageRequest { state: State::Unavailable, parsed_url: None, source_url: None, @@ -588,7 +588,7 @@ impl HTMLImageElement { blocker: None, final_url: None, }), - pending_request: DOMRefCell::new(ImageRequest { + pending_request: DomRefCell::new(ImageRequest { state: State::Unavailable, parsed_url: None, source_url: None, diff --git a/components/script/dom/htmlinputelement.rs b/components/script/dom/htmlinputelement.rs index 0520a3a3d4f..77ddc6eb8e3 100755 --- a/components/script/dom/htmlinputelement.rs +++ b/components/script/dom/htmlinputelement.rs @@ -5,7 +5,7 @@ use caseless::compatibility_caseless_match_str; use dom::activation::{Activatable, ActivationSource, synthetic_click_activation}; use dom::attr::Attr; -use dom::bindings::cell::DOMRefCell; +use dom::bindings::cell::DomRefCell; use dom::bindings::codegen::Bindings::EventBinding::EventMethods; use dom::bindings::codegen::Bindings::FileListBinding::FileListMethods; use dom::bindings::codegen::Bindings::HTMLInputElementBinding; @@ -88,14 +88,14 @@ pub struct HTMLInputElement { htmlelement: HTMLElement, input_type: Cell, checked_changed: Cell, - placeholder: DOMRefCell, + placeholder: DomRefCell, value_changed: Cell, size: Cell, maxlength: Cell, minlength: Cell, #[ignore_heap_size_of = "#7193"] - textinput: DOMRefCell>, - activation_state: DOMRefCell, + textinput: DomRefCell>, + activation_state: DomRefCell, // https://html.spec.whatwg.org/multipage/#concept-input-value-dirty-flag value_dirty: Cell, @@ -142,19 +142,19 @@ impl HTMLInputElement { HTMLElement::new_inherited_with_state(IN_ENABLED_STATE | IN_READ_WRITE_STATE, local_name, prefix, document), input_type: Cell::new(InputType::InputText), - placeholder: DOMRefCell::new(DOMString::new()), + placeholder: DomRefCell::new(DOMString::new()), checked_changed: Cell::new(false), value_changed: Cell::new(false), maxlength: Cell::new(DEFAULT_MAX_LENGTH), minlength: Cell::new(DEFAULT_MIN_LENGTH), size: Cell::new(DEFAULT_INPUT_SIZE), - textinput: DOMRefCell::new(TextInput::new(Single, + textinput: DomRefCell::new(TextInput::new(Single, DOMString::new(), chan, None, None, SelectionDirection::None)), - activation_state: DOMRefCell::new(InputActivationState::new()), + activation_state: DomRefCell::new(InputActivationState::new()), value_dirty: Cell::new(false), filelist: MutNullableDom::new(None), form_owner: Default::default(), diff --git a/components/script/dom/htmllinkelement.rs b/components/script/dom/htmllinkelement.rs index b229e331ed6..42b6f59d6bc 100644 --- a/components/script/dom/htmllinkelement.rs +++ b/components/script/dom/htmllinkelement.rs @@ -4,7 +4,7 @@ use cssparser::{Parser as CssParser, ParserInput}; use dom::attr::Attr; -use dom::bindings::cell::DOMRefCell; +use dom::bindings::cell::DomRefCell; use dom::bindings::codegen::Bindings::DOMTokenListBinding::DOMTokenListBinding::DOMTokenListMethods; use dom::bindings::codegen::Bindings::HTMLLinkElementBinding; use dom::bindings::codegen::Bindings::HTMLLinkElementBinding::HTMLLinkElementMethods; @@ -52,7 +52,7 @@ pub struct HTMLLinkElement { htmlelement: HTMLElement, rel_list: MutNullableDom, #[ignore_heap_size_of = "Arc"] - stylesheet: DOMRefCell>>, + stylesheet: DomRefCell>>, cssom_stylesheet: MutNullableDom, /// https://html.spec.whatwg.org/multipage/#a-style-sheet-that-is-blocking-scripts @@ -73,7 +73,7 @@ impl HTMLLinkElement { htmlelement: HTMLElement::new_inherited(local_name, prefix, document), rel_list: Default::default(), parser_inserted: Cell::new(creator.is_parser_created()), - stylesheet: DOMRefCell::new(None), + stylesheet: DomRefCell::new(None), cssom_stylesheet: MutNullableDom::new(None), pending_loads: Cell::new(0), any_failed_load: Cell::new(false), diff --git a/components/script/dom/htmlmediaelement.rs b/components/script/dom/htmlmediaelement.rs index 81708864742..74f8c87b77b 100644 --- a/components/script/dom/htmlmediaelement.rs +++ b/components/script/dom/htmlmediaelement.rs @@ -5,7 +5,7 @@ use audio_video_metadata; use document_loader::{LoadBlocker, LoadType}; use dom::attr::Attr; -use dom::bindings::cell::DOMRefCell; +use dom::bindings::cell::DomRefCell; use dom::bindings::codegen::Bindings::AttrBinding::AttrMethods; use dom::bindings::codegen::Bindings::HTMLMediaElementBinding::CanPlayTypeResult; use dom::bindings::codegen::Bindings::HTMLMediaElementBinding::HTMLMediaElementConstants; @@ -58,7 +58,7 @@ pub struct HTMLMediaElement { /// https://html.spec.whatwg.org/multipage/#dom-media-readystate ready_state: Cell, /// https://html.spec.whatwg.org/multipage/#dom-media-currentsrc - current_src: DOMRefCell, + current_src: DomRefCell, /// Incremented whenever tasks associated with this element are cancelled. generation_id: Cell, /// https://html.spec.whatwg.org/multipage/#fire-loadeddata @@ -72,16 +72,16 @@ pub struct HTMLMediaElement { /// https://html.spec.whatwg.org/multipage/#attr-media-autoplay autoplaying: Cell, /// https://html.spec.whatwg.org/multipage/#delaying-the-load-event-flag - delaying_the_load_event_flag: DOMRefCell>, + delaying_the_load_event_flag: DomRefCell>, /// https://html.spec.whatwg.org/multipage/#list-of-pending-play-promises #[ignore_heap_size_of = "promises are hard"] - pending_play_promises: DOMRefCell>>, + pending_play_promises: DomRefCell>>, /// Play promises which are soon to be fulfilled by a queued task. #[ignore_heap_size_of = "promises are hard"] - in_flight_play_promises_queue: DOMRefCell]>, ErrorResult)>>, + in_flight_play_promises_queue: DomRefCell]>, ErrorResult)>>, /// The details of the video currently related to this media element. // FIXME(nox): Why isn't this in HTMLVideoElement? - video: DOMRefCell>, + video: DomRefCell>, } /// https://html.spec.whatwg.org/multipage/#dom-media-networkstate @@ -126,7 +126,7 @@ impl HTMLMediaElement { htmlelement: HTMLElement::new_inherited(tag_name, prefix, document), network_state: Cell::new(NetworkState::Empty), ready_state: Cell::new(ReadyState::HaveNothing), - current_src: DOMRefCell::new("".to_owned()), + current_src: DomRefCell::new("".to_owned()), generation_id: Cell::new(0), fired_loadeddata_event: Cell::new(false), error: Default::default(), @@ -136,7 +136,7 @@ impl HTMLMediaElement { delaying_the_load_event_flag: Default::default(), pending_play_promises: Default::default(), in_flight_play_promises_queue: Default::default(), - video: DOMRefCell::new(None), + video: DomRefCell::new(None), } } diff --git a/components/script/dom/htmlmetaelement.rs b/components/script/dom/htmlmetaelement.rs index 41ae52a1b4c..ea79406c336 100644 --- a/components/script/dom/htmlmetaelement.rs +++ b/components/script/dom/htmlmetaelement.rs @@ -3,7 +3,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ use dom::attr::Attr; -use dom::bindings::cell::DOMRefCell; +use dom::bindings::cell::DomRefCell; use dom::bindings::codegen::Bindings::HTMLMetaElementBinding; use dom::bindings::codegen::Bindings::HTMLMetaElementBinding::HTMLMetaElementMethods; use dom::bindings::codegen::Bindings::NodeBinding::NodeMethods; @@ -33,7 +33,7 @@ use style::stylesheets::{Stylesheet, StylesheetContents, CssRule, CssRules, Orig pub struct HTMLMetaElement { htmlelement: HTMLElement, #[ignore_heap_size_of = "Arc"] - stylesheet: DOMRefCell>>, + stylesheet: DomRefCell>>, cssom_stylesheet: MutNullableDom, } @@ -43,7 +43,7 @@ impl HTMLMetaElement { document: &Document) -> HTMLMetaElement { HTMLMetaElement { htmlelement: HTMLElement::new_inherited(local_name, prefix, document), - stylesheet: DOMRefCell::new(None), + stylesheet: DomRefCell::new(None), cssom_stylesheet: MutNullableDom::new(None), } } diff --git a/components/script/dom/htmlobjectelement.rs b/components/script/dom/htmlobjectelement.rs index 121dde5d2ae..bd84b1bdd0b 100755 --- a/components/script/dom/htmlobjectelement.rs +++ b/components/script/dom/htmlobjectelement.rs @@ -3,7 +3,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ use dom::attr::Attr; -use dom::bindings::cell::DOMRefCell; +use dom::bindings::cell::DomRefCell; use dom::bindings::codegen::Bindings::HTMLObjectElementBinding; use dom::bindings::codegen::Bindings::HTMLObjectElementBinding::HTMLObjectElementMethods; use dom::bindings::inheritance::Castable; @@ -27,7 +27,7 @@ use std::default::Default; pub struct HTMLObjectElement { htmlelement: HTMLElement, #[ignore_heap_size_of = "Arc"] - image: DOMRefCell>>, + image: DomRefCell>>, form_owner: MutNullableDom, } @@ -38,7 +38,7 @@ impl HTMLObjectElement { HTMLObjectElement { htmlelement: HTMLElement::new_inherited(local_name, prefix, document), - image: DOMRefCell::new(None), + image: DomRefCell::new(None), form_owner: Default::default(), } } diff --git a/components/script/dom/htmlstyleelement.rs b/components/script/dom/htmlstyleelement.rs index a66ede9c930..0ba69b63549 100644 --- a/components/script/dom/htmlstyleelement.rs +++ b/components/script/dom/htmlstyleelement.rs @@ -3,7 +3,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ use cssparser::{Parser as CssParser, ParserInput}; -use dom::bindings::cell::DOMRefCell; +use dom::bindings::cell::DomRefCell; use dom::bindings::codegen::Bindings::HTMLStyleElementBinding; use dom::bindings::codegen::Bindings::HTMLStyleElementBinding::HTMLStyleElementMethods; use dom::bindings::codegen::Bindings::NodeBinding::NodeMethods; @@ -32,7 +32,7 @@ use stylesheet_loader::{StylesheetLoader, StylesheetOwner}; pub struct HTMLStyleElement { htmlelement: HTMLElement, #[ignore_heap_size_of = "Arc"] - stylesheet: DOMRefCell>>, + stylesheet: DomRefCell>>, cssom_stylesheet: MutNullableDom, /// https://html.spec.whatwg.org/multipage/#a-style-sheet-that-is-blocking-scripts parser_inserted: Cell, @@ -49,7 +49,7 @@ impl HTMLStyleElement { creator: ElementCreator) -> HTMLStyleElement { HTMLStyleElement { htmlelement: HTMLElement::new_inherited(local_name, prefix, document), - stylesheet: DOMRefCell::new(None), + stylesheet: DomRefCell::new(None), cssom_stylesheet: MutNullableDom::new(None), parser_inserted: Cell::new(creator.is_parser_created()), in_stack_of_open_elements: Cell::new(creator.is_parser_created()), diff --git a/components/script/dom/htmltextareaelement.rs b/components/script/dom/htmltextareaelement.rs index 6531586ca29..3d0cc360deb 100755 --- a/components/script/dom/htmltextareaelement.rs +++ b/components/script/dom/htmltextareaelement.rs @@ -3,7 +3,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ use dom::attr::Attr; -use dom::bindings::cell::DOMRefCell; +use dom::bindings::cell::DomRefCell; use dom::bindings::codegen::Bindings::EventBinding::EventMethods; use dom::bindings::codegen::Bindings::HTMLTextAreaElementBinding; use dom::bindings::codegen::Bindings::HTMLTextAreaElementBinding::HTMLTextAreaElementMethods; @@ -39,8 +39,8 @@ use textinput::{KeyReaction, Lines, SelectionDirection, TextInput}; pub struct HTMLTextAreaElement { htmlelement: HTMLElement, #[ignore_heap_size_of = "#7193"] - textinput: DOMRefCell>, - placeholder: DOMRefCell, + textinput: DomRefCell>, + placeholder: DomRefCell, // https://html.spec.whatwg.org/multipage/#concept-textarea-dirty value_changed: Cell, form_owner: MutNullableDom, @@ -113,8 +113,8 @@ impl HTMLTextAreaElement { htmlelement: HTMLElement::new_inherited_with_state(IN_ENABLED_STATE | IN_READ_WRITE_STATE, local_name, prefix, document), - placeholder: DOMRefCell::new(DOMString::new()), - textinput: DOMRefCell::new(TextInput::new( + placeholder: DomRefCell::new(DOMString::new()), + textinput: DomRefCell::new(TextInput::new( Lines::Multiple, DOMString::new(), chan, None, None, SelectionDirection::None)), value_changed: Cell::new(false), form_owner: Default::default(), diff --git a/components/script/dom/keyboardevent.rs b/components/script/dom/keyboardevent.rs index b9f2e354022..4107c809d3e 100644 --- a/components/script/dom/keyboardevent.rs +++ b/components/script/dom/keyboardevent.rs @@ -2,7 +2,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -use dom::bindings::cell::DOMRefCell; +use dom::bindings::cell::DomRefCell; use dom::bindings::codegen::Bindings::KeyboardEventBinding; use dom::bindings::codegen::Bindings::KeyboardEventBinding::{KeyboardEventConstants, KeyboardEventMethods}; use dom::bindings::codegen::Bindings::UIEventBinding::UIEventMethods; @@ -26,8 +26,8 @@ unsafe_no_jsmanaged_fields!(Key); pub struct KeyboardEvent { uievent: UIEvent, key: Cell>, - key_string: DOMRefCell, - code: DOMRefCell, + key_string: DomRefCell, + code: DomRefCell, location: Cell, ctrl: Cell, alt: Cell, @@ -45,8 +45,8 @@ impl KeyboardEvent { KeyboardEvent { uievent: UIEvent::new_inherited(), key: Cell::new(None), - key_string: DOMRefCell::new(DOMString::new()), - code: DOMRefCell::new(DOMString::new()), + key_string: DomRefCell::new(DOMString::new()), + code: DomRefCell::new(DOMString::new()), location: Cell::new(0), ctrl: Cell::new(false), alt: Cell::new(false), diff --git a/components/script/dom/mediaquerylist.rs b/components/script/dom/mediaquerylist.rs index b60632e7ebf..4c23ee080ba 100644 --- a/components/script/dom/mediaquerylist.rs +++ b/components/script/dom/mediaquerylist.rs @@ -2,7 +2,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -use dom::bindings::cell::DOMRefCell; +use dom::bindings::cell::DomRefCell; use dom::bindings::codegen::Bindings::EventListenerBinding::EventListener; use dom::bindings::codegen::Bindings::EventTargetBinding::EventTargetMethods; use dom::bindings::codegen::Bindings::MediaQueryListBinding::{self, MediaQueryListMethods}; @@ -113,13 +113,13 @@ impl MediaQueryListMethods for MediaQueryList { #[derive(HeapSizeOf)] pub struct WeakMediaQueryListVec { - cell: DOMRefCell>, + cell: DomRefCell>, } impl WeakMediaQueryListVec { /// Create a new vector of weak references to MediaQueryList pub fn new() -> Self { - WeakMediaQueryListVec { cell: DOMRefCell::new(WeakRefVec::new()) } + WeakMediaQueryListVec { cell: DomRefCell::new(WeakRefVec::new()) } } pub fn push(&self, mql: &MediaQueryList) { diff --git a/components/script/dom/mod.rs b/components/script/dom/mod.rs index 8df3660a3f9..deede3622d0 100644 --- a/components/script/dom/mod.rs +++ b/components/script/dom/mod.rs @@ -123,7 +123,7 @@ //! //! Reflectors are JavaScript objects, and as such can be freely aliased. As //! Rust does not allow mutable aliasing, mutable borrows of DOM objects are -//! not allowed. In particular, any mutable fields use `Cell` or `DOMRefCell` +//! not allowed. In particular, any mutable fields use `Cell` or `DomRefCell` //! to manage their mutability. //! //! `Reflector` and `DomObject` diff --git a/components/script/dom/mutationobserver.rs b/components/script/dom/mutationobserver.rs index ced20d1ec4a..6a411b7833f 100644 --- a/components/script/dom/mutationobserver.rs +++ b/components/script/dom/mutationobserver.rs @@ -3,7 +3,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ use dom::bindings::callback::ExceptionHandling; -use dom::bindings::cell::DOMRefCell; +use dom::bindings::cell::DomRefCell; use dom::bindings::codegen::Bindings::MutationObserverBinding; use dom::bindings::codegen::Bindings::MutationObserverBinding::MutationCallback; use dom::bindings::codegen::Bindings::MutationObserverBinding::MutationObserverBinding::MutationObserverMethods; @@ -26,7 +26,7 @@ pub struct MutationObserver { reflector_: Reflector, #[ignore_heap_size_of = "can't measure Rc values"] callback: Rc, - record_queue: DOMRefCell>>, + record_queue: DomRefCell>>, } pub enum Mutation<'a> { @@ -62,7 +62,7 @@ impl MutationObserver { MutationObserver { reflector_: Reflector::new(), callback: callback, - record_queue: DOMRefCell::new(vec![]), + record_queue: DomRefCell::new(vec![]), } } diff --git a/components/script/dom/node.rs b/components/script/dom/node.rs index d036e846e57..28f1979a53e 100644 --- a/components/script/dom/node.rs +++ b/components/script/dom/node.rs @@ -7,7 +7,7 @@ use app_units::Au; use devtools_traits::NodeInfo; use document_loader::DocumentLoader; -use dom::bindings::cell::DOMRefCell; +use dom::bindings::cell::DomRefCell; use dom::bindings::codegen::Bindings::CharacterDataBinding::CharacterDataMethods; use dom::bindings::codegen::Bindings::DocumentBinding::DocumentMethods; use dom::bindings::codegen::Bindings::ElementBinding::ElementMethods; @@ -140,7 +140,7 @@ pub struct Node { style_and_layout_data: Cell>, /// Registered observers for this node. - mutation_observers: DOMRefCell>, + mutation_observers: DomRefCell>, unique_id: UniqueId, } diff --git a/components/script/dom/paintworkletglobalscope.rs b/components/script/dom/paintworkletglobalscope.rs index daf8a0d35c2..24bd7e7d940 100644 --- a/components/script/dom/paintworkletglobalscope.rs +++ b/components/script/dom/paintworkletglobalscope.rs @@ -3,7 +3,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ use dom::bindings::callback::CallbackContainer; -use dom::bindings::cell::DOMRefCell; +use dom::bindings::cell::DomRefCell; use dom::bindings::codegen::Bindings::PaintWorkletGlobalScopeBinding; use dom::bindings::codegen::Bindings::PaintWorkletGlobalScopeBinding::PaintWorkletGlobalScopeMethods; use dom::bindings::codegen::Bindings::VoidFunctionBinding::VoidFunction; @@ -71,21 +71,21 @@ pub struct PaintWorkletGlobalScope { #[ignore_heap_size_of = "Arc"] image_cache: Arc, /// https://drafts.css-houdini.org/css-paint-api/#paint-definitions - paint_definitions: DOMRefCell>>, + paint_definitions: DomRefCell>>, /// https://drafts.css-houdini.org/css-paint-api/#paint-class-instances - paint_class_instances: DOMRefCell>>>, + paint_class_instances: DomRefCell>>>, /// The most recent name the worklet was called with - cached_name: DOMRefCell, + cached_name: DomRefCell, /// The most recent size the worklet was drawn at cached_size: Cell>, /// The most recent device pixel ratio the worklet was drawn at cached_device_pixel_ratio: Cell>, /// The most recent properties the worklet was drawn at - cached_properties: DOMRefCell>, + cached_properties: DomRefCell>, /// The most recent arguments the worklet was drawn at - cached_arguments: DOMRefCell>, + cached_arguments: DomRefCell>, /// The most recent result - cached_result: DOMRefCell, + cached_result: DomRefCell, } impl PaintWorkletGlobalScope { @@ -102,12 +102,12 @@ impl PaintWorkletGlobalScope { image_cache: init.image_cache.clone(), paint_definitions: Default::default(), paint_class_instances: Default::default(), - cached_name: DOMRefCell::new(Atom::from("")), + cached_name: DomRefCell::new(Atom::from("")), cached_size: Cell::new(TypedSize2D::zero()), cached_device_pixel_ratio: Cell::new(ScaleFactor::new(1.0)), cached_properties: Default::default(), cached_arguments: Default::default(), - cached_result: DOMRefCell::new(DrawAPaintImageResult { + cached_result: DomRefCell::new(DrawAPaintImageResult { width: 0, height: 0, format: PixelFormat::BGRA8, diff --git a/components/script/dom/performance.rs b/components/script/dom/performance.rs index b0fbae9b844..5df6f1bc9a8 100644 --- a/components/script/dom/performance.rs +++ b/components/script/dom/performance.rs @@ -2,7 +2,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -use dom::bindings::cell::DOMRefCell; +use dom::bindings::cell::DomRefCell; use dom::bindings::codegen::Bindings::PerformanceBinding; use dom::bindings::codegen::Bindings::PerformanceBinding::{DOMHighResTimeStamp, PerformanceMethods}; use dom::bindings::codegen::Bindings::PerformanceBinding::PerformanceEntryList as DOMPerformanceEntryList; @@ -111,8 +111,8 @@ struct PerformanceObserver { pub struct Performance { reflector_: Reflector, timing: Option>, - entries: DOMRefCell, - observers: DOMRefCell>, + entries: DomRefCell, + observers: DomRefCell>, pending_notification_observers_task: Cell, navigation_start_precise: f64, } @@ -130,8 +130,8 @@ impl Performance { } else { None }, - entries: DOMRefCell::new(PerformanceEntryList::new(Vec::new())), - observers: DOMRefCell::new(Vec::new()), + entries: DomRefCell::new(PerformanceEntryList::new(Vec::new())), + observers: DomRefCell::new(Vec::new()), pending_notification_observers_task: Cell::new(false), navigation_start_precise, } diff --git a/components/script/dom/performanceobserver.rs b/components/script/dom/performanceobserver.rs index ac28a7f4297..86b45f67a40 100644 --- a/components/script/dom/performanceobserver.rs +++ b/components/script/dom/performanceobserver.rs @@ -3,7 +3,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ use dom::bindings::callback::ExceptionHandling; -use dom::bindings::cell::DOMRefCell; +use dom::bindings::cell::DomRefCell; use dom::bindings::codegen::Bindings::PerformanceBinding::PerformanceEntryList as DOMPerformanceEntryList; use dom::bindings::codegen::Bindings::PerformanceObserverBinding; use dom::bindings::codegen::Bindings::PerformanceObserverBinding::PerformanceObserverCallback; @@ -34,12 +34,12 @@ pub struct PerformanceObserver { reflector_: Reflector, #[ignore_heap_size_of = "can't measure Rc values"] callback: Rc, - entries: DOMRefCell, + entries: DomRefCell, } impl PerformanceObserver { fn new_inherited(callback: Rc, - entries: DOMRefCell) + entries: DomRefCell) -> PerformanceObserver { PerformanceObserver { reflector_: Reflector::new(), @@ -53,7 +53,7 @@ impl PerformanceObserver { callback: Rc, entries: DOMPerformanceEntryList) -> Root { - let observer = PerformanceObserver::new_inherited(callback, DOMRefCell::new(entries)); + let observer = PerformanceObserver::new_inherited(callback, DomRefCell::new(entries)); reflect_dom_object(box observer, global, PerformanceObserverBinding::Wrap) } diff --git a/components/script/dom/performanceobserverentrylist.rs b/components/script/dom/performanceobserverentrylist.rs index 2b127ec75f7..558ad749e5d 100644 --- a/components/script/dom/performanceobserverentrylist.rs +++ b/components/script/dom/performanceobserverentrylist.rs @@ -2,7 +2,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -use dom::bindings::cell::DOMRefCell; +use dom::bindings::cell::DomRefCell; use dom::bindings::codegen::Bindings::PerformanceObserverEntryListBinding; use dom::bindings::codegen::Bindings::PerformanceObserverEntryListBinding::PerformanceObserverEntryListMethods; use dom::bindings::reflector::{Reflector, reflect_dom_object}; @@ -16,14 +16,14 @@ use dom_struct::dom_struct; #[dom_struct] pub struct PerformanceObserverEntryList { reflector_: Reflector, - entries: DOMRefCell, + entries: DomRefCell, } impl PerformanceObserverEntryList { fn new_inherited(entries: PerformanceEntryList) -> PerformanceObserverEntryList { PerformanceObserverEntryList { reflector_: Reflector::new(), - entries: DOMRefCell::new(entries), + entries: DomRefCell::new(entries), } } diff --git a/components/script/dom/request.rs b/components/script/dom/request.rs index 1d9d20629d0..6f7f5518c57 100644 --- a/components/script/dom/request.rs +++ b/components/script/dom/request.rs @@ -3,7 +3,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ use body::{BodyOperations, BodyType, consume_body}; -use dom::bindings::cell::DOMRefCell; +use dom::bindings::cell::DomRefCell; use dom::bindings::codegen::Bindings::HeadersBinding::{HeadersInit, HeadersMethods}; use dom::bindings::codegen::Bindings::RequestBinding; use dom::bindings::codegen::Bindings::RequestBinding::ReferrerPolicy; @@ -44,12 +44,12 @@ use std::rc::Rc; #[dom_struct] pub struct Request { reflector_: Reflector, - request: DOMRefCell, + request: DomRefCell, body_used: Cell, headers: MutNullableDom, - mime_type: DOMRefCell>, + mime_type: DomRefCell>, #[ignore_heap_size_of = "Rc"] - body_promise: DOMRefCell, BodyType)>>, + body_promise: DomRefCell, BodyType)>>, } impl Request { @@ -57,12 +57,12 @@ impl Request { url: ServoUrl) -> Request { Request { reflector_: Reflector::new(), - request: DOMRefCell::new( + request: DomRefCell::new( net_request_from_global(global, url)), body_used: Cell::new(false), headers: Default::default(), - mime_type: DOMRefCell::new("".to_string().into_bytes()), - body_promise: DOMRefCell::new(None), + mime_type: DomRefCell::new("".to_string().into_bytes()), + body_promise: DomRefCell::new(None), } } diff --git a/components/script/dom/response.rs b/components/script/dom/response.rs index 55c942e88fc..269803feaa2 100644 --- a/components/script/dom/response.rs +++ b/components/script/dom/response.rs @@ -4,7 +4,7 @@ use body::{BodyOperations, BodyType, consume_body, consume_body_with_promise}; use core::cell::Cell; -use dom::bindings::cell::DOMRefCell; +use dom::bindings::cell::DomRefCell; use dom::bindings::codegen::Bindings::HeadersBinding::{HeadersInit, HeadersMethods}; use dom::bindings::codegen::Bindings::ResponseBinding; use dom::bindings::codegen::Bindings::ResponseBinding::{ResponseMethods, ResponseType as DOMResponseType}; @@ -34,19 +34,19 @@ use url::Position; pub struct Response { reflector_: Reflector, headers_reflector: MutNullableDom, - mime_type: DOMRefCell>, + mime_type: DomRefCell>, body_used: Cell, /// `None` can be considered a StatusCode of `0`. #[ignore_heap_size_of = "Defined in hyper"] - status: DOMRefCell>, - raw_status: DOMRefCell)>>, - response_type: DOMRefCell, - url: DOMRefCell>, - url_list: DOMRefCell>, + status: DomRefCell>, + raw_status: DomRefCell)>>, + response_type: DomRefCell, + url: DomRefCell>, + url_list: DomRefCell>, // For now use the existing NetTraitsResponseBody enum - body: DOMRefCell, + body: DomRefCell, #[ignore_heap_size_of = "Rc"] - body_promise: DOMRefCell, BodyType)>>, + body_promise: DomRefCell, BodyType)>>, } impl Response { @@ -54,15 +54,15 @@ impl Response { Response { reflector_: Reflector::new(), headers_reflector: Default::default(), - mime_type: DOMRefCell::new("".to_string().into_bytes()), + mime_type: DomRefCell::new("".to_string().into_bytes()), body_used: Cell::new(false), - status: DOMRefCell::new(Some(StatusCode::Ok)), - raw_status: DOMRefCell::new(Some((200, b"OK".to_vec()))), - response_type: DOMRefCell::new(DOMResponseType::Default), - url: DOMRefCell::new(None), - url_list: DOMRefCell::new(vec![]), - body: DOMRefCell::new(NetTraitsResponseBody::Empty), - body_promise: DOMRefCell::new(None), + status: DomRefCell::new(Some(StatusCode::Ok)), + raw_status: DomRefCell::new(Some((200, b"OK".to_vec()))), + response_type: DomRefCell::new(DOMResponseType::Default), + url: DomRefCell::new(None), + url_list: DomRefCell::new(vec![]), + body: DomRefCell::new(NetTraitsResponseBody::Empty), + body_promise: DomRefCell::new(None), } } diff --git a/components/script/dom/serviceworker.rs b/components/script/dom/serviceworker.rs index adc4796a270..4078daabf4f 100644 --- a/components/script/dom/serviceworker.rs +++ b/components/script/dom/serviceworker.rs @@ -3,7 +3,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ use dom::abstractworker::SimpleWorkerErrorHandler; -use dom::bindings::cell::DOMRefCell; +use dom::bindings::cell::DomRefCell; use dom::bindings::codegen::Bindings::ServiceWorkerBinding::{ServiceWorkerMethods, ServiceWorkerState, Wrap}; use dom::bindings::error::{ErrorResult, Error}; use dom::bindings::inheritance::Castable; @@ -26,7 +26,7 @@ pub type TrustedServiceWorkerAddress = Trusted; #[dom_struct] pub struct ServiceWorker { eventtarget: EventTarget, - script_url: DOMRefCell, + script_url: DomRefCell, scope_url: ServoUrl, state: Cell, skip_waiting: Cell @@ -38,7 +38,7 @@ impl ServiceWorker { scope_url: ServoUrl) -> ServiceWorker { ServiceWorker { eventtarget: EventTarget::new_inherited(), - script_url: DOMRefCell::new(String::from(script_url)), + script_url: DomRefCell::new(String::from(script_url)), state: Cell::new(ServiceWorkerState::Installing), scope_url: scope_url, skip_waiting: Cell::new(skip_waiting) diff --git a/components/script/dom/servoparser/mod.rs b/components/script/dom/servoparser/mod.rs index 0da5d9391d7..3bc3a98baba 100644 --- a/components/script/dom/servoparser/mod.rs +++ b/components/script/dom/servoparser/mod.rs @@ -3,7 +3,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ use document_loader::{DocumentLoader, LoadType}; -use dom::bindings::cell::DOMRefCell; +use dom::bindings::cell::DomRefCell; use dom::bindings::codegen::Bindings::DocumentBinding::{DocumentMethods, DocumentReadyState}; use dom::bindings::codegen::Bindings::HTMLImageElementBinding::HTMLImageElementMethods; use dom::bindings::codegen::Bindings::HTMLTemplateElementBinding::HTMLTemplateElementMethods; @@ -75,15 +75,15 @@ pub struct ServoParser { document: Dom, /// Input received from network. #[ignore_heap_size_of = "Defined in html5ever"] - network_input: DOMRefCell, + network_input: DomRefCell, /// Part of an UTF-8 code point spanning input chunks #[ignore_heap_size_of = "Defined in html5ever"] - incomplete_utf8: DOMRefCell>, + incomplete_utf8: DomRefCell>, /// Input received from script. Used only to support document.write(). #[ignore_heap_size_of = "Defined in html5ever"] - script_input: DOMRefCell, + script_input: DomRefCell, /// The tokenizer of this parser. - tokenizer: DOMRefCell, + tokenizer: DomRefCell, /// Whether to expect any further input from the associated network request. last_chunk_received: Cell, /// Whether this parser should avoid passing any further data to the tokenizer. @@ -320,10 +320,10 @@ impl ServoParser { ServoParser { reflector: Reflector::new(), document: Dom::from_ref(document), - incomplete_utf8: DOMRefCell::new(None), - network_input: DOMRefCell::new(BufferQueue::new()), - script_input: DOMRefCell::new(BufferQueue::new()), - tokenizer: DOMRefCell::new(tokenizer), + incomplete_utf8: DomRefCell::new(None), + network_input: DomRefCell::new(BufferQueue::new()), + script_input: DomRefCell::new(BufferQueue::new()), + tokenizer: DomRefCell::new(tokenizer), last_chunk_received: Cell::new(last_chunk_state == LastChunkState::Received), suspended: Default::default(), script_nesting_level: Default::default(), diff --git a/components/script/dom/testbindingiterable.rs b/components/script/dom/testbindingiterable.rs index 2ee9fca631d..a412c5e288d 100644 --- a/components/script/dom/testbindingiterable.rs +++ b/components/script/dom/testbindingiterable.rs @@ -4,7 +4,7 @@ // check-tidy: no specs after this line -use dom::bindings::cell::DOMRefCell; +use dom::bindings::cell::DomRefCell; use dom::bindings::codegen::Bindings::TestBindingIterableBinding::{self, TestBindingIterableMethods}; use dom::bindings::error::Fallible; use dom::bindings::reflector::{Reflector, reflect_dom_object}; @@ -16,14 +16,14 @@ use dom_struct::dom_struct; #[dom_struct] pub struct TestBindingIterable { reflector: Reflector, - vals: DOMRefCell>, + vals: DomRefCell>, } impl TestBindingIterable { fn new(global: &GlobalScope) -> Root { reflect_dom_object(box TestBindingIterable { reflector: Reflector::new(), - vals: DOMRefCell::new(vec![]), + vals: DomRefCell::new(vec![]), }, global, TestBindingIterableBinding::Wrap) } diff --git a/components/script/dom/testbindingpairiterable.rs b/components/script/dom/testbindingpairiterable.rs index 7d95e95e7d7..106fb5e850b 100644 --- a/components/script/dom/testbindingpairiterable.rs +++ b/components/script/dom/testbindingpairiterable.rs @@ -4,7 +4,7 @@ // check-tidy: no specs after this line -use dom::bindings::cell::DOMRefCell; +use dom::bindings::cell::DomRefCell; use dom::bindings::codegen::Bindings::TestBindingPairIterableBinding; use dom::bindings::codegen::Bindings::TestBindingPairIterableBinding::TestBindingPairIterableMethods; use dom::bindings::error::Fallible; @@ -18,7 +18,7 @@ use dom_struct::dom_struct; #[dom_struct] pub struct TestBindingPairIterable { reflector: Reflector, - map: DOMRefCell>, + map: DomRefCell>, } impl Iterable for TestBindingPairIterable { @@ -39,7 +39,7 @@ impl TestBindingPairIterable { fn new(global: &GlobalScope) -> Root { reflect_dom_object(box TestBindingPairIterable { reflector: Reflector::new(), - map: DOMRefCell::new(vec![]), + map: DomRefCell::new(vec![]), }, global, TestBindingPairIterableBinding::TestBindingPairIterableWrap) } diff --git a/components/script/dom/testworkletglobalscope.rs b/components/script/dom/testworkletglobalscope.rs index f548fb0544f..ed29e8a4f30 100644 --- a/components/script/dom/testworkletglobalscope.rs +++ b/components/script/dom/testworkletglobalscope.rs @@ -2,7 +2,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -use dom::bindings::cell::DOMRefCell; +use dom::bindings::cell::DomRefCell; use dom::bindings::codegen::Bindings::TestWorkletGlobalScopeBinding; use dom::bindings::codegen::Bindings::TestWorkletGlobalScopeBinding::TestWorkletGlobalScopeMethods; use dom::bindings::root::Root; @@ -24,7 +24,7 @@ pub struct TestWorkletGlobalScope { // The worklet global for this object worklet_global: WorkletGlobalScope, // The key/value pairs - lookup_table: DOMRefCell>, + lookup_table: DomRefCell>, } impl TestWorkletGlobalScope { diff --git a/components/script/dom/url.rs b/components/script/dom/url.rs index b19d2337142..73832c4e5a4 100644 --- a/components/script/dom/url.rs +++ b/components/script/dom/url.rs @@ -2,7 +2,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -use dom::bindings::cell::DOMRefCell; +use dom::bindings::cell::DomRefCell; use dom::bindings::codegen::Bindings::URLBinding::{self, URLMethods}; use dom::bindings::error::{Error, ErrorResult, Fallible}; use dom::bindings::reflector::{DomObject, Reflector, reflect_dom_object}; @@ -27,7 +27,7 @@ pub struct URL { reflector_: Reflector, // https://url.spec.whatwg.org/#concept-url-url - url: DOMRefCell, + url: DomRefCell, // https://url.spec.whatwg.org/#dom-url-searchparams search_params: MutNullableDom, @@ -37,7 +37,7 @@ impl URL { fn new_inherited(url: ServoUrl) -> URL { URL { reflector_: Reflector::new(), - url: DOMRefCell::new(url), + url: DomRefCell::new(url), search_params: Default::default(), } } diff --git a/components/script/dom/urlsearchparams.rs b/components/script/dom/urlsearchparams.rs index cdb215a2c95..6ac19c05db7 100644 --- a/components/script/dom/urlsearchparams.rs +++ b/components/script/dom/urlsearchparams.rs @@ -2,7 +2,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -use dom::bindings::cell::DOMRefCell; +use dom::bindings::cell::DomRefCell; use dom::bindings::codegen::Bindings::URLSearchParamsBinding::URLSearchParamsMethods; use dom::bindings::codegen::Bindings::URLSearchParamsBinding::URLSearchParamsWrap; use dom::bindings::codegen::UnionTypes::USVStringOrURLSearchParams; @@ -23,7 +23,7 @@ use url::form_urlencoded; pub struct URLSearchParams { reflector_: Reflector, // https://url.spec.whatwg.org/#concept-urlsearchparams-list - list: DOMRefCell>, + list: DomRefCell>, // https://url.spec.whatwg.org/#concept-urlsearchparams-url-object url: MutableWeakRef, } @@ -32,7 +32,7 @@ impl URLSearchParams { fn new_inherited(url: Option<&URL>) -> URLSearchParams { URLSearchParams { reflector_: Reflector::new(), - list: DOMRefCell::new(url.map_or(Vec::new(), |url| url.query_pairs())), + list: DomRefCell::new(url.map_or(Vec::new(), |url| url.query_pairs())), url: MutableWeakRef::new(url), } } diff --git a/components/script/dom/vr.rs b/components/script/dom/vr.rs index 83e75931e6a..ea77bde63f8 100644 --- a/components/script/dom/vr.rs +++ b/components/script/dom/vr.rs @@ -2,7 +2,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -use dom::bindings::cell::DOMRefCell; +use dom::bindings::cell::DomRefCell; use dom::bindings::codegen::Bindings::VRBinding; use dom::bindings::codegen::Bindings::VRBinding::VRMethods; use dom::bindings::codegen::Bindings::VRDisplayBinding::VRDisplayMethods; @@ -28,16 +28,16 @@ use webvr_traits::{WebVRGamepadData, WebVRGamepadEvent, WebVRGamepadState}; #[dom_struct] pub struct VR { reflector_: Reflector, - displays: DOMRefCell>>, - gamepads: DOMRefCell>> + displays: DomRefCell>>, + gamepads: DomRefCell>> } impl VR { fn new_inherited() -> VR { VR { reflector_: Reflector::new(), - displays: DOMRefCell::new(Vec::new()), - gamepads: DOMRefCell::new(Vec::new()), + displays: DomRefCell::new(Vec::new()), + gamepads: DomRefCell::new(Vec::new()), } } diff --git a/components/script/dom/vrdisplay.rs b/components/script/dom/vrdisplay.rs index c05ff88b19a..81399b894e9 100644 --- a/components/script/dom/vrdisplay.rs +++ b/components/script/dom/vrdisplay.rs @@ -5,7 +5,7 @@ use canvas_traits::webgl::{webgl_channel, WebGLReceiver, WebVRCommand}; use core::ops::Deref; use dom::bindings::callback::ExceptionHandling; -use dom::bindings::cell::DOMRefCell; +use dom::bindings::cell::DomRefCell; use dom::bindings::codegen::Bindings::PerformanceBinding::PerformanceBinding::PerformanceMethods; use dom::bindings::codegen::Bindings::VRDisplayBinding; use dom::bindings::codegen::Bindings::VRDisplayBinding::VRDisplayMethods; @@ -47,7 +47,7 @@ use webvr_traits::{WebVRDisplayData, WebVRDisplayEvent, WebVRFrameData, WebVRLay pub struct VRDisplay { eventtarget: EventTarget, #[ignore_heap_size_of = "Defined in rust-webvr"] - display: DOMRefCell, + display: DomRefCell, depth_near: Cell, depth_far: Cell, presenting: Cell, @@ -56,19 +56,19 @@ pub struct VRDisplay { capabilities: MutDom, stage_params: MutNullableDom, #[ignore_heap_size_of = "Defined in rust-webvr"] - frame_data: DOMRefCell, + frame_data: DomRefCell, #[ignore_heap_size_of = "Defined in rust-webvr"] - layer: DOMRefCell, + layer: DomRefCell, layer_ctx: MutNullableDom, #[ignore_heap_size_of = "Defined in rust-webvr"] next_raf_id: Cell, /// List of request animation frame callbacks #[ignore_heap_size_of = "closures are hard"] - raf_callback_list: DOMRefCell>)>>, + raf_callback_list: DomRefCell>)>>, // Compositor VRFrameData synchonization frame_data_status: Cell, #[ignore_heap_size_of = "channels are hard"] - frame_data_receiver: DOMRefCell, ()>>>>, + frame_data_receiver: DomRefCell, ()>>>>, running_display_raf: Cell, paused: Cell, stopped_on_pause: Cell, @@ -96,7 +96,7 @@ impl VRDisplay { VRDisplay { eventtarget: EventTarget::new_inherited(), - display: DOMRefCell::new(display.clone()), + display: DomRefCell::new(display.clone()), depth_near: Cell::new(0.01), depth_far: Cell::new(10000.0), presenting: Cell::new(false), @@ -104,13 +104,13 @@ impl VRDisplay { right_eye_params: MutDom::new(&*VREyeParameters::new(display.right_eye_parameters.clone(), &global)), capabilities: MutDom::new(&*VRDisplayCapabilities::new(display.capabilities.clone(), &global)), stage_params: MutNullableDom::new(stage.as_ref().map(|v| v.deref())), - frame_data: DOMRefCell::new(Default::default()), - layer: DOMRefCell::new(Default::default()), + frame_data: DomRefCell::new(Default::default()), + layer: DomRefCell::new(Default::default()), layer_ctx: MutNullableDom::default(), next_raf_id: Cell::new(1), - raf_callback_list: DOMRefCell::new(vec![]), + raf_callback_list: DomRefCell::new(vec![]), frame_data_status: Cell::new(VRFrameDataStatus::Waiting), - frame_data_receiver: DOMRefCell::new(None), + frame_data_receiver: DomRefCell::new(None), running_display_raf: Cell::new(false), // Some VR implementations (e.g. Daydream) can be paused in some life cycle situations // such as showing and hiding the controller pairing screen. diff --git a/components/script/dom/vrdisplaycapabilities.rs b/components/script/dom/vrdisplaycapabilities.rs index 39e8dabc854..340a2942820 100644 --- a/components/script/dom/vrdisplaycapabilities.rs +++ b/components/script/dom/vrdisplaycapabilities.rs @@ -2,7 +2,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -use dom::bindings::cell::DOMRefCell; +use dom::bindings::cell::DomRefCell; use dom::bindings::codegen::Bindings::VRDisplayCapabilitiesBinding; use dom::bindings::codegen::Bindings::VRDisplayCapabilitiesBinding::VRDisplayCapabilitiesMethods; use dom::bindings::reflector::{Reflector, reflect_dom_object}; @@ -15,7 +15,7 @@ use webvr_traits::WebVRDisplayCapabilities; pub struct VRDisplayCapabilities { reflector_: Reflector, #[ignore_heap_size_of = "Defined in rust-webvr"] - capabilities: DOMRefCell + capabilities: DomRefCell } unsafe_no_jsmanaged_fields!(WebVRDisplayCapabilities); @@ -24,7 +24,7 @@ impl VRDisplayCapabilities { fn new_inherited(capabilities: WebVRDisplayCapabilities) -> VRDisplayCapabilities { VRDisplayCapabilities { reflector_: Reflector::new(), - capabilities: DOMRefCell::new(capabilities) + capabilities: DomRefCell::new(capabilities) } } diff --git a/components/script/dom/vreyeparameters.rs b/components/script/dom/vreyeparameters.rs index 8df18c91e04..337f70d2b46 100644 --- a/components/script/dom/vreyeparameters.rs +++ b/components/script/dom/vreyeparameters.rs @@ -3,7 +3,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ use core::nonzero::NonZero; -use dom::bindings::cell::DOMRefCell; +use dom::bindings::cell::DomRefCell; use dom::bindings::codegen::Bindings::VREyeParametersBinding; use dom::bindings::codegen::Bindings::VREyeParametersBinding::VREyeParametersMethods; use dom::bindings::reflector::{Reflector, reflect_dom_object}; @@ -21,7 +21,7 @@ use webvr_traits::WebVREyeParameters; pub struct VREyeParameters { reflector_: Reflector, #[ignore_heap_size_of = "Defined in rust-webvr"] - parameters: DOMRefCell, + parameters: DomRefCell, offset: Heap<*mut JSObject>, fov: Dom, } @@ -32,7 +32,7 @@ impl VREyeParameters { fn new_inherited(parameters: WebVREyeParameters, fov: &VRFieldOfView) -> VREyeParameters { VREyeParameters { reflector_: Reflector::new(), - parameters: DOMRefCell::new(parameters), + parameters: DomRefCell::new(parameters), offset: Heap::default(), fov: Dom::from_ref(&*fov) } diff --git a/components/script/dom/vrfieldofview.rs b/components/script/dom/vrfieldofview.rs index a91bb13fa83..93f72bc77b5 100644 --- a/components/script/dom/vrfieldofview.rs +++ b/components/script/dom/vrfieldofview.rs @@ -2,7 +2,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -use dom::bindings::cell::DOMRefCell; +use dom::bindings::cell::DomRefCell; use dom::bindings::codegen::Bindings::VRFieldOfViewBinding; use dom::bindings::codegen::Bindings::VRFieldOfViewBinding::VRFieldOfViewMethods; use dom::bindings::num::Finite; @@ -16,7 +16,7 @@ use webvr_traits::WebVRFieldOfView; pub struct VRFieldOfView { reflector_: Reflector, #[ignore_heap_size_of = "Defined in rust-webvr"] - fov: DOMRefCell + fov: DomRefCell } unsafe_no_jsmanaged_fields!(WebVRFieldOfView); @@ -25,7 +25,7 @@ impl VRFieldOfView { fn new_inherited(fov: WebVRFieldOfView) -> VRFieldOfView { VRFieldOfView { reflector_: Reflector::new(), - fov: DOMRefCell::new(fov) + fov: DomRefCell::new(fov) } } diff --git a/components/script/dom/vrstageparameters.rs b/components/script/dom/vrstageparameters.rs index 2161b215560..c2731d1193b 100644 --- a/components/script/dom/vrstageparameters.rs +++ b/components/script/dom/vrstageparameters.rs @@ -3,7 +3,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ use core::nonzero::NonZero; -use dom::bindings::cell::DOMRefCell; +use dom::bindings::cell::DomRefCell; use dom::bindings::codegen::Bindings::VRStageParametersBinding; use dom::bindings::codegen::Bindings::VRStageParametersBinding::VRStageParametersMethods; use dom::bindings::num::Finite; @@ -20,7 +20,7 @@ use webvr_traits::WebVRStageParameters; pub struct VRStageParameters { reflector_: Reflector, #[ignore_heap_size_of = "Defined in rust-webvr"] - parameters: DOMRefCell, + parameters: DomRefCell, transform: Heap<*mut JSObject>, } @@ -30,7 +30,7 @@ impl VRStageParameters { fn new_inherited(parameters: WebVRStageParameters) -> VRStageParameters { VRStageParameters { reflector_: Reflector::new(), - parameters: DOMRefCell::new(parameters), + parameters: DomRefCell::new(parameters), transform: Heap::default() } } diff --git a/components/script/dom/webgl_extensions/ext/webglvertexarrayobjectoes.rs b/components/script/dom/webgl_extensions/ext/webglvertexarrayobjectoes.rs index 3ef5f8bbefa..cdbe9f2e2e8 100644 --- a/components/script/dom/webgl_extensions/ext/webglvertexarrayobjectoes.rs +++ b/components/script/dom/webgl_extensions/ext/webglvertexarrayobjectoes.rs @@ -5,7 +5,7 @@ use canvas_traits::webgl::WebGLVertexArrayId; use core::cell::Ref; use core::iter::FromIterator; -use dom::bindings::cell::DOMRefCell; +use dom::bindings::cell::DomRefCell; use dom::bindings::codegen::Bindings::WebGLVertexArrayObjectOESBinding; use dom::bindings::reflector::reflect_dom_object; use dom::bindings::root::{Dom, MutNullableDom, Root}; @@ -22,7 +22,7 @@ pub struct WebGLVertexArrayObjectOES { id: WebGLVertexArrayId, ever_bound: Cell, is_deleted: Cell, - bound_attrib_buffers: DOMRefCell>>, + bound_attrib_buffers: DomRefCell>>, bound_buffer_element_array: MutNullableDom, } @@ -33,7 +33,7 @@ impl WebGLVertexArrayObjectOES { id: id, ever_bound: Cell::new(false), is_deleted: Cell::new(false), - bound_attrib_buffers: DOMRefCell::new(HashMap::new()), + bound_attrib_buffers: DomRefCell::new(HashMap::new()), bound_buffer_element_array: MutNullableDom::new(None), } } diff --git a/components/script/dom/webgl_extensions/extensions.rs b/components/script/dom/webgl_extensions/extensions.rs index 1eca2aac3ca..ebadaf9a612 100644 --- a/components/script/dom/webgl_extensions/extensions.rs +++ b/components/script/dom/webgl_extensions/extensions.rs @@ -5,7 +5,7 @@ use canvas_traits::webgl::WebGLError; use core::iter::FromIterator; use core::nonzero::NonZero; -use dom::bindings::cell::DOMRefCell; +use dom::bindings::cell::DomRefCell; use dom::bindings::codegen::Bindings::OESStandardDerivativesBinding::OESStandardDerivativesConstants; use dom::bindings::codegen::Bindings::OESTextureHalfFloatBinding::OESTextureHalfFloatConstants; use dom::bindings::codegen::Bindings::WebGLRenderingContextBinding::WebGLRenderingContextConstants as constants; @@ -76,15 +76,15 @@ impl Default for WebGLExtensionFeatures { #[must_root] #[derive(HeapSizeOf, JSTraceable)] pub struct WebGLExtensions { - extensions: DOMRefCell>>, - features: DOMRefCell, + extensions: DomRefCell>>, + features: DomRefCell, } impl WebGLExtensions { pub fn new() -> WebGLExtensions { Self { - extensions: DOMRefCell::new(HashMap::new()), - features: DOMRefCell::new(Default::default()) + extensions: DomRefCell::new(HashMap::new()), + features: DomRefCell::new(Default::default()) } } diff --git a/components/script/dom/webglbuffer.rs b/components/script/dom/webglbuffer.rs index 4a3e2634453..63859fb9afe 100644 --- a/components/script/dom/webglbuffer.rs +++ b/components/script/dom/webglbuffer.rs @@ -5,7 +5,7 @@ // https://www.khronos.org/registry/webgl/specs/latest/1.0/webgl.idl use canvas_traits::webgl::{WebGLBufferId, WebGLCommand, WebGLError, WebGLMsgSender, WebGLResult, WebGLVertexArrayId}; use canvas_traits::webgl::webgl_channel; -use dom::bindings::cell::DOMRefCell; +use dom::bindings::cell::DomRefCell; use dom::bindings::codegen::Bindings::WebGLBufferBinding; use dom::bindings::reflector::reflect_dom_object; use dom::bindings::root::Root; @@ -25,7 +25,7 @@ pub struct WebGLBuffer { capacity: Cell, is_deleted: Cell, // The Vertex Array Objects that are referencing this buffer - vao_references: DOMRefCell>>, + vao_references: DomRefCell>>, pending_delete: Cell, #[ignore_heap_size_of = "Defined in ipc-channel"] renderer: WebGLMsgSender, @@ -41,7 +41,7 @@ impl WebGLBuffer { target: Cell::new(None), capacity: Cell::new(0), is_deleted: Cell::new(false), - vao_references: DOMRefCell::new(None), + vao_references: DomRefCell::new(None), pending_delete: Cell::new(false), renderer: renderer, } diff --git a/components/script/dom/webglframebuffer.rs b/components/script/dom/webglframebuffer.rs index 0a8df198cdb..35698c5a4d2 100644 --- a/components/script/dom/webglframebuffer.rs +++ b/components/script/dom/webglframebuffer.rs @@ -6,7 +6,7 @@ use canvas_traits::webgl::{WebGLCommand, WebGLFramebufferBindingRequest, WebGLFramebufferId}; use canvas_traits::webgl::{WebGLMsgSender, WebGLResult, WebGLError}; use canvas_traits::webgl::webgl_channel; -use dom::bindings::cell::DOMRefCell; +use dom::bindings::cell::DomRefCell; use dom::bindings::codegen::Bindings::WebGLFramebufferBinding; use dom::bindings::codegen::Bindings::WebGLRenderingContextBinding::WebGLRenderingContextConstants as constants; use dom::bindings::reflector::reflect_dom_object; @@ -39,10 +39,10 @@ pub struct WebGLFramebuffer { // The attachment points for textures and renderbuffers on this // FBO. - color: DOMRefCell>, - depth: DOMRefCell>, - stencil: DOMRefCell>, - depthstencil: DOMRefCell>, + color: DomRefCell>, + depth: DomRefCell>, + stencil: DomRefCell>, + depthstencil: DomRefCell>, } impl WebGLFramebuffer { @@ -57,10 +57,10 @@ impl WebGLFramebuffer { renderer: renderer, size: Cell::new(None), status: Cell::new(constants::FRAMEBUFFER_UNSUPPORTED), - color: DOMRefCell::new(None), - depth: DOMRefCell::new(None), - stencil: DOMRefCell::new(None), - depthstencil: DOMRefCell::new(None), + color: DomRefCell::new(None), + depth: DomRefCell::new(None), + stencil: DomRefCell::new(None), + depthstencil: DomRefCell::new(None), } } @@ -291,7 +291,7 @@ impl WebGLFramebuffer { } fn with_matching_renderbuffers(&self, rb: &WebGLRenderbuffer, mut closure: F) - where F: FnMut(&DOMRefCell>) + where F: FnMut(&DomRefCell>) { let attachments = [&self.color, &self.depth, @@ -314,7 +314,7 @@ impl WebGLFramebuffer { } fn with_matching_textures(&self, texture: &WebGLTexture, mut closure: F) - where F: FnMut(&DOMRefCell>) + where F: FnMut(&DomRefCell>) { let attachments = [&self.color, &self.depth, diff --git a/components/script/dom/webglrenderingcontext.rs b/components/script/dom/webglrenderingcontext.rs index 6ce1718d799..dd0c802ab09 100644 --- a/components/script/dom/webglrenderingcontext.rs +++ b/components/script/dom/webglrenderingcontext.rs @@ -11,7 +11,7 @@ use canvas_traits::webgl::webgl_channel; use core::cell::Ref; use core::iter::FromIterator; use core::nonzero::NonZero; -use dom::bindings::cell::DOMRefCell; +use dom::bindings::cell::DomRefCell; use dom::bindings::codegen::Bindings::WebGLRenderingContextBinding::{self, WebGLContextAttributes}; use dom::bindings::codegen::Bindings::WebGLRenderingContextBinding::WebGLRenderingContextConstants as constants; use dom::bindings::codegen::Bindings::WebGLRenderingContextBinding::WebGLRenderingContextMethods; @@ -151,7 +151,7 @@ pub struct WebGLRenderingContext { bound_texture_cube_map: MutNullableDom, bound_buffer_array: MutNullableDom, bound_buffer_element_array: MutNullableDom, - bound_attrib_buffers: DOMRefCell>>, + bound_attrib_buffers: DomRefCell>>, current_program: MutNullableDom, #[ignore_heap_size_of = "Because it's small"] current_vertex_attrib_0: Cell<(f32, f32, f32, f32)>, @@ -194,7 +194,7 @@ impl WebGLRenderingContext { bound_texture_cube_map: MutNullableDom::new(None), bound_buffer_array: MutNullableDom::new(None), bound_buffer_element_array: MutNullableDom::new(None), - bound_attrib_buffers: DOMRefCell::new(Default::default()), + bound_attrib_buffers: DomRefCell::new(Default::default()), bound_renderbuffer: MutNullableDom::new(None), current_program: MutNullableDom::new(None), current_vertex_attrib_0: Cell::new((0f32, 0f32, 0f32, 1f32)), diff --git a/components/script/dom/webglshader.rs b/components/script/dom/webglshader.rs index 8f9c0f78f3b..54f2a743446 100644 --- a/components/script/dom/webglshader.rs +++ b/components/script/dom/webglshader.rs @@ -5,7 +5,7 @@ // https://www.khronos.org/registry/webgl/specs/latest/1.0/webgl.idl use angle::hl::{BuiltInResources, Output, ShaderValidator}; use canvas_traits::webgl::{webgl_channel, WebGLCommand, WebGLMsgSender, WebGLParameter, WebGLResult, WebGLShaderId}; -use dom::bindings::cell::DOMRefCell; +use dom::bindings::cell::DomRefCell; use dom::bindings::codegen::Bindings::WebGLShaderBinding; use dom::bindings::reflector::reflect_dom_object; use dom::bindings::root::Root; @@ -30,8 +30,8 @@ pub struct WebGLShader { webgl_object: WebGLObject, id: WebGLShaderId, gl_type: u32, - source: DOMRefCell>, - info_log: DOMRefCell>, + source: DomRefCell>, + info_log: DomRefCell>, is_deleted: Cell, attached_counter: Cell, compilation_status: Cell, @@ -57,8 +57,8 @@ impl WebGLShader { webgl_object: WebGLObject::new_inherited(), id: id, gl_type: shader_type, - source: DOMRefCell::new(None), - info_log: DOMRefCell::new(None), + source: DomRefCell::new(None), + info_log: DomRefCell::new(None), is_deleted: Cell::new(false), attached_counter: Cell::new(0), compilation_status: Cell::new(ShaderCompilationStatus::NotCompiled), diff --git a/components/script/dom/webgltexture.rs b/components/script/dom/webgltexture.rs index 22800430a6b..fe323b53efd 100644 --- a/components/script/dom/webgltexture.rs +++ b/components/script/dom/webgltexture.rs @@ -5,7 +5,7 @@ // https://www.khronos.org/registry/webgl/specs/latest/1.0/webgl.idl use canvas_traits::webgl::{webgl_channel, WebGLCommand, WebGLError, WebGLMsgSender, WebGLResult, WebGLTextureId}; -use dom::bindings::cell::DOMRefCell; +use dom::bindings::cell::DomRefCell; use dom::bindings::codegen::Bindings::WebGLRenderingContextBinding::WebGLRenderingContextConstants as constants; use dom::bindings::codegen::Bindings::WebGLTextureBinding; use dom::bindings::reflector::reflect_dom_object; @@ -36,7 +36,7 @@ pub struct WebGLTexture { is_deleted: Cell, /// Stores information about mipmap levels and cubemap faces. #[ignore_heap_size_of = "Arrays are cumbersome"] - image_info_array: DOMRefCell<[ImageInfo; MAX_LEVEL_COUNT * MAX_FACE_COUNT]>, + image_info_array: DomRefCell<[ImageInfo; MAX_LEVEL_COUNT * MAX_FACE_COUNT]>, /// Face count can only be 1 or 6 face_count: Cell, base_mipmap_level: u32, @@ -60,7 +60,7 @@ impl WebGLTexture { base_mipmap_level: 0, min_filter: Cell::new(None), mag_filter: Cell::new(None), - image_info_array: DOMRefCell::new([ImageInfo::new(); MAX_LEVEL_COUNT * MAX_FACE_COUNT]), + image_info_array: DomRefCell::new([ImageInfo::new(); MAX_LEVEL_COUNT * MAX_FACE_COUNT]), renderer: renderer, } } diff --git a/components/script/dom/websocket.rs b/components/script/dom/websocket.rs index 4e25a64fce7..132c616ae49 100644 --- a/components/script/dom/websocket.rs +++ b/components/script/dom/websocket.rs @@ -2,7 +2,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -use dom::bindings::cell::DOMRefCell; +use dom::bindings::cell::DomRefCell; use dom::bindings::codegen::Bindings::BlobBinding::BlobMethods; use dom::bindings::codegen::Bindings::WebSocketBinding; use dom::bindings::codegen::Bindings::WebSocketBinding::{BinaryType, WebSocketMethods}; @@ -105,9 +105,9 @@ pub struct WebSocket { buffered_amount: Cell, clearing_buffer: Cell, //Flag to tell if there is a running thread to clear buffered_amount #[ignore_heap_size_of = "Defined in std"] - sender: DOMRefCell>>, + sender: DomRefCell>>, binary_type: Cell, - protocol: DOMRefCell, //Subprotocol selected by server + protocol: DomRefCell, //Subprotocol selected by server } impl WebSocket { @@ -118,9 +118,9 @@ impl WebSocket { ready_state: Cell::new(WebSocketRequestState::Connecting), buffered_amount: Cell::new(0), clearing_buffer: Cell::new(false), - sender: DOMRefCell::new(None), + sender: DomRefCell::new(None), binary_type: Cell::new(BinaryType::Blob), - protocol: DOMRefCell::new("".to_owned()), + protocol: DomRefCell::new("".to_owned()), } } diff --git a/components/script/dom/window.rs b/components/script/dom/window.rs index 1cb9bd37158..10e0299b0ae 100644 --- a/components/script/dom/window.rs +++ b/components/script/dom/window.rs @@ -8,7 +8,7 @@ use bluetooth_traits::BluetoothRequest; use canvas_traits::webgl::WebGLChan; use cssparser::{Parser, ParserInput}; use devtools_traits::{ScriptToDevtoolsControlMsg, TimelineMarker, TimelineMarkerType}; -use dom::bindings::cell::DOMRefCell; +use dom::bindings::cell::DomRefCell; use dom::bindings::codegen::Bindings::DocumentBinding::{DocumentMethods, DocumentReadyState}; use dom::bindings::codegen::Bindings::FunctionBinding::Function; use dom::bindings::codegen::Bindings::PermissionStatusBinding::PermissionState; @@ -192,13 +192,13 @@ pub struct Window { screen: MutNullableDom, session_storage: MutNullableDom, local_storage: MutNullableDom, - status: DOMRefCell, + status: DomRefCell, /// For sending timeline markers. Will be ignored if /// no devtools server - devtools_markers: DOMRefCell>, + devtools_markers: DomRefCell>, #[ignore_heap_size_of = "channels are hard"] - devtools_marker_sender: DOMRefCell>>>, + devtools_marker_sender: DomRefCell>>>, /// Pending resize event, if any. resize_event: Cell>, @@ -211,7 +211,7 @@ pub struct Window { /// The JavaScript runtime. #[ignore_heap_size_of = "Rc is hard"] - js_runtime: DOMRefCell>>, + js_runtime: DomRefCell>>, /// A handle for communicating messages to the layout thread. #[ignore_heap_size_of = "channels are hard"] @@ -244,7 +244,7 @@ pub struct Window { /// A channel for communicating results of async scripts back to the webdriver server #[ignore_heap_size_of = "channels are hard"] - webdriver_script_chan: DOMRefCell>>, + webdriver_script_chan: DomRefCell>>, /// The current state of the window object current_state: Cell, @@ -253,12 +253,12 @@ pub struct Window { /// A flag to prevent async events from attempting to interact with this window. #[ignore_heap_size_of = "defined in std"] - ignore_further_async_events: DOMRefCell>, + ignore_further_async_events: DomRefCell>, error_reporter: CSSErrorReporter, /// A list of scroll offsets for each scrollable element. - scroll_offsets: DOMRefCell>>, + scroll_offsets: DomRefCell>>, /// All the MediaQueryLists we need to update media_query_lists: WeakMediaQueryListVec, @@ -274,17 +274,17 @@ pub struct Window { webvr_chan: Option>, /// A map for storing the previous permission state read results. - permission_state_invocation_results: DOMRefCell>, + permission_state_invocation_results: DomRefCell>, /// All of the elements that have an outstanding image request that was /// initiated by layout during a reflow. They are stored in the script thread /// to ensure that the element can be marked dirty when the image data becomes /// available at some point in the future. - pending_layout_images: DOMRefCell>>>, + pending_layout_images: DomRefCell>>>, /// Directory to store unminified scripts for this window if unminify-js /// opt is enabled. - unminified_js_dir: DOMRefCell>, + unminified_js_dir: DomRefCell>, /// Worklets test_worklet: MutNullableDom, @@ -404,7 +404,7 @@ impl Window { Worklet::new(self, WorkletGlobalScopeType::Paint) } - pub fn permission_state_invocation_results(&self) -> &DOMRefCell> { + pub fn permission_state_invocation_results(&self) -> &DomRefCell> { &self.permission_state_invocation_results } @@ -1866,10 +1866,10 @@ impl Window { screen: Default::default(), session_storage: Default::default(), local_storage: Default::default(), - status: DOMRefCell::new(DOMString::new()), + status: DomRefCell::new(DOMString::new()), parent_info, dom_static: GlobalStaticData::new(), - js_runtime: DOMRefCell::new(Some(runtime.clone())), + js_runtime: DomRefCell::new(Some(runtime.clone())), bluetooth_thread, bluetooth_extra_permission_data: BluetoothExtraPermissionData::new(), page_clip_rect: Cell::new(max_rect()), diff --git a/components/script/dom/xmlhttprequest.rs b/components/script/dom/xmlhttprequest.rs index a08982c4255..16c14cb2e5b 100644 --- a/components/script/dom/xmlhttprequest.rs +++ b/components/script/dom/xmlhttprequest.rs @@ -3,7 +3,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ use document_loader::DocumentLoader; -use dom::bindings::cell::DOMRefCell; +use dom::bindings::cell::DomRefCell; use dom::bindings::codegen::Bindings::BlobBinding::BlobBinding::BlobMethods; use dom::bindings::codegen::Bindings::WindowBinding::WindowMethods; use dom::bindings::codegen::Bindings::XMLHttpRequestBinding; @@ -90,8 +90,8 @@ pub struct GenerationId(u32); struct XHRContext { xhr: TrustedXHRAddress, gen_id: GenerationId, - buf: DOMRefCell>, - sync_status: DOMRefCell>, + buf: DomRefCell>, + sync_status: DomRefCell>, } #[derive(Clone)] @@ -124,34 +124,34 @@ pub struct XMLHttpRequest { timeout: Cell, with_credentials: Cell, upload: Dom, - response_url: DOMRefCell, + response_url: DomRefCell, status: Cell, - status_text: DOMRefCell, - response: DOMRefCell, + status_text: DomRefCell, + response: DomRefCell, response_type: Cell, response_xml: MutNullableDom, response_blob: MutNullableDom, #[ignore_heap_size_of = "Defined in rust-mozjs"] response_json: Heap, #[ignore_heap_size_of = "Defined in hyper"] - response_headers: DOMRefCell, + response_headers: DomRefCell, #[ignore_heap_size_of = "Defined in hyper"] - override_mime_type: DOMRefCell>, + override_mime_type: DomRefCell>, #[ignore_heap_size_of = "Defined in rust-encoding"] - override_charset: DOMRefCell>, + override_charset: DomRefCell>, // Associated concepts #[ignore_heap_size_of = "Defined in hyper"] - request_method: DOMRefCell, - request_url: DOMRefCell>, + request_method: DomRefCell, + request_url: DomRefCell>, #[ignore_heap_size_of = "Defined in hyper"] - request_headers: DOMRefCell, + request_headers: DomRefCell, request_body_len: Cell, sync: Cell, upload_complete: Cell, send_flag: Cell, - timeout_cancel: DOMRefCell>, + timeout_cancel: DomRefCell>, fetch_time: Cell, generation_id: Cell, response_status: Cell>, @@ -175,27 +175,27 @@ impl XMLHttpRequest { timeout: Cell::new(0u32), with_credentials: Cell::new(false), upload: Dom::from_ref(&*XMLHttpRequestUpload::new(global)), - response_url: DOMRefCell::new(String::new()), + response_url: DomRefCell::new(String::new()), status: Cell::new(0), - status_text: DOMRefCell::new(ByteString::new(vec!())), - response: DOMRefCell::new(ByteString::new(vec!())), + status_text: DomRefCell::new(ByteString::new(vec!())), + response: DomRefCell::new(ByteString::new(vec!())), response_type: Cell::new(XMLHttpRequestResponseType::_empty), response_xml: Default::default(), response_blob: Default::default(), response_json: Heap::default(), - response_headers: DOMRefCell::new(Headers::new()), - override_mime_type: DOMRefCell::new(None), - override_charset: DOMRefCell::new(None), + response_headers: DomRefCell::new(Headers::new()), + override_mime_type: DomRefCell::new(None), + override_charset: DomRefCell::new(None), - request_method: DOMRefCell::new(Method::Get), - request_url: DOMRefCell::new(None), - request_headers: DOMRefCell::new(Headers::new()), + request_method: DomRefCell::new(Method::Get), + request_url: DomRefCell::new(None), + request_headers: DomRefCell::new(Headers::new()), request_body_len: Cell::new(0), sync: Cell::new(false), upload_complete: Cell::new(false), send_flag: Cell::new(false), - timeout_cancel: DOMRefCell::new(None), + timeout_cancel: DomRefCell::new(None), fetch_time: Cell::new(0), generation_id: Cell::new(GenerationId(0)), response_status: Cell::new(Ok(())), @@ -1279,8 +1279,8 @@ impl XMLHttpRequest { let context = Arc::new(Mutex::new(XHRContext { xhr: xhr, gen_id: self.generation_id.get(), - buf: DOMRefCell::new(vec!()), - sync_status: DOMRefCell::new(None), + buf: DomRefCell::new(vec!()), + sync_status: DomRefCell::new(None), })); let (task_source, script_port) = if self.sync.get() { diff --git a/components/script/microtask.rs b/components/script/microtask.rs index f88f6e8fa4c..476a551c25c 100644 --- a/components/script/microtask.rs +++ b/components/script/microtask.rs @@ -7,7 +7,7 @@ //! perform checkpoints at appropriate times, as well as enqueue microtasks as required. use dom::bindings::callback::ExceptionHandling; -use dom::bindings::cell::DOMRefCell; +use dom::bindings::cell::DomRefCell; use dom::bindings::codegen::Bindings::PromiseBinding::PromiseJobCallback; use dom::bindings::root::Root; use dom::globalscope::GlobalScope; @@ -24,7 +24,7 @@ use std::rc::Rc; #[derive(Default, HeapSizeOf, JSTraceable)] pub struct MicrotaskQueue { /// The list of enqueued microtasks that will be invoked at the next microtask checkpoint. - microtask_queue: DOMRefCell>, + microtask_queue: DomRefCell>, /// https://html.spec.whatwg.org/multipage/#performing-a-microtask-checkpoint performing_a_microtask_checkpoint: Cell, } diff --git a/components/script/script_thread.rs b/components/script/script_thread.rs index 6da18b8f28b..5957b3a8857 100644 --- a/components/script/script_thread.rs +++ b/components/script/script_thread.rs @@ -24,7 +24,7 @@ use devtools_traits::{DevtoolScriptControlMsg, DevtoolsPageInfo}; use devtools_traits::{ScriptToDevtoolsControlMsg, WorkerId}; use devtools_traits::CSSError; use document_loader::DocumentLoader; -use dom::bindings::cell::DOMRefCell; +use dom::bindings::cell::DomRefCell; use dom::bindings::codegen::Bindings::CSSStyleDeclarationBinding::CSSStyleDeclarationMethods; use dom::bindings::codegen::Bindings::DocumentBinding::{DocumentMethods, DocumentReadyState}; use dom::bindings::codegen::Bindings::EventBinding::EventInit; @@ -385,16 +385,16 @@ impl<'a> Iterator for DocumentsIter<'a> { #[allow(unrooted_must_root)] pub struct ScriptThread { /// The documents for pipelines managed by this thread - documents: DOMRefCell, + documents: DomRefCell, /// The window proxies known by this thread /// TODO: this map grows, but never shrinks. Issue #15258. - window_proxies: DOMRefCell>>, + window_proxies: DomRefCell>>, /// A list of data pertaining to loads that have not yet received a network response - incomplete_loads: DOMRefCell>, + incomplete_loads: DomRefCell>, /// A vector containing parser contexts which have not yet been fully processed - incomplete_parser_contexts: DOMRefCell>, + incomplete_parser_contexts: DomRefCell>, /// A map to store service worker registrations for a given origin - registration_map: DOMRefCell>>, + registration_map: DomRefCell>>, /// A job queue for Service Workers keyed by their scope url job_queue_map: Rc, /// Image cache for this script thread. @@ -461,7 +461,7 @@ pub struct ScriptThread { topmost_mouse_over_target: MutNullableDom, /// List of pipelines that have been owned and closed by this script thread. - closed_pipelines: DOMRefCell>, + closed_pipelines: DomRefCell>, scheduler_chan: IpcSender, timer_event_chan: Sender, @@ -476,7 +476,7 @@ pub struct ScriptThread { mutation_observer_compound_microtask_queued: Cell, /// The unit of related similar-origin browsing contexts' list of MutationObserver objects - mutation_observers: DOMRefCell>>, + mutation_observers: DomRefCell>>, /// A handle to the webgl thread webgl_chan: WebGLPipeline, @@ -485,15 +485,15 @@ pub struct ScriptThread { webvr_chan: Option>, /// The worklet thread pool - worklet_thread_pool: DOMRefCell>>, + worklet_thread_pool: DomRefCell>>, /// A list of pipelines containing documents that finished loading all their blocking /// resources during a turn of the event loop. - docs_with_no_blocking_loads: DOMRefCell>>, + docs_with_no_blocking_loads: DomRefCell>>, /// A list of nodes with in-progress CSS transitions, which roots them for the duration /// of the transition. - transitioning_nodes: DOMRefCell>>, + transitioning_nodes: DomRefCell>>, /// https://html.spec.whatwg.org/multipage/#custom-element-reactions-stack custom_element_reaction_stack: CustomElementReactionStack, @@ -811,11 +811,11 @@ impl ScriptThread { let (image_cache_channel, image_cache_port) = channel(); ScriptThread { - documents: DOMRefCell::new(Documents::new()), - window_proxies: DOMRefCell::new(HashMap::new()), - incomplete_loads: DOMRefCell::new(vec!()), - incomplete_parser_contexts: DOMRefCell::new(vec!()), - registration_map: DOMRefCell::new(HashMap::new()), + documents: DomRefCell::new(Documents::new()), + window_proxies: DomRefCell::new(HashMap::new()), + incomplete_loads: DomRefCell::new(vec!()), + incomplete_parser_contexts: DomRefCell::new(vec!()), + registration_map: DomRefCell::new(HashMap::new()), job_queue_map: Rc::new(JobQueue::new()), image_cache: state.image_cache.clone(), @@ -847,7 +847,7 @@ impl ScriptThread { js_runtime: Rc::new(runtime), topmost_mouse_over_target: MutNullableDom::new(Default::default()), - closed_pipelines: DOMRefCell::new(HashSet::new()), + closed_pipelines: DomRefCell::new(HashSet::new()), scheduler_chan: state.scheduler_chan, timer_event_chan: timer_event_chan, diff --git a/components/script/serviceworkerjob.rs b/components/script/serviceworkerjob.rs index 76276d7b5ce..1a146f82c61 100644 --- a/components/script/serviceworkerjob.rs +++ b/components/script/serviceworkerjob.rs @@ -7,7 +7,7 @@ //! the script thread. The script thread contains a JobQueue, which stores all scheduled Jobs //! by multiple service worker clients in a Vec. -use dom::bindings::cell::DOMRefCell; +use dom::bindings::cell::DomRefCell; use dom::bindings::error::Error; use dom::bindings::refcounted::{Trusted, TrustedPromise}; use dom::bindings::reflector::DomObject; @@ -93,11 +93,11 @@ impl PartialEq for Job { #[must_root] #[derive(JSTraceable)] -pub struct JobQueue(pub DOMRefCell>>); +pub struct JobQueue(pub DomRefCell>>); impl JobQueue { pub fn new() -> JobQueue { - JobQueue(DOMRefCell::new(HashMap::new())) + JobQueue(DomRefCell::new(HashMap::new())) } #[allow(unrooted_must_root)] // https://w3c.github.io/ServiceWorker/#schedule-job-algorithm diff --git a/components/script/test.rs b/components/script/test.rs index 18d8754d831..0ff6811b14d 100644 --- a/components/script/test.rs +++ b/components/script/test.rs @@ -6,7 +6,7 @@ pub use dom::bindings::str::{ByteString, DOMString}; pub use dom::headers::normalize_value; // For compile-fail tests only. -pub use dom::bindings::cell::DOMRefCell; +pub use dom::bindings::cell::DomRefCell; pub use dom::bindings::root::Dom; pub use dom::node::Node; pub use dom::bindings::refcounted::TrustedPromise; diff --git a/components/script/timers.rs b/components/script/timers.rs index 7d219bbb199..1f69eca03ba 100644 --- a/components/script/timers.rs +++ b/components/script/timers.rs @@ -3,7 +3,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ use dom::bindings::callback::ExceptionHandling::Report; -use dom::bindings::cell::DOMRefCell; +use dom::bindings::cell::DomRefCell; use dom::bindings::codegen::Bindings::FunctionBinding::Function; use dom::bindings::reflector::DomObject; use dom::bindings::str::DOMString; @@ -38,7 +38,7 @@ pub struct OneshotTimers { #[ignore_heap_size_of = "Defined in std"] scheduler_chan: IpcSender, next_timer_handle: Cell, - timers: DOMRefCell>, + timers: DomRefCell>, suspended_since: Cell>, /// Initially 0, increased whenever the associated document is reactivated /// by the amount of ms the document was inactive. The current time can be @@ -117,7 +117,7 @@ impl OneshotTimers { timer_event_chan: timer_event_chan, scheduler_chan: scheduler_chan, next_timer_handle: Cell::new(OneshotTimerHandle(1)), - timers: DOMRefCell::new(Vec::new()), + timers: DomRefCell::new(Vec::new()), suspended_since: Cell::new(None), suspension_offset: Cell::new(Length::new(0)), expected_event_id: Cell::new(TimerEventId(0)), @@ -307,7 +307,7 @@ pub struct JsTimerHandle(i32); #[derive(DenyPublicFields, HeapSizeOf, JSTraceable)] pub struct JsTimers { next_timer_handle: Cell, - active_timers: DOMRefCell>, + active_timers: DomRefCell>, /// The nesting level of the currently executing timer task or 0. nesting_level: Cell, /// Used to introduce a minimum delay in event intervals @@ -364,7 +364,7 @@ impl JsTimers { pub fn new() -> JsTimers { JsTimers { next_timer_handle: Cell::new(JsTimerHandle(1)), - active_timers: DOMRefCell::new(HashMap::new()), + active_timers: DomRefCell::new(HashMap::new()), nesting_level: Cell::new(0), min_duration: Cell::new(None), } diff --git a/components/script_plugins/unrooted_must_root.rs b/components/script_plugins/unrooted_must_root.rs index b0b409862c5..5b5647794dc 100644 --- a/components/script_plugins/unrooted_must_root.rs +++ b/components/script_plugins/unrooted_must_root.rs @@ -186,11 +186,11 @@ impl<'a, 'b, 'tcx> visit::Visitor<'tcx> for FnDefVisitor<'a, 'b, 'tcx> { hir::ExprCast(ref subexpr, _) => require_rooted(cx, self.in_new_function, &*subexpr), // This catches assignments... the main point of this would be to catch mutable // references to `JS`. - // FIXME: Enable this? Triggers on certain kinds of uses of DOMRefCell. + // FIXME: Enable this? Triggers on certain kinds of uses of DomRefCell. // hir::ExprAssign(_, ref rhs) => require_rooted(cx, self.in_new_function, &*rhs), // This catches calls; basically, this enforces the constraint that only constructors // can call other constructors. - // FIXME: Enable this? Currently triggers with constructs involving DOMRefCell, and + // FIXME: Enable this? Currently triggers with constructs involving DomRefCell, and // constructs like Vec> and RootedVec>. // hir::ExprCall(..) if !self.in_new_function => { // require_rooted(cx, self.in_new_function, expr); diff --git a/python/tidy/servo_tidy/tidy.py b/python/tidy/servo_tidy/tidy.py index d7c83ee8cee..e23834c0c58 100644 --- a/python/tidy/servo_tidy/tidy.py +++ b/python/tidy/servo_tidy/tidy.py @@ -574,11 +574,11 @@ def check_rust(file_name, lines): # No benefit over using &str (r": &String", "use &str instead of &String", no_filter), # There should be any use of banned types: - # Cell, Cell>, DOMRefCell>, DOMRefCell> + # Cell, Cell>, DomRefCell>, DomRefCell> (r"(\s|:)+Cell", "Banned type Cell detected. Use MutDom instead", no_filter), (r"(\s|:)+Cell>", "Banned type Cell> detected. Use MutDom instead", no_filter), - (r"DOMRefCell>", "Banned type DOMRefCell> detected. Use MutDom instead", no_filter), - (r"DOMRefCell>", "Banned type DOMRefCell> detected. Use MutDom instead", no_filter), + (r"DomRefCell>", "Banned type DomRefCell> detected. Use MutDom instead", no_filter), + (r"DomRefCell>", "Banned type DomRefCell> detected. Use MutDom instead", no_filter), # No benefit to using &Root (r": &Root<", "use &T instead of &Root", no_filter), (r"^&&", "operators should go at the end of the first line", no_filter), diff --git a/python/tidy/servo_tidy_tests/ban-domrefcell.rs b/python/tidy/servo_tidy_tests/ban-domrefcell.rs index 6d4e2b2fbc3..74b79e813cf 100644 --- a/python/tidy/servo_tidy_tests/ban-domrefcell.rs +++ b/python/tidy/servo_tidy_tests/ban-domrefcell.rs @@ -8,12 +8,12 @@ extern crate script; use script::test::Dom; -use script::test::DOMRefCell; +use script::test::DomRefCell; use script::test::Node; struct Foo { - bar: DOMRefCell> - //~^ ERROR Banned type DOMRefCell> detected. Use MutDom instead + bar: DomRefCell> + //~^ ERROR Banned type DomRefCell> detected. Use MutDom instead } fn main() {} diff --git a/python/tidy/servo_tidy_tests/test_tidy.py b/python/tidy/servo_tidy_tests/test_tidy.py index 3761975c62b..3826e4537b5 100644 --- a/python/tidy/servo_tidy_tests/test_tidy.py +++ b/python/tidy/servo_tidy_tests/test_tidy.py @@ -151,7 +151,7 @@ class CheckTidiness(unittest.TestCase): self.assertNoMoreErrors(ban_errors) ban_errors = tidy.collect_errors_for_files(iterFile('ban-domrefcell.rs'), [], [tidy.check_rust], print_text=False) - self.assertEqual('Banned type DOMRefCell> detected. Use MutDom instead', ban_errors.next()[2]) + self.assertEqual('Banned type DomRefCell> detected. Use MutDom instead', ban_errors.next()[2]) self.assertNoMoreErrors(ban_errors) def test_spec_link(self):