зеркало из https://github.com/mozilla/gecko-dev.git
servo: Merge #5732 - Move the lookupPrefix content test (from Ms2ger:content); r=jdm
Source-Repo: https://github.com/servo/servo Source-Revision: b296c721869680d44757324a9254525eed10d8ed
This commit is contained in:
Родитель
150198541e
Коммит
20024464a6
|
@ -1,48 +0,0 @@
|
||||||
<!doctype html>
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<script src="harness.js"></script>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<x xarg="xval">
|
|
||||||
<!--comment-->
|
|
||||||
<?test test?>
|
|
||||||
TEST
|
|
||||||
<x/>
|
|
||||||
</x>
|
|
||||||
<script>
|
|
||||||
document.documentElement.setAttributeNS("http://www.w3.org/2000/xmlns/", "xmlns:x", "test");
|
|
||||||
document.body.setAttributeNS("http://www.w3.org/2000/xmlns/", "xmlns:s", "test");
|
|
||||||
var x = document.getElementsByTagName("x")[0];
|
|
||||||
x.setAttributeNS("http://www.w3.org/2000/xmlns/", "xmlns:t", "test");
|
|
||||||
var yprefix = document.createElementNS("ynamespace", "yprefix:ylocalname");
|
|
||||||
var ynoprefix = document.createElementNS("ynamespace", "ylocalname");
|
|
||||||
ynoprefix.setAttribute("ynoprefixattr", "yval");
|
|
||||||
ynoprefix.setAttributeNS("http://www.w3.org/2000/xmlns/", "xmlns:yattr", "yval");
|
|
||||||
|
|
||||||
// Step 1
|
|
||||||
is(document.lookupPrefix(""), null);
|
|
||||||
is(document.lookupPrefix(null), null);
|
|
||||||
|
|
||||||
// Element step 1
|
|
||||||
is(yprefix.lookupPrefix("ynamespace"), "yprefix");
|
|
||||||
is(ynoprefix.lookupPrefix("ynamespace"), null);
|
|
||||||
|
|
||||||
// Element step 2
|
|
||||||
is(x.lookupPrefix("test"), "t");
|
|
||||||
is(ynoprefix.lookupPrefix("yval"), "yattr");
|
|
||||||
|
|
||||||
// analogous to wpt - https://github.com/w3c/web-platform-tests/blob/master/dom/nodes/Node-lookupPrefix.xhtml
|
|
||||||
is(document.lookupPrefix("test"), "x");
|
|
||||||
is(x.lookupPrefix("test"), "t");
|
|
||||||
is(x.lookupPrefix("http://www.w3.org/1999/xhtml"), null);
|
|
||||||
is(x.lookupPrefix("something"), null);
|
|
||||||
is(x.lookupPrefix(null), null);
|
|
||||||
is(x.parentNode.lookupPrefix("test"), "s");
|
|
||||||
is(x.firstChild.lookupPrefix("test"), "t");
|
|
||||||
is(x.childNodes[1].lookupPrefix("test"), "t");
|
|
||||||
is(x.childNodes[2].lookupPrefix("test"), "t");
|
|
||||||
is(x.lastChild.lookupPrefix("test"), "t");
|
|
||||||
</script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
Загрузка…
Ссылка в новой задаче