Remove the rule that "://" means a standard URL. This fixes a number of bugs
commit3ac0011b957721330788e6c8bf64b27fcea38b7e
authorbrettw@gmail.com <brettw@gmail.com@8873c55e-713a-0410-88f8-23d9c3d90b1b>
Fri, 12 Feb 2010 21:20:26 +0000 (12 21:20 +0000)
committerbrettw@gmail.com <brettw@gmail.com@8873c55e-713a-0410-88f8-23d9c3d90b1b>
Fri, 12 Feb 2010 21:20:26 +0000 (12 21:20 +0000)
tree4a34752e4f67bc6151bfe7f9fb9a2d9c90d1d930
parentdf2632eb033bf8144cb05f776fcadb22f363bf00
Remove the rule that "://" means a standard URL. This fixes a number of bugs
and layout tests. The only thing we use now to determine whether a scheme is
standard scheme is whether it is on a known list.

Fix some bugs around setting protocols. Previously, we wouldn't reparse the
entire URL, which would give weird results in some cases, since which part
actually gets replaced changes if you change the protocol. This change has us
replace the protocol, then completely reparse the URL which ensures we don't
miss any edge cases. It is a bit slower, but changing the protocol is very
unusual.

This differs from KURL in several cases. On the
fast/dom/HTMLAnchorElement/set-href-attribute-hostname.html
layout test, we fail setting a hostname on a URL with "foo" protocol because we
no longer treat a "foo" URL as a standard protocol. However, this matches
Firefox's behavior, so I think there should not be compat problems.

Other differences in that test are that we allow setting hosts with spaces in
them for IE compat, and that when we generate the URL "c:/path/testurl.html" on
Windows, we reinterpret that as a file URL to file:///C:/path/testurl.html.
This is how "c:/path/testurl.html" would be interpreted if we just found it on
a page, so I think this behavior is correct, even though no other browser does
this (our handling of these generally matches IE, but it fails to set a "c"
protocol with an exception in this case).

http://crbug.com/160
Review URL: http://codereview.chromium.org/564011

git-svn-id: http://google-url.googlecode.com/svn/trunk@123 8873c55e-713a-0410-88f8-23d9c3d90b1b
src/gurl.cc
src/gurl.h
src/gurl_unittest.cc
src/url_canon_stdurl.cc
src/url_util.cc
src/url_util.h
src/url_util_unittest.cc