- fixed <rdar://problem/
4151619> Safari changes "\" characters to "/" in the query part of links that start with "?"
Test cases added:
* layout-tests/fast/dom/anchor-backslash-expected.txt: Added.
* layout-tests/fast/dom/anchor-backslash.html: Added.
* kwq/KWQKURL.mm: (substituteBackslashes): Fix error where we'd ignore
"?" and "#" characters if they were the first character in the string.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@9481
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
--- /dev/null
+This tests \ characters being changed to / in anchor tags.
+
+If it works you should see five messages below that have \ or / characters as specified.
+
+1 2 3 4 5
+paths like this should turn all \ characters into /: "/a/b/c/"
+query strings like this one should still have \ characters: "?path=\\a\b\c\"
+query strings like this one should still have \ characters even if the URL is only a query: "?path=\\myshare\myfolder\myfile\"
+anchor strings like this one should still have \ characters: "#path=\\a\b\c\"
+anchor strings like this one should still have \ characters even if the URL is only an anchor: "#path=\\myshare\myfolder\myfile\"
+
--- /dev/null
+<html>
+ <head>
+ <script type="text/javascript">
+ function log(message)
+ {
+ var item = document.createElement("li");
+ item.appendChild(document.createTextNode(message));
+ document.getElementById("console").appendChild(item);
+ }
+ function test()
+ {
+ if (window.layoutTestController)
+ layoutTestController.dumpAsText();
+ log("paths like this should turn all \\ characters into /: \"" + document.getElementById("1").pathname + "\"");
+ log("query strings like this one should still have \\ characters: \"" + document.getElementById("2").search + "\"");
+ log("query strings like this one should still have \\ characters even if the URL is only a query: \"" + document.getElementById("3").search + "\"");
+ log("anchor strings like this one should still have \\ characters: \"" + document.getElementById("4").hash + "\"");
+ log("anchor strings like this one should still have \\ characters even if the URL is only an anchor: \"" + document.getElementById("5").hash + "\"");
+ }
+ </script>
+ </head>
+ <body onload="test()">
+ <p>This tests \ characters being changed to / in anchor tags.</p>
+ <p>If it works you should see five messages below that have \ or / characters as specified.</p>
+ <hr>
+ <a id="1" href="file:\\\a\b\c\">1</a>
+ <a id="2" href="file:///?path=\\a\b\c\">2</a>
+ <a id="3" href="?path=\\myshare\myfolder\myfile\">3</a>
+ <a id="4" href="file:///#path=\\a\b\c\">4</a>
+ <a id="5" href="#path=\\myshare\myfolder\myfile\">5</a>
+ <hr>
+ <p><ol id="console"></ol></p>
+ </body>
+</html>
+2005-06-24 Darin Adler <darin@apple.com>
+
+ Reviewed by Justin Garcia.
+
+ - fixed <rdar://problem/4151619> Safari changes "\" characters to "/" in the query part of links that start with "?"
+
+ Test cases added:
+ * layout-tests/fast/dom/anchor-backslash-expected.txt: Added.
+ * layout-tests/fast/dom/anchor-backslash.html: Added.
+
+ * kwq/KWQKURL.mm: (substituteBackslashes): Fix error where we'd ignore
+ "?" and "#" characters if they were the first character in the string.
+
2005-06-23 Darin Adler <darin@apple.com>
* khtml/html/html_formimpl.cpp: (DOM::HTMLTextAreaElementImpl::setValue):
int hashPos = string.find('#');
unsigned pathEnd;
- if (hashPos > 0 && (questionPos < 0 || questionPos > hashPos)) {
+ if (hashPos >= 0 && (questionPos < 0 || questionPos > hashPos)) {
pathEnd = hashPos;
- } else if (questionPos > 0) {
+ } else if (questionPos >= 0) {
pathEnd = questionPos;
} else {
pathEnd = string.length();