Rename DOMRefCell<T> to DomRefCell<T>

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.
This commit is contained in:
Anthony Ramine 2017-09-26 01:32:40 +02:00
parent 9a7ba89c84
commit 577370746e
85 changed files with 436 additions and 436 deletions

View file

@ -3,7 +3,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use devtools_traits::AttrInfo; 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::codegen::Bindings::AttrBinding::{self, AttrMethods};
use dom::bindings::inheritance::Castable; use dom::bindings::inheritance::Castable;
use dom::bindings::reflector::{Reflector, reflect_dom_object}; use dom::bindings::reflector::{Reflector, reflect_dom_object};
@ -29,7 +29,7 @@ use style::attr::{AttrIdentifier, AttrValue};
pub struct Attr { pub struct Attr {
reflector_: Reflector, reflector_: Reflector,
identifier: AttrIdentifier, identifier: AttrIdentifier,
value: DOMRefCell<AttrValue>, value: DomRefCell<AttrValue>,
/// the element that owns this attribute. /// the element that owns this attribute.
owner: MutNullableDom<Element>, owner: MutNullableDom<Element>,
@ -51,7 +51,7 @@ impl Attr {
namespace: namespace, namespace: namespace,
prefix: prefix, prefix: prefix,
}, },
value: DOMRefCell::new(value), value: DomRefCell::new(value),
owner: MutNullableDom::new(owner), owner: MutNullableDom::new(owner),
} }
} }

View file

