aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbors-servo <metajack+bors@gmail.com>2014-11-05 12:57:37 -0700
committerbors-servo <metajack+bors@gmail.com>2014-11-05 12:57:37 -0700
commit76cc006a40d7242e64c6c12f033127c569914e31 (patch)
tree8d66f30f81b415b6cfc47e68a6d6e2a6297f746a
parent390e1115375fc887912961baff0ad626e7192cf8 (diff)
parent82ff32a71094898454a2b9f269b1a306d5afd4a8 (diff)
downloadservo-76cc006a40d7242e64c6c12f033127c569914e31.tar.gz
servo-76cc006a40d7242e64c6c12f033127c569914e31.zip
auto merge of #3898 : Ms2ger/servo/prefix-clone, r=jdm
The current code calls as_slice() on the Option, yielding &[DOMString], and then calls to_string, yielding "[prefix]".
-rw-r--r--components/script/dom/node.rs2
-rw-r--r--tests/wpt/metadata/dom/nodes/Element-tagName.html.ini6
-rw-r--r--tests/wpt/metadata/dom/nodes/Node-cloneNode.html.ini6
3 files changed, 1 insertions, 13 deletions
diff --git a/components/script/dom/node.rs b/components/script/dom/node.rs
index 938404bdc37..c1b3ffc7980 100644
--- a/components/script/dom/node.rs
+++ b/components/script/dom/node.rs
@@ -1516,7 +1516,7 @@ impl Node {
local: element.local_name().clone()
};
let element = Element::create(name,
- Some(element.prefix().as_slice().to_string()), *document, ScriptCreated);
+ element.prefix().as_ref().map(|p| p.as_slice().to_string()), *document, ScriptCreated);
NodeCast::from_temporary(element)
},
TextNodeTypeId => {
diff --git a/tests/wpt/metadata/dom/nodes/Element-tagName.html.ini b/tests/wpt/metadata/dom/nodes/Element-tagName.html.ini
index 70f532bf2ee..f9cc02a4f31 100644
--- a/tests/wpt/metadata/dom/nodes/Element-tagName.html.ini
+++ b/tests/wpt/metadata/dom/nodes/Element-tagName.html.ini
@@ -3,9 +3,3 @@
[tagName should be updated when changing ownerDocument]
expected: FAIL
- [tagName should be updated when changing ownerDocument (createDocument without prefix)]
- expected: FAIL
-
- [tagName should be updated when changing ownerDocument (createDocument with prefix)]
- expected: FAIL
-
diff --git a/tests/wpt/metadata/dom/nodes/Node-cloneNode.html.ini b/tests/wpt/metadata/dom/nodes/Node-cloneNode.html.ini
index 015721fb33b..e8a25099d6e 100644
--- a/tests/wpt/metadata/dom/nodes/Node-cloneNode.html.ini
+++ b/tests/wpt/metadata/dom/nodes/Node-cloneNode.html.ini
@@ -1,11 +1,5 @@
[Node-cloneNode.html]
type: testharness
- [Unprefixed HTML element]
- expected: FAIL
-
- [Prefixed HTML element]
- expected: FAIL
-
[Prefixed non-HTML element]
expected: FAIL