[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:13:02 UTC 2009
The following commit has been merged in the debian/unstable branch:
commit 9d0f55fe5b0252c46533380348f733b5be634669
Author: mjs <mjs at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Mon Nov 17 23:27:42 2003 +0000
Reviewed by Darin.
- fixed 3382829 - Safari won't load script src javascript if done by a document.write followed by document.close
* khtml/xml/dom_docimpl.cpp:
(DocumentImpl::closeInternal): Don't delete the tokenizer if it's
waiting for scripts. It will get destroyed later when the part
gets all subresources and closes the document.
* khtml/html/htmltokenizer.cpp:
(HTMLTokenizer::isWaitingForScripts): Added.
* khtml/html/htmltokenizer.h: Prototyped.
* khtml/xml/xml_tokenizer.cpp:
(XMLTokenizer::isWaitingForScripts): Added.
* khtml/xml/xml_tokenizer.h: Prototyped.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@5546 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index 7a92b6f..6649ce7 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,20 @@
+2003-11-17 Maciej Stachowiak <mjs at apple.com>
+
+ Reviewed by Darin.
+
+ - fixed 3382829 - Safari won't load script src javascript if done by a document.write followed by document.close
+
+ * khtml/xml/dom_docimpl.cpp:
+ (DocumentImpl::closeInternal): Don't delete the tokenizer if it's
+ waiting for scripts. It will get destroyed later when the part
+ gets all subresources and closes the document.
+ * khtml/html/htmltokenizer.cpp:
+ (HTMLTokenizer::isWaitingForScripts): Added.
+ * khtml/html/htmltokenizer.h: Prototyped.
+ * khtml/xml/xml_tokenizer.cpp:
+ (XMLTokenizer::isWaitingForScripts): Added.
+ * khtml/xml/xml_tokenizer.h: Prototyped.
+
2003-11-17 David Hyatt <hyatt at apple.com>
Fix for 3480108, crash because of the wrong malformedTableParent when stray content is placed inside
diff --git a/WebCore/khtml/html/htmltokenizer.cpp b/WebCore/khtml/html/htmltokenizer.cpp
index 02698d1..fdcd301 100644
--- a/WebCore/khtml/html/htmltokenizer.cpp
+++ b/WebCore/khtml/html/htmltokenizer.cpp
@@ -1834,6 +1834,11 @@ void HTMLTokenizer::notifyFinished(CachedObject */*finishedObj*/)
}
}
+bool HTMLTokenizer::isWaitingForScripts()
+{
+ return loadingExtScript;
+}
+
void HTMLTokenizer::setSrc(const QString &source)
{
lineno += src.lineCount();
diff --git a/WebCore/khtml/html/htmltokenizer.h b/WebCore/khtml/html/htmltokenizer.h
index e3a16ad..49e2d4e 100644
--- a/WebCore/khtml/html/htmltokenizer.h
+++ b/WebCore/khtml/html/htmltokenizer.h
@@ -175,6 +175,8 @@ protected:
// from CachedObjectClient
void notifyFinished(khtml::CachedObject *finishedObj);
+
+ virtual bool isWaitingForScripts();
protected:
// Internal buffers
///////////////////
diff --git a/WebCore/khtml/xml/dom_docimpl.cpp b/WebCore/khtml/xml/dom_docimpl.cpp
index f85d81a..6ce0082 100644
--- a/WebCore/khtml/xml/dom_docimpl.cpp
+++ b/WebCore/khtml/xml/dom_docimpl.cpp
@@ -1206,8 +1206,13 @@ void DocumentImpl::closeInternal( bool checkTokenizer )
if ( m_render )
m_render->close();
- delete m_tokenizer;
- m_tokenizer = 0;
+ // on an explicit document.close(), the tokenizer might still be waiting on scripts,
+ // and in that case we don't want to destroy it because that will prevent the
+ // scripts from getting processed.
+ if (m_tokenizer && !m_tokenizer->isWaitingForScripts()) {
+ delete m_tokenizer;
+ m_tokenizer = 0;
+ }
if (m_view)
m_view->part()->checkEmitLoadEvent();
diff --git a/WebCore/khtml/xml/xml_tokenizer.cpp b/WebCore/khtml/xml/xml_tokenizer.cpp
index 2fa0e69..727b89b 100644
--- a/WebCore/khtml/xml/xml_tokenizer.cpp
+++ b/WebCore/khtml/xml/xml_tokenizer.cpp
@@ -507,5 +507,10 @@ void XMLTokenizer::notifyFinished(CachedObject *finishedObj)
}
}
+bool XMLTokenizer::isWaitingForScripts()
+{
+ return m_cachedScript != 0;
+}
+
#include "xml_tokenizer.moc"
diff --git a/WebCore/khtml/xml/xml_tokenizer.h b/WebCore/khtml/xml/xml_tokenizer.h
index 45d42bd..1d3ce8e 100644
--- a/WebCore/khtml/xml/xml_tokenizer.h
+++ b/WebCore/khtml/xml/xml_tokenizer.h
@@ -118,6 +118,7 @@ public:
virtual void end() = 0;
virtual void finish() = 0;
virtual void setOnHold(bool /*_onHold*/) {}
+ virtual bool isWaitingForScripts() = 0;
signals:
void finishedParsing();
@@ -143,6 +144,7 @@ public:
// from CachedObjectClient
void notifyFinished(khtml::CachedObject *finishedObj);
+ virtual bool isWaitingForScripts();
protected:
DOM::DocumentPtr *m_doc;
KHTMLView *m_view;
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list