Diff
Modified: trunk/LayoutTests/ChangeLog (105293 => 105294)
--- trunk/LayoutTests/ChangeLog 2012-01-18 18:41:13 UTC (rev 105293)
+++ trunk/LayoutTests/ChangeLog 2012-01-18 18:41:43 UTC (rev 105294)
@@ -1,3 +1,24 @@
+2012-01-17 Alexey Proskuryakov <a...@apple.com>
+
+ file:// doesn't work as base URL
+ https://bugs.webkit.org/show_bug.cgi?id=76496
+
+ Reviewed by Darin Adler.
+
+ * fast/url/degenerate-file-base-expected.txt: Added.
+ * fast/url/degenerate-file-base.html: Added.
+ * fast/url/resources/pass.js: Added.
+ Added a test checking that this use case works.
+
+ * fast/url/file-expected.txt:
+ * fast/url/file-http-base-expected.txt:
+ * fast/loader/url-parse-1-expected.txt:
+ Also updated mega-test results.
+
+ * http/tests/misc/drag-over-iframe-invalid-source-crash-expected.txt:
+ * http/tests/misc/iframe-invalid-source-crash-expected.txt:
+ Console message is different now, as "file:" is properly canonicalized.
+
2012-01-18 Csaba Osztrogonác <o...@webkit.org>
[Qt] fontCache related assertion revealed by r105143
Added: trunk/LayoutTests/fast/url/degenerate-file-base-expected.txt (0 => 105294)
--- trunk/LayoutTests/fast/url/degenerate-file-base-expected.txt (rev 0)
+++ trunk/LayoutTests/fast/url/degenerate-file-base-expected.txt 2012-01-18 18:41:43 UTC (rev 105294)
@@ -0,0 +1,2 @@
+Base URL: file:///
+Should say PASS: PASS
Property changes on: trunk/LayoutTests/fast/url/degenerate-file-base-expected.txt
___________________________________________________________________
Added: svn:mime-type
Added: svn:eol-style
Added: trunk/LayoutTests/fast/url/degenerate-file-base.html (0 => 105294)
--- trunk/LayoutTests/fast/url/degenerate-file-base.html (rev 0)
+++ trunk/LayoutTests/fast/url/degenerate-file-base.html 2012-01-18 18:41:43 UTC (rev 105294)
@@ -0,0 +1,13 @@
+<base href=""
+<body>
+<script>
+if (window.layoutTestController)
+ layoutTestController.dumpAsText();
+
+document.write("Base URL: <b>" + document.getElementsByTagName("base")[0].href + "</b><br>");
+
+var directoryPart = document.URL.substring(7);
+directoryPart = directoryPart.substring(0, directoryPart.lastIndexOf('/') + 1);
+document.write("Should say PASS: <b>");
+document.write("<script src=''></scri" + "pt>");
+</script>
Property changes on: trunk/LayoutTests/fast/url/degenerate-file-base.html
___________________________________________________________________
Added: svn:mime-type
Modified: trunk/LayoutTests/fast/url/file-expected.txt (105293 => 105294)
--- trunk/LayoutTests/fast/url/file-expected.txt 2012-01-18 18:41:13 UTC (rev 105293)
+++ trunk/LayoutTests/fast/url/file-expected.txt 2012-01-18 18:41:43 UTC (rev 105294)
@@ -24,11 +24,11 @@
PASS canonicalize('file:///home/me') is 'file:///home/me'
FAIL canonicalize('file:c:\\foo\\bar.html') should be file:///c:/foo/bar.html. Was file:///tmp/mock/c:/foo/bar.html.
FAIL canonicalize('file:c|//foo\\bar.html') should be file:///c%7C//foo/bar.html. Was file:///tmp/mock/c|//foo/bar.html.
-FAIL canonicalize('//') should be file:///. Was file:.
+PASS canonicalize('//') is 'file:///'
PASS canonicalize('///') is 'file:///'
PASS canonicalize('///test') is 'file:///test'
-FAIL canonicalize('file://test') should be file://test/. Was file://test.
-FAIL canonicalize('file://localhost') should be file://localhost/. Was file:.
+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:///.
FAIL canonicalize('file://localhost/test') should be file://localhost/test. Was file:///test.
PASS successfullyParsed is true
Modified: trunk/LayoutTests/fast/url/file-http-base-expected.txt (105293 => 105294)
--- trunk/LayoutTests/fast/url/file-http-base-expected.txt 2012-01-18 18:41:13 UTC (rev 105293)
+++ trunk/LayoutTests/fast/url/file-http-base-expected.txt 2012-01-18 18:41:43 UTC (rev 105294)
@@ -5,7 +5,7 @@
FAIL canonicalize('file:c:\\foo\\bar.html') should be file:///C:/foo/bar.html. Was file://c:/foo/bar.html.
FAIL canonicalize(' File:c|////foo\\bar.html') should be file:///C:////foo/bar.html. Was file://c|////foo/bar.html.
-FAIL canonicalize('file:') should be file:///. Was file:.
+PASS canonicalize('file:') is 'file:///'
FAIL canonicalize('file:UNChost/path') should be file://unchost/path. Was file://UNChost/path.
FAIL canonicalize('c:\\foo\\bar') should be file:///C:/foo/bar. Was c:/foo/bar.
FAIL canonicalize('C|/foo/bar') should be file:///C:/foo/bar. Was http://example.com/mock/C|/foo/bar.
@@ -28,8 +28,8 @@
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('file://test') should be file://test/. Was file://test.
-FAIL canonicalize('file://localhost') should be file://localhost/. Was file:.
+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:///.
FAIL canonicalize('file://localhost/test') should be file://localhost/test. Was file:///test.
PASS successfullyParsed is true
Added: trunk/LayoutTests/fast/url/resources/pass.js (0 => 105294)
--- trunk/LayoutTests/fast/url/resources/pass.js (rev 0)
+++ trunk/LayoutTests/fast/url/resources/pass.js 2012-01-18 18:41:43 UTC (rev 105294)
@@ -0,0 +1 @@
+document.write("PASS");
Property changes on: trunk/LayoutTests/fast/url/resources/pass.js
___________________________________________________________________
Added: svn:mime-type
Added: svn:eol-style
Modified: trunk/LayoutTests/http/tests/misc/drag-over-iframe-invalid-source-crash-expected.txt (105293 => 105294)
--- trunk/LayoutTests/http/tests/misc/drag-over-iframe-invalid-source-crash-expected.txt 2012-01-18 18:41:13 UTC (rev 105293)
+++ trunk/LayoutTests/http/tests/misc/drag-over-iframe-invalid-source-crash-expected.txt 2012-01-18 18:41:43 UTC (rev 105294)
@@ -1,4 +1,4 @@
-CONSOLE MESSAGE: Not allowed to load local resource: file:
+CONSOLE MESSAGE: Not allowed to load local resource: /
This page tests that we don't crash if we drag something to an iframe that has an invalid source.
Modified: trunk/LayoutTests/http/tests/misc/iframe-invalid-source-crash-expected.txt (105293 => 105294)
--- trunk/LayoutTests/http/tests/misc/iframe-invalid-source-crash-expected.txt 2012-01-18 18:41:13 UTC (rev 105293)
+++ trunk/LayoutTests/http/tests/misc/iframe-invalid-source-crash-expected.txt 2012-01-18 18:41:43 UTC (rev 105294)
@@ -1,3 +1,3 @@
-CONSOLE MESSAGE: Not allowed to load local resource: file:
+CONSOLE MESSAGE: Not allowed to load local resource: /
This tests that we don't crash if an iframe has an invalid source.
SUCCESS - didn't crash
Modified: trunk/Source/WebCore/ChangeLog (105293 => 105294)
--- trunk/Source/WebCore/ChangeLog 2012-01-18 18:41:13 UTC (rev 105293)
+++ trunk/Source/WebCore/ChangeLog 2012-01-18 18:41:43 UTC (rev 105294)
@@ -1,3 +1,14 @@
+2012-01-17 Alexey Proskuryakov <a...@apple.com>
+
+ file:// doesn't work as base URL
+ https://bugs.webkit.org/show_bug.cgi?id=76496
+
+ Reviewed by Darin Adler.
+
+ Test: fast/url/degenerate-file-base.html
+
+ * platform/KURL.cpp: (WebCore::KURL::parse): Handle degenerate file URLs properly.
+
2012-01-18 Ilya Tikhonovsky <loi...@chromium.org>
[chromium] Web Inspector: highlight DOM nodes from detached DOM trees.
Modified: trunk/Source/WebCore/platform/KURL.cpp (105293 => 105294)
--- trunk/Source/WebCore/platform/KURL.cpp 2012-01-18 18:41:13 UTC (rev 105293)
+++ trunk/Source/WebCore/platform/KURL.cpp 2012-01-18 18:41:43 UTC (rev 105294)
@@ -1324,7 +1324,7 @@
&& isLetterMatchIgnoringCase(url[userStart+8], 't');
// File URLs need a host part unless it is just file:// or file://localhost
- bool degenFilePath = pathStart == pathEnd && (hostStart == hostEnd || hostIsLocalHost);
+ bool degenerateFilePath = pathStart == pathEnd && (hostStart == hostEnd || hostIsLocalHost);
bool haveNonHostAuthorityPart = userStart != userEnd || passwordStart != passwordEnd || portStart != portEnd;
@@ -1332,7 +1332,7 @@
*p++ = ':';
// if we have at least one authority part or a file URL - add "//" and authority
- if (isFile ? !degenFilePath : (haveNonHostAuthorityPart || hostStart != hostEnd)) {
+ if (isFile ? !degenerateFilePath : (haveNonHostAuthorityPart || hostStart != hostEnd)) {
*p++ = '/';
*p++ = '/';
@@ -1385,12 +1385,18 @@
}
}
m_portEnd = p - buffer.data();
- } else
+ } else {
+ if (isFile) {
+ ASSERT(degenerateFilePath);
+ *p++ = '/';
+ *p++ = '/';
+ }
m_userStart = m_userEnd = m_passwordEnd = m_hostEnd = m_portEnd = p - buffer.data();
+ }
// For canonicalization, ensure we have a '/' for no path.
- // Do this only for URL with protocol http or https.
- if (m_protocolIsInHTTPFamily && pathEnd == pathStart)
+ // Do this only for URL with protocol file, http or https.
+ if ((m_protocolIsInHTTPFamily || isFile) && pathEnd == pathStart)
*p++ = '/';
// add path, escaping bad characters