From e2dac78d3600cb4b2b4474f1db4f0fcaadbe24ea Mon Sep 17 00:00:00 2001 From: Anthony Ramine Date: Tue, 26 Sep 2017 01:30:06 +0200 Subject: Rename LayoutJS to LayoutDom --- components/script/dom/attr.rs | 4 +- .../script/dom/bindings/codegen/CodegenRust.py | 2 +- components/script/dom/bindings/root.rs | 48 +++++++++++----------- components/script/dom/canvasrenderingcontext2d.rs | 4 +- components/script/dom/characterdata.rs | 4 +- components/script/dom/document.rs | 8 ++-- components/script/dom/element.rs | 6 +-- components/script/dom/htmlbodyelement.rs | 4 +- components/script/dom/htmlcanvaselement.rs | 4 +- components/script/dom/htmlfontelement.rs | 4 +- components/script/dom/htmlhrelement.rs | 4 +- components/script/dom/htmliframeelement.rs | 4 +- components/script/dom/htmlimageelement.rs | 4 +- components/script/dom/htmlinputelement.rs | 8 ++-- components/script/dom/htmltablecellelement.rs | 4 +- components/script/dom/htmltableelement.rs | 4 +- components/script/dom/htmltablerowelement.rs | 4 +- components/script/dom/htmltablesectionelement.rs | 4 +- components/script/dom/htmltextareaelement.rs | 4 +- components/script/dom/mod.rs | 4 +- components/script/dom/node.rs | 28 ++++++------- components/script/dom/svgsvgelement.rs | 4 +- components/script/dom/webglrenderingcontext.rs | 4 +- components/script/lib.rs | 2 +- 24 files changed, 85 insertions(+), 85 deletions(-) (limited to 'components/script') diff --git a/components/script/dom/attr.rs b/components/script/dom/attr.rs index d18eed26f65..ea9f1f23a78 100644 --- a/components/script/dom/attr.rs +++ b/components/script/dom/attr.rs @@ -7,7 +7,7 @@ use dom::bindings::cell::DOMRefCell; use dom::bindings::codegen::Bindings::AttrBinding::{self, AttrMethods}; use dom::bindings::inheritance::Castable; use dom::bindings::reflector::{Reflector, reflect_dom_object}; -use dom::bindings::root::{LayoutJS, MutNullableDom, Root, RootedReference}; +use dom::bindings::root::{LayoutDom, MutNullableDom, Root, RootedReference}; use dom::bindings::str::DOMString; use dom::customelementregistry::CallbackReaction; use dom::element::{AttributeMutation, Element}; @@ -256,7 +256,7 @@ pub trait AttrHelpersForLayout { } #[allow(unsafe_code)] -impl AttrHelpersForLayout for LayoutJS { +impl AttrHelpersForLayout for LayoutDom { #[inline] unsafe fn value_forever(&self) -> &'static AttrValue { // This transmute is used to cheat the lifetime restriction. diff --git a/components/script/dom/bindings/codegen/CodegenRust.py b/components/script/dom/bindings/codegen/CodegenRust.py index 3f99ea37a41..888a17a3a8c 100644 --- a/components/script/dom/bindings/codegen/CodegenRust.py +++ b/components/script/dom/bindings/codegen/CodegenRust.py @@ -7195,7 +7195,7 @@ class GlobalGenRoots(): imports = [CGGeneric("use dom::types::*;\n"), CGGeneric("use dom::bindings::conversions::{DerivedFrom, get_dom_class};\n"), CGGeneric("use dom::bindings::inheritance::Castable;\n"), - CGGeneric("use dom::bindings::root::{Dom, LayoutJS, Root};\n"), + CGGeneric("use dom::bindings::root::{Dom, LayoutDom, Root};\n"), CGGeneric("use dom::bindings::trace::JSTraceable;\n"), CGGeneric("use dom::bindings::reflector::DomObject;\n"), CGGeneric("use js::jsapi::JSTracer;\n\n"), diff --git a/components/script/dom/bindings/root.rs b/components/script/dom/bindings/root.rs index dbfe4023d63..f845bd3bd30 100644 --- a/components/script/dom/bindings/root.rs +++ b/components/script/dom/bindings/root.rs @@ -68,10 +68,10 @@ impl HeapSizeOf for Dom { } impl Dom { - /// Returns `LayoutJS` containing the same pointer. - pub unsafe fn to_layout(&self) -> LayoutJS { + /// Returns `LayoutDom` containing the same pointer. + pub unsafe fn to_layout(&self) -> LayoutDom { debug_assert!(thread_state::get().is_layout()); - LayoutJS { + LayoutDom { ptr: self.ptr.clone(), } } @@ -124,32 +124,32 @@ unsafe impl JSTraceable for Dom { /// An unrooted reference to a DOM object for use in layout. `Layout*Helpers` /// traits must be implemented on this. #[allow_unrooted_interior] -pub struct LayoutJS { +pub struct LayoutDom { ptr: NonZero<*const T>, } -impl LayoutJS { +impl LayoutDom { /// Cast a DOM object root upwards to one of the interfaces it derives from. - pub fn upcast(&self) -> LayoutJS + pub fn upcast(&self) -> LayoutDom where U: Castable, T: DerivedFrom { debug_assert!(thread_state::get().is_layout()); let ptr: *const T = self.ptr.get(); - LayoutJS { + LayoutDom { ptr: unsafe { NonZero::new_unchecked(ptr as *const U) }, } } /// Cast a DOM object downwards to one of the interfaces it might implement. - pub fn downcast(&self) -> Option> + pub fn downcast(&self) -> Option> where U: DerivedFrom { debug_assert!(thread_state::get().is_layout()); unsafe { if (*self.unsafe_get()).is::() { let ptr: *const T = self.ptr.get(); - Some(LayoutJS { + Some(LayoutDom { ptr: NonZero::new_unchecked(ptr as *const U), }) } else { @@ -159,7 +159,7 @@ impl LayoutJS { } } -impl LayoutJS { +impl LayoutDom { /// Get the reflector. pub unsafe fn get_jsobject(&self) -> *mut JSObject { debug_assert!(thread_state::get().is_layout()); @@ -167,7 +167,7 @@ impl LayoutJS { } } -impl Copy for LayoutJS {} +impl Copy for LayoutDom {} impl PartialEq for Dom { fn eq(&self, other: &Dom) -> bool { @@ -177,13 +177,13 @@ impl PartialEq for Dom { impl Eq for Dom {} -impl PartialEq for LayoutJS { - fn eq(&self, other: &LayoutJS) -> bool { +impl PartialEq for LayoutDom { + fn eq(&self, other: &LayoutDom) -> bool { self.ptr == other.ptr } } -impl Eq for LayoutJS {} +impl Eq for LayoutDom {} impl Hash for Dom { fn hash(&self, state: &mut H) { @@ -191,7 +191,7 @@ impl Hash for Dom { } } -impl Hash for LayoutJS { +impl Hash for LayoutDom { fn hash(&self, state: &mut H) { self.ptr.hash(state) } @@ -208,23 +208,23 @@ impl Clone for Dom { } } -impl Clone for LayoutJS { +impl Clone for LayoutDom { #[inline] - fn clone(&self) -> LayoutJS { + fn clone(&self) -> LayoutDom { debug_assert!(thread_state::get().is_layout()); - LayoutJS { + LayoutDom { ptr: self.ptr.clone(), } } } -impl LayoutJS { +impl LayoutDom { /// Create a new JS-owned value wrapped from an address known to be a /// `Node` pointer. - pub unsafe fn from_trusted_node_address(inner: TrustedNodeAddress) -> LayoutJS { + pub unsafe fn from_trusted_node_address(inner: TrustedNodeAddress) -> LayoutDom { debug_assert!(thread_state::get().is_layout()); let TrustedNodeAddress(addr) = inner; - LayoutJS { + LayoutDom { ptr: NonZero::new_unchecked(addr as *const Node), } } @@ -327,10 +327,10 @@ impl MutNullableDom { } } - /// Retrieve a copy of the inner optional `Dom` as `LayoutJS`. + /// Retrieve a copy of the inner optional `Dom` as `LayoutDom`. /// For use by layout, which can't use safe types like Temporary. #[allow(unrooted_must_root)] - pub unsafe fn get_inner_as_layout(&self) -> Option> { + pub unsafe fn get_inner_as_layout(&self) -> Option> { debug_assert!(thread_state::get().is_layout()); ptr::read(self.ptr.get()).map(|js| js.to_layout()) } @@ -442,7 +442,7 @@ unsafe impl JSTraceable for OnceCellJS { } } -impl LayoutJS { +impl LayoutDom { /// Returns an unsafe pointer to the interior of this JS object. This is /// the only method that be safely accessed from layout. (The fact that /// this is unsafe is what necessitates the layout wrappers.) diff --git a/components/script/dom/canvasrenderingcontext2d.rs b/components/script/dom/canvasrenderingcontext2d.rs index 4eafb0907e8..cf898b06880 100644 --- a/components/script/dom/canvasrenderingcontext2d.rs +++ b/components/script/dom/canvasrenderingcontext2d.rs @@ -23,7 +23,7 @@ use dom::bindings::error::{Error, ErrorResult, Fallible}; use dom::bindings::inheritance::Castable; use dom::bindings::num::Finite; use dom::bindings::reflector::{DomObject, Reflector, reflect_dom_object}; -use dom::bindings::root::{Dom, LayoutJS, Root}; +use dom::bindings::root::{Dom, LayoutDom, Root}; use dom::bindings::str::DOMString; use dom::canvasgradient::{CanvasGradient, CanvasGradientStyle, ToFillOrStrokeStyle}; use dom::canvaspattern::CanvasPattern; @@ -585,7 +585,7 @@ pub trait LayoutCanvasRenderingContext2DHelpers { unsafe fn get_ipc_renderer(&self) -> IpcSender; } -impl LayoutCanvasRenderingContext2DHelpers for LayoutJS { +impl LayoutCanvasRenderingContext2DHelpers for LayoutDom { #[allow(unsafe_code)] unsafe fn get_ipc_renderer(&self) -> IpcSender { (*self.unsafe_get()).ipc_renderer.clone() diff --git a/components/script/dom/characterdata.rs b/components/script/dom/characterdata.rs index 9db97be00f6..38a30e8ef50 100644 --- a/components/script/dom/characterdata.rs +++ b/components/script/dom/characterdata.rs @@ -12,7 +12,7 @@ use dom::bindings::codegen::InheritTypes::{CharacterDataTypeId, NodeTypeId}; use dom::bindings::codegen::UnionTypes::NodeOrString; use dom::bindings::error::{Error, ErrorResult, Fallible}; use dom::bindings::inheritance::Castable; -use dom::bindings::root::{LayoutJS, Root}; +use dom::bindings::root::{LayoutDom, Root}; use dom::bindings::str::DOMString; use dom::comment::Comment; use dom::document::Document; @@ -253,7 +253,7 @@ pub trait LayoutCharacterDataHelpers { } #[allow(unsafe_code)] -impl LayoutCharacterDataHelpers for LayoutJS { +impl LayoutCharacterDataHelpers for LayoutDom { #[inline] unsafe fn data_for_layout(&self) -> &str { &(*self.unsafe_get()).data.borrow_for_layout() diff --git a/components/script/dom/document.rs b/components/script/dom/document.rs index 49dfdb4230e..48e4103e76e 100644 --- a/components/script/dom/document.rs +++ b/components/script/dom/document.rs @@ -27,7 +27,7 @@ use dom::bindings::inheritance::{Castable, ElementTypeId, HTMLElementTypeId, Nod use dom::bindings::num::Finite; use dom::bindings::refcounted::{Trusted, TrustedPromise}; use dom::bindings::reflector::{DomObject, reflect_dom_object}; -use dom::bindings::root::{Dom, LayoutJS, MutNullableDom, Root, RootedReference}; +use dom::bindings::root::{Dom, LayoutDom, MutNullableDom, Root, RootedReference}; use dom::bindings::str::{DOMString, USVString}; use dom::bindings::xmlname::{namespace_from_domstring, validate_and_extract, xml_name_type}; use dom::bindings::xmlname::XMLName::InvalidXMLName; @@ -2082,7 +2082,7 @@ pub enum DocumentSource { #[allow(unsafe_code)] pub trait LayoutDocumentHelpers { unsafe fn is_html_document_for_layout(&self) -> bool; - unsafe fn drain_pending_restyles(&self) -> Vec<(LayoutJS, PendingRestyle)>; + unsafe fn drain_pending_restyles(&self) -> Vec<(LayoutDom, PendingRestyle)>; unsafe fn needs_paint_from_layout(&self); unsafe fn will_paint(&self); unsafe fn quirks_mode(&self) -> QuirksMode; @@ -2090,7 +2090,7 @@ pub trait LayoutDocumentHelpers { } #[allow(unsafe_code)] -impl LayoutDocumentHelpers for LayoutJS { +impl LayoutDocumentHelpers for LayoutDom { #[inline] unsafe fn is_html_document_for_layout(&self) -> bool { (*self.unsafe_get()).is_html_document @@ -2098,7 +2098,7 @@ impl LayoutDocumentHelpers for LayoutJS { #[inline] #[allow(unrooted_must_root)] - unsafe fn drain_pending_restyles(&self) -> Vec<(LayoutJS, PendingRestyle)> { + unsafe fn drain_pending_restyles(&self) -> Vec<(LayoutDom, PendingRestyle)> { let mut elements = (*self.unsafe_get()).pending_restyles.borrow_mut_for_layout(); // Elements were in a document when they were adding to this list, but that // may no longer be true when the next layout occurs. diff --git a/components/script/dom/element.rs b/components/script/dom/element.rs index 66c1ac9cbb1..79bbb3b11e3 100644 --- a/components/script/dom/element.rs +++ b/components/script/dom/element.rs @@ -24,7 +24,7 @@ use dom::bindings::error::{Error, ErrorResult, Fallible}; use dom::bindings::inheritance::{Castable, ElementTypeId, HTMLElementTypeId, NodeTypeId}; use dom::bindings::refcounted::{Trusted, TrustedPromise}; use dom::bindings::reflector::DomObject; -use dom::bindings::root::{Dom, LayoutJS, MutNullableDom, Root, RootedReference}; +use dom::bindings::root::{Dom, LayoutDom, MutNullableDom, Root, RootedReference}; use dom::bindings::str::DOMString; use dom::bindings::xmlname::{namespace_from_domstring, validate_and_extract, xml_name_type}; use dom::bindings::xmlname::XMLName::InvalidXMLName; @@ -384,7 +384,7 @@ pub trait RawLayoutElementHelpers { #[inline] #[allow(unsafe_code)] pub unsafe fn get_attr_for_layout<'a>(elem: &'a Element, namespace: &Namespace, name: &LocalName) - -> Option> { + -> Option> { // cast to point to T in RefCell directly let attrs = elem.attrs.borrow_for_layout(); attrs.iter().find(|attr| { @@ -453,7 +453,7 @@ pub trait LayoutElementHelpers { fn has_selector_flags(&self, flags: ElementSelectorFlags) -> bool; } -impl LayoutElementHelpers for LayoutJS { +impl LayoutElementHelpers for LayoutDom { #[allow(unsafe_code)] #[inline] unsafe fn has_class_for_layout(&self, name: &Atom, case_sensitivity: CaseSensitivity) -> bool { diff --git a/components/script/dom/htmlbodyelement.rs b/components/script/dom/htmlbodyelement.rs index 3eca3fba978..3ec993ca3df 100644 --- a/components/script/dom/htmlbodyelement.rs +++ b/components/script/dom/htmlbodyelement.rs @@ -7,7 +7,7 @@ use dom::attr::Attr; use dom::bindings::codegen::Bindings::HTMLBodyElementBinding::{self, HTMLBodyElementMethods}; use dom::bindings::codegen::Bindings::WindowBinding::WindowMethods; use dom::bindings::inheritance::Castable; -use dom::bindings::root::{LayoutJS, Root}; +use dom::bindings::root::{LayoutDom, Root}; use dom::bindings::str::DOMString; use dom::document::Document; use dom::element::{AttributeMutation, Element, RawLayoutElementHelpers}; @@ -88,7 +88,7 @@ pub trait HTMLBodyElementLayoutHelpers { fn get_background(&self) -> Option; } -impl HTMLBodyElementLayoutHelpers for LayoutJS { +impl HTMLBodyElementLayoutHelpers for LayoutDom { #[allow(unsafe_code)] fn get_background_color(&self) -> Option { unsafe { diff --git a/components/script/dom/htmlcanvaselement.rs b/components/script/dom/htmlcanvaselement.rs index 0e376f63b2d..de6fc1b1bd4 100644 --- a/components/script/dom/htmlcanvaselement.rs +++ b/components/script/dom/htmlcanvaselement.rs @@ -15,7 +15,7 @@ use dom::bindings::conversions::ConversionResult; use dom::bindings::error::{Error, Fallible}; use dom::bindings::inheritance::Castable; use dom::bindings::num::Finite; -use dom::bindings::root::{Dom, LayoutJS, Root}; +use dom::bindings::root::{Dom, LayoutDom, Root}; use dom::bindings::str::DOMString; use dom::canvasrenderingcontext2d::{CanvasRenderingContext2D, LayoutCanvasRenderingContext2DHelpers}; use dom::document::Document; @@ -101,7 +101,7 @@ pub trait LayoutHTMLCanvasElementHelpers { fn get_height(&self) -> LengthOrPercentageOrAuto; } -impl LayoutHTMLCanvasElementHelpers for LayoutJS { +impl LayoutHTMLCanvasElementHelpers for LayoutDom { #[allow(unsafe_code)] fn data(&self) -> HTMLCanvasData { unsafe { diff --git a/components/script/dom/htmlfontelement.rs b/components/script/dom/htmlfontelement.rs index 77417b89997..e2f9eaeec21 100644 --- a/components/script/dom/htmlfontelement.rs +++ b/components/script/dom/htmlfontelement.rs @@ -7,7 +7,7 @@ use dom::attr::Attr; use dom::bindings::codegen::Bindings::HTMLFontElementBinding; use dom::bindings::codegen::Bindings::HTMLFontElementBinding::HTMLFontElementMethods; use dom::bindings::inheritance::Castable; -use dom::bindings::root::{LayoutJS, Root}; +use dom::bindings::root::{LayoutDom, Root}; use dom::bindings::str::DOMString; use dom::document::Document; use dom::element::{Element, RawLayoutElementHelpers}; @@ -96,7 +96,7 @@ pub trait HTMLFontElementLayoutHelpers { fn get_size(&self) -> Option; } -impl HTMLFontElementLayoutHelpers for LayoutJS { +impl HTMLFontElementLayoutHelpers for LayoutDom { #[allow(unsafe_code)] fn get_color(&self) -> Option { unsafe { diff --git a/components/script/dom/htmlhrelement.rs b/components/script/dom/htmlhrelement.rs index 38a2f354a6f..e66494e6843 100644 --- a/components/script/dom/htmlhrelement.rs +++ b/components/script/dom/htmlhrelement.rs @@ -5,7 +5,7 @@ use cssparser::RGBA; use dom::bindings::codegen::Bindings::HTMLHRElementBinding::{self, HTMLHRElementMethods}; use dom::bindings::inheritance::Castable; -use dom::bindings::root::{LayoutJS, Root}; +use dom::bindings::root::{LayoutDom, Root}; use dom::bindings::str::DOMString; use dom::document::Document; use dom::element::{Element, RawLayoutElementHelpers}; @@ -63,7 +63,7 @@ pub trait HTMLHRLayoutHelpers { fn get_width(&self) -> LengthOrPercentageOrAuto; } -impl HTMLHRLayoutHelpers for LayoutJS { +impl HTMLHRLayoutHelpers for LayoutDom { #[allow(unsafe_code)] fn get_color(&self) -> Option { unsafe { diff --git a/components/script/dom/htmliframeelement.rs b/components/script/dom/htmliframeelement.rs index 8e71609a451..923c0fab2df 100644 --- a/components/script/dom/htmliframeelement.rs +++ b/components/script/dom/htmliframeelement.rs @@ -21,7 +21,7 @@ use dom::bindings::error::{Error, ErrorResult, Fallible}; use dom::bindings::inheritance::Castable; use dom::bindings::refcounted::Trusted; use dom::bindings::reflector::DomObject; -use dom::bindings::root::{LayoutJS, MutNullableDom, Root}; +use dom::bindings::root::{LayoutDom, MutNullableDom, Root}; use dom::bindings::str::DOMString; use dom::customevent::CustomEvent; use dom::document::Document; @@ -419,7 +419,7 @@ pub trait HTMLIFrameElementLayoutMethods { fn get_height(&self) -> LengthOrPercentageOrAuto; } -impl HTMLIFrameElementLayoutMethods for LayoutJS { +impl HTMLIFrameElementLayoutMethods for LayoutDom { #[inline] #[allow(unsafe_code)] fn pipeline_id(&self) -> Option { diff --git a/components/script/dom/htmlimageelement.rs b/components/script/dom/htmlimageelement.rs index 89873ffc4d8..3a71f8bda48 100644 --- a/components/script/dom/htmlimageelement.rs +++ b/components/script/dom/htmlimageelement.rs @@ -17,7 +17,7 @@ use dom::bindings::error::Fallible; use dom::bindings::inheritance::Castable; use dom::bindings::refcounted::Trusted; use dom::bindings::reflector::DomObject; -use dom::bindings::root::{LayoutJS, MutNullableDom, Root}; +use dom::bindings::root::{LayoutDom, MutNullableDom, Root}; use dom::bindings::str::DOMString; use dom::document::Document; use dom::element::{AttributeMutation, Element, RawLayoutElementHelpers}; @@ -694,7 +694,7 @@ pub trait LayoutHTMLImageElementHelpers { fn get_height(&self) -> LengthOrPercentageOrAuto; } -impl LayoutHTMLImageElementHelpers for LayoutJS { +impl LayoutHTMLImageElementHelpers for LayoutDom { #[allow(unsafe_code)] unsafe fn image(&self) -> Option> { (*self.unsafe_get()).current_request.borrow_for_layout().image.clone() diff --git a/components/script/dom/htmlinputelement.rs b/components/script/dom/htmlinputelement.rs index bd714509dda..0520a3a3d4f 100755 --- a/components/script/dom/htmlinputelement.rs +++ b/components/script/dom/htmlinputelement.rs @@ -15,7 +15,7 @@ use dom::bindings::codegen::Bindings::MouseEventBinding::MouseEventMethods; use dom::bindings::codegen::Bindings::WindowBinding::WindowMethods; use dom::bindings::error::{Error, ErrorResult}; use dom::bindings::inheritance::Castable; -use dom::bindings::root::{Dom, LayoutJS, MutNullableDom, Root, RootedReference}; +use dom::bindings::root::{Dom, LayoutDom, MutNullableDom, Root, RootedReference}; use dom::bindings::str::DOMString; use dom::document::Document; use dom::element::{AttributeMutation, Element, LayoutElementHelpers, RawLayoutElementHelpers}; @@ -206,15 +206,15 @@ pub trait LayoutHTMLInputElementHelpers { } #[allow(unsafe_code)] -unsafe fn get_raw_textinput_value(input: LayoutJS) -> DOMString { +unsafe fn get_raw_textinput_value(input: LayoutDom) -> DOMString { (*input.unsafe_get()).textinput.borrow_for_layout().get_content() } -impl LayoutHTMLInputElementHelpers for LayoutJS { +impl LayoutHTMLInputElementHelpers for LayoutDom { #[allow(unsafe_code)] unsafe fn value_for_layout(self) -> String { #[allow(unsafe_code)] - unsafe fn get_raw_attr_value(input: LayoutJS, default: &str) -> String { + unsafe fn get_raw_attr_value(input: LayoutDom, default: &str) -> String { let elem = input.upcast::(); let value = (*elem.unsafe_get()) .get_attr_val_for_layout(&ns!(), &local_name!("value")) diff --git a/components/script/dom/htmltablecellelement.rs b/components/script/dom/htmltablecellelement.rs index 6bbdc65079a..3be05003a4a 100644 --- a/components/script/dom/htmltablecellelement.rs +++ b/components/script/dom/htmltablecellelement.rs @@ -6,7 +6,7 @@ use cssparser::RGBA; use dom::bindings::codegen::Bindings::HTMLTableCellElementBinding::HTMLTableCellElementMethods; use dom::bindings::codegen::Bindings::NodeBinding::NodeMethods; use dom::bindings::inheritance::Castable; -use dom::bindings::root::LayoutJS; +use dom::bindings::root::LayoutDom; use dom::bindings::str::DOMString; use dom::document::Document; use dom::element::{Element, RawLayoutElementHelpers}; @@ -88,7 +88,7 @@ pub trait HTMLTableCellElementLayoutHelpers { } #[allow(unsafe_code)] -impl HTMLTableCellElementLayoutHelpers for LayoutJS { +impl HTMLTableCellElementLayoutHelpers for LayoutDom { fn get_background_color(&self) -> Option { unsafe { (&*self.upcast::().unsafe_get()) diff --git a/components/script/dom/htmltableelement.rs b/components/script/dom/htmltableelement.rs index 25069647f6c..3571dda873d 100644 --- a/components/script/dom/htmltableelement.rs +++ b/components/script/dom/htmltableelement.rs @@ -10,7 +10,7 @@ use dom::bindings::codegen::Bindings::HTMLTableElementBinding::HTMLTableElementM use dom::bindings::codegen::Bindings::NodeBinding::NodeMethods; use dom::bindings::error::{Error, ErrorResult, Fallible}; use dom::bindings::inheritance::Castable; -use dom::bindings::root::{Dom, LayoutJS, MutNullableDom, Root, RootedReference}; +use dom::bindings::root::{Dom, LayoutDom, MutNullableDom, Root, RootedReference}; use dom::bindings::str::DOMString; use dom::document::Document; use dom::element::{AttributeMutation, Element, RawLayoutElementHelpers}; @@ -379,7 +379,7 @@ pub trait HTMLTableElementLayoutHelpers { fn get_width(&self) -> LengthOrPercentageOrAuto; } -impl HTMLTableElementLayoutHelpers for LayoutJS { +impl HTMLTableElementLayoutHelpers for LayoutDom { #[allow(unsafe_code)] fn get_background_color(&self) -> Option { unsafe { diff --git a/components/script/dom/htmltablerowelement.rs b/components/script/dom/htmltablerowelement.rs index 78246d4444c..ded30ae590c 100644 --- a/components/script/dom/htmltablerowelement.rs +++ b/components/script/dom/htmltablerowelement.rs @@ -9,7 +9,7 @@ use dom::bindings::codegen::Bindings::HTMLTableSectionElementBinding::HTMLTableS use dom::bindings::codegen::Bindings::NodeBinding::NodeMethods; use dom::bindings::error::{ErrorResult, Fallible}; use dom::bindings::inheritance::Castable; -use dom::bindings::root::{LayoutJS, MutNullableDom, Root, RootedReference}; +use dom::bindings::root::{LayoutDom, MutNullableDom, Root, RootedReference}; use dom::bindings::str::DOMString; use dom::document::Document; use dom::element::{Element, RawLayoutElementHelpers}; @@ -142,7 +142,7 @@ pub trait HTMLTableRowElementLayoutHelpers { } #[allow(unsafe_code)] -impl HTMLTableRowElementLayoutHelpers for LayoutJS { +impl HTMLTableRowElementLayoutHelpers for LayoutDom { fn get_background_color(&self) -> Option { unsafe { (&*self.upcast::().unsafe_get()) diff --git a/components/script/dom/htmltablesectionelement.rs b/components/script/dom/htmltablesectionelement.rs index e2165843b0f..ffaaeea0427 100644 --- a/components/script/dom/htmltablesectionelement.rs +++ b/components/script/dom/htmltablesectionelement.rs @@ -7,7 +7,7 @@ use dom::bindings::codegen::Bindings::HTMLTableSectionElementBinding::{self, HTM use dom::bindings::codegen::Bindings::NodeBinding::NodeMethods; use dom::bindings::error::{ErrorResult, Fallible}; use dom::bindings::inheritance::Castable; -use dom::bindings::root::{LayoutJS, Root, RootedReference}; +use dom::bindings::root::{LayoutDom, Root, RootedReference}; use dom::bindings::str::DOMString; use dom::document::Document; use dom::element::{Element, RawLayoutElementHelpers}; @@ -81,7 +81,7 @@ pub trait HTMLTableSectionElementLayoutHelpers { } #[allow(unsafe_code)] -impl HTMLTableSectionElementLayoutHelpers for LayoutJS { +impl HTMLTableSectionElementLayoutHelpers for LayoutDom { fn get_background_color(&self) -> Option { unsafe { (&*self.upcast::().unsafe_get()) diff --git a/components/script/dom/htmltextareaelement.rs b/components/script/dom/htmltextareaelement.rs index 4958d2d3ca9..6531586ca29 100755 --- a/components/script/dom/htmltextareaelement.rs +++ b/components/script/dom/htmltextareaelement.rs @@ -9,7 +9,7 @@ use dom::bindings::codegen::Bindings::HTMLTextAreaElementBinding; use dom::bindings::codegen::Bindings::HTMLTextAreaElementBinding::HTMLTextAreaElementMethods; use dom::bindings::codegen::Bindings::NodeBinding::NodeMethods; use dom::bindings::inheritance::Castable; -use dom::bindings::root::{LayoutJS, MutNullableDom, Root}; +use dom::bindings::root::{LayoutDom, MutNullableDom, Root}; use dom::bindings::str::DOMString; use dom::document::Document; use dom::element::{AttributeMutation, Element}; @@ -57,7 +57,7 @@ pub trait LayoutHTMLTextAreaElementHelpers { fn get_rows(self) -> u32; } -impl LayoutHTMLTextAreaElementHelpers for LayoutJS { +impl LayoutHTMLTextAreaElementHelpers for LayoutDom { #[allow(unrooted_must_root)] #[allow(unsafe_code)] unsafe fn get_value_for_layout(self) -> String { diff --git a/components/script/dom/mod.rs b/components/script/dom/mod.rs index b14cca5f820..8df3660a3f9 100644 --- a/components/script/dom/mod.rs +++ b/components/script/dom/mod.rs @@ -195,11 +195,11 @@ //! ================================= //! //! Layout code can access the DOM through the -//! [`LayoutJS`](bindings/root/struct.LayoutJS.html) smart pointer. This does not +//! [`LayoutDom`](bindings/root/struct.LayoutDom.html) smart pointer. This does not //! keep the DOM object alive; we ensure that no DOM code (Garbage Collection //! in particular) runs while the layout thread is accessing the DOM. //! -//! Methods accessible to layout are implemented on `LayoutJS` using +//! Methods accessible to layout are implemented on `LayoutDom` using //! `LayoutFooHelpers` traits. #[macro_use] diff --git a/components/script/dom/node.rs b/components/script/dom/node.rs index 2ce11daeb0f..d036e846e57 100644 --- a/components/script/dom/node.rs +++ b/components/script/dom/node.rs @@ -23,7 +23,7 @@ use dom::bindings::inheritance::{Castable, CharacterDataTypeId, ElementTypeId}; use dom::bindings::inheritance::{EventTargetTypeId, HTMLElementTypeId, NodeTypeId}; use dom::bindings::inheritance::{SVGElementTypeId, SVGGraphicsElementTypeId}; use dom::bindings::reflector::{DomObject, reflect_dom_object}; -use dom::bindings::root::{Dom, LayoutJS, MutNullableDom, Root, RootedReference}; +use dom::bindings::root::{Dom, LayoutDom, MutNullableDom, Root, RootedReference}; use dom::bindings::str::{DOMString, USVString}; use dom::bindings::xmlname::namespace_from_domstring; use dom::characterdata::{CharacterData, LayoutCharacterDataHelpers}; @@ -999,13 +999,13 @@ pub unsafe fn from_untrusted_node_address(_runtime: *mut JSRuntime, candidate: U pub trait LayoutNodeHelpers { unsafe fn type_id_for_layout(&self) -> NodeTypeId; - unsafe fn parent_node_ref(&self) -> Option>; - unsafe fn first_child_ref(&self) -> Option>; - unsafe fn last_child_ref(&self) -> Option>; - unsafe fn prev_sibling_ref(&self) -> Option>; - unsafe fn next_sibling_ref(&self) -> Option>; + unsafe fn parent_node_ref(&self) -> Option>; + unsafe fn first_child_ref(&self) -> Option>; + unsafe fn last_child_ref(&self) -> Option>; + unsafe fn prev_sibling_ref(&self) -> Option>; + unsafe fn next_sibling_ref(&self) -> Option>; - unsafe fn owner_doc_for_layout(&self) -> LayoutJS; + unsafe fn owner_doc_for_layout(&self) -> LayoutDom; unsafe fn is_element_for_layout(&self) -> bool; unsafe fn get_flag(&self, flag: NodeFlags) -> bool; @@ -1027,7 +1027,7 @@ pub trait LayoutNodeHelpers { fn opaque(&self) -> OpaqueNode; } -impl LayoutNodeHelpers for LayoutJS { +impl LayoutNodeHelpers for LayoutDom { #[inline] #[allow(unsafe_code)] unsafe fn type_id_for_layout(&self) -> NodeTypeId { @@ -1042,37 +1042,37 @@ impl LayoutNodeHelpers for LayoutJS { #[inline] #[allow(unsafe_code)] - unsafe fn parent_node_ref(&self) -> Option> { + unsafe fn parent_node_ref(&self) -> Option> { (*self.unsafe_get()).parent_node.get_inner_as_layout() } #[inline] #[allow(unsafe_code)] - unsafe fn first_child_ref(&self) -> Option> { + unsafe fn first_child_ref(&self) -> Option> { (*self.unsafe_get()).first_child.get_inner_as_layout() } #[inline] #[allow(unsafe_code)] - unsafe fn last_child_ref(&self) -> Option> { + unsafe fn last_child_ref(&self) -> Option> { (*self.unsafe_get()).last_child.get_inner_as_layout() } #[inline] #[allow(unsafe_code)] - unsafe fn prev_sibling_ref(&self) -> Option> { + unsafe fn prev_sibling_ref(&self) -> Option> { (*self.unsafe_get()).prev_sibling.get_inner_as_layout() } #[inline] #[allow(unsafe_code)] - unsafe fn next_sibling_ref(&self) -> Option> { + unsafe fn next_sibling_ref(&self) -> Option> { (*self.unsafe_get()).next_sibling.get_inner_as_layout() } #[inline] #[allow(unsafe_code)] - unsafe fn owner_doc_for_layout(&self) -> LayoutJS { + unsafe fn owner_doc_for_layout(&self) -> LayoutDom { (*self.unsafe_get()).owner_doc.get_inner_as_layout().unwrap() } diff --git a/components/script/dom/svgsvgelement.rs b/components/script/dom/svgsvgelement.rs index b1ab9ddd50f..e223d7f0b79 100644 --- a/components/script/dom/svgsvgelement.rs +++ b/components/script/dom/svgsvgelement.rs @@ -5,7 +5,7 @@ use dom::attr::Attr; use dom::bindings::codegen::Bindings::SVGSVGElementBinding; use dom::bindings::inheritance::Castable; -use dom::bindings::root::{LayoutJS, Root}; +use dom::bindings::root::{LayoutDom, Root}; use dom::bindings::str::DOMString; use dom::document::Document; use dom::element::{AttributeMutation, Element, RawLayoutElementHelpers}; @@ -49,7 +49,7 @@ pub trait LayoutSVGSVGElementHelpers { fn data(&self) -> SVGSVGData; } -impl LayoutSVGSVGElementHelpers for LayoutJS { +impl LayoutSVGSVGElementHelpers for LayoutDom { #[allow(unsafe_code)] fn data(&self) -> SVGSVGData { unsafe { diff --git a/components/script/dom/webglrenderingcontext.rs b/components/script/dom/webglrenderingcontext.rs index 9f3b9f286e8..6ce1718d799 100644 --- a/components/script/dom/webglrenderingcontext.rs +++ b/components/script/dom/webglrenderingcontext.rs @@ -20,7 +20,7 @@ use dom::bindings::conversions::{ConversionResult, FromJSValConvertible, ToJSVal use dom::bindings::error::{Error, Fallible}; use dom::bindings::inheritance::Castable; use dom::bindings::reflector::{DomObject, Reflector, reflect_dom_object}; -use dom::bindings::root::{Dom, LayoutJS, MutNullableDom, Root}; +use dom::bindings::root::{Dom, LayoutDom, MutNullableDom, Root}; use dom::bindings::str::DOMString; use dom::event::{Event, EventBubbles, EventCancelable}; use dom::htmlcanvaselement::HTMLCanvasElement; @@ -3384,7 +3384,7 @@ pub trait LayoutCanvasWebGLRenderingContextHelpers { unsafe fn canvas_data_source(&self) -> HTMLCanvasDataSource; } -impl LayoutCanvasWebGLRenderingContextHelpers for LayoutJS { +impl LayoutCanvasWebGLRenderingContextHelpers for LayoutDom { #[allow(unsafe_code)] unsafe fn canvas_data_source(&self) -> HTMLCanvasDataSource { HTMLCanvasDataSource::WebGL((*self.unsafe_get()).layout_handle()) diff --git a/components/script/lib.rs b/components/script/lib.rs index d382e95ced8..6a6a40417e3 100644 --- a/components/script/lib.rs +++ b/components/script/lib.rs @@ -141,7 +141,7 @@ mod webdriver_handlers; pub mod layout_exports { pub use dom::bindings::inheritance::{CharacterDataTypeId, ElementTypeId}; pub use dom::bindings::inheritance::{HTMLElementTypeId, NodeTypeId}; - pub use dom::bindings::root::LayoutJS; + pub use dom::bindings::root::LayoutDom; pub use dom::characterdata::LayoutCharacterDataHelpers; pub use dom::document::{Document, LayoutDocumentHelpers, PendingRestyle}; pub use dom::element::{Element, LayoutElementHelpers, RawLayoutElementHelpers}; -- cgit v1.2.3