Diff
Modified: branches/safari-600.4.10-branch/LayoutTests/ChangeLog (180294 => 180295)
--- branches/safari-600.4.10-branch/LayoutTests/ChangeLog 2015-02-18 22:23:22 UTC (rev 180294)
+++ branches/safari-600.4.10-branch/LayoutTests/ChangeLog 2015-02-18 22:24:46 UTC (rev 180295)
@@ -1,5 +1,24 @@
2015-02-18 Lucas Forschler <lforsch...@apple.com>
+ Merge r174712
+
+ 2014-10-14 Dan Bernstein <m...@apple.com>
+
+ URLs that start with http:/// and https:/// lose two slashes when parsed, causing assertion failure and inconsistent behavior
+ https://bugs.webkit.org/show_bug.cgi?id=137718
+
+ Reviewed by Alexey Proskuryakov.
+
+ * fast/loader/url-parse-1-expected.txt: Updated results.
+ * fast/loader/url-parse-1.html: Added a few test cases.
+ * fast/url/file-http-base-expected.txt: Updated results.
+ * fast/url/host-expected.txt: Ditto.
+ * fast/url/invalid-urls-utf8-expected.txt: Ditto.
+ * fast/url/relative-expected.txt: Ditto.
+ * fast/url/standard-url-expected.txt: Ditto.
+
+2015-02-18 Lucas Forschler <lforsch...@apple.com>
+
Merge r174085
2014-09-29 David Hyatt <hy...@apple.com>
Modified: branches/safari-600.4.10-branch/LayoutTests/fast/loader/url-parse-1-expected.txt (180294 => 180295)
--- branches/safari-600.4.10-branch/LayoutTests/fast/loader/url-parse-1-expected.txt 2015-02-18 22:23:22 UTC (rev 180294)
+++ branches/safari-600.4.10-branch/LayoutTests/fast/loader/url-parse-1-expected.txt 2015-02-18 22:24:46 UTC (rev 180295)
@@ -24,7 +24,15 @@
http:/ http:/ /
http:// http:/ /
http:/// http:/ /
-http://// http:// //
+http://// http:/ /
+http:webkit.org http://webkit.org/ webkit.org /
+http:/webkit.org http://webkit.org/ webkit.org /
+http://webkit.org http://webkit.org/ webkit.org /
+http:///webkit.org http://webkit.org/ webkit.org /
+http:////webkit.org http://webkit.org/ webkit.org /
+http://///webkit.org http://webkit.org/ webkit.org /
+http://////webkit.org http://webkit.org/ webkit.org /
+http:////////////////webkit.org http://webkit.org/ webkit.org /
http://localhost http://localhost/ localhost /
http://localhost/ http://localhost/ localhost /
http://localhost/test http://localhost/test localhost /test
Modified: branches/safari-600.4.10-branch/LayoutTests/fast/loader/url-parse-1.html (180294 => 180295)
--- branches/safari-600.4.10-branch/LayoutTests/fast/loader/url-parse-1.html 2015-02-18 22:23:22 UTC (rev 180294)
+++ branches/safari-600.4.10-branch/LayoutTests/fast/loader/url-parse-1.html 2015-02-18 22:24:46 UTC (rev 180295)
@@ -67,6 +67,14 @@
"http://",
"http:///",
"http:////",
+ "http:webkit.org",
+ "http:/webkit.org",
+ "http://webkit.org",
+ "http:///webkit.org",
+ "http:////webkit.org",
+ "http://///webkit.org",
+ "http://////webkit.org",
+ "http:////////////////webkit.org",
"http://localhost",
"http://localhost/",
"http://localhost/test",
Modified: branches/safari-600.4.10-branch/LayoutTests/fast/url/file-http-base-expected.txt (180294 => 180295)
--- branches/safari-600.4.10-branch/LayoutTests/fast/url/file-http-base-expected.txt 2015-02-18 22:23:22 UTC (rev 180294)
+++ branches/safari-600.4.10-branch/LayoutTests/fast/url/file-http-base-expected.txt 2015-02-18 22:24:46 UTC (rev 180295)
@@ -27,7 +27,7 @@
FAIL canonicalize('file:c|//foo\\bar.html') should be file:///c%7C//foo/bar.html. Was file://c|//foo/bar.html.
FAIL canonicalize('//') should be file:///. Was http:/.
FAIL canonicalize('///') should be file:///. Was http:/.
-FAIL canonicalize('///test') should be file:///test. Was http:/test.
+FAIL canonicalize('///test') should be file:///test. Was http://test/.
PASS canonicalize('file://test') is 'file://test/'
FAIL canonicalize('file://localhost') should be file://localhost/. Was file:///.
FAIL canonicalize('file://localhost/') should be file://localhost/. Was file:///.
Modified: branches/safari-600.4.10-branch/LayoutTests/fast/url/host-expected.txt (180294 => 180295)
--- branches/safari-600.4.10-branch/LayoutTests/fast/url/host-expected.txt 2015-02-18 22:23:22 UTC (rev 180294)
+++ branches/safari-600.4.10-branch/LayoutTests/fast/url/host-expected.txt 2015-02-18 22:24:46 UTC (rev 180295)
@@ -33,16 +33,16 @@
FAIL canonicalize('http://www.lookout.net::==80::==443::/') should be http://www.lookout.net::%3D%3D80::%3D%3D443:/. Was http://www.lookout.net::==80::==443::/.
PASS canonicalize('http://www.lookout.net::80::443/') is 'http://www.lookout.net::80::443/'
PASS canonicalize('http://\.//') is 'http://.//'
-FAIL canonicalize('http:////:@//') should be http:////. Was http://:@//.
+FAIL canonicalize('http:////:@//') should be http:////. Was http:////:@//.
PASS canonicalize('http://\google.com/foo/') is 'http://google.com/foo/'
-FAIL canonicalize('http://\\google.com/foo/') should be http://google.com/foo/. Was http:/google.com/foo/.
-PASS canonicalize('http:////asdf@//') is 'http://asdf@//'
+PASS canonicalize('http://\\google.com/foo/') is 'http://google.com/foo/'
+FAIL canonicalize('http:////asdf@//') should be http://asdf@//. Was http:////asdf@//.
PASS canonicalize('http:////:81/') is 'http://:81/'
PASS canonicalize('http://:///') is 'http://:///'
PASS canonicalize('http://c:/') is 'http://c/'
PASS canonicalize('http://xxxx:/') is 'http://xxxx/'
PASS canonicalize('http://.:./') is 'http://.:./'
-FAIL canonicalize('http://////@google.com//') should be http://google.com//. Was http:////@google.com//.
+PASS canonicalize('http://////@google.com//') is 'http://google.com//'
PASS canonicalize('http://@google.com/') is 'http://google.com/'
PASS successfullyParsed is true
Modified: branches/safari-600.4.10-branch/LayoutTests/fast/url/invalid-urls-utf8-expected.txt (180294 => 180295)
--- branches/safari-600.4.10-branch/LayoutTests/fast/url/invalid-urls-utf8-expected.txt 2015-02-18 22:23:22 UTC (rev 180294)
+++ branches/safari-600.4.10-branch/LayoutTests/fast/url/invalid-urls-utf8-expected.txt 2015-02-18 22:24:46 UTC (rev 180295)
@@ -5,6 +5,10 @@
FAIL src should be http:///. Was http:/.
FAIL src should be https:///. Was https:/.
+FAIL src should be ftp:///. Was ftp://.
+FAIL src should be gopher:///. Was gopher://.
+FAIL src should be ws:///. Was ws://.
+FAIL src should be wss:///. Was wss://.
PASS src is expected
PASS src is expected
PASS src is expected
@@ -21,10 +25,6 @@
PASS src is expected
PASS src is expected
PASS src is expected
-PASS src is expected
-PASS src is expected
-PASS src is expected
-PASS src is expected
PASS successfullyParsed is true
TEST COMPLETE
Modified: branches/safari-600.4.10-branch/LayoutTests/fast/url/relative-expected.txt (180294 => 180295)
--- branches/safari-600.4.10-branch/LayoutTests/fast/url/relative-expected.txt 2015-02-18 22:23:22 UTC (rev 180294)
+++ branches/safari-600.4.10-branch/LayoutTests/fast/url/relative-expected.txt 2015-02-18 22:24:46 UTC (rev 180295)
@@ -52,7 +52,7 @@
PASS canonicalize(';/../bar') is 'http://host/bar'
PASS canonicalize('//another') is 'http://another/'
PASS canonicalize('//another/path?query#ref') is 'http://another/path?query#ref'
-FAIL canonicalize('///another/path') should be http://another/path. Was http:/another/path.
+PASS canonicalize('///another/path') is 'http://another/path'
PASS canonicalize('//Another\\path') is 'http://another/path'
FAIL canonicalize('//') should be http:. Was http:/.
PASS canonicalize('\\/another/path') is 'http://another/path'
Modified: branches/safari-600.4.10-branch/LayoutTests/fast/url/standard-url-expected.txt (180294 => 180295)
--- branches/safari-600.4.10-branch/LayoutTests/fast/url/standard-url-expected.txt 2015-02-18 22:23:22 UTC (rev 180294)
+++ branches/safari-600.4.10-branch/LayoutTests/fast/url/standard-url-expected.txt 2015-02-18 22:24:46 UTC (rev 180295)
@@ -7,7 +7,7 @@
FAIL canonicalize('http://www.google.com/foo?bar=baz# »') should be http://www.google.com/foo?bar=baz# ». Was http://www.google.com/foo?bar=baz# %BB.
PASS canonicalize('http://[www.google.com]/') is 'http://[www.google.com]/'
PASS canonicalize('http://www.google.com') is 'http://www.google.com/'
-FAIL canonicalize('http:////////user:@google.com:99?foo') should be http://u...@google.com:99/?foo. Was http://////user:@google.com:99?foo.
+PASS canonicalize('http:////////user:@google.com:99?foo') is 'http://u...@google.com:99/?foo'
FAIL canonicalize('http://192.0x00A80001') should be http://192.168.0.1/. Was http://192.0x00a80001/.
FAIL canonicalize('http://www/foo%2Ehtml') should be http://www/foo.html. Was http://www/foo%2Ehtml.
PASS canonicalize('http://user:pass@/') is 'http://user:pass@/'
Modified: branches/safari-600.4.10-branch/Source/WebCore/ChangeLog (180294 => 180295)
--- branches/safari-600.4.10-branch/Source/WebCore/ChangeLog 2015-02-18 22:23:22 UTC (rev 180294)
+++ branches/safari-600.4.10-branch/Source/WebCore/ChangeLog 2015-02-18 22:24:46 UTC (rev 180295)
@@ -1,5 +1,23 @@
2015-02-18 Lucas Forschler <lforsch...@apple.com>
+ Merge r174712
+
+ 2014-10-14 Dan Bernstein <m...@apple.com>
+
+ URLs that start with http:/// and https:/// lose two slashes when parsed, causing assertion failure and inconsistent behavior
+ https://bugs.webkit.org/show_bug.cgi?id=137718
+
+ Reviewed by Alexey Proskuryakov.
+
+ Added cases to fast/loader/url-parse-1.html.
+
+ * platform/URL.cpp:
+ (WebCore::URL::parse): In hierarchical schemes other than file:, ignore any additional
+ slashes after the ://, as prescribed by the authority-ignore-slashes state in the current
+ URL spec.
+
+2015-02-18 Lucas Forschler <lforsch...@apple.com>
+
Merge r174085
2014-09-29 David Hyatt <hy...@apple.com>
Modified: branches/safari-600.4.10-branch/Source/WebCore/platform/URL.cpp (180294 => 180295)
--- branches/safari-600.4.10-branch/Source/WebCore/platform/URL.cpp 2015-02-18 22:23:22 UTC (rev 180294)
+++ branches/safari-600.4.10-branch/Source/WebCore/platform/URL.cpp 2015-02-18 22:24:46 UTC (rev 180295)
@@ -247,7 +247,7 @@
static inline bool isPathSegmentEndChar(char c) { return characterClassTable[static_cast<unsigned char>(c)] & PathSegmentEndChar; }
static inline bool isPathSegmentEndChar(UChar c) { return c <= 0xff && (characterClassTable[c] & PathSegmentEndChar); }
static inline bool isBadChar(unsigned char c) { return characterClassTable[c] & BadChar; }
-
+
static inline bool isSchemeCharacterMatchIgnoringCase(char character, char schemeCharacter)
{
ASSERT(isSchemeChar(character));
@@ -1140,10 +1140,17 @@
// Attempt to find an authority.
// FIXME: Authority characters may be scanned twice, and it would be nice to be faster.
- if (hierarchical)
+ if (hierarchical) {
userStart++;
- if (hasSecondSlash)
- userStart++;
+ if (hasSecondSlash) {
+ userStart++;
+ if (isNonFileHierarchicalScheme(url, schemeEnd)) {
+ while (url[userStart] == '/')
+ userStart++;
+ }
+ }
+ }
+
userEnd = userStart;
int colonPos = 0;