- From: Sam Ruby <rubys@intertwingly.net>
- Date: Tue, 14 Oct 2014 07:20:47 -0400
- To: Simon Pieters <simonp@opera.com>, Anne van Kesteren <annevk@annevk.nl>
- Cc: whatWG <whatwg@whatwg.org>
On 10/14/2014 07:00 AM, Simon Pieters wrote: > On Tue, 14 Oct 2014 12:34:55 +0200, Anne van Kesteren <annevk@annevk.nl> > wrote: > >>> If you could be so kind as to point out what I am missing, I would >>> appreciate it. >> >> The way the <a> element works, I assume. Which is mostly how URLUtils >> works when associated with an object that is not URL. > > [[ > The a element also supports the URLUtils interface. [URL] > > When the element is created, and whenever the element's href content > attribute is set, changed, or removed, the user agent must invoke the > element's URLUtils interface's set the input algorithm with the value of > the href content attribute, if any, or the empty string otherwise, as > the given value. > ]] > https://html.spec.whatwg.org/multipage/semantics.html#the-a-element > > -> set the input > > [[ > 1. Set url to null. > ... > 4. If url is not failure, set url to url. > ]] > https://url.spec.whatwg.org/#concept-urlutils-set-the-input > > When /url/ is failure, https://url.spec.whatwg.org/#concept-urlutils-url > is null. So: > > .href: > > [[ > 1. If url is null, return input. > ]] > https://url.spec.whatwg.org/#dom-url-href > > .protocol: > > [[ > 1. If url is null, return ":". > ]] > https://url.spec.whatwg.org/#dom-url-protocol > > ...and the other attributes return empty string in the first step if url > is null. > > Does that help? Indeed, it does. Thanks! I was looking too myopically, assuming that urltestdata.txt was testing URL; and got sidetracked by http://www.lookout.net/test/url/. What I should have been looking at is https://github.com/w3c/web-platform-tests/tree/master/url, and in particular, the name of: https://github.com/w3c/web-platform-tests/blob/master/url/a-element.html - - - I think that a working and up-to-date live url parser would be a handy thing to have, and I hope to have one available shortly. - Sam Ruby
Received on Tuesday, 14 October 2014 11:21:14 UTC