Bug 819475 - Make document.domain non-nullable; r=bz

Make document.domain non-nullable, to conform to the HTML spec.

MozReview-Commit-ID: B1YuQekBgZD

--HG--
extra : rebase_source : 00999e16549e62c783f06f61c62000ab7677cf1d
This commit is contained in:
Kyle Machulis 2018-06-07 12:29:23 -07:00
parent ea4aa07dab
commit 14d4b9546c
2 changed files with 4 additions and 4 deletions

View File

@ -890,7 +890,7 @@ nsHTMLDocument::GetDomain(nsAString& aDomain)
nsCOMPtr<nsIURI> uri = GetDomainURI();
if (!uri) {
SetDOMStringToNull(aDomain);
aDomain.Truncate();
return;
}
@ -900,8 +900,8 @@ nsHTMLDocument::GetDomain(nsAString& aDomain)
CopyUTF8toUTF16(hostName, aDomain);
} else {
// If we can't get the host from the URI (e.g. about:, javascript:,
// etc), just return an null string.
SetDOMStringToNull(aDomain);
// etc), just return an empty string.
aDomain.Truncate();
}
}

View File

@ -7,7 +7,7 @@
[OverrideBuiltins]
interface HTMLDocument : Document {
[SetterThrows]
attribute DOMString? domain;
attribute DOMString domain;
[Throws]
attribute DOMString cookie;
// DOM tree accessors