Re: URL comparison

On 04/25/2013 04:34 AM, Anne van Kesteren wrote:
> Background reading: http://dev.w3.org/csswg/selectors/#local-pseudo
> and http://url.spec.whatwg.org/
>
> :local-link() seems like a special case API for doing URL comparison
> within the context of selectors. It seems like a great feature, but
> I'd like it if we could agree on common comparison rules so that when
> we eventually introduce the JavaScript equivalent they're not wildly
> divergent.
>
> :local-link() seems to ask for: Ignore fragment and query and only
> look at a subset of path segments. However, :local-link() also ignores
> port/scheme which is not typical. We try to keep everything
> origin-scoped (ignoring username/password probably makes sense).

I suspect this was so that http and https links could be compared
sensibly. The use case for :local-link() is to style links that
belong to the same section differently from others in a navbar.
For such things, http vs. https shouldn't matter. But maybe it's
not a common enough case that we needn't handle it.

~fantasai

Received on Thursday, 25 April 2013 17:58:32 UTC