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/parse/html.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/parse/html.rs')
-rw-r--r-- | components/script/parse/html.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/components/script/parse/html.rs b/components/script/parse/html.rs index 70880ef34e3..d16177e3a07 100644 --- a/components/script/parse/html.rs +++ b/components/script/parse/html.rs @@ -14,7 +14,7 @@ use dom::bindings::codegen::InheritTypes::ProcessingInstructionCast; use dom::bindings::js::{JS, JSRef, OptionalRootable, Root, Rootable}; use dom::bindings::js::{RootedReference, Temporary}; use dom::bindings::trace::RootedVec; -use dom::characterdata::CharacterDataHelpers; +use dom::characterdata::{CharacterDataHelpers, CharacterDataTypeId}; use dom::comment::Comment; use dom::document::{Document, DocumentHelpers}; use dom::document::{DocumentSource, IsHTMLDocument}; @@ -247,17 +247,17 @@ impl<'a> Serializable for JSRef<'a, Node> { serializer.write_doctype(&doctype.name()) }, - (IncludeNode, NodeTypeId::Text) => { + (IncludeNode, NodeTypeId::CharacterData(CharacterDataTypeId::Text)) => { let cdata = CharacterDataCast::to_ref(node).unwrap(); serializer.write_text(&cdata.data()) }, - (IncludeNode, NodeTypeId::Comment) => { + (IncludeNode, NodeTypeId::CharacterData(CharacterDataTypeId::Comment)) => { let cdata = CharacterDataCast::to_ref(node).unwrap(); serializer.write_comment(&cdata.data()) }, - (IncludeNode, NodeTypeId::ProcessingInstruction) => { + (IncludeNode, NodeTypeId::CharacterData(CharacterDataTypeId::ProcessingInstruction)) => { let pi: JSRef<ProcessingInstruction> = ProcessingInstructionCast::to_ref(node).unwrap(); let data = CharacterDataCast::from_ref(pi).data(); serializer.write_processing_instruction(&pi.target(), &data) |