Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Has the ::-webkit-selection selector ever been supported?

There are a few references on the internet to ::-webkit-selection, a WebKit-specific version of the ::selection selector.

See e.g. http://www.quirksmode.org/css/selection.html (Edit: PPK has since removed ::-webkit-selection from that page.)

However, I haven’t been able to get the example in the page above, or my own examples, to work in any WebKit-based browser. I’ve tried:

  • Safari
    • 1.0
    • 1.2
    • 2.0
    • 3.0
    • 4.0
    • 5.0
    • 5.1
  • Chrome
    • 2
    • 6
    • 14

The unprefixed ::selection selector works in all of these browsers anyway, so it’s not really a problem. But I was wondering where the references to the WebKit-specific version of this selector had come from.

Has anyone ever used it?

like image 913
Paul D. Waite Avatar asked Sep 25 '11 12:09

Paul D. Waite


People also ask

What's new in WebKit selectors level 4?

Since last year, WebKit supports many selectors defined in the draft of CSS Selectors Level 4. In this post, we will see a special subset of new selectors: new pseudo classes that take other selectors as arguments. Those are :matches (), :not (), :nth-child (), and :nth-last-child ().

What is the new match selector in WebKit?

This new selector is used extensively inside WebKit itself to simplify stylesheets. For example, code like the following used to appear in Web Inspector: The argument inside :matches () does not have to be a list of simple selectors. Any selector is supported, including the use of combinators.

What is ::selection selector in CSS?

CSS ::selection Selector 1 Definition and Usage. The ::selection selector matches the portion of an element that is selected by a user. Only a few... 2 Browser Support. The numbers in the table specify the first browser version that fully supports the property. Numbers... 3 CSS Syntax. More ...

What is the difference between @supports and @not() selector?

@supports(selector(:has(p))) { /* Supported! */ } The :not () selector is part of the same spec… Unlike :has, :not does have pretty decent browser support and I used it for the first time the other day: That’s great I also love how gosh darn readable it is; you don’t ever have to have seen this line of code to understand what it does.


1 Answers

I’ve tested all the way back to Safari 1.0 (using Multi-Safari), and no version supports ::-webkit-selection (and they all do support ::selection).

Unless this is an issue with Multi-Safari, ::-webkit-selection has never been supported in Safari post-1.0. I guess it might have been in the public beta though.

like image 175
Paul D. Waite Avatar answered Oct 05 '22 10:10

Paul D. Waite