[webkit-changes] [14103] branches/Safari-2-0-branch/WebCore

Eric Seidel eseidel at apple.com
Fri Apr 28 12:43:57 PDT 2006


TOT doesn't use the isXMLMIMEType for XSL, although it could be  
changed to.

-eric

On Apr 28, 2006, at 11:24 AM, thatcher at opensource.apple.com wrote:

> Revision
> 14103
> Author
> thatcher
> Date
> 2006-04-28 11:24:26 -0700 (Fri, 28 Apr 2006)
> Log Message
>
>         Merged fix from TOT to Safari-2-0-branch
>
>     2006-04-27  Eric Seidel
>
>         Reviewed by andersca.
>
>         Make WebCore accept any */*+xml type as XML.
>         http://bugzilla.opendarwin.org/show_bug.cgi?id=5998
>          XmlHttpRequest doesn't allow responses with Content-Type:  
> application/soap+xml
>
>         Test: http/tests/xmlhttprequest/supported-xml-content- 
> types.html
>
>         * dom/DOMImplementation.cpp:
>         (WebCore::DOMImplementation::isXMLMIMEType):
> Modified Paths
>
> branches/Safari-2-0-branch/WebCore/ChangeLog
> branches/Safari-2-0-branch/WebCore/khtml/ecma/domparser.cpp
> branches/Safari-2-0-branch/WebCore/khtml/ecma/xmlhttprequest.cpp
> branches/Safari-2-0-branch/WebCore/khtml/misc/loader.cpp
> branches/Safari-2-0-branch/WebCore/khtml/misc/loader.h
> branches/Safari-2-0-branch/WebCore/khtml/xml/dom_xmlimpl.cpp
> Property Changed
>
> branches/Safari-2-0-branch/WebCore/khtml/ecma/domparser.cpp
> branches/Safari-2-0-branch/WebCore/khtml/misc/loader.cpp
> branches/Safari-2-0-branch/WebCore/khtml/misc/loader.h
> branches/Safari-2-0-branch/WebCore/khtml/xml/dom_xmlimpl.cpp
> Diff
>
> Modified: branches/Safari-2-0-branch/WebCore/ChangeLog (14102 =>  
> 14103)
>
> --- branches/Safari-2-0-branch/WebCore/ChangeLog	2006-04-28  
> 17:05:49 UTC (rev 14102)
> +++ branches/Safari-2-0-branch/WebCore/ChangeLog	2006-04-28  
> 18:24:26 UTC (rev 14103)
> @@ -1,3 +1,20 @@
> +2006-04-28  Timothy Hatcher  <timothy at apple.com>
> +
> +        Merged fix from TOT to Safari-2-0-branch
> +
> +    2006-04-27  Eric Seidel  <eseidel at apple.com>
> +
> +        Reviewed by andersca.
> +
> +        Make WebCore accept any */*+xml type as XML.
> +        http://bugzilla.opendarwin.org/show_bug.cgi?id=5998
> +        <rdar://problem/4031511> XmlHttpRequest doesn't allow  
> responses with Content-Type: application/soap+xml
> +
> +        Test: http/tests/xmlhttprequest/supported-xml-content- 
> types.html
> +
> +        * dom/DOMImplementation.cpp:
> +        (WebCore::DOMImplementation::isXMLMIMEType):
> +
>  2006-04-27  Timothy Hatcher  <timothy at apple.com>
>
>          Merged fix from TOT to Safari-2-0-branch
> Modified: branches/Safari-2-0-branch/WebCore/khtml/ecma/ 
> domparser.cpp (14102 => 14103)
>
> --- branches/Safari-2-0-branch/WebCore/khtml/ecma/domparser.cpp	 
> 2006-04-28 17:05:49 UTC (rev 14102)
> +++ branches/Safari-2-0-branch/WebCore/khtml/ecma/domparser.cpp	 
> 2006-04-28 18:24:26 UTC (rev 14103)
> @@ -22,6 +22,7 @@
>  #include "domparser.lut.h"
>
>  #include "html/html_documentimpl.h"
> +#include "misc/loader.h"
>
>  using DOM::DocumentImpl;
>
> @@ -89,7 +90,7 @@
>        QString str = args[0].toString(exec).qstring();
>        QString contentType = args[1].toString(exec).qstring 
> ().stripWhiteSpace();
>
> -      if (contentType == "text/xml" || contentType == "application/ 
> xml" || contentType == "application/xhtml+xml") {
> +      if (khtml::isXMLMIMEType(contentType)) {
>          DocumentImpl *docImpl = parser->doc->implementation()- 
> >createDocument();
>
>          docImpl->open();
> Property changes on: branches/Safari-2-0-branch/WebCore/khtml/ecma/ 
> domparser.cpp
> ___________________________________________________________________
> Name: allow-tabs
>    + 1
> Modified: branches/Safari-2-0-branch/WebCore/khtml/ecma/ 
> xmlhttprequest.cpp (14102 => 14103)
>
> --- branches/Safari-2-0-branch/WebCore/khtml/ecma/ 
> xmlhttprequest.cpp	2006-04-28 17:05:49 UTC (rev 14102)
> +++ branches/Safari-2-0-branch/WebCore/khtml/ecma/ 
> xmlhttprequest.cpp	2006-04-28 18:24:26 UTC (rev 14103)
> @@ -150,8 +150,7 @@
>          mimeType = MIMETypeOverride;
>        }
>
> -      if (mimeType == "text/xml" || mimeType == "application/xml"  
> || mimeType == "application/xhtml+xml" ||
> -          mimeType == "text/xsl" || mimeType == "application/rss 
> +xml" || mimeType == "application/atom+xml") {
> +      if (khtml::isXMLMIMEType(mimeType)) {
>  	responseXML = DOM::Document(doc->implementation()->createDocument 
> ());
>
>  	DOM::DocumentImpl *docImpl = static_cast<DOM::DocumentImpl *> 
> (responseXML.handle());
> Modified: branches/Safari-2-0-branch/WebCore/khtml/misc/loader.cpp  
> (14102 => 14103)
>
> --- branches/Safari-2-0-branch/WebCore/khtml/misc/loader.cpp	 
> 2006-04-28 17:05:49 UTC (rev 14102)
> +++ branches/Safari-2-0-branch/WebCore/khtml/misc/loader.cpp	 
> 2006-04-28 18:24:26 UTC (rev 14103)
> @@ -64,6 +64,7 @@
>  #if APPLE_CHANGES
>  #include "KWQAssertions.h"
>  #include "KWQLoader.h"
> +#include "KWQRegExp.h"
>  #endif
>
>  using namespace khtml;
> @@ -73,6 +74,17 @@
>  static bool cacheDisabled;
>  #endif
>
> +bool khtml::isXMLMIMEType(const QString& mimeType)
> +{
> +    if (mimeType == "text/xml" || mimeType == "application/xml" ||  
> mimeType == "text/xsl")
> +        return true;
> +    static const char* validChars = "[0-9a-zA-Z_\\-+~!$\\^{}|. 
> %'`#&*]"; // per RFCs: 3023, 2045
> +    static QRegExp xmlTypeRegExp(QString("^") + validChars + "+/"  
> + validChars + "+\\+xml$");
> +    if (xmlTypeRegExp.match(mimeType) > -1)
> +        return true;
> +    return false;
> +}
> +
>  // Call this "walker" instead of iterator so people won't expect  
> Qt or STL-style iterator interface.
>  // Just keep calling next() on this. It's safe from deletions of  
> the current item
>  class CachedObjectClientWalker {
> Property changes on: branches/Safari-2-0-branch/WebCore/khtml/misc/ 
> loader.cpp
> ___________________________________________________________________
> Name: allow-tabs
>    + 1
> Modified: branches/Safari-2-0-branch/WebCore/khtml/misc/loader.h  
> (14102 => 14103)
>
> --- branches/Safari-2-0-branch/WebCore/khtml/misc/loader.h	 
> 2006-04-28 17:05:49 UTC (rev 14102)
> +++ branches/Safari-2-0-branch/WebCore/khtml/misc/loader.h	 
> 2006-04-28 18:24:26 UTC (rev 14103)
> @@ -97,7 +97,9 @@
>          LRUList();
>          ~LRUList();
>      };
> -
> +
> +    bool isXMLMIMEType(const QString& mimeType);
> +
>      /**
>       * @internal
>       *
> Property changes on: branches/Safari-2-0-branch/WebCore/khtml/misc/ 
> loader.h
> ___________________________________________________________________
> Name: allow-tabs
>    + 1
> Modified: branches/Safari-2-0-branch/WebCore/khtml/xml/ 
> dom_xmlimpl.cpp (14102 => 14103)
>
> --- branches/Safari-2-0-branch/WebCore/khtml/xml/dom_xmlimpl.cpp	 
> 2006-04-28 17:05:49 UTC (rev 14102)
> +++ branches/Safari-2-0-branch/WebCore/khtml/xml/dom_xmlimpl.cpp	 
> 2006-04-28 18:24:26 UTC (rev 14103)
> @@ -419,8 +419,7 @@
>
>          bool isCSS = type.isEmpty() || type == "text/css";
>  #ifdef KHTML_XSLT
> -        m_isXSL = (type == "text/xml" || type == "text/xsl" ||  
> type == "application/xml" ||
> -                   type == "application/xhtml+xml" || type ==  
> "application/rss+xml" || type == "application/atom=xml");
> +        m_isXSL = khtml::isXMLMIMEType(type);
>          if (!isCSS && !m_isXSL)
>  #else
>          if (!isCSS)
> Property changes on: branches/Safari-2-0-branch/WebCore/khtml/xml/ 
> dom_xmlimpl.cpp
> ___________________________________________________________________
> Name: allow-tabs
>    + 1
> _______________________________________________
> webkit-changes mailing list
> webkit-changes at opendarwin.org
> http://www.opendarwin.org/mailman/listinfo/webkit-changes

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/webkit-changes/attachments/20060428/495c099d/attachment.html


More information about the webkit-changes mailing list