Re: :here for Links

On 31 Mar 2003 at 9:44, Daniel wrote:

> Ernest Cline wrote:
> 
> > That can already be done with CSS3 Selectors. The selector a[href^="#"] would 
> > select all links that begin with "#" and hence point to the current page.
> 
> That's clearly not enough. if the document's URL is 
> http://www.example.com/foo.html and the href of the link is 
> foo.html#bar, that's a local URL too and it does not begin with #...

If the author chooses to use that style of href then they can use 
a[href^="foo.html#"] on a per page basis. No matter what style of local URL 
they choose to use this technique would work. I will grant that if you are 
using an external stylesheet :here would gather in those local links of 
various forms that [href^="#"] does not, but I fail to see why the author 
could not use #bar instead of foo.html#bar. Failure on the part of a page 
author to use an existing method is no reason to create a new one. From the 
viewpoint of a document author there is no reason for :here.

How about a document user, tho? The main reason I can see for being 
interested in :here would be as a way of indicating that a document will not 
have to be retreived and hence could be rendered without a new download. 
However in that context, a pseudoclass of :cached to indicate that status 
would be more relevant. There is a potential privacy issue in that the 
computed style could be used by a malicious script to find out if someone has 
a particular page in their cache but it is the same potential privacy issue 
caused by the existing :visited pseudo-class.

Altho I can see the utility of a pseudo-class such as :cached, unless one can 
present a reason why a user might desire :here beyond because they might 
desire it, I will remain strongly opposed to adding :here to CSS. There are 
all sorts of neat things that could be added. However, just because it is 
neat doesn't mean that it should be added. If that were the standard, why 
isn't generic regular expression attribute matching in CSS Selectors instead 
of just the more limited ~=, ^=, $=, *=, and |=. I certainly would be much 
more interested in adding that than in adding :here.

Received on Monday, 31 March 2003 09:19:41 UTC