Open Bug 1475773 Opened 3 years ago Updated 2 years ago

implement the ::inactive-selection pseudo-element


(Core :: Layout, enhancement, P3)




Tracking Status
firefox63 --- affected


(Reporter: zjz, Unassigned)


(Blocks 1 open bug)


(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>:



<div contenteditable="true">:

Keywords: testcase
Hardware: Unspecified → All

<input> with select() and blur()

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.