Skip to content
This repository has been archived by the owner on Jan 21, 2023. It is now read-only.

Update html5ever to 0.20.0 #38

Merged
merged 1 commit into from
Sep 27, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ doctest = false
[dependencies]
cssparser = "0.13"
matches = "0.1.4"
html5ever = "0.18"
html5ever = "0.20"
selectors = "0.18"

[dev-dependencies]
Expand Down
10 changes: 10 additions & 0 deletions src/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -167,4 +167,14 @@ impl TreeSink for Sink {
fn get_template_contents(&mut self, target: &NodeRef) -> NodeRef {
target.as_element().unwrap().template_contents.clone().unwrap()
}

fn append_based_on_parent_node(
&mut self,
_element: &NodeRef,
_prev_element: &NodeRef,
_child: NodeOrText<NodeRef>,
) {
// FIXME: What to do?
unimplemented!();
}
}
8 changes: 4 additions & 4 deletions src/serializer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ impl Serialize for NodeRef {
fn serialize<S: Serializer>(&self, serializer: &mut S,
traversal_scope: TraversalScope) -> Result<()> {
match (traversal_scope, self.data()) {
(_, &NodeData::Element(ref element)) => {
if traversal_scope == IncludeNode {
(ref scope, &NodeData::Element(ref element)) => {
if *scope == IncludeNode {
try!(serializer.start_elem(
element.name.clone(),
element.attributes.borrow().map.iter().map(|(name, value)| (name, &**value))));
Expand All @@ -23,7 +23,7 @@ impl Serialize for NodeRef {
try!(Serialize::serialize(&child, serializer, IncludeNode));
}

if traversal_scope == IncludeNode {
if *scope == IncludeNode {
try!(serializer.end_elem(element.name.clone()));
}
Ok(())
Expand All @@ -37,7 +37,7 @@ impl Serialize for NodeRef {
Ok(())
}

(ChildrenOnly, _) => Ok(()),
(ChildrenOnly(_), _) => Ok(()),

(IncludeNode, &NodeData::Doctype(ref doctype)) => serializer.write_doctype(&doctype.name),
(IncludeNode, &NodeData::Text(ref text)) => serializer.write_text(&text.borrow()),
Expand Down