W3C home > Mailing lists > Public > www-style@w3.org > August 2014

Re: [selectors] :any-link, :link and :visited should not match HTML's <link>

From: Boris Zbarsky <bzbarsky@MIT.EDU>
Date: Wed, 13 Aug 2014 00:05:41 -0400
Message-ID: <53EAE415.2080209@mit.edu>
To: www-style@w3.org
On 8/12/14, 8:18 PM, Benjamin Poulain wrote:
> In the definition of :any-link (http://dev.w3.org/csswg/selectors4/#the-any-link-pseudo), the text explicitly mentions the elements it matches for HTML5: <a>, <area> and <link>. I donít see why matching <link> is useful in that context since it does not have a visual representation.

By default.  You can render it just fine in practice.  Here's a simple 
example:

   <!DOCTYPE html>
   <style>
     head,link { display: block }
     link::before { content: attr(href) }
   </style>
   <link href="http://example.org">

Of course if you try that testcase you'll see even more behavior 
differences between browsers in terms of whether the <link> is treated 
as a link or not...

> I suggest removing <link> and limiting the 3 selectors to visual content.

Please do note 
http://www.whatwg.org/specs/web-apps/current-work/multipage/scripting.html#selector-link 
for what the HTML spec has to say on the matter.

-Boris
Received on Wednesday, 13 August 2014 04:06:11 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 13 August 2014 04:06:13 UTC