W3C home > Mailing lists > Public > public-webapi@w3.org > April 2008

RE: [selectors-api] Handling :link and :visited Pseudo Classes

From: Travis Leithead <travil@windows.microsoft.com>
Date: Wed, 16 Apr 2008 14:56:12 -0700
To: Lachlan Hunt <lachlan.hunt@lachy.id.au>
CC: public-webapi <public-webapi@w3.org>
Message-ID: <0003CB8B8FE2154EB50431DB2B8F69C002C7A38ED5@NA-EXMSG-W601.wingroup.windeploy.ntdev.microsoft.com>
>> what is wrong with treating all links as unvisited as far as these
APIs are concerned.

This is the alternate option I'd prefer, if you insist on changing the spec in this way. However, my first choice would be to not alter the spec :)

To recap your proposal:
* :link - matches all links (essentially document.links, but without the href constraint) whether visited or not
* :visited - matches none.

Is that correct?

-----Original Message-----
From: Lachlan Hunt [mailto:lachlan.hunt@lachy.id.au]
Sent: Wednesday, April 16, 2008 2:35 PM
To: Travis Leithead
Cc: public-webapi
Subject: Re: [selectors-api] Handling :link and :visited Pseudo Classes

Travis Leithead wrote:
>>> I'm considering adjusting the spec to allow just two options, and
>>> making IE8's behaviour non-conforming.
>
> That sounds like you're trying to play hardball. :)

My main concern is that interoperability is not sacrificed in the name
of a security measure that's not entirely effective anyway.  I believe
there are alternative approaches that would achieve the same level of
security without sacrificing too much interoperability.

Although, ideally, both :link and :visited used in these APIs would
match the same elements as they do when used in CSS.  However, failing
that, what is wrong with treating all links as unvisited as far as these
APIs are concerned.

Consider this:

<p><a href="visited-link">foo</a> <a href="unvisited-link">bar</a>

<script>
var list1 = document.querySelectorAll(":link"); // Returns both links
var list2 = document.querySelectorAll(":visited"); // Returns empty list
</script>

That retains sufficient functionality to make at least :link useful,
without revealing which links have or have not been visited.  This
doesn't really affect interoperability too much, since the result is
effectively the same as if the user just cleared their history.

Alternatively, implementing a variation of that solution such as that
described by Bjoern [1] would, perhaps, be even better.

[1] http://lists.w3.org/Archives/Public/public-webapi/2008Apr/0137.html


--
Lachlan Hunt - Opera Software
http://lachy.id.au/

http://www.opera.com/


Received on Wednesday, 16 April 2008 21:59:29 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 16 April 2008 21:59:31 GMT