diff options
author | Fernando Jiménez Moreno <ferjmoreno@gmail.com> | 2019-03-08 17:03:34 +0100 |
---|---|---|
committer | Fernando Jiménez Moreno <ferjmoreno@gmail.com> | 2019-04-26 12:00:25 +0200 |
commit | 6bf1ca20a282fea83fd3438a11b16081352251df (patch) | |
tree | a76526b5ee9c49a65956243060fc9acd47559533 /components/script/dom/raredata.rs | |
parent | f6069630d29bd49f805756a73b0f60aee2309c18 (diff) | |
download | servo-6bf1ca20a282fea83fd3438a11b16081352251df.tar.gz servo-6bf1ca20a282fea83fd3438a11b16081352251df.zip |
Make Node and Element rare_data an Option
Diffstat (limited to 'components/script/dom/raredata.rs')
-rw-r--r-- | components/script/dom/raredata.rs | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/components/script/dom/raredata.rs b/components/script/dom/raredata.rs index 9ebf8e7d787..874db7b48ad 100644 --- a/components/script/dom/raredata.rs +++ b/components/script/dom/raredata.rs @@ -2,14 +2,12 @@ * 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::cell::DomRefCell; -use crate::dom::bindings::root::MutNullableDom; +use crate::dom::bindings::root::Dom; use crate::dom::customelementregistry::{ CustomElementDefinition, CustomElementReaction, CustomElementState, }; use crate::dom::mutationobserver::RegisteredObserver; use crate::dom::shadowroot::ShadowRoot; -use std::cell::Cell; use std::rc::Rc; #[derive(Default, JSTraceable, MallocSizeOf)] @@ -18,9 +16,9 @@ pub struct NodeRareData { /// The shadow root the node belongs to. /// This is None if the node is not in a shadow tree or /// if it is a ShadowRoot. - pub owner_shadow_root: MutNullableDom<ShadowRoot>, + pub owner_shadow_root: Option<Dom<ShadowRoot>>, /// Registered observers for this node. - pub mutation_observers: DomRefCell<Vec<RegisteredObserver>>, + pub mutation_observers: Vec<RegisteredObserver>, } #[derive(Default, JSTraceable, MallocSizeOf)] @@ -29,12 +27,12 @@ pub struct ElementRareData { /// https://dom.spec.whatwg.org/#dom-element-shadowroot /// XXX This is currently not exposed to web content. Only for /// internal use. - pub shadow_root: MutNullableDom<ShadowRoot>, + pub shadow_root: Option<Dom<ShadowRoot>>, /// <https://html.spec.whatwg.org/multipage/#custom-element-reaction-queue> - pub custom_element_reaction_queue: DomRefCell<Vec<CustomElementReaction>>, + pub custom_element_reaction_queue: Vec<CustomElementReaction>, /// <https://dom.spec.whatwg.org/#concept-element-custom-element-definition> #[ignore_malloc_size_of = "Rc"] - pub custom_element_definition: DomRefCell<Option<Rc<CustomElementDefinition>>>, + pub custom_element_definition: Option<Rc<CustomElementDefinition>>, /// <https://dom.spec.whatwg.org/#concept-element-custom-element-state> - pub custom_element_state: Cell<CustomElementState>, + pub custom_element_state: CustomElementState, } |