mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-11-12 06:08:24 +02:00
MozReview-Commit-ID: FIohq85kl1G --HG-- rename : testing/web-platform/tests/XMLHttpRequest/event-upload-progress-crossorigin.sub.htm => testing/web-platform/tests/XMLHttpRequest/event-upload-progress-crossorigin.htm rename : testing/web-platform/tests/XMLHttpRequest/send-non-same-origin.sub.htm => testing/web-platform/tests/XMLHttpRequest/send-non-same-origin.htm rename : testing/web-platform/tests/html/browsers/history/the-location-interface/security_location_0.sub.htm => testing/web-platform/tests/html/browsers/history/the-location-interface/security_location_0.htm rename : testing/web-platform/tests/html/browsers/the-window-object/security-window/window-security.sub.html => testing/web-platform/tests/html/browsers/the-window-object/security-window/window-security.html rename : testing/web-platform/tests/html/browsers/windows/nested-browsing-contexts/frameElement.sub.html => testing/web-platform/tests/html/browsers/windows/nested-browsing-contexts/frameElement.html rename : testing/web-platform/tests/html/browsers/windows/targeting-cross-origin-nested-browsing-contexts.sub.html => testing/web-platform/tests/html/browsers/windows/targeting-cross-origin-nested-browsing-contexts.html rename : testing/web-platform/tests/html/dom/documents/dom-tree-accessors/Document.currentScript.sub.html => testing/web-platform/tests/html/dom/documents/dom-tree-accessors/Document.currentScript.html rename : testing/web-platform/tests/html/semantics/document-metadata/the-base-element/base_href_specified.sub.html => testing/web-platform/tests/html/semantics/document-metadata/the-base-element/base_href_specified.html
36 lines
1 KiB
HTML
36 lines
1 KiB
HTML
<!doctype html>
|
|
<title>Node.contains() tests</title>
|
|
<link rel=author title="Aryeh Gregor" href=ayg@aryeh.name>
|
|
<div id=log></div>
|
|
<script src=/resources/testharness.js></script>
|
|
<script src=/resources/testharnessreport.js></script>
|
|
<script src=../common.js></script>
|
|
<script>
|
|
"use strict";
|
|
|
|
testNodes.forEach(function(referenceName) {
|
|
var reference = eval(referenceName);
|
|
|
|
test(function() {
|
|
assert_false(reference.contains(null));
|
|
}, referenceName + ".contains(null)");
|
|
|
|
testNodes.forEach(function(otherName) {
|
|
var other = eval(otherName);
|
|
test(function() {
|
|
var ancestor = other;
|
|
while (ancestor && ancestor !== reference) {
|
|
ancestor = ancestor.parentNode;
|
|
}
|
|
if (ancestor === reference) {
|
|
assert_true(reference.contains(other));
|
|
} else {
|
|
assert_false(reference.contains(other));
|
|
}
|
|
}, referenceName + ".contains(" + otherName + ")");
|
|
});
|
|
});
|
|
|
|
testDiv.parentNode.removeChild(testDiv);
|
|
</script>
|
|
<!-- vim: set expandtab tabstop=2 shiftwidth=2: -->
|