diff options
104 files changed, 363 insertions, 471 deletions
diff --git a/Cargo.lock b/Cargo.lock index de6a44940d0..9e00ee76e97 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1150,34 +1150,18 @@ dependencies = [ [[package]] name = "html5ever" -version = "0.15.0" +version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "heapsize 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", - "heapsize_derive 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", - "html5ever-atoms 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", "mac 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "phf 0.7.21 (registry+https://github.com/rust-lang/crates.io-index)", - "phf_codegen 0.7.21 (registry+https://github.com/rust-lang/crates.io-index)", + "markup5ever 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "quote 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)", "syn 0.11.11 (registry+https://github.com/rust-lang/crates.io-index)", "tendril 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] -name = "html5ever-atoms" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "heapsize 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", - "heapsize_derive 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", - "string_cache 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", - "string_cache_codegen 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] name = "httparse" version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -1378,7 +1362,7 @@ dependencies = [ "gfx 0.0.1", "gfx_traits 0.0.1", "heapsize 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", - "html5ever-atoms 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "html5ever 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)", "ipc-channel 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.22 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1574,6 +1558,21 @@ dependencies = [ ] [[package]] +name = "markup5ever" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "heapsize 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", + "heapsize_derive 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", + "phf 0.7.21 (registry+https://github.com/rust-lang/crates.io-index)", + "phf_codegen 0.7.21 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)", + "string_cache 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", + "string_cache_codegen 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "tendril 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] name = "matches" version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -2279,8 +2278,7 @@ dependencies = [ "gfx_traits 0.0.1", "heapsize 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", "heapsize_derive 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", - "html5ever 0.15.0 (registry+https://github.com/rust-lang/crates.io-index)", - "html5ever-atoms 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "html5ever 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)", "hyper 0.10.9 (registry+https://github.com/rust-lang/crates.io-index)", "hyper_serde 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", "image 0.12.4 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2328,7 +2326,7 @@ dependencies = [ "webrender_traits 0.36.0 (git+https://github.com/servo/webrender)", "webvr 0.0.1", "webvr_traits 0.0.1", - "xml5ever 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", + "xml5ever 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -2343,7 +2341,7 @@ dependencies = [ "gfx_traits 0.0.1", "heapsize 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", "heapsize_derive 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", - "html5ever-atoms 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "html5ever 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)", "ipc-channel 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.22 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2768,7 +2766,7 @@ dependencies = [ "fnv 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", "heapsize 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", "heapsize_derive 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", - "html5ever-atoms 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "html5ever 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)", "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2803,7 +2801,7 @@ dependencies = [ "app_units 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "cssparser 0.13.1 (registry+https://github.com/rust-lang/crates.io-index)", "euclid 0.11.3 (registry+https://github.com/rust-lang/crates.io-index)", - "html5ever-atoms 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "html5ever 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", "rayon 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3327,15 +3325,12 @@ dependencies = [ [[package]] name = "xml5ever" -version = "0.5.0" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "html5ever-atoms 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", "mac 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "phf 0.7.21 (registry+https://github.com/rust-lang/crates.io-index)", - "phf_codegen 0.7.21 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)", + "markup5ever 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "tendril 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -3439,8 +3434,7 @@ dependencies = [ "checksum heapsize_derive 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "46f96d52fb1564059fc97b85ef6165728cc30198ab60073bf114c66c4c89bb5d" "checksum heartbeats-simple 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "9ad003ce233955e9d95f2c69cde84e68302ba9ba4a673d351c9bff93c738aadc" "checksum heartbeats-simple-sys 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "e1a408c0011427cc0e0049f7861c70377819aedfc006e8c901b1c70fd98fb1a4" -"checksum html5ever 0.15.0 (registry+https://github.com/rust-lang/crates.io-index)" = "89a83ad398346d1f25b21979dd79ed7b5c345796194665b34321b5551726347e" -"checksum html5ever-atoms 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8e4a291981feff7291514f8219d5cd2c740d0c042d75cff248a7c00a025f9d40" +"checksum html5ever 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)" = "83d2f9d3abeac56d8b4de9fd033473f6183b89ea91e635326b2807b6a14e98b9" "checksum httparse 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "a6e7a63e511f9edffbab707141fbb8707d1a3098615fb2adbd5769cdfcc9b17d" "checksum hyper 0.10.9 (registry+https://github.com/rust-lang/crates.io-index)" = "94da93321c171e26481afeebe8288757b0501901b7c5492648163d8ec4942ec5" "checksum hyper-openssl 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "85a372eb692590b3fe014c196c30f9f52d4c42f58cd49dd94caeee1593c9cc37" @@ -3470,6 +3464,7 @@ dependencies = [ "checksum lzw 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7d947cbb889ed21c2a84be6ffbaebf5b4e0f4340638cba0444907e38b56be084" "checksum mac 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c41e0c4fef86961ac6d6f8a82609f55f31b05e4fce149ac5710e439df7619ba4" "checksum malloc_buf 0.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "62bb907fe88d54d8d9ce32a3cceab4218ed2f6b7d35617cafe9adf84e43919cb" +"checksum markup5ever 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a614f301a2d5583894d1915a8c6bd2c473e80fba69263a60cf2677dbc49936f8" "checksum matches 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "efd7622e3022e1a6eaa602c4cea8912254e5582c9c692e9167714182244801b1" "checksum memchr 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "1dbccc0e46f1ea47b9f17e6d67c5a96bd27030519c519c9c91327e31275a47b4" "checksum metadeps 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "829fffe7ea1d747e23f64be972991bc516b2f1ac2ae4a3b33d8bea150c410151" @@ -3606,4 +3601,4 @@ dependencies = [ "checksum xdg 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a66b7c2281ebde13cf4391d70d4c7e5946c3c25e72a7b859ca8f677dcd0b0c61" "checksum xi-unicode 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "12ea8eda4b1eb72f02d148402e23832d56a33f55d8c1b2d5bcdde91d79d47cb1" "checksum xml-rs 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "f2b15eed12692bd59d15e98ee7f8dc8408465b992d8ddb4d1672c24865132ec7" -"checksum xml5ever 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a1aae5379a4a7ffb580300bb725696ce238bec993a7bad872ec09ea00ec1c4a5" +"checksum xml5ever 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b5bbbde15cfe438463d4e48dc0c752e427a29766d144e3304594ad0c5813cbf9" diff --git a/components/layout/Cargo.toml b/components/layout/Cargo.toml index cdeb2f09103..dee003a53b4 100644 --- a/components/layout/Cargo.toml +++ b/components/layout/Cargo.toml @@ -20,7 +20,7 @@ fnv = "1.0" gfx = {path = "../gfx"} gfx_traits = {path = "../gfx_traits"} heapsize = "0.3.0" -html5ever-atoms = "0.3" +html5ever = "0.16" ipc-channel = "0.7" libc = "0.2" log = "0.3.5" diff --git a/components/layout/lib.rs b/components/layout/lib.rs index 4c5bd766e24..7788c9a667d 100644 --- a/components/layout/lib.rs +++ b/components/layout/lib.rs @@ -22,7 +22,7 @@ extern crate fnv; extern crate gfx; extern crate gfx_traits; extern crate heapsize; -#[macro_use] extern crate html5ever_atoms; +#[macro_use] extern crate html5ever; extern crate ipc_channel; extern crate libc; #[macro_use] diff --git a/components/script/Cargo.toml b/components/script/Cargo.toml index f145e8f65b0..76facbdc2ec 100644 --- a/components/script/Cargo.toml +++ b/components/script/Cargo.toml @@ -46,8 +46,7 @@ fnv = "1.0" gfx_traits = {path = "../gfx_traits"} heapsize = "0.3.6" heapsize_derive = "0.1" -html5ever = {version = "0.15", features = ["heap_size", "unstable"]} -html5ever-atoms = {version = "0.3", features = ["heap_size"]} +html5ever = {version = "0.16", features = ["heap_size", "unstable"]} hyper = "0.10" hyper_serde = "0.6" image = "0.12" @@ -88,7 +87,7 @@ time = "0.1.12" unicode-segmentation = "1.1.0" url = {version = "1.2", features = ["heap_size", "query_encoding"]} uuid = {version = "0.4", features = ["v4"]} -xml5ever = {version = "0.5", features = ["unstable"]} +xml5ever = {version = "0.6", features = ["unstable"]} webrender_traits = {git = "https://github.com/servo/webrender", features = ["ipc"]} webvr = {path = "../webvr"} webvr_traits = {path = "../webvr_traits"} diff --git a/components/script/dom/attr.rs b/components/script/dom/attr.rs index 55f2adcfdb6..3c775ffdf57 100644 --- a/components/script/dom/attr.rs +++ b/components/script/dom/attr.rs @@ -13,7 +13,7 @@ use dom::element::{AttributeMutation, Element}; use dom::virtualmethods::vtable_for; use dom::window::Window; use dom_struct::dom_struct; -use html5ever_atoms::{Prefix, LocalName, Namespace}; +use html5ever::{Prefix, LocalName, Namespace}; use servo_atoms::Atom; use std::borrow::ToOwned; use std::cell::Ref; diff --git a/components/script/dom/bindings/str.rs b/components/script/dom/bindings/str.rs index e75958d974a..6cb17fae4e3 100644 --- a/components/script/dom/bindings/str.rs +++ b/components/script/dom/bindings/str.rs @@ -4,7 +4,7 @@ //! The `ByteString` struct. -use html5ever_atoms::{LocalName, Namespace}; +use html5ever::{LocalName, Namespace}; use servo_atoms::Atom; use std::ascii::AsciiExt; use std::borrow::{Borrow, Cow, ToOwned}; diff --git a/components/script/dom/bindings/trace.rs b/components/script/dom/bindings/trace.rs index 1bc9c165fb1..11cca130e7f 100644 --- a/components/script/dom/bindings/trace.rs +++ b/components/script/dom/bindings/trace.rs @@ -47,8 +47,8 @@ use euclid::{Matrix2D, Matrix4D, Point2D}; use euclid::length::Length as EuclidLength; use euclid::rect::Rect; use euclid::size::Size2D; -use html5ever::tokenizer::buffer_queue::BufferQueue; -use html5ever_atoms::{Prefix, LocalName, Namespace, QualName}; +use html5ever::{Prefix, LocalName, Namespace, QualName}; +use html5ever::buffer_queue::BufferQueue; use hyper::header::Headers; use hyper::method::Method; use hyper::mime::Mime; diff --git a/components/script/dom/bindings/xmlname.rs b/components/script/dom/bindings/xmlname.rs index 4522c9c4ac0..e688052fba8 100644 --- a/components/script/dom/bindings/xmlname.rs +++ b/components/script/dom/bindings/xmlname.rs @@ -6,7 +6,7 @@ use dom::bindings::error::{Error, ErrorResult, Fallible}; use dom::bindings::str::DOMString; -use html5ever_atoms::{Prefix, LocalName, Namespace}; +use html5ever::{Prefix, LocalName, Namespace}; /// Validate a qualified name. See https://dom.spec.whatwg.org/#validate for details. pub fn validate_qualified_name(qualified_name: &str) -> ErrorResult { diff --git a/components/script/dom/create.rs b/components/script/dom/create.rs index 7c9a9eeea9c..ad5c4f2c763 100644 --- a/components/script/dom/create.rs +++ b/components/script/dom/create.rs @@ -77,7 +77,7 @@ use dom::htmlulistelement::HTMLUListElement; use dom::htmlunknownelement::HTMLUnknownElement; use dom::htmlvideoelement::HTMLVideoElement; use dom::svgsvgelement::SVGSVGElement; -use html5ever_atoms::{Prefix, QualName}; +use html5ever::QualName; use servo_config::prefs::PREFS; fn create_svg_element(name: QualName, @@ -274,13 +274,12 @@ fn create_html_element(name: QualName, } pub fn create_element(name: QualName, - prefix: Option<Prefix>, document: &Document, creator: ElementCreator) -> Root<Element> { // FIXME(ajeffrey): Convert directly from Prefix to DOMString. - let prefix = prefix.map(|p| DOMString::from(&*p)); + let prefix = name.prefix.as_ref().map(|p| DOMString::from(&**p)); match name.ns { ns!(html) => create_html_element(name, prefix, document, creator), diff --git a/components/script/dom/document.rs b/components/script/dom/document.rs index 06b8f7596cf..86fc09406ab 100644 --- a/components/script/dom/document.rs +++ b/components/script/dom/document.rs @@ -93,7 +93,7 @@ use dom_struct::dom_struct; use encoding::EncodingRef; use encoding::all::UTF_8; use euclid::point::Point2D; -use html5ever_atoms::{LocalName, QualName}; +use html5ever::{LocalName, QualName}; use hyper::header::{Header, SetCookie}; use hyper_serde::Serde; use ipc_channel::ipc::{self, IpcSender}; @@ -2733,7 +2733,7 @@ impl DocumentMethods for Document { -> Root<HTMLCollection> { let ns = namespace_from_domstring(maybe_ns); let local = LocalName::from(tag_name); - let qname = QualName::new(ns, local); + let qname = QualName::new(None, ns, local); match self.tagns_map.borrow_mut().entry(qname.clone()) { Occupied(entry) => Root::from_ref(entry.get()), Vacant(entry) => { @@ -2782,8 +2782,8 @@ impl DocumentMethods for Document { ns!() }; - let name = QualName::new(ns, LocalName::from(local_name)); - Ok(Element::create(name, None, self, ElementCreator::ScriptCreated)) + let name = QualName::new(None, ns, LocalName::from(local_name)); + Ok(Element::create(name, self, ElementCreator::ScriptCreated)) } // https://dom.spec.whatwg.org/#dom-document-createelementns @@ -2793,8 +2793,8 @@ impl DocumentMethods for Document { -> Fallible<Root<Element>> { let (namespace, prefix, local_name) = try!(validate_and_extract(namespace, &qualified_name)); - let name = QualName::new(namespace, local_name); - Ok(Element::create(name, prefix, self, ElementCreator::ScriptCreated)) + let name = QualName::new(prefix, namespace, local_name); + Ok(Element::create(name, self, ElementCreator::ScriptCreated)) } // https://dom.spec.whatwg.org/#dom-document-createattribute @@ -3047,8 +3047,8 @@ impl DocumentMethods for Document { match elem { Some(elem) => Root::upcast::<Node>(elem), None => { - let name = QualName::new(ns!(svg), local_name!("title")); - let elem = Element::create(name, None, self, ElementCreator::ScriptCreated); + let name = QualName::new(None, ns!(svg), local_name!("title")); + let elem = Element::create(name, self, ElementCreator::ScriptCreated); let parent = root.upcast::<Node>(); let child = elem.upcast::<Node>(); parent.InsertBefore(child, parent.GetFirstChild().r()) @@ -3064,9 +3064,8 @@ impl DocumentMethods for Document { None => { match self.GetHead() { Some(head) => { - let name = QualName::new(ns!(html), local_name!("title")); + let name = QualName::new(None, ns!(html), local_name!("title")); let elem = Element::create(name, - None, self, ElementCreator::ScriptCreated); head.upcast::<Node>() diff --git a/components/script/dom/domtokenlist.rs b/components/script/dom/domtokenlist.rs index 28266709f67..b07a4357e83 100644 --- a/components/script/dom/domtokenlist.rs +++ b/components/script/dom/domtokenlist.rs @@ -12,7 +12,7 @@ use dom::bindings::str::DOMString; use dom::element::Element; use dom::node::window_from_node; use dom_struct::dom_struct; -use html5ever_atoms::LocalName; +use html5ever::LocalName; use servo_atoms::Atom; use style::str::HTML_SPACE_CHARACTERS; diff --git a/components/script/dom/element.rs b/components/script/dom/element.rs index d6974fb9075..517af0bcd44 100644 --- a/components/script/dom/element.rs +++ b/components/script/dom/element.rs @@ -75,11 +75,11 @@ use dom::validation::Validatable; use dom::virtualmethods::{VirtualMethods, vtable_for}; use dom::window::ReflowReason; use dom_struct::dom_struct; +use html5ever::{Prefix, LocalName, Namespace, QualName}; use html5ever::serialize; use html5ever::serialize::SerializeOpts; use html5ever::serialize::TraversalScope; use html5ever::serialize::TraversalScope::{ChildrenOnly, IncludeNode}; -use html5ever_atoms::{Prefix, LocalName, Namespace, QualName}; use js::jsapi::{HandleValue, JSAutoCompartment}; use net_traits::request::CorsSettings; use ref_filter_map::ref_filter_map; @@ -195,10 +195,10 @@ impl<'a> TryFrom<&'a str> for AdjacentPosition { // Element methods // impl Element { - pub fn create(name: QualName, prefix: Option<Prefix>, + pub fn create(name: QualName, document: &Document, creator: ElementCreator) -> Root<Element> { - create_element(name, prefix, document, creator) + create_element(name, document, creator) } pub fn new_inherited(local_name: LocalName, @@ -1955,8 +1955,8 @@ impl ElementMethods for Element { // Step 4. NodeTypeId::DocumentFragment => { - let body_elem = Element::create(QualName::new(ns!(html), local_name!("body")), - None, &context_document, + let body_elem = Element::create(QualName::new(None, ns!(html), local_name!("body")), + &context_document, ElementCreator::ScriptCreated); Root::upcast(body_elem) }, diff --git a/components/script/dom/formdata.rs b/components/script/dom/formdata.rs index af4c692e7d9..2d8657e3564 100644 --- a/components/script/dom/formdata.rs +++ b/components/script/dom/formdata.rs @@ -17,7 +17,7 @@ use dom::file::File; use dom::globalscope::GlobalScope; use dom::htmlformelement::{HTMLFormElement, FormDatumValue, FormDatum}; use dom_struct::dom_struct; -use html5ever_atoms::LocalName; +use html5ever::LocalName; use std::collections::HashMap; use std::collections::hash_map::Entry::{Occupied, Vacant}; use std::iter; diff --git a/components/script/dom/htmlanchorelement.rs b/components/script/dom/htmlanchorelement.rs index a139afe0384..4468f1ed8b3 100644 --- a/components/script/dom/htmlanchorelement.rs +++ b/components/script/dom/htmlanchorelement.rs @@ -25,7 +25,7 @@ use dom::node::{Node, document_from_node}; use dom::urlhelper::UrlHelper; use dom::virtualmethods::VirtualMethods; use dom_struct::dom_struct; -use html5ever_atoms::LocalName; +use html5ever::LocalName; use net_traits::ReferrerPolicy; use num_traits::ToPrimitive; use script_traits::MozBrowserEvent; diff --git a/components/script/dom/htmlappletelement.rs b/components/script/dom/htmlappletelement.rs index 73de3061cfe..35b1109d5b8 100644 --- a/components/script/dom/htmlappletelement.rs +++ b/components/script/dom/htmlappletelement.rs @@ -12,7 +12,7 @@ use dom::htmlelement::HTMLElement; use dom::node::Node; use dom::virtualmethods::VirtualMethods; use dom_struct::dom_struct; -use html5ever_atoms::LocalName; +use html5ever::LocalName; use style::attr::AttrValue; #[dom_struct] diff --git a/components/script/dom/htmlareaelement.rs b/components/script/dom/htmlareaelement.rs index 724deb2bdcd..61f43c4d7e0 100644 --- a/components/script/dom/htmlareaelement.rs +++ b/components/script/dom/htmlareaelement.rs @@ -20,7 +20,7 @@ use dom::node::{Node, document_from_node}; use dom::virtualmethods::VirtualMethods; use dom_struct::dom_struct; use euclid::point::Point2D; -use html5ever_atoms::LocalName; +use html5ever::LocalName; use net_traits::ReferrerPolicy; use std::default::Default; use std::f32; diff --git a/components/script/dom/htmlaudioelement.rs b/components/script/dom/htmlaudioelement.rs index bb8b12f06d6..df832313cd4 100644 --- a/components/script/dom/htmlaudioelement.rs +++ b/components/script/dom/htmlaudioelement.rs @@ -9,7 +9,7 @@ use dom::document::Document; use dom::htmlmediaelement::HTMLMediaElement; use dom::node::Node; use dom_struct::dom_struct; -use html5ever_atoms::LocalName; +use html5ever::LocalName; #[dom_struct] pub struct HTMLAudioElement { diff --git a/components/script/dom/htmlbaseelement.rs b/components/script/dom/htmlbaseelement.rs index fe34e6d77f0..3fa4093e737 100644 --- a/components/script/dom/htmlbaseelement.rs +++ b/components/script/dom/htmlbaseelement.rs @@ -14,7 +14,7 @@ use dom::htmlelement::HTMLElement; use dom::node::{Node, UnbindContext, document_from_node}; use dom::virtualmethods::VirtualMethods; use dom_struct::dom_struct; -use html5ever_atoms::LocalName; +use html5ever::LocalName; use servo_url::ServoUrl; use style::attr::AttrValue; diff --git a/components/script/dom/htmlbodyelement.rs b/components/script/dom/htmlbodyelement.rs index ef2855fa512..432c15334ba 100644 --- a/components/script/dom/htmlbodyelement.rs +++ b/components/script/dom/htmlbodyelement.rs @@ -18,7 +18,7 @@ use dom::htmlelement::HTMLElement; use dom::node::{Node, document_from_node, window_from_node}; use dom::virtualmethods::VirtualMethods; use dom_struct::dom_struct; -use html5ever_atoms::LocalName; +use html5ever::LocalName; use script_traits::ScriptMsg as ConstellationMsg; use servo_url::ServoUrl; use style::attr::AttrValue; diff --git a/components/script/dom/htmlbrelement.rs b/components/script/dom/htmlbrelement.rs index ebe6ed43706..c247cdd6123 100644 --- a/components/script/dom/htmlbrelement.rs +++ b/components/script/dom/htmlbrelement.rs @@ -9,7 +9,7 @@ use dom::document::Document; use dom::htmlelement::HTMLElement; use dom::node::Node; use dom_struct::dom_struct; -use html5ever_atoms::LocalName; +use html5ever::LocalName; #[dom_struct] pub struct HTMLBRElement { diff --git a/components/script/dom/htmlbuttonelement.rs b/components/script/dom/htmlbuttonelement.rs index b36b276bfd7..5378fc031f5 100755 --- a/components/script/dom/htmlbuttonelement.rs +++ b/components/script/dom/htmlbuttonelement.rs @@ -24,7 +24,7 @@ use dom::validation::Validatable; use dom::validitystate::{ValidityState, ValidationFlags}; use dom::virtualmethods::VirtualMethods; use dom_struct::dom_struct; -use html5ever_atoms::LocalName; +use html5ever::LocalName; use std::cell::Cell; use std::default::Default; use style::element_state::*; diff --git a/components/script/dom/htmlcanvaselement.rs b/components/script/dom/htmlcanvaselement.rs index 577537b421f..9d80db225d6 100644 --- a/components/script/dom/htmlcanvaselement.rs +++ b/components/script/dom/htmlcanvaselement.rs @@ -27,7 +27,7 @@ use dom::virtualmethods::VirtualMethods; use dom::webglrenderingcontext::{LayoutCanvasWebGLRenderingContextHelpers, WebGLRenderingContext}; use dom_struct::dom_struct; use euclid::size::Size2D; -use html5ever_atoms::LocalName; +use html5ever::LocalName; use image::ColorType; use image::png::PNGEncoder; use ipc_channel::ipc::{self, IpcSender}; diff --git a/components/script/dom/htmlcollection.rs b/components/script/dom/htmlcollection.rs index 4e05de86922..aff4125a29f 100644 --- a/components/script/dom/htmlcollection.rs +++ b/components/script/dom/htmlcollection.rs @@ -14,7 +14,7 @@ use dom::element::Element; use dom::node::Node; use dom::window::Window; use dom_struct::dom_struct; -use html5ever_atoms::{LocalName, QualName}; +use html5ever::{LocalName, QualName}; use servo_atoms::Atom; use std::cell::Cell; use style::str::split_html_space_chars; @@ -164,7 +164,7 @@ impl HTMLCollection { maybe_ns: Option<DOMString>) -> Root<HTMLCollection> { let local = LocalName::from(tag); let ns = namespace_from_domstring(maybe_ns); - let qname = QualName::new(ns, local); + let qname = QualName::new(None, ns, local); HTMLCollection::by_qual_tag_name(window, root, qname) } diff --git a/components/script/dom/htmldataelement.rs b/components/script/dom/htmldataelement.rs index 8dc53d9860b..51e1fc10c71 100644 --- a/components/script/dom/htmldataelement.rs +++ b/components/script/dom/htmldataelement.rs @@ -10,7 +10,7 @@ use dom::document::Document; use dom::htmlelement::HTMLElement; use dom::node::Node; use dom_struct::dom_struct; -use html5ever_atoms::LocalName; +use html5ever::LocalName; #[dom_struct] pub struct HTMLDataElement { diff --git a/components/script/dom/htmldatalistelement.rs b/components/script/dom/htmldatalistelement.rs index 48c39c500ed..13efb1b772c 100644 --- a/components/script/dom/htmldatalistelement.rs +++ b/components/script/dom/htmldatalistelement.rs @@ -14,7 +14,7 @@ use dom::htmlelement::HTMLElement; use dom::htmloptionelement::HTMLOptionElement; use dom::node::{Node, window_from_node}; use dom_struct::dom_struct; -use html5ever_atoms::LocalName; +use html5ever::LocalName; #[dom_struct] pub struct HTMLDataListElement { diff --git a/components/script/dom/htmldetailselement.rs b/components/script/dom/htmldetailselement.rs index 1937c8f09b6..a48219926fd 100644 --- a/components/script/dom/htmldetailselement.rs +++ b/components/script/dom/htmldetailselement.rs @@ -16,7 +16,7 @@ use dom::htmlelement::HTMLElement; use dom::node::{Node, window_from_node}; use dom::virtualmethods::VirtualMethods; use dom_struct::dom_struct; -use html5ever_atoms::LocalName; +use html5ever::LocalName; use script_thread::Runnable; use std::cell::Cell; use task_source::TaskSource; diff --git a/components/script/dom/htmldialogelement.rs b/components/script/dom/htmldialogelement.rs index 37b38ed82dc..00bc71147b2 100644 --- a/components/script/dom/htmldialogelement.rs +++ b/components/script/dom/htmldialogelement.rs @@ -14,7 +14,7 @@ use dom::eventtarget::EventTarget; use dom::htmlelement::HTMLElement; use dom::node::{Node, window_from_node}; use dom_struct::dom_struct; -use html5ever_atoms::LocalName; +use html5ever::LocalName; #[dom_struct] pub struct HTMLDialogElement { diff --git a/components/script/dom/htmldirectoryelement.rs b/components/script/dom/htmldirectoryelement.rs index aa24adcfacf..a6dd2bc9cb6 100644 --- a/components/script/dom/htmldirectoryelement.rs +++ b/components/script/dom/htmldirectoryelement.rs @@ -9,7 +9,7 @@ use dom::document::Document; use dom::htmlelement::HTMLElement; use dom::node::Node; use dom_struct::dom_struct; -use html5ever_atoms::LocalName; +use html5ever::LocalName; #[dom_struct] pub struct HTMLDirectoryElement { diff --git a/components/script/dom/htmldivelement.rs b/components/script/dom/htmldivelement.rs index e4d8bf669ef..d89e0cfa8c1 100644 --- a/components/script/dom/htmldivelement.rs +++ b/components/script/dom/htmldivelement.rs @@ -9,7 +9,7 @@ use dom::document::Document; use dom::htmlelement::HTMLElement; use dom::node::Node; use dom_struct::dom_struct; -use html5ever_atoms::LocalName; +use html5ever::LocalName; #[dom_struct] pub struct HTMLDivElement { diff --git a/components/script/dom/htmldlistelement.rs b/components/script/dom/htmldlistelement.rs index 6da79f5d5c8..6934677ef31 100644 --- a/components/script/dom/htmldlistelement.rs +++ b/components/script/dom/htmldlistelement.rs @@ -9,7 +9,7 @@ use dom::document::Document; use dom::htmlelement::HTMLElement; use dom::node::Node; use dom_struct::dom_struct; -use html5ever_atoms::LocalName; +use html5ever::LocalName; #[dom_struct] pub struct HTMLDListElement { diff --git a/components/script/dom/htmlelement.rs b/components/script/dom/htmlelement.rs index ade0b7307d1..578476cb574 100644 --- a/components/script/dom/htmlelement.rs +++ b/components/script/dom/htmlelement.rs @@ -30,7 +30,7 @@ use dom::node::{document_from_node, window_from_node}; use dom::nodelist::NodeList; use dom::virtualmethods::VirtualMethods; use dom_struct::dom_struct; -use html5ever_atoms::LocalName; +use html5ever::LocalName; use std::ascii::AsciiExt; use std::borrow::ToOwned; use std::default::Default; diff --git a/components/script/dom/htmlembedelement.rs b/components/script/dom/htmlembedelement.rs index 9d88e7d7c12..64f9e19b06f 100644 --- a/components/script/dom/htmlembedelement.rs +++ b/components/script/dom/htmlembedelement.rs @@ -9,7 +9,7 @@ use dom::document::Document; use dom::htmlelement::HTMLElement; use dom::node::Node; use dom_struct::dom_struct; -use html5ever_atoms::LocalName; +use html5ever::LocalName; #[dom_struct] pub struct HTMLEmbedElement { diff --git a/components/script/dom/htmlfieldsetelement.rs b/components/script/dom/htmlfieldsetelement.rs index 9fdc65a513c..1c30cd987ca 100644 --- a/components/script/dom/htmlfieldsetelement.rs +++ b/components/script/dom/htmlfieldsetelement.rs @@ -18,7 +18,7 @@ use dom::node::{Node, window_from_node}; use dom::validitystate::ValidityState; use dom::virtualmethods::VirtualMethods; use dom_struct::dom_struct; -use html5ever_atoms::LocalName; +use html5ever::LocalName; use std::default::Default; use style::element_state::*; diff --git a/components/script/dom/htmlfontelement.rs b/components/script/dom/htmlfontelement.rs index 4e6b96a9c7e..3639a990be7 100644 --- a/components/script/dom/htmlfontelement.rs +++ b/components/script/dom/htmlfontelement.rs @@ -14,7 +14,7 @@ use dom::htmlelement::HTMLElement; use dom::node::Node; use dom::virtualmethods::VirtualMethods; use dom_struct::dom_struct; -use html5ever_atoms::LocalName; +use html5ever::LocalName; use servo_atoms::Atom; use style::attr::AttrValue; use style::str::{HTML_SPACE_CHARACTERS, read_numbers}; diff --git a/components/script/dom/htmlformelement.rs b/components/script/dom/htmlformelement.rs index afcfd9c6690..268ad1a8250 100755 --- a/components/script/dom/htmlformelement.rs +++ b/components/script/dom/htmlformelement.rs @@ -45,7 +45,7 @@ use dom_struct::dom_struct; use encoding::EncodingRef; use encoding::all::UTF_8; use encoding::label::encoding_from_whatwg_label; -use html5ever_atoms::LocalName; +use html5ever::LocalName; use hyper::header::{Charset, ContentDisposition, ContentType, DispositionParam, DispositionType}; use hyper::method::Method; use msg::constellation_msg::PipelineId; diff --git a/components/script/dom/htmlframeelement.rs b/components/script/dom/htmlframeelement.rs index e36bfc95310..d41c0f67433 100644 --- a/components/script/dom/htmlframeelement.rs +++ b/components/script/dom/htmlframeelement.rs @@ -9,7 +9,7 @@ use dom::document::Document; use dom::htmlelement::HTMLElement; use dom::node::Node; use dom_struct::dom_struct; -use html5ever_atoms::LocalName; +use html5ever::LocalName; #[dom_struct] pub struct HTMLFrameElement { diff --git a/components/script/dom/htmlframesetelement.rs b/components/script/dom/htmlframesetelement.rs index d6fba77cb08..4b92561b045 100644 --- a/components/script/dom/htmlframesetelement.rs +++ b/components/script/dom/htmlframesetelement.rs @@ -12,7 +12,7 @@ use dom::document::Document; use dom::htmlelement::HTMLElement; use dom::node::{Node, document_from_node}; use dom_struct::dom_struct; -use html5ever_atoms::LocalName; +use html5ever::LocalName; #[dom_struct] pub struct HTMLFrameSetElement { diff --git a/components/script/dom/htmlheadelement.rs b/components/script/dom/htmlheadelement.rs index 7e05ac3d45c..4354a4545b5 100644 --- a/components/script/dom/htmlheadelement.rs +++ b/components/script/dom/htmlheadelement.rs @@ -15,7 +15,7 @@ use dom::node::{Node, document_from_node}; use dom::userscripts::load_script; use dom::virtualmethods::VirtualMethods; use dom_struct::dom_struct; -use html5ever_atoms::LocalName; +use html5ever::LocalName; #[dom_struct] pub struct HTMLHeadElement { diff --git a/components/script/dom/htmlheadingelement.rs b/components/script/dom/htmlheadingelement.rs index f820b8ba90f..9c01dceb91f 100644 --- a/components/script/dom/htmlheadingelement.rs +++ b/components/script/dom/htmlheadingelement.rs @@ -9,7 +9,7 @@ use dom::document::Document; use dom::htmlelement::HTMLElement; use dom::node::Node; use dom_struct::dom_struct; -use html5ever_atoms::LocalName; +use html5ever::LocalName; #[derive(JSTraceable, HeapSizeOf)] pub enum HeadingLevel { diff --git a/components/script/dom/htmlhrelement.rs b/components/script/dom/htmlhrelement.rs index f1d5774dbe9..4784957132a 100644 --- a/components/script/dom/htmlhrelement.rs +++ b/components/script/dom/htmlhrelement.rs @@ -13,7 +13,7 @@ use dom::htmlelement::HTMLElement; use dom::node::Node; use dom::virtualmethods::VirtualMethods; use dom_struct::dom_struct; -use html5ever_atoms::LocalName; +use html5ever::LocalName; use style::attr::{AttrValue, LengthOrPercentageOrAuto}; #[dom_struct] diff --git a/components/script/dom/htmlhtmlelement.rs b/components/script/dom/htmlhtmlelement.rs index 924b55650ee..29ea62861a2 100644 --- a/components/script/dom/htmlhtmlelement.rs +++ b/components/script/dom/htmlhtmlelement.rs @@ -9,7 +9,7 @@ use dom::document::Document; use dom::htmlelement::HTMLElement; use dom::node::Node; use dom_struct::dom_struct; -use html5ever_atoms::LocalName; +use html5ever::LocalName; #[dom_struct] pub struct HTMLHtmlElement { diff --git a/components/script/dom/htmliframeelement.rs b/components/script/dom/htmliframeelement.rs index 599f2f69c36..45f743a6424 100644 --- a/components/script/dom/htmliframeelement.rs +++ b/components/script/dom/htmliframeelement.rs @@ -36,7 +36,7 @@ use dom::node::{Node, NodeDamage, UnbindContext, document_from_node, window_from use dom::virtualmethods::VirtualMethods; use dom::window::{ReflowReason, Window}; use dom_struct::dom_struct; -use html5ever_atoms::LocalName; +use html5ever::LocalName; use ipc_channel::ipc; use js::jsapi::{JSAutoCompartment, JSContext, MutableHandleValue}; use js::jsval::{NullValue, UndefinedValue}; diff --git a/components/script/dom/htmlimageelement.rs b/components/script/dom/htmlimageelement.rs index 389cd87b064..64f802bc2a6 100644 --- a/components/script/dom/htmlimageelement.rs +++ b/components/script/dom/htmlimageelement.rs @@ -35,7 +35,7 @@ use dom::virtualmethods::VirtualMethods; use dom::window::Window; use dom_struct::dom_struct; use euclid::point::Point2D; -use html5ever_atoms::LocalName; +use html5ever::LocalName; use ipc_channel::ipc; use ipc_channel::router::ROUTER; use net_traits::{FetchResponseListener, FetchMetadata, NetworkError, FetchResponseMsg}; diff --git a/components/script/dom/htmlinputelement.rs b/components/script/dom/htmlinputelement.rs index baff4983504..38e4156ded7 100755 --- a/components/script/dom/htmlinputelement.rs +++ b/components/script/dom/htmlinputelement.rs @@ -37,7 +37,7 @@ use dom::validation::Validatable; use dom::validitystate::ValidationFlags; use dom::virtualmethods::VirtualMethods; use dom_struct::dom_struct; -use html5ever_atoms::LocalName; +use html5ever::LocalName; use ipc_channel::ipc::{self, IpcSender}; use mime_guess; use net_traits::{CoreResourceMsg, IpcSend}; diff --git a/components/script/dom/htmllabelelement.rs b/components/script/dom/htmllabelelement.rs index 73a62af5570..e5a5d36d9a6 100644 --- a/components/script/dom/htmllabelelement.rs +++ b/components/script/dom/htmllabelelement.rs @@ -18,7 +18,7 @@ use dom::htmlformelement::{FormControl, FormControlElementHelpers, HTMLFormEleme use dom::node::{document_from_node, Node}; use dom::virtualmethods::VirtualMethods; use dom_struct::dom_struct; -use html5ever_atoms::LocalName; +use html5ever::LocalName; use style::attr::AttrValue; #[dom_struct] diff --git a/components/script/dom/htmllegendelement.rs b/components/script/dom/htmllegendelement.rs index 86b34c27dd0..95ad89e1137 100644 --- a/components/script/dom/htmllegendelement.rs +++ b/components/script/dom/htmllegendelement.rs @@ -16,7 +16,7 @@ use dom::htmlformelement::{HTMLFormElement, FormControl}; use dom::node::{Node, UnbindContext}; use dom::virtualmethods::VirtualMethods; use dom_struct::dom_struct; -use html5ever_atoms::LocalName; +use html5ever::LocalName; #[dom_struct] pub struct HTMLLegendElement { diff --git a/components/script/dom/htmllielement.rs b/components/script/dom/htmllielement.rs index aef80a52311..faefea88742 100644 --- a/components/script/dom/htmllielement.rs +++ b/components/script/dom/htmllielement.rs @@ -12,7 +12,7 @@ use dom::htmlelement::HTMLElement; use dom::node::Node; use dom::virtualmethods::VirtualMethods; use dom_struct::dom_struct; -use html5ever_atoms::LocalName; +use html5ever::LocalName; use style::attr::AttrValue; #[dom_struct] diff --git a/components/script/dom/htmllinkelement.rs b/components/script/dom/htmllinkelement.rs index bf36d28b29d..2a970e40acf 100644 --- a/components/script/dom/htmllinkelement.rs +++ b/components/script/dom/htmllinkelement.rs @@ -22,7 +22,7 @@ use dom::node::{Node, UnbindContext, document_from_node, window_from_node}; use dom::stylesheet::StyleSheet as DOMStyleSheet; use dom::virtualmethods::VirtualMethods; use dom_struct::dom_struct; -use html5ever_atoms::LocalName; +use html5ever::LocalName; use net_traits::ReferrerPolicy; use script_layout_interface::message::Msg; use script_traits::{MozBrowserEvent, ScriptMsg as ConstellationMsg}; diff --git a/components/script/dom/htmlmapelement.rs b/components/script/dom/htmlmapelement.rs index 9a2ae807619..b0200e81645 100644 --- a/components/script/dom/htmlmapelement.rs +++ b/components/script/dom/htmlmapelement.rs @@ -11,7 +11,7 @@ use dom::htmlareaelement::HTMLAreaElement; use dom::htmlelement::HTMLElement; use dom::node::Node; use dom_struct::dom_struct; -use html5ever_atoms::LocalName; +use html5ever::LocalName; #[dom_struct] pub struct HTMLMapElement { diff --git a/components/script/dom/htmlmediaelement.rs b/components/script/dom/htmlmediaelement.rs index fc036ee35cc..c29eb5fcf6a 100644 --- a/components/script/dom/htmlmediaelement.rs +++ b/components/script/dom/htmlmediaelement.rs @@ -28,7 +28,7 @@ use dom::mediaerror::MediaError; use dom::node::{window_from_node, document_from_node, Node, UnbindContext}; use dom::virtualmethods::VirtualMethods; use dom_struct::dom_struct; -use html5ever_atoms::LocalName; +use html5ever::LocalName; use ipc_channel::ipc; use ipc_channel::router::ROUTER; use net_traits::{FetchResponseListener, FetchMetadata, Metadata, NetworkError}; diff --git a/components/script/dom/htmlmetaelement.rs b/components/script/dom/htmlmetaelement.rs index 62d7215e3df..4b628df363e 100644 --- a/components/script/dom/htmlmetaelement.rs +++ b/components/script/dom/htmlmetaelement.rs @@ -18,7 +18,7 @@ use dom::htmlheadelement::HTMLHeadElement; use dom::node::{Node, UnbindContext, document_from_node, window_from_node}; use dom::virtualmethods::VirtualMethods; use dom_struct::dom_struct; -use html5ever_atoms::LocalName; +use html5ever::LocalName; use servo_config::prefs::PREFS; use std::ascii::AsciiExt; use std::sync::Arc; diff --git a/components/script/dom/htmlmeterelement.rs b/components/script/dom/htmlmeterelement.rs index b57951270a4..1ee7ef732f5 100644 --- a/components/script/dom/htmlmeterelement.rs +++ b/components/script/dom/htmlmeterelement.rs @@ -11,7 +11,7 @@ use dom::htmlelement::HTMLElement; use dom::node::Node; use dom::nodelist::NodeList; use dom_struct::dom_struct; -use html5ever_atoms::LocalName; +use html5ever::LocalName; #[dom_struct] pub struct HTMLMeterElement { diff --git a/components/script/dom/htmlmodelement.rs b/components/script/dom/htmlmodelement.rs index 7724640642c..8a45aae5f87 100644 --- a/components/script/dom/htmlmodelement.rs +++ b/components/script/dom/htmlmodelement.rs @@ -9,7 +9,7 @@ use dom::document::Document; use dom::htmlelement::HTMLElement; use dom::node::Node; use dom_struct::dom_struct; -use html5ever_atoms::LocalName; +use html5ever::LocalName; #[dom_struct] pub struct HTMLModElement { diff --git a/components/script/dom/htmlobjectelement.rs b/components/script/dom/htmlobjectelement.rs index c80a7838198..d61650b9412 100755 --- a/components/script/dom/htmlobjectelement.rs +++ b/components/script/dom/htmlobjectelement.rs @@ -18,7 +18,7 @@ use dom::validation::Validatable; use dom::validitystate::{ValidityState, ValidationFlags}; use dom::virtualmethods::VirtualMethods; use dom_struct::dom_struct; -use html5ever_atoms::LocalName; +use html5ever::LocalName; use net_traits::image::base::Image; use std::default::Default; use std::sync::Arc; diff --git a/components/script/dom/htmlolistelement.rs b/components/script/dom/htmlolistelement.rs index a36e97404e4..e02e5b445cf 100644 --- a/components/script/dom/htmlolistelement.rs +++ b/components/script/dom/htmlolistelement.rs @@ -9,7 +9,7 @@ use dom::document::Document; use dom::htmlelement::HTMLElement; use dom::node::Node; use dom_struct::dom_struct; -use html5ever_atoms::LocalName; +use html5ever::LocalName; #[dom_struct] pub struct HTMLOListElement { diff --git a/components/script/dom/htmloptgroupelement.rs b/components/script/dom/htmloptgroupelement.rs index 13a68d7ff41..fdc5de3d760 100644 --- a/components/script/dom/htmloptgroupelement.rs +++ b/components/script/dom/htmloptgroupelement.rs @@ -15,7 +15,7 @@ use dom::htmloptionelement::HTMLOptionElement; use dom::node::Node; use dom::virtualmethods::VirtualMethods; use dom_struct::dom_struct; -use html5ever_atoms::LocalName; +use html5ever::LocalName; use style::element_state::*; #[dom_struct] diff --git a/components/script/dom/htmloptionelement.rs b/components/script/dom/htmloptionelement.rs index e54b9b563e4..d69aed022d3 100644 --- a/components/script/dom/htmloptionelement.rs +++ b/components/script/dom/htmloptionelement.rs @@ -23,7 +23,7 @@ use dom::node::{Node, UnbindContext}; use dom::text::Text; use dom::virtualmethods::VirtualMethods; use dom_struct::dom_struct; -use html5ever_atoms::LocalName; +use html5ever::LocalName; use std::cell::Cell; use style::element_state::*; use style::str::{split_html_space_chars, str_join}; diff --git a/components/script/dom/htmloutputelement.rs b/components/script/dom/htmloutputelement.rs index 719efad95d3..e8febadef4f 100644 --- a/components/script/dom/htmloutputelement.rs +++ b/components/script/dom/htmloutputelement.rs @@ -17,7 +17,7 @@ use dom::nodelist::NodeList; use dom::validitystate::ValidityState; use dom::virtualmethods::VirtualMethods; use dom_struct::dom_struct; -use html5ever_atoms::LocalName; +use html5ever::LocalName; #[dom_struct] pub struct HTMLOutputElement { diff --git a/components/script/dom/htmlparagraphelement.rs b/components/script/dom/htmlparagraphelement.rs index 1a7936352bc..b932e2c1b41 100644 --- a/components/script/dom/htmlparagraphelement.rs +++ b/components/script/dom/htmlparagraphelement.rs @@ -9,7 +9,7 @@ use dom::document::Document; use dom::htmlelement::HTMLElement; use dom::node::Node; use dom_struct::dom_struct; -use html5ever_atoms::LocalName; +use html5ever::LocalName; #[dom_struct] pub struct HTMLParagraphElement { diff --git a/components/script/dom/htmlparamelement.rs b/components/script/dom/htmlparamelement.rs index 103faa0a641..eb1bb5ba3f2 100644 --- a/components/script/dom/htmlparamelement.rs +++ b/components/script/dom/htmlparamelement.rs @@ -9,7 +9,7 @@ use dom::document::Document; use dom::htmlelement::HTMLElement; use dom::node::Node; use dom_struct::dom_struct; -use html5ever_atoms::LocalName; +use html5ever::LocalName; #[dom_struct] pub struct HTMLParamElement { diff --git a/components/script/dom/htmlpreelement.rs b/components/script/dom/htmlpreelement.rs index 7d3575d1eae..3a6f8621edf 100644 --- a/components/script/dom/htmlpreelement.rs +++ b/components/script/dom/htmlpreelement.rs @@ -9,7 +9,7 @@ use dom::document::Document; use dom::htmlelement::HTMLElement; use dom::node::Node; use dom_struct::dom_struct; -use html5ever_atoms::LocalName; +use html5ever::LocalName; #[dom_struct] pub struct HTMLPreElement { diff --git a/components/script/dom/htmlprogresselement.rs b/components/script/dom/htmlprogresselement.rs index fe8eb2775e9..096c9dce38c 100644 --- a/components/script/dom/htmlprogresselement.rs +++ b/components/script/dom/htmlprogresselement.rs @@ -11,7 +11,7 @@ use dom::htmlelement::HTMLElement; use dom::node::Node; use dom::nodelist::NodeList; use dom_struct::dom_struct; -use html5ever_atoms::LocalName; +use html5ever::LocalName; #[dom_struct] pub struct HTMLProgressElement { diff --git a/components/script/dom/htmlquoteelement.rs b/components/script/dom/htmlquoteelement.rs index de3e473434b..797f6913b54 100644 --- a/components/script/dom/htmlquoteelement.rs +++ b/components/script/dom/htmlquoteelement.rs @@ -9,7 +9,7 @@ use dom::document::Document; use dom::htmlelement::HTMLElement; use dom::node::Node; use dom_struct::dom_struct; -use html5ever_atoms::LocalName; +use html5ever::LocalName; #[dom_struct] pub struct HTMLQuoteElement { diff --git a/components/script/dom/htmlscriptelement.rs b/components/script/dom/htmlscriptelement.rs index d6679c5168c..c77e7a46dfa 100644 --- a/components/script/dom/htmlscriptelement.rs +++ b/components/script/dom/htmlscriptelement.rs @@ -26,7 +26,7 @@ use dom::virtualmethods::VirtualMethods; use dom_struct::dom_struct; use encoding::label::encoding_from_whatwg_label; use encoding::types::{DecoderTrap, EncodingRef}; -use html5ever_atoms::LocalName; +use html5ever::LocalName; use ipc_channel::ipc; use ipc_channel::router::ROUTER; use js::jsval::UndefinedValue; diff --git a/components/script/dom/htmlselectelement.rs b/components/script/dom/htmlselectelement.rs index 2d4dc4758b6..f59753e60c5 100755 --- a/components/script/dom/htmlselectelement.rs +++ b/components/script/dom/htmlselectelement.rs @@ -31,7 +31,7 @@ use dom::validation::Validatable; use dom::validitystate::{ValidityState, ValidationFlags}; use dom::virtualmethods::VirtualMethods; use dom_struct::dom_struct; -use html5ever_atoms::LocalName; +use html5ever::LocalName; use std::default::Default; use std::iter; use style::attr::AttrValue; diff --git a/components/script/dom/htmlsourceelement.rs b/components/script/dom/htmlsourceelement.rs index 2b15fabd789..0e550b6aa74 100644 --- a/components/script/dom/htmlsourceelement.rs +++ b/components/script/dom/htmlsourceelement.rs @@ -9,7 +9,7 @@ use dom::document::Document; use dom::htmlelement::HTMLElement; use dom::node::Node; use dom_struct::dom_struct; -use html5ever_atoms::LocalName; +use html5ever::LocalName; #[dom_struct] pub struct HTMLSourceElement { diff --git a/components/script/dom/htmlspanelement.rs b/components/script/dom/htmlspanelement.rs index 1437d1dbb08..32accc8bbc1 100644 --- a/components/script/dom/htmlspanelement.rs +++ b/components/script/dom/htmlspanelement.rs @@ -9,7 +9,7 @@ use dom::document::Document; use dom::htmlelement::HTMLElement; use dom::node::Node; use dom_struct::dom_struct; -use html5ever_atoms::LocalName; +use html5ever::LocalName; #[dom_struct] pub struct HTMLSpanElement { diff --git a/components/script/dom/htmlstyleelement.rs b/components/script/dom/htmlstyleelement.rs index 8905c3baa65..02ccc83d824 100644 --- a/components/script/dom/htmlstyleelement.rs +++ b/components/script/dom/htmlstyleelement.rs @@ -19,7 +19,7 @@ use dom::node::{ChildrenMutation, Node, UnbindContext, document_from_node, windo use dom::stylesheet::StyleSheet as DOMStyleSheet; use dom::virtualmethods::VirtualMethods; use dom_struct::dom_struct; -use html5ever_atoms::LocalName; +use html5ever::LocalName; use net_traits::ReferrerPolicy; use script_layout_interface::message::Msg; use std::cell::Cell; diff --git a/components/script/dom/htmltablecaptionelement.rs b/components/script/dom/htmltablecaptionelement.rs index fd6c06643dd..bb78ca5fd7f 100644 --- a/components/script/dom/htmltablecaptionelement.rs +++ b/components/script/dom/htmltablecaptionelement.rs @@ -9,7 +9,7 @@ use dom::document::Document; use dom::htmlelement::HTMLElement; use dom::node::Node; use dom_struct::dom_struct; -use html5ever_atoms::LocalName; +use html5ever::LocalName; #[dom_struct] pub struct HTMLTableCaptionElement { diff --git a/components/script/dom/htmltablecellelement.rs b/components/script/dom/htmltablecellelement.rs index ef4bffba5d7..70f39fff623 100644 --- a/components/script/dom/htmltablecellelement.rs +++ b/components/script/dom/htmltablecellelement.rs @@ -15,7 +15,7 @@ use dom::htmltablerowelement::HTMLTableRowElement; use dom::node::Node; use dom::virtualmethods::VirtualMethods; use dom_struct::dom_struct; -use html5ever_atoms::LocalName; +use html5ever::LocalName; use style::attr::{AttrValue, LengthOrPercentageOrAuto}; const DEFAULT_COLSPAN: u32 = 1; diff --git a/components/script/dom/htmltablecolelement.rs b/components/script/dom/htmltablecolelement.rs index 00f618ed65f..3b7656f3386 100644 --- a/components/script/dom/htmltablecolelement.rs +++ b/components/script/dom/htmltablecolelement.rs @@ -9,7 +9,7 @@ use dom::document::Document; use dom::htmlelement::HTMLElement; use dom::node::Node; use dom_struct::dom_struct; -use html5ever_atoms::LocalName; +use html5ever::LocalName; #[dom_struct] pub struct HTMLTableColElement { diff --git a/components/script/dom/htmltabledatacellelement.rs b/components/script/dom/htmltabledatacellelement.rs index 77808c77d79..fe3ab42ef73 100644 --- a/components/script/dom/htmltabledatacellelement.rs +++ b/components/script/dom/htmltabledatacellelement.rs @@ -9,7 +9,7 @@ use dom::document::Document; use dom::htmltablecellelement::HTMLTableCellElement; use dom::node::Node; use dom_struct::dom_struct; -use html5ever_atoms::LocalName; +use html5ever::LocalName; #[dom_struct] pub struct HTMLTableDataCellElement { diff --git a/components/script/dom/htmltableelement.rs b/components/script/dom/htmltableelement.rs index 56e9876b753..d255d8a91c8 100644 --- a/components/script/dom/htmltableelement.rs +++ b/components/script/dom/htmltableelement.rs @@ -23,7 +23,7 @@ use dom::htmltablesectionelement::HTMLTableSectionElement; use dom::node::{Node, document_from_node, window_from_node}; use dom::virtualmethods::VirtualMethods; use dom_struct::dom_struct; -use html5ever_atoms::LocalName; +use html5ever::LocalName; use std::cell::Cell; use style::attr::{AttrValue, LengthOrPercentageOrAuto, parse_unsigned_integer}; diff --git a/components/script/dom/htmltableheadercellelement.rs b/components/script/dom/htmltableheadercellelement.rs index a471faee00f..aeb293081e8 100644 --- a/components/script/dom/htmltableheadercellelement.rs +++ b/components/script/dom/htmltableheadercellelement.rs @@ -9,7 +9,7 @@ use dom::document::Document; use dom::htmltablecellelement::HTMLTableCellElement; use dom::node::Node; use dom_struct::dom_struct; -use html5ever_atoms::LocalName; +use html5ever::LocalName; #[dom_struct] pub struct HTMLTableHeaderCellElement { diff --git a/components/script/dom/htmltablerowelement.rs b/components/script/dom/htmltablerowelement.rs index be1b636beb4..40cb25148bd 100644 --- a/components/script/dom/htmltablerowelement.rs +++ b/components/script/dom/htmltablerowelement.rs @@ -22,7 +22,7 @@ use dom::htmltablesectionelement::HTMLTableSectionElement; use dom::node::{Node, window_from_node}; use dom::virtualmethods::VirtualMethods; use dom_struct::dom_struct; -use html5ever_atoms::LocalName; +use html5ever::LocalName; use style::attr::AttrValue; #[derive(JSTraceable)] diff --git a/components/script/dom/htmltablesectionelement.rs b/components/script/dom/htmltablesectionelement.rs index cf9be4b81b4..717705622eb 100644 --- a/components/script/dom/htmltablesectionelement.rs +++ b/components/script/dom/htmltablesectionelement.rs @@ -17,7 +17,7 @@ use dom::htmltablerowelement::HTMLTableRowElement; use dom::node::{Node, window_from_node}; use dom::virtualmethods::VirtualMethods; use dom_struct::dom_struct; -use html5ever_atoms::LocalName; +use html5ever::LocalName; use style::attr::AttrValue; #[dom_struct] diff --git a/components/script/dom/htmltemplateelement.rs b/components/script/dom/htmltemplateelement.rs index 8e54ae63523..db45fada13d 100644 --- a/components/script/dom/htmltemplateelement.rs +++ b/components/script/dom/htmltemplateelement.rs @@ -15,7 +15,7 @@ use dom::htmlelement::HTMLElement; use dom::node::{CloneChildrenFlag, Node, document_from_node}; use dom::virtualmethods::VirtualMethods; use dom_struct::dom_struct; -use html5ever_atoms::LocalName; +use html5ever::LocalName; #[dom_struct] pub struct HTMLTemplateElement { diff --git a/components/script/dom/htmltextareaelement.rs b/components/script/dom/htmltextareaelement.rs index 8a4e9f41cd3..a8f9d22947c 100755 --- a/components/script/dom/htmltextareaelement.rs +++ b/components/script/dom/htmltextareaelement.rs @@ -26,7 +26,7 @@ use dom::nodelist::NodeList; use dom::validation::Validatable; use dom::virtualmethods::VirtualMethods; use dom_struct::dom_struct; -use html5ever_atoms::LocalName; +use html5ever::LocalName; use ipc_channel::ipc::IpcSender; use script_traits::ScriptMsg as ConstellationMsg; use std::cell::Cell; diff --git a/components/script/dom/htmltimeelement.rs b/components/script/dom/htmltimeelement.rs index 2c559a30cc5..907f6373ea7 100644 --- a/components/script/dom/htmltimeelement.rs +++ b/components/script/dom/htmltimeelement.rs @@ -10,7 +10,7 @@ use dom::document::Document; use dom::htmlelement::HTMLElement; use dom::node::Node; use dom_struct::dom_struct; -use html5ever_atoms::LocalName; +use html5ever::LocalName; #[dom_struct] pub struct HTMLTimeElement { diff --git a/components/script/dom/htmltitleelement.rs b/components/script/dom/htmltitleelement.rs index 43208399fb6..8f312ef41a0 100644 --- a/components/script/dom/htmltitleelement.rs +++ b/components/script/dom/htmltitleelement.rs @@ -13,7 +13,7 @@ use dom::htmlelement::HTMLElement; use dom::node::{ChildrenMutation, Node}; use dom::virtualmethods::VirtualMethods; use dom_struct::dom_struct; -use html5ever_atoms::LocalName; +use html5ever::LocalName; #[dom_struct] pub struct HTMLTitleElement { diff --git a/components/script/dom/htmltrackelement.rs b/components/script/dom/htmltrackelement.rs index 97811ee5a10..77868e484a7 100644 --- a/components/script/dom/htmltrackelement.rs +++ b/components/script/dom/htmltrackelement.rs @@ -9,7 +9,7 @@ use dom::document::Document; use dom::htmlelement::HTMLElement; use dom::node::Node; use dom_struct::dom_struct; -use html5ever_atoms::LocalName; +use html5ever::LocalName; #[dom_struct] pub struct HTMLTrackElement { diff --git a/components/script/dom/htmlulistelement.rs b/components/script/dom/htmlulistelement.rs index 4153709e108..552202c3421 100644 --- a/components/script/dom/htmlulistelement.rs +++ b/components/script/dom/htmlulistelement.rs @@ -9,7 +9,7 @@ use dom::document::Document; use dom::htmlelement::HTMLElement; use dom::node::Node; use dom_struct::dom_struct; -use html5ever_atoms::LocalName; +use html5ever::LocalName; #[dom_struct] pub struct HTMLUListElement { diff --git a/components/script/dom/htmlunknownelement.rs b/components/script/dom/htmlunknownelement.rs index d54025de852..a7f3f77b095 100644 --- a/components/script/dom/htmlunknownelement.rs +++ b/components/script/dom/htmlunknownelement.rs @@ -9,7 +9,7 @@ use dom::document::Document; use dom::htmlelement::HTMLElement; use dom::node::Node; use dom_struct::dom_struct; -use html5ever_atoms::LocalName; +use html5ever::LocalName; #[dom_struct] pub struct HTMLUnknownElement { diff --git a/components/script/dom/htmlvideoelement.rs b/components/script/dom/htmlvideoelement.rs index 1a0d93dacf8..f3d698b3376 100644 --- a/components/script/dom/htmlvideoelement.rs +++ b/components/script/dom/htmlvideoelement.rs @@ -9,7 +9,7 @@ use dom::document::Document; use dom::htmlmediaelement::HTMLMediaElement; use dom::node::Node; use dom_struct::dom_struct; -use html5ever_atoms::LocalName; +use html5ever::LocalName; #[dom_struct] pub struct HTMLVideoElement { diff --git a/components/script/dom/namednodemap.rs b/components/script/dom/namednodemap.rs index 273b87c8d00..9d92bf11c2d 100644 --- a/components/script/dom/namednodemap.rs +++ b/components/script/dom/namednodemap.rs @@ -14,7 +14,7 @@ use dom::bindings::xmlname::namespace_from_domstring; use dom::element::Element; use dom::window::Window; use dom_struct::dom_struct; -use html5ever_atoms::LocalName; +use html5ever::LocalName; use std::ascii::AsciiExt; #[dom_struct] diff --git a/components/script/dom/node.rs b/components/script/dom/node.rs index 0384c4ed19d..b511d8630dd 100644 --- a/components/script/dom/node.rs +++ b/components/script/dom/node.rs @@ -58,7 +58,7 @@ use euclid::point::Point2D; use euclid::rect::Rect; use euclid::size::Size2D; use heapsize::{HeapSizeOf, heap_size_of}; -use html5ever_atoms::{Prefix, Namespace, QualName}; +use html5ever::{Prefix, Namespace, QualName}; use js::jsapi::{JSContext, JSObject, JSRuntime}; use libc::{self, c_void, uintptr_t}; use msg::constellation_msg::PipelineId; @@ -1749,11 +1749,11 @@ impl Node { NodeTypeId::Element(..) => { let element = node.downcast::<Element>().unwrap(); let name = QualName { + prefix: element.prefix().map(|p| Prefix::from(&**p)), ns: element.namespace().clone(), local: element.local_name().clone() }; let element = Element::create(name, - element.prefix().map(|p| Prefix::from(&**p)), &document, ElementCreator::ScriptCreated); Root::upcast::<Node>(element) }, diff --git a/components/script/dom/servoparser/html.rs b/components/script/dom/servoparser/html.rs index 6142dba20f6..f25e95507e4 100644 --- a/components/script/dom/servoparser/html.rs +++ b/components/script/dom/servoparser/html.rs @@ -5,38 +5,28 @@ #![allow(unrooted_must_root)] use dom::bindings::codegen::Bindings::HTMLTemplateElementBinding::HTMLTemplateElementMethods; -use dom::bindings::codegen::Bindings::NodeBinding::NodeMethods; use dom::bindings::inheritance::{Castable, CharacterDataTypeId, NodeTypeId}; use dom::bindings::js::{JS, Root}; -use dom::bindings::str::DOMString; use dom::bindings::trace::JSTraceable; use dom::characterdata::CharacterData; -use dom::comment::Comment; use dom::document::Document; use dom::documenttype::DocumentType; -use dom::element::{Element, ElementCreator}; -use dom::htmlformelement::{FormControlElementHelpers, HTMLFormElement}; +use dom::element::Element; use dom::htmlscriptelement::HTMLScriptElement; use dom::htmltemplateelement::HTMLTemplateElement; use dom::node::Node; use dom::processinginstruction::ProcessingInstruction; -use dom::virtualmethods::vtable_for; -use html5ever::Attribute; +use dom::servoparser::Sink; use html5ever::QualName; -use html5ever::serialize::{AttrRef, Serializable, Serializer}; +use html5ever::buffer_queue::BufferQueue; +use html5ever::serialize::{AttrRef, Serialize, Serializer}; use html5ever::serialize::TraversalScope; use html5ever::serialize::TraversalScope::{ChildrenOnly, IncludeNode}; -use html5ever::tendril::StrTendril; use html5ever::tokenizer::{Tokenizer as HtmlTokenizer, TokenizerOpts, TokenizerResult}; -use html5ever::tokenizer::buffer_queue::BufferQueue; -use html5ever::tree_builder::{NodeOrText, QuirksMode}; -use html5ever::tree_builder::{Tracer as HtmlTracer, TreeBuilder, TreeBuilderOpts, TreeSink}; +use html5ever::tree_builder::{Tracer as HtmlTracer, TreeBuilder, TreeBuilderOpts}; use js::jsapi::JSTracer; use servo_url::ServoUrl; -use std::ascii::AsciiExt; -use std::borrow::Cow; -use std::io::{self, Write}; -use style::context::QuirksMode as ServoQuirksMode; +use std::io; #[derive(HeapSizeOf, JSTraceable)] #[must_root] @@ -55,6 +45,7 @@ impl Tokenizer { base_url: url, document: JS::from_ref(document), current_line: 1, + script: Default::default(), }; let options = TreeBuilderOpts { @@ -124,179 +115,18 @@ unsafe impl JSTraceable for HtmlTokenizer<TreeBuilder<JS<Node>, Sink>> { } } -#[derive(JSTraceable, HeapSizeOf)] -#[must_root] -struct Sink { - base_url: ServoUrl, - document: JS<Document>, - current_line: u64, -} - -impl TreeSink for Sink { - type Output = Self; - fn finish(self) -> Self { self } - - type Handle = JS<Node>; - - fn get_document(&mut self) -> JS<Node> { - JS::from_ref(self.document.upcast()) - } - - fn get_template_contents(&mut self, target: JS<Node>) -> JS<Node> { - let template = target.downcast::<HTMLTemplateElement>() - .expect("tried to get template contents of non-HTMLTemplateElement in HTML parsing"); - JS::from_ref(template.Content().upcast()) - } - - fn same_node(&self, x: JS<Node>, y: JS<Node>) -> bool { - x == y - } - - fn elem_name(&self, target: JS<Node>) -> QualName { - let elem = target.downcast::<Element>() - .expect("tried to get name of non-Element in HTML parsing"); - QualName { - ns: elem.namespace().clone(), - local: elem.local_name().clone(), - } - } - - fn same_tree(&self, x: JS<Node>, y: JS<Node>) -> bool { - let x = x.downcast::<Element>().expect("Element node expected"); - let y = y.downcast::<Element>().expect("Element node expected"); - - x.is_in_same_home_subtree(y) - } - - fn create_element(&mut self, name: QualName, attrs: Vec<Attribute>) - -> JS<Node> { - let elem = Element::create(name, None, &*self.document, - ElementCreator::ParserCreated(self.current_line)); - - for attr in attrs { - elem.set_attribute_from_parser(attr.name, DOMString::from(String::from(attr.value)), None); - } - - JS::from_ref(elem.upcast()) - } - - fn create_comment(&mut self, text: StrTendril) -> JS<Node> { - let comment = Comment::new(DOMString::from(String::from(text)), &*self.document); - JS::from_ref(comment.upcast()) - } - - fn has_parent_node(&self, node: JS<Node>) -> bool { - node.GetParentNode().is_some() - } - - fn associate_with_form(&mut self, target: JS<Node>, form: JS<Node>) { - let node = target; - let form = Root::downcast::<HTMLFormElement>(Root::from_ref(&*form)) - .expect("Owner must be a form element"); - - let elem = node.downcast::<Element>(); - let control = elem.as_ref().and_then(|e| e.as_maybe_form_control()); - - if let Some(control) = control { - control.set_form_owner_from_parser(&form); - } else { - // TODO remove this code when keygen is implemented. - assert!(node.NodeName() == "KEYGEN", "Unknown form-associatable element"); - } - } - - fn append_before_sibling(&mut self, - sibling: JS<Node>, - new_node: NodeOrText<JS<Node>>) { - let parent = sibling.GetParentNode() - .expect("append_before_sibling called on node without parent"); - - super::insert(&parent, Some(&*sibling), new_node); - } - - fn parse_error(&mut self, msg: Cow<'static, str>) { - debug!("Parse error: {}", msg); - } - - fn set_quirks_mode(&mut self, mode: QuirksMode) { - let mode = match mode { - QuirksMode::Quirks => ServoQuirksMode::Quirks, - QuirksMode::LimitedQuirks => ServoQuirksMode::LimitedQuirks, - QuirksMode::NoQuirks => ServoQuirksMode::NoQuirks, - }; - self.document.set_quirks_mode(mode); - } - - fn append(&mut self, parent: JS<Node>, child: NodeOrText<JS<Node>>) { - super::insert(&parent, None, child); - } - - fn append_doctype_to_document(&mut self, name: StrTendril, public_id: StrTendril, - system_id: StrTendril) { - let doc = &*self.document; - let doctype = DocumentType::new( - DOMString::from(String::from(name)), Some(DOMString::from(String::from(public_id))), - Some(DOMString::from(String::from(system_id))), doc); - doc.upcast::<Node>().AppendChild(doctype.upcast()).expect("Appending failed"); - } - - fn add_attrs_if_missing(&mut self, target: JS<Node>, attrs: Vec<Attribute>) { - let elem = target.downcast::<Element>() - .expect("tried to set attrs on non-Element in HTML parsing"); - for attr in attrs { - elem.set_attribute_from_parser(attr.name, DOMString::from(String::from(attr.value)), None); - } - } - - fn remove_from_parent(&mut self, target: JS<Node>) { - if let Some(ref parent) = target.GetParentNode() { - parent.RemoveChild(&*target).unwrap(); - } - } - - fn mark_script_already_started(&mut self, node: JS<Node>) { - let script = node.downcast::<HTMLScriptElement>(); - script.map(|script| script.set_already_started(true)); - } - - fn reparent_children(&mut self, node: JS<Node>, new_parent: JS<Node>) { - while let Some(ref child) = node.GetFirstChild() { - new_parent.AppendChild(&child).unwrap(); - } - } - - /// https://html.spec.whatwg.org/multipage/#html-integration-point - /// Specifically, the <annotation-xml> cases. - fn is_mathml_annotation_xml_integration_point(&self, handle: JS<Node>) -> bool { - let elem = handle.downcast::<Element>().unwrap(); - elem.get_attribute(&ns!(), &local_name!("encoding")).map_or(false, |attr| { - attr.value().eq_ignore_ascii_case("text/html") - || attr.value().eq_ignore_ascii_case("application/xhtml+xml") - }) - } - - fn set_current_line(&mut self, line_number: u64) { - self.current_line = line_number; - } - - fn pop(&mut self, node: JS<Node>) { - let node = Root::from_ref(&*node); - vtable_for(&node).pop(); - } -} - -impl<'a> Serializable for &'a Node { - fn serialize<'wr, Wr: Write>(&self, serializer: &mut Serializer<'wr, Wr>, - traversal_scope: TraversalScope) -> io::Result<()> { +impl<'a> Serialize for &'a Node { + fn serialize<S: Serializer>(&self, serializer: &mut S, + traversal_scope: TraversalScope) -> io::Result<()> { let node = *self; match (traversal_scope, node.type_id()) { (_, NodeTypeId::Element(..)) => { let elem = node.downcast::<Element>().unwrap(); - let name = QualName::new(elem.namespace().clone(), + let name = QualName::new(None, elem.namespace().clone(), elem.local_name().clone()); if traversal_scope == IncludeNode { let attrs = elem.attrs().iter().map(|attr| { - let qname = QualName::new(attr.namespace().clone(), + let qname = QualName::new(None, attr.namespace().clone(), attr.local_name().clone()); let value = attr.value().clone(); (qname, value) diff --git a/components/script/dom/servoparser/mod.rs b/components/script/dom/servoparser/mod.rs index 3904910d3a3..39c199a34f7 100644 --- a/components/script/dom/servoparser/mod.rs +++ b/components/script/dom/servoparser/mod.rs @@ -6,27 +6,35 @@ use document_loader::{DocumentLoader, LoadType}; use dom::bindings::cell::DOMRefCell; use dom::bindings::codegen::Bindings::DocumentBinding::{DocumentMethods, DocumentReadyState}; use dom::bindings::codegen::Bindings::HTMLImageElementBinding::HTMLImageElementMethods; +use dom::bindings::codegen::Bindings::HTMLTemplateElementBinding::HTMLTemplateElementMethods; use dom::bindings::codegen::Bindings::NodeBinding::NodeMethods; use dom::bindings::codegen::Bindings::ServoParserBinding; use dom::bindings::inheritance::Castable; -use dom::bindings::js::{JS, Root, RootedReference}; +use dom::bindings::js::{JS, MutNullableJS, Root, RootedReference}; use dom::bindings::refcounted::Trusted; use dom::bindings::reflector::{Reflector, reflect_dom_object}; use dom::bindings::str::DOMString; use dom::characterdata::CharacterData; +use dom::comment::Comment; use dom::document::{Document, DocumentSource, HasBrowsingContext, IsHTMLDocument}; -use dom::element::Element; +use dom::documenttype::DocumentType; +use dom::element::{Element, ElementCreator}; use dom::globalscope::GlobalScope; -use dom::htmlformelement::HTMLFormElement; +use dom::htmlformelement::{FormControlElementHelpers, HTMLFormElement}; use dom::htmlimageelement::HTMLImageElement; use dom::htmlscriptelement::{HTMLScriptElement, ScriptResult}; +use dom::htmltemplateelement::HTMLTemplateElement; use dom::node::{Node, NodeSiblingIterator}; +use dom::processinginstruction::ProcessingInstruction; use dom::text::Text; +use dom::virtualmethods::vtable_for; use dom_struct::dom_struct; use encoding::all::UTF_8; use encoding::types::{DecoderTrap, Encoding}; -use html5ever::tokenizer::buffer_queue::BufferQueue; -use html5ever::tree_builder::NodeOrText; +use html5ever::{Attribute, QualName, ExpandedName}; +use html5ever::buffer_queue::BufferQueue; +use html5ever::tendril::StrTendril; +use html5ever::tree_builder::{NodeOrText, TreeSink, NextParserState, QuirksMode, ElementFlags}; use hyper::header::ContentType; use hyper::mime::{Mime, SubLevel, TopLevel}; use hyper_serde::Serde; @@ -40,8 +48,10 @@ use script_traits::DocumentActivity; use servo_config::resource_files::read_resource_file; use servo_url::ServoUrl; use std::ascii::AsciiExt; +use std::borrow::Cow; use std::cell::Cell; use std::mem; +use style::context::QuirksMode as ServoQuirksMode; mod html; mod xml; @@ -671,3 +681,183 @@ fn insert(parent: &Node, reference_child: Option<&Node>, child: NodeOrText<JS<No }, } } + +#[derive(JSTraceable, HeapSizeOf)] +#[must_root] +pub struct Sink { + base_url: ServoUrl, + document: JS<Document>, + current_line: u64, + script: MutNullableJS<HTMLScriptElement>, +} + +#[allow(unrooted_must_root)] // FIXME: really? +impl TreeSink for Sink { + type Output = Self; + fn finish(self) -> Self { self } + + type Handle = JS<Node>; + + fn get_document(&mut self) -> JS<Node> { + JS::from_ref(self.document.upcast()) + } + + fn get_template_contents(&mut self, target: &JS<Node>) -> JS<Node> { + let template = target.downcast::<HTMLTemplateElement>() + .expect("tried to get template contents of non-HTMLTemplateElement in HTML parsing"); + JS::from_ref(template.Content().upcast()) + } + + fn same_node(&self, x: &JS<Node>, y: &JS<Node>) -> bool { + x == y + } + + fn elem_name<'a>(&self, target: &'a JS<Node>) -> ExpandedName<'a> { + let elem = target.downcast::<Element>() + .expect("tried to get name of non-Element in HTML parsing"); + ExpandedName { + ns: elem.namespace(), + local: elem.local_name(), + } + } + + fn same_tree(&self, x: &JS<Node>, y: &JS<Node>) -> bool { + let x = x.downcast::<Element>().expect("Element node expected"); + let y = y.downcast::<Element>().expect("Element node expected"); + + x.is_in_same_home_subtree(y) + } + + fn create_element(&mut self, name: QualName, attrs: Vec<Attribute>, _flags: ElementFlags) + -> JS<Node> { + let elem = Element::create(name, &*self.document, + ElementCreator::ParserCreated(self.current_line)); + + for attr in attrs { + elem.set_attribute_from_parser(attr.name, DOMString::from(String::from(attr.value)), None); + } + + JS::from_ref(elem.upcast()) + } + + fn create_comment(&mut self, text: StrTendril) -> JS<Node> { + let comment = Comment::new(DOMString::from(String::from(text)), &*self.document); + JS::from_ref(comment.upcast()) + } + + fn create_pi(&mut self, target: StrTendril, data: StrTendril) -> JS<Node> { + let doc = &*self.document; + let pi = ProcessingInstruction::new( + DOMString::from(String::from(target)), DOMString::from(String::from(data)), + doc); + JS::from_ref(pi.upcast()) + } + + fn has_parent_node(&self, node: &JS<Node>) -> bool { + node.GetParentNode().is_some() + } + + fn associate_with_form(&mut self, target: &JS<Node>, form: &JS<Node>) { + let node = target; + let form = Root::downcast::<HTMLFormElement>(Root::from_ref(&**form)) + .expect("Owner must be a form element"); + + let elem = node.downcast::<Element>(); + let control = elem.and_then(|e| e.as_maybe_form_control()); + + if let Some(control) = control { + control.set_form_owner_from_parser(&form); + } else { + // TODO remove this code when keygen is implemented. + assert!(node.NodeName() == "KEYGEN", "Unknown form-associatable element"); + } + } + + fn append_before_sibling(&mut self, + sibling: &JS<Node>, + new_node: NodeOrText<JS<Node>>) { + let parent = sibling.GetParentNode() + .expect("append_before_sibling called on node without parent"); + + insert(&parent, Some(&*sibling), new_node); + } + + fn parse_error(&mut self, msg: Cow<'static, str>) { + debug!("Parse error: {}", msg); + } + + fn set_quirks_mode(&mut self, mode: QuirksMode) { + let mode = match mode { + QuirksMode::Quirks => ServoQuirksMode::Quirks, + QuirksMode::LimitedQuirks => ServoQuirksMode::LimitedQuirks, + QuirksMode::NoQuirks => ServoQuirksMode::NoQuirks, + }; + self.document.set_quirks_mode(mode); + } + + fn append(&mut self, parent: &JS<Node>, child: NodeOrText<JS<Node>>) { + insert(&parent, None, child); + } + + fn append_doctype_to_document(&mut self, name: StrTendril, public_id: StrTendril, + system_id: StrTendril) { + let doc = &*self.document; + let doctype = DocumentType::new( + DOMString::from(String::from(name)), Some(DOMString::from(String::from(public_id))), + Some(DOMString::from(String::from(system_id))), doc); + doc.upcast::<Node>().AppendChild(doctype.upcast()).expect("Appending failed"); + } + + fn add_attrs_if_missing(&mut self, target: &JS<Node>, attrs: Vec<Attribute>) { + let elem = target.downcast::<Element>() + .expect("tried to set attrs on non-Element in HTML parsing"); + for attr in attrs { + elem.set_attribute_from_parser(attr.name, DOMString::from(String::from(attr.value)), None); + } + } + + fn remove_from_parent(&mut self, target: &JS<Node>) { + if let Some(ref parent) = target.GetParentNode() { + parent.RemoveChild(&*target).unwrap(); + } + } + + fn mark_script_already_started(&mut self, node: &JS<Node>) { + let script = node.downcast::<HTMLScriptElement>(); + script.map(|script| script.set_already_started(true)); + } + + fn complete_script(&mut self, node: &JS<Node>) -> NextParserState { + if let Some(script) = node.downcast() { + self.script.set(Some(script)); + NextParserState::Suspend + } else { + NextParserState::Continue + } + } + + fn reparent_children(&mut self, node: &JS<Node>, new_parent: &JS<Node>) { + while let Some(ref child) = node.GetFirstChild() { + new_parent.AppendChild(&child).unwrap(); + } + } + + /// https://html.spec.whatwg.org/multipage/#html-integration-point + /// Specifically, the <annotation-xml> cases. + fn is_mathml_annotation_xml_integration_point(&self, handle: &JS<Node>) -> bool { + let elem = handle.downcast::<Element>().unwrap(); + elem.get_attribute(&ns!(), &local_name!("encoding")).map_or(false, |attr| { + attr.value().eq_ignore_ascii_case("text/html") + || attr.value().eq_ignore_ascii_case("application/xhtml+xml") + }) + } + + fn set_current_line(&mut self, line_number: u64) { + self.current_line = line_number; + } + + fn pop(&mut self, node: &JS<Node>) { + let node = Root::from_ref(&**node); + vtable_for(&node).pop(); + } +} diff --git a/components/script/dom/servoparser/xml.rs b/components/script/dom/servoparser/xml.rs index 1ef5f882db0..da5e1987253 100644 --- a/components/script/dom/servoparser/xml.rs +++ b/components/script/dom/servoparser/xml.rs @@ -4,29 +4,17 @@ #![allow(unrooted_must_root)] -use dom::bindings::codegen::Bindings::NodeBinding::NodeMethods; -use dom::bindings::inheritance::Castable; -use dom::bindings::js::{JS, MutNullableJS, Root}; -use dom::bindings::str::DOMString; +use dom::bindings::js::{JS, Root}; use dom::bindings::trace::JSTraceable; -use dom::comment::Comment; use dom::document::Document; -use dom::documenttype::DocumentType; -use dom::element::{Element, ElementCreator}; use dom::htmlscriptelement::HTMLScriptElement; use dom::node::Node; -use dom::processinginstruction::ProcessingInstruction; -use dom::virtualmethods::vtable_for; -use html5ever::tokenizer::buffer_queue::BufferQueue; -use html5ever::tree_builder::{NodeOrText as H5eNodeOrText}; -use html5ever_atoms::{Prefix, QualName}; +use dom::servoparser::Sink; use js::jsapi::JSTracer; use servo_url::ServoUrl; -use std::borrow::Cow; -use xml5ever::tendril::StrTendril; -use xml5ever::tokenizer::{Attribute, QName, XmlTokenizer}; -use xml5ever::tree_builder::{NextParserState, NodeOrText}; -use xml5ever::tree_builder::{Tracer as XmlTracer, TreeSink, XmlTreeBuilder}; +use xml5ever::buffer_queue::BufferQueue; +use xml5ever::tokenizer::XmlTokenizer; +use xml5ever::tree_builder::{Tracer as XmlTracer, XmlTreeBuilder}; #[derive(HeapSizeOf, JSTraceable)] #[must_root] @@ -40,6 +28,7 @@ impl Tokenizer { let sink = Sink { base_url: url, document: JS::from_ref(document), + current_line: 1, script: Default::default(), }; @@ -86,7 +75,7 @@ unsafe impl JSTraceable for XmlTokenizer<XmlTreeBuilder<JS<Node>, Sink>> { impl XmlTracer for Tracer { type Handle = JS<Node>; #[allow(unrooted_must_root)] - fn trace_handle(&self, node: JS<Node>) { + fn trace_handle(&self, node: &JS<Node>) { unsafe { node.trace(self.0); } } } @@ -96,111 +85,3 @@ unsafe impl JSTraceable for XmlTokenizer<XmlTreeBuilder<JS<Node>, Sink>> { tree_builder.sink().trace(trc); } } - -#[derive(JSTraceable, HeapSizeOf)] -#[must_root] -struct Sink { - base_url: ServoUrl, - document: JS<Document>, - script: MutNullableJS<HTMLScriptElement>, -} - -impl TreeSink for Sink { - type Output = Self; - type Handle = JS<Node>; - - fn finish(self) -> Self { - self - } - - fn parse_error(&mut self, msg: Cow<'static, str>) { - debug!("Parse error: {}", msg); - } - - fn get_document(&mut self) -> JS<Node> { - JS::from_ref(self.document.upcast()) - } - - fn elem_name(&self, target: &JS<Node>) -> QName { - let elem = target.downcast::<Element>() - .expect("tried to get name of non-Element in XML parsing"); - QName { - prefix: elem.prefix().map_or(namespace_prefix!(""), |p| Prefix::from(&**p)), - namespace_url: elem.namespace().clone(), - local: elem.local_name().clone(), - } - } - - fn create_element(&mut self, name: QName, attrs: Vec<Attribute>) - -> JS<Node> { - let prefix = if name.prefix == namespace_prefix!("") { None } else { Some(name.prefix) }; - let name = QualName { - ns: name.namespace_url, - local: name.local, - }; - //TODO: Add ability to track lines to API of xml5ever - let elem = Element::create(name, prefix, &*self.document, - ElementCreator::ParserCreated(1)); - - for attr in attrs { - let name = QualName { - ns: 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()) - } - - fn create_comment(&mut self, text: StrTendril) -> JS<Node> { - let comment = Comment::new(DOMString::from(String::from(text)), &*self.document); - JS::from_ref(comment.upcast()) - } - - fn append(&mut self, parent: JS<Node>, child: NodeOrText<JS<Node>>) { - let child = match child { - NodeOrText::AppendNode(n) => H5eNodeOrText::AppendNode(n), - NodeOrText::AppendText(s) => H5eNodeOrText::AppendText(s), - }; - super::insert(&*parent, None, child); - } - - fn append_doctype_to_document(&mut self, name: StrTendril, public_id: StrTendril, - system_id: StrTendril) { - let doc = &*self.document; - let doctype = DocumentType::new( - DOMString::from(String::from(name)), Some(DOMString::from(String::from(public_id))), - Some(DOMString::from(String::from(system_id))), doc); - doc.upcast::<Node>().AppendChild(doctype.upcast()).expect("Appending failed"); - } - - fn create_pi(&mut self, target: StrTendril, data: StrTendril) -> JS<Node> { - let doc = &*self.document; - let pi = ProcessingInstruction::new( - DOMString::from(String::from(target)), DOMString::from(String::from(data)), - doc); - JS::from_ref(pi.upcast()) - } - - fn mark_script_already_started(&mut self, node: Self::Handle) { - let script = node.downcast::<HTMLScriptElement>(); - if let Some(script) = script { - script.set_already_started(true); - } - } - - fn complete_script(&mut self, node: Self::Handle) -> NextParserState { - if let Some(script) = node.downcast() { - self.script.set(Some(script)); - NextParserState::Suspend - } else { - NextParserState::Continue - } - } - - fn pop(&mut self, node: Self::Handle) { - let node = Root::from_ref(&*node); - vtable_for(&node).pop(); - } -} diff --git a/components/script/dom/svgelement.rs b/components/script/dom/svgelement.rs index 1a0654ed312..358cc925383 100644 --- a/components/script/dom/svgelement.rs +++ b/components/script/dom/svgelement.rs @@ -8,7 +8,7 @@ use dom::document::Document; use dom::element::Element; use dom::virtualmethods::VirtualMethods; use dom_struct::dom_struct; -use html5ever_atoms::LocalName; +use html5ever::LocalName; use style::element_state::ElementState; #[dom_struct] diff --git a/components/script/dom/svggraphicselement.rs b/components/script/dom/svggraphicselement.rs index f41768f9815..73b3a3789f6 100644 --- a/components/script/dom/svggraphicselement.rs +++ b/components/script/dom/svggraphicselement.rs @@ -8,7 +8,7 @@ use dom::document::Document; use dom::svgelement::SVGElement; use dom::virtualmethods::VirtualMethods; use dom_struct::dom_struct; -use html5ever_atoms::LocalName; +use html5ever::LocalName; use style::element_state::ElementState; #[dom_struct] diff --git a/components/script/dom/svgsvgelement.rs b/components/script/dom/svgsvgelement.rs index 7c7d85f17b0..c8bb6ff54ad 100644 --- a/components/script/dom/svgsvgelement.rs +++ b/components/script/dom/svgsvgelement.rs @@ -13,7 +13,7 @@ use dom::node::Node; use dom::svggraphicselement::SVGGraphicsElement; use dom::virtualmethods::VirtualMethods; use dom_struct::dom_struct; -use html5ever_atoms::LocalName; +use html5ever::LocalName; use script_layout_interface::SVGSVGData; use style::attr::AttrValue; diff --git a/components/script/dom/virtualmethods.rs b/components/script/dom/virtualmethods.rs index 8ff47f9ced5..ecb4d2ee559 100644 --- a/components/script/dom/virtualmethods.rs +++ b/components/script/dom/virtualmethods.rs @@ -51,7 +51,7 @@ use dom::htmltextareaelement::HTMLTextAreaElement; use dom::htmltitleelement::HTMLTitleElement; use dom::node::{ChildrenMutation, CloneChildrenFlag, Node, UnbindContext}; use dom::svgsvgelement::SVGSVGElement; -use html5ever_atoms::LocalName; +use html5ever::LocalName; use style::attr::AttrValue; /// Trait to allow DOM nodes to opt-in to overriding (or adding to) common diff --git a/components/script/layout_wrapper.rs b/components/script/layout_wrapper.rs index 3ddb1d2b5c9..6f7c8723c2b 100644 --- a/components/script/layout_wrapper.rs +++ b/components/script/layout_wrapper.rs @@ -42,7 +42,7 @@ use dom::node::{CAN_BE_FRAGMENTED, DIRTY_ON_VIEWPORT_SIZE_CHANGE, HAS_DIRTY_DESC use dom::node::{LayoutNodeHelpers, Node}; use dom::text::Text; use gfx_traits::ByteIndex; -use html5ever_atoms::{LocalName, Namespace}; +use html5ever::{LocalName, Namespace}; use msg::constellation_msg::PipelineId; use range::Range; use script_layout_interface::{HTMLCanvasData, LayoutNodeType, SVGSVGData, TrustedNodeAddress}; diff --git a/components/script/lib.rs b/components/script/lib.rs index 678603ee60f..c1bd886b927 100644 --- a/components/script/lib.rs +++ b/components/script/lib.rs @@ -48,8 +48,7 @@ extern crate fnv; extern crate gfx_traits; extern crate heapsize; #[macro_use] extern crate heapsize_derive; -extern crate html5ever; -#[macro_use] extern crate html5ever_atoms; +#[macro_use] extern crate html5ever; #[macro_use] extern crate hyper; extern crate hyper_serde; diff --git a/components/script_layout_interface/Cargo.toml b/components/script_layout_interface/Cargo.toml index 2df1a3f3205..03bb0df8436 100644 --- a/components/script_layout_interface/Cargo.toml +++ b/components/script_layout_interface/Cargo.toml @@ -18,7 +18,7 @@ euclid = "0.11" gfx_traits = {path = "../gfx_traits"} heapsize = "0.3.0" heapsize_derive = "0.1" -html5ever-atoms = "0.3" +html5ever = "0.16" ipc-channel = "0.7" libc = "0.2" log = "0.3.5" diff --git a/components/script_layout_interface/lib.rs b/components/script_layout_interface/lib.rs index 98375e6a05a..46d9bf2aadc 100644 --- a/components/script_layout_interface/lib.rs +++ b/components/script_layout_interface/lib.rs @@ -19,7 +19,7 @@ extern crate euclid; extern crate gfx_traits; extern crate heapsize; #[macro_use] extern crate heapsize_derive; -#[macro_use] extern crate html5ever_atoms; +#[macro_use] extern crate html5ever; extern crate ipc_channel; extern crate libc; #[macro_use] diff --git a/components/script_layout_interface/wrapper_traits.rs b/components/script_layout_interface/wrapper_traits.rs index 4abc74bcac0..237cc4f5687 100644 --- a/components/script_layout_interface/wrapper_traits.rs +++ b/components/script_layout_interface/wrapper_traits.rs @@ -10,7 +10,7 @@ use OpaqueStyleAndLayoutData; use SVGSVGData; use atomic_refcell::AtomicRefCell; use gfx_traits::{ByteIndex, FragmentType, combine_id_with_fragment_type}; -use html5ever_atoms::{Namespace, LocalName}; +use html5ever::{Namespace, LocalName}; use msg::constellation_msg::PipelineId; use range::Range; use servo_url::ServoUrl; diff --git a/components/style/Cargo.toml b/components/style/Cargo.toml index 3f1aa94f750..a7e262ec322 100644 --- a/components/style/Cargo.toml +++ b/components/style/Cargo.toml @@ -16,7 +16,7 @@ doctest = false gecko = ["nsstring_vendor", "rayon/unstable", "num_cpus"] use_bindgen = ["bindgen", "regex"] servo = ["serde/unstable", "serde", "serde_derive", "heapsize", "heapsize_derive", - "style_traits/servo", "servo_atoms", "servo_config", "html5ever-atoms", + "style_traits/servo", "servo_atoms", "servo_config", "html5ever", "cssparser/heapsize", "cssparser/serde", "encoding", "smallvec/heapsizeof", "rayon/unstable", "servo_url"] testing = [] @@ -35,7 +35,7 @@ euclid = "0.11" fnv = "1.0" heapsize = {version = "0.3.0", optional = true} heapsize_derive = {version = "0.1", optional = true} -html5ever-atoms = {version = "0.3", optional = true} +html5ever = {version = "0.16", optional = true} lazy_static = "0.2" log = "0.3" matches = "0.1" diff --git a/components/style/lib.rs b/components/style/lib.rs index 7479279418d..ab09fcdbc61 100644 --- a/components/style/lib.rs +++ b/components/style/lib.rs @@ -50,7 +50,7 @@ extern crate fnv; #[cfg(feature = "gecko")] #[macro_use] pub mod gecko_string_cache; #[cfg(feature = "servo")] extern crate heapsize; #[cfg(feature = "servo")] #[macro_use] extern crate heapsize_derive; -#[cfg(feature = "servo")] #[macro_use] extern crate html5ever_atoms; +#[cfg(feature = "servo")] #[macro_use] extern crate html5ever; #[macro_use] extern crate lazy_static; #[macro_use] @@ -140,9 +140,9 @@ use style_traits::ToCss; #[cfg(feature = "gecko")] pub use gecko_string_cache::Atom as LocalName; #[cfg(feature = "servo")] pub use servo_atoms::Atom; -#[cfg(feature = "servo")] pub use html5ever_atoms::Prefix; -#[cfg(feature = "servo")] pub use html5ever_atoms::LocalName; -#[cfg(feature = "servo")] pub use html5ever_atoms::Namespace; +#[cfg(feature = "servo")] pub use html5ever::Prefix; +#[cfg(feature = "servo")] pub use html5ever::LocalName; +#[cfg(feature = "servo")] pub use html5ever::Namespace; /// The CSS properties supported by the style system. /// Generated from the properties.mako.rs template by build.rs diff --git a/tests/unit/style/Cargo.toml b/tests/unit/style/Cargo.toml index 4450cb901b4..09e0231931b 100644 --- a/tests/unit/style/Cargo.toml +++ b/tests/unit/style/Cargo.toml @@ -16,7 +16,7 @@ testing = ["style/testing"] app_units = "0.4" cssparser = "0.13" euclid = "0.11" -html5ever-atoms = "0.3" +html5ever = "0.16" parking_lot = "0.3" rayon = "0.6" rustc-serialize = "0.3" diff --git a/tests/unit/style/lib.rs b/tests/unit/style/lib.rs index baddd4da618..4a03cf0f232 100644 --- a/tests/unit/style/lib.rs +++ b/tests/unit/style/lib.rs @@ -8,7 +8,7 @@ extern crate app_units; extern crate cssparser; extern crate euclid; -#[macro_use] extern crate html5ever_atoms; +#[macro_use] extern crate html5ever; extern crate parking_lot; extern crate rayon; extern crate rustc_serialize; diff --git a/tests/unit/style/stylesheets.rs b/tests/unit/style/stylesheets.rs index 47aa1ea9730..877cc82de31 100644 --- a/tests/unit/style/stylesheets.rs +++ b/tests/unit/style/stylesheets.rs @@ -3,7 +3,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ use cssparser::{self, Parser as CssParser, SourcePosition}; -use html5ever_atoms::{Namespace as NsAtom}; +use html5ever::{Namespace as NsAtom}; use media_queries::CSSErrorReporterTest; use parking_lot::RwLock; use selectors::parser::*; diff --git a/tests/unit/style/stylist.rs b/tests/unit/style/stylist.rs index ea89dfde06b..7b58cab58c2 100644 --- a/tests/unit/style/stylist.rs +++ b/tests/unit/style/stylist.rs @@ -2,7 +2,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -use html5ever_atoms::LocalName; +use html5ever::LocalName; use selectors::parser::LocalName as LocalNameSelector; use selectors::parser::Selector; use servo_atoms::Atom; |