2009-12-11 10:37:41 +03:00
|
|
|
<!DOCTYPE HTML>
|
|
|
|
<html>
|
|
|
|
<!--
|
|
|
|
https://bugzilla.mozilla.org/show_bug.cgi?id=525952
|
|
|
|
-->
|
|
|
|
<head>
|
|
|
|
<title>Test for Bug 525952</title>
|
|
|
|
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
|
|
|
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
|
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=525952">Mozilla Bug 525952</a>
|
|
|
|
<p id="display"></p>
|
|
|
|
<div id="content" style="display: none">
|
|
|
|
|
|
|
|
</div>
|
|
|
|
<pre id="test">
|
|
|
|
<script type="application/javascript">
|
|
|
|
|
|
|
|
/** Test for Bug 525952 **/
|
|
|
|
var bodies = document.querySelectorAll("::before, div::before, body");
|
|
|
|
is(bodies.length, 1, "Unexpected length");
|
|
|
|
is(bodies[0], document.body, "Unexpected element");
|
|
|
|
|
|
|
|
is(document.querySelector("div > ::after, body"), document.body,
|
|
|
|
"Unexpected return value");
|
|
|
|
|
|
|
|
var emptyList = document.querySelectorAll("::before, div::before");
|
|
|
|
is(emptyList.length, 0, "Unexpected empty list length");
|
|
|
|
|
|
|
|
is(document.querySelectorAll("div > ::after").length, 0,
|
|
|
|
"Pseudo-element matched something?");
|
|
|
|
|
2014-08-12 16:30:59 +04:00
|
|
|
is(document.body.matches("::first-line"), false,
|
2009-12-11 10:37:41 +03:00
|
|
|
"body shouldn't match ::first-line");
|
|
|
|
|
2014-08-12 16:30:59 +04:00
|
|
|
is(document.body.matches("::first-line, body"), true,
|
2009-12-11 10:37:41 +03:00
|
|
|
"body should match 'body'");
|
|
|
|
|
2014-08-12 16:30:59 +04:00
|
|
|
is(document.body.matches("::first-line, body, ::first-letter"), true,
|
2009-12-11 10:37:41 +03:00
|
|
|
"body should match 'body' here too");
|
|
|
|
|
|
|
|
</script>
|
|
|
|
</pre>
|
|
|
|
</body>
|
|
|
|
</html>
|