aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/script/dom
diff options
context:
space:
mode:
authorSimon Sapin <simon.sapin@exyr.org>2014-01-25 08:22:51 -0800
committerSimon Sapin <simon.sapin@exyr.org>2014-01-25 12:14:06 -0800
commit624e2714d44d6d064aa507f8f6c806888a0f8ddc (patch)
tree23690076464d8062bb2d23695dd966fda3214c21 /src/components/script/dom
parentae0cbda327b16e4f38b10e1913b04c3eaad0224e (diff)
downloadservo-624e2714d44d6d064aa507f8f6c806888a0f8ddc.tar.gz
servo-624e2714d44d6d064aa507f8f6c806888a0f8ddc.zip
Move script::dom::namespace into util, in order to use it from style later.
Diffstat (limited to 'src/components/script/dom')
-rw-r--r--src/components/script/dom/attr.rs2
-rw-r--r--src/components/script/dom/document.rs2
-rw-r--r--src/components/script/dom/element.rs4
-rw-r--r--src/components/script/dom/htmldocument.rs2
-rw-r--r--src/components/script/dom/htmlelement.rs2
-rw-r--r--src/components/script/dom/htmlimageelement.rs2
-rw-r--r--src/components/script/dom/htmlserializer.rs2
-rw-r--r--src/components/script/dom/namespace.rs43
8 files changed, 8 insertions, 51 deletions
diff --git a/src/components/script/dom/attr.rs b/src/components/script/dom/attr.rs
index 3903e2d891d..e7e13853087 100644
--- a/src/components/script/dom/attr.rs
+++ b/src/components/script/dom/attr.rs
@@ -5,8 +5,8 @@
use dom::bindings::codegen::AttrBinding;
use dom::bindings::utils::{Reflectable, Reflector, DOMString};
use dom::bindings::utils::reflect_dom_object;
-use dom::namespace::{Namespace, Null};
use dom::window::Window;
+use servo_util::namespace::{Namespace, Null};
use std::util;
diff --git a/src/components/script/dom/document.rs b/src/components/script/dom/document.rs
index 08979165375..092b3e63abe 100644
--- a/src/components/script/dom/document.rs
+++ b/src/components/script/dom/document.rs
@@ -16,7 +16,6 @@ use dom::event::{AbstractEvent, Event};
use dom::htmlcollection::HTMLCollection;
use dom::htmldocument::HTMLDocument;
use dom::mouseevent::MouseEvent;
-use dom::namespace::Null;
use dom::node::{AbstractNode, Node, ElementNodeTypeId, DocumentNodeTypeId};
use dom::text::Text;
use dom::uievent::UIEvent;
@@ -24,6 +23,7 @@ use dom::window::Window;
use dom::htmltitleelement::HTMLTitleElement;
use html::hubbub_html_parser::build_element_from_tag;
use layout_interface::{DocumentDamageLevel, ContentChangedDocumentDamage};
+use servo_util::namespace::Null;
use js::jsapi::{JSObject, JSContext, JSTracer};
use std::ascii::StrAsciiExt;
diff --git a/src/components/script/dom/element.rs b/src/components/script/dom/element.rs
index c2e790fd53d..f3c75db7a82 100644
--- a/src/components/script/dom/element.rs
+++ b/src/components/script/dom/element.rs
@@ -15,13 +15,13 @@ use dom::clientrectlist::ClientRectList;
use dom::document::AbstractDocument;
use dom::node::{AbstractNode, ElementNodeTypeId, Node, NodeIterator};
use dom::document;
-use dom::namespace;
-use dom::namespace::{Namespace, Null};
use dom::htmlserializer::serialize;
use layout_interface::{ContentBoxQuery, ContentBoxResponse, ContentBoxesQuery};
use layout_interface::{ContentBoxesResponse, ContentChangedDocumentDamage};
use layout_interface::{MatchSelectorsDocumentDamage};
use style;
+use servo_util::namespace;
+use servo_util::namespace::{Namespace, Null};
use std::ascii::StrAsciiExt;
use std::cast;
diff --git a/src/components/script/dom/htmldocument.rs b/src/components/script/dom/htmldocument.rs
index 144869392fe..0dad2905d89 100644
--- a/src/components/script/dom/htmldocument.rs
+++ b/src/components/script/dom/htmldocument.rs
@@ -6,8 +6,8 @@ use dom::bindings::codegen::HTMLDocumentBinding;
use dom::bindings::utils::{Reflectable, Reflector, Traceable};
use dom::document::{AbstractDocument, Document, HTML};
use dom::htmlcollection::HTMLCollection;
-use dom::namespace::Null;
use dom::window::Window;
+use servo_util::namespace::Null;
use js::jsapi::JSTracer;
use std::str::eq_slice;
diff --git a/src/components/script/dom/htmlelement.rs b/src/components/script/dom/htmlelement.rs
index f8703298926..19aecc6d947 100644
--- a/src/components/script/dom/htmlelement.rs
+++ b/src/components/script/dom/htmlelement.rs
@@ -9,7 +9,7 @@ use dom::element::{Element, ElementTypeId, HTMLElementTypeId};
use dom::node::{AbstractNode, Node};
use js::jsapi::{JSContext, JSVal};
use js::JSVAL_NULL;
-use dom::namespace;
+use servo_util::namespace;
pub struct HTMLElement {
element: Element
diff --git a/src/components/script/dom/htmlimageelement.rs b/src/components/script/dom/htmlimageelement.rs
index 2939de9e43a..dd0c5514472 100644
--- a/src/components/script/dom/htmlimageelement.rs
+++ b/src/components/script/dom/htmlimageelement.rs
@@ -7,7 +7,6 @@ use dom::bindings::utils::{DOMString, ErrorResult};
use dom::document::AbstractDocument;
use dom::element::HTMLImageElementTypeId;
use dom::htmlelement::HTMLElement;
-use dom::namespace::Null;
use dom::node::{AbstractNode, Node};
use extra::url::Url;
use servo_util::geometry::to_px;
@@ -15,6 +14,7 @@ use layout_interface::{ContentBoxQuery, ContentBoxResponse};
use servo_net::image_cache_task;
use servo_net::image_cache_task::ImageCacheTask;
use servo_util::url::make_url;
+use servo_util::namespace::Null;
pub struct HTMLImageElement {
htmlelement: HTMLElement,
diff --git a/src/components/script/dom/htmlserializer.rs b/src/components/script/dom/htmlserializer.rs
index 3de36d831f2..8dbedcb2679 100644
--- a/src/components/script/dom/htmlserializer.rs
+++ b/src/components/script/dom/htmlserializer.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 dom::namespace;
+use servo_util::namespace;
use dom::attr::Attr;
use dom::node::NodeIterator;
use dom::node::{DoctypeNodeTypeId, DocumentFragmentNodeTypeId, CommentNodeTypeId, DocumentNodeTypeId, ElementNodeTypeId, TextNodeTypeId, AbstractNode};
diff --git a/src/components/script/dom/namespace.rs b/src/components/script/dom/namespace.rs
deleted file mode 100644
index 354f95f69b2..00000000000
--- a/src/components/script/dom/namespace.rs
+++ /dev/null
@@ -1,43 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * 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/. */
-
-#[deriving(Eq, Clone)]
-pub enum Namespace {
- Null,
- HTML,
- XML,
- XMLNS,
- XLink,
- SVG,
- MathML,
- Other(~str)
-}
-
-impl Namespace {
- /// Empty string for "no namespace"
- pub fn from_str(url: &str) -> Namespace {
- match url {
- "http://www.w3.org/1999/xhtml" => HTML,
- "http://www.w3.org/XML/1998/namespace" => XML,
- "http://www.w3.org/2000/xmlns/" => XMLNS,
- "http://www.w3.org/1999/xlink" => XLink,
- "http://www.w3.org/2000/svg" => SVG,
- "http://www.w3.org/1998/Math/MathML" => MathML,
- "" => Null,
- ns => Other(ns.to_owned())
- }
- }
- pub fn to_str<'a>(&'a self) -> Option<&'a str> {
- match *self {
- Null => None,
- HTML => Some("http://www.w3.org/1999/xhtml"),
- XML => Some("http://www.w3.org/XML/1998/namespace"),
- XMLNS => Some("http://www.w3.org/2000/xmlns/"),
- XLink => Some("http://www.w3.org/1999/xlink"),
- SVG => Some("http://www.w3.org/2000/svg"),
- MathML => Some("http://www.w3.org/1998/Math/MathML"),
- Other(ref x) => Some(x.as_slice())
- }
- }
-}