Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add a test for queries whose leftmost selector matches the root node
https://bugs.webkit.org/show_bug.cgi?id=123877

Reviewed by Andreas Kling.

Merge https://chromium.googlesource.com/chromium/blink/+/22981c70bf93e8a07ee7b4d68a4522aee21b26ce
so that we won't introduce the regression they had.

* fast/selectors/querySelector-leftmost-selector-matches-rootNode-expected.txt: Added.
* fast/selectors/querySelector-leftmost-selector-matches-rootNode.html: Added.


Canonical link: https://commits.webkit.org/142058@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@158731 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
rniwa committed Nov 6, 2013
1 parent d26618f commit bcf88fe
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 0 deletions.
13 changes: 13 additions & 0 deletions LayoutTests/ChangeLog
@@ -1,3 +1,16 @@
2013-11-06 Ryosuke Niwa <rniwa@webkit.org>

Add a test for queries whose leftmost selector matches the root node
https://bugs.webkit.org/show_bug.cgi?id=123877

Reviewed by Andreas Kling.

Merge https://chromium.googlesource.com/chromium/blink/+/22981c70bf93e8a07ee7b4d68a4522aee21b26ce
so that we won't introduce the regression they had.

* fast/selectors/querySelector-leftmost-selector-matches-rootNode-expected.txt: Added.
* fast/selectors/querySelector-leftmost-selector-matches-rootNode.html: Added.

2013-11-06 Ryosuke Niwa <rniwa@webkit.org>

Assertion failure end < m_runCount in WebCore::BidiRunList<WebCore::BidiRun>::reverseRuns
Expand Down
@@ -0,0 +1,18 @@
Test queries whose leftmost selector matches the root node.

On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".


PASS document.body.querySelectorAll('#target > div').length is 6
PASS document.body.querySelectorAll('#target').length is 0
PASS document.body.querySelectorAll('.target > div').length is 6
PASS document.body.querySelectorAll('.target').length is 0
PASS document.body.querySelectorAll('body > div').length is 6
PASS document.body.querySelectorAll('body').length is 0
PASS document.body.querySelector('#target') is null
PASS document.body.querySelector('.target') is null
PASS document.body.querySelector('body') is null
PASS successfullyParsed is true

TEST COMPLETE

@@ -0,0 +1,28 @@
<!doctype html>
<html>
<head>
<script src="../../resources/js-test-pre.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 queries whose leftmost selector matches the root node.');
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>
<script src="../../resources/js-test-post.js"></script>
</html>

0 comments on commit bcf88fe

Please sign in to comment.