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
+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.
--- /dev/null
+ALERT: PASS: File parsed as SVG
+
--- /dev/null
+<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>
--- /dev/null
+PASS: File parsed as XHTML
+
--- /dev/null
+<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>
+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.
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";
- }
}
}