diff options
author | Jinwoo Song <jinwoo7.song@samsung.com> | 2015-04-28 14:09:31 +0900 |
---|---|---|
committer | Jinwoo Song <jinwoo7.song@samsung.com> | 2015-04-29 13:30:21 +0900 |
commit | f404853c99a5e4912bff09882d20e1856fbd405b (patch) | |
tree | 480b9d9e5af1e091bd419d62c0a8e14107647b0b /components/script/dom/text.rs | |
parent | 1e150140bd12624ad357e3168fb496079fb8ec7c (diff) | |
download | servo-f404853c99a5e4912bff09882d20e1856fbd405b.tar.gz servo-f404853c99a5e4912bff09882d20e1856fbd405b.zip |
Make NodeTypeId include CharacterData variant
NodeTypeId is supposed to reflect the WebIDL inheritance hierarchy.
All of Text/ProcessingInstruction/Comment inherit from CharacterData,
which inherits from Node. There should be a CharacterDataTypeId value
that differentiates between those, instead.
Diffstat (limited to 'components/script/dom/text.rs')
-rw-r--r-- | components/script/dom/text.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/components/script/dom/text.rs b/components/script/dom/text.rs index c8430c48809..9cd321bf9ae 100644 --- a/components/script/dom/text.rs +++ b/components/script/dom/text.rs @@ -13,7 +13,7 @@ use dom::bindings::error::{Error, Fallible}; use dom::bindings::global::GlobalRef; use dom::bindings::js::{JSRef, OptionalRootable, Rootable, RootedReference}; use dom::bindings::js::Temporary; -use dom::characterdata::{CharacterData, CharacterDataHelpers}; +use dom::characterdata::{CharacterData, CharacterDataHelpers, CharacterDataTypeId}; use dom::document::Document; use dom::eventtarget::{EventTarget, EventTargetTypeId}; use dom::node::{Node, NodeHelpers, NodeTypeId}; @@ -27,14 +27,14 @@ pub struct Text { impl TextDerived for EventTarget { fn is_text(&self) -> bool { - *self.type_id() == EventTargetTypeId::Node(NodeTypeId::Text) + *self.type_id() == EventTargetTypeId::Node(NodeTypeId::CharacterData(CharacterDataTypeId::Text)) } } impl Text { fn new_inherited(text: DOMString, document: JSRef<Document>) -> Text { Text { - characterdata: CharacterData::new_inherited(NodeTypeId::Text, text, document) + characterdata: CharacterData::new_inherited(CharacterDataTypeId::Text, text, document) } } |