aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/parse
diff options
context:
space:
mode:
authorAnthony Ramine <n.oxyde@gmail.com>2015-08-27 02:11:37 +0200
committerAnthony Ramine <n.oxyde@gmail.com>2015-08-27 16:59:03 +0200
commitc0cff59df895f2ed495bbd29ff5c8c8aec6ed453 (patch)
tree0a14898eec89c162049fc52468e5186c4d6fc9fc /components/script/parse
parent275907f256814e492c53086f455938f11fedaf42 (diff)
downloadservo-c0cff59df895f2ed495bbd29ff5c8c8aec6ed453.tar.gz
servo-c0cff59df895f2ed495bbd29ff5c8c8aec6ed453.zip
Remove SinkHelpers
Method get_or_create() is now directly on servohtmlparser::Sink.
Diffstat (limited to 'components/script/parse')
-rw-r--r--components/script/parse/html.rs20
1 files changed, 1 insertions, 19 deletions
diff --git a/components/script/parse/html.rs b/components/script/parse/html.rs
index 9eabc2bb088..e2a6e483ea6 100644
--- a/components/script/parse/html.rs
+++ b/components/script/parse/html.rs
@@ -24,7 +24,6 @@ use dom::node::{Node, NodeTypeId};
use dom::node::{document_from_node, window_from_node};
use dom::servohtmlparser;
use dom::servohtmlparser::{ServoHTMLParser, FragmentContext};
-use dom::text::Text;
use parse::Parser;
use encoding::types::Encoding;
@@ -33,7 +32,7 @@ use html5ever::Attribute;
use html5ever::serialize::TraversalScope;
use html5ever::serialize::TraversalScope::{IncludeNode, ChildrenOnly};
use html5ever::serialize::{Serializable, Serializer, AttrRef};
-use html5ever::tree_builder::{TreeSink, QuirksMode, NodeOrText, AppendNode, AppendText, NextParserState};
+use html5ever::tree_builder::{NextParserState, NodeOrText, QuirksMode, TreeSink};
use msg::constellation_msg::PipelineId;
use std::borrow::Cow;
use std::io::{self, Write};
@@ -42,23 +41,6 @@ use tendril::StrTendril;
use url::Url;
use util::str::DOMString;
-trait SinkHelpers {
- fn get_or_create(&self, child: NodeOrText<JS<Node>>) -> Root<Node>;
-}
-
-impl SinkHelpers for servohtmlparser::Sink {
- fn get_or_create(&self, child: NodeOrText<JS<Node>>) -> Root<Node> {
- match child {
- AppendNode(n) => n.root(),
- AppendText(t) => {
- let doc = self.document.root();
- let text = Text::new(t.into(), doc.r());
- NodeCast::from_root(text)
- }
- }
- }
-}
-
impl<'a> TreeSink for servohtmlparser::Sink {
type Handle = JS<Node>;
fn get_document(&mut self) -> JS<Node> {