W3C home > Mailing lists > Public > www-style@w3.org > May 2013

Re: URL comparison

From: Simon Sapin <simon.sapin@exyr.org>
Date: Sun, 05 May 2013 08:13:30 +0200
Message-ID: <5185F88A.2080102@exyr.org>
To: sam@cateches.is
CC: Anne van Kesteren <annevk@annevk.nl>, "www-style@w3.org" <www-style@w3.org>, WebApps WG <public-webapps@w3.org>
Le 25/04/2013 20:41, sam@cateches.is a écrit :
>> Requests I've heard before I looked at :local-link():
>>
>> * Simple equality
>> * Ignore fragment
>> * Ignore fragment and query
>> * Further normalization (browsers don't normalize as much as they
>> could during parsing, but maybe this should be an operation to modify
>> the URL object rather than a comparison option)
>
> What about links that point to a null URL with a hash? ie <a href="#back-to-top">
> Obviously this is a local link, but it doesn't really fit into the
> host/path/query segmentation that's defined with the :local-link([0|1|2...]) definition[1].
> Perhaps a :local-link(hash) keyword would be appropriate so that we could select links within the page?
>
> [1]http://dev.w3.org/csswg/selectors/#local-pseudo

Selectors 4 says "an element that is the source anchor of a hyperlink 
whose target's absolute URL matches the element's own document URL."

So the href attribute value would be parsed as an URL and made absolute 
per the usual rules before being matched by :link-local. In an HTML 
document, without a <base> element, the base URL would be the document 
URL and so :link-local would match.


>> However, :local-link() also ignores port/scheme which is not typical.
>
> Isn't it perfectly reasonable to expect that a different scheme/port
> is running an entirely different application?

I agree that Selectors 4 should be changed here. URLs that differ only 
by the scheme or port number should not be considered "local".

-- 
Simon Sapin
Received on Sunday, 5 May 2013 06:13:57 UTC

This archive was generated by hypermail 2.3.1 : Sunday, 5 May 2013 06:13:57 UTC