Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tests to confirm document's location getter returns null outside of a browsing context. #7574

Merged
merged 1 commit into from
Oct 6, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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