Re: parsing URI (references) according to RFC 3986

On 2011-06-23 20:46, Julian Reschke wrote:
> On 2011-06-23 20:31, Boris Zbarsky wrote:
>> On 6/23/11 2:27 PM, Julian Reschke wrote:
>>> Using Firefox 5; looking at the "Net" tab under "Options" -> "Web
>>> Developer" -> "Web Console"; I just checked my server log and it does
>>> seem to be a bug in the tool.
>>
>> Yeah, the Web Console doesn't know what actually went on the wire; it
>> just synthesizes its information from some metadata about the network
>> request... ;)
>
> (does this need a bug?)
>
>>> 4.4 defers to section 5.1 for the definition of the base URI, and makes
>>> it media type dependent how to find it. So the HTML spec needs to answer
>>> that question (also, related questions with respect to changing the base
>>> URI after the document was loaded)-
>>
>> There is no question about those aspects of this. The base URI for the
>> image source in this case is
>> "http://greenbytes.de/tech/tc/uris/imgother.html".
>
> Yes.
>
> So please remind me (sorry; has been a long day for me): what is the
> problem here?
>
> Sending an additional request despite the URI spec says "should not"?
> Why is the request being sent anyway?
>
>>> It doesn't. HTML needs to define it.
>>
>> How can HTML define it without contradicting 4.4? What's 4.4 even
>> supposed to mean?
>>
>> If it's not supposed to mean anything and specs that use URIs are just
>> supposed to define what happens (a stance I agree with), then why is 4.4
>> even there?
>
> The text was changed from RFC 2396, which just said:
>
> "A URI reference that does not contain a URI is a reference to the
> current document. In other words, an empty URI reference within a
> document is interpreted as a reference to the start of that document,
> and a reference containing only a fragment identifier is a reference to
> the identified fragment of that document. Traversal of such a reference
> should not result in an additional retrieval action. However, if the URI
> reference occurs in a context that is always intended to result in a new
> request, as in the case of HTML's FORM element, then an empty URI
> reference represents the base URI of the current document and should be
> replaced by that URI when transformed into a request." --
> <http://greenbytes.de/tech/webdav/rfc2396.html#rfc.section.4.2>
>
> The history for this seems to be in
> <http://labs.apache.org/webarch/uri/rev-2002/issues.html#017-rdf-fragment>.
> ...

and...:

"The determination of whether a URI reference is a same-document 
reference has been decoupled from the URI parser, simplifying the URI 
processing interface within applications in a way consistent with the 
internal architecture of deployed URI processing implementations. The 
determination is now based on comparison to the base URI after 
transforming a reference to absolute form, rather than on the format of 
the reference itself. This change may result in more references being 
considered "same-document" under this specification than there would be 
under the rules given in RFC 2396, especially when normalization is used 
to reduce aliases. However, it does not change the status of existing 
same-document references." -- 
<http://greenbytes.de/tech/webdav/rfc3986.html#rfc.section.D.2.p.6>

BR, Julian

Received on Thursday, 23 June 2011 18:49:29 UTC