Skip to content

Commit 5b0571d

Browse files
committed
Replace Servo's namespace.rs with a stub
1 parent 7adabf3 commit 5b0571d

File tree

1 file changed

+2
-36
lines changed

1 file changed

+2
-36
lines changed

src/util/namespace.rs

+2-36
Original file line numberDiff line numberDiff line change
@@ -2,44 +2,10 @@
22
* License, v. 2.0. If a copy of the MPL was not distributed with this
33
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
44

5-
// FIXME: This is copied from Servo. The two modules should be unified.
5+
// FIXME: Unify with Servo's namespace.rs.
66

77
#[deriving(Eq, Clone)]
88
pub enum Namespace {
9-
Null,
109
HTML,
11-
XML,
12-
XMLNS,
13-
XLink,
14-
SVG,
15-
MathML,
16-
Other(StrBuf)
17-
}
18-
19-
impl Namespace {
20-
/// Empty string for "no namespace"
21-
pub fn from_str(url: &str) -> Namespace {
22-
match url {
23-
"http://www.w3.org/1999/xhtml" => HTML,
24-
"http://www.w3.org/XML/1998/namespace" => XML,
25-
"http://www.w3.org/2000/xmlns/" => XMLNS,
26-
"http://www.w3.org/1999/xlink" => XLink,
27-
"http://www.w3.org/2000/svg" => SVG,
28-
"http://www.w3.org/1998/Math/MathML" => MathML,
29-
"" => Null,
30-
ns => Other(ns.to_strbuf())
31-
}
32-
}
33-
pub fn to_str<'a>(&'a self) -> &'a str {
34-
match *self {
35-
Null => "",
36-
HTML => "http://www.w3.org/1999/xhtml",
37-
XML => "http://www.w3.org/XML/1998/namespace",
38-
XMLNS => "http://www.w3.org/2000/xmlns/",
39-
XLink => "http://www.w3.org/1999/xlink",
40-
SVG => "http://www.w3.org/2000/svg",
41-
MathML => "http://www.w3.org/1998/Math/MathML",
42-
Other(ref x) => x.as_slice()
43-
}
44-
}
10+
// FIXME: others
4511
}

0 commit comments

Comments
 (0)