Re: parsing URI (references) according to RFC 3986

On 6/23/11 3:05 PM, Julian Reschke wrote:
> On 2011-06-23 20:56, Boris Zbarsky wrote:
>> The problem is that per 4.4 as I understand it this HTML:
>>
>> <!DOCTYPE html>
>> <base href="http://greenbytes.de/tech/tc/uris/imgother.html">
>> <img src="#foo">
>>
>> located at <http://greenbytes.de/tech/tc/uris/img.html> should treat the
>> image load as a load of <http://greenbytes.de/tech/tc/uris/img.html>
>> (because this is a same-document URI reference) whereas this is not what
>> any browser does. Browsers treat it as a load of
>> <http://greenbytes.de/tech/tc/uris/imgother.html>.
>>
>> Is my understanding of 4.4 incorrect? If so, why?
>
> Yes, it's incorrect.

OK.

> 4.4 says:
>
> "When a URI reference refers to a URI that is, aside from its fragment
> component (if any), identical to the base URI (Section 5.1), that
> reference is called a "same-document" reference."
>
> Note that section 5.1 is referenced for "base URI", and that has in
> <http://greenbytes.de/tech/webdav/rfc3986.html#rfc.section.5.1.1>:
...
> ...which is about the HTML <base> case, unless I'm mistaken.

Sure.  But the point is that in this case the base URI is 
"http://greenbytes.de/tech/tc/uris/imgother.html".  And the URI of the 
image is equal to the base URI except for the fragment identifier.  So 
per 4.4 this should be a same-document reference, no?

>> 1) It's the wrong way to solve the problem.
>> 2) The problem is outside the remit what I think a URI RFC should be
>> concerned with.
>> 3) And most importantly, it's a partial answer to the original "Which
>> parts of RFC 3986 are interop issues?" question.
>
> Yes!

OK, so we agree so far...

> I *believe* that you are reading 3986 wrong, and that there really is no
> conflict with HTML and with what browsers do.

But somehow not this far.  That confuses me.  ;)

-Boris

Received on Thursday, 23 June 2011 19:50:41 UTC