Bug 819475 - Make document.domain non-nullable

This commit is contained in:
janekptacijarabaci 2018-07-20 07:45:05 +02:00 • committed by Roy Tam
commit d75c4a5956
2 changed files with 4 additions and 4 deletions

View file

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

View file

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