Skip to content

Commit

Permalink
Add tests to confirm document/window location getters are null outsid…
Browse files Browse the repository at this point in the history
…e of browser context.
  • Loading branch information
Anthony Hughes authored and Ms2ger committed Oct 6, 2017
1 parent a0e1877 commit 0051903
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions dom/nodes/DOMImplementation-createDocument.html
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@
if (expected === null) {
test(function() {
var doc = document.implementation.createDocument(namespace, qualifiedName, doctype)
assert_equals(doc.location, null)
assert_equals(doc.compatMode, "CSS1Compat")
assert_equals(doc.characterSet, "UTF-8")
assert_equals(doc.contentType, namespace == htmlNamespace ? "application/xhtml+xml"
Expand Down
6 changes: 6 additions & 0 deletions dom/nodes/DOMImplementation-createHTMLDocument.html
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,10 @@
a.href = "http://example.org/?\u00E4";
assert_equals(a.href, "http://example.org/?%C3%A4");
}, "createHTMLDocument(): URL parsing")

// Test the document location getter is null outside of browser context
test(function() {
var doc = document.implementation.createHTMLDocument();
assert_equals(doc.location, null);
}, "createHTMLDocument(): document location getter is null")
</script>
1 change: 1 addition & 0 deletions dom/nodes/Document-constructor.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@

test(function() {
var doc = new Document();
assert_equals(doc.location, null);
assert_equals(doc.URL, "about:blank");
assert_equals(doc.documentURI, "about:blank");
assert_equals(doc.compatMode, "CSS1Compat");
Expand Down

0 comments on commit 0051903

Please sign in to comment.