[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677

mjs mjs at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 08:18:26 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit 4f7a16c7c26800334eb9b30cb685dfc0774dec5b
Author: mjs <mjs at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Dec 11 23:50:09 2003 +0000

            Reviewed by John.
    
    	<rdar://problem/3507862>: XMLHttpRequest documents that reference external resources (e.g. stylesheets) cause crash
    
            * khtml/html/html_headimpl.cpp:
            (HTMLLinkElementImpl::process):
            * khtml/html/htmltokenizer.cpp:
            (HTMLTokenizer::scriptHandler):
            * khtml/xml/dom_xmlimpl.cpp:
            (ProcessingInstructionImpl::checkStyleSheet):
            * khtml/xml/xml_tokenizer.cpp:
            (XMLHandler::processingInstruction):
            (XMLTokenizer::executeScripts):
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@5772 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index b80379e..3f1bd6d 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,5 +1,21 @@
 2003-12-11  Maciej Stachowiak  <mjs at apple.com>
 
+        Reviewed by John.
+
+	<rdar://problem/3507862>: XMLHttpRequest documents that reference external resources (e.g. stylesheets) cause crash
+
+        * khtml/html/html_headimpl.cpp:
+        (HTMLLinkElementImpl::process):
+        * khtml/html/htmltokenizer.cpp:
+        (HTMLTokenizer::scriptHandler):
+        * khtml/xml/dom_xmlimpl.cpp:
+        (ProcessingInstructionImpl::checkStyleSheet):
+        * khtml/xml/xml_tokenizer.cpp:
+        (XMLHandler::processingInstruction):
+        (XMLTokenizer::executeScripts):
+
+2003-12-11  Maciej Stachowiak  <mjs at apple.com>
+
         Reviewed by Chris.
 
 	<rdar://problem/3507859>: Status text should only include "OK", not full "HTTP/1.0 200 OK" status line
diff --git a/WebCore/khtml/html/html_headimpl.cpp b/WebCore/khtml/html/html_headimpl.cpp
index e87d107..7009e3f 100644
--- a/WebCore/khtml/html/html_headimpl.cpp
+++ b/WebCore/khtml/html/html_headimpl.cpp
@@ -220,9 +220,10 @@ void HTMLLinkElementImpl::process()
 
     // Stylesheet
     // This was buggy and would incorrectly match <link rel="alternate">, which has a different specified meaning. -dwh
-    if(m_disabledState != 2 && (type.contains("text/css") || rel == "stylesheet" || (rel.contains("alternate") && rel.contains("stylesheet")))) {
+    if(m_disabledState != 2 && (type.contains("text/css") || rel == "stylesheet" || (rel.contains("alternate") && rel.contains("stylesheet"))) && getDocument()->part()) {
         // no need to load style sheets which aren't for the screen output
         // ### there may be in some situations e.g. for an editor or script to manipulate
+	// also, don't load style sheets for standalone documents
         if( m_media.isNull() || m_media.contains("screen") || m_media.contains("all") || m_media.contains("print") ) {
             m_loading = true;
 
diff --git a/WebCore/khtml/html/htmltokenizer.cpp b/WebCore/khtml/html/htmltokenizer.cpp
index 7ce3c98..9c222d4 100644
--- a/WebCore/khtml/html/htmltokenizer.cpp
+++ b/WebCore/khtml/html/htmltokenizer.cpp
@@ -466,7 +466,8 @@ void HTMLTokenizer::scriptHandler()
     // We are inside a <script>
     bool doScriptExec = false;
     CachedScript* cs = 0;
-    if (!scriptSrc.isEmpty()) {
+    // don't load external scripts for standalone documents (for now)
+    if (!scriptSrc.isEmpty() && parser->doc()->part()) {
         // forget what we just got; load from src url instead
         if ( !parser->skipMode() ) {
             if ( (cs = parser->doc()->docLoader()->requestScript(scriptSrc, scriptSrcCharset) ))
diff --git a/WebCore/khtml/xml/dom_xmlimpl.cpp b/WebCore/khtml/xml/dom_xmlimpl.cpp
index ab87cec..44e8a9e 100644
--- a/WebCore/khtml/xml/dom_xmlimpl.cpp
+++ b/WebCore/khtml/xml/dom_xmlimpl.cpp
@@ -420,12 +420,14 @@ void ProcessingInstructionImpl::checkStyleSheet()
             {
                 // ### some validation on the URL?
                 // ### FIXME charset
-                m_loading = true;
-                getDocument()->addPendingSheet();
-                if (m_cachedSheet) m_cachedSheet->deref(this);
-                m_cachedSheet = getDocument()->docLoader()->requestStyleSheet(getDocument()->completeURL(href.string()), QString::null);
-                if (m_cachedSheet)
-                    m_cachedSheet->ref( this );
+		if (getDocument()->part()) {
+		    m_loading = true;
+		    getDocument()->addPendingSheet();
+		    if (m_cachedSheet) m_cachedSheet->deref(this);
+		    m_cachedSheet = getDocument()->docLoader()->requestStyleSheet(getDocument()->completeURL(href.string()), QString::null);
+		    if (m_cachedSheet)
+			m_cachedSheet->ref( this );
+		}
             }
 
         }
diff --git a/WebCore/khtml/xml/xml_tokenizer.cpp b/WebCore/khtml/xml/xml_tokenizer.cpp
index 7abc4ec..29a3e11 100644
--- a/WebCore/khtml/xml/xml_tokenizer.cpp
+++ b/WebCore/khtml/xml/xml_tokenizer.cpp
@@ -201,7 +201,10 @@ bool XMLHandler::processingInstruction(const QString &target, const QString &dat
     // ### handle exceptions
     ProcessingInstructionImpl *pi = m_doc->document()->createProcessingInstruction(target,data);
     m_currentNode->addChild(pi);
-    pi->checkStyleSheet();
+    // don't load stylesheets for standalone documents
+    if (m_doc->document()->part()) {
+	pi->checkStyleSheet();
+    }
     return true;
 }
 
@@ -459,7 +462,8 @@ void XMLTokenizer::executeScripts()
         DOMString scriptSrc = m_scriptsIt->current()->getAttribute(ATTR_SRC);
         QString charset = m_scriptsIt->current()->getAttribute(ATTR_CHARSET).string();
 
-        if (scriptSrc != "") {
+	// don't load external scripts for standalone documents (for now)
+        if (scriptSrc != "" && m_doc->document()->part()) {
             // we have a src attribute
             m_cachedScript = m_doc->document()->docLoader()->requestScript(scriptSrc, charset);
             ++(*m_scriptsIt);

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list