Reviewed by Alexey.
authoreric@webkit.org <eric@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 1 Jan 2008 10:40:57 +0000 (10:40 +0000)
committereric@webkit.org <eric@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 1 Jan 2008 10:40:57 +0000 (10:40 +0000)
        Don't replace \ with / in data: urls
        http://bugs.webkit.org/show_bug.cgi?id=16692

        Test: fast/loader/url-data-replace-backslash.html

        * platform/KURL.cpp:
        (WebCore::KURL::init):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@29061 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/fast/loader/url-data-replace-backslash-expected.txt [new file with mode: 0644]
LayoutTests/fast/loader/url-data-replace-backslash.html [new file with mode: 0644]
WebCore/ChangeLog
WebCore/platform/KURL.cpp

index c446ab2806bdb0cf6c0bebbed5d701c175d2b3e3..661bfa502bfb87bb2f4ef7e7059dc8f86c992a1e 100644 (file)
@@ -1,3 +1,13 @@
+2008-01-01  Eric Seidel  <eric@webkit.org>
+
+        Reviewed by Alexey.
+        
+        Don't replace \ with / in data: urls
+        http://bugs.webkit.org/show_bug.cgi?id=16692
+
+        * fast/loader/url-data-replace-backslash-expected.txt: Added.
+        * fast/loader/url-data-replace-backslash.html: Added.
+
 2007-12-31  Sam Weinig  <sam@webkit.org>
 
         Reviewed by Darin.
diff --git a/LayoutTests/fast/loader/url-data-replace-backslash-expected.txt b/LayoutTests/fast/loader/url-data-replace-backslash-expected.txt
new file mode 100644 (file)
index 0000000..7ef22e9
--- /dev/null
@@ -0,0 +1 @@
+PASS
diff --git a/LayoutTests/fast/loader/url-data-replace-backslash.html b/LayoutTests/fast/loader/url-data-replace-backslash.html
new file mode 100644 (file)
index 0000000..85e2669
--- /dev/null
@@ -0,0 +1,13 @@
+<script>
+var d5 = "fail";
+</script>
+<script type="text/javascript" src="data:text/javascript,d5%20%3D%20'five\u0027s'%3B"></script>
+<script>
+if (window.layoutTestController)
+  layoutTestController.dumpAsText();
+if (d5 == "five's") {
+  document.write("PASS");
+} else {
+  document.write("FAIL: d5 was: " + d5 + " should have been : five's");
+}
+</script>
index fd609663159df9f6b4d1f8dc0b3b045c13b46285..9851d28a3b3a00512635c9019a81108aaf121209 100644 (file)
@@ -1,3 +1,15 @@
+2008-01-01  Eric Seidel  <eric@webkit.org>
+
+        Reviewed by Alexey.
+
+        Don't replace \ with / in data: urls
+        http://bugs.webkit.org/show_bug.cgi?id=16692
+
+        Test: fast/loader/url-data-replace-backslash.html
+
+        * platform/KURL.cpp:
+        (WebCore::KURL::init):
+
 2008-01-01  Alp Toker  <alp@atoker.com>
 
         GTK+ autotools build fix. Track changes in r29051, r29058 and pass the
index 0a13c9161920d7e36c2c937e0f88de83571375d3..8498bbafed52ed0e8ca2b7448da314adbb809f74 100644 (file)
@@ -285,10 +285,9 @@ void KURL::init(const KURL &base, const DeprecatedString &relative, const TextEn
 
     // for compatibility with Win IE, we must treat backslashes as if they were slashes, as long as we're not dealing with the javascript: schema
     DeprecatedString substitutedRelative;
-    bool shouldSubstituteBackslashes = relative.contains('\\') && !relative.startsWith("javascript:", false);
-    if (shouldSubstituteBackslashes) {
+    bool shouldSubstituteBackslashes = relative.contains('\\') && !(relative.startsWith("javascript:", false) || relative.startsWith("data:", false));
+    if (shouldSubstituteBackslashes)
         substitutedRelative = substituteBackslashes(relative);
-    }
 
     const DeprecatedString &rel = shouldSubstituteBackslashes ? substitutedRelative : relative;