Bug 1908907 - Text Fragments: Set sequential focus to the text directive, but don't focus it. r=emilio

Differential Revision: https://phabricator.services.mozilla.com/D217100
This commit is contained in:
Jan-Niklas Jaeschke
2024-07-19 15:42:32 +00:00
parent 4774349c8c
commit cd139cc24d
2 changed files with 46 additions and 1 deletions

View File

@@ -3218,7 +3218,7 @@ nsresult PresShell::GoToAnchor(const nsAString& aAnchorName,
// TODO(emilio): Do we really want to clear the focus even if aScroll is
// false?
const bool shouldFocusTarget = [&] {
if (!aScroll) {
if (!aScroll || thereIsATextFragment) {
return false;
}
nsIFrame* targetFrame = target->GetPrimaryFrame();