Use string-cache's Namespace type

This commit is contained in:
Keegan McAllister 2014-09-29 18:30:01 -07:00
parent 6429750b33
commit d50114c41d
27 changed files with 126 additions and 183 deletions

22
Cargo.lock generated
View file

@ -287,8 +287,8 @@ dependencies = [
"plugins 0.0.1", "plugins 0.0.1",
"script 0.0.1", "script 0.0.1",
"script_traits 0.0.1", "script_traits 0.0.1",
"string_cache 0.0.0 (git+https://github.com/servo/string-cache#b348bd00cc8991e1f25749be077c5bd9cec019bb)", "string_cache 0.0.0 (git+https://github.com/servo/string-cache#97754929f38d93f6728d1f0acce8107648420e98)",
"string_cache_macros 0.0.0 (git+https://github.com/servo/string-cache#b348bd00cc8991e1f25749be077c5bd9cec019bb)", "string_cache_macros 0.0.0 (git+https://github.com/servo/string-cache#97754929f38d93f6728d1f0acce8107648420e98)",
"style 0.0.1", "style 0.0.1",
"url 0.1.0 (git+https://github.com/servo/rust-url#29f70a47230c2aa736e263977247c786e0b2c243)", "url 0.1.0 (git+https://github.com/servo/rust-url#29f70a47230c2aa736e263977247c786e0b2c243)",
"util 0.0.1", "util 0.0.1",
@ -399,8 +399,8 @@ dependencies = [
"net 0.0.1", "net 0.0.1",
"plugins 0.0.1", "plugins 0.0.1",
"script_traits 0.0.1", "script_traits 0.0.1",
"string_cache 0.0.0 (git+https://github.com/servo/string-cache#b348bd00cc8991e1f25749be077c5bd9cec019bb)", "string_cache 0.0.0 (git+https://github.com/servo/string-cache#97754929f38d93f6728d1f0acce8107648420e98)",
"string_cache_macros 0.0.0 (git+https://github.com/servo/string-cache#b348bd00cc8991e1f25749be077c5bd9cec019bb)", "string_cache_macros 0.0.0 (git+https://github.com/servo/string-cache#97754929f38d93f6728d1f0acce8107648420e98)",
"style 0.0.1", "style 0.0.1",
"url 0.1.0 (git+https://github.com/servo/rust-url#29f70a47230c2aa736e263977247c786e0b2c243)", "url 0.1.0 (git+https://github.com/servo/rust-url#29f70a47230c2aa736e263977247c786e0b2c243)",
"util 0.0.1", "util 0.0.1",
@ -440,17 +440,17 @@ source = "git+https://github.com/servo/rust-stb-image#f5022de4ad6bb474a03493d1f2
[[package]] [[package]]
name = "string_cache" name = "string_cache"
version = "0.0.0" version = "0.0.0"
source = "git+https://github.com/servo/string-cache#b348bd00cc8991e1f25749be077c5bd9cec019bb" source = "git+https://github.com/servo/string-cache#97754929f38d93f6728d1f0acce8107648420e98"
dependencies = [ dependencies = [
"phf 0.0.0 (git+https://github.com/sfackler/rust-phf#06254fdde7708630a6397c41c6c17ef81a4b66a0)", "phf 0.0.0 (git+https://github.com/sfackler/rust-phf#06254fdde7708630a6397c41c6c17ef81a4b66a0)",
"phf_mac 0.0.0 (git+https://github.com/sfackler/rust-phf#06254fdde7708630a6397c41c6c17ef81a4b66a0)", "phf_mac 0.0.0 (git+https://github.com/sfackler/rust-phf#06254fdde7708630a6397c41c6c17ef81a4b66a0)",
"string_cache_macros 0.0.0 (git+https://github.com/servo/string-cache#b348bd00cc8991e1f25749be077c5bd9cec019bb)", "string_cache_macros 0.0.0 (git+https://github.com/servo/string-cache#97754929f38d93f6728d1f0acce8107648420e98)",
] ]
[[package]] [[package]]
name = "string_cache_macros" name = "string_cache_macros"
version = "0.0.0" version = "0.0.0"
source = "git+https://github.com/servo/string-cache#b348bd00cc8991e1f25749be077c5bd9cec019bb" source = "git+https://github.com/servo/string-cache#97754929f38d93f6728d1f0acce8107648420e98"
dependencies = [ dependencies = [
"lazy_static 0.1.0 (git+https://github.com/Kimundi/lazy-static.rs#e62a65372f1dd9019e37eb9381d819edff80e360)", "lazy_static 0.1.0 (git+https://github.com/Kimundi/lazy-static.rs#e62a65372f1dd9019e37eb9381d819edff80e360)",
] ]
@ -464,10 +464,10 @@ dependencies = [
"geom 0.1.0 (git+https://github.com/servo/rust-geom#90add8d65273c8a46aa16d73959e29a51d0c282d)", "geom 0.1.0 (git+https://github.com/servo/rust-geom#90add8d65273c8a46aa16d73959e29a51d0c282d)",
"lazy_static 0.1.0 (git+https://github.com/Kimundi/lazy-static.rs#e62a65372f1dd9019e37eb9381d819edff80e360)", "lazy_static 0.1.0 (git+https://github.com/Kimundi/lazy-static.rs#e62a65372f1dd9019e37eb9381d819edff80e360)",
"plugins 0.0.1", "plugins 0.0.1",
"string_cache 0.0.0 (git+https://github.com/servo/string-cache#97754929f38d93f6728d1f0acce8107648420e98)",
"string_cache_macros 0.0.0 (git+https://github.com/servo/string-cache#97754929f38d93f6728d1f0acce8107648420e98)",
"url 0.1.0 (git+https://github.com/servo/rust-url#29f70a47230c2aa736e263977247c786e0b2c243)", "url 0.1.0 (git+https://github.com/servo/rust-url#29f70a47230c2aa736e263977247c786e0b2c243)",
"util 0.0.1", "util 0.0.1",
"string_cache 0.0.0 (git+https://github.com/servo/string-cache#b348bd00cc8991e1f25749be077c5bd9cec019bb)",
"string_cache_macros 0.0.0 (git+https://github.com/servo/string-cache#b348bd00cc8991e1f25749be077c5bd9cec019bb)",
] ]
[[package]] [[package]]
@ -488,8 +488,8 @@ version = "0.0.1"
dependencies = [ dependencies = [
"azure 0.1.0 (git+https://github.com/servo/rust-azure#b357751c04a89a87e6ef1f0cebe5f20957dd112d)", "azure 0.1.0 (git+https://github.com/servo/rust-azure#b357751c04a89a87e6ef1f0cebe5f20957dd112d)",
"geom 0.1.0 (git+https://github.com/servo/rust-geom#90add8d65273c8a46aa16d73959e29a51d0c282d)", "geom 0.1.0 (git+https://github.com/servo/rust-geom#90add8d65273c8a46aa16d73959e29a51d0c282d)",
"string_cache 0.0.0 (git+https://github.com/servo/string-cache#b348bd00cc8991e1f25749be077c5bd9cec019bb)", "string_cache 0.0.0 (git+https://github.com/servo/string-cache#97754929f38d93f6728d1f0acce8107648420e98)",
"string_cache_macros 0.0.0 (git+https://github.com/servo/string-cache#b348bd00cc8991e1f25749be077c5bd9cec019bb)", "string_cache_macros 0.0.0 (git+https://github.com/servo/string-cache#97754929f38d93f6728d1f0acce8107648420e98)",
"task_info 0.0.1", "task_info 0.0.1",
"url 0.1.0 (git+https://github.com/servo/rust-url#29f70a47230c2aa736e263977247c786e0b2c243)", "url 0.1.0 (git+https://github.com/servo/rust-url#29f70a47230c2aa736e263977247c786e0b2c243)",
] ]

View file

@ -57,7 +57,6 @@ use script::dom::node::{CommentNodeTypeId, DoctypeNodeTypeId, DocumentFragmentNo
use script::dom::node::{DocumentNodeTypeId, ElementNodeTypeId, ProcessingInstructionNodeTypeId}; use script::dom::node::{DocumentNodeTypeId, ElementNodeTypeId, ProcessingInstructionNodeTypeId};
use script::dom::node::{TextNodeTypeId}; use script::dom::node::{TextNodeTypeId};
use script::dom::htmlobjectelement::is_image_data; use script::dom::htmlobjectelement::is_image_data;
use servo_util::namespace;
use std::mem; use std::mem;
use std::sync::atomics::Relaxed; use std::sync::atomics::Relaxed;
use style::ComputedValues; use style::ComputedValues;
@ -1091,7 +1090,7 @@ trait ObjectElement<'a> {
impl<'ln> ObjectElement<'ln> for ThreadSafeLayoutNode<'ln> { impl<'ln> ObjectElement<'ln> for ThreadSafeLayoutNode<'ln> {
fn get_type_and_data(&self) -> (Option<&'ln str>, Option<&'ln str>) { fn get_type_and_data(&self) -> (Option<&'ln str>, Option<&'ln str>) {
let elem = self.as_element(); let elem = self.as_element();
(elem.get_attr(&namespace::Null, "type"), elem.get_attr(&namespace::Null, "data")) (elem.get_attr(&ns!(""), "type"), elem.get_attr(&ns!(""), "data"))
} }
fn has_object_data(&self) -> bool { fn has_object_data(&self) -> bool {

View file

@ -13,7 +13,6 @@ use wrapper::{LayoutElement, LayoutNode, PostorderNodeMutTraversal, ThreadSafeLa
use script::dom::node::{TextNodeTypeId}; use script::dom::node::{TextNodeTypeId};
use servo_util::bloom::BloomFilter; use servo_util::bloom::BloomFilter;
use servo_util::cache::{Cache, LRUCache, SimpleHashCache}; use servo_util::cache::{Cache, LRUCache, SimpleHashCache};
use servo_util::namespace::Null;
use servo_util::smallvec::{SmallVec, SmallVec16}; use servo_util::smallvec::{SmallVec, SmallVec16};
use servo_util::str::DOMString; use servo_util::str::DOMString;
use std::mem; use std::mem;
@ -223,7 +222,7 @@ impl StyleSharingCandidate {
style: style, style: style,
parent_style: parent_style, parent_style: parent_style,
local_name: element.get_local_name().clone(), local_name: element.get_local_name().clone(),
class: element.get_attr(&Null, "class") class: element.get_attr(&ns!(""), "class")
.map(|string| string.to_string()), .map(|string| string.to_string()),
}) })
} }
@ -232,7 +231,7 @@ impl StyleSharingCandidate {
if *element.get_local_name() != self.local_name { if *element.get_local_name() != self.local_name {
return false return false
} }
match (&self.class, element.get_attr(&Null, "class")) { match (&self.class, element.get_attr(&ns!(""), "class")) {
(&None, Some(_)) | (&Some(_), None) => return false, (&None, Some(_)) | (&Some(_), None) => return false,
(&Some(ref this_class), Some(element_class)) if element_class != this_class.as_slice() => { (&Some(ref this_class), Some(element_class)) if element_class != this_class.as_slice() => {
return false return false
@ -454,7 +453,7 @@ impl<'ln> MatchMethods for LayoutNode<'ln> {
} }
let ok = { let ok = {
let element = self.as_element(); let element = self.as_element();
element.style_attribute().is_none() && element.get_attr(&Null, "id").is_none() element.style_attribute().is_none() && element.get_attr(&ns!(""), "id").is_none()
}; };
if !ok { if !ok {
return CannotShare(false) return CannotShare(false)
@ -501,7 +500,7 @@ impl<'ln> MatchMethods for LayoutNode<'ln> {
// TODO: case-sensitivity depends on the document type and quirks mode // TODO: case-sensitivity depends on the document type and quirks mode
element element
.get_attr(&Null, "class") .get_attr(&ns!(""), "class")
.map(|attr| { .map(|attr| {
for c in attr.split(style::SELECTOR_WHITESPACE) { for c in attr.split(style::SELECTOR_WHITESPACE) {
bf.insert(&c); bf.insert(&c);
@ -520,7 +519,7 @@ impl<'ln> MatchMethods for LayoutNode<'ln> {
// TODO: case-sensitivity depends on the document type and quirks mode // TODO: case-sensitivity depends on the document type and quirks mode
element element
.get_attr(&Null, "class") .get_attr(&ns!(""), "class")
.map(|attr| { .map(|attr| {
for c in attr.split(style::SELECTOR_WHITESPACE) { for c in attr.split(style::SELECTOR_WHITESPACE) {
bf.remove(&c); bf.remove(&c);

View file

@ -43,7 +43,6 @@ use servo_util::geometry::Au;
use servo_util::geometry; use servo_util::geometry;
use servo_util::logical_geometry::{LogicalRect, LogicalSize, LogicalMargin}; use servo_util::logical_geometry::{LogicalRect, LogicalSize, LogicalMargin};
use servo_util::range::*; use servo_util::range::*;
use servo_util::namespace;
use servo_util::smallvec::SmallVec; use servo_util::smallvec::SmallVec;
use servo_util::str::is_whitespace; use servo_util::str::is_whitespace;
use std::cmp::{max, min}; use std::cmp::{max, min};
@ -179,7 +178,7 @@ impl ImageFragmentInfo {
-> ImageFragmentInfo { -> ImageFragmentInfo {
fn convert_length(node: &ThreadSafeLayoutNode, name: &str) -> Option<Au> { fn convert_length(node: &ThreadSafeLayoutNode, name: &str) -> Option<Au> {
let element = node.as_element(); let element = node.as_element();
element.get_attr(&namespace::Null, name).and_then(|string| { element.get_attr(&ns!(""), name).and_then(|string| {
let n: Option<int> = FromStr::from_str(string); let n: Option<int> = FromStr::from_str(string);
n n
}).and_then(|pixels| Some(Au::from_px(pixels))) }).and_then(|pixels| Some(Au::from_px(pixels)))
@ -352,7 +351,7 @@ impl TableColumnFragmentInfo {
pub fn new(node: &ThreadSafeLayoutNode) -> TableColumnFragmentInfo { pub fn new(node: &ThreadSafeLayoutNode) -> TableColumnFragmentInfo {
let span = { let span = {
let element = node.as_element(); let element = node.as_element();
element.get_attr(&namespace::Null, "span").and_then(|string| { element.get_attr(&ns!(""), "span").and_then(|string| {
let n: Option<int> = FromStr::from_str(string); let n: Option<int> = FromStr::from_str(string);
n n
}) })

View file

@ -48,8 +48,6 @@ use script::dom::node::{LayoutNodeHelpers, RawLayoutNodeHelpers, SharedLayoutDat
use script::dom::text::Text; use script::dom::text::Text;
use script::layout_interface::LayoutChan; use script::layout_interface::LayoutChan;
use servo_msg::constellation_msg::{PipelineId, SubpageId}; use servo_msg::constellation_msg::{PipelineId, SubpageId};
use servo_util::namespace::Namespace;
use servo_util::namespace;
use servo_util::str::is_whitespace; use servo_util::str::is_whitespace;
use std::cell::{RefCell, Ref, RefMut}; use std::cell::{RefCell, Ref, RefMut};
use std::kinds::marker::ContravariantLifetime; use std::kinds::marker::ContravariantLifetime;
@ -58,7 +56,7 @@ use style::computed_values::{content, display, white_space};
use style::{AnyNamespace, AttrSelector, PropertyDeclarationBlock, SpecificNamespace, TElement}; use style::{AnyNamespace, AttrSelector, PropertyDeclarationBlock, SpecificNamespace, TElement};
use style::{TNode}; use style::{TNode};
use url::Url; use url::Url;
use string_cache::Atom; use string_cache::{Atom, Namespace};
/// Allows some convenience methods on generic layout nodes. /// Allows some convenience methods on generic layout nodes.
pub trait TLayoutNode { pub trait TLayoutNode {
@ -413,7 +411,7 @@ impl<'le> TElement<'le> for LayoutElement<'le> {
ElementNodeTypeId(HTMLAnchorElementTypeId) | ElementNodeTypeId(HTMLAnchorElementTypeId) |
ElementNodeTypeId(HTMLAreaElementTypeId) | ElementNodeTypeId(HTMLAreaElementTypeId) |
ElementNodeTypeId(HTMLLinkElementTypeId) => { ElementNodeTypeId(HTMLLinkElementTypeId) => {
unsafe { self.element.get_attr_val_for_layout(&namespace::Null, "href") } unsafe { self.element.get_attr_val_for_layout(&ns!(""), "href") }
} }
_ => None, _ => None,
} }
@ -427,7 +425,7 @@ impl<'le> TElement<'le> for LayoutElement<'le> {
#[inline] #[inline]
fn get_id(&self) -> Option<Atom> { fn get_id(&self) -> Option<Atom> {
unsafe { self.element.get_attr_atom_for_layout(&namespace::Null, "id") } unsafe { self.element.get_attr_atom_for_layout(&ns!(""), "id") }
} }
fn get_disabled_state(&self) -> bool { fn get_disabled_state(&self) -> bool {

View file

@ -15,13 +15,11 @@ use dom::window::Window;
use dom::virtualmethods::vtable_for; use dom::virtualmethods::vtable_for;
use devtools_traits::AttrInfo; use devtools_traits::AttrInfo;
use servo_util::namespace;
use servo_util::namespace::Namespace;
use servo_util::str::{DOMString, split_html_space_chars}; use servo_util::str::{DOMString, split_html_space_chars};
use std::cell::{Ref, RefCell}; use std::cell::{Ref, RefCell};
use std::mem; use std::mem;
use std::slice::Items; use std::slice::Items;
use string_cache::Atom; use string_cache::{Atom, Namespace};
pub enum AttrSettingType { pub enum AttrSettingType {
FirstSetAttr, FirstSetAttr,
@ -136,7 +134,8 @@ impl<'a> AttrMethods for JSRef<'a, Attr> {
} }
fn GetNamespaceURI(self) -> Option<DOMString> { fn GetNamespaceURI(self) -> Option<DOMString> {
match self.namespace.to_str() { let Namespace(ref atom) = self.namespace;
match atom.as_slice() {
"" => None, "" => None,
url => Some(url.to_string()), url => Some(url.to_string()),
} }
@ -158,7 +157,7 @@ impl<'a> AttrHelpers<'a> for JSRef<'a, Attr> {
fn set_value(self, set_type: AttrSettingType, value: AttrValue) { fn set_value(self, set_type: AttrSettingType, value: AttrValue) {
let owner = self.owner.root(); let owner = self.owner.root();
let node: JSRef<Node> = NodeCast::from_ref(*owner); let node: JSRef<Node> = NodeCast::from_ref(*owner);
let namespace_is_null = self.namespace == namespace::Null; let namespace_is_null = self.namespace == ns!("");
match set_type { match set_type {
ReplacedAttr => { ReplacedAttr => {
@ -189,8 +188,9 @@ impl<'a> AttrHelpers<'a> for JSRef<'a, Attr> {
} }
fn summarize(self) -> AttrInfo { fn summarize(self) -> AttrInfo {
let Namespace(ref ns) = self.namespace;
AttrInfo { AttrInfo {
namespace: self.namespace.to_str().to_string(), namespace: ns.as_slice().to_string(),
name: self.Name(), name: self.Name(),
value: self.Value(), value: self.Value(),
} }

View file

@ -35,14 +35,13 @@ use std::rc::Rc;
use std::cell::{Cell, RefCell}; use std::cell::{Cell, RefCell};
use url::Url; use url::Url;
use servo_util::namespace::Namespace;
use msg::constellation_msg::{PipelineId, SubpageId, WindowSizeData}; use msg::constellation_msg::{PipelineId, SubpageId, WindowSizeData};
use net::image_cache_task::ImageCacheTask; use net::image_cache_task::ImageCacheTask;
use script_traits::ScriptControlChan; use script_traits::ScriptControlChan;
use std::collections::hashmap::HashMap; use std::collections::hashmap::HashMap;
use collections::hash::Hash; use collections::hash::Hash;
use style::PropertyDeclarationBlock; use style::PropertyDeclarationBlock;
use string_cache::Atom; use string_cache::{Atom, Namespace};
impl<T: Reflectable> JSTraceable for JS<T> { impl<T: Reflectable> JSTraceable for JS<T> {
fn trace(&self, trc: *mut JSTracer) { fn trace(&self, trc: *mut JSTracer) {

View file

@ -56,7 +56,6 @@ use html::hubbub_html_parser::build_element_from_tag;
use hubbub::hubbub::{QuirksMode, NoQuirks, LimitedQuirks, FullQuirks}; use hubbub::hubbub::{QuirksMode, NoQuirks, LimitedQuirks, FullQuirks};
use layout_interface::{DocumentDamageLevel, ContentChangedDocumentDamage}; use layout_interface::{DocumentDamageLevel, ContentChangedDocumentDamage};
use servo_util::namespace; use servo_util::namespace;
use servo_util::namespace::{Namespace, Null};
use servo_util::str::{DOMString, split_html_space_chars}; use servo_util::str::{DOMString, split_html_space_chars};
use string_cache::Atom; use string_cache::Atom;
@ -466,14 +465,14 @@ impl<'a> DocumentMethods for JSRef<'a, Document> {
return Err(InvalidCharacter); return Err(InvalidCharacter);
} }
let local_name = local_name.as_slice().to_ascii_lower(); let local_name = local_name.as_slice().to_ascii_lower();
Ok(build_element_from_tag(local_name, namespace::HTML, self)) Ok(build_element_from_tag(local_name, ns!(HTML), self))
} }
// http://dom.spec.whatwg.org/#dom-document-createelementns // http://dom.spec.whatwg.org/#dom-document-createelementns
fn CreateElementNS(self, fn CreateElementNS(self,
namespace: Option<DOMString>, namespace: Option<DOMString>,
qualified_name: DOMString) -> Fallible<Temporary<Element>> { qualified_name: DOMString) -> Fallible<Temporary<Element>> {
let ns = Namespace::from_str(namespace); let ns = namespace::from_domstring(namespace);
match xml_name_type(qualified_name.as_slice()) { match xml_name_type(qualified_name.as_slice()) {
InvalidXMLName => { InvalidXMLName => {
debug!("Not a valid element name"); debug!("Not a valid element name");
@ -490,26 +489,26 @@ impl<'a> DocumentMethods for JSRef<'a, Document> {
local_name_from_qname) = get_attribute_parts(qualified_name.as_slice()); local_name_from_qname) = get_attribute_parts(qualified_name.as_slice());
match (&ns, prefix_from_qname.clone(), local_name_from_qname.as_slice()) { match (&ns, prefix_from_qname.clone(), local_name_from_qname.as_slice()) {
// throw if prefix is not null and namespace is null // throw if prefix is not null and namespace is null
(&namespace::Null, Some(_), _) => { (&ns!(""), Some(_), _) => {
debug!("Namespace can't be null with a non-null prefix"); debug!("Namespace can't be null with a non-null prefix");
return Err(NamespaceError); return Err(NamespaceError);
}, },
// throw if prefix is "xml" and namespace is not the XML namespace // throw if prefix is "xml" and namespace is not the XML namespace
(_, Some(ref prefix), _) if "xml" == prefix.as_slice() && ns != namespace::XML => { (_, Some(ref prefix), _) if "xml" == prefix.as_slice() && ns != ns!(XML) => {
debug!("Namespace must be the xml namespace if the prefix is 'xml'"); debug!("Namespace must be the xml namespace if the prefix is 'xml'");
return Err(NamespaceError); return Err(NamespaceError);
}, },
// throw if namespace is the XMLNS namespace and neither qualifiedName nor prefix is "xmlns" // throw if namespace is the XMLNS namespace and neither qualifiedName nor prefix is "xmlns"
(&namespace::XMLNS, Some(ref prefix), _) if "xmlns" == prefix.as_slice() => {}, (&ns!(XMLNS), Some(ref prefix), _) if "xmlns" == prefix.as_slice() => {},
(&namespace::XMLNS, _, "xmlns") => {}, (&ns!(XMLNS), _, "xmlns") => {},
(&namespace::XMLNS, _, _) => { (&ns!(XMLNS), _, _) => {
debug!("The prefix or the qualified name must be 'xmlns' if namespace is the XMLNS namespace "); debug!("The prefix or the qualified name must be 'xmlns' if namespace is the XMLNS namespace ");
return Err(NamespaceError); return Err(NamespaceError);
}, },
_ => {} _ => {}
} }
if ns == namespace::HTML { if ns == ns!(HTML) {
Ok(build_element_from_tag(local_name_from_qname.to_string(), ns, self)) Ok(build_element_from_tag(local_name_from_qname.to_string(), ns, self))
} else { } else {
Ok(Element::new(local_name_from_qname.to_string(), ns, Ok(Element::new(local_name_from_qname.to_string(), ns,
@ -755,7 +754,7 @@ impl<'a> DocumentMethods for JSRef<'a, Document> {
} }
let element: JSRef<Element> = ElementCast::to_ref(node).unwrap(); let element: JSRef<Element> = ElementCast::to_ref(node).unwrap();
element.get_attribute(Null, "name").root().map_or(false, |attr| { element.get_attribute(ns!(""), "name").root().map_or(false, |attr| {
attr.value().as_slice() == name.as_slice() attr.value().as_slice() == name.as_slice()
}) })
}) })

View file

@ -12,7 +12,6 @@ use dom::bindings::utils::{Reflector, Reflectable, reflect_dom_object};
use dom::element::{Element, AttributeHandlers}; use dom::element::{Element, AttributeHandlers};
use dom::node::window_from_node; use dom::node::window_from_node;
use servo_util::namespace::Null;
use servo_util::str::{DOMString, HTML_SPACE_CHARACTERS}; use servo_util::str::{DOMString, HTML_SPACE_CHARACTERS};
use string_cache::Atom; use string_cache::Atom;
@ -56,7 +55,7 @@ trait PrivateDOMTokenListHelpers {
impl<'a> PrivateDOMTokenListHelpers for JSRef<'a, DOMTokenList> { impl<'a> PrivateDOMTokenListHelpers for JSRef<'a, DOMTokenList> {
fn attribute(self) -> Option<Temporary<Attr>> { fn attribute(self) -> Option<Temporary<Attr>> {
let element = self.element.root(); let element = self.element.root();
element.deref().get_attribute(Null, self.local_name) element.deref().get_attribute(ns!(""), self.local_name)
} }
fn check_token_exceptions<'a>(self, token: &'a str) -> Fallible<&'a str> { fn check_token_exceptions<'a>(self, token: &'a str) -> Fallible<&'a str> {

View file

@ -35,13 +35,12 @@ use devtools_traits::AttrInfo;
use style::{matches, parse_selector_list_from_str}; use style::{matches, parse_selector_list_from_str};
use style; use style;
use servo_util::namespace; use servo_util::namespace;
use servo_util::namespace::{Namespace, Null};
use servo_util::str::DOMString; use servo_util::str::DOMString;
use std::ascii::StrAsciiExt; use std::ascii::StrAsciiExt;
use std::cell::{Cell, RefCell}; use std::cell::{Cell, RefCell};
use std::mem; use std::mem;
use string_cache::Atom; use string_cache::{Atom, Namespace};
#[jstraceable] #[jstraceable]
#[must_root] #[must_root]
@ -229,7 +228,7 @@ pub trait LayoutElementHelpers {
impl LayoutElementHelpers for JS<Element> { impl LayoutElementHelpers for JS<Element> {
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
unsafe fn html_element_in_html_document_for_layout(&self) -> bool { unsafe fn html_element_in_html_document_for_layout(&self) -> bool {
if (*self.unsafe_get()).namespace != namespace::HTML { if (*self.unsafe_get()).namespace != ns!(HTML) {
return false return false
} }
let node: JS<Node> = self.transmute_copy(); let node: JS<Node> = self.transmute_copy();
@ -249,7 +248,7 @@ pub trait ElementHelpers {
impl<'a> ElementHelpers for JSRef<'a, Element> { impl<'a> ElementHelpers for JSRef<'a, Element> {
fn html_element_in_html_document(&self) -> bool { fn html_element_in_html_document(&self) -> bool {
let node: JSRef<Node> = NodeCast::from_ref(*self); let node: JSRef<Node> = NodeCast::from_ref(*self);
self.namespace == namespace::HTML && node.is_in_html_doc() self.namespace == ns!(HTML) && node.is_in_html_doc()
} }
fn get_local_name<'a>(&'a self) -> &'a Atom { fn get_local_name<'a>(&'a self) -> &'a Atom {
@ -273,7 +272,7 @@ impl<'a> ElementHelpers for JSRef<'a, Element> {
} }
fn is_void(self) -> bool { fn is_void(self) -> bool {
if self.namespace != namespace::HTML { if self.namespace != ns!(HTML) {
return false return false
} }
match self.local_name.as_slice() { match self.local_name.as_slice() {
@ -351,7 +350,7 @@ impl<'a> AttributeHandlers for JSRef<'a, Element> {
let name = Atom::from_slice(name); let name = Atom::from_slice(name);
self.do_set_attribute(name.clone(), value, name.clone(), self.do_set_attribute(name.clone(), value, name.clone(),
namespace::Null, None, |attr| *attr.local_name() == name); ns!(""), None, |attr| *attr.local_name() == name);
} }
fn do_set_attribute(self, local_name: Atom, value: AttrValue, fn do_set_attribute(self, local_name: Atom, value: AttrValue,
@ -376,7 +375,7 @@ impl<'a> AttributeHandlers for JSRef<'a, Element> {
fn parse_attribute(self, namespace: &Namespace, local_name: &Atom, fn parse_attribute(self, namespace: &Namespace, local_name: &Atom,
value: DOMString) -> AttrValue { value: DOMString) -> AttrValue {
if *namespace == namespace::Null { if *namespace == ns!("") {
vtable_for(&NodeCast::from_ref(self)) vtable_for(&NodeCast::from_ref(self))
.parse_plain_attribute(local_name.as_slice(), value) .parse_plain_attribute(local_name.as_slice(), value)
} else { } else {
@ -400,7 +399,7 @@ impl<'a> AttributeHandlers for JSRef<'a, Element> {
node.wait_until_safe_to_modify_dom(); node.wait_until_safe_to_modify_dom();
} }
if namespace == namespace::Null { if namespace == ns!("") {
let removed_raw_value = (*self.deref().attrs.borrow())[idx].root().Value(); let removed_raw_value = (*self.deref().attrs.borrow())[idx].root().Value();
vtable_for(&NodeCast::from_ref(self)) vtable_for(&NodeCast::from_ref(self))
.before_remove_attr(&local_name, .before_remove_attr(&local_name,
@ -425,7 +424,7 @@ impl<'a> AttributeHandlers for JSRef<'a, Element> {
} }
fn has_class(&self, name: &str) -> bool { fn has_class(&self, name: &str) -> bool {
self.get_attribute(Null, "class").root().map(|attr| { self.get_attribute(ns!(""), "class").root().map(|attr| {
attr.deref().value().tokens().map(|mut tokens| { attr.deref().value().tokens().map(|mut tokens| {
tokens.any(|atom| atom.as_slice() == name) tokens.any(|atom| atom.as_slice() == name)
}).unwrap_or(false) }).unwrap_or(false)
@ -444,7 +443,7 @@ impl<'a> AttributeHandlers for JSRef<'a, Element> {
false => Atom::from_slice(name) false => Atom::from_slice(name)
}; };
self.deref().attrs.borrow().iter().map(|attr| attr.root()).any(|attr| { self.deref().attrs.borrow().iter().map(|attr| attr.root()).any(|attr| {
*attr.local_name() == name && attr.namespace == Null *attr.local_name() == name && attr.namespace == ns!("")
}) })
} }
@ -453,7 +452,7 @@ impl<'a> AttributeHandlers for JSRef<'a, Element> {
if value { if value {
self.set_string_attribute(name, String::new()); self.set_string_attribute(name, String::new());
} else { } else {
self.remove_attribute(Null, name); self.remove_attribute(ns!(""), name);
} }
} }
@ -468,7 +467,7 @@ impl<'a> AttributeHandlers for JSRef<'a, Element> {
fn get_string_attribute(self, name: &str) -> DOMString { fn get_string_attribute(self, name: &str) -> DOMString {
assert!(name == name.to_ascii_lower().as_slice()); assert!(name == name.to_ascii_lower().as_slice());
match self.get_attribute(Null, name) { match self.get_attribute(ns!(""), name) {
Some(x) => { Some(x) => {
let x = x.root(); let x = x.root();
x.deref().Value() x.deref().Value()
@ -488,7 +487,7 @@ impl<'a> AttributeHandlers for JSRef<'a, Element> {
fn get_uint_attribute(self, name: &str) -> u32 { fn get_uint_attribute(self, name: &str) -> u32 {
assert!(name == name.to_ascii_lower().as_slice()); assert!(name == name.to_ascii_lower().as_slice());
let attribute = self.get_attribute(Null, name).root(); let attribute = self.get_attribute(ns!(""), name).root();
match attribute { match attribute {
Some(attribute) => { Some(attribute) => {
match *attribute.deref().value() { match *attribute.deref().value() {
@ -509,8 +508,8 @@ impl<'a> ElementMethods for JSRef<'a, Element> {
// http://dom.spec.whatwg.org/#dom-element-namespaceuri // http://dom.spec.whatwg.org/#dom-element-namespaceuri
fn GetNamespaceURI(self) -> Option<DOMString> { fn GetNamespaceURI(self) -> Option<DOMString> {
match self.namespace { match self.namespace {
Null => None, ns!("") => None,
ref ns => Some(ns.to_str().to_string()) Namespace(ref ns) => Some(ns.as_slice().to_string())
} }
} }
@ -592,7 +591,7 @@ impl<'a> ElementMethods for JSRef<'a, Element> {
} else { } else {
name name
}; };
self.get_attribute(Null, name.as_slice()).root() self.get_attribute(ns!(""), name.as_slice()).root()
.map(|s| s.deref().Value()) .map(|s| s.deref().Value())
} }
@ -600,7 +599,7 @@ impl<'a> ElementMethods for JSRef<'a, Element> {
fn GetAttributeNS(self, fn GetAttributeNS(self,
namespace: Option<DOMString>, namespace: Option<DOMString>,
local_name: DOMString) -> Option<DOMString> { local_name: DOMString) -> Option<DOMString> {
let namespace = Namespace::from_str(namespace); let namespace = namespace::from_domstring(namespace);
self.get_attribute(namespace, local_name.as_slice()).root() self.get_attribute(namespace, local_name.as_slice()).root()
.map(|attr| attr.deref().Value()) .map(|attr| attr.deref().Value())
} }
@ -629,8 +628,8 @@ impl<'a> ElementMethods for JSRef<'a, Element> {
// Step 3-5. // Step 3-5.
let name = Atom::from_slice(name.as_slice()); let name = Atom::from_slice(name.as_slice());
let value = self.parse_attribute(&namespace::Null, &name, value); let value = self.parse_attribute(&ns!(""), &name, value);
self.do_set_attribute(name.clone(), value, name.clone(), namespace::Null, None, |attr| { self.do_set_attribute(name.clone(), value, name.clone(), ns!(""), None, |attr| {
attr.deref().name.as_slice() == name.as_slice() attr.deref().name.as_slice() == name.as_slice()
}); });
Ok(()) Ok(())
@ -647,7 +646,7 @@ impl<'a> ElementMethods for JSRef<'a, Element> {
} }
// Step 1. // Step 1.
let namespace = Namespace::from_str(namespace_url); let namespace = namespace::from_domstring(namespace_url);
let name_type = xml_name_type(name.as_slice()); let name_type = xml_name_type(name.as_slice());
match name_type { match name_type {
@ -663,17 +662,17 @@ impl<'a> ElementMethods for JSRef<'a, Element> {
match prefix { match prefix {
Some(ref prefix_str) => { Some(ref prefix_str) => {
// Step 5. // Step 5.
if namespace == namespace::Null { if namespace == ns!("") {
return Err(NamespaceError); return Err(NamespaceError);
} }
// Step 6. // Step 6.
if "xml" == prefix_str.as_slice() && namespace != namespace::XML { if "xml" == prefix_str.as_slice() && namespace != ns!(XML) {
return Err(NamespaceError); return Err(NamespaceError);
} }
// Step 7b. // Step 7b.
if "xmlns" == prefix_str.as_slice() && namespace != namespace::XMLNS { if "xmlns" == prefix_str.as_slice() && namespace != ns!(XMLNS) {
return Err(NamespaceError); return Err(NamespaceError);
} }
}, },
@ -685,12 +684,12 @@ impl<'a> ElementMethods for JSRef<'a, Element> {
let xmlns = Atom::from_slice("xmlns"); // TODO: Make this a static atom type let xmlns = Atom::from_slice("xmlns"); // TODO: Make this a static atom type
// Step 7a. // Step 7a.
if xmlns == name && namespace != namespace::XMLNS { if xmlns == name && namespace != ns!(XMLNS) {
return Err(NamespaceError); return Err(NamespaceError);
} }
// Step 8. // Step 8.
if namespace == namespace::XMLNS && xmlns != name && Some("xmlns") != prefix { if namespace == ns!(XMLNS) && xmlns != name && Some("xmlns") != prefix {
return Err(NamespaceError); return Err(NamespaceError);
} }
@ -712,14 +711,14 @@ impl<'a> ElementMethods for JSRef<'a, Element> {
} else { } else {
name name
}; };
self.remove_attribute(namespace::Null, name.as_slice()) self.remove_attribute(ns!(""), name.as_slice())
} }
// http://dom.spec.whatwg.org/#dom-element-removeattributens // http://dom.spec.whatwg.org/#dom-element-removeattributens
fn RemoveAttributeNS(self, fn RemoveAttributeNS(self,
namespace: Option<DOMString>, namespace: Option<DOMString>,
localname: DOMString) { localname: DOMString) {
let namespace = Namespace::from_str(namespace); let namespace = namespace::from_domstring(namespace);
self.remove_attribute(namespace, localname.as_slice()) self.remove_attribute(namespace, localname.as_slice())
} }
@ -913,7 +912,7 @@ impl<'a> VirtualMethods for JSRef<'a, Element> {
if !tree_in_doc { return; } if !tree_in_doc { return; }
match self.get_attribute(Null, "id").root() { match self.get_attribute(ns!(""), "id").root() {
Some(attr) => { Some(attr) => {
let doc = document_from_node(*self).root(); let doc = document_from_node(*self).root();
let value = attr.deref().Value(); let value = attr.deref().Value();
@ -934,7 +933,7 @@ impl<'a> VirtualMethods for JSRef<'a, Element> {
if !tree_in_doc { return; } if !tree_in_doc { return; }
match self.get_attribute(Null, "id").root() { match self.get_attribute(ns!(""), "id").root() {
Some(attr) => { Some(attr) => {
let doc = document_from_node(*self).root(); let doc = document_from_node(*self).root();
let value = attr.deref().Value(); let value = attr.deref().Value();
@ -962,7 +961,7 @@ impl<'a> style::TElement<'a> for JSRef<'a, Element> {
// selector-link // selector-link
ElementNodeTypeId(HTMLAnchorElementTypeId) | ElementNodeTypeId(HTMLAnchorElementTypeId) |
ElementNodeTypeId(HTMLAreaElementTypeId) | ElementNodeTypeId(HTMLAreaElementTypeId) |
ElementNodeTypeId(HTMLLinkElementTypeId) => self.get_attr(&namespace::Null, "href"), ElementNodeTypeId(HTMLLinkElementTypeId) => self.get_attr(&ns!(""), "href"),
_ => None, _ => None,
} }
} }
@ -977,7 +976,7 @@ impl<'a> style::TElement<'a> for JSRef<'a, Element> {
node.get_hover_state() node.get_hover_state()
} }
fn get_id<'a>(&self) -> Option<Atom> { fn get_id<'a>(&self) -> Option<Atom> {
self.get_attribute(namespace::Null, "id").map(|attr| { self.get_attribute(ns!(""), "id").map(|attr| {
let attr = attr.root(); let attr = attr.root();
match *attr.value() { match *attr.value() {
AtomAttrValue(ref val) => val.clone(), AtomAttrValue(ref val) => val.clone(),

View file

@ -19,7 +19,6 @@ use dom::htmlelement::HTMLElement;
use dom::node::{Node, NodeHelpers, ElementNodeTypeId}; use dom::node::{Node, NodeHelpers, ElementNodeTypeId};
use dom::virtualmethods::VirtualMethods; use dom::virtualmethods::VirtualMethods;
use servo_util::namespace::Null;
use servo_util::str::DOMString; use servo_util::str::DOMString;
#[jstraceable] #[jstraceable]
@ -56,7 +55,7 @@ impl<'a> PrivateHTMLAnchorElementHelpers for JSRef<'a, HTMLAnchorElement> {
fn handle_event_impl(self, event: JSRef<Event>) { fn handle_event_impl(self, event: JSRef<Event>) {
if "click" == event.Type().as_slice() && !event.DefaultPrevented() { if "click" == event.Type().as_slice() && !event.DefaultPrevented() {
let element: JSRef<Element> = ElementCast::from_ref(self); let element: JSRef<Element> = ElementCast::from_ref(self);
let attr = element.get_attribute(Null, "href").root(); let attr = element.get_attribute(ns!(""), "href").root();
match attr { match attr {
Some(ref href) => { Some(ref href) => {
let value = href.Value(); let value = href.Value();

View file

@ -12,11 +12,11 @@ use dom::bindings::utils::{Reflectable, Reflector, reflect_dom_object};
use dom::element::{Element, AttributeHandlers, ElementHelpers}; use dom::element::{Element, AttributeHandlers, ElementHelpers};
use dom::node::{Node, NodeHelpers}; use dom::node::{Node, NodeHelpers};
use dom::window::Window; use dom::window::Window;
use servo_util::namespace::Namespace; use servo_util::namespace;
use servo_util::str::{DOMString, split_html_space_chars}; use servo_util::str::{DOMString, split_html_space_chars};
use std::ascii::StrAsciiExt; use std::ascii::StrAsciiExt;
use string_cache::Atom; use string_cache::{Atom, Namespace};
pub trait CollectionFilter : JSTraceable { pub trait CollectionFilter : JSTraceable {
fn filter(&self, elem: JSRef<Element>, root: JSRef<Node>) -> bool; fn filter(&self, elem: JSRef<Element>, root: JSRef<Node>) -> bool;
@ -105,7 +105,7 @@ impl HTMLCollection {
maybe_ns: Option<DOMString>) -> Temporary<HTMLCollection> { maybe_ns: Option<DOMString>) -> Temporary<HTMLCollection> {
let namespace_filter = match maybe_ns { let namespace_filter = match maybe_ns {
Some(ref namespace) if namespace.as_slice() == "*" => None, Some(ref namespace) if namespace.as_slice() == "*" => None,
ns => Some(Namespace::from_str(ns)), ns => Some(namespace::from_domstring(ns)),
}; };
if tag.as_slice() == "*" { if tag.as_slice() == "*" {

View file

@ -17,7 +17,6 @@ use dom::eventtarget::{EventTarget, EventTargetHelpers, NodeTargetTypeId};
use dom::node::{Node, ElementNodeTypeId, window_from_node}; use dom::node::{Node, ElementNodeTypeId, window_from_node};
use dom::virtualmethods::VirtualMethods; use dom::virtualmethods::VirtualMethods;
use servo_util::namespace;
use servo_util::str::DOMString; use servo_util::str::DOMString;
use string_cache::Atom; use string_cache::Atom;
@ -40,7 +39,7 @@ impl HTMLElementDerived for EventTarget {
impl HTMLElement { impl HTMLElement {
pub fn new_inherited(type_id: ElementTypeId, tag_name: DOMString, document: JSRef<Document>) -> HTMLElement { pub fn new_inherited(type_id: ElementTypeId, tag_name: DOMString, document: JSRef<Document>) -> HTMLElement {
HTMLElement { HTMLElement {
element: Element::new_inherited(type_id, tag_name, namespace::HTML, None, document) element: Element::new_inherited(type_id, tag_name, ns!(HTML), None, document)
} }
} }

View file

@ -23,7 +23,6 @@ use page::IterablePage;
use servo_msg::constellation_msg::{PipelineId, SubpageId}; use servo_msg::constellation_msg::{PipelineId, SubpageId};
use servo_msg::constellation_msg::{IFrameSandboxed, IFrameUnsandboxed}; use servo_msg::constellation_msg::{IFrameSandboxed, IFrameUnsandboxed};
use servo_msg::constellation_msg::{ConstellationChan, LoadIframeUrlMsg}; use servo_msg::constellation_msg::{ConstellationChan, LoadIframeUrlMsg};
use servo_util::namespace::Null;
use servo_util::str::DOMString; use servo_util::str::DOMString;
use string_cache::Atom; use string_cache::Atom;
@ -75,7 +74,7 @@ impl<'a> HTMLIFrameElementHelpers for JSRef<'a, HTMLIFrameElement> {
fn get_url(self) -> Option<Url> { fn get_url(self) -> Option<Url> {
let element: JSRef<Element> = ElementCast::from_ref(self); let element: JSRef<Element> = ElementCast::from_ref(self);
element.get_attribute(Null, "src").root().and_then(|src| { element.get_attribute(ns!(""), "src").root().and_then(|src| {
let url = src.deref().value(); let url = src.deref().value();
if url.as_slice().is_empty() { if url.as_slice().is_empty() {
None None

View file

@ -16,7 +16,6 @@ use dom::node::{Node, NodeHelpers, ElementNodeTypeId, window_from_node};
use dom::virtualmethods::VirtualMethods; use dom::virtualmethods::VirtualMethods;
use layout_interface::{LayoutChan, LoadStylesheetMsg}; use layout_interface::{LayoutChan, LoadStylesheetMsg};
use servo_util::str::{DOMString, HTML_SPACE_CHARACTERS}; use servo_util::str::{DOMString, HTML_SPACE_CHARACTERS};
use servo_util::namespace::Null;
use std::ascii::StrAsciiExt; use std::ascii::StrAsciiExt;
use url::UrlParser; use url::UrlParser;
@ -49,7 +48,7 @@ impl HTMLLinkElement {
} }
fn get_attr(element: JSRef<Element>, name: &str) -> Option<String> { fn get_attr(element: JSRef<Element>, name: &str) -> Option<String> {
let elem = element.get_attribute(Null, name).root(); let elem = element.get_attribute(ns!(""), name).root();
elem.map(|e| e.deref().value().as_slice().to_string()) elem.map(|e| e.deref().value().as_slice().to_string())
} }

View file

@ -20,7 +20,6 @@ use dom::virtualmethods::VirtualMethods;
use servo_net::image_cache_task; use servo_net::image_cache_task;
use servo_net::image_cache_task::ImageCacheTask; use servo_net::image_cache_task::ImageCacheTask;
use servo_util::namespace::Null;
use servo_util::str::DOMString; use servo_util::str::DOMString;
use string_cache::Atom; use string_cache::Atom;
@ -63,8 +62,8 @@ impl<'a> ProcessDataURL for JSRef<'a, HTMLObjectElement> {
let elem: JSRef<Element> = ElementCast::from_ref(*self); let elem: JSRef<Element> = ElementCast::from_ref(*self);
// TODO: support other values // TODO: support other values
match (elem.get_attribute(Null, "type").map(|x| x.root().Value()), match (elem.get_attribute(ns!(""), "type").map(|x| x.root().Value()),
elem.get_attribute(Null, "data").map(|x| x.root().Value())) { elem.get_attribute(ns!(""), "data").map(|x| x.root().Value())) {
(None, Some(uri)) => { (None, Some(uri)) => {
if is_image_data(uri.as_slice()) { if is_image_data(uri.as_slice()) {
let data_url = Url::parse(uri.as_slice()).unwrap(); let data_url = Url::parse(uri.as_slice()).unwrap();

View file

@ -19,7 +19,6 @@ use dom::htmlelement::HTMLElement;
use dom::node::{DisabledStateHelpers, Node, NodeHelpers, ElementNodeTypeId}; use dom::node::{DisabledStateHelpers, Node, NodeHelpers, ElementNodeTypeId};
use dom::virtualmethods::VirtualMethods; use dom::virtualmethods::VirtualMethods;
use servo_util::namespace;
use servo_util::str::{DOMString, split_html_space_chars}; use servo_util::str::{DOMString, split_html_space_chars};
use string_cache::Atom; use string_cache::Atom;
@ -51,7 +50,7 @@ impl HTMLOptionElement {
fn collect_text(node: &JSRef<Node>, value: &mut DOMString) { fn collect_text(node: &JSRef<Node>, value: &mut DOMString) {
let elem: JSRef<Element> = ElementCast::to_ref(*node).unwrap(); let elem: JSRef<Element> = ElementCast::to_ref(*node).unwrap();
let svg_script = elem.namespace == namespace::SVG && elem.local_name.as_slice() == "script"; let svg_script = elem.namespace == ns!(SVG) && elem.local_name.as_slice() == "script";
let html_script = node.is_htmlscriptelement(); let html_script = node.is_htmlscriptelement();
if svg_script || html_script { if svg_script || html_script {
return; return;

View file

@ -16,7 +16,6 @@ use dom::eventtarget::{EventTarget, NodeTargetTypeId};
use dom::htmlelement::HTMLElement; use dom::htmlelement::HTMLElement;
use dom::node::{Node, NodeHelpers, ElementNodeTypeId}; use dom::node::{Node, NodeHelpers, ElementNodeTypeId};
use servo_util::namespace::Null;
use servo_util::str::{DOMString, HTML_SPACE_CHARACTERS, StaticStringVec}; use servo_util::str::{DOMString, HTML_SPACE_CHARACTERS, StaticStringVec};
#[jstraceable] #[jstraceable]
@ -75,7 +74,7 @@ static SCRIPT_JS_MIMES: StaticStringVec = &[
impl<'a> HTMLScriptElementHelpers for JSRef<'a, HTMLScriptElement> { impl<'a> HTMLScriptElementHelpers for JSRef<'a, HTMLScriptElement> {
fn is_javascript(self) -> bool { fn is_javascript(self) -> bool {
let element: JSRef<Element> = ElementCast::from_ref(self); let element: JSRef<Element> = ElementCast::from_ref(self);
match element.get_attribute(Null, "type").root().map(|s| s.Value()) { match element.get_attribute(ns!(""), "type").root().map(|s| s.Value()) {
Some(ref s) if s.is_empty() => { Some(ref s) if s.is_empty() => {
// type attr exists, but empty means js // type attr exists, but empty means js
debug!("script type empty, inferring js"); debug!("script type empty, inferring js");
@ -87,7 +86,7 @@ impl<'a> HTMLScriptElementHelpers for JSRef<'a, HTMLScriptElement> {
}, },
None => { None => {
debug!("no script type"); debug!("no script type");
match element.get_attribute(Null, "language").root().map(|s| s.Value()) { match element.get_attribute(ns!(""), "language").root().map(|s| s.Value()) {
Some(ref s) if s.is_empty() => { Some(ref s) if s.is_empty() => {
debug!("script language empty, inferring js"); debug!("script language empty, inferring js");
true true

View file

@ -18,7 +18,6 @@ use dom::node::{TextNodeTypeId, NodeHelpers};
use dom::processinginstruction::ProcessingInstruction; use dom::processinginstruction::ProcessingInstruction;
use dom::text::Text; use dom::text::Text;
use servo_util::namespace;
use string_cache::Atom; use string_cache::Atom;
#[allow(unrooted_must_root)] #[allow(unrooted_must_root)]
@ -82,7 +81,7 @@ fn serialize_text(text: JSRef<Text>, html: &mut String) {
match elem.deref().local_name.as_slice() { match elem.deref().local_name.as_slice() {
"style" | "script" | "xmp" | "iframe" | "style" | "script" | "xmp" | "iframe" |
"noembed" | "noframes" | "plaintext" | "noembed" | "noframes" | "plaintext" |
"noscript" if elem.deref().namespace == namespace::HTML "noscript" if elem.deref().namespace == ns!(HTML)
=> html.push_str(text.deref().characterdata.data.deref().borrow().as_slice()), => html.push_str(text.deref().characterdata.data.deref().borrow().as_slice()),
_ => escape(text.deref().characterdata.data.deref().borrow().as_slice(), false, html) _ => escape(text.deref().characterdata.data.deref().borrow().as_slice(), false, html)
} }
@ -116,7 +115,7 @@ fn serialize_elem(elem: JSRef<Element>, open_elements: &mut Vec<String>, html: &
html.push_char('>'); html.push_char('>');
match elem.deref().local_name.as_slice() { match elem.deref().local_name.as_slice() {
"pre" | "listing" | "textarea" if elem.deref().namespace == namespace::HTML => { "pre" | "listing" | "textarea" if elem.deref().namespace == ns!(HTML) => {
let node: JSRef<Node> = NodeCast::from_ref(elem); let node: JSRef<Node> = NodeCast::from_ref(elem);
match node.first_child().map(|child| child.root()) { match node.first_child().map(|child| child.root()) {
Some(ref child) if child.is_text() => { Some(ref child) if child.is_text() => {
@ -138,16 +137,16 @@ fn serialize_elem(elem: JSRef<Element>, open_elements: &mut Vec<String>, html: &
fn serialize_attr(attr: JSRef<Attr>, html: &mut String) { fn serialize_attr(attr: JSRef<Attr>, html: &mut String) {
html.push_char(' '); html.push_char(' ');
if attr.deref().namespace == namespace::XML { if attr.deref().namespace == ns!(XML) {
html.push_str("xml:"); html.push_str("xml:");
html.push_str(attr.local_name().as_slice()); html.push_str(attr.local_name().as_slice());
} else if attr.deref().namespace == namespace::XMLNS && } else if attr.deref().namespace == ns!(XMLNS) &&
*attr.local_name() == Atom::from_slice("xmlns") { *attr.local_name() == Atom::from_slice("xmlns") {
html.push_str("xmlns"); html.push_str("xmlns");
} else if attr.deref().namespace == namespace::XMLNS { } else if attr.deref().namespace == ns!(XMLNS) {
html.push_str("xmlns:"); html.push_str("xmlns:");
html.push_str(attr.local_name().as_slice()); html.push_str(attr.local_name().as_slice());
} else if attr.deref().namespace == namespace::XLink { } else if attr.deref().namespace == ns!(XLink) {
html.push_str("xlink:"); html.push_str("xlink:");
html.push_str(attr.local_name().as_slice()); html.push_str(attr.local_name().as_slice());
} else { } else {

View file

@ -25,8 +25,6 @@ use encoding::types::{Encoding, DecodeReplace};
use hubbub::hubbub; use hubbub::hubbub;
use hubbub::hubbub::{NullNs, HtmlNs, MathMlNs, SvgNs, XLinkNs, XmlNs, XmlNsNs}; use hubbub::hubbub::{NullNs, HtmlNs, MathMlNs, SvgNs, XLinkNs, XmlNs, XmlNsNs};
use servo_net::resource_task::{Load, LoadData, Payload, Done, ResourceTask, load_whole_resource}; use servo_net::resource_task::{Load, LoadData, Payload, Done, ResourceTask, load_whole_resource};
use servo_util::namespace;
use servo_util::namespace::{Namespace, Null};
use servo_util::str::DOMString; use servo_util::str::DOMString;
use servo_util::task::spawn_named; use servo_util::task::spawn_named;
use std::ascii::StrAsciiExt; use std::ascii::StrAsciiExt;
@ -36,7 +34,7 @@ use std::comm::{channel, Sender, Receiver};
use url::{Url, UrlParser}; use url::{Url, UrlParser};
use http::headers::HeaderEnum; use http::headers::HeaderEnum;
use time; use time;
use string_cache::Atom; use string_cache::{Atom, Namespace};
macro_rules! handle_element( macro_rules! handle_element(
($document: expr, ($document: expr,
@ -153,7 +151,7 @@ fn parse_last_modified(timestamp: &str) -> String {
// via atomization (issue #85). // via atomization (issue #85).
pub fn build_element_from_tag(tag: DOMString, ns: Namespace, document: JSRef<Document>) -> Temporary<Element> { pub fn build_element_from_tag(tag: DOMString, ns: Namespace, document: JSRef<Document>) -> Temporary<Element> {
if ns != namespace::HTML { if ns != ns!(HTML) {
return Element::new(tag, ns, None, document); return Element::new(tag, ns, None, document);
} }
@ -373,9 +371,9 @@ pub fn parse_html(page: &Page,
let tmp_borrow = doc_cell.borrow(); let tmp_borrow = doc_cell.borrow();
let tmp = &*tmp_borrow; let tmp = &*tmp_borrow;
let namespace = match tag.ns { let namespace = match tag.ns {
HtmlNs => namespace::HTML, HtmlNs => ns!(HTML),
MathMlNs => namespace::MathML, MathMlNs => ns!(MathML),
SvgNs => namespace::SVG, SvgNs => ns!(SVG),
ns => fail!("Not expecting namespace {:?}", ns), ns => fail!("Not expecting namespace {:?}", ns),
}; };
let element: Root<Element> = build_element_from_tag(tag.name.clone(), namespace, *tmp).root(); let element: Root<Element> = build_element_from_tag(tag.name.clone(), namespace, *tmp).root();
@ -383,10 +381,10 @@ pub fn parse_html(page: &Page,
debug!("-- attach attrs"); debug!("-- attach attrs");
for attr in tag.attributes.iter() { for attr in tag.attributes.iter() {
let (namespace, prefix) = match attr.ns { let (namespace, prefix) = match attr.ns {
NullNs => (namespace::Null, None), NullNs => (ns!(""), None),
XLinkNs => (namespace::XLink, Some("xlink")), XLinkNs => (ns!(XLink), Some("xlink")),
XmlNs => (namespace::XML, Some("xml")), XmlNs => (ns!(XML), Some("xml")),
XmlNsNs => (namespace::XMLNS, Some("xmlns")), XmlNsNs => (ns!(XMLNS), Some("xmlns")),
ns => fail!("Not expecting namespace {:?}", ns), ns => fail!("Not expecting namespace {:?}", ns),
}; };
element.set_attribute_from_parser(Atom::from_slice(attr.name.as_slice()), element.set_attribute_from_parser(Atom::from_slice(attr.name.as_slice()),
@ -472,7 +470,7 @@ pub fn parse_html(page: &Page,
}; };
let script_element: JSRef<Element> = ElementCast::from_ref(script); let script_element: JSRef<Element> = ElementCast::from_ref(script);
match script_element.get_attribute(Null, "src").root() { match script_element.get_attribute(ns!(""), "src").root() {
Some(src) => { Some(src) => {
debug!("found script: {:s}", src.deref().Value()); debug!("found script: {:s}", src.deref().Value());
let mut url_parser = UrlParser::new(); let mut url_parser = UrlParser::new();

View file

@ -27,7 +27,6 @@ use servo_msg::compositor_msg::ScriptListener;
use servo_msg::constellation_msg::{ConstellationChan, WindowSizeData}; use servo_msg::constellation_msg::{ConstellationChan, WindowSizeData};
use servo_msg::constellation_msg::{PipelineId, SubpageId}; use servo_msg::constellation_msg::{PipelineId, SubpageId};
use servo_net::resource_task::ResourceTask; use servo_net::resource_task::ResourceTask;
use servo_util::namespace::Null;
use servo_util::str::DOMString; use servo_util::str::DOMString;
use std::cell::{Cell, RefCell, Ref, RefMut}; use std::cell::{Cell, RefCell, Ref, RefMut};
use std::comm::{channel, Receiver, Empty, Disconnected}; use std::comm::{channel, Receiver, Empty, Disconnected};
@ -400,7 +399,7 @@ impl Page {
.filter(|node| node.is_anchor_element()); .filter(|node| node.is_anchor_element());
anchors.find(|node| { anchors.find(|node| {
let elem: JSRef<Element> = ElementCast::to_ref(*node).unwrap(); let elem: JSRef<Element> = ElementCast::to_ref(*node).unwrap();
elem.get_attribute(Null, "name").root().map_or(false, |attr| { elem.get_attribute(ns!(""), "name").root().map_or(false, |attr| {
attr.deref().value().as_slice() == fragid.as_slice() attr.deref().value().as_slice() == fragid.as_slice()
}) })
}).map(|node| Temporary::from_rooted(ElementCast::to_ref(node).unwrap())) }).map(|node| Temporary::from_rooted(ElementCast::to_ref(node).unwrap()))

View file

@ -4,8 +4,9 @@
use cssparser::ast::*; use cssparser::ast::*;
use std::collections::hashmap::HashMap; use std::collections::hashmap::HashMap;
use servo_util::namespace::Namespace; use servo_util::namespace;
use errors::log_css_error; use errors::log_css_error;
use string_cache::Namespace;
pub struct NamespaceMap { pub struct NamespaceMap {
pub default: Option<Namespace>, pub default: Option<Namespace>,
@ -40,7 +41,7 @@ pub fn parse_namespace_rule(rule: AtRule, namespaces: &mut NamespaceMap) {
}, },
URL(value) | QuotedString(value) => { URL(value) | QuotedString(value) => {
if ns.is_some() { syntax_error!() } if ns.is_some() { syntax_error!() }
ns = Some(Namespace::from_str(Some(value))); ns = Some(namespace::from_domstring(Some(value)));
break break
}, },
_ => syntax_error!(), _ => syntax_error!(),

View file

@ -6,8 +6,7 @@
//! style. //! style.
use selectors::AttrSelector; use selectors::AttrSelector;
use servo_util::namespace::Namespace; use string_cache::{Atom, Namespace};
use string_cache::Atom;
pub trait TNode<'a, E: TElement<'a>> : Clone { pub trait TNode<'a, E: TElement<'a>> : Clone {

View file

@ -10,7 +10,6 @@ use sync::Arc;
use url::Url; use url::Url;
use servo_util::bloom::BloomFilter; use servo_util::bloom::BloomFilter;
use servo_util::namespace;
use servo_util::smallvec::VecLike; use servo_util::smallvec::VecLike;
use servo_util::sort; use servo_util::sort;
use string_cache::Atom; use string_cache::Atom;
@ -107,7 +106,7 @@ impl SelectorMap {
None => {} None => {}
} }
match element.get_attr(&namespace::Null, "class") { match element.get_attr(&ns!(""), "class") {
Some(ref class_attr) => { Some(ref class_attr) => {
// FIXME: Store classes pre-split as atoms to make the loop below faster. // FIXME: Store classes pre-split as atoms to make the loop below faster.
for class in class_attr.split(SELECTOR_WHITESPACE) { for class in class_attr.split(SELECTOR_WHITESPACE) {

View file

@ -9,9 +9,7 @@ use sync::Arc;
use cssparser::ast::*; use cssparser::ast::*;
use cssparser::{tokenize, parse_nth}; use cssparser::{tokenize, parse_nth};
use servo_util::namespace::Namespace; use string_cache::{Atom, Namespace};
use servo_util::namespace;
use string_cache::Atom;
use namespaces::NamespaceMap; use namespaces::NamespaceMap;
@ -414,7 +412,7 @@ fn parse_qualified_name<I: Iterator<ComponentValue>>(
explicit_namespace(iter, SpecificNamespace(namespace)) explicit_namespace(iter, SpecificNamespace(namespace))
}, },
_ if in_attr_selector => Ok(Some( _ if in_attr_selector => Ok(Some(
(SpecificNamespace(namespace::Null), Some(value)))), (SpecificNamespace(ns!("")), Some(value)))),
_ => default_namespace(Some(value)), _ => default_namespace(Some(value)),
} }
}, },
@ -428,7 +426,7 @@ fn parse_qualified_name<I: Iterator<ComponentValue>>(
}, },
} }
}, },
Some(&Delim('|')) => explicit_namespace(iter, SpecificNamespace(namespace::Null)), Some(&Delim('|')) => explicit_namespace(iter, SpecificNamespace(ns!(""))),
_ => Ok(None), _ => Ok(None),
} }
} }
@ -575,7 +573,6 @@ fn skip_whitespace<I: Iterator<ComponentValue>>(iter: &mut Iter<I>) -> bool {
mod tests { mod tests {
use sync::Arc; use sync::Arc;
use cssparser; use cssparser;
use servo_util::namespace;
use namespaces::NamespaceMap; use namespaces::NamespaceMap;
use super::*; use super::*;
@ -654,7 +651,7 @@ mod tests {
simple_selectors: vec!(AttrExists(AttrSelector { simple_selectors: vec!(AttrExists(AttrSelector {
name: Atom::from_slice("Foo"), name: Atom::from_slice("Foo"),
lower_name: Atom::from_slice("foo"), lower_name: Atom::from_slice("foo"),
namespace: SpecificNamespace(namespace::Null), namespace: SpecificNamespace(ns!("")),
})), })),
next: None, next: None,
}), }),
@ -663,13 +660,13 @@ mod tests {
}))) })))
// Default namespace does not apply to attribute selectors // Default namespace does not apply to attribute selectors
// https://github.com/mozilla/servo/pull/1652 // https://github.com/mozilla/servo/pull/1652
namespaces.default = Some(namespace::MathML); namespaces.default = Some(ns!(MathML));
assert!(parse_ns("[Foo]", &namespaces) == Ok(vec!(Selector { assert!(parse_ns("[Foo]", &namespaces) == Ok(vec!(Selector {
compound_selectors: Arc::new(CompoundSelector { compound_selectors: Arc::new(CompoundSelector {
simple_selectors: vec!(AttrExists(AttrSelector { simple_selectors: vec!(AttrExists(AttrSelector {
name: Atom::from_slice("Foo"), name: Atom::from_slice("Foo"),
lower_name: Atom::from_slice("foo"), lower_name: Atom::from_slice("foo"),
namespace: SpecificNamespace(namespace::Null), namespace: SpecificNamespace(ns!("")),
})), })),
next: None, next: None,
}), }),
@ -680,7 +677,7 @@ mod tests {
assert!(parse_ns("e", &namespaces) == Ok(vec!(Selector { assert!(parse_ns("e", &namespaces) == Ok(vec!(Selector {
compound_selectors: Arc::new(CompoundSelector { compound_selectors: Arc::new(CompoundSelector {
simple_selectors: vec!( simple_selectors: vec!(
NamespaceSelector(namespace::MathML), NamespaceSelector(ns!(MathML)),
LocalNameSelector(LocalName { LocalNameSelector(LocalName {
name: Atom::from_slice("e"), name: Atom::from_slice("e"),
lower_name: Atom::from_slice("e") }), lower_name: Atom::from_slice("e") }),

View file

@ -3,44 +3,11 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use str::DOMString; use str::DOMString;
use string_cache::{Atom, Namespace};
#[deriving(Eq, PartialEq, Clone, Encodable, Hash, Show)] pub fn from_domstring(url: Option<DOMString>) -> Namespace {
pub enum Namespace { match url {
Null, None => ns!(""),
HTML, Some(ref s) => Namespace(Atom::from_slice(s.as_slice())),
XML,
XMLNS,
XLink,
SVG,
MathML,
Other(String)
}
impl Namespace {
/// Empty string for "no namespace"
pub fn from_str(url: Option<DOMString>) -> Namespace {
match url {
None => Null,
Some(ref ns) if ns.as_slice() == "" => Null,
Some(ref ns) if ns.as_slice() == "http://www.w3.org/1999/xhtml" => HTML,
Some(ref ns) if ns.as_slice() == "http://www.w3.org/XML/1998/namespace" => XML,
Some(ref ns) if ns.as_slice() == "http://www.w3.org/2000/xmlns/" => XMLNS,
Some(ref ns) if ns.as_slice() == "http://www.w3.org/1999/xlink" => XLink,
Some(ref ns) if ns.as_slice() == "http://www.w3.org/2000/svg" => SVG,
Some(ref ns) if ns.as_slice() == "http://www.w3.org/1998/Math/MathML" => MathML,
Some(ns) => Other(ns)
}
}
pub fn to_str<'a>(&'a self) -> &'a str {
match *self {
Null => "",
HTML => "http://www.w3.org/1999/xhtml",
XML => "http://www.w3.org/XML/1998/namespace",
XMLNS => "http://www.w3.org/2000/xmlns/",
XLink => "http://www.w3.org/1999/xlink",
SVG => "http://www.w3.org/2000/svg",
MathML => "http://www.w3.org/1998/Math/MathML",
Other(ref x) => x.as_slice()
}
} }
} }

22
ports/cef/Cargo.lock generated
View file

@ -299,8 +299,8 @@ dependencies = [
"plugins 0.0.1", "plugins 0.0.1",
"script 0.0.1", "script 0.0.1",
"script_traits 0.0.1", "script_traits 0.0.1",
"string_cache 0.0.0 (git+https://github.com/servo/string-cache#b348bd00cc8991e1f25749be077c5bd9cec019bb)", "string_cache 0.0.0 (git+https://github.com/servo/string-cache#97754929f38d93f6728d1f0acce8107648420e98)",
"string_cache_macros 0.0.0 (git+https://github.com/servo/string-cache#b348bd00cc8991e1f25749be077c5bd9cec019bb)", "string_cache_macros 0.0.0 (git+https://github.com/servo/string-cache#97754929f38d93f6728d1f0acce8107648420e98)",
"style 0.0.1", "style 0.0.1",
"url 0.1.0 (git+https://github.com/servo/rust-url#29f70a47230c2aa736e263977247c786e0b2c243)", "url 0.1.0 (git+https://github.com/servo/rust-url#29f70a47230c2aa736e263977247c786e0b2c243)",
"util 0.0.1", "util 0.0.1",
@ -411,8 +411,8 @@ dependencies = [
"net 0.0.1", "net 0.0.1",
"plugins 0.0.1", "plugins 0.0.1",
"script_traits 0.0.1", "script_traits 0.0.1",
"string_cache 0.0.0 (git+https://github.com/servo/string-cache#b348bd00cc8991e1f25749be077c5bd9cec019bb)", "string_cache 0.0.0 (git+https://github.com/servo/string-cache#97754929f38d93f6728d1f0acce8107648420e98)",
"string_cache_macros 0.0.0 (git+https://github.com/servo/string-cache#b348bd00cc8991e1f25749be077c5bd9cec019bb)", "string_cache_macros 0.0.0 (git+https://github.com/servo/string-cache#97754929f38d93f6728d1f0acce8107648420e98)",
"style 0.0.1", "style 0.0.1",
"url 0.1.0 (git+https://github.com/servo/rust-url#29f70a47230c2aa736e263977247c786e0b2c243)", "url 0.1.0 (git+https://github.com/servo/rust-url#29f70a47230c2aa736e263977247c786e0b2c243)",
"util 0.0.1", "util 0.0.1",
@ -466,17 +466,17 @@ source = "git+https://github.com/servo/rust-stb-image#f5022de4ad6bb474a03493d1f2
[[package]] [[package]]
name = "string_cache" name = "string_cache"
version = "0.0.0" version = "0.0.0"
source = "git+https://github.com/servo/string-cache#b348bd00cc8991e1f25749be077c5bd9cec019bb" source = "git+https://github.com/servo/string-cache#97754929f38d93f6728d1f0acce8107648420e98"
dependencies = [ dependencies = [
"phf 0.0.0 (git+https://github.com/sfackler/rust-phf#06254fdde7708630a6397c41c6c17ef81a4b66a0)", "phf 0.0.0 (git+https://github.com/sfackler/rust-phf#06254fdde7708630a6397c41c6c17ef81a4b66a0)",
"phf_mac 0.0.0 (git+https://github.com/sfackler/rust-phf#06254fdde7708630a6397c41c6c17ef81a4b66a0)", "phf_mac 0.0.0 (git+https://github.com/sfackler/rust-phf#06254fdde7708630a6397c41c6c17ef81a4b66a0)",
"string_cache_macros 0.0.0 (git+https://github.com/servo/string-cache#b348bd00cc8991e1f25749be077c5bd9cec019bb)", "string_cache_macros 0.0.0 (git+https://github.com/servo/string-cache#97754929f38d93f6728d1f0acce8107648420e98)",
] ]
[[package]] [[package]]
name = "string_cache_macros" name = "string_cache_macros"
version = "0.0.0" version = "0.0.0"
source = "git+https://github.com/servo/string-cache#b348bd00cc8991e1f25749be077c5bd9cec019bb" source = "git+https://github.com/servo/string-cache#97754929f38d93f6728d1f0acce8107648420e98"
dependencies = [ dependencies = [
"lazy_static 0.1.0 (git+https://github.com/Kimundi/lazy-static.rs#e62a65372f1dd9019e37eb9381d819edff80e360)", "lazy_static 0.1.0 (git+https://github.com/Kimundi/lazy-static.rs#e62a65372f1dd9019e37eb9381d819edff80e360)",
] ]
@ -490,8 +490,8 @@ dependencies = [
"geom 0.1.0 (git+https://github.com/servo/rust-geom#90add8d65273c8a46aa16d73959e29a51d0c282d)", "geom 0.1.0 (git+https://github.com/servo/rust-geom#90add8d65273c8a46aa16d73959e29a51d0c282d)",
"lazy_static 0.1.0 (git+https://github.com/Kimundi/lazy-static.rs#e62a65372f1dd9019e37eb9381d819edff80e360)", "lazy_static 0.1.0 (git+https://github.com/Kimundi/lazy-static.rs#e62a65372f1dd9019e37eb9381d819edff80e360)",
"plugins 0.0.1", "plugins 0.0.1",
"string_cache 0.0.0 (git+https://github.com/servo/string-cache#b348bd00cc8991e1f25749be077c5bd9cec019bb)", "string_cache 0.0.0 (git+https://github.com/servo/string-cache#97754929f38d93f6728d1f0acce8107648420e98)",
"string_cache_macros 0.0.0 (git+https://github.com/servo/string-cache#b348bd00cc8991e1f25749be077c5bd9cec019bb)", "string_cache_macros 0.0.0 (git+https://github.com/servo/string-cache#97754929f38d93f6728d1f0acce8107648420e98)",
"url 0.1.0 (git+https://github.com/servo/rust-url#29f70a47230c2aa736e263977247c786e0b2c243)", "url 0.1.0 (git+https://github.com/servo/rust-url#29f70a47230c2aa736e263977247c786e0b2c243)",
"util 0.0.1", "util 0.0.1",
] ]
@ -514,8 +514,8 @@ version = "0.0.1"
dependencies = [ dependencies = [
"azure 0.1.0 (git+https://github.com/servo/rust-azure#b357751c04a89a87e6ef1f0cebe5f20957dd112d)", "azure 0.1.0 (git+https://github.com/servo/rust-azure#b357751c04a89a87e6ef1f0cebe5f20957dd112d)",
"geom 0.1.0 (git+https://github.com/servo/rust-geom#90add8d65273c8a46aa16d73959e29a51d0c282d)", "geom 0.1.0 (git+https://github.com/servo/rust-geom#90add8d65273c8a46aa16d73959e29a51d0c282d)",
"string_cache 0.0.0 (git+https://github.com/servo/string-cache#b348bd00cc8991e1f25749be077c5bd9cec019bb)", "string_cache 0.0.0 (git+https://github.com/servo/string-cache#97754929f38d93f6728d1f0acce8107648420e98)",
"string_cache_macros 0.0.0 (git+https://github.com/servo/string-cache#b348bd00cc8991e1f25749be077c5bd9cec019bb)", "string_cache_macros 0.0.0 (git+https://github.com/servo/string-cache#97754929f38d93f6728d1f0acce8107648420e98)",
"task_info 0.0.1", "task_info 0.0.1",
"url 0.1.0 (git+https://github.com/servo/rust-url#29f70a47230c2aa736e263977247c786e0b2c243)", "url 0.1.0 (git+https://github.com/servo/rust-url#29f70a47230c2aa736e263977247c786e0b2c243)",
] ]