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: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Wed, 13 Aug 2014 13:24:43 -0700
Message-ID: <CAAWBYDAL4MYqwcvt0Hh5KNOGywKXqELsNDsppGdzYugdTGpvtg@mail.gmail.com>
To: Benjamin Poulain <bpoulain@apple.com>
Cc: Boris Zbarsky <bzbarsky@mit.edu>, www-style list <www-style@w3.org>
On Wed, Aug 13, 2014 at 1:17 PM, Benjamin Poulain <bpoulain@apple.com> wrote:
> On Aug 12, 2014, at 9:05 PM, Boris Zbarsky <bzbarsky@MIT.EDU> wrote:
>> 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.
>
> I understand Firefox does things differently, but what is the rationale behind that?
> Is there a new role for <link> I am unaware of? Is it intended to replace <a> in some cases?
>
> If you use -moz-any-link with querySelector on Firefox, half of the results are for stylesheets which is never what authors want.

Just use querySelector("a")?

~TJ
Received on Wednesday, 13 August 2014 20:25:36 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 13 August 2014 20:25:36 UTC