Open Bug 1475773 Opened 3 years ago Updated 2 years ago

implement the ::inactive-selection pseudo-element

Categories

(Core :: Layout, enhancement, P3)

All
Unspecified
enhancement

Tracking

()

Tracking Status
firefox63 --- affected

People

(Reporter: zjz, Unassigned)

References

(Blocks 1 open bug)

Details

(Keywords: testcase)

There's no way to tell if a selection is active or inactive from CSS if the developer customises the selection style with ::selection. So it's highly unlikely to see the new pseudo-element dropped from final standards, though it's currently in the working draft stage.

I think it's ready to implement the ::inactive-selection pseudo-element now.
Blocks: css-pseudo-4
I think you can do :-moz-window-inactive::selection, right?

But yeah if there's a spec for this it should be easy to implement.
Thank you for the information.

However, it doesn't mean exactly the same thing, :-moz-window-inactive means the whole window(i.e. the browser) of the applied element loses the focus, that means div:-moz-window-inactive only takes effects when the whole browser(not just the <div>) loses its focus, while ::inactive-selection take effects when you just focus on any other element.

BTW, I find that div:-moz-window-inactive::-moz-selection doesn't work, so is it also a bug?
To carify my previous comment, "any other element" in the above means:

an element outside of a document window but inside the browser, for example, the URL bar in the browser.
Priority: -- → P3
Blocks: 1479760

Ordinary <div>:

http://www.gtalbot.org/BrowserBugsSection/CSS4Pseudo/inactive-selection-001-manual-new.html

http://www.gtalbot.org/BrowserBugsSection/CSS4Pseudo/inactive-selection-002-manual-new.html

http://www.gtalbot.org/BrowserBugsSection/CSS4Pseudo/inactive-selection-003-manual-new.html

http://www.gtalbot.org/BrowserBugsSection/CSS4Pseudo/inactive-selection-004-manual-new.html


<input>:

http://www.gtalbot.org/BrowserBugsSection/CSS4Pseudo/inactive-selection-005-manual-new.html

http://www.gtalbot.org/BrowserBugsSection/CSS4Pseudo/inactive-selection-006-manual-new.html

http://www.gtalbot.org/BrowserBugsSection/CSS4Pseudo/inactive-selection-007-manual-new.html

http://www.gtalbot.org/BrowserBugsSection/CSS4Pseudo/inactive-selection-008-manual-new.html


<textarea>:

http://www.gtalbot.org/BrowserBugsSection/CSS4Pseudo/inactive-selection-009-manual-new.html

http://www.gtalbot.org/BrowserBugsSection/CSS4Pseudo/inactive-selection-010-manual-new.html

http://www.gtalbot.org/BrowserBugsSection/CSS4Pseudo/inactive-selection-011-manual-new.html

http://www.gtalbot.org/BrowserBugsSection/CSS4Pseudo/inactive-selection-012-manual-new.html


<div contenteditable="true">:

http://www.gtalbot.org/BrowserBugsSection/CSS4Pseudo/inactive-selection-013-manual-new.html

http://www.gtalbot.org/BrowserBugsSection/CSS4Pseudo/inactive-selection-014-manual-new.html

http://www.gtalbot.org/BrowserBugsSection/CSS4Pseudo/inactive-selection-015-manual-new.html

http://www.gtalbot.org/BrowserBugsSection/CSS4Pseudo/inactive-selection-016-manual-new.html

Keywords: testcase
Hardware: Unspecified → All

<input> with select() and blur()
http://www.gtalbot.org/BrowserBugsSection/CSS4Pseudo/inactive-selection-031.html

Error console in Firefox 68.4.1 ESR and in Firefox 74.0a1 buildID=20200129093157 will report that inactive-selection pseudo-element is unknown.

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