Issue #252 - Move getElementsByName from HTMLDocument to Document

Based on https://bugzilla.mozilla.org/show_bug.cgi?id=1415176
This commit is contained in:
FranklinDM 2023-04-05 14:04:43 +08:00 committed by roytam1
commit b2d7504112
8 changed files with 34 additions and 42 deletions

View file

@ -2987,10 +2987,9 @@ PresShell::GoToAnchor(const nsAString& aAnchorName, bool aScroll,
// Search for an anchor element with a matching "name" attribute
if (!content && htmlDoc) {
nsCOMPtr<nsIDOMNodeList> list;
// Find a matching list of named nodes
rv = htmlDoc->GetElementsByName(aAnchorName, getter_AddRefs(list));
if (NS_SUCCEEDED(rv) && list) {
nsCOMPtr<nsIDOMNodeList> list = mDocument->GetElementsByName(aAnchorName);
if (list) {
uint32_t i;
// Loop through the named nodes looking for the first anchor
for (i = 0; true; i++) {