Merge remote-tracking branch 'origin/tracking' into custom

This commit is contained in:
roytam1 2023-04-08 07:34:30 +08:00
commit d27b63fc1c
10 changed files with 36 additions and 47 deletions

View file

@ -2986,11 +2986,10 @@ PresShell::GoToAnchor(const nsAString& aAnchorName, bool aScroll,
}
// Search for an anchor element with a matching "name" attribute
if (!content && htmlDoc) {
nsCOMPtr<nsIDOMNodeList> list;
if (!content && htmlDoc && mDocument) {
// 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++) {