Re: [whatwg] [URL] Cargo-cult naming in URL and matching

On Thu, Feb 7, 2013 at 5:16 PM, Alex Russell <slightlyoff@google.com> wrote:
> It doesn't appear straightforward to test if two URL objects reference the
> same path. The serialization algorithm has as flag for omitting the
> fragment, but not the query. Is there something in the API that I'm missing
> that would make this easier than custom-serializing 2 URLs to omit queries
> and then test string equality?

new URL(path, base).pathname == new URL(path2, base).pathname ought to work.


> The word "search" seems drived from window.location's use of that. Is it
> only included for compat with window.location? if so, can we drop it and
> spec window.location to use a subclass that provides it?

It's used by <a>, <area>, Location, and WorkerLocation. I think we
should just embrace that the string variant is named search
personally.


-- 
http://annevankesteren.nl/

Received on Thursday, 7 February 2013 17:27:58 UTC