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

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