Remove workarounds for <rdar://problem/5386894> now that it's been fixed
authoraroben <aroben@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 20 Aug 2007 23:04:45 +0000 (23:04 +0000)
committeraroben <aroben@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 20 Aug 2007 23:04:45 +0000 (23:04 +0000)
WebCore:

        Remove workarounds for <rdar://problem/5386894> now that it's been fixed

        Reviewed by Darin.

        Tests: fast/loader/local-svg-parsed-as-svg.svg
               fast/loader/local-xhtml-parsed-as-xhtml.xhtml

        * platform/network/cf/ResourceResponseCFNet.cpp:
        (WebCore::ResourceResponse::doUpdateResourceResponse): Removed hackish
        workaround.

LayoutTests:

        Tests to ensure that local .xhtml and .svg files end up being parsed as XHTML and SVG, respectively

        Reviewed by Darin.

        * fast/loader/local-svg-parsed-as-svg-expected.txt: Added.
        * fast/loader/local-svg-parsed-as-svg.svg: Added.
        * fast/loader/local-xhtml-parsed-as-xhtml-expected.txt: Added.
        * fast/loader/local-xhtml-parsed-as-xhtml.xhtml: Added.

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

LayoutTests/ChangeLog
LayoutTests/fast/loader/local-svg-parsed-as-svg-expected.txt [new file with mode: 0644]
LayoutTests/fast/loader/local-svg-parsed-as-svg.svg [new file with mode: 0644]
LayoutTests/fast/loader/local-xhtml-parsed-as-xhtml-expected.txt [new file with mode: 0644]
LayoutTests/fast/loader/local-xhtml-parsed-as-xhtml.xhtml [new file with mode: 0644]
WebCore/ChangeLog
WebCore/platform/network/cf/ResourceResponseCFNet.cpp

index 316d6d9b7c78138980dd04b47077157a82e36028..7a3ddced4fcee72d2c411ff679ebaf5a1b2150bb 100644 (file)
@@ -1,3 +1,14 @@
+2007-08-20  Adam Roben  <aroben@apple.com>
+
+        Tests to ensure that local .xhtml and .svg files end up being parsed as XHTML and SVG, respectively
+
+        Reviewed by Darin.
+
+        * fast/loader/local-svg-parsed-as-svg-expected.txt: Added.
+        * fast/loader/local-svg-parsed-as-svg.svg: Added.
+        * fast/loader/local-xhtml-parsed-as-xhtml-expected.txt: Added.
+        * fast/loader/local-xhtml-parsed-as-xhtml.xhtml: Added.
+
 2007-08-16  Kevin McCullough  <kmccullough@apple.com>
 
         Reviewed by Geoff and Adam.
diff --git a/LayoutTests/fast/loader/local-svg-parsed-as-svg-expected.txt b/LayoutTests/fast/loader/local-svg-parsed-as-svg-expected.txt
new file mode 100644 (file)
index 0000000..3b652e7
--- /dev/null
@@ -0,0 +1,2 @@
+ALERT: PASS: File parsed as SVG
+
diff --git a/LayoutTests/fast/loader/local-svg-parsed-as-svg.svg b/LayoutTests/fast/loader/local-svg-parsed-as-svg.svg
new file mode 100644 (file)
index 0000000..ae784db
--- /dev/null
@@ -0,0 +1,8 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+    <script>
+        if (window.layoutTestController)
+           layoutTestController.dumpAsText();
+        var tagName = document.documentElement.tagName;
+        alert(tagName == "svg" ? "PASS: File parsed as SVG" : "FAIL: document.documentElement.tagName was '" + tagName + "', expected 'svg'");
+    </script>
+</svg>
diff --git a/LayoutTests/fast/loader/local-xhtml-parsed-as-xhtml-expected.txt b/LayoutTests/fast/loader/local-xhtml-parsed-as-xhtml-expected.txt
new file mode 100644 (file)
index 0000000..0daf2f2
--- /dev/null
@@ -0,0 +1,2 @@
+PASS: File parsed as XHTML
+
diff --git a/LayoutTests/fast/loader/local-xhtml-parsed-as-xhtml.xhtml b/LayoutTests/fast/loader/local-xhtml-parsed-as-xhtml.xhtml
new file mode 100644 (file)
index 0000000..60f7964
--- /dev/null
@@ -0,0 +1,21 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+    <script>
+        function log(msg)
+        {
+            document.getElementById('console').appendChild(document.createTextNode(msg + '\n'));
+        }
+
+        window.onload = function()
+        {
+            if (window.layoutTestController)
+                layoutTestController.dumpAsText();
+            var tagName = document.createElement('html').tagName;
+            log(tagName == "html" ? "PASS: File parsed as XHTML" : "FAIL: document.createElement('html').tagName was '" + tagName + "', expected 'html'");
+        }
+    </script>
+</head>
+<body>
+    <pre id='console'></pre>
+</body>
+</html>
index 3023b70504ce5d2ab30d378262102e044138585f..1173fe38330d3a450988c4db6b2a454d42735ef2 100644 (file)
@@ -1,3 +1,16 @@
+2007-08-20  Adam Roben  <aroben@apple.com>
+
+        Remove workarounds for <rdar://problem/5386894> now that it's been fixed
+
+        Reviewed by Darin.
+
+        Tests: fast/loader/local-svg-parsed-as-svg.svg
+               fast/loader/local-xhtml-parsed-as-xhtml.xhtml
+
+        * platform/network/cf/ResourceResponseCFNet.cpp:
+        (WebCore::ResourceResponse::doUpdateResourceResponse): Removed hackish
+        workaround.
+
 2007-08-20  Anders Carlsson  <andersca@apple.com>
 
         Reviewed by Adam.
index c462fc76de263475de0109bc2a269ef9fdd7d892..9fe10d4e47908e067245023bcbb09c847e849d52 100644 (file)
@@ -117,21 +117,6 @@ void ResourceResponse::doUpdateResourceResponse()
         m_httpStatusCode = 0;
 
     m_suggestedFilename = suggestedFilenameForResponse(m_cfResponse.get(), m_httpHeaderFields);
-
-    // FIXME: This is a workaround for <rdar://problem/5386894> CFURLResponseGetMIMEType returns
-    // text/html for local .xhtml and .xml files. This code should be removed once that bug is fixed.
-    if (m_url.isLocalFile() && m_mimeType == "text/html") {
-        const String& path = m_url.path();
-        static const String xhtmlExt(".xhtml");
-        static const String xmlExt(".xml");
-        static const String svgExt(".svg");
-        if (path.endsWith(xhtmlExt, false))
-            m_mimeType = "application/xhtml+xml";
-        else if (path.endsWith(xmlExt, false))
-            m_mimeType = "text/xml";
-        else if (path.endsWith(svgExt, false))
-            m_mimeType = "image/svg+xml";
-    }
 }
 
 }