Implement hidden=until-found attribute and beforematch event
Categories
(Core :: DOM: Core & HTML, enhancement)
Tracking
()
Tracking | Status | |
---|---|---|
firefox139 | --- | fixed |
People
(Reporter: jarhar, Assigned: jjaschke)
References
(Depends on 2 open bugs, Blocks 1 open bug)
Details
(Keywords: dev-doc-complete, parity-chrome)
User Story
platform-scheduled: 2025-09-30
Attachments
(7 files)
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review |
User Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.46 Safari/537.36
Steps to reproduce:
This feature was added to the HTML spec here: https://github.com/whatwg/html/pull/7475
Here is an explainer: https://github.com/WICG/display-locking/blob/main/explainers/hidden-content-explainer.md
The "until-found" value for the hidden attribute should make the element content-visibility:hidden instead of display:none. When the browser searches for text via find-in-page or ScrollToTextFragment, it should also search for text in hidden=until-found elements. If find-in-page or ScrollToTextFragment want to scroll to a match inside a hidden=until-found element, it should remove the hidden attribute from the element and fire the "beforematch" event on it in order to reveal the match.
Comment 1•3 years 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•2 years ago
|
Comment 2•1 year ago
|
||
Wikipedia uses this attribute now which means find in page works much better in Chrome on Android than in Firefox
Comment 3•5 months ago
|
||
I've found one more use case where hidden=until-found is very helpful which I described here: https://schepp.dev/posts/rethinking-find-in-page-accessibility-making-hidden-text-work-for-everyone/
I'm aware that this feature is part of Interop 2025 via <details> element, but maybe we can get this quicker than end of this year?
Updated•5 months ago
|
Updated•5 months ago
|
Updated•4 months ago
|
Assignee | ||
Updated•4 months ago
|
Updated•4 months ago
|
Assignee | ||
Comment 4•4 months ago
|
||
Assignee | ||
Comment 5•4 months ago
|
||
To allow hidden=until-found
, the webidl attribute must allow additional data types 0.
Therefore, this patch sets its type to Any
,
and implements setter and getter logic that allows
setting the value directly (div.hidden="until-found"
and indirectly (div.setAttribute("hidden", "until-found")
.
Assignee | ||
Comment 6•4 months ago
|
||
Assignee | ||
Comment 7•4 months ago
|
||
Assignee | ||
Comment 8•4 months ago
|
||
Assignee | ||
Comment 9•4 months ago
|
||
This fixes Text Fragments tests as well since
that feature relies on nsFind
.
Assignee | ||
Comment 10•4 months ago
|
||
hidden-until-found-002.html needs to use \ue004
instead of \t
to work in Gecko.
hidden-ua-stylesheet.html gets additional asserts that
ensure that setting hidden=until-found is set properly
when using setAttribute()
with case-insensitive values.
Comment 11•4 months ago
|
||
I filed bug 1955379 to enable the pref (the one added in part 1 here) when we're ready, so that we've got that tracked as still needed in order to pass the associated tests on wpt.fyi.
Comment 12•3 months ago
|
||
Comment 14•3 months ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/b8e79fffd79a
https://hg.mozilla.org/mozilla-central/rev/815d42c71c38
https://hg.mozilla.org/mozilla-central/rev/e842c0154a9a
https://hg.mozilla.org/mozilla-central/rev/c365b9156d01
https://hg.mozilla.org/mozilla-central/rev/adc25f3f0b31
https://hg.mozilla.org/mozilla-central/rev/8319cbeffeb5
https://hg.mozilla.org/mozilla-central/rev/6c11ac0d8fda
Assignee | ||
Comment 16•3 months ago
|
||
Release Note Request (optional, but appreciated)
[Why is this notable]: hidden=until-found allows content to be found via find-in-page when it's hidden by default. This feature is for example used by the mobile version of Wikipedia.
[Affects Firefox for Android]: Yes
[Suggested wording]:
[Links (documentation, blog post, etc)]: https://github.com/WICG/display-locking/blob/main/explainers/hidden-content-explainer.md
Comment hidden (obsolete) |
Comment 18•3 months ago
|
||
Added to the nightly relnotes.
Comment 19•3 months ago
|
||
Removing from the Nightly release notes for Fx140+
This was enabled by default for Fx139 under Bug 1955379
Updated•2 months ago
|
Comment 20•2 months ago
|
||
MDN changes for this (and the pref 'dom.hidden_until_found.enabled' bug https://bugzilla.mozilla.org/show_bug.cgi?id=1955379) can be tracked in the following GitHub issue: https://github.com/mdn/content/issues/39306
Updated•2 months ago
|
Description
•