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

Anne van Kesteren annevk at annevk.nl
Thu Feb 7 09:27:34 PST 2013

On Thu, Feb 7, 2013 at 5:16 PM, Alex Russell <slightlyoff at 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


More information about the whatwg mailing list