+2012-01-17 Alexey Proskuryakov <ap@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 <ossy@webkit.org>
[Qt] fontCache related assertion revealed by r105143
--- /dev/null
+Base URL: file:///
+Should say PASS: PASS
--- /dev/null
+<base href="file://">
+<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='" + directoryPart + "resources/pass.js'></scri" + "pt>");
+</script>
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
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.
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
--- /dev/null
+document.write("PASS");
-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.
-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
+2012-01-17 Alexey Proskuryakov <ap@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 <loislo@chromium.org>
[chromium] Web Inspector: highlight DOM nodes from detached DOM trees.
&& 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;
*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++ = '/';
}
}
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