diff options
-rw-r--r-- | components/script/Cargo.toml | 3 | ||||
-rw-r--r-- | components/script/lib.rs | 1 | ||||
-rw-r--r-- | components/script/parse/html.rs | 5 | ||||
-rw-r--r-- | components/script/parse/xml.rs | 28 | ||||
-rw-r--r-- | components/servo/Cargo.lock | 29 | ||||
-rw-r--r-- | components/util/Cargo.toml | 2 | ||||
-rw-r--r-- | ports/cef/Cargo.lock | 29 | ||||
-rw-r--r-- | ports/gonk/Cargo.lock | 29 | ||||
-rw-r--r-- | tests/wpt/metadata/dom/nodes/Element-tagName.html.ini | 5 |
9 files changed, 79 insertions, 52 deletions
diff --git a/components/script/Cargo.toml b/components/script/Cargo.toml index 0a1c5f9b6b9..c3754adf3fe 100644 --- a/components/script/Cargo.toml +++ b/components/script/Cargo.toml @@ -78,11 +78,10 @@ num = "0.1.24" websocket = "0.14.0" uuid = "0.1.16" smallvec = "0.1" -html5ever = { version = "0.2.1", features = ["unstable"] } +html5ever = { version = "0.4", features = ["unstable"] } selectors = "0.2" string_cache = { version = "0.2", features = ["unstable"] } euclid = {version = "0.4", features = ["plugins"]} -tendril = "0.1.1" rand = "0.3" serde = "0.6" caseless = "0.1.0" diff --git a/components/script/lib.rs b/components/script/lib.rs index 0993d090dd5..a776fe2d484 100644 --- a/components/script/lib.rs +++ b/components/script/lib.rs @@ -66,7 +66,6 @@ extern crate smallvec; #[macro_use(atom, ns)] extern crate string_cache; #[macro_use] extern crate style; -extern crate tendril; extern crate time; extern crate unicase; extern crate url; diff --git a/components/script/parse/html.rs b/components/script/parse/html.rs index dc201402a61..d4ea3cf2093 100644 --- a/components/script/parse/html.rs +++ b/components/script/parse/html.rs @@ -29,13 +29,13 @@ use html5ever::Attribute; use html5ever::serialize::TraversalScope; use html5ever::serialize::TraversalScope::{ChildrenOnly, IncludeNode}; use html5ever::serialize::{AttrRef, Serializable, Serializer}; +use html5ever::tendril::StrTendril; use html5ever::tree_builder::{NextParserState, NodeOrText, QuirksMode, TreeSink}; use msg::constellation_msg::PipelineId; use parse::Parser; use std::borrow::Cow; use std::io::{self, Write}; use string_cache::QualName; -use tendril::StrTendril; use url::Url; use util::str::DOMString; @@ -54,6 +54,9 @@ fn insert(parent: &Node, reference_child: Option<&Node>, child: NodeOrText<JS<No } impl<'a> TreeSink for servohtmlparser::Sink { + type Output = Self; + fn finish(self) -> Self { self } + type Handle = JS<Node>; fn get_document(&mut self) -> JS<Node> { diff --git a/components/script/parse/xml.rs b/components/script/parse/xml.rs index 30cd5138348..6c82e5af358 100644 --- a/components/script/parse/xml.rs +++ b/components/script/parse/xml.rs @@ -19,11 +19,11 @@ use dom::text::Text; use msg::constellation_msg::PipelineId; use parse::Parser; use std::borrow::Cow; -use string_cache::QualName; -use tendril::StrTendril; +use string_cache::{Atom, QualName, Namespace}; use url::Url; use util::str::DOMString; -use xml5ever::tokenizer::Attribute; +use xml5ever::tendril::StrTendril; +use xml5ever::tokenizer::{Attribute, QName}; use xml5ever::tree_builder::{NodeOrText, TreeSink}; impl<'a> TreeSink for servoxmlparser::Sink { @@ -37,22 +37,32 @@ impl<'a> TreeSink for servoxmlparser::Sink { JS::from_ref(self.document.upcast()) } - fn elem_name(&self, target: &JS<Node>) -> QualName { + fn elem_name(&self, target: &JS<Node>) -> QName { let elem = target.downcast::<Element>() .expect("tried to get name of non-Element in XML parsing"); - QualName { - ns: elem.namespace().clone(), + QName { + prefix: elem.prefix().as_ref().map_or(atom!(""), |p| Atom::from(&**p)), + namespace_url: elem.namespace().0.clone(), local: elem.local_name().clone(), } } - fn create_element(&mut self, name: QualName, attrs: Vec<Attribute>) + fn create_element(&mut self, name: QName, attrs: Vec<Attribute>) -> JS<Node> { - let elem = Element::create(name, None, &*self.document, + let prefix = if name.prefix == atom!("") { None } else { Some(name.prefix) }; + let name = QualName { + ns: Namespace(name.namespace_url), + local: name.local, + }; + let elem = Element::create(name, prefix, &*self.document, ElementCreator::ParserCreated); for attr in attrs { - elem.set_attribute_from_parser(attr.name, DOMString::from(String::from(attr.value)), None); + let name = QualName { + ns: Namespace(attr.name.namespace_url), + local: attr.name.local, + }; + elem.set_attribute_from_parser(name, DOMString::from(String::from(attr.value)), None); } JS::from_ref(elem.upcast()) diff --git a/components/servo/Cargo.lock b/components/servo/Cargo.lock index afe8fd8b61c..f8247e209e3 100644 --- a/components/servo/Cargo.lock +++ b/components/servo/Cargo.lock @@ -800,17 +800,16 @@ dependencies = [ [[package]] name = "html5ever" -version = "0.2.11" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "log 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", "mac 0.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "phf 0.7.5 (registry+https://github.com/rust-lang/crates.io-index)", "phf_codegen 0.7.5 (registry+https://github.com/rust-lang/crates.io-index)", - "rc 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)", "string_cache 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", - "tendril 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", + "tendril 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.34 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1515,7 +1514,7 @@ dependencies = [ "euclid 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "fnv 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "gfx_traits 0.0.1", - "html5ever 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", + "html5ever 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "hyper 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", "image 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", "ipc-channel 0.1.0 (git+https://github.com/servo/ipc-channel)", @@ -1537,14 +1536,13 @@ dependencies = [ "smallvec 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "string_cache 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", "style 0.0.1", - "tendril 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.34 (registry+https://github.com/rust-lang/crates.io-index)", "unicase 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", "url 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", "util 0.0.1", "uuid 0.1.18 (registry+https://github.com/rust-lang/crates.io-index)", "websocket 0.14.0 (registry+https://github.com/rust-lang/crates.io-index)", - "xml5ever 0.1.0 (git+https://github.com/Ygg01/xml5ever)", + "xml5ever 0.1.1 (git+https://github.com/Ygg01/xml5ever)", ] [[package]] @@ -1864,12 +1862,13 @@ source = "git+https://github.com/Manishearth/rust-tenacious#3eaa89911cf32b09b869 [[package]] name = "tendril" -version = "0.1.6" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "encoding 0.2.32 (registry+https://github.com/rust-lang/crates.io-index)", "futf 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "mac 0.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "utf-8 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1948,6 +1947,14 @@ dependencies = [ ] [[package]] +name = "utf-8" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "matches 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] name = "util" version = "0.0.1" dependencies = [ @@ -1957,7 +1964,7 @@ dependencies = [ "cssparser 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", "euclid 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "getopts 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)", - "html5ever 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", + "html5ever 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "hyper 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", "ipc-channel 0.1.0 (git+https://github.com/servo/ipc-channel)", "js 0.1.1 (git+https://github.com/servo/rust-mozjs)", @@ -2151,8 +2158,8 @@ dependencies = [ [[package]] name = "xml5ever" -version = "0.1.0" -source = "git+https://github.com/Ygg01/xml5ever#9da3b1628bfcb69a48420f7aef69739d6706aa6a" +version = "0.1.1" +source = "git+https://github.com/Ygg01/xml5ever#a14a2aff974830614435ce246734b899f9aab05b" dependencies = [ "log 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", "mac 0.0.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2161,7 +2168,7 @@ dependencies = [ "rc 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)", "string_cache 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", - "tendril 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", + "tendril 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.34 (registry+https://github.com/rust-lang/crates.io-index)", ] diff --git a/components/util/Cargo.toml b/components/util/Cargo.toml index ad0b43234b3..bd26fcf7626 100644 --- a/components/util/Cargo.toml +++ b/components/util/Cargo.toml @@ -49,7 +49,7 @@ app_units = {version = "0.1", features = ["plugins"]} cssparser = { version = "0.5", features = [ "serde-serialization" ] } log = "0.3" bitflags = "0.3" -html5ever = { version = "0.2.1", features = ["unstable"], optional = true } +html5ever = { version = "0.4", features = ["unstable"], optional = true } libc = "0.2" rand = "0.3" rustc-serialize = "0.3" diff --git a/ports/cef/Cargo.lock b/ports/cef/Cargo.lock index f860549821f..f53ac52827c 100644 --- a/ports/cef/Cargo.lock +++ b/ports/cef/Cargo.lock @@ -759,17 +759,16 @@ dependencies = [ [[package]] name = "html5ever" -version = "0.2.11" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "log 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", "mac 0.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "phf 0.7.5 (registry+https://github.com/rust-lang/crates.io-index)", "phf_codegen 0.7.5 (registry+https://github.com/rust-lang/crates.io-index)", - "rc 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)", "string_cache 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", - "tendril 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", + "tendril 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.34 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1439,7 +1438,7 @@ dependencies = [ "euclid 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "fnv 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "gfx_traits 0.0.1", - "html5ever 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", + "html5ever 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "hyper 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", "image 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", "ipc-channel 0.1.0 (git+https://github.com/servo/ipc-channel)", @@ -1461,14 +1460,13 @@ dependencies = [ "smallvec 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "string_cache 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", "style 0.0.1", - "tendril 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.34 (registry+https://github.com/rust-lang/crates.io-index)", "unicase 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", "url 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", "util 0.0.1", "uuid 0.1.18 (registry+https://github.com/rust-lang/crates.io-index)", "websocket 0.14.0 (registry+https://github.com/rust-lang/crates.io-index)", - "xml5ever 0.1.0 (git+https://github.com/Ygg01/xml5ever)", + "xml5ever 0.1.1 (git+https://github.com/Ygg01/xml5ever)", ] [[package]] @@ -1797,12 +1795,13 @@ source = "git+https://github.com/Manishearth/rust-tenacious#3eaa89911cf32b09b869 [[package]] name = "tendril" -version = "0.1.6" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "encoding 0.2.32 (registry+https://github.com/rust-lang/crates.io-index)", "futf 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "mac 0.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "utf-8 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1881,6 +1880,14 @@ dependencies = [ ] [[package]] +name = "utf-8" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "matches 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] name = "util" version = "0.0.1" dependencies = [ @@ -1890,7 +1897,7 @@ dependencies = [ "cssparser 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", "euclid 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "getopts 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)", - "html5ever 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", + "html5ever 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "hyper 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", "ipc-channel 0.1.0 (git+https://github.com/servo/ipc-channel)", "js 0.1.1 (git+https://github.com/servo/rust-mozjs)", @@ -2073,8 +2080,8 @@ dependencies = [ [[package]] name = "xml5ever" -version = "0.1.0" -source = "git+https://github.com/Ygg01/xml5ever#9da3b1628bfcb69a48420f7aef69739d6706aa6a" +version = "0.1.1" +source = "git+https://github.com/Ygg01/xml5ever#a14a2aff974830614435ce246734b899f9aab05b" dependencies = [ "log 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", "mac 0.0.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2083,7 +2090,7 @@ dependencies = [ "rc 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)", "string_cache 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", - "tendril 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", + "tendril 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.34 (registry+https://github.com/rust-lang/crates.io-index)", ] diff --git a/ports/gonk/Cargo.lock b/ports/gonk/Cargo.lock index 1ab510b4877..20b11349ee4 100644 --- a/ports/gonk/Cargo.lock +++ b/ports/gonk/Cargo.lock @@ -730,17 +730,16 @@ dependencies = [ [[package]] name = "html5ever" -version = "0.2.11" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "log 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", "mac 0.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "phf 0.7.5 (registry+https://github.com/rust-lang/crates.io-index)", "phf_codegen 0.7.5 (registry+https://github.com/rust-lang/crates.io-index)", - "rc 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)", "string_cache 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", - "tendril 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", + "tendril 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.34 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1410,7 +1409,7 @@ dependencies = [ "euclid 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "fnv 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "gfx_traits 0.0.1", - "html5ever 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", + "html5ever 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "hyper 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", "image 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", "ipc-channel 0.1.0 (git+https://github.com/servo/ipc-channel)", @@ -1432,14 +1431,13 @@ dependencies = [ "smallvec 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "string_cache 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", "style 0.0.1", - "tendril 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.34 (registry+https://github.com/rust-lang/crates.io-index)", "unicase 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", "url 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", "util 0.0.1", "uuid 0.1.18 (registry+https://github.com/rust-lang/crates.io-index)", "websocket 0.14.0 (registry+https://github.com/rust-lang/crates.io-index)", - "xml5ever 0.1.0 (git+https://github.com/Ygg01/xml5ever)", + "xml5ever 0.1.1 (git+https://github.com/Ygg01/xml5ever)", ] [[package]] @@ -1766,12 +1764,13 @@ source = "git+https://github.com/Manishearth/rust-tenacious#3eaa89911cf32b09b869 [[package]] name = "tendril" -version = "0.1.6" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "encoding 0.2.32 (registry+https://github.com/rust-lang/crates.io-index)", "futf 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "mac 0.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "utf-8 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1850,6 +1849,14 @@ dependencies = [ ] [[package]] +name = "utf-8" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "matches 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] name = "util" version = "0.0.1" dependencies = [ @@ -1859,7 +1866,7 @@ dependencies = [ "cssparser 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", "euclid 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "getopts 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)", - "html5ever 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", + "html5ever 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "hyper 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", "ipc-channel 0.1.0 (git+https://github.com/servo/ipc-channel)", "js 0.1.1 (git+https://github.com/servo/rust-mozjs)", @@ -2011,8 +2018,8 @@ dependencies = [ [[package]] name = "xml5ever" -version = "0.1.0" -source = "git+https://github.com/Ygg01/xml5ever#9da3b1628bfcb69a48420f7aef69739d6706aa6a" +version = "0.1.1" +source = "git+https://github.com/Ygg01/xml5ever#a14a2aff974830614435ce246734b899f9aab05b" dependencies = [ "log 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", "mac 0.0.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2021,7 +2028,7 @@ dependencies = [ "rc 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)", "string_cache 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", - "tendril 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", + "tendril 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.34 (registry+https://github.com/rust-lang/crates.io-index)", ] diff --git a/tests/wpt/metadata/dom/nodes/Element-tagName.html.ini b/tests/wpt/metadata/dom/nodes/Element-tagName.html.ini deleted file mode 100644 index f9cc02a4f31..00000000000 --- a/tests/wpt/metadata/dom/nodes/Element-tagName.html.ini +++ /dev/null @@ -1,5 +0,0 @@ -[Element-tagName.html] - type: testharness - [tagName should be updated when changing ownerDocument] - expected: FAIL - |