-
Notifications
You must be signed in to change notification settings - Fork 682
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
[selectors] :link and <link> #3817
Comments
I don't think there is any sensible definition of what it means for a From a user perspective, it's also not very helpful for |
@AmeliaBR LINK elements are used for things other than style sheets. For example, rel=next/prev. |
Also, this works, and creates a navigable link.
|
Personally, I don't think it's reasonable to say that :link/:visited don't apply to LINK elements. They are hyperlinks, even if they're not visible by default. If browser don't want to deal with rendering them, they can specify link { display: none !important; } in their UA style sheet. |
@fantasai I know about next/previous If there are use cases for turning a displayed On this issue, my conclusion therefore is qualified based on the behavior: if force-displaying a |
…in chrome docs. r=smaug I don't think there's a point in making <link> elements match :visited, and it's an issue for Chrome docs because some chrome code can run before we have a profile. Make the already-existent workaround for localization links work more generally. There's no interop across browsers here anyhow: w3c/csswg-drafts#3817 tracks that. Differential Revision: https://phabricator.services.mozilla.com/D26910 --HG-- extra : moz-landing-system : lando
…in chrome docs. r=smaug I don't think there's a point in making <link> elements match :visited, and it's an issue for Chrome docs because some chrome code can run before we have a profile. Make the already-existent workaround for localization links work more generally. There's no interop across browsers here anyhow: w3c/csswg-drafts#3817 tracks that. Differential Revision: https://phabricator.services.mozilla.com/D26910
@AmeliaBR I don't understand why you think not rendering an element should make pseudo-classes not apply. Selectors aren't just about CSS. FWIW, the HTML spec is very explicit that they should match: https://html.spec.whatwg.org/multipage/semantics-other.html#pseudo-classes |
@fantasai, I never said that selector matching should depend on whether the element renders or not. It's about whether the element (if it is rendered) actually acts like a link from a user perspective: can you click it, or tab to it and press enter, and trigger navigation. Whether or not a |
@AmeliaBR The HTML spec doesn't need clarification, it's very explicit about whether :link and :visited match LINK elements. There is zero ambiguity here. |
Zero ambiguity, sure. The argument, tho, is that the definition is wrong/useless, and I agree. Having :link apply to We should pursue changing the HTML definition so that :link only applies to (In other words, a |
I think as of http://trac.webkit.org/projects/webkit/changeset/244642 WebKit will also stop matching @rniwa, do you know what's the reasoning for changing that? |
I guess the not recomputing Edit: Right, but that doesn't work. Nice. |
@emilio : oh, that's surprising. That's probably an unintentional change if any. FWIW, my testing at r244643 says WebKit still does blue, purple, blue, purple. |
Arguably it could be a real problem: |
…in chrome docs. r=smaug I don't think there's a point in making <link> elements match :visited, and it's an issue for Chrome docs because some chrome code can run before we have a profile. Make the already-existent workaround for localization links work more generally. There's no interop across browsers here anyhow: w3c/csswg-drafts#3817 tracks that. Differential Revision: https://phabricator.services.mozilla.com/D26910 UltraBlame original commit: e2a285801fb26598983b83b32fa3a44f1840c441
…in chrome docs. r=smaug I don't think there's a point in making <link> elements match :visited, and it's an issue for Chrome docs because some chrome code can run before we have a profile. Make the already-existent workaround for localization links work more generally. There's no interop across browsers here anyhow: w3c/csswg-drafts#3817 tracks that. Differential Revision: https://phabricator.services.mozilla.com/D26910 UltraBlame original commit: e2a285801fb26598983b83b32fa3a44f1840c441
…in chrome docs. r=smaug I don't think there's a point in making <link> elements match :visited, and it's an issue for Chrome docs because some chrome code can run before we have a profile. Make the already-existent workaround for localization links work more generally. There's no interop across browsers here anyhow: w3c/csswg-drafts#3817 tracks that. Differential Revision: https://phabricator.services.mozilla.com/D26910 UltraBlame original commit: e2a285801fb26598983b83b32fa3a44f1840c441
I'm implementing the pseudo selectors in blink which should make it have the same behavior as webkit: https://groups.google.com/a/chromium.org/g/blink-dev/c/l3Qw9cWYPUA |
There is a discussion about removing link:link and link:visited here: whatwg/html#4831 |
I think this can be closed now that whatwg/html#6269 is merged. |
Sorry for the issue title, it was just a good opportunity.
So, the following testcase:
Renders as follows in UAs:
I think per spec (https://drafts.csswg.org/selectors-4/#location) Firefox and WebKit are right. However, I don't see any use-case for letting
<link>
s match:visited
, and I have an internal use-case in Firefox where Blink or Edge's behavior would save us some trouble (https://bugzilla.mozilla.org/show_bug.cgi?id=1495621#c20).Arguably that Firefox case can't arise in the web, and we can work around it in different ways, but I wonder if there'd be interest here in either making
<link>
s never match:visited
, or making them not match any of:link
/:visited
/:any-link
.The text was updated successfully, but these errors were encountered: