Closed Bug 2006040 Opened 5 months ago Closed 5 months ago

Find-in-page should scroll to revealed matches

Categories

(Core :: Find Backend, defect)

Firefox 148
defect

Tracking

()

RESOLVED FIXED
148 Branch
Tracking Status
firefox148 --- fixed

People

(Reporter: jakea, Assigned: jjaschke)

Details

(Keywords: dev-doc-complete)

Attachments

(3 files)

Attached video Bug demo

Observed on MacOS, but I assume other platforms are impacted.

When found text (eg via cmd-f) is revealed, as in it was inside a <div hidden="until-found"> or <details>, the page should be scrolled to the match. Right now Firefox appears to scroll only to the container.

Demo.

Component: General → Find Toolbar
Product: Firefox → Toolkit
Component: Find Toolbar → Find Backend
Flags: needinfo?(jjaschke)
Product: Toolkit → Core

(Probably we're not flushing layout between revealing and scrolling-to-match)

So, the spec says to queue a task and run the ancestor revealing algorithm.

We do that, and after that, we scroll the selection into view, which means that we scroll before we reveal.

Flags: needinfo?(jjaschke)

A potential one-liner fix could be to use Async scroll mode here, but that said, the MoveFocus looks also suspicious since we'd be moving focus to something that hasn't been revealed...

Before this patch, the ancestor reveal algorithm would run asynchronously,
and therefore after the synchronous scroll attempt.
This breaks find-in-page for hidden=until-found / details elements.

This patch moves the scroll logic to run after the reveal has completed.

Assignee: nobody → jjaschke
Status: NEW → ASSIGNED

Same as part 1, but for window.find().

Severity: -- → S3
Status: ASSIGNED → RESOLVED
Closed: 5 months ago
Resolution: --- → FIXED
Target Milestone: --- → 148 Branch
Keywords: dev-doc-needed

dev-doc-needed because I marked this as a partial implementation in https://github.com/mdn/browser-compat-data/pull/28672, so that needs updating once we know what version it's landing in.

FF148 MDN work can be tracked in https://github.com/mdn/content/issues/42751 (just the BCD updated)

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: