[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc
simon.fraser at apple.com
simon.fraser at apple.com
Wed Dec 22 12:29:50 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit d5e70656295fd3e9711663aaa70d9d25db68217f
Author: simon.fraser at apple.com <simon.fraser at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Tue Aug 24 20:22:55 2010 +0000
2010-08-24 Simon Fraser <simon.fraser at apple.com>
Reviewed by Sam Weinig.
Add test for a NodeFilter throwing
https://bugs.webkit.org/show_bug.cgi?id=44480
The TreeWalker DOM spec says that an exception thrown inside the NodeFilter should
propagate out to the caller. This tests that.
* fast/dom/TreeWalker/filter-throw-expected.txt: Added.
* fast/dom/TreeWalker/filter-throw.html: Added.
* fast/dom/TreeWalker/script-tests/filter-throw.js: Added.
(walker.document.createTreeWalker):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@65928 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 00dd6e6..2ab9984 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -2,6 +2,21 @@
Reviewed by Sam Weinig.
+ Add test for a NodeFilter throwing
+ https://bugs.webkit.org/show_bug.cgi?id=44480
+
+ The TreeWalker DOM spec says that an exception thrown inside the NodeFilter should
+ propagate out to the caller. This tests that.
+
+ * fast/dom/TreeWalker/filter-throw-expected.txt: Added.
+ * fast/dom/TreeWalker/filter-throw.html: Added.
+ * fast/dom/TreeWalker/script-tests/filter-throw.js: Added.
+ (walker.document.createTreeWalker):
+
+2010-08-24 Simon Fraser <simon.fraser at apple.com>
+
+ Reviewed by Sam Weinig.
+
TreeWalker traversal order is wrong when skipping and rejecting
https://bugs.webkit.org/show_bug.cgi?id=44377
diff --git a/LayoutTests/fast/dom/TreeWalker/filter-throw-expected.txt b/LayoutTests/fast/dom/TreeWalker/filter-throw-expected.txt
new file mode 100644
index 0000000..c7213aa
--- /dev/null
+++ b/LayoutTests/fast/dom/TreeWalker/filter-throw-expected.txt
@@ -0,0 +1,21 @@
+Test JS objects as NodeFilters.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+Testing with object filter
+Test with filter function
+PASS walker.firstChild(); threw exception filter exception.
+PASS walker.currentNode.id is 'root'
+PASS walker.nextNode();walker.currentNode.id threw exception filter exception.
+PASS walker.currentNode.id is 'root'
+
+Test with filter object
+PASS walker.firstChild(); threw exception filter exception.
+PASS walker.currentNode.id is 'root'
+PASS walker.nextNode();walker.currentNode.id threw exception filter exception.
+PASS walker.currentNode.id is 'root'
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/dom/TreeWalker/filter-throw.html b/LayoutTests/fast/dom/TreeWalker/filter-throw.html
new file mode 100644
index 0000000..e1ad777
--- /dev/null
+++ b/LayoutTests/fast/dom/TreeWalker/filter-throw.html
@@ -0,0 +1,13 @@
+<!DOCTYPE html>
+<html>
+<head>
+<link rel="stylesheet" href="../../js/resources/js-test-style.css">
+<script src="../../js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script src="script-tests/filter-throw.js"></script>
+<script src="../../js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/fast/dom/TreeWalker/script-tests/filter-throw.js b/LayoutTests/fast/dom/TreeWalker/script-tests/filter-throw.js
new file mode 100644
index 0000000..1127f77
--- /dev/null
+++ b/LayoutTests/fast/dom/TreeWalker/script-tests/filter-throw.js
@@ -0,0 +1,32 @@
+description('Test JS objects as NodeFilters.');
+
+var walker;
+var testElement = document.createElement("div");
+testElement.id = 'root';
+testElement.innerHTML='<div id="A1"><div id="B1"></div><div id="B2"></div></div>';
+debug("Testing with object filter");
+walker = document.createTreeWalker(testElement, NodeFilter.SHOW_ELEMENT, function(node) {
+ throw('filter exception');
+ return NodeFilter.FILTER_ACCEPT;
+}, false);
+
+debug("Test with filter function");
+shouldThrow("walker.firstChild();");
+shouldBe("walker.currentNode.id", "'root'")
+shouldThrow("walker.nextNode();walker.currentNode.id");
+shouldBe("walker.currentNode.id", "'root'")
+
+walker = document.createTreeWalker(testElement, NodeFilter.SHOW_ELEMENT, {
+ acceptNode : function(node) {
+ throw('filter exception');
+ return NodeFilter.FILTER_ACCEPT;
+ }
+ }, false);
+
+debug("<br>Test with filter object");
+shouldThrow("walker.firstChild();");
+shouldBe("walker.currentNode.id", "'root'")
+shouldThrow("walker.nextNode();walker.currentNode.id");
+shouldBe("walker.currentNode.id", "'root'")
+
+var successfullyParsed = true;
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list