[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:51:51 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit 4ed3d11beea1b3c7f90778add632b242cd6894fc
Author: mjs <mjs at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Jul 20 20:45:22 2004 +0000

            Reviewed by Dave.
    
    	<rdar://problem/3720111> REGRESSION(125-152): map fails to load depending on banner ad; weather.com (works in IE and Firefox)
    
            * khtml/html/htmltokenizer.cpp:
            (khtml::HTMLTokenizer::begin): Initialize currentPrependingSrc.
            (khtml::HTMLTokenizer::scriptHandler): Store a pointer to the currently
    	active prependingSrc variable on the stack, the better to handle weird cases
    	of scripts writing out additional script tags and so forth.
            (khtml::HTMLTokenizer::write): Deal with the above.
            * khtml/html/htmltokenizer.h: Declare new member field.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@7068 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index 114520d..8bcdfaa 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,17 @@
+2004-07-20  Maciej Stachowiak  <mjs at apple.com>
+
+        Reviewed by Dave.
+
+	<rdar://problem/3720111> REGRESSION(125-152): map fails to load depending on banner ad; weather.com (works in IE and Firefox)
+	
+        * khtml/html/htmltokenizer.cpp:
+        (khtml::HTMLTokenizer::begin): Initialize currentPrependingSrc.
+        (khtml::HTMLTokenizer::scriptHandler): Store a pointer to the currently
+	active prependingSrc variable on the stack, the better to handle weird cases
+	of scripts writing out additional script tags and so forth.
+        (khtml::HTMLTokenizer::write): Deal with the above.
+        * khtml/html/htmltokenizer.h: Declare new member field.
+
 2004-07-20  David Hyatt  <hyatt at apple.com>
 
 	Fix for layer positioning error that occurs when absolute positioned blocks are inside static positioned overflow:auto
diff --git a/WebCore/khtml/html/htmltokenizer.cpp b/WebCore/khtml/html/htmltokenizer.cpp
index 3c280f0..6b49573 100644
--- a/WebCore/khtml/html/htmltokenizer.cpp
+++ b/WebCore/khtml/html/htmltokenizer.cpp
@@ -315,6 +315,7 @@ void HTMLTokenizer::begin()
     loadingExtScript = false;
     scriptSrc = QString::null;
     pendingSrc.clear();
+    currentPrependingSrc = 0;
     noMoreData = false;
     brokenComments = false;
     brokenServer = false;
@@ -500,13 +501,19 @@ void HTMLTokenizer::scriptHandler()
     currToken.id = ID_SCRIPT + ID_CLOSE_TAG;
     processToken();
 
+    TokenizerString *savedPrependingSrc = currentPrependingSrc;
     TokenizerString prependingSrc;
+    currentPrependingSrc = &prependingSrc;
     if ( !parser->skipMode() ) {
         if (cs) {
              //kdDebug( 6036 ) << "cachedscript extern!" << endl;
              //kdDebug( 6036 ) << "src: *" << QString( src.current(), src.length() ).latin1() << "*" << endl;
              //kdDebug( 6036 ) << "pending: *" << pendingSrc.latin1() << "*" << endl;
-            pendingSrc.prepend(src);
+	    if (savedPrependingSrc) {
+		savedPrependingSrc->append(src);
+	    } else {
+		pendingSrc.prepend(src);
+	    }
             setSrc(TokenizerString());
             scriptCodeSize = scriptCodeResync = 0;
             cs->ref(this);
@@ -535,8 +542,26 @@ void HTMLTokenizer::scriptHandler()
 	// kdDebug( 6036 ) << "adding pending Output to parsed string" << endl;
 	src.append(pendingSrc);
 	pendingSrc.clear();
-    } else if (!prependingSrc.isEmpty())
-        write(prependingSrc, false);
+    } else if (!prependingSrc.isEmpty()) {
+	// restore first so that the write appends in the right place
+	// (does not hurt to do it again below)
+	currentPrependingSrc = savedPrependingSrc;
+
+	// we need to do this slightly modified bit of one of the write() cases
+	// because we want to prepend to pendingSrc rather than appending
+	// if there's no previous prependingSrc
+	if (loadingExtScript) {
+	    if (currentPrependingSrc) {
+		currentPrependingSrc->append(prependingSrc);
+	    } else {
+		pendingSrc.prepend(prependingSrc);
+	    }
+	} else {
+	    write(prependingSrc, false);
+	}
+    }
+
+    currentPrependingSrc = savedPrependingSrc;
 }
 
 void HTMLTokenizer::scriptExecution( const QString& str, QString scriptURL,
@@ -1403,10 +1428,14 @@ void HTMLTokenizer::write(const TokenizerString &str, bool appendData)
     if ( !buffer )
         return;
 
-    if ( ( m_executingScript && appendData ) ||
-         ( !m_executingScript && loadingExtScript ) ) {
+    if ( ( m_executingScript && appendData ) || 
+	 loadingExtScript) {
         // don't parse; we will do this later
-        pendingSrc.append(str);
+	if (currentPrependingSrc) {
+	    currentPrependingSrc->append(str);
+	} else {
+	    pendingSrc.append(str);
+	}
         return;
     }
 
diff --git a/WebCore/khtml/html/htmltokenizer.h b/WebCore/khtml/html/htmltokenizer.h
index 625d5c5..c68479a 100644
--- a/WebCore/khtml/html/htmltokenizer.h
+++ b/WebCore/khtml/html/htmltokenizer.h
@@ -322,6 +322,11 @@ protected:
     bool javascript;
     // the HTML code we will parse after the external script we are waiting for has loaded
     TokenizerString pendingSrc;
+
+    // the HTML code we will parse after this particular script has
+    // loaded, but before all pending HTML
+    TokenizerString *currentPrependingSrc;
+
     // true if we are executing a script while parsing a document. This causes the parsing of
     // the output of the script to be postponed until after the script has finished executing
     int m_executingScript;

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list