Bug 1517241 - Rename nsIDocument to mozilla::dom::Document. r=smaug

Summary: Really sorry for the size of the patch. It's mostly automatic
s/nsIDocument/Document/ but I had to fix up in a bunch of places manually to
add the right namespacing and such.

Overall it's not a very interesting patch I think.

nsDocument.cpp turns into Document.cpp, nsIDocument.h into Document.h and
nsIDocumentInlines.h into DocumentInlines.h.

I also changed a bunch of nsCOMPtr usage to RefPtr, but not all of it.

While fixing up some of the bits I also removed some unneeded OwnerDoc() null
checks and such, but I didn't do anything riskier than that.
This commit is contained in:
Emilio Cobos Álvarez
2019-01-02 14:05:23 +01:00
parent 870c153fbd
commit dc336a73ba
954 changed files with 5076 additions and 5120 deletions

View File

@@ -42,7 +42,7 @@
#include "nsPresContext.h"
#include "nsMappedAttributes.h"
#include "nsIFormControl.h"
#include "nsIDocument.h"
#include "mozilla/dom/Document.h"
#include "nsIPresShell.h"
#include "nsIFormControlFrame.h"
#include "nsITextControlFrame.h"
@@ -51,7 +51,6 @@
#include "nsIServiceManager.h"
#include "nsError.h"
#include "nsIEditor.h"
#include "nsIDocument.h"
#include "nsAttrValueOrString.h"
#include "nsDateTimeControlFrame.h"
@@ -667,7 +666,7 @@ nsresult HTMLInputElement::InitColorPicker() {
return NS_ERROR_FAILURE;
}
nsCOMPtr<nsIDocument> doc = OwnerDoc();
nsCOMPtr<Document> doc = OwnerDoc();
nsCOMPtr<nsPIDOMWindowOuter> win = doc->GetWindow();
if (!win) {
@@ -712,7 +711,7 @@ nsresult HTMLInputElement::InitFilePicker(FilePickerType aType) {
}
// Get parent nsPIDOMWindow object.
nsCOMPtr<nsIDocument> doc = OwnerDoc();
nsCOMPtr<Document> doc = OwnerDoc();
nsCOMPtr<nsPIDOMWindowOuter> win = doc->GetWindow();
if (!win) {
@@ -830,7 +829,7 @@ void HTMLInputElement::InitUploadLastDir() {
void HTMLInputElement::DestroyUploadLastDir() { NS_IF_RELEASE(gUploadLastDir); }
nsresult UploadLastDir::FetchDirectoryAndDisplayPicker(
nsIDocument* aDoc, nsIFilePicker* aFilePicker,
Document* aDoc, nsIFilePicker* aFilePicker,
nsIFilePickerShownCallback* aFpCallback) {
MOZ_ASSERT(aDoc, "aDoc is null");
MOZ_ASSERT(aFilePicker, "aFilePicker is null");
@@ -861,8 +860,7 @@ nsresult UploadLastDir::FetchDirectoryAndDisplayPicker(
return NS_OK;
}
nsresult UploadLastDir::StoreLastUsedDirectory(nsIDocument* aDoc,
nsIFile* aDir) {
nsresult UploadLastDir::StoreLastUsedDirectory(Document* aDoc, nsIFile* aDir) {
MOZ_ASSERT(aDoc, "aDoc is null");
if (!aDir) {
return NS_OK;
@@ -3845,7 +3843,7 @@ nsresult HTMLInputElement::PostHandleEvent(EventChainPostVisitor& aVisitor) {
if (fm && IsSingleLineTextControl(false) &&
!aVisitor.mEvent->AsFocusEvent()->mFromRaise &&
SelectTextFieldOnFocus()) {
nsIDocument* document = GetComposedDoc();
Document* document = GetComposedDoc();
if (document) {
uint32_t lastFocusMethod;
fm->GetLastFocusMethod(document->GetWindow(), &lastFocusMethod);
@@ -4280,8 +4278,7 @@ void HTMLInputElement::MaybeLoadImage() {
}
}
nsresult HTMLInputElement::BindToTree(nsIDocument* aDocument,
nsIContent* aParent,
nsresult HTMLInputElement::BindToTree(Document* aDocument, nsIContent* aParent,
nsIContent* aBindingParent) {
nsresult rv = nsGenericHTMLFormElementWithState::BindToTree(
aDocument, aParent, aBindingParent);