diff options
Diffstat (limited to 'components/script/layout_dom')
-rw-r--r-- | components/script/layout_dom/document.rs | 14 | ||||
-rw-r--r-- | components/script/layout_dom/element.rs | 31 | ||||
-rw-r--r-- | components/script/layout_dom/node.rs | 30 | ||||
-rw-r--r-- | components/script/layout_dom/shadow_root.rs | 11 |
4 files changed, 43 insertions, 43 deletions
diff --git a/components/script/layout_dom/document.rs b/components/script/layout_dom/document.rs index 392c1686f97..f068600a005 100644 --- a/components/script/layout_dom/document.rs +++ b/components/script/layout_dom/document.rs @@ -2,21 +2,21 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ -use crate::dom::bindings::root::LayoutDom; -use crate::dom::document::{Document, LayoutDocumentHelpers}; -use crate::dom::node::{LayoutNodeHelpers, Node, NodeFlags}; -use crate::layout_dom::ServoLayoutElement; -use crate::layout_dom::ServoLayoutNode; -use crate::layout_dom::ServoShadowRoot; +use std::marker::PhantomData; + use script_layout_interface::wrapper_traits::LayoutDataTrait; use selectors::matching::QuirksMode; -use std::marker::PhantomData; use style::dom::{TDocument, TNode}; use style::shared_lock::{ SharedRwLock as StyleSharedRwLock, SharedRwLockReadGuard as StyleSharedRwLockReadGuard, }; use style::stylist::Stylist; +use crate::dom::bindings::root::LayoutDom; +use crate::dom::document::{Document, LayoutDocumentHelpers}; +use crate::dom::node::{LayoutNodeHelpers, Node, NodeFlags}; +use crate::layout_dom::{ServoLayoutElement, ServoLayoutNode, ServoShadowRoot}; + // A wrapper around documents that ensures ayout can only ever access safe properties. pub struct ServoLayoutDocument<'dom, LayoutDataType: LayoutDataTrait> { /// The wrapped private DOM Document diff --git a/components/script/layout_dom/element.rs b/components/script/layout_dom/element.rs index 2b1c199cbaa..b923cdb12f8 100644 --- a/components/script/layout_dom/element.rs +++ b/components/script/layout_dom/element.rs @@ -2,15 +2,11 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ -use crate::dom::attr::AttrHelpersForLayout; -use crate::dom::bindings::inheritance::{ - CharacterDataTypeId, DocumentFragmentTypeId, ElementTypeId, -}; -use crate::dom::bindings::inheritance::{HTMLElementTypeId, NodeTypeId, TextTypeId}; -use crate::dom::bindings::root::LayoutDom; -use crate::dom::characterdata::LayoutCharacterDataHelpers; -use crate::dom::element::{Element, LayoutElementHelpers}; -use crate::dom::node::{LayoutNodeHelpers, NodeFlags}; +use std::fmt; +use std::hash::{Hash, Hasher}; +use std::marker::PhantomData; +use std::sync::atomic::Ordering; + use atomic_refcell::{AtomicRef, AtomicRefMut}; use html5ever::{local_name, namespace_url, ns, LocalName, Namespace}; use script_layout_interface::wrapper_traits::{ @@ -23,10 +19,6 @@ use selectors::matching::{ElementSelectorFlags, MatchingContext, VisitedHandling use selectors::sink::Push; use servo_arc::{Arc, ArcBorrow}; use servo_atoms::Atom; -use std::fmt; -use std::hash::{Hash, Hasher}; -use std::marker::PhantomData; -use std::sync::atomic::Ordering; use style::animation::AnimationSetKey; use style::applicable_declarations::ApplicableDeclarationBlock; use style::attr::AttrValue; @@ -43,9 +35,16 @@ use style::shared_lock::Locked as StyleLocked; use style::values::{AtomIdent, AtomString}; use style::CaseSensitivityExt; -use crate::layout_dom::ServoLayoutNode; -use crate::layout_dom::ServoShadowRoot; -use crate::layout_dom::ServoThreadSafeLayoutNode; +use crate::dom::attr::AttrHelpersForLayout; +use crate::dom::bindings::inheritance::{ + CharacterDataTypeId, DocumentFragmentTypeId, ElementTypeId, HTMLElementTypeId, NodeTypeId, + TextTypeId, +}; +use crate::dom::bindings::root::LayoutDom; +use crate::dom::characterdata::LayoutCharacterDataHelpers; +use crate::dom::element::{Element, LayoutElementHelpers}; +use crate::dom::node::{LayoutNodeHelpers, NodeFlags}; +use crate::layout_dom::{ServoLayoutNode, ServoShadowRoot, ServoThreadSafeLayoutNode}; /// A wrapper around elements that ensures layout can only ever access safe properties. pub struct ServoLayoutElement<'dom, LayoutDataType: LayoutDataTrait> { diff --git a/components/script/layout_dom/node.rs b/components/script/layout_dom/node.rs index 7674a10e743..521e20957f7 100644 --- a/components/script/layout_dom/node.rs +++ b/components/script/layout_dom/node.rs @@ -4,17 +4,11 @@ #![allow(unsafe_code)] -use super::ServoLayoutDocument; -use super::ServoLayoutElement; -use super::ServoShadowRoot; -use super::ServoThreadSafeLayoutElement; -use crate::dom::bindings::inheritance::CharacterDataTypeId; -use crate::dom::bindings::inheritance::{NodeTypeId, TextTypeId}; -use crate::dom::bindings::root::LayoutDom; -use crate::dom::characterdata::LayoutCharacterDataHelpers; -use crate::dom::element::{Element, LayoutElementHelpers}; -use crate::dom::node::{LayoutNodeHelpers, Node, NodeFlags}; -use crate::dom::text::Text; +use std::borrow::Cow; +use std::fmt; +use std::marker::PhantomData; +use std::sync::Arc as StdArc; + use atomic_refcell::AtomicRefCell; use gfx_traits::ByteIndex; use html5ever::{local_name, namespace_url, ns}; @@ -31,16 +25,22 @@ use script_layout_interface::{ }; use servo_arc::Arc; use servo_url::ServoUrl; -use std::borrow::Cow; -use std::fmt; -use std::marker::PhantomData; -use std::sync::Arc as StdArc; use style; use style::context::SharedStyleContext; use style::dom::{NodeInfo, TElement, TNode, TShadowRoot}; use style::properties::ComputedValues; use style::str::is_whitespace; +use super::{ + ServoLayoutDocument, ServoLayoutElement, ServoShadowRoot, ServoThreadSafeLayoutElement, +}; +use crate::dom::bindings::inheritance::{CharacterDataTypeId, NodeTypeId, TextTypeId}; +use crate::dom::bindings::root::LayoutDom; +use crate::dom::characterdata::LayoutCharacterDataHelpers; +use crate::dom::element::{Element, LayoutElementHelpers}; +use crate::dom::node::{LayoutNodeHelpers, Node, NodeFlags}; +use crate::dom::text::Text; + /// A wrapper around a `LayoutDom<Node>` which provides a safe interface that /// can be used during layout. This implements the `LayoutNode` trait as well as /// several style and selectors traits for use during layout. This version diff --git a/components/script/layout_dom/shadow_root.rs b/components/script/layout_dom/shadow_root.rs index 19336befe74..7bd57a8ee84 100644 --- a/components/script/layout_dom/shadow_root.rs +++ b/components/script/layout_dom/shadow_root.rs @@ -2,17 +2,18 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ -use crate::dom::bindings::root::LayoutDom; -use crate::dom::shadowroot::{LayoutShadowRootHelpers, ShadowRoot}; -use crate::layout_dom::ServoLayoutElement; -use crate::layout_dom::ServoLayoutNode; -use script_layout_interface::wrapper_traits::LayoutDataTrait; use std::fmt; use std::marker::PhantomData; + +use script_layout_interface::wrapper_traits::LayoutDataTrait; use style::dom::TShadowRoot; use style::shared_lock::SharedRwLockReadGuard as StyleSharedRwLockReadGuard; use style::stylist::{CascadeData, Stylist}; +use crate::dom::bindings::root::LayoutDom; +use crate::dom::shadowroot::{LayoutShadowRootHelpers, ShadowRoot}; +use crate::layout_dom::{ServoLayoutElement, ServoLayoutNode}; + pub struct ServoShadowRoot<'dom, LayoutDataType: LayoutDataTrait> { /// The wrapped private DOM ShadowRoot. shadow_root: LayoutDom<'dom, ShadowRoot>, |