SamsungInternet / support

For general Samsung Internet support. You can use the Issues register here as a way to ask support questions.
MIT License
17 stars 0 forks source link

CSS :not(-webkit-any()) selector does not appear to work #106

Closed Roye7777777 closed 3 years ago

Roye7777777 commented 3 years ago

Greetings! I run into an issue while debugging CSS and I encountered something I am not sure if whether it is a missing feature or whether it is a bug. When I write something like

.button:-webkit-any(a, span) { background: pink; }

my background gets pink on an anchor tag with the class 'button' in Samsung Internet as expected. However, when I wrap this in a :not(), like

.button:not(:-webkit-any(a, span)) { background: #777FFF; }

any <button> (which are obv. not an anchor tag or a span) with the class 'button' will not become purple in Samsung Internet, while on Chrome (Mac, Windows, Android), Firefox (using the more standard :is()) and Safari both show a button with a purple background.

Is this expected? I replicated this case here: https://codepen.io/roye7777777/pen/OJmzaoY

AdaRoseCannon commented 3 years ago

This is the same behaviour as in mobile Chrome so we shouldn't change it to maintain compatibility.

any() is a non-standard selector. Try to use the standardised :is() instead which is supported in Samsung Internet versions >=15

https://developer.mozilla.org/en-US/docs/Web/CSS/:is

Roye7777777 commented 3 years ago

@AdaRoseCannon I see, in beta-version 15 this issue no longer appears. When reporting, I used v. 14.2.1.69, which didn't support :is() yet, while it however did support :-webkit-any(), except apparently not together with :not(), which is why I referred to the non-standard in this case. Thanks!