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/comment.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/comment.rs')
-rw-r--r-- | components/script/dom/comment.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/components/script/dom/comment.rs b/components/script/dom/comment.rs index 9f95d318890..b65384e9ddf 100644 --- a/components/script/dom/comment.rs +++ b/components/script/dom/comment.rs @@ -8,7 +8,7 @@ use dom::bindings::codegen::InheritTypes::CommentDerived; use dom::bindings::error::Fallible; use dom::bindings::global::GlobalRef; use dom::bindings::js::{JSRef, Rootable, Temporary}; -use dom::characterdata::CharacterData; +use dom::characterdata::{CharacterData, CharacterDataTypeId}; use dom::document::Document; use dom::eventtarget::{EventTarget, EventTargetTypeId}; use dom::node::{Node, NodeTypeId}; @@ -22,14 +22,14 @@ pub struct Comment { impl CommentDerived for EventTarget { fn is_comment(&self) -> bool { - *self.type_id() == EventTargetTypeId::Node(NodeTypeId::Comment) + *self.type_id() == EventTargetTypeId::Node(NodeTypeId::CharacterData(CharacterDataTypeId::Comment)) } } impl Comment { fn new_inherited(text: DOMString, document: JSRef<Document>) -> Comment { Comment { - characterdata: CharacterData::new_inherited(NodeTypeId::Comment, text, document) + characterdata: CharacterData::new_inherited(CharacterDataTypeId::Comment, text, document) } } |