Closed Bug 2086758 Opened 1 month ago Closed 28 days ago

window.find() scrolls to the match asynchronously, overriding a scroll() called right after it

Categories

(Core :: Find Backend, defect)

defect

Tracking

()

RESOLVED FIXED
161 Branch
Tracking Status
firefox161 --- fixed

People

(Reporter: florian, Assigned: florian)

References

(Blocks 1 open bug)

Details

Attachments

(1 external file)

Since bug 2006040, nsWebBrowserFind scrolls to a window.find() match from a dispatched runnable, so the ancestor revealing algorithm can run first. A page calling scroll(0,0) right after window.find() is then scrolled back to the match one task later. This regresses bug 1659276, which was filed from a live site doing exactly that, and makes editor/libeditor/tests/test_bug1659276.html fail whenever it runs first in a fresh browser (the mochitest-plain-standalone jobs, where it is skipped).

The deferred scroll is only needed when the match is inside hidden=until-found content or a closed <details>; otherwise window.find() can scroll synchronously as it did before.

Bug 2006040 made window.find() always scroll to the match from a separate
task, so a script calling scroll() right after window.find() no longer wins,
regressing bug 1659276. Only defer the scroll when hidden ancestors have to be
revealed first.

test_bug1659276.html failed whenever it ran first in a fresh browser, so it
was skipped in the standalone jobs (bug 2026600); it is now re-enabled.

Blocks: 2086769
Attachment #9670737 - Attachment description: Bug 2086758 - Scroll synchronously in window.find() when the match needs no revealing, r=#dom-core-reviewers. → Bug 2086758 - Let window.find() scroll before calling scroll(0, 0) in test_bug1659276.html, r=#dom-core-reviewers.
Pushed by fqueze@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/75c09106949e https://hg.mozilla.org/integration/autoland/rev/c40fe10a740c Let window.find() scroll before calling scroll(0, 0) in test_bug1659276.html, r=dom-core-reviewers,smaug.
Status: ASSIGNED → RESOLVED
Closed: 28 days ago
Resolution: --- → FIXED
Target Milestone: --- → 161 Branch
QA Whiteboard: [qa-triage-done-c162/b161]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: