-
Notifications
You must be signed in to change notification settings - Fork 715
[selectors] Specify the "all ::-webkit-* pseudos are valid" behavior #3051
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@fantasai and I have gone ahead and added the section to Selectors 4 for discussion. |
It is regrettable that we need this, but Firefox implementing it shows that we do. So yes, this should be in the spec, thanks for writing it. |
The added text is wrong. Only those pseudo-elements need to be valid, pseudo-classes don't. WebKit and Blink doesn't allow arbitrary webkit-prefixed pseudo-class either. |
Ah, that wasn't clear from the whatwg/compat issue. I'll fix. |
Fixed in 456e902 |
Looks good now, thanks. |
Is it hard to limit the list to the currently exposed ::-webkit- pseudo-elements? |
That's the point of the compat bug - WK-derived browsers accept all pseudo-elements with a -webkit- prefix as valid at parse time, not just ones that they actually know about. If we can change Blink/WebKit to stop recognizing those as valid, great. But I doubt that's possible, if the quirk has gotten bad enough that Firefox feels the need to implement it. |
yeah that was my intent. but after reading #2156 (comment) now I understand it seems impossible (still doubt how and why ~40% of page loads has unknown ::-webkit-whatever though...) |
There are two reasons for Firefox to implement it:
So this is a matter of webcompat directly and indirectly. |
Sadly, folks use this hack to target those browsers in order to get around other compat issues, like differences in implementation of the |
Using hacks that assume support for X is equivalent to support for Y is a bad idea if those hacks are targeting current browsers. Such hacks are safe only if the features are implemented in all current browsers and the equivalence holds in the old versions where they're not implemented. |
To reflect that this was added into selectors spec rather than compat spec, and update the link correspondingly. Related to w3c/csswg-drafts#3051.
To reflect that this was added into selectors spec rather than compat spec, and update the link correspondingly. Related to w3c/csswg-drafts#3051.
The CSS Working Group just discussed
The full IRC log of that discussion<dael> Topic: Specify the "all ::-webkit-* pseudos are valid" behavior<dael> github: https://github.com//issues/3051 <dael> TabAtkins: For a long time webkit based browsers had a quirk where they accept any psuedo element with -webkit at parse time. Won't match, but valid selector. <dael> TabAtkins: FF found this is causing compat problems for them b/c people had used webkit pseudos in the past to select browsers. FF realized they had to match the rules because people doing browser selection. <dael> TabAtkins: roposed we spec that quirk that anything with -webkit prefix i s valid at parsetime <dael> TabAtkins: Put that in an appendix of required but obsolete things. <TabAtkins> https://drafts.csswg.org/selectors-4/#compat <dael> emilio: fwiw I think most of this i sn't even intentional. They do ::webkit-scrollbar something that they intend to work and it doesn't in FF. <dael> emilio: If someone knows why webkit hasthis I'd be curious to know <dael> TabAtkins: I suspect it was dumb early parsing code and now we can't remove. If it looks like one of our psuedos let it be valid. <dael> florian: Maybe also b/c there's a bunch of webkit pseudos that only exist on some elements. Maybe checking if valid sometimes was too complex. <dael> TabAtkins: No, validity of selector can't depend on anything in DOM <dael> florian: Right, because you can't person didn't want to check anything because can't check some valid. <dael> dbaron: I think in the past unknown psuedos were jsut accepted. Might have been incomplete fix for that. <dael> plinss: True <dael> plinss: That was why double colon was to allow user defined psuedo elements for templating system. <dael> TabAtkins: Regardless of history, it's h ere. Appears to be necessary for compat. Need to spec. <dael> florian: webkit-whatever is an ident or sart functional notation there? <dael> TabAtkins: No idea. I think start functional notation, have to check <dael> emilio: Doesn't work with functional stuff. In FF we only do identifiers <dael> florian: Okay, good. Less insanity is better. <dael> TabAtkins: Confirmed. Just ident. I'll have to clarify spec text on that <dael> astearns: Concerns with this change? <dael> astearns: Anyone against it? <dael> tantek: I'm not against doing it. <dael> tantek: In light of unproductive comment, might be worth doing a blog post from chairs about this. Seems like a big compat thing to put out there. <dael> tantek: I figure it's indicitive of emotional output. Rather then people discover it and thing we're doing crazy an upfront blog post might diffuse it. Say this sucks but here's why we have to do it. <dael> astearns: We can put a post on CSSWG blog. <tantek> s/diffuse/defuse <dael> astearns: I'll wait until TabAtkins does clarification <dbaron> It might make more sense to put something clarifying in the issue itself rather than having it prominently in the blog? <dael> astearns: Other concerns about this? <dael> astearns: dbaron you're concerned about a blog post because you'd rather not call attention? <dael> dbaron: Don't know if it's worth making that big of a deal. Don't feel strong <dael> fantasai: Agree not make a big deal. If direct concerns we can put comments in issue or add expository notes in the section. People don't need to know about this in general and I don't want to take attention from things that matter. A blog postmight get in front of some people but it's more likely to make more people mad because they know and a vast majority of people that don't care just read a blog post <dael> florian: I suggest FAQ of wiki with an entry of why did you spec this and web compat with details <dael> tantek: It's precieved differently if we do this. They'll appriciate if we're up front. Much worse if someone says look at this crap and puts it on reddit. I agree more people will learn in passing but seeing it from WG it's just hohum as opposed to a 3rd party in another context with exaggeration. <dael> tantek: Hiding or not bringing something up causes things to blow up <dael> fantasai: With webkit prefix we hada blog post. It blew up before we could post. Secondly a blog post puts the explination in a separate place. If you want in front of people you put in spec. <dael> tantek: Spec bigger is worse. <bkardell_> is it not reasonable to do both? <dael> astearns: I'm convinced by argument that explination will b e in spec. You're concerned people will stumble across this and make a big deal. People will stumble across spec and blog is somewhere else. <dael> tantek: I'm okay with the FAQ having a long explination and link to that on blog and spec. Don't like polluting spec with hsitorical drama. Not what they're for <dael> fantasai: Don't think it's complex enough for that much text <dael> fremy: NOt sure it's worthy of a blog post. It's minor. I'm pretty sure Edge has this already ano no one said anything. This is wierd and no one should use it. Not worth calling attention. Few are using. <fantasai> +1 to fremy <TabAtkins> Okay, spec has been updated. <dael> astearns: Concern about spec bigger I don't think is founded. I'm a fan of bigger specs with reason why decisions get in. <dauwhe> +1 to astearns <dael> TabAtkins: Also why we have stying support for details class=note so you can add lots of details without space <dael> bradk: blog would get it in front of eyes to get feedback. <TabAtkins> I also folded in a clarification about how to serialize them, since annevk brought up that it was technically undefined. <dael> astearns: Don't htink we're looking for feedback. There's a known compat problems. Fixing because we need not not because it'sgood. <dael> fremy: It's a terrible idea. I don't want people to know this exists. <dael> bradk: There's probably people using it as a hack. Curious how big of a problem that will be. <TabAtkins> I'm happy to write a quick explanatory note into the spec. <dael> tantek: astearns I leave it to your judgement. Still think it's a good idea to put something out. If you don't think necessary I trust your judgement <bkardell_> didn't mean to make that comment off the record... I kind of agree that proactive seems better.. I'm not even sure it has to be official csswg, just a member who writes a post we all share is probably ok? <dael> astearns: TabAtkins has been mentioning changes. TabAtkins I would like a note in the spec explaining and appologizing why it's there. <dael> TabAtkins: Spec is live now, writing explanatory note <dael> astearns: Objections to change? <dael> RESOLVED: Accept the proposed change |
Years ago, allowing "MQ-style invalidation" for selector lists was seen as unsafe, most likely breaking old sites when it would "activate unexpected declaration blocks". Though I trust @dbaron's opinion on the real issues
https://www.w3.org/Style/CSS/Tracker/issues/223 |
…orrect spec link, a=testonly Automatic update from web-platform-testsUpdate webkit-pseudo-element test with correct spec link. (#12683) To reflect that this was added into selectors spec rather than compat spec, and update the link correspondingly. Related to w3c/csswg-drafts#3051. -- wpt-commits: 04d0c8c0d8f8f9f0e91881be731fd344477573dc wpt-pr: 12683
…orrect spec link, a=testonly Automatic update from web-platform-testsUpdate webkit-pseudo-element test with correct spec link. (#12683) To reflect that this was added into selectors spec rather than compat spec, and update the link correspondingly. Related to w3c/csswg-drafts#3051. -- wpt-commits: 04d0c8c0d8f8f9f0e91881be731fd344477573dc wpt-pr: 12683
In #3082, we have a proposal to use the reverse strategy regarding pseudo-elements: treat all unknown pseudo-elements (not just Are there any pseudo-elements other than |
…orrect spec link, a=testonly Automatic update from web-platform-testsUpdate webkit-pseudo-element test with correct spec link. (#12683) To reflect that this was added into selectors spec rather than compat spec, and update the link correspondingly. Related to w3c/csswg-drafts#3051. -- wpt-commits: 04d0c8c0d8f8f9f0e91881be731fd344477573dc wpt-pr: 12683 UltraBlame original commit: 0f3786ce06a117be24250205d060ebd4a180a5bf
…orrect spec link, a=testonly Automatic update from web-platform-testsUpdate webkit-pseudo-element test with correct spec link. (#12683) To reflect that this was added into selectors spec rather than compat spec, and update the link correspondingly. Related to w3c/csswg-drafts#3051. -- wpt-commits: 04d0c8c0d8f8f9f0e91881be731fd344477573dc wpt-pr: 12683 UltraBlame original commit: 0f3786ce06a117be24250205d060ebd4a180a5bf
…orrect spec link, a=testonly Automatic update from web-platform-testsUpdate webkit-pseudo-element test with correct spec link. (#12683) To reflect that this was added into selectors spec rather than compat spec, and update the link correspondingly. Related to w3c/csswg-drafts#3051. -- wpt-commits: 04d0c8c0d8f8f9f0e91881be731fd344477573dc wpt-pr: 12683 UltraBlame original commit: 0f3786ce06a117be24250205d060ebd4a180a5bf
For a while, WebKit-derived browsers have had a quirk where all
::-webkit-*
pseudo-elements are considered valid at parse time (and thus won't invalidate a selector list if they appear in only one selector). This has apparently begun to create compat problems for Firefox (see whatwg/compat#103), so they're adding that behavior themselves. This behavior is being tracked in WPT tests in web-platform-tests/wpt#12673.We should go ahead and inline that into the Selectors spec, probably in a compatibility appendix.
The text was updated successfully, but these errors were encountered: