Auto-expanding <details/> while using Find-in-page toggles <details/> weirdly
Categories
(Core :: DOM: Core & HTML, defect)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox146 | --- | fixed |
People
(Reporter: teun, Assigned: jjaschke)
References
(Regressed 1 open bug)
Details
Attachments
(2 files)
User Agent: Links (2.2; Linux 2.6.32-gentoo-r6 x86_64; 129x42)
Steps to reproduce:
- Visit a page with multiple <details/> elements.
- Use Find-in-page (Cmd-F) and search for the letter "a" (that appears lots of times in the page)
- Press enter repeatedly to search for the next occurrence of this letter.
Actual results:
When the search hits a result inside a <details/> element, it briefly opens that <details/> element, then closes it again and opens the very last (of many) <details/> elements on the page, which stays open
Expected results:
Only the <details/> element where the hit occurs should stay open.
Comment 1•1 year ago
|
||
The Bugbug bot thinks this bug should belong to the 'Core::DOM: Core & HTML' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.
Updated•1 year ago
|
| Reporter | ||
Comment 2•1 year ago
|
||
Please ignore the "User Agent: Links..." in the original description (can't edit it?)
Comment 3•11 months ago
|
||
This was also reported and filed to Toolkit::Find Toolbar with bug 1973904. Not sure which component needs to be assigned in order to get triaged by the right team.
Updated•8 months ago
|
| Assignee | ||
Comment 6•8 months ago
|
||
The previous behavior caused all sorts of edge-casey issues:
Find-in-page would open all <details> or hidden=until-found elments
which contain the search string. Therefore, accordions would open
one after another, and the last one would be opened instead of the one
with the match.
Finding a text fragment on a page would open all details/hidden=until-found elements
which contain any of a context term of the text directive.
Creating a text fragment link (context menu -> Copy Link to Highlight) would open
all hidden=until-found/details elements which contain the target range.
The reason for this behavior was nsFind::Find() calling the reveal algorithm unconditionally.
This patch fixes this by only calling the reveal algorithm at the appropriate places,
which is inside the find-in-page backend (nsTypeAheadFind.cpp),
in the window.find() backend (nsWebBrowserFind.cpp),
and in the text fragment finder backend (TextDirectiveFinder.cpp).
In addition, this patch refactors the tests for finding hidden=until-found / <details> elements:
- test_nsFind.html only tests that text inside hidden=until-found or <details> can be found
- New tests in
browser_findbar_hidden_beforematch.jsandtest_find.htmlensure that
the elements are visible after they are found, and thatbeforematchis fired for hidden=until-found elements - New tests have been added for finding and creating text fragments to ensure that only the correct elements are revealed.
Updated•8 months ago
|
| Assignee | ||
Updated•8 months ago
|
Comment 9•8 months ago
|
||
| bugherder | ||
Description
•