[whatwg] URL decomposition on HTMLAnchorElement interface

Kartikaya Gupta wrote:
> The empty string falls under the "anything else" case in my suggestion above and would work as you expect.

Null and empty string should, imo, have the same behavior here.  It 
doesn't make sense to treat them differently to me.

>> There are big scary comments in the Gecko code for these setters saying 
>> that they must never ever throw.  I suspect that making them throw would 
>> be a serious web compat issue.
> 
> Is this Gecko-internal code you're referring to? Or the setters exposed to web content via HTMLAnchorElement?

The latter.  The Gecko-internal URI code does in fact throw on a lot of 
these setters, and the HTMLAnchorElement methods catch and eat these 
exceptions, very much on purpose.

> And do you have any examples of websites that would break if they threw?

Not offhand; I know I've seen sites setting hostnames on various 
non-http URIs, though (just as part of dealing with other, unrelated, 
bugs)...  That would become an uncaught exception with your proposal.

>> Changing from an authority to a non-authority URI or the other way 
>> around doesn't seem desirable to me (and would only work for unknown 
>> schemes anyway, presumably, at best; it's better if it just never works).
> 
> Does it matter? Since it's an unknown scheme, it's basically opaque data. You can't dereference it and fetch the resource it points to

No, but you can pass it off to a helper application.  In any case, my 
comment above was more concerned with your proposal that one should be 
able to create a non-authority http: URI than about unknown schemes.

>> That's nice, but I suspect web sites rely on the silent fail behavior here.
> 
> Examples?

If I see some, I'll let you know.  Looking through the web for them (or 
through bugzilla for that matter) is not really a priority for me right 
now, sorry.

-Boris

Received on Friday, 27 March 2009 18:53:48 UTC