Closed Bug 1576817 Opened 5 months ago Closed 5 months ago

find in page sometimes matches input placeholder text

Categories

(Core :: Find Backend, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
mozilla70
Tracking Status
firefox70 --- fixed

People

(Reporter: heycam, Assigned: emilio)

Details

Attachments

(3 files)

STR:

  1. Open searchfox.
  2. Press Ctrl+F / Cmd+F.
  3. Type "m", notice that the "m" in the "Search mozilla-central" placeholder text selected.
  4. Type "o", notice that the "mo" in the placeholder text does not get selected.

Not sure whether it should match or not, but it's weird that only a single character matches.

Flags: needinfo?(emilio)
Assignee: nobody → emilio
Flags: needinfo?(emilio)

The split between IsDisplayedNode and IsVisibleNode is pretty intentional, since
visibility: visible descendants of visiblity: hidden ancestors are in fact
visible.

We skip fully-invisible ranges in here instead:

https://searchfox.org/mozilla-central/rev/325c1a707819602feff736f129cb36055ba6d94f/toolkit/components/find/nsFind.cpp#776

We want to find the text inside the input that the user types, but not stuff
like the placeholder. So check that the anonymous subtree is editable, or skip
it otherwise.

Pushed by ealvarez@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/34b4dcc475d3
Simplify some code added in bug 1490974. r=bradwerth
https://hg.mozilla.org/integration/autoland/rev/3192da5a883f
Only allow finding editable anonymous nodes in form controls. r=bradwerth
https://hg.mozilla.org/integration/autoland/rev/bcbd2fb36cb1
Fix a regression from bug 1490974 where we'll fail to find visibility: visible descendants of visibility: hidden nodes. r=bradwerth
You need to log in before you can comment on or make changes to this bug.