Bug 1434318 part 12. Remove nsIDOMDocument's contentType attribute. r=mystor

MozReview-Commit-ID: DAXrxIxiac4
This commit is contained in:
Boris Zbarsky 2018-01-31 15:18:11 -05:00
parent d8503e650d
commit 0935ca9973
6 changed files with 7 additions and 26 deletions

View File

@ -3339,12 +3339,10 @@ nsDocument::SetApplicationCache(nsIApplicationCache *aApplicationCache)
return NS_OK;
}
NS_IMETHODIMP
nsDocument::GetContentType(nsAString& aContentType)
void
nsIDocument::GetContentType(nsAString& aContentType)
{
CopyUTF8toUTF16(GetContentTypeInternal(), aContentType);
return NS_OK;
}
void

View File

@ -377,12 +377,6 @@ public:
*/
virtual void SetPrincipal(nsIPrincipal *aPrincipal) override;
/**
* Get the Content-Type of this document.
*/
// NS_IMETHOD GetContentType(nsAString& aContentType);
// Already declared in nsIDOMDocument
/**
* Set the Content-Type of this document.
*/

View File

@ -564,10 +564,8 @@ public:
/**
* Get the Content-Type of this document.
* (This will always return NS_OK, but has this signature to be compatible
* with nsIDOMDocument::GetContentType())
*/
NS_IMETHOD GetContentType(nsAString& aContentType) = 0;
void GetContentType(nsAString& aContentType);
/**
* Set the Content-Type of this document.

View File

@ -122,12 +122,6 @@ interface nsIDOMDocument : nsIDOMNode
nsIDOMElement elementFromPoint(in float x, in float y);
// Mozilla extensions
/**
* @see <https://developer.mozilla.org/en/DOM/document.contentType>
*/
readonly attribute DOMString contentType;
/**
* True if this document is synthetic : stand alone image, video, audio file,
* etc.

View File

@ -117,11 +117,8 @@ NS_IMETHODIMP
WebBrowserPersistLocalDocument::GetContentType(nsACString& aContentType)
{
nsAutoString utf16Type;
nsresult rv;
rv = mDocument->GetContentType(utf16Type);
NS_ENSURE_SUCCESS(rv, rv);
aContentType = NS_ConvertUTF16toUTF8(utf16Type);
mDocument->GetContentType(utf16Type);
CopyUTF16toUTF8(utf16Type, aContentType);
return NS_OK;
}

View File

@ -319,8 +319,8 @@ nsEditingSession::SetupEditorOnWindow(mozIDOMWindowProxy* aWindow)
//then lets check the mime type
if (nsCOMPtr<nsIDocument> doc = window->GetDoc()) {
nsAutoString mimeType;
if (NS_SUCCEEDED(doc->GetContentType(mimeType)))
AppendUTF16toUTF8(mimeType, mimeCType);
doc->GetContentType(mimeType);
AppendUTF16toUTF8(mimeType, mimeCType);
if (IsSupportedTextType(mimeCType.get())) {
mEditorType.AssignLiteral("text");