diff options
author | Anthony Ramine <n.oxyde@gmail.com> | 2015-09-28 01:07:32 +0200 |
---|---|---|
committer | Anthony Ramine <n.oxyde@gmail.com> | 2015-10-15 17:30:41 +0200 |
commit | 7d6ea834790445d2ea71ca186484ef59ac2ac268 (patch) | |
tree | f535bc5428961c332e4ffc3e9c948d180817922e /components/script/dom/characterdata.rs | |
parent | 617fc08783d2356e644266d9e9addcd720a7138a (diff) | |
download | servo-7d6ea834790445d2ea71ca186484ef59ac2ac268.tar.gz servo-7d6ea834790445d2ea71ca186484ef59ac2ac268.zip |
Explicitly customise flags of new nodes where needed
Given codegen now generates the various TypeId enums, it seems pointless to
still have to write their respective values in every DOM struct inheriting from
Node just to set the initial IS_IN_DOC flag in Document and IN_ENABLED_STATE in
form controls.
Diffstat (limited to 'components/script/dom/characterdata.rs')
-rw-r--r-- | components/script/dom/characterdata.rs | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/components/script/dom/characterdata.rs b/components/script/dom/characterdata.rs index 0ab605f5dd2..fce14f68c3d 100644 --- a/components/script/dom/characterdata.rs +++ b/components/script/dom/characterdata.rs @@ -6,8 +6,7 @@ use dom::bindings::cell::DOMRefCell; use dom::bindings::codegen::Bindings::CharacterDataBinding::CharacterDataMethods; -use dom::bindings::codegen::InheritTypes::{CharacterDataTypeId, ElementCast}; -use dom::bindings::codegen::InheritTypes::{NodeCast, NodeTypeId}; +use dom::bindings::codegen::InheritTypes::{ElementCast, NodeCast}; use dom::bindings::codegen::UnionTypes::NodeOrString; use dom::bindings::error::{Error, ErrorResult, Fallible}; use dom::bindings::js::{LayoutJS, Root}; @@ -26,9 +25,9 @@ pub struct CharacterData { } impl CharacterData { - pub fn new_inherited(id: CharacterDataTypeId, data: DOMString, document: &Document) -> CharacterData { + pub fn new_inherited(data: DOMString, document: &Document) -> CharacterData { CharacterData { - node: Node::new_inherited(NodeTypeId::CharacterData(id), document), + node: Node::new_inherited(document), data: DOMRefCell::new(data), } } |