Content-Base: http://a/b/c/d;p?q
I will need your help testing the examples on multiple browsers. What you need to do is point to the example anchor and compare it to the resolved URL in your browser (most browsers have a feature by which you can see the resolved URL at the bottom of the window/screen when the anchor is active).
RESULTS from g:h = g:h [R,X,2,3,4,5] http://a/b/c/g:h [1] g = http://a/b/c/g [R,X,1,2,3,4,5] ./g = http://a/b/c/g [R,X,1,2,3,4,5] g/ = http://a/b/c/g/ [R,X,1,2,3,4,5] /g = http://a/g [R,X,1,2,3,4,5] //g = http://g [R,X,1,2,3,4,5] ?y = http://a/b/c/?y [R,1,2,3,4] http://a/b/c/d;p?y [X,5] g?y = http://a/b/c/g?y [R,X,1,2,3,4,5] #s = (current document)#s [R,2,4] http://a/b/c/d;p?q#s [X,1,3,5] g#s = http://a/b/c/g#s [R,X,1,2,3,4,5] g?y#s = http://a/b/c/g?y#s [R,X,1,2,3,4,5] ;x = http://a/b/c/;x [R,1,2,3,4] http://a/b/c/d;x [X,5] g;x = http://a/b/c/g;x [R,X,1,2,3,4,5] g;x?y#s = http://a/b/c/g;x?y#s [R,X,1,2,3,4,5] . = http://a/b/c/ [R,X,2,5] http://a/b/c/. [1] http://a/b/c [3,4] ./ = http://a/b/c/ [R,X,1,2,3,4,5] .. = http://a/b/ [R,X,2,5] http://a/b [1,3,4] ../ = http://a/b/ [R,X,1,2,3,4,5] ../g = http://a/b/g [R,X,1,2,3,4,5] ../.. = http://a/ [R,X,2,5] http://a [1,3,4] ../../ = http://a/ [R,X,1,2,3,4,5] ../../g = http://a/g [R,X,1,2,3,4,5]
An empty reference refers to the start of the current document.
<> = (current document) [R,2,4] http://a/b/c/d;p?q [X,3,5] http://a/b/c/ [1]
../../../g = http://a/../g [R,X,2,4,5] http://a/g [R,1,3] ../../../../g = http://a/../../g [R,X,2,4,5] http://a/g [R,1,3]
Similarly, parsers must avoid treating "." and ".." as special when they are not complete components of a relative path.
/./g = http://a/./g [R,X,2,3,4,5] http://a/g [1] /../g = http://a/../g [R,X,2,3,4,5] http://a/g [1] g. = http://a/b/c/g. [R,X,1,2,3,4,5] .g = http://a/b/c/.g [R,X,1,2,3,4,5] g.. = http://a/b/c/g.. [R,X,1,2,3,4,5] ..g = http://a/b/c/..g [R,X,1,2,3,4,5]
./../g = http://a/b/g [R,X,1,2,5] http://a/b/c/../g [3,4] ./g/. = http://a/b/c/g/ [R,X,2,5] http://a/b/c/g/. [1] http://a/b/c/g [3,4] g/./h = http://a/b/c/g/h [R,X,1,2,3,4,5] g/../h = http://a/b/c/h [R,X,1,2,3,4,5] g;x=1/./y = http://a/b/c/g;x=1/y [R,1,2,3,4] http://a/b/c/g;x=1/./y [X,5] g;x=1/../y = http://a/b/c/y [R,1,2,3,4] http://a/b/c/g;x=1/../y [X,5]
g?y/./x = http://a/b/c/g?y/./x [R,X,5] http://a/b/c/g?y/x [1,2,3,4] g?y/../x = http://a/b/c/g?y/../x [R,X,5] http://a/b/c/x [1,2,3,4] g#s/./x = http://a/b/c/g#s/./x [R,X,2,3,4,5] http://a/b/c/g#s/x [1] g#s/../x = http://a/b/c/g#s/../x [R,X,2,3,4,5] http://a/b/c/x [1]
http:g = http:g [R,X,5] | http://a/b/c/g [1,2,3,4] (ok for compat.) http: = http: [R,X,5] http://a/b/c/ [1] http://a/b/c/d;p?q [2,3,4]