Bug 1418076 part 9. Eliminate remaining uses of nsIDOMHTMLDocument. r=mystor

MozReview-Commit-ID: DqjJPKKRYOx
This commit is contained in:
Boris Zbarsky 2018-01-26 01:01:25 -05:00
Родитель 94892c7519
Коммит d3dc65034f
2 изменённых файлов: 6 добавлений и 10 удалений

Просмотреть файл

@ -343,12 +343,10 @@ nsGenericHTMLElement::GetOffsetRect(CSSIntRect& aRect)
// frame for the HTML element so we fail to find the body in the
// parent chain. We want the offset parent in this case to be
// the body, so we just get the body element from the document.
nsCOMPtr<nsIDOMHTMLDocument> html_doc(do_QueryInterface(GetComposedDoc()));
if (html_doc) {
offsetParent = static_cast<nsHTMLDocument*>(html_doc.get())->GetBody();
}
//
// We use GetBodyElement() here, not GetBody(), because we don't want to
// end up with framesets here.
offsetParent = GetComposedDoc()->GetBodyElement();
}
}

Просмотреть файл

@ -73,7 +73,6 @@
#include "nsIMozBrowserFrame.h"
#include "nsCaret.h"
#include "AccessibleCaretEventHub.h"
#include "nsIDOMHTMLDocument.h"
#include "nsFrameManager.h"
#include "nsXPCOM.h"
#include "nsILayoutHistoryState.h"
@ -3077,7 +3076,6 @@ PresShell::GoToAnchor(const nsAString& aAnchorName, bool aScroll,
return NS_OK;
}
nsCOMPtr<nsIDOMHTMLDocument> htmlDoc = do_QueryInterface(mDocument);
nsresult rv = NS_OK;
nsCOMPtr<nsIContent> content;
@ -3087,7 +3085,7 @@ PresShell::GoToAnchor(const nsAString& aAnchorName, bool aScroll,
}
// Search for an anchor element with a matching "name" attribute
if (!content && htmlDoc) {
if (!content && mDocument->IsHTMLDocument()) {
// Find a matching list of named nodes
nsCOMPtr<nsIDOMNodeList> list = mDocument->GetElementsByName(aAnchorName);
if (list) {
@ -3112,7 +3110,7 @@ PresShell::GoToAnchor(const nsAString& aAnchorName, bool aScroll,
}
// Search for anchor in the HTML namespace with a matching name
if (!content && !htmlDoc)
if (!content && !mDocument->IsHTMLDocument())
{
NS_NAMED_LITERAL_STRING(nameSpace, "http://www.w3.org/1999/xhtml");
// Get the list of anchor elements