From c831369e3effa82aca268843ba61bd2d011bd643 Mon Sep 17 00:00:00 2001 From: Simon Sapin Date: Wed, 28 Sep 2016 02:28:59 +0200 Subject: [PATCH] Move DOMRefCell back into script. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We’re not using it in style after all. --- .../{style/domrefcell.rs => script/dom/bindings/cell.rs} | 7 +++---- components/script/dom/bindings/mod.rs | 3 +-- components/script/dom/bindings/trace.rs | 2 +- components/style/lib.rs | 1 - 4 files changed, 5 insertions(+), 8 deletions(-) rename components/{style/domrefcell.rs => script/dom/bindings/cell.rs} (96%) diff --git a/components/style/domrefcell.rs b/components/script/dom/bindings/cell.rs similarity index 96% rename from components/style/domrefcell.rs rename to components/script/dom/bindings/cell.rs index f33d20b2191..14987db5add 100644 --- a/components/style/domrefcell.rs +++ b/components/script/dom/bindings/cell.rs @@ -4,15 +4,14 @@ //! A shareable mutable container for the DOM. -use refcell::{BorrowError, BorrowMutError, Ref, RefCell, RefMut}; -use thread_state; +use style::refcell::{BorrowError, BorrowMutError, Ref, RefCell, RefMut}; +use style::thread_state; /// A mutable field in the DOM. /// /// This extends the API of `core::cell::RefCell` to allow unsafe access in /// certain situations, with dynamic checking in debug builds. -#[derive(Clone, PartialEq, Debug)] -#[cfg_attr(feature = "servo", derive(HeapSizeOf))] +#[derive(Clone, PartialEq, Debug, HeapSizeOf)] pub struct DOMRefCell { value: RefCell, } diff --git a/components/script/dom/bindings/mod.rs b/components/script/dom/bindings/mod.rs index 4cb10add852..013484a47b9 100644 --- a/components/script/dom/bindings/mod.rs +++ b/components/script/dom/bindings/mod.rs @@ -128,9 +128,8 @@ //! return `Err()` from the method with the appropriate [error value] //! (error/enum.Error.html). -pub use style::domrefcell as cell; - pub mod callback; +pub mod cell; pub mod constant; pub mod conversions; pub mod error; diff --git a/components/script/dom/bindings/trace.rs b/components/script/dom/bindings/trace.rs index 53d141d114c..f71c2b83ef1 100644 --- a/components/script/dom/bindings/trace.rs +++ b/components/script/dom/bindings/trace.rs @@ -35,6 +35,7 @@ use cssparser::RGBA; use devtools_traits::CSSError; use devtools_traits::WorkerId; use dom::abstractworker::SharedRt; +use dom::bindings::cell::DOMRefCell; use dom::bindings::js::{JS, Root}; use dom::bindings::refcounted::{Trusted, TrustedPromise}; use dom::bindings::reflector::{Reflectable, Reflector}; @@ -89,7 +90,6 @@ use std::sync::mpsc::{Receiver, Sender}; use std::time::{SystemTime, Instant}; use string_cache::{Atom, Namespace, QualName}; use style::attr::{AttrIdentifier, AttrValue, LengthOrPercentageOrAuto}; -use style::domrefcell::DOMRefCell; use style::element_state::*; use style::properties::PropertyDeclarationBlock; use style::selector_impl::{ElementSnapshot, PseudoElement}; diff --git a/components/style/lib.rs b/components/style/lib.rs index 51ee0e122e5..c1b8dd874f0 100644 --- a/components/style/lib.rs +++ b/components/style/lib.rs @@ -90,7 +90,6 @@ pub mod context; pub mod custom_properties; pub mod data; pub mod dom; -pub mod domrefcell; pub mod element_state; pub mod error_reporting; pub mod font_face;