summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fast/selectors/querySelector-leftmost-selector-matches-rootNode.html
blob: 1a944eb7c0f83363868d06f7932be6c682463881 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<!doctype html>
<html>
<head>
<script src="../../resources/js-test.js"></script>
</head>
<body id="target" class="target">
  <div></div>
  <div></div>
  <div></div>
  <div></div>
  <div></div>
  <div></div>
  <pre id='console'></pre>
</body>
<script>
description('Test for crbug.com/304069: querySelectorAll regression.');
shouldBe("document.body.querySelectorAll('#target > div').length", "6");
shouldBe("document.body.querySelectorAll('#target').length", "0");
shouldBe("document.body.querySelectorAll('.target > div').length", "6");
shouldBe("document.body.querySelectorAll('.target').length", "0");
shouldBe("document.body.querySelectorAll('body > div').length", "6");
shouldBe("document.body.querySelectorAll('body').length", "0");
shouldBeNull("document.body.querySelector('#target')");
shouldBeNull("document.body.querySelector('.target')");
shouldBeNull("document.body.querySelector('body')");
</script>
</html>