This is a bug that was originally filed under Android but has been narrowed down to the URL parsing portion of WebKit. When loading a page such as the one linked above, in which there is a <base> url and a relative path being processed, the browser will sometimes fail to remove all '.'s in the path, resulting in a URL which starts with '/.'. This does not comply with RFC 3986 section 5.4, as shown here http://curlies.googlecode.com/svn/trunk/test_results/latest/relative_results.html. This does not result in any errors and the url is followed properly by most browsers, but it is not the standard result. Proposed Fix: We have already fixed this within the Android codebase but would like to keep our code as consistent as possible, and would therefore like to update this change within the Webkit base as well. The following lines need to be added to WebCore/platform/KURL.cpp 1290 1291 // Remove any trailing '.' from base, in order to conform to RFC 3986 section 5.4 1292 if (p[-1] == '.') { 1293 p--; 1294 } 1295 This will remove a trailing '.' at the end of the base url, which is not checked and therefore results in the incorrect rendering. Is this indeed the correct way to fix this? If not, what would be the appropriate way to deal with this issue? Thanks!
You mentioned off-bug that you don't observe this incorrect behaviour with either Chrome or Safari - only Android. Chrome uses GURL rather than KURL - can you take a look to see if GURL handles this case differently? Also, can you provide a LayoutTest to test this? There may already be one, but this has value even if we don't end up making a change to WebCore. A failing test on Mac would confirm that a fix is required. A passing test on Mac would confirm that the correct behaviour observed in Safari is due to the Mac WebKit layer, rather than the browser itself. Finally, note that typically, reviewers will only monitor bugs with proposed patches attached and the r? flag set.
After further investigation we have concluded that the proper place to deal with this is within our Android Browser code, not Webkit. The KURL behavior is correct, we are simply passing an incorrectly split base/relative path pair.