W3C home > Mailing lists > Public > public-css-archive@w3.org > April 2019

[csswg-drafts] [selectors] :link and <link> (#3817)

From: Emilio Cobos Álvarez via GitHub <sysbot+gh@w3.org>
Date: Wed, 10 Apr 2019 13:50:54 +0000
To: public-css-archive@w3.org
Message-ID: <issues.opened-431515807-1554904252-sysbot+gh@w3.org>
emilio has just created a new issue for https://github.com/w3c/csswg-drafts:

== [selectors] :link and <link> ==
Sorry for the issue title, it was just a good opportunity.

So, the following testcase:

```html
<style>
  body { margin: 0 }
  a, head, link { display: block }
  a, link { width: 100px; height: 100px; background-color: red }
  :link { background-color: blue }
  :visited { background-color: purple }
</style>
<link href="unvisited"></a>
<link href="">
<a href="unvisited"></a>
<a href=""></a>
```

Renders as follows in UAs:

 * Firefox and WebKit: blue, purple, blue, purple
 * Edge: blue, blue, blue, purple
 * Blink: red, red, blue, purple

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`.

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/3817 using your GitHub account
Received on Wednesday, 10 April 2019 13:50:56 UTC

This archive was generated by hypermail 2.4.0 : Tuesday, 19 October 2021 01:31:07 UTC