Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign up[selectors] :link and <link> #3817
Comments
This comment has been minimized.
This comment has been minimized.
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 |
This comment has been minimized.
This comment has been minimized.
@AmeliaBR LINK elements are used for things other than style sheets. For example, rel=next/prev. |
This comment has been minimized.
This comment has been minimized.
Also, this works, and creates a navigable link.
|
This comment has been minimized.
This comment has been minimized.
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. |
This comment has been minimized.
This comment has been minimized.
@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
This comment has been minimized.
This comment has been minimized.
@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 |
This comment has been minimized.
This comment has been minimized.
@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 |
This comment has been minimized.
This comment has been minimized.
@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. |
This comment has been minimized.
This comment has been minimized.
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 |
This comment has been minimized.
This comment has been minimized.
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? |
This comment has been minimized.
This comment has been minimized.
I guess the not recomputing Edit: Right, but that doesn't work. Nice. |
This comment has been minimized.
This comment has been minimized.
@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. |
This comment has been minimized.
This comment has been minimized.
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
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
.