@ -4,7 +4,7 @@
#![allow(dead_code)] #![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;
use dom::bindings::codegen::Bindings::BeforeUnloadEventBinding::BeforeUnloadEventMethods; use dom::bindings::codegen::Bindings::BeforeUnloadEventBinding::BeforeUnloadEventMethods;
use dom::bindings::codegen::Bindings::EventBinding::EventMethods; use dom::bindings::codegen::Bindings::EventBinding::EventMethods;
@ -21,14 +21,14 @@ use servo_atoms::Atom;
#[dom_struct] #[dom_struct]
pub struct BeforeUnloadEvent { pub struct BeforeUnloadEvent {
event: Event, event: Event,
return_value: DOMRefCell<DOMString>, return_value: DomRefCell<DOMString>,
} }
impl BeforeUnloadEvent { impl BeforeUnloadEvent {
fn new_inherited() -> BeforeUnloadEvent { fn new_inherited() -> BeforeUnloadEvent {
BeforeUnloadEvent { BeforeUnloadEvent {
event: Event::new_inherited(), event: Event::new_inherited(),
return_value: DOMRefCell::new(DOMString::new()), return_value: DomRefCell::new(DOMString::new()),
} }
} }

View file

@ -12,14 +12,14 @@ use style::thread_state;
/// This extends the API of `core::cell::RefCell` to allow unsafe access in /// This extends the API of `core::cell::RefCell` to allow unsafe access in
/// certain situations, with dynamic checking in debug builds. /// certain situations, with dynamic checking in debug builds.
#[derive(Clone, Debug, Default, HeapSizeOf, PartialEq)] #[derive(Clone, Debug, Default, HeapSizeOf, PartialEq)]
pub struct DOMRefCell<T> { pub struct DomRefCell<T> {
value: RefCell<T>, value: RefCell<T>,
} }
// Functionality specific to Servo's `DOMRefCell` type // Functionality specific to Servo's `DomRefCell` type
// =================================================== // ===================================================
impl<T> DOMRefCell<T> { impl<T> DomRefCell<T> {
/// Return a reference to the contents. /// Return a reference to the contents.
/// ///
/// For use in the layout thread only. /// For use in the layout thread only.
@ -59,10 +59,10 @@ impl<T> DOMRefCell<T> {
// Functionality duplicated with `core::cell::RefCell` // Functionality duplicated with `core::cell::RefCell`
// =================================================== // ===================================================
impl<T> DOMRefCell<T> { impl<T> DomRefCell<T> {
/// Create a new `DOMRefCell` containing `value`. /// Create a new `DomRefCell` containing `value`.
pub fn new(value: T) -> DOMRefCell<T> { pub fn new(value: T) -> DomRefCell<T> {
DOMRefCell { DomRefCell {
value: RefCell::new(value), value: RefCell::new(value),
} }
} }
@ -79,7 +79,7 @@ impl<T> DOMRefCell<T> {
/// ///
/// Panics if the value is currently mutably borrowed. /// Panics if the value is currently mutably borrowed.
pub fn borrow(&self) -> Ref<T> { pub fn borrow(&self) -> Ref<T> {
self.try_borrow().expect("DOMRefCell<T> already mutably borrowed") self.try_borrow().expect("DomRefCell<T> already mutably borrowed")
} }
/// Mutably borrows the wrapped value. /// Mutably borrows the wrapped value.
@ -93,7 +93,7 @@ impl<T> DOMRefCell<T> {
/// ///
/// Panics if the value is currently borrowed. /// Panics if the value is currently borrowed.
pub fn borrow_mut(&self) -> RefMut<T> { pub fn borrow_mut(&self) -> RefMut<T> {
self.try_borrow_mut().expect("DOMRefCell<T> already borrowed") self.try_borrow_mut().expect("DomRefCell<T> already borrowed")
} }
/// Attempts to immutably borrow the wrapped value. /// Attempts to immutably borrow the wrapped value.

View file

@ -38,7 +38,7 @@ use canvas_traits::webgl::{WebGLReceiver, WebGLSender, WebGLShaderId, WebGLTextu
use cssparser::RGBA; use cssparser::RGBA;
use devtools_traits::{CSSError, TimelineMarkerType, WorkerId}; use devtools_traits::{CSSError, TimelineMarkerType, WorkerId};
use dom::abstractworker::SharedRt; use dom::abstractworker::SharedRt;
use dom::bindings::cell::DOMRefCell; use dom::bindings::cell::DomRefCell;
use dom::bindings::error::Error; use dom::bindings::error::Error;
use dom::bindings::refcounted::{Trusted, TrustedPromise}; use dom::bindings::refcounted::{Trusted, TrustedPromise};
use dom::bindings::reflector::{DomObject, Reflector}; use dom::bindings::reflector::{DomObject, Reflector};
@ -202,7 +202,7 @@ unsafe impl<T: JSTraceable> JSTraceable for UnsafeCell<T> {
} }
} }
unsafe impl<T: JSTraceable> JSTraceable for DOMRefCell<T> { unsafe impl<T: JSTraceable> JSTraceable for DomRefCell<T> {
unsafe fn trace(&self, trc: *mut JSTracer) { unsafe fn trace(&self, trc: *mut JSTracer) {
(*self).borrow_for_gc_trace().trace(trc) (*self).borrow_for_gc_trace().trace(trc)
} }

View file

@ -2,7 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * 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;
use dom::bindings::codegen::Bindings::BlobBinding::BlobMethods; use dom::bindings::codegen::Bindings::BlobBinding::BlobMethods;
use dom::bindings::codegen::UnionTypes::BlobOrString; use dom::bindings::codegen::UnionTypes::BlobOrString;
@ -27,7 +27,7 @@ use uuid::Uuid;
pub struct FileBlob { pub struct FileBlob {
id: Uuid, id: Uuid,
name: Option<PathBuf>, name: Option<PathBuf>,
cache: DOMRefCell<Option<Vec<u8>>>, cache: DomRefCell<Option<Vec<u8>>>,
size: u64, size: u64,
} }
@ -59,7 +59,7 @@ impl BlobImpl {
BlobImpl::File(FileBlob { BlobImpl::File(FileBlob {
id: file_id, id: file_id,
name: Some(name), name: Some(name),
cache: DOMRefCell::new(None), cache: DomRefCell::new(None),
size: size, size: size,
}) })
} }
@ -70,7 +70,7 @@ impl BlobImpl {
pub struct Blob { pub struct Blob {
reflector_: Reflector, reflector_: Reflector,
#[ignore_heap_size_of = "No clear owner"] #[ignore_heap_size_of = "No clear owner"]
blob_impl: DOMRefCell<BlobImpl>, blob_impl: DomRefCell<BlobImpl>,
/// content-type string /// content-type string
type_string: String, type_string: String,
} }
@ -88,7 +88,7 @@ impl Blob {
pub fn new_inherited(blob_impl: BlobImpl, type_string: String) -> Blob { pub fn new_inherited(blob_impl: BlobImpl, type_string: String) -> Blob {
Blob { Blob {
reflector_: Reflector::new(), reflector_: Reflector::new(),
blob_impl: DOMRefCell::new(blob_impl), blob_impl: DomRefCell::new(blob_impl),
// NOTE: Guarding the format correctness here, // NOTE: Guarding the format correctness here,
// https://w3c.github.io/FileAPI/#dfn-type // https://w3c.github.io/FileAPI/#dfn-type
type_string: normalize_type_string(&type_string), type_string: normalize_type_string(&type_string),
@ -237,7 +237,7 @@ impl Blob {
*self.blob_impl.borrow_mut() = BlobImpl::File(FileBlob { *self.blob_impl.borrow_mut() = BlobImpl::File(FileBlob {
id: id.clone(), id: id.clone(),
name: None, name: None,
cache: DOMRefCell::new(Some(bytes.to_vec())), cache: DomRefCell::new(Some(bytes.to_vec())),
size: bytes.len() as u64, size: bytes.len() as u64,
}); });
id id
@ -262,7 +262,7 @@ impl Blob {
*self.blob_impl.borrow_mut() = BlobImpl::File(FileBlob { *self.blob_impl.borrow_mut() = BlobImpl::File(FileBlob {
id: new_id.clone(), id: new_id.clone(),
name: None, name: None,
cache: DOMRefCell::new(None), cache: DomRefCell::new(None),
size: rel_pos.to_abs_range(parent_len as usize).len() as u64, size: rel_pos.to_abs_range(parent_len as usize).len() as u64,
}); });

View file

@ -8,7 +8,7 @@ use bluetooth_traits::blocklist::{Blocklist, uuid_is_blocklisted};
use bluetooth_traits::scanfilter::{BluetoothScanfilter, BluetoothScanfilterSequence}; use bluetooth_traits::scanfilter::{BluetoothScanfilter, BluetoothScanfilterSequence};
use bluetooth_traits::scanfilter::{RequestDeviceoptions, ServiceUUIDSequence}; use bluetooth_traits::scanfilter::{RequestDeviceoptions, ServiceUUIDSequence};
use core::clone::Clone; 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::{self, BluetoothDataFilterInit, BluetoothLEScanFilterInit};
use dom::bindings::codegen::Bindings::BluetoothBinding::{BluetoothMethods, RequestDeviceOptions}; use dom::bindings::codegen::Bindings::BluetoothBinding::{BluetoothMethods, RequestDeviceOptions};
use dom::bindings::codegen::Bindings::BluetoothPermissionResultBinding::BluetoothPermissionDescriptor; use dom::bindings::codegen::Bindings::BluetoothPermissionResultBinding::BluetoothPermissionDescriptor;
@ -65,13 +65,13 @@ pub struct AllowedBluetoothDevice {
#[derive(HeapSizeOf, JSTraceable)] #[derive(HeapSizeOf, JSTraceable)]
pub struct BluetoothExtraPermissionData { pub struct BluetoothExtraPermissionData {
allowed_devices: DOMRefCell<Vec<AllowedBluetoothDevice>>, allowed_devices: DomRefCell<Vec<AllowedBluetoothDevice>>,
} }
impl BluetoothExtraPermissionData { impl BluetoothExtraPermissionData {
pub fn new() -> BluetoothExtraPermissionData { pub fn new() -> BluetoothExtraPermissionData {
BluetoothExtraPermissionData { BluetoothExtraPermissionData {
allowed_devices: DOMRefCell::new(Vec::new()), allowed_devices: DomRefCell::new(Vec::new()),
} }
} }
@ -120,14 +120,14 @@ where
#[dom_struct] #[dom_struct]
pub struct Bluetooth { pub struct Bluetooth {
eventtarget: EventTarget, eventtarget: EventTarget,
device_instance_map: DOMRefCell<HashMap<String, Dom<BluetoothDevice>>>, device_instance_map: DomRefCell<HashMap<String, Dom<BluetoothDevice>>>,
} }
impl Bluetooth { impl Bluetooth {
pub fn new_inherited() -> Bluetooth { pub fn new_inherited() -> Bluetooth {
Bluetooth { Bluetooth {
eventtarget: EventTarget::new_inherited(), 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() self.global().as_window().bluetooth_thread()
} }
pub fn get_device_map(&self) -> &DOMRefCell<HashMap<String, Dom<BluetoothDevice>>> { pub fn get_device_map(&self) -> &DomRefCell<HashMap<String, Dom<BluetoothDevice>>> {
&self.device_instance_map &self.device_instance_map
} }

View file

@ -4,7 +4,7 @@
use bluetooth_traits::{BluetoothCharacteristicMsg, BluetoothDescriptorMsg}; use bluetooth_traits::{BluetoothCharacteristicMsg, BluetoothDescriptorMsg};
use bluetooth_traits::{BluetoothRequest, BluetoothResponse, BluetoothServiceMsg}; 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;
use dom::bindings::codegen::Bindings::BluetoothDeviceBinding::BluetoothDeviceMethods; use dom::bindings::codegen::Bindings::BluetoothDeviceBinding::BluetoothDeviceMethods;
use dom::bindings::codegen::Bindings::BluetoothRemoteGATTServerBinding::BluetoothRemoteGATTServerMethods; use dom::bindings::codegen::Bindings::BluetoothRemoteGATTServerBinding::BluetoothRemoteGATTServerMethods;
@ -37,9 +37,9 @@ pub struct BluetoothDevice {
name: Option<DOMString>, name: Option<DOMString>,
gatt: MutNullableDom<BluetoothRemoteGATTServer>, gatt: MutNullableDom<BluetoothRemoteGATTServer>,
context: Dom<Bluetooth>, context: Dom<Bluetooth>,
attribute_instance_map: (DOMRefCell<HashMap<String, Dom<BluetoothRemoteGATTService>>>, attribute_instance_map: (DomRefCell<HashMap<String, Dom<BluetoothRemoteGATTService>>>,
DOMRefCell<HashMap<String, Dom<BluetoothRemoteGATTCharacteristic>>>, DomRefCell<HashMap<String, Dom<BluetoothRemoteGATTCharacteristic>>>,
DOMRefCell<HashMap<String, Dom<BluetoothRemoteGATTDescriptor>>>), DomRefCell<HashMap<String, Dom<BluetoothRemoteGATTDescriptor>>>),
watching_advertisements: Cell<bool>, watching_advertisements: Cell<bool>,
} }
@ -54,9 +54,9 @@ impl BluetoothDevice {
name: name, name: name,
gatt: Default::default(), gatt: Default::default(),
context: Dom::from_ref(context), context: Dom::from_ref(context),
attribute_instance_map: (DOMRefCell::new(HashMap::new()), attribute_instance_map: (DomRefCell::new(HashMap::new()),
DOMRefCell::new(HashMap::new()), DomRefCell::new(HashMap::new()),
DOMRefCell::new(HashMap::new())), DomRefCell::new(HashMap::new())),
watching_advertisements: Cell::new(false), watching_advertisements: Cell::new(false),
} }
} }

View file

@ -3,7 +3,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use bluetooth_traits::{BluetoothRequest, BluetoothResponse}; 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::BluetoothPermissionResultBinding::{self, BluetoothPermissionResultMethods};
use dom::bindings::codegen::Bindings::NavigatorBinding::NavigatorBinding::NavigatorMethods; use dom::bindings::codegen::Bindings::NavigatorBinding::NavigatorBinding::NavigatorMethods;
use dom::bindings::codegen::Bindings::PermissionStatusBinding::{PermissionName, PermissionState}; use dom::bindings::codegen::Bindings::PermissionStatusBinding::{PermissionName, PermissionState};
@ -26,7 +26,7 @@ use std::rc::Rc;
#[dom_struct] #[dom_struct]
pub struct BluetoothPermissionResult { pub struct BluetoothPermissionResult {
status: PermissionStatus, status: PermissionStatus,
devices: DOMRefCell<Vec<Dom<BluetoothDevice>>>, devices: DomRefCell<Vec<Dom<BluetoothDevice>>>,
} }
impl BluetoothPermissionResult { impl BluetoothPermissionResult {
@ -34,7 +34,7 @@ impl BluetoothPermissionResult {
fn new_inherited(status: &PermissionStatus) -> BluetoothPermissionResult { fn new_inherited(status: &PermissionStatus) -> BluetoothPermissionResult {
let result = BluetoothPermissionResult { let result = BluetoothPermissionResult {
status: PermissionStatus::new_inherited(status.get_query()), status: PermissionStatus::new_inherited(status.get_query()),
devices: DOMRefCell::new(Vec::new()), devices: DomRefCell::new(Vec::new()),
}; };
result.status.set_state(status.State()); result.status.set_state(status.State());
result result

View file

@ -4,7 +4,7 @@
use bluetooth_traits::{BluetoothRequest, BluetoothResponse, GATTType}; use bluetooth_traits::{BluetoothRequest, BluetoothResponse, GATTType};
use bluetooth_traits::blocklist::{Blocklist, uuid_is_blocklisted}; use bluetooth_traits::blocklist::{Blocklist, uuid_is_blocklisted};
use dom::bindings::cell::DOMRefCell; use dom::bindings::cell::DomRefCell;
use dom::bindings::codegen::Bindings::BluetoothCharacteristicPropertiesBinding:: use dom::bindings::codegen::Bindings::BluetoothCharacteristicPropertiesBinding::
BluetoothCharacteristicPropertiesMethods; BluetoothCharacteristicPropertiesMethods;
use dom::bindings::codegen::Bindings::BluetoothRemoteGATTCharacteristicBinding; use dom::bindings::codegen::Bindings::BluetoothRemoteGATTCharacteristicBinding;
@ -39,7 +39,7 @@ pub struct BluetoothRemoteGATTCharacteristic {
service: Dom<BluetoothRemoteGATTService>, service: Dom<BluetoothRemoteGATTService>,
uuid: DOMString, uuid: DOMString,
properties: Dom<BluetoothCharacteristicProperties>, properties: Dom<BluetoothCharacteristicProperties>,
value: DOMRefCell<Option<ByteString>>, value: DomRefCell<Option<ByteString>>,
instance_id: String, instance_id: String,
} }
@ -54,7 +54,7 @@ impl BluetoothRemoteGATTCharacteristic {
service: Dom::from_ref(service), service: Dom::from_ref(service),
uuid: uuid, uuid: uuid,
properties: Dom::from_ref(properties), properties: Dom::from_ref(properties),
value: DOMRefCell::new(None), value: DomRefCell::new(None),
instance_id: instance_id, instance_id: instance_id,
} }
} }

View file

@ -4,7 +4,7 @@
use bluetooth_traits::{BluetoothRequest, BluetoothResponse}; use bluetooth_traits::{BluetoothRequest, BluetoothResponse};
use bluetooth_traits::blocklist::{Blocklist, uuid_is_blocklisted}; use bluetooth_traits::blocklist::{Blocklist, uuid_is_blocklisted};
use dom::bindings::cell::DOMRefCell; use dom::bindings::cell::DomRefCell;
use dom::bindings::codegen::Bindings::BluetoothRemoteGATTCharacteristicBinding:: use dom::bindings::codegen::Bindings::BluetoothRemoteGATTCharacteristicBinding::
BluetoothRemoteGATTCharacteristicMethods; BluetoothRemoteGATTCharacteristicMethods;
use dom::bindings::codegen::Bindings::BluetoothRemoteGATTDescriptorBinding; use dom::bindings::codegen::Bindings::BluetoothRemoteGATTDescriptorBinding;
@ -29,7 +29,7 @@ pub struct BluetoothRemoteGATTDescriptor {
reflector_: Reflector, reflector_: Reflector,
characteristic: Dom<BluetoothRemoteGATTCharacteristic>, characteristic: Dom<BluetoothRemoteGATTCharacteristic>,
uuid: DOMString, uuid: DOMString,
value: DOMRefCell<Option<ByteString>>, value: DomRefCell<Option<ByteString>>,
instance_id: String, instance_id: String,
} }
@ -42,7 +42,7 @@ impl BluetoothRemoteGATTDescriptor {
reflector_: Reflector::new(), reflector_: Reflector::new(),
characteristic: Dom::from_ref(characteristic), characteristic: Dom::from_ref(characteristic),
uuid: uuid, uuid: uuid,
value: DOMRefCell::new(None), value: DomRefCell::new(None),
instance_id: instance_id, instance_id: instance_id,
} }
} }

View file

@ -5,7 +5,7 @@
use canvas_traits::canvas::{CanvasGradientStop, FillOrStrokeStyle, LinearGradientStyle, RadialGradientStyle}; use canvas_traits::canvas::{CanvasGradientStop, FillOrStrokeStyle, LinearGradientStyle, RadialGradientStyle};
use cssparser::{Parser, ParserInput, RGBA}; use cssparser::{Parser, ParserInput, RGBA};
use cssparser::Color as CSSColor; 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;
use dom::bindings::codegen::Bindings::CanvasGradientBinding::CanvasGradientMethods; use dom::bindings::codegen::Bindings::CanvasGradientBinding::CanvasGradientMethods;
use dom::bindings::error::{Error, ErrorResult}; use dom::bindings::error::{Error, ErrorResult};
@ -21,7 +21,7 @@ use dom_struct::dom_struct;
pub struct CanvasGradient { pub struct CanvasGradient {
reflector_: Reflector, reflector_: Reflector,
style: CanvasGradientStyle, style: CanvasGradientStyle,
stops: DOMRefCell<Vec<CanvasGradientStop>>, stops: DomRefCell<Vec<CanvasGradientStop>>,
} }
#[derive(Clone, HeapSizeOf, JSTraceable)] #[derive(Clone, HeapSizeOf, JSTraceable)]
@ -35,7 +35,7 @@ impl CanvasGradient {
CanvasGradient { CanvasGradient {
reflector_: Reflector::new(), reflector_: Reflector::new(),
style: style, style: style,
stops: DOMRefCell::new(Vec::new()), stops: DomRefCell::new(Vec::new()),
} }
} }

View file

@ -8,7 +8,7 @@ use canvas_traits::canvas::{LineCapStyle, LineJoinStyle, LinearGradientStyle};
use canvas_traits::canvas::{RadialGradientStyle, RepetitionStyle, byte_swap_and_premultiply}; use canvas_traits::canvas::{RadialGradientStyle, RepetitionStyle, byte_swap_and_premultiply};
use cssparser::{Parser, ParserInput, RGBA}; use cssparser::{Parser, ParserInput, RGBA};
use cssparser::Color as CSSColor; 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::CSSStyleDeclarationBinding::CSSStyleDeclarationMethods;
use dom::bindings::codegen::Bindings::CanvasRenderingContext2DBinding; use dom::bindings::codegen::Bindings::CanvasRenderingContext2DBinding;
use dom::bindings::codegen::Bindings::CanvasRenderingContext2DBinding::CanvasFillRule; use dom::bindings::codegen::Bindings::CanvasRenderingContext2DBinding::CanvasFillRule;
@ -71,12 +71,12 @@ pub struct CanvasRenderingContext2D {
#[ignore_heap_size_of = "Arc"] #[ignore_heap_size_of = "Arc"]
image_cache: Arc<ImageCache>, image_cache: Arc<ImageCache>,
/// Any missing image URLs. /// Any missing image URLs.
missing_image_urls: DOMRefCell<Vec<ServoUrl>>, missing_image_urls: DomRefCell<Vec<ServoUrl>>,
/// The base URL for resolving CSS image URL values. /// The base URL for resolving CSS image URL values.
/// Needed because of https://github.com/servo/servo/issues/17625 /// Needed because of https://github.com/servo/servo/issues/17625
base_url: ServoUrl, base_url: ServoUrl,
state: DOMRefCell<CanvasContextState>, state: DomRefCell<CanvasContextState>,
saved_states: DOMRefCell<Vec<CanvasContextState>>, saved_states: DomRefCell<Vec<CanvasContextState>>,
origin_clean: Cell<bool>, origin_clean: Cell<bool>,
} }
@ -140,10 +140,10 @@ impl CanvasRenderingContext2D {
ipc_renderer: ipc_renderer, ipc_renderer: ipc_renderer,
canvas: canvas.map(Dom::from_ref), canvas: canvas.map(Dom::from_ref),
image_cache: image_cache, image_cache: image_cache,
missing_image_urls: DOMRefCell::new(Vec::new()), missing_image_urls: DomRefCell::new(Vec::new()),
base_url: base_url, base_url: base_url,
state: DOMRefCell::new(CanvasContextState::new()), state: DomRefCell::new(CanvasContextState::new()),
saved_states: DOMRefCell::new(Vec::new()), saved_states: DomRefCell::new(Vec::new()),
origin_clean: Cell::new(true), origin_clean: Cell::new(true),
} }
} }

View file

@ -4,7 +4,7 @@
//! DOM bindings for `CharacterData`. //! 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::CharacterDataBinding::CharacterDataMethods;
use dom::bindings::codegen::Bindings::NodeBinding::NodeBinding::NodeMethods; use dom::bindings::codegen::Bindings::NodeBinding::NodeBinding::NodeMethods;
use dom::bindings::codegen::Bindings::ProcessingInstructionBinding::ProcessingInstructionMethods; use dom::bindings::codegen::Bindings::ProcessingInstructionBinding::ProcessingInstructionMethods;
@ -29,14 +29,14 @@ use std::cell::Ref;
#[dom_struct] #[dom_struct]
pub struct CharacterData { pub struct CharacterData {
node: Node, node: Node,
data: DOMRefCell<DOMString>, data: DomRefCell<DOMString>,
} }
impl CharacterData { impl CharacterData {
pub fn new_inherited(data: DOMString, document: &Document) -> CharacterData { pub fn new_inherited(data: DOMString, document: &Document) -> CharacterData {
CharacterData { CharacterData {
node: Node::new_inherited(document), node: Node::new_inherited(document),
data: DOMRefCell::new(data), data: DomRefCell::new(data),
} }
} }

View file

@ -3,7 +3,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use core::nonzero::NonZero; 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;
use dom::bindings::codegen::Bindings::CryptoBinding::CryptoMethods; use dom::bindings::codegen::Bindings::CryptoBinding::CryptoMethods;
use dom::bindings::error::{Error, Fallible}; use dom::bindings::error::{Error, Fallible};
@ -22,14 +22,14 @@ unsafe_no_jsmanaged_fields!(ServoRng);
pub struct Crypto { pub struct Crypto {
reflector_: Reflector, reflector_: Reflector,
#[ignore_heap_size_of = "Defined in rand"] #[ignore_heap_size_of = "Defined in rand"]
rng: DOMRefCell<ServoRng>, rng: DomRefCell<ServoRng>,
} }
impl Crypto { impl Crypto {
fn new_inherited() -> Crypto { fn new_inherited() -> Crypto {
Crypto { Crypto {
reflector_: Reflector::new(), reflector_: Reflector::new(),
rng: DOMRefCell::new(ServoRng::new()), rng: DomRefCell::new(ServoRng::new()),
} }
} }

View file

@ -2,7 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * 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;
use dom::bindings::codegen::Bindings::CSSRuleListBinding::CSSRuleListMethods; use dom::bindings::codegen::Bindings::CSSRuleListBinding::CSSRuleListMethods;
use dom::bindings::error::{Error, ErrorResult, Fallible}; use dom::bindings::error::{Error, ErrorResult, Fallible};
@ -39,7 +39,7 @@ pub struct CSSRuleList {
parent_stylesheet: Dom<CSSStyleSheet>, parent_stylesheet: Dom<CSSStyleSheet>,
#[ignore_heap_size_of = "Arc"] #[ignore_heap_size_of = "Arc"]
rules: RulesSource, rules: RulesSource,
dom_rules: DOMRefCell<Vec<MutNullableDom<CSSRule>>> dom_rules: DomRefCell<Vec<MutNullableDom<CSSRule>>>
} }
pub enum RulesSource { pub enum RulesSource {
@ -64,7 +64,7 @@ impl CSSRuleList {
reflector_: Reflector::new(), reflector_: Reflector::new(),
parent_stylesheet: Dom::from_ref(parent_stylesheet), parent_stylesheet: Dom::from_ref(parent_stylesheet),
rules: rules, rules: rules,
dom_rules: DOMRefCell::new(dom_rules), dom_rules: DomRefCell::new(dom_rules),
} }
} }

View file

@ -3,7 +3,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use dom::bindings::callback::{CallbackContainer, ExceptionHandling}; 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;
use dom::bindings::codegen::Bindings::CustomElementRegistryBinding::CustomElementRegistryMethods; use dom::bindings::codegen::Bindings::CustomElementRegistryBinding::CustomElementRegistryMethods;
use dom::bindings::codegen::Bindings::CustomElementRegistryBinding::ElementDefinitionOptions; use dom::bindings::codegen::Bindings::CustomElementRegistryBinding::ElementDefinitionOptions;
@ -48,12 +48,12 @@ pub struct CustomElementRegistry {
window: Dom<Window>, window: Dom<Window>,
#[ignore_heap_size_of = "Rc"] #[ignore_heap_size_of = "Rc"]
when_defined: DOMRefCell<HashMap<LocalName, Rc<Promise>>>, when_defined: DomRefCell<HashMap<LocalName, Rc<Promise>>>,
element_definition_is_running: Cell<bool>, element_definition_is_running: Cell<bool>,
#[ignore_heap_size_of = "Rc"] #[ignore_heap_size_of = "Rc"]
definitions: DOMRefCell<HashMap<LocalName, Rc<CustomElementDefinition>>>, definitions: DomRefCell<HashMap<LocalName, Rc<CustomElementDefinition>>>,
} }
impl CustomElementRegistry { impl CustomElementRegistry {
@ -61,9 +61,9 @@ impl CustomElementRegistry {
CustomElementRegistry { CustomElementRegistry {
reflector_: Reflector::new(), reflector_: Reflector::new(),
window: Dom::from_ref(window), window: Dom::from_ref(window),
when_defined: DOMRefCell::new(HashMap::new()), when_defined: DomRefCell::new(HashMap::new()),
element_definition_is_running: Cell::new(false), 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 callbacks: LifecycleCallbacks,
pub construction_stack: DOMRefCell<Vec<ConstructionStackEntry>>, pub construction_stack: DomRefCell<Vec<ConstructionStackEntry>>,
} }
impl CustomElementDefinition { impl CustomElementDefinition {
@ -627,7 +627,7 @@ enum BackupElementQueueFlag {
#[derive(HeapSizeOf, JSTraceable)] #[derive(HeapSizeOf, JSTraceable)]
#[must_root] #[must_root]
pub struct CustomElementReactionStack { pub struct CustomElementReactionStack {
stack: DOMRefCell<Vec<ElementQueue>>, stack: DomRefCell<Vec<ElementQueue>>,
backup_queue: ElementQueue, backup_queue: ElementQueue,
processing_backup_element_queue: Cell<BackupElementQueueFlag>, processing_backup_element_queue: Cell<BackupElementQueueFlag>,
} }
@ -635,7 +635,7 @@ pub struct CustomElementReactionStack {
impl CustomElementReactionStack { impl CustomElementReactionStack {
pub fn new() -> CustomElementReactionStack { pub fn new() -> CustomElementReactionStack {
CustomElementReactionStack { CustomElementReactionStack {
stack: DOMRefCell::new(Vec::new()), stack: DomRefCell::new(Vec::new()),
backup_queue: ElementQueue::new(), backup_queue: ElementQueue::new(),
processing_backup_element_queue: Cell::new(BackupElementQueueFlag::NotProcessing), processing_backup_element_queue: Cell::new(BackupElementQueueFlag::NotProcessing),
} }
@ -776,7 +776,7 @@ impl CustomElementReactionStack {
#[derive(HeapSizeOf, JSTraceable)] #[derive(HeapSizeOf, JSTraceable)]
#[must_root] #[must_root]
struct ElementQueue { struct ElementQueue {
queue: DOMRefCell<VecDeque<Dom<Element>>>, queue: DomRefCell<VecDeque<Dom<Element>>>,
} }
impl ElementQueue { impl ElementQueue {

View file

@ -6,7 +6,7 @@ use devtools;
use devtools_traits::DevtoolScriptControlMsg; use devtools_traits::DevtoolScriptControlMsg;
use dom::abstractworker::{SharedRt, SimpleWorkerErrorHandler, WorkerScriptMsg}; use dom::abstractworker::{SharedRt, SimpleWorkerErrorHandler, WorkerScriptMsg};
use dom::abstractworkerglobalscope::{SendableWorkerScriptChan, WorkerThreadWorkerChan}; 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;
use dom::bindings::codegen::Bindings::DedicatedWorkerGlobalScopeBinding::DedicatedWorkerGlobalScopeMethods; use dom::bindings::codegen::Bindings::DedicatedWorkerGlobalScopeBinding::DedicatedWorkerGlobalScopeMethods;
use dom::bindings::error::{ErrorInfo, ErrorResult}; use dom::bindings::error::{ErrorInfo, ErrorResult};
@ -87,7 +87,7 @@ pub struct DedicatedWorkerGlobalScope {
#[ignore_heap_size_of = "Defined in std"] #[ignore_heap_size_of = "Defined in std"]
timer_event_port: Receiver<(TrustedWorkerAddress, TimerEvent)>, timer_event_port: Receiver<(TrustedWorkerAddress, TimerEvent)>,
#[ignore_heap_size_of = "Trusted<T> has unclear ownership like Dom<T>"] #[ignore_heap_size_of = "Trusted<T> has unclear ownership like Dom<T>"]
worker: DOMRefCell<Option<TrustedWorkerAddress>>, worker: DomRefCell<Option<TrustedWorkerAddress>>,
#[ignore_heap_size_of = "Can't measure trait objects"] #[ignore_heap_size_of = "Can't measure trait objects"]
/// Sender to the parent thread. /// Sender to the parent thread.
parent_sender: Box<ScriptChan + Send>, parent_sender: Box<ScriptChan + Send>,
@ -116,7 +116,7 @@ impl DedicatedWorkerGlobalScope {
own_sender: own_sender, own_sender: own_sender,
timer_event_port: timer_event_port, timer_event_port: timer_event_port,
parent_sender: parent_sender, parent_sender: parent_sender,
worker: DOMRefCell::new(None), worker: DomRefCell::new(None),
} }
} }

View file

@ -10,7 +10,7 @@ use dom::activation::{ActivationSource, synthetic_click_activation};
use dom::attr::Attr; use dom::attr::Attr;
use dom::beforeunloadevent::BeforeUnloadEvent; use dom::beforeunloadevent::BeforeUnloadEvent;
use dom::bindings::callback::ExceptionHandling; 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::DOMRectBinding::DOMRectMethods;
use dom::bindings::codegen::Bindings::DocumentBinding; use dom::bindings::codegen::Bindings::DocumentBinding;
use dom::bindings::codegen::Bindings::DocumentBinding::{DocumentMethods, DocumentReadyState, ElementCreationOptions}; use dom::bindings::codegen::Bindings::DocumentBinding::{DocumentMethods, DocumentReadyState, ElementCreationOptions};
@ -231,14 +231,14 @@ pub struct Document {
has_browsing_context: bool, has_browsing_context: bool,
is_html_document: bool, is_html_document: bool,
activity: Cell<DocumentActivity>, activity: Cell<DocumentActivity>,
url: DOMRefCell<ServoUrl>, url: DomRefCell<ServoUrl>,
#[ignore_heap_size_of = "defined in selectors"] #[ignore_heap_size_of = "defined in selectors"]
quirks_mode: Cell<QuirksMode>, quirks_mode: Cell<QuirksMode>,
/// Caches for the getElement methods /// Caches for the getElement methods
id_map: DOMRefCell<HashMap<Atom, Vec<Dom<Element>>>>, id_map: DomRefCell<HashMap<Atom, Vec<Dom<Element>>>>,
tag_map: DOMRefCell<HashMap<LocalName, Dom<HTMLCollection>>>, tag_map: DomRefCell<HashMap<LocalName, Dom<HTMLCollection>>>,
tagns_map: DOMRefCell<HashMap<QualName, Dom<HTMLCollection>>>, tagns_map: DomRefCell<HashMap<QualName, Dom<HTMLCollection>>>,
classes_map: DOMRefCell<HashMap<Vec<Atom>, Dom<HTMLCollection>>>, classes_map: DomRefCell<HashMap<Vec<Atom>, Dom<HTMLCollection>>>,
images: MutNullableDom<HTMLCollection>, images: MutNullableDom<HTMLCollection>,
embeds: MutNullableDom<HTMLCollection>, embeds: MutNullableDom<HTMLCollection>,
links: MutNullableDom<HTMLCollection>, links: MutNullableDom<HTMLCollection>,
@ -250,7 +250,7 @@ pub struct Document {
/// Can be acquired once for accessing many objects. /// Can be acquired once for accessing many objects.
style_shared_lock: StyleSharedRwLock, style_shared_lock: StyleSharedRwLock,
/// List of stylesheets associated with nodes in this document. |None| if the list needs to be refreshed. /// List of stylesheets associated with nodes in this document. |None| if the list needs to be refreshed.
stylesheets: DOMRefCell<StylesheetSet<StyleSheetInDocument>>, stylesheets: DomRefCell<StylesheetSet<StyleSheetInDocument>>,
stylesheet_list: MutNullableDom<StyleSheetList>, stylesheet_list: MutNullableDom<StyleSheetList>,
ready_state: Cell<DocumentReadyState>, ready_state: Cell<DocumentReadyState>,
/// Whether the DOMContentLoaded event has already been dispatched. /// Whether the DOMContentLoaded event has already been dispatched.
@ -262,7 +262,7 @@ pub struct Document {
/// The script element that is currently executing. /// The script element that is currently executing.
current_script: MutNullableDom<HTMLScriptElement>, current_script: MutNullableDom<HTMLScriptElement>,
/// https://html.spec.whatwg.org/multipage/#pending-parsing-blocking-script /// https://html.spec.whatwg.org/multipage/#pending-parsing-blocking-script
pending_parsing_blocking_script: DOMRefCell<Option<PendingScript>>, pending_parsing_blocking_script: DomRefCell<Option<PendingScript>>,
/// Number of stylesheets that block executing the next parser-inserted script /// Number of stylesheets that block executing the next parser-inserted script
script_blocking_stylesheets_count: Cell<u32>, script_blocking_stylesheets_count: Cell<u32>,
/// https://html.spec.whatwg.org/multipage/#list-of-scripts-that-will-execute-when-the-document-has-finished-parsing /// 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 /// https://html.spec.whatwg.org/multipage/#list-of-scripts-that-will-execute-in-order-as-soon-as-possible
asap_in_order_scripts_list: PendingInOrderScriptVec, asap_in_order_scripts_list: PendingInOrderScriptVec,
/// https://html.spec.whatwg.org/multipage/#set-of-scripts-that-will-execute-as-soon-as-possible /// https://html.spec.whatwg.org/multipage/#set-of-scripts-that-will-execute-as-soon-as-possible
asap_scripts_set: DOMRefCell<Vec<Dom<HTMLScriptElement>>>, asap_scripts_set: DomRefCell<Vec<Dom<HTMLScriptElement>>>,
/// https://html.spec.whatwg.org/multipage/#concept-n-noscript /// https://html.spec.whatwg.org/multipage/#concept-n-noscript
/// True if scripting is enabled for all scripts in this document /// True if scripting is enabled for all scripts in this document
scripting_enabled: bool, scripting_enabled: bool,
@ -279,14 +279,14 @@ pub struct Document {
animation_frame_ident: Cell<u32>, animation_frame_ident: Cell<u32>,
/// https://html.spec.whatwg.org/multipage/#list-of-animation-frame-callbacks /// https://html.spec.whatwg.org/multipage/#list-of-animation-frame-callbacks
/// List of animation frame callbacks /// List of animation frame callbacks
animation_frame_list: DOMRefCell<Vec<(u32, Option<AnimationFrameCallback>)>>, animation_frame_list: DomRefCell<Vec<(u32, Option<AnimationFrameCallback>)>>,
/// Whether we're in the process of running animation callbacks. /// Whether we're in the process of running animation callbacks.
/// ///
/// Tracking this is not necessary for correctness. Instead, it is an optimization to avoid /// Tracking this is not necessary for correctness. Instead, it is an optimization to avoid
/// sending needless `ChangeRunningAnimationsState` messages to the compositor. /// sending needless `ChangeRunningAnimationsState` messages to the compositor.
running_animation_callbacks: Cell<bool>, running_animation_callbacks: Cell<bool>,
/// Tracks all outstanding loads related to this document. /// Tracks all outstanding loads related to this document.
loader: DOMRefCell<DocumentLoader>, loader: DomRefCell<DocumentLoader>,
/// The current active HTML parser, to allow resuming after interruptions. /// The current active HTML parser, to allow resuming after interruptions.
current_parser: MutNullableDom<ServoParser>, current_parser: MutNullableDom<ServoParser>,
/// When we should kick off a reflow. This happens during parsing. /// When we should kick off a reflow. This happens during parsing.
@ -298,12 +298,12 @@ pub struct Document {
appropriate_template_contents_owner_document: MutNullableDom<Document>, appropriate_template_contents_owner_document: MutNullableDom<Document>,
/// Information on elements needing restyle to ship over to the layout thread when the /// Information on elements needing restyle to ship over to the layout thread when the
/// time comes. /// time comes.
pending_restyles: DOMRefCell<HashMap<Dom<Element>, PendingRestyle>>, pending_restyles: DomRefCell<HashMap<Dom<Element>, PendingRestyle>>,
/// This flag will be true if layout suppressed a reflow attempt that was /// This flag will be true if layout suppressed a reflow attempt that was
/// needed in order for the page to be painted. /// needed in order for the page to be painted.
needs_paint: Cell<bool>, needs_paint: Cell<bool>,
/// http://w3c.github.io/touch-events/#dfn-active-touch-point /// http://w3c.github.io/touch-events/#dfn-active-touch-point
active_touch_points: DOMRefCell<Vec<Dom<Touch>>>, active_touch_points: DomRefCell<Vec<Dom<Touch>>>,
/// Navigation Timing properties: /// Navigation Timing properties:
/// https://w3c.github.io/navigation-timing/#sec-PerformanceNavigationTiming /// https://w3c.github.io/navigation-timing/#sec-PerformanceNavigationTiming
dom_loading: Cell<u64>, dom_loading: Cell<u64>,
@ -326,7 +326,7 @@ pub struct Document {
target_element: MutNullableDom<Element>, target_element: MutNullableDom<Element>,
/// https://w3c.github.io/uievents/#event-type-dblclick /// https://w3c.github.io/uievents/#event-type-dblclick
#[ignore_heap_size_of = "Defined in std"] #[ignore_heap_size_of = "Defined in std"]
last_click_info: DOMRefCell<Option<(Instant, Point2D<f32>)>>, last_click_info: DomRefCell<Option<(Instant, Point2D<f32>)>>,
/// https://html.spec.whatwg.org/multipage/#ignore-destructive-writes-counter /// https://html.spec.whatwg.org/multipage/#ignore-destructive-writes-counter
ignore_destructive_writes_counter: Cell<u32>, ignore_destructive_writes_counter: Cell<u32>,
/// The number of spurious `requestAnimationFrame()` requests we've received. /// 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 /// whenever any element with the same ID as the form attribute
/// is inserted or removed from the document. /// is inserted or removed from the document.
/// See https://html.spec.whatwg.org/multipage/#form-owner /// See https://html.spec.whatwg.org/multipage/#form-owner
form_id_listener_map: DOMRefCell<HashMap<Atom, HashSet<Dom<Element>>>>, form_id_listener_map: DomRefCell<HashMap<Atom, HashSet<Dom<Element>>>>,
} }
#[derive(HeapSizeOf, JSTraceable)] #[derive(HeapSizeOf, JSTraceable)]
@ -2230,17 +2230,17 @@ impl Document {
}), }),
}, },
last_modified: last_modified, last_modified: last_modified,
url: DOMRefCell::new(url), url: DomRefCell::new(url),
// https://dom.spec.whatwg.org/#concept-document-quirks // https://dom.spec.whatwg.org/#concept-document-quirks
quirks_mode: Cell::new(QuirksMode::NoQuirks), quirks_mode: Cell::new(QuirksMode::NoQuirks),
// https://dom.spec.whatwg.org/#concept-document-encoding // https://dom.spec.whatwg.org/#concept-document-encoding
encoding: Cell::new(UTF_8), encoding: Cell::new(UTF_8),
is_html_document: is_html_document == IsHTMLDocument::HTMLDocument, is_html_document: is_html_document == IsHTMLDocument::HTMLDocument,
activity: Cell::new(activity), activity: Cell::new(activity),
id_map: DOMRefCell::new(HashMap::new()), id_map: DomRefCell::new(HashMap::new()),
tag_map: DOMRefCell::new(HashMap::new()), tag_map: DomRefCell::new(HashMap::new()),
tagns_map: DOMRefCell::new(HashMap::new()), tagns_map: DomRefCell::new(HashMap::new()),
classes_map: DOMRefCell::new(HashMap::new()), classes_map: DomRefCell::new(HashMap::new()),
images: Default::default(), images: Default::default(),
embeds: Default::default(), embeds: Default::default(),
links: Default::default(), links: Default::default(),
@ -2263,7 +2263,7 @@ impl Document {
PER_PROCESS_AUTHOR_SHARED_LOCK.clone() PER_PROCESS_AUTHOR_SHARED_LOCK.clone()
//StyleSharedRwLock::new() //StyleSharedRwLock::new()
}, },
stylesheets: DOMRefCell::new(StylesheetSet::new()), stylesheets: DomRefCell::new(StylesheetSet::new()),
stylesheet_list: MutNullableDom::new(None), stylesheet_list: MutNullableDom::new(None),
ready_state: Cell::new(ready_state), ready_state: Cell::new(ready_state),
domcontentloaded_dispatched: Cell::new(domcontentloaded_dispatched), domcontentloaded_dispatched: Cell::new(domcontentloaded_dispatched),
@ -2277,16 +2277,16 @@ impl Document {
asap_scripts_set: Default::default(), asap_scripts_set: Default::default(),
scripting_enabled: has_browsing_context == HasBrowsingContext::Yes, scripting_enabled: has_browsing_context == HasBrowsingContext::Yes,
animation_frame_ident: Cell::new(0), animation_frame_ident: Cell::new(0),
animation_frame_list: DOMRefCell::new(vec![]), animation_frame_list: DomRefCell::new(vec![]),
running_animation_callbacks: Cell::new(false), running_animation_callbacks: Cell::new(false),
loader: DOMRefCell::new(doc_loader), loader: DomRefCell::new(doc_loader),
current_parser: Default::default(), current_parser: Default::default(),
reflow_timeout: Cell::new(None), reflow_timeout: Cell::new(None),
base_element: Default::default(), base_element: Default::default(),
appropriate_template_contents_owner_document: 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), 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_loading: Cell::new(Default::default()),
dom_interactive: Cell::new(Default::default()), dom_interactive: Cell::new(Default::default()),
dom_content_loaded_event_start: Cell::new(Default::default()), dom_content_loaded_event_start: Cell::new(Default::default()),
@ -2300,7 +2300,7 @@ impl Document {
referrer: referrer, referrer: referrer,
referrer_policy: Cell::new(referrer_policy), referrer_policy: Cell::new(referrer_policy),
target_element: MutNullableDom::new(None), target_element: MutNullableDom::new(None),
last_click_info: DOMRefCell::new(None), last_click_info: DomRefCell::new(None),
ignore_destructive_writes_counter: Default::default(), ignore_destructive_writes_counter: Default::default(),
spurious_animation_frames: Cell::new(0), spurious_animation_frames: Cell::new(0),
dom_count: Cell::new(1), dom_count: Cell::new(1),
@ -4081,7 +4081,7 @@ impl AnimationFrameCallback {
#[derive(Default, HeapSizeOf, JSTraceable)] #[derive(Default, HeapSizeOf, JSTraceable)]
#[must_root] #[must_root]
struct PendingInOrderScriptVec { struct PendingInOrderScriptVec {
scripts: DOMRefCell<VecDeque<PendingScript>>, scripts: DomRefCell<VecDeque<PendingScript>>,
} }
impl PendingInOrderScriptVec { impl PendingInOrderScriptVec {

View file

@ -2,7 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * 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::DOMMatrixBinding::{DOMMatrixInit, DOMMatrixMethods};
use dom::bindings::codegen::Bindings::DOMMatrixReadOnlyBinding::{DOMMatrixReadOnlyMethods, Wrap}; use dom::bindings::codegen::Bindings::DOMMatrixReadOnlyBinding::{DOMMatrixReadOnlyMethods, Wrap};
use dom::bindings::codegen::Bindings::DOMPointBinding::DOMPointInit; use dom::bindings::codegen::Bindings::DOMPointBinding::DOMPointInit;
@ -21,7 +21,7 @@ use std::f64;
#[dom_struct] #[dom_struct]
pub struct DOMMatrixReadOnly { pub struct DOMMatrixReadOnly {
reflector_: Reflector, reflector_: Reflector,
matrix: DOMRefCell<Transform3D<f64>>, matrix: DomRefCell<Transform3D<f64>>,
is2D: Cell<bool>, is2D: Cell<bool>,
} }
@ -35,7 +35,7 @@ impl DOMMatrixReadOnly {
pub fn new_inherited(is2D: bool, matrix: Transform3D<f64>) -> Self { pub fn new_inherited(is2D: bool, matrix: Transform3D<f64>) -> Self {
DOMMatrixReadOnly { DOMMatrixReadOnly {
reflector_: Reflector::new(), reflector_: Reflector::new(),
matrix: DOMRefCell::new(matrix), matrix: DomRefCell::new(matrix),
is2D: Cell::new(is2D), is2D: Cell::new(is2D),
} }
} }

View file

@ -7,7 +7,7 @@
use devtools_traits::AttrInfo; use devtools_traits::AttrInfo;
use dom::activation::Activatable; use dom::activation::Activatable;
use dom::attr::{Attr, AttrHelpersForLayout}; 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::AttrBinding::AttrMethods;
use dom::bindings::codegen::Bindings::DocumentBinding::DocumentMethods; use dom::bindings::codegen::Bindings::DocumentBinding::DocumentMethods;
use dom::bindings::codegen::Bindings::ElementBinding; use dom::bindings::codegen::Bindings::ElementBinding;
@ -130,12 +130,12 @@ pub struct Element {
local_name: LocalName, local_name: LocalName,
tag_name: TagName, tag_name: TagName,
namespace: Namespace, namespace: Namespace,
prefix: DOMRefCell<Option<Prefix>>, prefix: DomRefCell<Option<Prefix>>,
attrs: DOMRefCell<Vec<Dom<Attr>>>, attrs: DomRefCell<Vec<Dom<Attr>>>,
id_attribute: DOMRefCell<Option<Atom>>, id_attribute: DomRefCell<Option<Atom>>,
is: DOMRefCell<Option<LocalName>>, is: DomRefCell<Option<LocalName>>,
#[ignore_heap_size_of = "Arc"] #[ignore_heap_size_of = "Arc"]
style_attribute: DOMRefCell<Option<Arc<Locked<PropertyDeclarationBlock>>>>, style_attribute: DomRefCell<Option<Arc<Locked<PropertyDeclarationBlock>>>>,
attr_list: MutNullableDom<NamedNodeMap>, attr_list: MutNullableDom<NamedNodeMap>,
class_list: MutNullableDom<DOMTokenList>, class_list: MutNullableDom<DOMTokenList>,
state: Cell<ElementState>, state: Cell<ElementState>,
@ -146,10 +146,10 @@ pub struct Element {
#[ignore_heap_size_of = "bitflags defined in rust-selectors"] #[ignore_heap_size_of = "bitflags defined in rust-selectors"]
selector_flags: Cell<ElementSelectorFlags>, selector_flags: Cell<ElementSelectorFlags>,
/// https://html.spec.whatwg.org/multipage/#custom-element-reaction-queue /// https://html.spec.whatwg.org/multipage/#custom-element-reaction-queue
custom_element_reaction_queue: DOMRefCell<Vec<CustomElementReaction>>, custom_element_reaction_queue: DomRefCell<Vec<CustomElementReaction>>,
/// https://dom.spec.whatwg.org/#concept-element-custom-element-definition /// https://dom.spec.whatwg.org/#concept-element-custom-element-definition
#[ignore_heap_size_of = "Rc"] #[ignore_heap_size_of = "Rc"]
custom_element_definition: DOMRefCell<Option<Rc<CustomElementDefinition>>>, custom_element_definition: DomRefCell<Option<Rc<CustomElementDefinition>>>,
/// https://dom.spec.whatwg.org/#concept-element-custom-element-state /// https://dom.spec.whatwg.org/#concept-element-custom-element-state
custom_element_state: Cell<CustomElementState>, custom_element_state: Cell<CustomElementState>,
} }
@ -255,11 +255,11 @@ impl Element {
local_name: local_name, local_name: local_name,
tag_name: TagName::new(), tag_name: TagName::new(),
namespace: namespace, namespace: namespace,
prefix: DOMRefCell::new(prefix), prefix: DomRefCell::new(prefix),
attrs: DOMRefCell::new(vec![]), attrs: DomRefCell::new(vec![]),
id_attribute: DOMRefCell::new(None), id_attribute: DomRefCell::new(None),
is: DOMRefCell::new(None), is: DomRefCell::new(None),
style_attribute: DOMRefCell::new(None), style_attribute: DomRefCell::new(None),
attr_list: Default::default(), attr_list: Default::default(),
class_list: Default::default(), class_list: Default::default(),
state: Cell::new(state), state: Cell::new(state),
@ -958,7 +958,7 @@ impl Element {
ns!() ns!()
} }
pub fn style_attribute(&self) -> &DOMRefCell<Option<Arc<Locked<PropertyDeclarationBlock>>>> { pub fn style_attribute(&self) -> &DomRefCell<Option<Arc<Locked<PropertyDeclarationBlock>>>> {
&self.style_attribute &self.style_attribute
} }
@ -3006,12 +3006,12 @@ impl<'a> AttributeMutation<'a> {
/// owner changes. /// owner changes.
#[derive(HeapSizeOf, JSTraceable)] #[derive(HeapSizeOf, JSTraceable)]
struct TagName { struct TagName {
ptr: DOMRefCell<Option<LocalName>>, ptr: DomRefCell<Option<LocalName>>,
} }
impl TagName { impl TagName {
fn new() -> 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 /// Retrieve a copy of the current inner value. If it is `None`, it is

View file

@ -2,7 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * 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;
use dom::bindings::codegen::Bindings::ErrorEventBinding::ErrorEventMethods; use dom::bindings::codegen::Bindings::ErrorEventBinding::ErrorEventMethods;
use dom::bindings::codegen::Bindings::EventBinding::EventMethods; use dom::bindings::codegen::Bindings::EventBinding::EventMethods;
@ -23,8 +23,8 @@ use std::cell::Cell;
#[dom_struct] #[dom_struct]
pub struct ErrorEvent { pub struct ErrorEvent {
event: Event, event: Event,
message: DOMRefCell<DOMString>, message: DomRefCell<DOMString>,
filename: DOMRefCell<DOMString>, filename: DomRefCell<DOMString>,
lineno: Cell<u32>, lineno: Cell<u32>,
colno: Cell<u32>, colno: Cell<u32>,
#[ignore_heap_size_of = "Defined in rust-mozjs"] #[ignore_heap_size_of = "Defined in rust-mozjs"]
@ -35,8 +35,8 @@ impl ErrorEvent {
fn new_inherited() -> ErrorEvent { fn new_inherited() -> ErrorEvent {
ErrorEvent { ErrorEvent {
event: Event::new_inherited(), event: Event::new_inherited(),
message: DOMRefCell::new(DOMString::new()), message: DomRefCell::new(DOMString::new()),
filename: DOMRefCell::new(DOMString::new()), filename: DomRefCell::new(DOMString::new()),
lineno: Cell::new(0), lineno: Cell::new(0),
colno: Cell::new(0), colno: Cell::new(0),
error: Heap::default() error: Heap::default()

View file

@ -4,7 +4,7 @@
use devtools_traits::{TimelineMarker, TimelineMarkerType}; use devtools_traits::{TimelineMarker, TimelineMarkerType};
use dom::bindings::callback::ExceptionHandling; 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;
use dom::bindings::codegen::Bindings::EventBinding::{EventConstants, EventMethods}; use dom::bindings::codegen::Bindings::EventBinding::{EventConstants, EventMethods};
use dom::bindings::error::Fallible; use dom::bindings::error::Fallible;
@ -31,7 +31,7 @@ pub struct Event {
reflector_: Reflector, reflector_: Reflector,
current_target: MutNullableDom<EventTarget>, current_target: MutNullableDom<EventTarget>,
target: MutNullableDom<EventTarget>, target: MutNullableDom<EventTarget>,
type_: DOMRefCell<Atom>, type_: DomRefCell<Atom>,
phase: Cell<EventPhase>, phase: Cell<EventPhase>,
canceled: Cell<EventDefault>, canceled: Cell<EventDefault>,
stop_propagation: Cell<bool>, stop_propagation: Cell<bool>,
@ -50,7 +50,7 @@ impl Event {
reflector_: Reflector::new(), reflector_: Reflector::new(),
current_target: Default::default(), current_target: Default::default(),
target: Default::default(), target: Default::default(),
type_: DOMRefCell::new(atom!("")), type_: DomRefCell::new(atom!("")),
phase: Cell::new(EventPhase::None), phase: Cell::new(EventPhase::None),
canceled: Cell::new(EventDefault::Allowed), canceled: Cell::new(EventDefault::Allowed),
stop_propagation: Cell::new(false), stop_propagation: Cell::new(false),

View file

@ -2,7 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * 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::codegen::Bindings::EventSourceBinding::{EventSourceInit, EventSourceMethods, Wrap};
use dom::bindings::error::{Error, Fallible}; use dom::bindings::error::{Error, Fallible};
use dom::bindings::inheritance::Castable; use dom::bindings::inheritance::Castable;
@ -56,8 +56,8 @@ enum ReadyState {
pub struct EventSource { pub struct EventSource {
eventtarget: EventTarget, eventtarget: EventTarget,
url: ServoUrl, url: ServoUrl,
request: DOMRefCell<Option<RequestInit>>, request: DomRefCell<Option<RequestInit>>,
last_event_id: DOMRefCell<DOMString>, last_event_id: DomRefCell<DOMString>,
reconnection_time: Cell<u64>, reconnection_time: Cell<u64>,
generation_id: Cell<GenerationId>, generation_id: Cell<GenerationId>,
@ -402,8 +402,8 @@ impl EventSource {
EventSource { EventSource {
eventtarget: EventTarget::new_inherited(), eventtarget: EventTarget::new_inherited(),
url: url, url: url,
request: DOMRefCell::new(None), request: DomRefCell::new(None),
last_event_id: DOMRefCell::new(DOMString::from("")), last_event_id: DomRefCell::new(DOMString::from("")),
reconnection_time: Cell::new(DEFAULT_RECONNECTION_TIME), reconnection_time: Cell::new(DEFAULT_RECONNECTION_TIME),
generation_id: Cell::new(GenerationId(0)), generation_id: Cell::new(GenerationId(0)),

View file

@ -4,7 +4,7 @@
use dom::beforeunloadevent::BeforeUnloadEvent; use dom::beforeunloadevent::BeforeUnloadEvent;
use dom::bindings::callback::{CallbackContainer, ExceptionHandling, CallbackFunction}; 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::BeforeUnloadEventBinding::BeforeUnloadEventMethods;
use dom::bindings::codegen::Bindings::ErrorEventBinding::ErrorEventMethods; use dom::bindings::codegen::Bindings::ErrorEventBinding::ErrorEventMethods;
use dom::bindings::codegen::Bindings::EventBinding::EventMethods; use dom::bindings::codegen::Bindings::EventBinding::EventMethods;
@ -276,14 +276,14 @@ impl EventListeners {
#[dom_struct] #[dom_struct]
pub struct EventTarget { pub struct EventTarget {
reflector_: Reflector, reflector_: Reflector,
handlers: DOMRefCell<HashMap<Atom, EventListeners, BuildHasherDefault<FnvHasher>>>, handlers: DomRefCell<HashMap<Atom, EventListeners, BuildHasherDefault<FnvHasher>>>,
} }
impl EventTarget { impl EventTarget {
pub fn new_inherited() -> EventTarget { pub fn new_inherited() -> EventTarget {
EventTarget { EventTarget {
reflector_: Reflector::new(), reflector_: Reflector::new(),
handlers: DOMRefCell::new(Default::default()), handlers: DomRefCell::new(Default::default()),
} }
} }

View file

@ -3,7 +3,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use base64; use base64;
use dom::bindings::cell::DOMRefCell; use dom::bindings::cell::DomRefCell;
use dom::bindings::codegen::Bindings::BlobBinding::BlobMethods; use dom::bindings::codegen::Bindings::BlobBinding::BlobMethods;
use dom::bindings::codegen::Bindings::FileReaderBinding::{self, FileReaderConstants, FileReaderMethods}; use dom::bindings::codegen::Bindings::FileReaderBinding::{self, FileReaderConstants, FileReaderMethods};
use dom::bindings::codegen::UnionTypes::StringOrObject; use dom::bindings::codegen::UnionTypes::StringOrObject;
@ -88,7 +88,7 @@ pub struct FileReader {
eventtarget: EventTarget, eventtarget: EventTarget,
ready_state: Cell<FileReaderReadyState>, ready_state: Cell<FileReaderReadyState>,
error: MutNullableDom<DOMException>, error: MutNullableDom<DOMException>,
result: DOMRefCell<Option<FileReaderResult>>, result: DomRefCell<Option<FileReaderResult>>,
generation_id: Cell<GenerationId>, generation_id: Cell<GenerationId>,
} }
@ -98,7 +98,7 @@ impl FileReader {
eventtarget: EventTarget::new_inherited(), eventtarget: EventTarget::new_inherited(),
ready_state: Cell::new(FileReaderReadyState::Empty), ready_state: Cell::new(FileReaderReadyState::Empty),
error: MutNullableDom::new(None), error: MutNullableDom::new(None),
result: DOMRefCell::new(None), result: DomRefCell::new(None),
generation_id: Cell::new(GenerationId(0)), generation_id: Cell::new(GenerationId(0)),
} }
} }
@ -216,7 +216,7 @@ impl FileReader {
} }
// https://w3c.github.io/FileAPI/#dfn-readAsText // https://w3c.github.io/FileAPI/#dfn-readAsText
fn perform_readastext(result: &DOMRefCell<Option<FileReaderResult>>, data: ReadMetaData, blob_bytes: &[u8]) { fn perform_readastext(result: &DomRefCell<Option<FileReaderResult>>, data: ReadMetaData, blob_bytes: &[u8]) {
let blob_label = &data.label; let blob_label = &data.label;
let blob_type = &data.blobtype; let blob_type = &data.blobtype;
@ -246,7 +246,7 @@ impl FileReader {
} }
//https://w3c.github.io/FileAPI/#dfn-readAsDataURL //https://w3c.github.io/FileAPI/#dfn-readAsDataURL
fn perform_readasdataurl(result: &DOMRefCell<Option<FileReaderResult>>, data: ReadMetaData, bytes: &[u8]) { fn perform_readasdataurl(result: &DomRefCell<Option<FileReaderResult>>, data: ReadMetaData, bytes: &[u8]) {
let base64 = base64::encode(bytes); let base64 = base64::encode(bytes);
let output = if data.blobtype.is_empty() { let output = if data.blobtype.is_empty() {
@ -260,7 +260,7 @@ impl FileReader {
// https://w3c.github.io/FileAPI/#dfn-readAsArrayBuffer // https://w3c.github.io/FileAPI/#dfn-readAsArrayBuffer
#[allow(unsafe_code)] #[allow(unsafe_code)]
fn perform_readasarraybuffer(result: &DOMRefCell<Option<FileReaderResult>>, fn perform_readasarraybuffer(result: &DomRefCell<Option<FileReaderResult>>,
cx: *mut JSContext, _: ReadMetaData, bytes: &[u8]) { cx: *mut JSContext, _: ReadMetaData, bytes: &[u8]) {
unsafe { unsafe {
rooted!(in(cx) let mut array_buffer = ptr::null_mut()); rooted!(in(cx) let mut array_buffer = ptr::null_mut());

View file

@ -2,7 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * 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::FormDataMethods;
use dom::bindings::codegen::Bindings::FormDataBinding::FormDataWrap; use dom::bindings::codegen::Bindings::FormDataBinding::FormDataWrap;
use dom::bindings::codegen::UnionTypes::FileOrUSVString; use dom::bindings::codegen::UnionTypes::FileOrUSVString;
@ -25,7 +25,7 @@ use std::iter;
#[dom_struct] #[dom_struct]
pub struct FormData { pub struct FormData {
reflector_: Reflector, reflector_: Reflector,
data: DOMRefCell<HashMap<LocalName, Vec<FormDatum>>>, data: DomRefCell<HashMap<LocalName, Vec<FormDatum>>>,
} }
impl FormData { impl FormData {
@ -43,7 +43,7 @@ impl FormData {
FormData { FormData {
reflector_: Reflector::new(), reflector_: Reflector::new(),
data: DOMRefCell::new(hashmap), data: DomRefCell::new(hashmap),
} }
} }

View file

@ -2,7 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * 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;
use dom::bindings::codegen::Bindings::GamepadListBinding::GamepadListMethods; use dom::bindings::codegen::Bindings::GamepadListBinding::GamepadListMethods;
use dom::bindings::reflector::{Reflector, reflect_dom_object}; use dom::bindings::reflector::{Reflector, reflect_dom_object};
@ -15,14 +15,14 @@ use dom_struct::dom_struct;
#[dom_struct] #[dom_struct]
pub struct GamepadList { pub struct GamepadList {
reflector_: Reflector, reflector_: Reflector,
list: DOMRefCell<Vec<Dom<Gamepad>>> list: DomRefCell<Vec<Dom<Gamepad>>>
} }
impl GamepadList { impl GamepadList {
fn new_inherited(list: &[&Gamepad]) -> GamepadList { fn new_inherited(list: &[&Gamepad]) -> GamepadList {
GamepadList { GamepadList {
reflector_: Reflector::new(), 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())
} }
} }

View file

@ -3,7 +3,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use devtools_traits::{ScriptToDevtoolsControlMsg, WorkerId}; 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::WindowBinding::WindowMethods;
use dom::bindings::codegen::Bindings::WorkerGlobalScopeBinding::WorkerGlobalScopeMethods; use dom::bindings::codegen::Bindings::WorkerGlobalScopeBinding::WorkerGlobalScopeMethods;
use dom::bindings::conversions::root_from_object; use dom::bindings::conversions::root_from_object;
@ -69,7 +69,7 @@ pub struct GlobalScope {
devtools_wants_updates: Cell<bool>, devtools_wants_updates: Cell<bool>,
/// Timers used by the Console API. /// Timers used by the Console API.
console_timers: DOMRefCell<HashMap<DOMString, u64>>, console_timers: DomRefCell<HashMap<DOMString, u64>>,
/// For providing instructions to an optional devtools server. /// For providing instructions to an optional devtools server.
#[ignore_heap_size_of = "channels are hard"] #[ignore_heap_size_of = "channels are hard"]
@ -131,7 +131,7 @@ impl GlobalScope {
next_worker_id: Cell::new(WorkerId(0)), next_worker_id: Cell::new(WorkerId(0)),
pipeline_id, pipeline_id,
devtools_wants_updates: Default::default(), devtools_wants_updates: Default::default(),
console_timers: DOMRefCell::new(Default::default()), console_timers: DomRefCell::new(Default::default()),
devtools_chan, devtools_chan,
mem_profiler_chan, mem_profiler_chan,
time_profiler_chan, time_profiler_chan,

View file

@ -2,7 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * 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::codegen::Bindings::HeadersBinding::{HeadersInit, HeadersMethods, HeadersWrap};
use dom::bindings::error::{Error, ErrorResult, Fallible}; use dom::bindings::error::{Error, ErrorResult, Fallible};
use dom::bindings::iterable::Iterable; use dom::bindings::iterable::Iterable;
@ -22,7 +22,7 @@ pub struct Headers {
reflector_: Reflector, reflector_: Reflector,
guard: Cell<Guard>, guard: Cell<Guard>,
#[ignore_heap_size_of = "Defined in hyper"] #[ignore_heap_size_of = "Defined in hyper"]
header_list: DOMRefCell<HyperHeaders> header_list: DomRefCell<HyperHeaders>
} }
// https://fetch.spec.whatwg.org/#concept-headers-guard // https://fetch.spec.whatwg.org/#concept-headers-guard
@ -40,7 +40,7 @@ impl Headers {
Headers { Headers {
reflector_: Reflector::new(), reflector_: Reflector::new(),
guard: Cell::new(Guard::None), guard: Cell::new(Guard::None),
header_list: DOMRefCell::new(HyperHeaders::new()), header_list: DomRefCell::new(HyperHeaders::new()),
} }
} }

View file

@ -3,7 +3,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use dom::activation::Activatable; 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::AttrBinding::AttrMethods;
use dom::bindings::codegen::Bindings::DOMTokenListBinding::DOMTokenListMethods; use dom::bindings::codegen::Bindings::DOMTokenListBinding::DOMTokenListMethods;
use dom::bindings::codegen::Bindings::HTMLAnchorElementBinding; use dom::bindings::codegen::Bindings::HTMLAnchorElementBinding;
@ -38,7 +38,7 @@ use style::attr::AttrValue;
pub struct HTMLAnchorElement { pub struct HTMLAnchorElement {
htmlelement: HTMLElement, htmlelement: HTMLElement,
rel_list: MutNullableDom<DOMTokenList>, rel_list: MutNullableDom<DOMTokenList>,
url: DOMRefCell<Option<ServoUrl>>, url: DomRefCell<Option<ServoUrl>>,
} }
impl HTMLAnchorElement { impl HTMLAnchorElement {
@ -49,7 +49,7 @@ impl HTMLAnchorElement {
htmlelement: htmlelement:
HTMLElement::new_inherited(local_name, prefix, document), HTMLElement::new_inherited(local_name, prefix, document),
rel_list: Default::default(), rel_list: Default::default(),
url: DOMRefCell::new(None), url: DomRefCell::new(None),
} }
} }

View file

@ -5,7 +5,7 @@
use base64; use base64;
use canvas_traits::canvas::{CanvasMsg, FromScriptMsg}; use canvas_traits::canvas::{CanvasMsg, FromScriptMsg};
use dom::attr::Attr; 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::CanvasRenderingContext2DBinding::CanvasRenderingContext2DMethods;
use dom::bindings::codegen::Bindings::HTMLCanvasElementBinding; use dom::bindings::codegen::Bindings::HTMLCanvasElementBinding;
use dom::bindings::codegen::Bindings::HTMLCanvasElementBinding::HTMLCanvasElementMethods; use dom::bindings::codegen::Bindings::HTMLCanvasElementBinding::HTMLCanvasElementMethods;
@ -51,7 +51,7 @@ pub enum CanvasContext {
#[dom_struct] #[dom_struct]
pub struct HTMLCanvasElement { pub struct HTMLCanvasElement {
htmlelement: HTMLElement, htmlelement: HTMLElement,
context: DOMRefCell<Option<CanvasContext>>, context: DomRefCell<Option<CanvasContext>>,
} }
impl HTMLCanvasElement { impl HTMLCanvasElement {
@ -60,7 +60,7 @@ impl HTMLCanvasElement {
document: &Document) -> HTMLCanvasElement { document: &Document) -> HTMLCanvasElement {
HTMLCanvasElement { HTMLCanvasElement {
htmlelement: HTMLElement::new_inherited(local_name, prefix, document), htmlelement: HTMLElement::new_inherited(local_name, prefix, document),
context: DOMRefCell::new(None), context: DomRefCell::new(None),
} }
} }

View file

@ -2,7 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * 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;
use dom::bindings::codegen::Bindings::HTMLDialogElementBinding::HTMLDialogElementMethods; use dom::bindings::codegen::Bindings::HTMLDialogElementBinding::HTMLDialogElementMethods;
use dom::bindings::inheritance::Castable; use dom::bindings::inheritance::Castable;
@ -19,7 +19,7 @@ use html5ever::{LocalName, Prefix};
#[dom_struct] #[dom_struct]
pub struct HTMLDialogElement { pub struct HTMLDialogElement {
htmlelement: HTMLElement, htmlelement: HTMLElement,
return_value: DOMRefCell<DOMString>, return_value: DomRefCell<DOMString>,
} }
impl HTMLDialogElement { impl HTMLDialogElement {
@ -29,7 +29,7 @@ impl HTMLDialogElement {
HTMLDialogElement { HTMLDialogElement {
htmlelement: htmlelement:
HTMLElement::new_inherited(local_name, prefix, document), HTMLElement::new_inherited(local_name, prefix, document),
return_value: DOMRefCell::new(DOMString::new()), return_value: DomRefCell::new(DOMString::new()),
} }
} }

View file

@ -2,7 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * 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::BlobBinding::BlobMethods;
use dom::bindings::codegen::Bindings::DocumentBinding::DocumentMethods; use dom::bindings::codegen::Bindings::DocumentBinding::DocumentMethods;
use dom::bindings::codegen::Bindings::EventBinding::EventMethods; use dom::bindings::codegen::Bindings::EventBinding::EventMethods;
@ -66,7 +66,7 @@ pub struct HTMLFormElement {
marked_for_reset: Cell<bool>, marked_for_reset: Cell<bool>,
elements: DomOnceCell<HTMLFormControlsCollection>, elements: DomOnceCell<HTMLFormControlsCollection>,
generation_id: Cell<GenerationId>, generation_id: Cell<GenerationId>,
controls: DOMRefCell<Vec<Dom<Element>>>, controls: DomRefCell<Vec<Dom<Element>>>,
} }
impl HTMLFormElement { impl HTMLFormElement {
@ -78,7 +78,7 @@ impl HTMLFormElement {
marked_for_reset: Cell::new(false), marked_for_reset: Cell::new(false),
elements: Default::default(), elements: Default::default(),
generation_id: Cell::new(GenerationId(0)), generation_id: Cell::new(GenerationId(0)),
controls: DOMRefCell::new(Vec::new()), controls: DomRefCell::new(Vec::new()),
} }
} }

View file

@ -4,7 +4,7 @@
use document_loader::{LoadBlocker, LoadType}; use document_loader::{LoadBlocker, LoadType};
use dom::attr::Attr; 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::BrowserElementErrorEventDetail;
use dom::bindings::codegen::Bindings::BrowserElementBinding::BrowserElementIconChangeEventDetail; use dom::bindings::codegen::Bindings::BrowserElementBinding::BrowserElementIconChangeEventDetail;
use dom::bindings::codegen::Bindings::BrowserElementBinding::BrowserElementLocationChangeEventDetail; use dom::bindings::codegen::Bindings::BrowserElementBinding::BrowserElementLocationChangeEventDetail;
@ -90,7 +90,7 @@ pub struct HTMLIFrameElement {
pending_pipeline_id: Cell<Option<PipelineId>>, pending_pipeline_id: Cell<Option<PipelineId>>,
sandbox: MutNullableDom<DOMTokenList>, sandbox: MutNullableDom<DOMTokenList>,
sandbox_allowance: Cell<Option<SandboxAllowance>>, sandbox_allowance: Cell<Option<SandboxAllowance>>,
load_blocker: DOMRefCell<Option<LoadBlocker>>, load_blocker: DomRefCell<Option<LoadBlocker>>,
visibility: Cell<bool>, visibility: Cell<bool>,
} }
@ -329,7 +329,7 @@ impl HTMLIFrameElement {
pending_pipeline_id: Cell::new(None), pending_pipeline_id: Cell::new(None),
sandbox: Default::default(), sandbox: Default::default(),
sandbox_allowance: Cell::new(None), sandbox_allowance: Cell::new(None),
load_blocker: DOMRefCell::new(None), load_blocker: DomRefCell::new(None),
visibility: Cell::new(true), visibility: Cell::new(true),
} }
} }

View file

@ -6,7 +6,7 @@ use app_units::{Au, AU_PER_PX};
use document_loader::{LoadType, LoadBlocker}; use document_loader::{LoadType, LoadBlocker};
use dom::activation::Activatable; use dom::activation::Activatable;
use dom::attr::Attr; 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::DOMRectBinding::DOMRectBinding::DOMRectMethods;
use dom::bindings::codegen::Bindings::ElementBinding::ElementBinding::ElementMethods; use dom::bindings::codegen::Bindings::ElementBinding::ElementBinding::ElementMethods;
use dom::bindings::codegen::Bindings::HTMLImageElementBinding; use dom::bindings::codegen::Bindings::HTMLImageElementBinding;
@ -87,8 +87,8 @@ struct ImageRequest {
pub struct HTMLImageElement { pub struct HTMLImageElement {
htmlelement: HTMLElement, htmlelement: HTMLElement,
image_request: Cell<ImageRequestPhase>, image_request: Cell<ImageRequestPhase>,
current_request: DOMRefCell<ImageRequest>, current_request: DomRefCell<ImageRequest>,
pending_request: DOMRefCell<ImageRequest>, pending_request: DomRefCell<ImageRequest>,
form_owner: MutNullableDom<HTMLFormElement>, form_owner: MutNullableDom<HTMLFormElement>,
generation: Cell<u32>, generation: Cell<u32>,
} }
@ -579,7 +579,7 @@ impl HTMLImageElement {
HTMLImageElement { HTMLImageElement {
htmlelement: HTMLElement::new_inherited(local_name, prefix, document), htmlelement: HTMLElement::new_inherited(local_name, prefix, document),
image_request: Cell::new(ImageRequestPhase::Current), image_request: Cell::new(ImageRequestPhase::Current),
current_request: DOMRefCell::new(ImageRequest { current_request: DomRefCell::new(ImageRequest {
state: State::Unavailable, state: State::Unavailable,
parsed_url: None, parsed_url: None,
source_url: None, source_url: None,
@ -588,7 +588,7 @@ impl HTMLImageElement {
blocker: None, blocker: None,
final_url: None, final_url: None,
}), }),
pending_request: DOMRefCell::new(ImageRequest { pending_request: DomRefCell::new(ImageRequest {
state: State::Unavailable, state: State::Unavailable,
parsed_url: None, parsed_url: None,
source_url: None, source_url: None,

View file

@ -5,7 +5,7 @@
use caseless::compatibility_caseless_match_str; use caseless::compatibility_caseless_match_str;
use dom::activation::{Activatable, ActivationSource, synthetic_click_activation}; use dom::activation::{Activatable, ActivationSource, synthetic_click_activation};
use dom::attr::Attr; 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::EventBinding::EventMethods;
use dom::bindings::codegen::Bindings::FileListBinding::FileListMethods; use dom::bindings::codegen::Bindings::FileListBinding::FileListMethods;
use dom::bindings::codegen::Bindings::HTMLInputElementBinding; use dom::bindings::codegen::Bindings::HTMLInputElementBinding;
@ -88,14 +88,14 @@ pub struct HTMLInputElement {
htmlelement: HTMLElement, htmlelement: HTMLElement,
input_type: Cell<InputType>, input_type: Cell<InputType>,
checked_changed: Cell<bool>, checked_changed: Cell<bool>,
placeholder: DOMRefCell<DOMString>, placeholder: DomRefCell<DOMString>,
value_changed: Cell<bool>, value_changed: Cell<bool>,
size: Cell<u32>, size: Cell<u32>,
maxlength: Cell<i32>, maxlength: Cell<i32>,
minlength: Cell<i32>, minlength: Cell<i32>,
#[ignore_heap_size_of = "#7193"] #[ignore_heap_size_of = "#7193"]
textinput: DOMRefCell<TextInput<ScriptToConstellationChan>>, textinput: DomRefCell<TextInput<ScriptToConstellationChan>>,
activation_state: DOMRefCell<InputActivationState>, activation_state: DomRefCell<InputActivationState>,
// https://html.spec.whatwg.org/multipage/#concept-input-value-dirty-flag // https://html.spec.whatwg.org/multipage/#concept-input-value-dirty-flag
value_dirty: Cell<bool>, value_dirty: Cell<bool>,
@ -142,19 +142,19 @@ impl HTMLInputElement {
HTMLElement::new_inherited_with_state(IN_ENABLED_STATE | IN_READ_WRITE_STATE, HTMLElement::new_inherited_with_state(IN_ENABLED_STATE | IN_READ_WRITE_STATE,
local_name, prefix, document), local_name, prefix, document),
input_type: Cell::new(InputType::InputText), input_type: Cell::new(InputType::InputText),
placeholder: DOMRefCell::new(DOMString::new()), placeholder: DomRefCell::new(DOMString::new()),
checked_changed: Cell::new(false), checked_changed: Cell::new(false),
value_changed: Cell::new(false), value_changed: Cell::new(false),
maxlength: Cell::new(DEFAULT_MAX_LENGTH), maxlength: Cell::new(DEFAULT_MAX_LENGTH),
minlength: Cell::new(DEFAULT_MIN_LENGTH), minlength: Cell::new(DEFAULT_MIN_LENGTH),
size: Cell::new(DEFAULT_INPUT_SIZE), size: Cell::new(DEFAULT_INPUT_SIZE),
textinput: DOMRefCell::new(TextInput::new(Single, textinput: DomRefCell::new(TextInput::new(Single,
DOMString::new(), DOMString::new(),
chan, chan,
None, None,
None, None,
SelectionDirection::None)), SelectionDirection::None)),
activation_state: DOMRefCell::new(InputActivationState::new()), activation_state: DomRefCell::new(InputActivationState::new()),
value_dirty: Cell::new(false), value_dirty: Cell::new(false),
filelist: MutNullableDom::new(None), filelist: MutNullableDom::new(None),
form_owner: Default::default(), form_owner: Default::default(),

View file

@ -4,7 +4,7 @@
use cssparser::{Parser as CssParser, ParserInput}; use cssparser::{Parser as CssParser, ParserInput};
use dom::attr::Attr; 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::DOMTokenListBinding::DOMTokenListBinding::DOMTokenListMethods;
use dom::bindings::codegen::Bindings::HTMLLinkElementBinding; use dom::bindings::codegen::Bindings::HTMLLinkElementBinding;
use dom::bindings::codegen::Bindings::HTMLLinkElementBinding::HTMLLinkElementMethods; use dom::bindings::codegen::Bindings::HTMLLinkElementBinding::HTMLLinkElementMethods;
@ -52,7 +52,7 @@ pub struct HTMLLinkElement {
htmlelement: HTMLElement, htmlelement: HTMLElement,
rel_list: MutNullableDom<DOMTokenList>, rel_list: MutNullableDom<DOMTokenList>,
#[ignore_heap_size_of = "Arc"] #[ignore_heap_size_of = "Arc"]
stylesheet: DOMRefCell<Option<Arc<Stylesheet>>>, stylesheet: DomRefCell<Option<Arc<Stylesheet>>>,
cssom_stylesheet: MutNullableDom<CSSStyleSheet>, cssom_stylesheet: MutNullableDom<CSSStyleSheet>,
/// https://html.spec.whatwg.org/multipage/#a-style-sheet-that-is-blocking-scripts /// 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), htmlelement: HTMLElement::new_inherited(local_name, prefix, document),
rel_list: Default::default(), rel_list: Default::default(),
parser_inserted: Cell::new(creator.is_parser_created()), parser_inserted: Cell::new(creator.is_parser_created()),
stylesheet: DOMRefCell::new(None), stylesheet: DomRefCell::new(None),
cssom_stylesheet: MutNullableDom::new(None), cssom_stylesheet: MutNullableDom::new(None),
pending_loads: Cell::new(0), pending_loads: Cell::new(0),
any_failed_load: Cell::new(false), any_failed_load: Cell::new(false),

View file

@ -5,7 +5,7 @@
use audio_video_metadata; use audio_video_metadata;
use document_loader::{LoadBlocker, LoadType}; use document_loader::{LoadBlocker, LoadType};
use dom::attr::Attr; 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::AttrBinding::AttrMethods;
use dom::bindings::codegen::Bindings::HTMLMediaElementBinding::CanPlayTypeResult; use dom::bindings::codegen::Bindings::HTMLMediaElementBinding::CanPlayTypeResult;
use dom::bindings::codegen::Bindings::HTMLMediaElementBinding::HTMLMediaElementConstants; use dom::bindings::codegen::Bindings::HTMLMediaElementBinding::HTMLMediaElementConstants;
@ -58,7 +58,7 @@ pub struct HTMLMediaElement {
/// https://html.spec.whatwg.org/multipage/#dom-media-readystate /// https://html.spec.whatwg.org/multipage/#dom-media-readystate
ready_state: Cell<ReadyState>, ready_state: Cell<ReadyState>,
/// https://html.spec.whatwg.org/multipage/#dom-media-currentsrc /// https://html.spec.whatwg.org/multipage/#dom-media-currentsrc
current_src: DOMRefCell<String>, current_src: DomRefCell<String>,
/// Incremented whenever tasks associated with this element are cancelled. /// Incremented whenever tasks associated with this element are cancelled.
generation_id: Cell<u32>, generation_id: Cell<u32>,
/// https://html.spec.whatwg.org/multipage/#fire-loadeddata /// https://html.spec.whatwg.org/multipage/#fire-loadeddata
@ -72,16 +72,16 @@ pub struct HTMLMediaElement {
/// https://html.spec.whatwg.org/multipage/#attr-media-autoplay /// https://html.spec.whatwg.org/multipage/#attr-media-autoplay
autoplaying: Cell<bool>, autoplaying: Cell<bool>,
/// https://html.spec.whatwg.org/multipage/#delaying-the-load-event-flag /// https://html.spec.whatwg.org/multipage/#delaying-the-load-event-flag
delaying_the_load_event_flag: DOMRefCell<Option<LoadBlocker>>, delaying_the_load_event_flag: DomRefCell<Option<LoadBlocker>>,
/// https://html.spec.whatwg.org/multipage/#list-of-pending-play-promises /// https://html.spec.whatwg.org/multipage/#list-of-pending-play-promises
#[ignore_heap_size_of = "promises are hard"] #[ignore_heap_size_of = "promises are hard"]
pending_play_promises: DOMRefCell<Vec<Rc<Promise>>>, pending_play_promises: DomRefCell<Vec<Rc<Promise>>>,
/// Play promises which are soon to be fulfilled by a queued task. /// Play promises which are soon to be fulfilled by a queued task.
#[ignore_heap_size_of = "promises are hard"] #[ignore_heap_size_of = "promises are hard"]
in_flight_play_promises_queue: DOMRefCell<VecDeque<(Box<[Rc<Promise>]>, ErrorResult)>>, in_flight_play_promises_queue: DomRefCell<VecDeque<(Box<[Rc<Promise>]>, ErrorResult)>>,
/// The details of the video currently related to this media element. /// The details of the video currently related to this media element.
// FIXME(nox): Why isn't this in HTMLVideoElement? // FIXME(nox): Why isn't this in HTMLVideoElement?
video: DOMRefCell<Option<VideoMedia>>, video: DomRefCell<Option<VideoMedia>>,
} }
/// https://html.spec.whatwg.org/multipage/#dom-media-networkstate /// https://html.spec.whatwg.org/multipage/#dom-media-networkstate
@ -126,7 +126,7 @@ impl HTMLMediaElement {
htmlelement: HTMLElement::new_inherited(tag_name, prefix, document), htmlelement: HTMLElement::new_inherited(tag_name, prefix, document),
network_state: Cell::new(NetworkState::Empty), network_state: Cell::new(NetworkState::Empty),
ready_state: Cell::new(ReadyState::HaveNothing), ready_state: Cell::new(ReadyState::HaveNothing),
current_src: DOMRefCell::new("".to_owned()), current_src: DomRefCell::new("".to_owned()),
generation_id: Cell::new(0), generation_id: Cell::new(0),
fired_loadeddata_event: Cell::new(false), fired_loadeddata_event: Cell::new(false),
error: Default::default(), error: Default::default(),
@ -136,7 +136,7 @@ impl HTMLMediaElement {
delaying_the_load_event_flag: Default::default(), delaying_the_load_event_flag: Default::default(),
pending_play_promises: Default::default(), pending_play_promises: Default::default(),
in_flight_play_promises_queue: Default::default(), in_flight_play_promises_queue: Default::default(),
video: DOMRefCell::new(None), video: DomRefCell::new(None),
} }
} }

View file

@ -3,7 +3,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use dom::attr::Attr; 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;
use dom::bindings::codegen::Bindings::HTMLMetaElementBinding::HTMLMetaElementMethods; use dom::bindings::codegen::Bindings::HTMLMetaElementBinding::HTMLMetaElementMethods;
use dom::bindings::codegen::Bindings::NodeBinding::NodeMethods; use dom::bindings::codegen::Bindings::NodeBinding::NodeMethods;
@ -33,7 +33,7 @@ use style::stylesheets::{Stylesheet, StylesheetContents, CssRule, CssRules, Orig
pub struct HTMLMetaElement { pub struct HTMLMetaElement {
htmlelement: HTMLElement, htmlelement: HTMLElement,
#[ignore_heap_size_of = "Arc"] #[ignore_heap_size_of = "Arc"]
stylesheet: DOMRefCell<Option<Arc<Stylesheet>>>, stylesheet: DomRefCell<Option<Arc<Stylesheet>>>,
cssom_stylesheet: MutNullableDom<CSSStyleSheet>, cssom_stylesheet: MutNullableDom<CSSStyleSheet>,
} }
@ -43,7 +43,7 @@ impl HTMLMetaElement {
document: &Document) -> HTMLMetaElement { document: &Document) -> HTMLMetaElement {
HTMLMetaElement { HTMLMetaElement {
htmlelement: HTMLElement::new_inherited(local_name, prefix, document), htmlelement: HTMLElement::new_inherited(local_name, prefix, document),
stylesheet: DOMRefCell::new(None), stylesheet: DomRefCell::new(None),
cssom_stylesheet: MutNullableDom::new(None), cssom_stylesheet: MutNullableDom::new(None),
} }
} }

View file

@ -3,7 +3,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use dom::attr::Attr; 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;
use dom::bindings::codegen::Bindings::HTMLObjectElementBinding::HTMLObjectElementMethods; use dom::bindings::codegen::Bindings::HTMLObjectElementBinding::HTMLObjectElementMethods;
use dom::bindings::inheritance::Castable; use dom::bindings::inheritance::Castable;
@ -27,7 +27,7 @@ use std::default::Default;
pub struct HTMLObjectElement { pub struct HTMLObjectElement {
htmlelement: HTMLElement, htmlelement: HTMLElement,
#[ignore_heap_size_of = "Arc"] #[ignore_heap_size_of = "Arc"]
image: DOMRefCell<Option<Arc<Image>>>, image: DomRefCell<Option<Arc<Image>>>,
form_owner: MutNullableDom<HTMLFormElement>, form_owner: MutNullableDom<HTMLFormElement>,
} }
@ -38,7 +38,7 @@ impl HTMLObjectElement {
HTMLObjectElement { HTMLObjectElement {
htmlelement: htmlelement:
HTMLElement::new_inherited(local_name, prefix, document), HTMLElement::new_inherited(local_name, prefix, document),
image: DOMRefCell::new(None), image: DomRefCell::new(None),
form_owner: Default::default(), form_owner: Default::default(),
} }
} }

View file

@ -3,7 +3,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use cssparser::{Parser as CssParser, ParserInput}; 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;
use dom::bindings::codegen::Bindings::HTMLStyleElementBinding::HTMLStyleElementMethods; use dom::bindings::codegen::Bindings::HTMLStyleElementBinding::HTMLStyleElementMethods;
use dom::bindings::codegen::Bindings::NodeBinding::NodeMethods; use dom::bindings::codegen::Bindings::NodeBinding::NodeMethods;
@ -32,7 +32,7 @@ use stylesheet_loader::{StylesheetLoader, StylesheetOwner};
pub struct HTMLStyleElement { pub struct HTMLStyleElement {
htmlelement: HTMLElement, htmlelement: HTMLElement,
#[ignore_heap_size_of = "Arc"] #[ignore_heap_size_of = "Arc"]
stylesheet: DOMRefCell<Option<Arc<Stylesheet>>>, stylesheet: DomRefCell<Option<Arc<Stylesheet>>>,
cssom_stylesheet: MutNullableDom<CSSStyleSheet>, cssom_stylesheet: MutNullableDom<CSSStyleSheet>,
/// https://html.spec.whatwg.org/multipage/#a-style-sheet-that-is-blocking-scripts /// https://html.spec.whatwg.org/multipage/#a-style-sheet-that-is-blocking-scripts
parser_inserted: Cell<bool>, parser_inserted: Cell<bool>,
@ -49,7 +49,7 @@ impl HTMLStyleElement {
creator: ElementCreator) -> HTMLStyleElement { creator: ElementCreator) -> HTMLStyleElement {
HTMLStyleElement { HTMLStyleElement {
htmlelement: HTMLElement::new_inherited(local_name, prefix, document), htmlelement: HTMLElement::new_inherited(local_name, prefix, document),
stylesheet: DOMRefCell::new(None), stylesheet: DomRefCell::new(None),
cssom_stylesheet: MutNullableDom::new(None), cssom_stylesheet: MutNullableDom::new(None),
parser_inserted: Cell::new(creator.is_parser_created()), parser_inserted: Cell::new(creator.is_parser_created()),
in_stack_of_open_elements: Cell::new(creator.is_parser_created()), in_stack_of_open_elements: Cell::new(creator.is_parser_created()),

View file

@ -3,7 +3,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use dom::attr::Attr; 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::EventBinding::EventMethods;
use dom::bindings::codegen::Bindings::HTMLTextAreaElementBinding; use dom::bindings::codegen::Bindings::HTMLTextAreaElementBinding;
use dom::bindings::codegen::Bindings::HTMLTextAreaElementBinding::HTMLTextAreaElementMethods; use dom::bindings::codegen::Bindings::HTMLTextAreaElementBinding::HTMLTextAreaElementMethods;
@ -39,8 +39,8 @@ use textinput::{KeyReaction, Lines, SelectionDirection, TextInput};
pub struct HTMLTextAreaElement { pub struct HTMLTextAreaElement {
htmlelement: HTMLElement, htmlelement: HTMLElement,
#[ignore_heap_size_of = "#7193"] #[ignore_heap_size_of = "#7193"]
textinput: DOMRefCell<TextInput<ScriptToConstellationChan>>, textinput: DomRefCell<TextInput<ScriptToConstellationChan>>,
placeholder: DOMRefCell<DOMString>, placeholder: DomRefCell<DOMString>,
// https://html.spec.whatwg.org/multipage/#concept-textarea-dirty // https://html.spec.whatwg.org/multipage/#concept-textarea-dirty
value_changed: Cell<bool>, value_changed: Cell<bool>,
form_owner: MutNullableDom<HTMLFormElement>, form_owner: MutNullableDom<HTMLFormElement>,
@ -113,8 +113,8 @@ impl HTMLTextAreaElement {
htmlelement: htmlelement:
HTMLElement::new_inherited_with_state(IN_ENABLED_STATE | IN_READ_WRITE_STATE, HTMLElement::new_inherited_with_state(IN_ENABLED_STATE | IN_READ_WRITE_STATE,
local_name, prefix, document), local_name, prefix, document),
placeholder: DOMRefCell::new(DOMString::new()), placeholder: DomRefCell::new(DOMString::new()),
textinput: DOMRefCell::new(TextInput::new( textinput: DomRefCell::new(TextInput::new(
Lines::Multiple, DOMString::new(), chan, None, None, SelectionDirection::None)), Lines::Multiple, DOMString::new(), chan, None, None, SelectionDirection::None)),
value_changed: Cell::new(false), value_changed: Cell::new(false),
form_owner: Default::default(), form_owner: Default::default(),

View file

@ -2,7 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * 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;
use dom::bindings::codegen::Bindings::KeyboardEventBinding::{KeyboardEventConstants, KeyboardEventMethods}; use dom::bindings::codegen::Bindings::KeyboardEventBinding::{KeyboardEventConstants, KeyboardEventMethods};
use dom::bindings::codegen::Bindings::UIEventBinding::UIEventMethods; use dom::bindings::codegen::Bindings::UIEventBinding::UIEventMethods;
@ -26,8 +26,8 @@ unsafe_no_jsmanaged_fields!(Key);
pub struct KeyboardEvent { pub struct KeyboardEvent {
uievent: UIEvent, uievent: UIEvent,
key: Cell<Option<Key>>, key: Cell<Option<Key>>,
key_string: DOMRefCell<DOMString>, key_string: DomRefCell<DOMString>,
code: DOMRefCell<DOMString>, code: DomRefCell<DOMString>,
location: Cell<u32>, location: Cell<u32>,
ctrl: Cell<bool>, ctrl: Cell<bool>,
alt: Cell<bool>, alt: Cell<bool>,
@ -45,8 +45,8 @@ impl KeyboardEvent {
KeyboardEvent { KeyboardEvent {
uievent: UIEvent::new_inherited(), uievent: UIEvent::new_inherited(),
key: Cell::new(None), key: Cell::new(None),
key_string: DOMRefCell::new(DOMString::new()), key_string: DomRefCell::new(DOMString::new()),
code: DOMRefCell::new(DOMString::new()), code: DomRefCell::new(DOMString::new()),
location: Cell::new(0), location: Cell::new(0),
ctrl: Cell::new(false), ctrl: Cell::new(false),
alt: Cell::new(false), alt: Cell::new(false),

View file

@ -2,7 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * 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::EventListenerBinding::EventListener;
use dom::bindings::codegen::Bindings::EventTargetBinding::EventTargetMethods; use dom::bindings::codegen::Bindings::EventTargetBinding::EventTargetMethods;
use dom::bindings::codegen::Bindings::MediaQueryListBinding::{self, MediaQueryListMethods}; use dom::bindings::codegen::Bindings::MediaQueryListBinding::{self, MediaQueryListMethods};
@ -113,13 +113,13 @@ impl MediaQueryListMethods for MediaQueryList {
#[derive(HeapSizeOf)] #[derive(HeapSizeOf)]
pub struct WeakMediaQueryListVec { pub struct WeakMediaQueryListVec {
cell: DOMRefCell<WeakRefVec<MediaQueryList>>, cell: DomRefCell<WeakRefVec<MediaQueryList>>,
} }
impl WeakMediaQueryListVec { impl WeakMediaQueryListVec {
/// Create a new vector of weak references to MediaQueryList /// Create a new vector of weak references to MediaQueryList
pub fn new() -> Self { pub fn new() -> Self {
WeakMediaQueryListVec { cell: DOMRefCell::new(WeakRefVec::new()) } WeakMediaQueryListVec { cell: DomRefCell::new(WeakRefVec::new()) }
} }
pub fn push(&self, mql: &MediaQueryList) { pub fn push(&self, mql: &MediaQueryList) {

View file

@ -123,7 +123,7 @@
//! //!
//! Reflectors are JavaScript objects, and as such can be freely aliased. As //! Reflectors are JavaScript objects, and as such can be freely aliased. As
//! Rust does not allow mutable aliasing, mutable borrows of DOM objects are //! 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. //! to manage their mutability.
//! //!
//! `Reflector` and `DomObject` //! `Reflector` and `DomObject`

View file

@ -3,7 +3,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use dom::bindings::callback::ExceptionHandling; 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;
use dom::bindings::codegen::Bindings::MutationObserverBinding::MutationCallback; use dom::bindings::codegen::Bindings::MutationObserverBinding::MutationCallback;
use dom::bindings::codegen::Bindings::MutationObserverBinding::MutationObserverBinding::MutationObserverMethods; use dom::bindings::codegen::Bindings::MutationObserverBinding::MutationObserverBinding::MutationObserverMethods;
@ -26,7 +26,7 @@ pub struct MutationObserver {
reflector_: Reflector, reflector_: Reflector,
#[ignore_heap_size_of = "can't measure Rc values"] #[ignore_heap_size_of = "can't measure Rc values"]
callback: Rc<MutationCallback>, callback: Rc<MutationCallback>,
record_queue: DOMRefCell<Vec<Root<MutationRecord>>>, record_queue: DomRefCell<Vec<Root<MutationRecord>>>,
} }
pub enum Mutation<'a> { pub enum Mutation<'a> {
@ -62,7 +62,7 @@ impl MutationObserver {
MutationObserver { MutationObserver {
reflector_: Reflector::new(), reflector_: Reflector::new(),
callback: callback, callback: callback,
record_queue: DOMRefCell::new(vec![]), record_queue: DomRefCell::new(vec![]),
} }
} }

View file

@ -7,7 +7,7 @@
use app_units::Au; use app_units::Au;
use devtools_traits::NodeInfo; use devtools_traits::NodeInfo;
use document_loader::DocumentLoader; 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::CharacterDataBinding::CharacterDataMethods;
use dom::bindings::codegen::Bindings::DocumentBinding::DocumentMethods; use dom::bindings::codegen::Bindings::DocumentBinding::DocumentMethods;
use dom::bindings::codegen::Bindings::ElementBinding::ElementMethods; use dom::bindings::codegen::Bindings::ElementBinding::ElementMethods;
@ -140,7 +140,7 @@ pub struct Node {
style_and_layout_data: Cell<Option<OpaqueStyleAndLayoutData>>, style_and_layout_data: Cell<Option<OpaqueStyleAndLayoutData>>,
/// Registered observers for this node. /// Registered observers for this node.
mutation_observers: DOMRefCell<Vec<RegisteredObserver>>, mutation_observers: DomRefCell<Vec<RegisteredObserver>>,
unique_id: UniqueId, unique_id: UniqueId,
} }

View file

@ -3,7 +3,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use dom::bindings::callback::CallbackContainer; 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;
use dom::bindings::codegen::Bindings::PaintWorkletGlobalScopeBinding::PaintWorkletGlobalScopeMethods; use dom::bindings::codegen::Bindings::PaintWorkletGlobalScopeBinding::PaintWorkletGlobalScopeMethods;
use dom::bindings::codegen::Bindings::VoidFunctionBinding::VoidFunction; use dom::bindings::codegen::Bindings::VoidFunctionBinding::VoidFunction;
@ -71,21 +71,21 @@ pub struct PaintWorkletGlobalScope {
#[ignore_heap_size_of = "Arc"] #[ignore_heap_size_of = "Arc"]
image_cache: Arc<ImageCache>, image_cache: Arc<ImageCache>,
/// https://drafts.css-houdini.org/css-paint-api/#paint-definitions /// https://drafts.css-houdini.org/css-paint-api/#paint-definitions
paint_definitions: DOMRefCell<HashMap<Atom, Box<PaintDefinition>>>, paint_definitions: DomRefCell<HashMap<Atom, Box<PaintDefinition>>>,
/// https://drafts.css-houdini.org/css-paint-api/#paint-class-instances /// https://drafts.css-houdini.org/css-paint-api/#paint-class-instances
paint_class_instances: DOMRefCell<HashMap<Atom, Box<Heap<JSVal>>>>, paint_class_instances: DomRefCell<HashMap<Atom, Box<Heap<JSVal>>>>,
/// The most recent name the worklet was called with /// The most recent name the worklet was called with
cached_name: DOMRefCell<Atom>, cached_name: DomRefCell<Atom>,
/// The most recent size the worklet was drawn at /// The most recent size the worklet was drawn at
cached_size: Cell<TypedSize2D<f32, CSSPixel>>, cached_size: Cell<TypedSize2D<f32, CSSPixel>>,
/// The most recent device pixel ratio the worklet was drawn at /// The most recent device pixel ratio the worklet was drawn at
cached_device_pixel_ratio: Cell<ScaleFactor<f32, CSSPixel, DevicePixel>>, cached_device_pixel_ratio: Cell<ScaleFactor<f32, CSSPixel, DevicePixel>>,
/// The most recent properties the worklet was drawn at /// The most recent properties the worklet was drawn at
cached_properties: DOMRefCell<Vec<(Atom, String)>>, cached_properties: DomRefCell<Vec<(Atom, String)>>,
/// The most recent arguments the worklet was drawn at /// The most recent arguments the worklet was drawn at
cached_arguments: DOMRefCell<Vec<String>>, cached_arguments: DomRefCell<Vec<String>>,
/// The most recent result /// The most recent result
cached_result: DOMRefCell<DrawAPaintImageResult>, cached_result: DomRefCell<DrawAPaintImageResult>,
} }
impl PaintWorkletGlobalScope { impl PaintWorkletGlobalScope {
@ -102,12 +102,12 @@ impl PaintWorkletGlobalScope {
image_cache: init.image_cache.clone(), image_cache: init.image_cache.clone(),
paint_definitions: Default::default(), paint_definitions: Default::default(),
paint_class_instances: 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_size: Cell::new(TypedSize2D::zero()),
cached_device_pixel_ratio: Cell::new(ScaleFactor::new(1.0)), cached_device_pixel_ratio: Cell::new(ScaleFactor::new(1.0)),
cached_properties: Default::default(), cached_properties: Default::default(),
cached_arguments: Default::default(), cached_arguments: Default::default(),
cached_result: DOMRefCell::new(DrawAPaintImageResult { cached_result: DomRefCell::new(DrawAPaintImageResult {
width: 0, width: 0,
height: 0, height: 0,
format: PixelFormat::BGRA8, format: PixelFormat::BGRA8,

View file

@ -2,7 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * 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;
use dom::bindings::codegen::Bindings::PerformanceBinding::{DOMHighResTimeStamp, PerformanceMethods}; use dom::bindings::codegen::Bindings::PerformanceBinding::{DOMHighResTimeStamp, PerformanceMethods};
use dom::bindings::codegen::Bindings::PerformanceBinding::PerformanceEntryList as DOMPerformanceEntryList; use dom::bindings::codegen::Bindings::PerformanceBinding::PerformanceEntryList as DOMPerformanceEntryList;
@ -111,8 +111,8 @@ struct PerformanceObserver {
pub struct Performance { pub struct Performance {
reflector_: Reflector, reflector_: Reflector,
timing: Option<Dom<PerformanceTiming>>, timing: Option<Dom<PerformanceTiming>>,
entries: DOMRefCell<PerformanceEntryList>, entries: DomRefCell<PerformanceEntryList>,
observers: DOMRefCell<Vec<PerformanceObserver>>, observers: DomRefCell<Vec<PerformanceObserver>>,
pending_notification_observers_task: Cell<bool>, pending_notification_observers_task: Cell<bool>,
navigation_start_precise: f64, navigation_start_precise: f64,
} }
@ -130,8 +130,8 @@ impl Performance {
} else { } else {
None None
}, },
entries: DOMRefCell::new(PerformanceEntryList::new(Vec::new())), entries: DomRefCell::new(PerformanceEntryList::new(Vec::new())),
observers: DOMRefCell::new(Vec::new()), observers: DomRefCell::new(Vec::new()),
pending_notification_observers_task: Cell::new(false), pending_notification_observers_task: Cell::new(false),
navigation_start_precise, navigation_start_precise,
} }

View file

@ -3,7 +3,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use dom::bindings::callback::ExceptionHandling; 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::PerformanceBinding::PerformanceEntryList as DOMPerformanceEntryList;
use dom::bindings::codegen::Bindings::PerformanceObserverBinding; use dom::bindings::codegen::Bindings::PerformanceObserverBinding;
use dom::bindings::codegen::Bindings::PerformanceObserverBinding::PerformanceObserverCallback; use dom::bindings::codegen::Bindings::PerformanceObserverBinding::PerformanceObserverCallback;
@ -34,12 +34,12 @@ pub struct PerformanceObserver {
reflector_: Reflector, reflector_: Reflector,
#[ignore_heap_size_of = "can't measure Rc values"] #[ignore_heap_size_of = "can't measure Rc values"]
callback: Rc<PerformanceObserverCallback>, callback: Rc<PerformanceObserverCallback>,
entries: DOMRefCell<DOMPerformanceEntryList>, entries: DomRefCell<DOMPerformanceEntryList>,
} }
impl PerformanceObserver { impl PerformanceObserver {
fn new_inherited(callback: Rc<PerformanceObserverCallback>, fn new_inherited(callback: Rc<PerformanceObserverCallback>,
entries: DOMRefCell<DOMPerformanceEntryList>) entries: DomRefCell<DOMPerformanceEntryList>)
-> PerformanceObserver { -> PerformanceObserver {
PerformanceObserver { PerformanceObserver {
reflector_: Reflector::new(), reflector_: Reflector::new(),
@ -53,7 +53,7 @@ impl PerformanceObserver {
callback: Rc<PerformanceObserverCallback>, callback: Rc<PerformanceObserverCallback>,
entries: DOMPerformanceEntryList) entries: DOMPerformanceEntryList)
-> Root<PerformanceObserver> { -> Root<PerformanceObserver> {
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) reflect_dom_object(box observer, global, PerformanceObserverBinding::Wrap)
} }

View file

@ -2,7 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * 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;
use dom::bindings::codegen::Bindings::PerformanceObserverEntryListBinding::PerformanceObserverEntryListMethods; use dom::bindings::codegen::Bindings::PerformanceObserverEntryListBinding::PerformanceObserverEntryListMethods;
use dom::bindings::reflector::{Reflector, reflect_dom_object}; use dom::bindings::reflector::{Reflector, reflect_dom_object};
@ -16,14 +16,14 @@ use dom_struct::dom_struct;
#[dom_struct] #[dom_struct]
pub struct PerformanceObserverEntryList { pub struct PerformanceObserverEntryList {
reflector_: Reflector, reflector_: Reflector,
entries: DOMRefCell<PerformanceEntryList>, entries: DomRefCell<PerformanceEntryList>,
} }
impl PerformanceObserverEntryList { impl PerformanceObserverEntryList {
fn new_inherited(entries: PerformanceEntryList) -> PerformanceObserverEntryList { fn new_inherited(entries: PerformanceEntryList) -> PerformanceObserverEntryList {
PerformanceObserverEntryList { PerformanceObserverEntryList {
reflector_: Reflector::new(), reflector_: Reflector::new(),
entries: DOMRefCell::new(entries), entries: DomRefCell::new(entries),
} }
} }

View file

@ -3,7 +3,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use body::{BodyOperations, BodyType, consume_body}; 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::HeadersBinding::{HeadersInit, HeadersMethods};
use dom::bindings::codegen::Bindings::RequestBinding; use dom::bindings::codegen::Bindings::RequestBinding;
use dom::bindings::codegen::Bindings::RequestBinding::ReferrerPolicy; use dom::bindings::codegen::Bindings::RequestBinding::ReferrerPolicy;
@ -44,12 +44,12 @@ use std::rc::Rc;
#[dom_struct] #[dom_struct]
pub struct Request { pub struct Request {
reflector_: Reflector, reflector_: Reflector,
request: DOMRefCell<NetTraitsRequest>, request: DomRefCell<NetTraitsRequest>,
body_used: Cell<bool>, body_used: Cell<bool>,
headers: MutNullableDom<Headers>, headers: MutNullableDom<Headers>,
mime_type: DOMRefCell<Vec<u8>>, mime_type: DomRefCell<Vec<u8>>,
#[ignore_heap_size_of = "Rc"] #[ignore_heap_size_of = "Rc"]
body_promise: DOMRefCell<Option<(Rc<Promise>, BodyType)>>, body_promise: DomRefCell<Option<(Rc<Promise>, BodyType)>>,
} }
impl Request { impl Request {
@ -57,12 +57,12 @@ impl Request {
url: ServoUrl) -> Request { url: ServoUrl) -> Request {
Request { Request {
reflector_: Reflector::new(), reflector_: Reflector::new(),
request: DOMRefCell::new( request: DomRefCell::new(
net_request_from_global(global, url)), net_request_from_global(global, url)),
body_used: Cell::new(false), body_used: Cell::new(false),
headers: Default::default(), headers: Default::default(),
mime_type: DOMRefCell::new("".to_string().into_bytes()), mime_type: DomRefCell::new("".to_string().into_bytes()),
body_promise: DOMRefCell::new(None), body_promise: DomRefCell::new(None),
} }
} }

View file

@ -4,7 +4,7 @@
use body::{BodyOperations, BodyType, consume_body, consume_body_with_promise}; use body::{BodyOperations, BodyType, consume_body, consume_body_with_promise};
use core::cell::Cell; 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::HeadersBinding::{HeadersInit, HeadersMethods};
use dom::bindings::codegen::Bindings::ResponseBinding; use dom::bindings::codegen::Bindings::ResponseBinding;
use dom::bindings::codegen::Bindings::ResponseBinding::{ResponseMethods, ResponseType as DOMResponseType}; use dom::bindings::codegen::Bindings::ResponseBinding::{ResponseMethods, ResponseType as DOMResponseType};
@ -34,19 +34,19 @@ use url::Position;
pub struct Response { pub struct Response {
reflector_: Reflector, reflector_: Reflector,
headers_reflector: MutNullableDom<Headers>, headers_reflector: MutNullableDom<Headers>,
mime_type: DOMRefCell<Vec<u8>>, mime_type: DomRefCell<Vec<u8>>,
body_used: Cell<bool>, body_used: Cell<bool>,
/// `None` can be considered a StatusCode of `0`. /// `None` can be considered a StatusCode of `0`.
#[ignore_heap_size_of = "Defined in hyper"] #[ignore_heap_size_of = "Defined in hyper"]
status: DOMRefCell<Option<StatusCode>>, status: DomRefCell<Option<StatusCode>>,
raw_status: DOMRefCell<Option<(u16, Vec<u8>)>>, raw_status: DomRefCell<Option<(u16, Vec<u8>)>>,
response_type: DOMRefCell<DOMResponseType>, response_type: DomRefCell<DOMResponseType>,
url: DOMRefCell<Option<ServoUrl>>, url: DomRefCell<Option<ServoUrl>>,
url_list: DOMRefCell<Vec<ServoUrl>>, url_list: DomRefCell<Vec<ServoUrl>>,
// For now use the existing NetTraitsResponseBody enum // For now use the existing NetTraitsResponseBody enum
body: DOMRefCell<NetTraitsResponseBody>, body: DomRefCell<NetTraitsResponseBody>,
#[ignore_heap_size_of = "Rc"] #[ignore_heap_size_of = "Rc"]
body_promise: DOMRefCell<Option<(Rc<Promise>, BodyType)>>, body_promise: DomRefCell<Option<(Rc<Promise>, BodyType)>>,
} }
impl Response { impl Response {
@ -54,15 +54,15 @@ impl Response {
Response { Response {
reflector_: Reflector::new(), reflector_: Reflector::new(),
headers_reflector: Default::default(), 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), body_used: Cell::new(false),
status: DOMRefCell::new(Some(StatusCode::Ok)), status: DomRefCell::new(Some(StatusCode::Ok)),
raw_status: DOMRefCell::new(Some((200, b"OK".to_vec()))), raw_status: DomRefCell::new(Some((200, b"OK".to_vec()))),
response_type: DOMRefCell::new(DOMResponseType::Default), response_type: DomRefCell::new(DOMResponseType::Default),
url: DOMRefCell::new(None), url: DomRefCell::new(None),
url_list: DOMRefCell::new(vec![]), url_list: DomRefCell::new(vec![]),
body: DOMRefCell::new(NetTraitsResponseBody::Empty), body: DomRefCell::new(NetTraitsResponseBody::Empty),
body_promise: DOMRefCell::new(None), body_promise: DomRefCell::new(None),
} }
} }

View file

@ -3,7 +3,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use dom::abstractworker::SimpleWorkerErrorHandler; 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::codegen::Bindings::ServiceWorkerBinding::{ServiceWorkerMethods, ServiceWorkerState, Wrap};
use dom::bindings::error::{ErrorResult, Error}; use dom::bindings::error::{ErrorResult, Error};
use dom::bindings::inheritance::Castable; use dom::bindings::inheritance::Castable;
@ -26,7 +26,7 @@ pub type TrustedServiceWorkerAddress = Trusted<ServiceWorker>;
#[dom_struct] #[dom_struct]
pub struct ServiceWorker { pub struct ServiceWorker {
eventtarget: EventTarget, eventtarget: EventTarget,
script_url: DOMRefCell<String>, script_url: DomRefCell<String>,
scope_url: ServoUrl, scope_url: ServoUrl,
state: Cell<ServiceWorkerState>, state: Cell<ServiceWorkerState>,
skip_waiting: Cell<bool> skip_waiting: Cell<bool>
@ -38,7 +38,7 @@ impl ServiceWorker {
scope_url: ServoUrl) -> ServiceWorker { scope_url: ServoUrl) -> ServiceWorker {
ServiceWorker { ServiceWorker {
eventtarget: EventTarget::new_inherited(), 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), state: Cell::new(ServiceWorkerState::Installing),
scope_url: scope_url, scope_url: scope_url,
skip_waiting: Cell::new(skip_waiting) skip_waiting: Cell::new(skip_waiting)

View file

@ -3,7 +3,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use document_loader::{DocumentLoader, LoadType}; 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::DocumentBinding::{DocumentMethods, DocumentReadyState};
use dom::bindings::codegen::Bindings::HTMLImageElementBinding::HTMLImageElementMethods; use dom::bindings::codegen::Bindings::HTMLImageElementBinding::HTMLImageElementMethods;
use dom::bindings::codegen::Bindings::HTMLTemplateElementBinding::HTMLTemplateElementMethods; use dom::bindings::codegen::Bindings::HTMLTemplateElementBinding::HTMLTemplateElementMethods;
@ -75,15 +75,15 @@ pub struct ServoParser {
document: Dom<Document>, document: Dom<Document>,
/// Input received from network. /// Input received from network.
#[ignore_heap_size_of = "Defined in html5ever"] #[ignore_heap_size_of = "Defined in html5ever"]
network_input: DOMRefCell<BufferQueue>, network_input: DomRefCell<BufferQueue>,
/// Part of an UTF-8 code point spanning input chunks /// Part of an UTF-8 code point spanning input chunks
#[ignore_heap_size_of = "Defined in html5ever"] #[ignore_heap_size_of = "Defined in html5ever"]
incomplete_utf8: DOMRefCell<Option<IncompleteUtf8>>, incomplete_utf8: DomRefCell<Option<IncompleteUtf8>>,
/// Input received from script. Used only to support document.write(). /// Input received from script. Used only to support document.write().
#[ignore_heap_size_of = "Defined in html5ever"] #[ignore_heap_size_of = "Defined in html5ever"]
script_input: DOMRefCell<BufferQueue>, script_input: DomRefCell<BufferQueue>,
/// The tokenizer of this parser. /// The tokenizer of this parser.
tokenizer: DOMRefCell<Tokenizer>, tokenizer: DomRefCell<Tokenizer>,
/// Whether to expect any further input from the associated network request. /// Whether to expect any further input from the associated network request.
last_chunk_received: Cell<bool>, last_chunk_received: Cell<bool>,
/// Whether this parser should avoid passing any further data to the tokenizer. /// Whether this parser should avoid passing any further data to the tokenizer.
@ -320,10 +320,10 @@ impl ServoParser {
ServoParser { ServoParser {
reflector: Reflector::new(), reflector: Reflector::new(),
document: Dom::from_ref(document), document: Dom::from_ref(document),
incomplete_utf8: DOMRefCell::new(None), incomplete_utf8: DomRefCell::new(None),
network_input: DOMRefCell::new(BufferQueue::new()), network_input: DomRefCell::new(BufferQueue::new()),
script_input: DOMRefCell::new(BufferQueue::new()), script_input: DomRefCell::new(BufferQueue::new()),
tokenizer: DOMRefCell::new(tokenizer), tokenizer: DomRefCell::new(tokenizer),
last_chunk_received: Cell::new(last_chunk_state == LastChunkState::Received), last_chunk_received: Cell::new(last_chunk_state == LastChunkState::Received),
suspended: Default::default(), suspended: Default::default(),
script_nesting_level: Default::default(), script_nesting_level: Default::default(),

View file

@ -4,7 +4,7 @@
// check-tidy: no specs after this line // 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::codegen::Bindings::TestBindingIterableBinding::{self, TestBindingIterableMethods};
use dom::bindings::error::Fallible; use dom::bindings::error::Fallible;
use dom::bindings::reflector::{Reflector, reflect_dom_object}; use dom::bindings::reflector::{Reflector, reflect_dom_object};
@ -16,14 +16,14 @@ use dom_struct::dom_struct;
#[dom_struct] #[dom_struct]
pub struct TestBindingIterable { pub struct TestBindingIterable {
reflector: Reflector, reflector: Reflector,
vals: DOMRefCell<Vec<DOMString>>, vals: DomRefCell<Vec<DOMString>>,
} }
impl TestBindingIterable { impl TestBindingIterable {
fn new(global: &GlobalScope) -> Root<TestBindingIterable> { fn new(global: &GlobalScope) -> Root<TestBindingIterable> {
reflect_dom_object(box TestBindingIterable { reflect_dom_object(box TestBindingIterable {
reflector: Reflector::new(), reflector: Reflector::new(),
vals: DOMRefCell::new(vec![]), vals: DomRefCell::new(vec![]),
}, global, TestBindingIterableBinding::Wrap) }, global, TestBindingIterableBinding::Wrap)
} }

View file

@ -4,7 +4,7 @@
// check-tidy: no specs after this line // 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;
use dom::bindings::codegen::Bindings::TestBindingPairIterableBinding::TestBindingPairIterableMethods; use dom::bindings::codegen::Bindings::TestBindingPairIterableBinding::TestBindingPairIterableMethods;
use dom::bindings::error::Fallible; use dom::bindings::error::Fallible;
@ -18,7 +18,7 @@ use dom_struct::dom_struct;
#[dom_struct] #[dom_struct]
pub struct TestBindingPairIterable { pub struct TestBindingPairIterable {
reflector: Reflector, reflector: Reflector,
map: DOMRefCell<Vec<(DOMString, u32)>>, map: DomRefCell<Vec<(DOMString, u32)>>,
} }
impl Iterable for TestBindingPairIterable { impl Iterable for TestBindingPairIterable {
@ -39,7 +39,7 @@ impl TestBindingPairIterable {
fn new(global: &GlobalScope) -> Root<TestBindingPairIterable> { fn new(global: &GlobalScope) -> Root<TestBindingPairIterable> {
reflect_dom_object(box TestBindingPairIterable { reflect_dom_object(box TestBindingPairIterable {
reflector: Reflector::new(), reflector: Reflector::new(),
map: DOMRefCell::new(vec![]), map: DomRefCell::new(vec![]),
}, global, TestBindingPairIterableBinding::TestBindingPairIterableWrap) }, global, TestBindingPairIterableBinding::TestBindingPairIterableWrap)
} }

View file

@ -2,7 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * 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;
use dom::bindings::codegen::Bindings::TestWorkletGlobalScopeBinding::TestWorkletGlobalScopeMethods; use dom::bindings::codegen::Bindings::TestWorkletGlobalScopeBinding::TestWorkletGlobalScopeMethods;
use dom::bindings::root::Root; use dom::bindings::root::Root;
@ -24,7 +24,7 @@ pub struct TestWorkletGlobalScope {
// The worklet global for this object // The worklet global for this object
worklet_global: WorkletGlobalScope, worklet_global: WorkletGlobalScope,
// The key/value pairs // The key/value pairs
lookup_table: DOMRefCell<HashMap<String, String>>, lookup_table: DomRefCell<HashMap<String, String>>,
} }
impl TestWorkletGlobalScope { impl TestWorkletGlobalScope {

View file

@ -2,7 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * 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::codegen::Bindings::URLBinding::{self, URLMethods};
use dom::bindings::error::{Error, ErrorResult, Fallible}; use dom::bindings::error::{Error, ErrorResult, Fallible};
use dom::bindings::reflector::{DomObject, Reflector, reflect_dom_object}; use dom::bindings::reflector::{DomObject, Reflector, reflect_dom_object};
@ -27,7 +27,7 @@ pub struct URL {
reflector_: Reflector, reflector_: Reflector,
// https://url.spec.whatwg.org/#concept-url-url // https://url.spec.whatwg.org/#concept-url-url
url: DOMRefCell<ServoUrl>, url: DomRefCell<ServoUrl>,
// https://url.spec.whatwg.org/#dom-url-searchparams // https://url.spec.whatwg.org/#dom-url-searchparams
search_params: MutNullableDom<URLSearchParams>, search_params: MutNullableDom<URLSearchParams>,
@ -37,7 +37,7 @@ impl URL {
fn new_inherited(url: ServoUrl) -> URL { fn new_inherited(url: ServoUrl) -> URL {
URL { URL {
reflector_: Reflector::new(), reflector_: Reflector::new(),
url: DOMRefCell::new(url), url: DomRefCell::new(url),
search_params: Default::default(), search_params: Default::default(),
} }
} }

View file

@ -2,7 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * 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::URLSearchParamsMethods;
use dom::bindings::codegen::Bindings::URLSearchParamsBinding::URLSearchParamsWrap; use dom::bindings::codegen::Bindings::URLSearchParamsBinding::URLSearchParamsWrap;
use dom::bindings::codegen::UnionTypes::USVStringOrURLSearchParams; use dom::bindings::codegen::UnionTypes::USVStringOrURLSearchParams;
@ -23,7 +23,7 @@ use url::form_urlencoded;
pub struct URLSearchParams { pub struct URLSearchParams {
reflector_: Reflector, reflector_: Reflector,
// https://url.spec.whatwg.org/#concept-urlsearchparams-list // https://url.spec.whatwg.org/#concept-urlsearchparams-list
list: DOMRefCell<Vec<(String, String)>>, list: DomRefCell<Vec<(String, String)>>,
// https://url.spec.whatwg.org/#concept-urlsearchparams-url-object // https://url.spec.whatwg.org/#concept-urlsearchparams-url-object
url: MutableWeakRef<URL>, url: MutableWeakRef<URL>,
} }
@ -32,7 +32,7 @@ impl URLSearchParams {
fn new_inherited(url: Option<&URL>) -> URLSearchParams { fn new_inherited(url: Option<&URL>) -> URLSearchParams {
URLSearchParams { URLSearchParams {
reflector_: Reflector::new(), 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), url: MutableWeakRef::new(url),
} }
} }

View file

@ -2,7 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * 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;
use dom::bindings::codegen::Bindings::VRBinding::VRMethods; use dom::bindings::codegen::Bindings::VRBinding::VRMethods;
use dom::bindings::codegen::Bindings::VRDisplayBinding::VRDisplayMethods; use dom::bindings::codegen::Bindings::VRDisplayBinding::VRDisplayMethods;
@ -28,16 +28,16 @@ use webvr_traits::{WebVRGamepadData, WebVRGamepadEvent, WebVRGamepadState};
#[dom_struct] #[dom_struct]
pub struct VR { pub struct VR {
reflector_: Reflector, reflector_: Reflector,
displays: DOMRefCell<Vec<Dom<VRDisplay>>>, displays: DomRefCell<Vec<Dom<VRDisplay>>>,
gamepads: DOMRefCell<Vec<Dom<Gamepad>>> gamepads: DomRefCell<Vec<Dom<Gamepad>>>
} }
impl VR { impl VR {
fn new_inherited() -> VR { fn new_inherited() -> VR {
VR { VR {
reflector_: Reflector::new(), reflector_: Reflector::new(),
displays: DOMRefCell::new(Vec::new()), displays: DomRefCell::new(Vec::new()),
gamepads: DOMRefCell::new(Vec::new()), gamepads: DomRefCell::new(Vec::new()),
} }
} }

View file

@ -5,7 +5,7 @@
use canvas_traits::webgl::{webgl_channel, WebGLReceiver, WebVRCommand}; use canvas_traits::webgl::{webgl_channel, WebGLReceiver, WebVRCommand};
use core::ops::Deref; use core::ops::Deref;
use dom::bindings::callback::ExceptionHandling; 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::PerformanceBinding::PerformanceBinding::PerformanceMethods;
use dom::bindings::codegen::Bindings::VRDisplayBinding; use dom::bindings::codegen::Bindings::VRDisplayBinding;
use dom::bindings::codegen::Bindings::VRDisplayBinding::VRDisplayMethods; use dom::bindings::codegen::Bindings::VRDisplayBinding::VRDisplayMethods;
@ -47,7 +47,7 @@ use webvr_traits::{WebVRDisplayData, WebVRDisplayEvent, WebVRFrameData, WebVRLay
pub struct VRDisplay { pub struct VRDisplay {
eventtarget: EventTarget, eventtarget: EventTarget,
#[ignore_heap_size_of = "Defined in rust-webvr"] #[ignore_heap_size_of = "Defined in rust-webvr"]
display: DOMRefCell<WebVRDisplayData>, display: DomRefCell<WebVRDisplayData>,
depth_near: Cell<f64>, depth_near: Cell<f64>,
depth_far: Cell<f64>, depth_far: Cell<f64>,
presenting: Cell<bool>, presenting: Cell<bool>,
@ -56,19 +56,19 @@ pub struct VRDisplay {
capabilities: MutDom<VRDisplayCapabilities>, capabilities: MutDom<VRDisplayCapabilities>,
stage_params: MutNullableDom<VRStageParameters>, stage_params: MutNullableDom<VRStageParameters>,
#[ignore_heap_size_of = "Defined in rust-webvr"] #[ignore_heap_size_of = "Defined in rust-webvr"]
frame_data: DOMRefCell<WebVRFrameData>, frame_data: DomRefCell<WebVRFrameData>,
#[ignore_heap_size_of = "Defined in rust-webvr"] #[ignore_heap_size_of = "Defined in rust-webvr"]
layer: DOMRefCell<WebVRLayer>, layer: DomRefCell<WebVRLayer>,
layer_ctx: MutNullableDom<WebGLRenderingContext>, layer_ctx: MutNullableDom<WebGLRenderingContext>,
#[ignore_heap_size_of = "Defined in rust-webvr"] #[ignore_heap_size_of = "Defined in rust-webvr"]
next_raf_id: Cell<u32>, next_raf_id: Cell<u32>,
/// List of request animation frame callbacks /// List of request animation frame callbacks
#[ignore_heap_size_of = "closures are hard"] #[ignore_heap_size_of = "closures are hard"]
raf_callback_list: DOMRefCell<Vec<(u32, Option<Rc<FrameRequestCallback>>)>>, raf_callback_list: DomRefCell<Vec<(u32, Option<Rc<FrameRequestCallback>>)>>,
// Compositor VRFrameData synchonization // Compositor VRFrameData synchonization
frame_data_status: Cell<VRFrameDataStatus>, frame_data_status: Cell<VRFrameDataStatus>,
#[ignore_heap_size_of = "channels are hard"] #[ignore_heap_size_of = "channels are hard"]
frame_data_receiver: DOMRefCell<Option<WebGLReceiver<Result<Vec<u8>, ()>>>>, frame_data_receiver: DomRefCell<Option<WebGLReceiver<Result<Vec<u8>, ()>>>>,
running_display_raf: Cell<bool>, running_display_raf: Cell<bool>,
paused: Cell<bool>, paused: Cell<bool>,
stopped_on_pause: Cell<bool>, stopped_on_pause: Cell<bool>,
@ -96,7 +96,7 @@ impl VRDisplay {
VRDisplay { VRDisplay {
eventtarget: EventTarget::new_inherited(), eventtarget: EventTarget::new_inherited(),
display: DOMRefCell::new(display.clone()), display: DomRefCell::new(display.clone()),
depth_near: Cell::new(0.01), depth_near: Cell::new(0.01),
depth_far: Cell::new(10000.0), depth_far: Cell::new(10000.0),
presenting: Cell::new(false), presenting: Cell::new(false),
@ -104,13 +104,13 @@ impl VRDisplay {
right_eye_params: MutDom::new(&*VREyeParameters::new(display.right_eye_parameters.clone(), &global)), right_eye_params: MutDom::new(&*VREyeParameters::new(display.right_eye_parameters.clone(), &global)),
capabilities: MutDom::new(&*VRDisplayCapabilities::new(display.capabilities.clone(), &global)), capabilities: MutDom::new(&*VRDisplayCapabilities::new(display.capabilities.clone(), &global)),
stage_params: MutNullableDom::new(stage.as_ref().map(|v| v.deref())), stage_params: MutNullableDom::new(stage.as_ref().map(|v| v.deref())),
frame_data: DOMRefCell::new(Default::default()), frame_data: DomRefCell::new(Default::default()),
layer: DOMRefCell::new(Default::default()), layer: DomRefCell::new(Default::default()),
layer_ctx: MutNullableDom::default(), layer_ctx: MutNullableDom::default(),
next_raf_id: Cell::new(1), 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_status: Cell::new(VRFrameDataStatus::Waiting),
frame_data_receiver: DOMRefCell::new(None), frame_data_receiver: DomRefCell::new(None),
running_display_raf: Cell::new(false), running_display_raf: Cell::new(false),
// Some VR implementations (e.g. Daydream) can be paused in some life cycle situations // Some VR implementations (e.g. Daydream) can be paused in some life cycle situations
// such as showing and hiding the controller pairing screen. // such as showing and hiding the controller pairing screen.

View file

@ -2,7 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * 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;
use dom::bindings::codegen::Bindings::VRDisplayCapabilitiesBinding::VRDisplayCapabilitiesMethods; use dom::bindings::codegen::Bindings::VRDisplayCapabilitiesBinding::VRDisplayCapabilitiesMethods;
use dom::bindings::reflector::{Reflector, reflect_dom_object}; use dom::bindings::reflector::{Reflector, reflect_dom_object};
@ -15,7 +15,7 @@ use webvr_traits::WebVRDisplayCapabilities;
pub struct VRDisplayCapabilities { pub struct VRDisplayCapabilities {
reflector_: Reflector, reflector_: Reflector,
#[ignore_heap_size_of = "Defined in rust-webvr"] #[ignore_heap_size_of = "Defined in rust-webvr"]
capabilities: DOMRefCell<WebVRDisplayCapabilities> capabilities: DomRefCell<WebVRDisplayCapabilities>
} }
unsafe_no_jsmanaged_fields!(WebVRDisplayCapabilities); unsafe_no_jsmanaged_fields!(WebVRDisplayCapabilities);
@ -24,7 +24,7 @@ impl VRDisplayCapabilities {
fn new_inherited(capabilities: WebVRDisplayCapabilities) -> VRDisplayCapabilities { fn new_inherited(capabilities: WebVRDisplayCapabilities) -> VRDisplayCapabilities {
VRDisplayCapabilities { VRDisplayCapabilities {
reflector_: Reflector::new(), reflector_: Reflector::new(),
capabilities: DOMRefCell::new(capabilities) capabilities: DomRefCell::new(capabilities)
} }
} }

View file

@ -3,7 +3,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use core::nonzero::NonZero; 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;
use dom::bindings::codegen::Bindings::VREyeParametersBinding::VREyeParametersMethods; use dom::bindings::codegen::Bindings::VREyeParametersBinding::VREyeParametersMethods;
use dom::bindings::reflector::{Reflector, reflect_dom_object}; use dom::bindings::reflector::{Reflector, reflect_dom_object};
@ -21,7 +21,7 @@ use webvr_traits::WebVREyeParameters;
pub struct VREyeParameters { pub struct VREyeParameters {
reflector_: Reflector, reflector_: Reflector,
#[ignore_heap_size_of = "Defined in rust-webvr"] #[ignore_heap_size_of = "Defined in rust-webvr"]
parameters: DOMRefCell<WebVREyeParameters>, parameters: DomRefCell<WebVREyeParameters>,
offset: Heap<*mut JSObject>, offset: Heap<*mut JSObject>,
fov: Dom<VRFieldOfView>, fov: Dom<VRFieldOfView>,
} }
@ -32,7 +32,7 @@ impl VREyeParameters {
fn new_inherited(parameters: WebVREyeParameters, fov: &VRFieldOfView) -> VREyeParameters { fn new_inherited(parameters: WebVREyeParameters, fov: &VRFieldOfView) -> VREyeParameters {
VREyeParameters { VREyeParameters {
reflector_: Reflector::new(), reflector_: Reflector::new(),
parameters: DOMRefCell::new(parameters), parameters: DomRefCell::new(parameters),
offset: Heap::default(), offset: Heap::default(),
fov: Dom::from_ref(&*fov) fov: Dom::from_ref(&*fov)
} }

View file

@ -2,7 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * 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;
use dom::bindings::codegen::Bindings::VRFieldOfViewBinding::VRFieldOfViewMethods; use dom::bindings::codegen::Bindings::VRFieldOfViewBinding::VRFieldOfViewMethods;
use dom::bindings::num::Finite; use dom::bindings::num::Finite;
@ -16,7 +16,7 @@ use webvr_traits::WebVRFieldOfView;
pub struct VRFieldOfView { pub struct VRFieldOfView {
reflector_: Reflector, reflector_: Reflector,
#[ignore_heap_size_of = "Defined in rust-webvr"] #[ignore_heap_size_of = "Defined in rust-webvr"]
fov: DOMRefCell<WebVRFieldOfView> fov: DomRefCell<WebVRFieldOfView>
} }
unsafe_no_jsmanaged_fields!(WebVRFieldOfView); unsafe_no_jsmanaged_fields!(WebVRFieldOfView);
@ -25,7 +25,7 @@ impl VRFieldOfView {
fn new_inherited(fov: WebVRFieldOfView) -> VRFieldOfView { fn new_inherited(fov: WebVRFieldOfView) -> VRFieldOfView {
VRFieldOfView { VRFieldOfView {
reflector_: Reflector::new(), reflector_: Reflector::new(),
fov: DOMRefCell::new(fov) fov: DomRefCell::new(fov)
} }
} }

View file

@ -3,7 +3,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use core::nonzero::NonZero; 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;
use dom::bindings::codegen::Bindings::VRStageParametersBinding::VRStageParametersMethods; use dom::bindings::codegen::Bindings::VRStageParametersBinding::VRStageParametersMethods;
use dom::bindings::num::Finite; use dom::bindings::num::Finite;
@ -20,7 +20,7 @@ use webvr_traits::WebVRStageParameters;
pub struct VRStageParameters { pub struct VRStageParameters {
reflector_: Reflector, reflector_: Reflector,
#[ignore_heap_size_of = "Defined in rust-webvr"] #[ignore_heap_size_of = "Defined in rust-webvr"]
parameters: DOMRefCell<WebVRStageParameters>, parameters: DomRefCell<WebVRStageParameters>,
transform: Heap<*mut JSObject>, transform: Heap<*mut JSObject>,
} }
@ -30,7 +30,7 @@ impl VRStageParameters {
fn new_inherited(parameters: WebVRStageParameters) -> VRStageParameters { fn new_inherited(parameters: WebVRStageParameters) -> VRStageParameters {
VRStageParameters { VRStageParameters {
reflector_: Reflector::new(), reflector_: Reflector::new(),
parameters: DOMRefCell::new(parameters), parameters: DomRefCell::new(parameters),
transform: Heap::default() transform: Heap::default()
} }
} }

View file

@ -5,7 +5,7 @@
use canvas_traits::webgl::WebGLVertexArrayId; use canvas_traits::webgl::WebGLVertexArrayId;
use core::cell::Ref; use core::cell::Ref;
use core::iter::FromIterator; use core::iter::FromIterator;
use dom::bindings::cell::DOMRefCell; use dom::bindings::cell::DomRefCell;
use dom::bindings::codegen::Bindings::WebGLVertexArrayObjectOESBinding; use dom::bindings::codegen::Bindings::WebGLVertexArrayObjectOESBinding;
use dom::bindings::reflector::reflect_dom_object; use dom::bindings::reflector::reflect_dom_object;
use dom::bindings::root::{Dom, MutNullableDom, Root}; use dom::bindings::root::{Dom, MutNullableDom, Root};
@ -22,7 +22,7 @@ pub struct WebGLVertexArrayObjectOES {
id: WebGLVertexArrayId, id: WebGLVertexArrayId,
ever_bound: Cell<bool>, ever_bound: Cell<bool>,
is_deleted: Cell<bool>, is_deleted: Cell<bool>,
bound_attrib_buffers: DOMRefCell<HashMap<u32, Dom<WebGLBuffer>>>, bound_attrib_buffers: DomRefCell<HashMap<u32, Dom<WebGLBuffer>>>,
bound_buffer_element_array: MutNullableDom<WebGLBuffer>, bound_buffer_element_array: MutNullableDom<WebGLBuffer>,
} }
@ -33,7 +33,7 @@ impl WebGLVertexArrayObjectOES {
id: id, id: id,
ever_bound: Cell::new(false), ever_bound: Cell::new(false),
is_deleted: 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), bound_buffer_element_array: MutNullableDom::new(None),
} }
} }

View file

@ -5,7 +5,7 @@
use canvas_traits::webgl::WebGLError; use canvas_traits::webgl::WebGLError;
use core::iter::FromIterator; use core::iter::FromIterator;
use core::nonzero::NonZero; 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::OESStandardDerivativesBinding::OESStandardDerivativesConstants;
use dom::bindings::codegen::Bindings::OESTextureHalfFloatBinding::OESTextureHalfFloatConstants; use dom::bindings::codegen::Bindings::OESTextureHalfFloatBinding::OESTextureHalfFloatConstants;
use dom::bindings::codegen::Bindings::WebGLRenderingContextBinding::WebGLRenderingContextConstants as constants; use dom::bindings::codegen::Bindings::WebGLRenderingContextBinding::WebGLRenderingContextConstants as constants;
@ -76,15 +76,15 @@ impl Default for WebGLExtensionFeatures {
#[must_root] #[must_root]
#[derive(HeapSizeOf, JSTraceable)] #[derive(HeapSizeOf, JSTraceable)]
pub struct WebGLExtensions { pub struct WebGLExtensions {
extensions: DOMRefCell<HashMap<String, Box<WebGLExtensionWrapper>>>, extensions: DomRefCell<HashMap<String, Box<WebGLExtensionWrapper>>>,
features: DOMRefCell<WebGLExtensionFeatures>, features: DomRefCell<WebGLExtensionFeatures>,
} }
impl WebGLExtensions { impl WebGLExtensions {
pub fn new() -> WebGLExtensions { pub fn new() -> WebGLExtensions {
Self { Self {
extensions: DOMRefCell::new(HashMap::new()), extensions: DomRefCell::new(HashMap::new()),
features: DOMRefCell::new(Default::default()) features: DomRefCell::new(Default::default())
} }
} }

View file

@ -5,7 +5,7 @@
// https://www.khronos.org/registry/webgl/specs/latest/1.0/webgl.idl // 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::{WebGLBufferId, WebGLCommand, WebGLError, WebGLMsgSender, WebGLResult, WebGLVertexArrayId};
use canvas_traits::webgl::webgl_channel; 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::codegen::Bindings::WebGLBufferBinding;
use dom::bindings::reflector::reflect_dom_object; use dom::bindings::reflector::reflect_dom_object;
use dom::bindings::root::Root; use dom::bindings::root::Root;
@ -25,7 +25,7 @@ pub struct WebGLBuffer {
capacity: Cell<usize>, capacity: Cell<usize>,
is_deleted: Cell<bool>, is_deleted: Cell<bool>,
// The Vertex Array Objects that are referencing this buffer // The Vertex Array Objects that are referencing this buffer
vao_references: DOMRefCell<Option<HashSet<WebGLVertexArrayId>>>, vao_references: DomRefCell<Option<HashSet<WebGLVertexArrayId>>>,
pending_delete: Cell<bool>, pending_delete: Cell<bool>,
#[ignore_heap_size_of = "Defined in ipc-channel"] #[ignore_heap_size_of = "Defined in ipc-channel"]
renderer: WebGLMsgSender, renderer: WebGLMsgSender,
@ -41,7 +41,7 @@ impl WebGLBuffer {
target: Cell::new(None), target: Cell::new(None),
capacity: Cell::new(0), capacity: Cell::new(0),
is_deleted: Cell::new(false), is_deleted: Cell::new(false),
vao_references: DOMRefCell::new(None), vao_references: DomRefCell::new(None),
pending_delete: Cell::new(false), pending_delete: Cell::new(false),
renderer: renderer, renderer: renderer,
} }

View file

@ -6,7 +6,7 @@
use canvas_traits::webgl::{WebGLCommand, WebGLFramebufferBindingRequest, WebGLFramebufferId}; use canvas_traits::webgl::{WebGLCommand, WebGLFramebufferBindingRequest, WebGLFramebufferId};
use canvas_traits::webgl::{WebGLMsgSender, WebGLResult, WebGLError}; use canvas_traits::webgl::{WebGLMsgSender, WebGLResult, WebGLError};
use canvas_traits::webgl::webgl_channel; 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::WebGLFramebufferBinding;
use dom::bindings::codegen::Bindings::WebGLRenderingContextBinding::WebGLRenderingContextConstants as constants; use dom::bindings::codegen::Bindings::WebGLRenderingContextBinding::WebGLRenderingContextConstants as constants;
use dom::bindings::reflector::reflect_dom_object; use dom::bindings::reflector::reflect_dom_object;
@ -39,10 +39,10 @@ pub struct WebGLFramebuffer {
// The attachment points for textures and renderbuffers on this // The attachment points for textures and renderbuffers on this
// FBO. // FBO.
color: DOMRefCell<Option<WebGLFramebufferAttachment>>, color: DomRefCell<Option<WebGLFramebufferAttachment>>,
depth: DOMRefCell<Option<WebGLFramebufferAttachment>>, depth: DomRefCell<Option<WebGLFramebufferAttachment>>,
stencil: DOMRefCell<Option<WebGLFramebufferAttachment>>, stencil: DomRefCell<Option<WebGLFramebufferAttachment>>,
depthstencil: DOMRefCell<Option<WebGLFramebufferAttachment>>, depthstencil: DomRefCell<Option<WebGLFramebufferAttachment>>,
} }
impl WebGLFramebuffer { impl WebGLFramebuffer {
@ -57,10 +57,10 @@ impl WebGLFramebuffer {
renderer: renderer, renderer: renderer,
size: Cell::new(None), size: Cell::new(None),
status: Cell::new(constants::FRAMEBUFFER_UNSUPPORTED), status: Cell::new(constants::FRAMEBUFFER_UNSUPPORTED),
color: DOMRefCell::new(None), color: DomRefCell::new(None),
depth: DOMRefCell::new(None), depth: DomRefCell::new(None),
stencil: DOMRefCell::new(None), stencil: DomRefCell::new(None),
depthstencil: DOMRefCell::new(None), depthstencil: DomRefCell::new(None),
} }
} }
@ -291,7 +291,7 @@ impl WebGLFramebuffer {
} }
fn with_matching_renderbuffers<F>(&self, rb: &WebGLRenderbuffer, mut closure: F) fn with_matching_renderbuffers<F>(&self, rb: &WebGLRenderbuffer, mut closure: F)
where F: FnMut(&DOMRefCell<Option<WebGLFramebufferAttachment>>) where F: FnMut(&DomRefCell<Option<WebGLFramebufferAttachment>>)
{ {
let attachments = [&self.color, let attachments = [&self.color,
&self.depth, &self.depth,
@ -314,7 +314,7 @@ impl WebGLFramebuffer {
} }
fn with_matching_textures<F>(&self, texture: &WebGLTexture, mut closure: F) fn with_matching_textures<F>(&self, texture: &WebGLTexture, mut closure: F)
where F: FnMut(&DOMRefCell<Option<WebGLFramebufferAttachment>>) where F: FnMut(&DomRefCell<Option<WebGLFramebufferAttachment>>)
{ {
let attachments = [&self.color, let attachments = [&self.color,
&self.depth, &self.depth,

View file

@ -11,7 +11,7 @@ use canvas_traits::webgl::webgl_channel;
use core::cell::Ref; use core::cell::Ref;
use core::iter::FromIterator; use core::iter::FromIterator;
use core::nonzero::NonZero; 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::{self, WebGLContextAttributes};
use dom::bindings::codegen::Bindings::WebGLRenderingContextBinding::WebGLRenderingContextConstants as constants; use dom::bindings::codegen::Bindings::WebGLRenderingContextBinding::WebGLRenderingContextConstants as constants;
use dom::bindings::codegen::Bindings::WebGLRenderingContextBinding::WebGLRenderingContextMethods; use dom::bindings::codegen::Bindings::WebGLRenderingContextBinding::WebGLRenderingContextMethods;
@ -151,7 +151,7 @@ pub struct WebGLRenderingContext {
bound_texture_cube_map: MutNullableDom<WebGLTexture>, bound_texture_cube_map: MutNullableDom<WebGLTexture>,
bound_buffer_array: MutNullableDom<WebGLBuffer>, bound_buffer_array: MutNullableDom<WebGLBuffer>,
bound_buffer_element_array: MutNullableDom<WebGLBuffer>, bound_buffer_element_array: MutNullableDom<WebGLBuffer>,
bound_attrib_buffers: DOMRefCell<FnvHashMap<u32, Dom<WebGLBuffer>>>, bound_attrib_buffers: DomRefCell<FnvHashMap<u32, Dom<WebGLBuffer>>>,
current_program: MutNullableDom<WebGLProgram>, current_program: MutNullableDom<WebGLProgram>,
#[ignore_heap_size_of = "Because it's small"] #[ignore_heap_size_of = "Because it's small"]
current_vertex_attrib_0: Cell<(f32, f32, f32, f32)>, current_vertex_attrib_0: Cell<(f32, f32, f32, f32)>,
@ -194,7 +194,7 @@ impl WebGLRenderingContext {
bound_texture_cube_map: MutNullableDom::new(None), bound_texture_cube_map: MutNullableDom::new(None),
bound_buffer_array: MutNullableDom::new(None), bound_buffer_array: MutNullableDom::new(None),
bound_buffer_element_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), bound_renderbuffer: MutNullableDom::new(None),
current_program: MutNullableDom::new(None), current_program: MutNullableDom::new(None),
current_vertex_attrib_0: Cell::new((0f32, 0f32, 0f32, 1f32)), current_vertex_attrib_0: Cell::new((0f32, 0f32, 0f32, 1f32)),

View file

@ -5,7 +5,7 @@
// https://www.khronos.org/registry/webgl/specs/latest/1.0/webgl.idl // https://www.khronos.org/registry/webgl/specs/latest/1.0/webgl.idl
use angle::hl::{BuiltInResources, Output, ShaderValidator}; use angle::hl::{BuiltInResources, Output, ShaderValidator};
use canvas_traits::webgl::{webgl_channel, WebGLCommand, WebGLMsgSender, WebGLParameter, WebGLResult, WebGLShaderId}; 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::codegen::Bindings::WebGLShaderBinding;
use dom::bindings::reflector::reflect_dom_object; use dom::bindings::reflector::reflect_dom_object;
use dom::bindings::root::Root; use dom::bindings::root::Root;
@ -30,8 +30,8 @@ pub struct WebGLShader {
webgl_object: WebGLObject, webgl_object: WebGLObject,
id: WebGLShaderId, id: WebGLShaderId,
gl_type: u32, gl_type: u32,
source: DOMRefCell<Option<DOMString>>, source: DomRefCell<Option<DOMString>>,
info_log: DOMRefCell<Option<String>>, info_log: DomRefCell<Option<String>>,
is_deleted: Cell<bool>, is_deleted: Cell<bool>,
attached_counter: Cell<u32>, attached_counter: Cell<u32>,
compilation_status: Cell<ShaderCompilationStatus>, compilation_status: Cell<ShaderCompilationStatus>,
@ -57,8 +57,8 @@ impl WebGLShader {
webgl_object: WebGLObject::new_inherited(), webgl_object: WebGLObject::new_inherited(),
id: id, id: id,
gl_type: shader_type, gl_type: shader_type,
source: DOMRefCell::new(None), source: DomRefCell::new(None),
info_log: DOMRefCell::new(None), info_log: DomRefCell::new(None),
is_deleted: Cell::new(false), is_deleted: Cell::new(false),
attached_counter: Cell::new(0), attached_counter: Cell::new(0),
compilation_status: Cell::new(ShaderCompilationStatus::NotCompiled), compilation_status: Cell::new(ShaderCompilationStatus::NotCompiled),

View file

@ -5,7 +5,7 @@
// https://www.khronos.org/registry/webgl/specs/latest/1.0/webgl.idl // https://www.khronos.org/registry/webgl/specs/latest/1.0/webgl.idl
use canvas_traits::webgl::{webgl_channel, WebGLCommand, WebGLError, WebGLMsgSender, WebGLResult, WebGLTextureId}; 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::WebGLRenderingContextBinding::WebGLRenderingContextConstants as constants;
use dom::bindings::codegen::Bindings::WebGLTextureBinding; use dom::bindings::codegen::Bindings::WebGLTextureBinding;
use dom::bindings::reflector::reflect_dom_object; use dom::bindings::reflector::reflect_dom_object;
@ -36,7 +36,7 @@ pub struct WebGLTexture {
is_deleted: Cell<bool>, is_deleted: Cell<bool>,
/// Stores information about mipmap levels and cubemap faces. /// Stores information about mipmap levels and cubemap faces.
#[ignore_heap_size_of = "Arrays are cumbersome"] #[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 can only be 1 or 6
face_count: Cell<u8>, face_count: Cell<u8>,
base_mipmap_level: u32, base_mipmap_level: u32,
@ -60,7 +60,7 @@ impl WebGLTexture {
base_mipmap_level: 0, base_mipmap_level: 0,
min_filter: Cell::new(None), min_filter: Cell::new(None),
mag_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, renderer: renderer,
} }
} }

View file

@ -2,7 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * 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::BlobBinding::BlobMethods;
use dom::bindings::codegen::Bindings::WebSocketBinding; use dom::bindings::codegen::Bindings::WebSocketBinding;
use dom::bindings::codegen::Bindings::WebSocketBinding::{BinaryType, WebSocketMethods}; use dom::bindings::codegen::Bindings::WebSocketBinding::{BinaryType, WebSocketMethods};
@ -105,9 +105,9 @@ pub struct WebSocket {
buffered_amount: Cell<u64>, buffered_amount: Cell<u64>,
clearing_buffer: Cell<bool>, //Flag to tell if there is a running thread to clear buffered_amount clearing_buffer: Cell<bool>, //Flag to tell if there is a running thread to clear buffered_amount
#[ignore_heap_size_of = "Defined in std"] #[ignore_heap_size_of = "Defined in std"]
sender: DOMRefCell<Option<IpcSender<WebSocketDomAction>>>, sender: DomRefCell<Option<IpcSender<WebSocketDomAction>>>,
binary_type: Cell<BinaryType>, binary_type: Cell<BinaryType>,
protocol: DOMRefCell<String>, //Subprotocol selected by server protocol: DomRefCell<String>, //Subprotocol selected by server
} }
impl WebSocket { impl WebSocket {
@ -118,9 +118,9 @@ impl WebSocket {
ready_state: Cell::new(WebSocketRequestState::Connecting), ready_state: Cell::new(WebSocketRequestState::Connecting),
buffered_amount: Cell::new(0), buffered_amount: Cell::new(0),
clearing_buffer: Cell::new(false), clearing_buffer: Cell::new(false),
sender: DOMRefCell::new(None), sender: DomRefCell::new(None),
binary_type: Cell::new(BinaryType::Blob), binary_type: Cell::new(BinaryType::Blob),
protocol: DOMRefCell::new("".to_owned()), protocol: DomRefCell::new("".to_owned()),
} }
} }

View file

@ -8,7 +8,7 @@ use bluetooth_traits::BluetoothRequest;
use canvas_traits::webgl::WebGLChan; use canvas_traits::webgl::WebGLChan;
use cssparser::{Parser, ParserInput}; use cssparser::{Parser, ParserInput};
use devtools_traits::{ScriptToDevtoolsControlMsg, TimelineMarker, TimelineMarkerType}; 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::DocumentBinding::{DocumentMethods, DocumentReadyState};
use dom::bindings::codegen::Bindings::FunctionBinding::Function; use dom::bindings::codegen::Bindings::FunctionBinding::Function;
use dom::bindings::codegen::Bindings::PermissionStatusBinding::PermissionState; use dom::bindings::codegen::Bindings::PermissionStatusBinding::PermissionState;
@ -192,13 +192,13 @@ pub struct Window {
screen: MutNullableDom<Screen>, screen: MutNullableDom<Screen>,
session_storage: MutNullableDom<Storage>, session_storage: MutNullableDom<Storage>,
local_storage: MutNullableDom<Storage>, local_storage: MutNullableDom<Storage>,
status: DOMRefCell<DOMString>, status: DomRefCell<DOMString>,
/// For sending timeline markers. Will be ignored if /// For sending timeline markers. Will be ignored if
/// no devtools server /// no devtools server
devtools_markers: DOMRefCell<HashSet<TimelineMarkerType>>, devtools_markers: DomRefCell<HashSet<TimelineMarkerType>>,
#[ignore_heap_size_of = "channels are hard"] #[ignore_heap_size_of = "channels are hard"]
devtools_marker_sender: DOMRefCell<Option<IpcSender<Option<TimelineMarker>>>>, devtools_marker_sender: DomRefCell<Option<IpcSender<Option<TimelineMarker>>>>,
/// Pending resize event, if any. /// Pending resize event, if any.
resize_event: Cell<Option<(WindowSizeData, WindowSizeType)>>, resize_event: Cell<Option<(WindowSizeData, WindowSizeType)>>,
@ -211,7 +211,7 @@ pub struct Window {
/// The JavaScript runtime. /// The JavaScript runtime.
#[ignore_heap_size_of = "Rc<T> is hard"] #[ignore_heap_size_of = "Rc<T> is hard"]
js_runtime: DOMRefCell<Option<Rc<Runtime>>>, js_runtime: DomRefCell<Option<Rc<Runtime>>>,
/// A handle for communicating messages to the layout thread. /// A handle for communicating messages to the layout thread.
#[ignore_heap_size_of = "channels are hard"] #[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 /// A channel for communicating results of async scripts back to the webdriver server
#[ignore_heap_size_of = "channels are hard"] #[ignore_heap_size_of = "channels are hard"]
webdriver_script_chan: DOMRefCell<Option<IpcSender<WebDriverJSResult>>>, webdriver_script_chan: DomRefCell<Option<IpcSender<WebDriverJSResult>>>,
/// The current state of the window object /// The current state of the window object
current_state: Cell<WindowState>, current_state: Cell<WindowState>,
@ -253,12 +253,12 @@ pub struct Window {
/// A flag to prevent async events from attempting to interact with this window. /// A flag to prevent async events from attempting to interact with this window.
#[ignore_heap_size_of = "defined in std"] #[ignore_heap_size_of = "defined in std"]
ignore_further_async_events: DOMRefCell<Arc<AtomicBool>>, ignore_further_async_events: DomRefCell<Arc<AtomicBool>>,
error_reporter: CSSErrorReporter, error_reporter: CSSErrorReporter,
/// A list of scroll offsets for each scrollable element. /// A list of scroll offsets for each scrollable element.
scroll_offsets: DOMRefCell<HashMap<UntrustedNodeAddress, Vector2D<f32>>>, scroll_offsets: DomRefCell<HashMap<UntrustedNodeAddress, Vector2D<f32>>>,
/// All the MediaQueryLists we need to update /// All the MediaQueryLists we need to update
media_query_lists: WeakMediaQueryListVec, media_query_lists: WeakMediaQueryListVec,
@ -274,17 +274,17 @@ pub struct Window {
webvr_chan: Option<IpcSender<WebVRMsg>>, webvr_chan: Option<IpcSender<WebVRMsg>>,
/// A map for storing the previous permission state read results. /// A map for storing the previous permission state read results.
permission_state_invocation_results: DOMRefCell<HashMap<String, PermissionState>>, permission_state_invocation_results: DomRefCell<HashMap<String, PermissionState>>,
/// All of the elements that have an outstanding image request that was /// 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 /// 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 /// to ensure that the element can be marked dirty when the image data becomes
/// available at some point in the future. /// available at some point in the future.
pending_layout_images: DOMRefCell<HashMap<PendingImageId, Vec<Dom<Node>>>>, pending_layout_images: DomRefCell<HashMap<PendingImageId, Vec<Dom<Node>>>>,
/// Directory to store unminified scripts for this window if unminify-js /// Directory to store unminified scripts for this window if unminify-js
/// opt is enabled. /// opt is enabled.
unminified_js_dir: DOMRefCell<Option<String>>, unminified_js_dir: DomRefCell<Option<String>>,
/// Worklets /// Worklets
test_worklet: MutNullableDom<Worklet>, test_worklet: MutNullableDom<Worklet>,
@ -404,7 +404,7 @@ impl Window {
Worklet::new(self, WorkletGlobalScopeType::Paint) Worklet::new(self, WorkletGlobalScopeType::Paint)
} }
pub fn permission_state_invocation_results(&self) -> &DOMRefCell<HashMap<String, PermissionState>> { pub fn permission_state_invocation_results(&self) -> &DomRefCell<HashMap<String, PermissionState>> {
&self.permission_state_invocation_results &self.permission_state_invocation_results
} }
@ -1866,10 +1866,10 @@ impl Window {
screen: Default::default(), screen: Default::default(),
session_storage: Default::default(), session_storage: Default::default(),
local_storage: Default::default(), local_storage: Default::default(),
status: DOMRefCell::new(DOMString::new()), status: DomRefCell::new(DOMString::new()),
parent_info, parent_info,
dom_static: GlobalStaticData::new(), dom_static: GlobalStaticData::new(),
js_runtime: DOMRefCell::new(Some(runtime.clone())), js_runtime: DomRefCell::new(Some(runtime.clone())),
bluetooth_thread, bluetooth_thread,
bluetooth_extra_permission_data: BluetoothExtraPermissionData::new(), bluetooth_extra_permission_data: BluetoothExtraPermissionData::new(),
page_clip_rect: Cell::new(max_rect()), page_clip_rect: Cell::new(max_rect()),

View file

@ -3,7 +3,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use document_loader::DocumentLoader; 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::BlobBinding::BlobBinding::BlobMethods;
use dom::bindings::codegen::Bindings::WindowBinding::WindowMethods; use dom::bindings::codegen::Bindings::WindowBinding::WindowMethods;
use dom::bindings::codegen::Bindings::XMLHttpRequestBinding; use dom::bindings::codegen::Bindings::XMLHttpRequestBinding;
@ -90,8 +90,8 @@ pub struct GenerationId(u32);
struct XHRContext { struct XHRContext {
xhr: TrustedXHRAddress, xhr: TrustedXHRAddress,
gen_id: GenerationId, gen_id: GenerationId,
buf: DOMRefCell<Vec<u8>>, buf: DomRefCell<Vec<u8>>,
sync_status: DOMRefCell<Option<ErrorResult>>, sync_status: DomRefCell<Option<ErrorResult>>,
} }
#[derive(Clone)] #[derive(Clone)]
@ -124,34 +124,34 @@ pub struct XMLHttpRequest {
timeout: Cell<u32>, timeout: Cell<u32>,
with_credentials: Cell<bool>, with_credentials: Cell<bool>,
upload: Dom<XMLHttpRequestUpload>, upload: Dom<XMLHttpRequestUpload>,
response_url: DOMRefCell<String>, response_url: DomRefCell<String>,
status: Cell<u16>, status: Cell<u16>,
status_text: DOMRefCell<ByteString>, status_text: DomRefCell<ByteString>,
response: DOMRefCell<ByteString>, response: DomRefCell<ByteString>,
response_type: Cell<XMLHttpRequestResponseType>, response_type: Cell<XMLHttpRequestResponseType>,
response_xml: MutNullableDom<Document>, response_xml: MutNullableDom<Document>,
response_blob: MutNullableDom<Blob>, response_blob: MutNullableDom<Blob>,
#[ignore_heap_size_of = "Defined in rust-mozjs"] #[ignore_heap_size_of = "Defined in rust-mozjs"]
response_json: Heap<JSVal>, response_json: Heap<JSVal>,
#[ignore_heap_size_of = "Defined in hyper"] #[ignore_heap_size_of = "Defined in hyper"]
response_headers: DOMRefCell<Headers>, response_headers: DomRefCell<Headers>,
#[ignore_heap_size_of = "Defined in hyper"] #[ignore_heap_size_of = "Defined in hyper"]
override_mime_type: DOMRefCell<Option<Mime>>, override_mime_type: DomRefCell<Option<Mime>>,
#[ignore_heap_size_of = "Defined in rust-encoding"] #[ignore_heap_size_of = "Defined in rust-encoding"]
override_charset: DOMRefCell<Option<EncodingRef>>, override_charset: DomRefCell<Option<EncodingRef>>,
// Associated concepts // Associated concepts
#[ignore_heap_size_of = "Defined in hyper"] #[ignore_heap_size_of = "Defined in hyper"]
request_method: DOMRefCell<Method>, request_method: DomRefCell<Method>,
request_url: DOMRefCell<Option<ServoUrl>>, request_url: DomRefCell<Option<ServoUrl>>,
#[ignore_heap_size_of = "Defined in hyper"] #[ignore_heap_size_of = "Defined in hyper"]
request_headers: DOMRefCell<Headers>, request_headers: DomRefCell<Headers>,
request_body_len: Cell<usize>, request_body_len: Cell<usize>,
sync: Cell<bool>, sync: Cell<bool>,
upload_complete: Cell<bool>, upload_complete: Cell<bool>,
send_flag: Cell<bool>, send_flag: Cell<bool>,
timeout_cancel: DOMRefCell<Option<OneshotTimerHandle>>, timeout_cancel: DomRefCell<Option<OneshotTimerHandle>>,
fetch_time: Cell<i64>, fetch_time: Cell<i64>,
generation_id: Cell<GenerationId>, generation_id: Cell<GenerationId>,
response_status: Cell<Result<(), ()>>, response_status: Cell<Result<(), ()>>,
@ -175,27 +175,27 @@ impl XMLHttpRequest {
timeout: Cell::new(0u32), timeout: Cell::new(0u32),
with_credentials: Cell::new(false), with_credentials: Cell::new(false),
upload: Dom::from_ref(&*XMLHttpRequestUpload::new(global)), upload: Dom::from_ref(&*XMLHttpRequestUpload::new(global)),
response_url: DOMRefCell::new(String::new()), response_url: DomRefCell::new(String::new()),
status: Cell::new(0), status: Cell::new(0),
status_text: DOMRefCell::new(ByteString::new(vec!())), status_text: DomRefCell::new(ByteString::new(vec!())),
response: DOMRefCell::new(ByteString::new(vec!())), response: DomRefCell::new(ByteString::new(vec!())),
response_type: Cell::new(XMLHttpRequestResponseType::_empty), response_type: Cell::new(XMLHttpRequestResponseType::_empty),
response_xml: Default::default(), response_xml: Default::default(),
response_blob: Default::default(), response_blob: Default::default(),
response_json: Heap::default(), response_json: Heap::default(),
response_headers: DOMRefCell::new(Headers::new()), response_headers: DomRefCell::new(Headers::new()),
override_mime_type: DOMRefCell::new(None), override_mime_type: DomRefCell::new(None),
override_charset: DOMRefCell::new(None), override_charset: DomRefCell::new(None),
request_method: DOMRefCell::new(Method::Get), request_method: DomRefCell::new(Method::Get),
request_url: DOMRefCell::new(None), request_url: DomRefCell::new(None),
request_headers: DOMRefCell::new(Headers::new()), request_headers: DomRefCell::new(Headers::new()),
request_body_len: Cell::new(0), request_body_len: Cell::new(0),
sync: Cell::new(false), sync: Cell::new(false),
upload_complete: Cell::new(false), upload_complete: Cell::new(false),
send_flag: Cell::new(false), send_flag: Cell::new(false),
timeout_cancel: DOMRefCell::new(None), timeout_cancel: DomRefCell::new(None),
fetch_time: Cell::new(0), fetch_time: Cell::new(0),
generation_id: Cell::new(GenerationId(0)), generation_id: Cell::new(GenerationId(0)),
response_status: Cell::new(Ok(())), response_status: Cell::new(Ok(())),
@ -1279,8 +1279,8 @@ impl XMLHttpRequest {
let context = Arc::new(Mutex::new(XHRContext { let context = Arc::new(Mutex::new(XHRContext {
xhr: xhr, xhr: xhr,
gen_id: self.generation_id.get(), gen_id: self.generation_id.get(),
buf: DOMRefCell::new(vec!()), buf: DomRefCell::new(vec!()),
sync_status: DOMRefCell::new(None), sync_status: DomRefCell::new(None),
})); }));
let (task_source, script_port) = if self.sync.get() { let (task_source, script_port) = if self.sync.get() {

View file

@ -7,7 +7,7 @@
//! perform checkpoints at appropriate times, as well as enqueue microtasks as required. //! perform checkpoints at appropriate times, as well as enqueue microtasks as required.
use dom::bindings::callback::ExceptionHandling; 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::codegen::Bindings::PromiseBinding::PromiseJobCallback;
use dom::bindings::root::Root; use dom::bindings::root::Root;
use dom::globalscope::GlobalScope; use dom::globalscope::GlobalScope;
@ -24,7 +24,7 @@ use std::rc::Rc;
#[derive(Default, HeapSizeOf, JSTraceable)] #[derive(Default, HeapSizeOf, JSTraceable)]
pub struct MicrotaskQueue { pub struct MicrotaskQueue {
/// The list of enqueued microtasks that will be invoked at the next microtask checkpoint. /// The list of enqueued microtasks that will be invoked at the next microtask checkpoint.
microtask_queue: DOMRefCell<Vec<Microtask>>, microtask_queue: DomRefCell<Vec<Microtask>>,
/// https://html.spec.whatwg.org/multipage/#performing-a-microtask-checkpoint /// https://html.spec.whatwg.org/multipage/#performing-a-microtask-checkpoint
performing_a_microtask_checkpoint: Cell<bool>, performing_a_microtask_checkpoint: Cell<bool>,
} }

View file

@ -24,7 +24,7 @@ use devtools_traits::{DevtoolScriptControlMsg, DevtoolsPageInfo};
use devtools_traits::{ScriptToDevtoolsControlMsg, WorkerId}; use devtools_traits::{ScriptToDevtoolsControlMsg, WorkerId};
use devtools_traits::CSSError; use devtools_traits::CSSError;
use document_loader::DocumentLoader; 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::CSSStyleDeclarationBinding::CSSStyleDeclarationMethods;
use dom::bindings::codegen::Bindings::DocumentBinding::{DocumentMethods, DocumentReadyState}; use dom::bindings::codegen::Bindings::DocumentBinding::{DocumentMethods, DocumentReadyState};
use dom::bindings::codegen::Bindings::EventBinding::EventInit; use dom::bindings::codegen::Bindings::EventBinding::EventInit;
@ -385,16 +385,16 @@ impl<'a> Iterator for DocumentsIter<'a> {
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
pub struct ScriptThread { pub struct ScriptThread {
/// The documents for pipelines managed by this thread /// The documents for pipelines managed by this thread
documents: DOMRefCell<Documents>, documents: DomRefCell<Documents>,
/// The window proxies known by this thread /// The window proxies known by this thread
/// TODO: this map grows, but never shrinks. Issue #15258. /// TODO: this map grows, but never shrinks. Issue #15258.
window_proxies: DOMRefCell<HashMap<BrowsingContextId, Dom<WindowProxy>>>, window_proxies: DomRefCell<HashMap<BrowsingContextId, Dom<WindowProxy>>>,
/// A list of data pertaining to loads that have not yet received a network response /// A list of data pertaining to loads that have not yet received a network response
incomplete_loads: DOMRefCell<Vec<InProgressLoad>>, incomplete_loads: DomRefCell<Vec<InProgressLoad>>,
/// A vector containing parser contexts which have not yet been fully processed /// A vector containing parser contexts which have not yet been fully processed
incomplete_parser_contexts: DOMRefCell<Vec<(PipelineId, ParserContext)>>, incomplete_parser_contexts: DomRefCell<Vec<(PipelineId, ParserContext)>>,
/// A map to store service worker registrations for a given origin /// A map to store service worker registrations for a given origin
registration_map: DOMRefCell<HashMap<ServoUrl, Dom<ServiceWorkerRegistration>>>, registration_map: DomRefCell<HashMap<ServoUrl, Dom<ServiceWorkerRegistration>>>,
/// A job queue for Service Workers keyed by their scope url /// A job queue for Service Workers keyed by their scope url
job_queue_map: Rc<JobQueue>, job_queue_map: Rc<JobQueue>,
/// Image cache for this script thread. /// Image cache for this script thread.
@ -461,7 +461,7 @@ pub struct ScriptThread {
topmost_mouse_over_target: MutNullableDom<Element>, topmost_mouse_over_target: MutNullableDom<Element>,
/// List of pipelines that have been owned and closed by this script thread. /// List of pipelines that have been owned and closed by this script thread.
closed_pipelines: DOMRefCell<HashSet<PipelineId>>, closed_pipelines: DomRefCell<HashSet<PipelineId>>,
scheduler_chan: IpcSender<TimerSchedulerMsg>, scheduler_chan: IpcSender<TimerSchedulerMsg>,
timer_event_chan: Sender<TimerEvent>, timer_event_chan: Sender<TimerEvent>,
@ -476,7 +476,7 @@ pub struct ScriptThread {
mutation_observer_compound_microtask_queued: Cell<bool>, mutation_observer_compound_microtask_queued: Cell<bool>,
/// The unit of related similar-origin browsing contexts' list of MutationObserver objects /// The unit of related similar-origin browsing contexts' list of MutationObserver objects
mutation_observers: DOMRefCell<Vec<Dom<MutationObserver>>>, mutation_observers: DomRefCell<Vec<Dom<MutationObserver>>>,
/// A handle to the webgl thread /// A handle to the webgl thread
webgl_chan: WebGLPipeline, webgl_chan: WebGLPipeline,
@ -485,15 +485,15 @@ pub struct ScriptThread {
webvr_chan: Option<IpcSender<WebVRMsg>>, webvr_chan: Option<IpcSender<WebVRMsg>>,
/// The worklet thread pool /// The worklet thread pool
worklet_thread_pool: DOMRefCell<Option<Rc<WorkletThreadPool>>>, worklet_thread_pool: DomRefCell<Option<Rc<WorkletThreadPool>>>,
/// A list of pipelines containing documents that finished loading all their blocking /// A list of pipelines containing documents that finished loading all their blocking
/// resources during a turn of the event loop. /// resources during a turn of the event loop.
docs_with_no_blocking_loads: DOMRefCell<HashSet<Dom<Document>>>, docs_with_no_blocking_loads: DomRefCell<HashSet<Dom<Document>>>,
/// A list of nodes with in-progress CSS transitions, which roots them for the duration /// A list of nodes with in-progress CSS transitions, which roots them for the duration
/// of the transition. /// of the transition.
transitioning_nodes: DOMRefCell<Vec<Dom<Node>>>, transitioning_nodes: DomRefCell<Vec<Dom<Node>>>,
/// https://html.spec.whatwg.org/multipage/#custom-element-reactions-stack /// https://html.spec.whatwg.org/multipage/#custom-element-reactions-stack
custom_element_reaction_stack: CustomElementReactionStack, custom_element_reaction_stack: CustomElementReactionStack,
@ -811,11 +811,11 @@ impl ScriptThread {
let (image_cache_channel, image_cache_port) = channel(); let (image_cache_channel, image_cache_port) = channel();
ScriptThread { ScriptThread {
documents: DOMRefCell::new(Documents::new()), documents: DomRefCell::new(Documents::new()),
window_proxies: DOMRefCell::new(HashMap::new()), window_proxies: DomRefCell::new(HashMap::new()),
incomplete_loads: DOMRefCell::new(vec!()), incomplete_loads: DomRefCell::new(vec!()),
incomplete_parser_contexts: DOMRefCell::new(vec!()), incomplete_parser_contexts: DomRefCell::new(vec!()),
registration_map: DOMRefCell::new(HashMap::new()), registration_map: DomRefCell::new(HashMap::new()),
job_queue_map: Rc::new(JobQueue::new()), job_queue_map: Rc::new(JobQueue::new()),
image_cache: state.image_cache.clone(), image_cache: state.image_cache.clone(),
@ -847,7 +847,7 @@ impl ScriptThread {
js_runtime: Rc::new(runtime), js_runtime: Rc::new(runtime),
topmost_mouse_over_target: MutNullableDom::new(Default::default()), 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, scheduler_chan: state.scheduler_chan,
timer_event_chan: timer_event_chan, timer_event_chan: timer_event_chan,

View file

@ -7,7 +7,7 @@
//! the script thread. The script thread contains a JobQueue, which stores all scheduled Jobs //! the script thread. The script thread contains a JobQueue, which stores all scheduled Jobs
//! by multiple service worker clients in a Vec. //! 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::error::Error;
use dom::bindings::refcounted::{Trusted, TrustedPromise}; use dom::bindings::refcounted::{Trusted, TrustedPromise};
use dom::bindings::reflector::DomObject; use dom::bindings::reflector::DomObject;
@ -93,11 +93,11 @@ impl PartialEq for Job {
#[must_root] #[must_root]
#[derive(JSTraceable)] #[derive(JSTraceable)]
pub struct JobQueue(pub DOMRefCell<HashMap<ServoUrl, Vec<Job>>>); pub struct JobQueue(pub DomRefCell<HashMap<ServoUrl, Vec<Job>>>);
impl JobQueue { impl JobQueue {
pub fn new() -> JobQueue { pub fn new() -> JobQueue {
JobQueue(DOMRefCell::new(HashMap::new())) JobQueue(DomRefCell::new(HashMap::new()))
} }
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
// https://w3c.github.io/ServiceWorker/#schedule-job-algorithm // https://w3c.github.io/ServiceWorker/#schedule-job-algorithm

View file

@ -6,7 +6,7 @@ pub use dom::bindings::str::{ByteString, DOMString};
pub use dom::headers::normalize_value; pub use dom::headers::normalize_value;
// For compile-fail tests only. // 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::bindings::root::Dom;
pub use dom::node::Node; pub use dom::node::Node;
pub use dom::bindings::refcounted::TrustedPromise; pub use dom::bindings::refcounted::TrustedPromise;

View file

@ -3,7 +3,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use dom::bindings::callback::ExceptionHandling::Report; 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::codegen::Bindings::FunctionBinding::Function;
use dom::bindings::reflector::DomObject; use dom::bindings::reflector::DomObject;
use dom::bindings::str::DOMString; use dom::bindings::str::DOMString;
@ -38,7 +38,7 @@ pub struct OneshotTimers {
#[ignore_heap_size_of = "Defined in std"] #[ignore_heap_size_of = "Defined in std"]
scheduler_chan: IpcSender<TimerSchedulerMsg>, scheduler_chan: IpcSender<TimerSchedulerMsg>,
next_timer_handle: Cell<OneshotTimerHandle>, next_timer_handle: Cell<OneshotTimerHandle>,
timers: DOMRefCell<Vec<OneshotTimer>>, timers: DomRefCell<Vec<OneshotTimer>>,
suspended_since: Cell<Option<MsDuration>>, suspended_since: Cell<Option<MsDuration>>,
/// Initially 0, increased whenever the associated document is reactivated /// Initially 0, increased whenever the associated document is reactivated
/// by the amount of ms the document was inactive. The current time can be /// 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, timer_event_chan: timer_event_chan,
scheduler_chan: scheduler_chan, scheduler_chan: scheduler_chan,
next_timer_handle: Cell::new(OneshotTimerHandle(1)), next_timer_handle: Cell::new(OneshotTimerHandle(1)),
timers: DOMRefCell::new(Vec::new()), timers: DomRefCell::new(Vec::new()),
suspended_since: Cell::new(None), suspended_since: Cell::new(None),
suspension_offset: Cell::new(Length::new(0)), suspension_offset: Cell::new(Length::new(0)),
expected_event_id: Cell::new(TimerEventId(0)), expected_event_id: Cell::new(TimerEventId(0)),
@ -307,7 +307,7 @@ pub struct JsTimerHandle(i32);
#[derive(DenyPublicFields, HeapSizeOf, JSTraceable)] #[derive(DenyPublicFields, HeapSizeOf, JSTraceable)]
pub struct JsTimers { pub struct JsTimers {
next_timer_handle: Cell<JsTimerHandle>, next_timer_handle: Cell<JsTimerHandle>,
active_timers: DOMRefCell<HashMap<JsTimerHandle, JsTimerEntry>>, active_timers: DomRefCell<HashMap<JsTimerHandle, JsTimerEntry>>,
/// The nesting level of the currently executing timer task or 0. /// The nesting level of the currently executing timer task or 0.
nesting_level: Cell<u32>, nesting_level: Cell<u32>,
/// Used to introduce a minimum delay in event intervals /// Used to introduce a minimum delay in event intervals
@ -364,7 +364,7 @@ impl JsTimers {
pub fn new() -> JsTimers { pub fn new() -> JsTimers {
JsTimers { JsTimers {
next_timer_handle: Cell::new(JsTimerHandle(1)), next_timer_handle: Cell::new(JsTimerHandle(1)),
active_timers: DOMRefCell::new(HashMap::new()), active_timers: DomRefCell::new(HashMap::new()),
nesting_level: Cell::new(0), nesting_level: Cell::new(0),
min_duration: Cell::new(None), min_duration: Cell::new(None),
} }

View file

@ -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), 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 // This catches assignments... the main point of this would be to catch mutable
// references to `JS<T>`. // references to `JS<T>`.
// 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), // hir::ExprAssign(_, ref rhs) => require_rooted(cx, self.in_new_function, &*rhs),
// This catches calls; basically, this enforces the constraint that only constructors // This catches calls; basically, this enforces the constraint that only constructors
// can call other 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<JS<T>> and RootedVec<JS<T>>. // constructs like Vec<JS<T>> and RootedVec<JS<T>>.
// hir::ExprCall(..) if !self.in_new_function => { // hir::ExprCall(..) if !self.in_new_function => {
// require_rooted(cx, self.in_new_function, expr); // require_rooted(cx, self.in_new_function, expr);

View file

@ -574,11 +574,11 @@ def check_rust(file_name, lines):
# No benefit over using &str # No benefit over using &str
(r": &String", "use &str instead of &String", no_filter), (r": &String", "use &str instead of &String", no_filter),
# There should be any use of banned types: # There should be any use of banned types:
# Cell<JSVal>, Cell<Dom<T>>, DOMRefCell<Dom<T>>, DOMRefCell<HEAP<T>> # Cell<JSVal>, Cell<Dom<T>>, DomRefCell<Dom<T>>, DomRefCell<HEAP<T>>
(r"(\s|:)+Cell<JSVal>", "Banned type Cell<JSVal> detected. Use MutDom<JSVal> instead", no_filter), (r"(\s|:)+Cell<JSVal>", "Banned type Cell<JSVal> detected. Use MutDom<JSVal> instead", no_filter),
(r"(\s|:)+Cell<Dom<.+>>", "Banned type Cell<Dom<T>> detected. Use MutDom<T> instead", no_filter), (r"(\s|:)+Cell<Dom<.+>>", "Banned type Cell<Dom<T>> detected. Use MutDom<T> instead", no_filter),
(r"DOMRefCell<Dom<.+>>", "Banned type DOMRefCell<Dom<T>> detected. Use MutDom<T> instead", no_filter), (r"DomRefCell<Dom<.+>>", "Banned type DomRefCell<Dom<T>> detected. Use MutDom<T> instead", no_filter),
(r"DOMRefCell<Heap<.+>>", "Banned type DOMRefCell<Heap<T>> detected. Use MutDom<T> instead", no_filter), (r"DomRefCell<Heap<.+>>", "Banned type DomRefCell<Heap<T>> detected. Use MutDom<T> instead", no_filter),
# No benefit to using &Root<T> # No benefit to using &Root<T>
(r": &Root<", "use &T instead of &Root<T>", no_filter), (r": &Root<", "use &T instead of &Root<T>", no_filter),
(r"^&&", "operators should go at the end of the first line", no_filter), (r"^&&", "operators should go at the end of the first line", no_filter),

View file

@ -8,12 +8,12 @@
extern crate script; extern crate script;
use script::test::Dom; use script::test::Dom;
use script::test::DOMRefCell; use script::test::DomRefCell;
use script::test::Node; use script::test::Node;
struct Foo { struct Foo {
bar: DOMRefCell<Dom<Node>> bar: DomRefCell<Dom<Node>>
//~^ ERROR Banned type DOMRefCell<Dom<T>> detected. Use MutDom<T> instead //~^ ERROR Banned type DomRefCell<Dom<T>> detected. Use MutDom<T> instead
} }
fn main() {} fn main() {}

View file

@ -151,7 +151,7 @@ class CheckTidiness(unittest.TestCase):
self.assertNoMoreErrors(ban_errors) self.assertNoMoreErrors(ban_errors)
ban_errors = tidy.collect_errors_for_files(iterFile('ban-domrefcell.rs'), [], [tidy.check_rust], print_text=False) ban_errors = tidy.collect_errors_for_files(iterFile('ban-domrefcell.rs'), [], [tidy.check_rust], print_text=False)
self.assertEqual('Banned type DOMRefCell<Dom<T>> detected. Use MutDom<T> instead', ban_errors.next()[2]) self.assertEqual('Banned type DomRefCell<Dom<T>> detected. Use MutDom<T> instead', ban_errors.next()[2])
self.assertNoMoreErrors(ban_errors) self.assertNoMoreErrors(ban_errors)
def test_spec_link(self): def test_spec_link(self):