diff options
Diffstat (limited to 'testing/web-platform/tests/dom/traversal/support')
3 files changed, 26 insertions, 0 deletions
diff --git a/testing/web-platform/tests/dom/traversal/support/TreeWalker-acceptNode-filter-cross-realm-null-browsing-context-subframe.html b/testing/web-platform/tests/dom/traversal/support/TreeWalker-acceptNode-filter-cross-realm-null-browsing-context-subframe.html new file mode 100644 index 0000000000..f5e393d0f0 --- /dev/null +++ b/testing/web-platform/tests/dom/traversal/support/TreeWalker-acceptNode-filter-cross-realm-null-browsing-context-subframe.html @@ -0,0 +1,13 @@ +<!DOCTYPE html> + +<script> +function createNodeIterator() { + function filter() { + nodeIterator.dummyFilterCalled = true; + return true; + } + const nodeIterator = parent.document.createNodeIterator(parent.document.body, NodeFilter.SHOW_ELEMENT, filter); + nodeIterator.dummyFilterCalled = false; + return nodeIterator; +} +</script> diff --git a/testing/web-platform/tests/dom/traversal/support/assert-node.js b/testing/web-platform/tests/dom/traversal/support/assert-node.js new file mode 100644 index 0000000000..0d5d8ad74f --- /dev/null +++ b/testing/web-platform/tests/dom/traversal/support/assert-node.js @@ -0,0 +1,10 @@ +// |expected| should be an object indicating the expected type of node. +function assert_node(actual, expected) +{ + assert_true(actual instanceof expected.type, + 'Node type mismatch: actual = ' + actual.nodeType + ', expected = ' + expected.nodeType); + if (typeof(expected.id) !== 'undefined') + assert_equals(actual.id, expected.id); + if (typeof(expected.nodeValue) !== 'undefined') + assert_equals(actual.nodeValue, expected.nodeValue); +} diff --git a/testing/web-platform/tests/dom/traversal/support/empty-document.html b/testing/web-platform/tests/dom/traversal/support/empty-document.html new file mode 100644 index 0000000000..b9cd130a07 --- /dev/null +++ b/testing/web-platform/tests/dom/traversal/support/empty-document.html @@ -0,0 +1,3 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<body> |