Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 51672 Details for
Bug 78058
"Konqueror crash on specific javascript" patch released
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
New patch.
konqueror-javascript.crash.patch (text/plain), 6.44 KB, created by
Peter Volkov (RETIRED)
on 2005-02-20 08:27:52 UTC
(
hide
)
Description:
New patch.
Filename:
MIME Type:
Creator:
Peter Volkov (RETIRED)
Created:
2005-02-20 08:27:52 UTC
Size:
6.44 KB
patch
obsolete
>diff -Naur kdelibs-3.3.2/khtml/html/htmltokenizer.cpp kdelibs-3.3.2.new/khtml/html/htmltokenizer.cpp >--- kdelibs-3.3.2/khtml/html/htmltokenizer.cpp 2004-11-28 20:30:53.000000000 +0300 >+++ kdelibs-3.3.2.new/khtml/html/htmltokenizer.cpp 2005-02-19 15:41:13.000000000 +0300 >@@ -133,6 +133,7 @@ > charsets = KGlobal::charsets(); > parser = new KHTMLParser(_view, _doc); > m_executingScript = 0; >+ m_autoCloseTimer = 0; > onHold = false; > > reset(); >@@ -147,6 +148,7 @@ > charsets = KGlobal::charsets(); > parser = new KHTMLParser( i, _doc ); > m_executingScript = 0; >+ m_autoCloseTimer = 0; > onHold = false; > > reset(); >@@ -170,6 +172,11 @@ > scriptCode = 0; > scriptCodeSize = scriptCodeMaxSize = scriptCodeResync = 0; > >+ if (m_autoCloseTimer) { >+ killTimer(m_autoCloseTimer); >+ m_autoCloseTimer = 0; >+ } >+ > currToken.reset(); > } > >@@ -1480,12 +1487,33 @@ > } > _src = QString::null; > >- if (noMoreData && cachedScript.isEmpty() && !m_executingScript ) >+ if (noMoreData && cachedScript.isEmpty() && !m_executingScript) > end(); // this actually causes us to be deleted > } > >+void HTMLTokenizer::timerEvent( QTimerEvent *e ) >+{ >+ if ( e->timerId() == m_autoCloseTimer && cachedScript.isEmpty() ) { >+ finish(); >+ if (!m_autoCloseTimer && parser->doc()) >+ parser->doc()->setParsing( false ); >+ } >+} >+ >+void HTMLTokenizer::setAutoClose( bool b ) { >+ killTimer( m_autoCloseTimer ); >+ m_autoCloseTimer = 0; >+ if ( b ) >+ m_autoCloseTimer = startTimer(100); >+} >+ > void HTMLTokenizer::end() > { >+ if ( m_autoCloseTimer ) { >+ killTimer( m_autoCloseTimer ); >+ m_autoCloseTimer = 0; >+ } >+ > if ( buffer == 0 ) { > emit finishedParsing(); > return; >diff -Naur kdelibs-3.3.2/khtml/html/htmltokenizer.h kdelibs-3.3.2.new/khtml/html/htmltokenizer.h >--- kdelibs-3.3.2/khtml/html/htmltokenizer.h 2004-11-28 20:30:53.000000000 +0300 >+++ kdelibs-3.3.2.new/khtml/html/htmltokenizer.h 2005-02-19 15:44:05.000000000 +0300 >@@ -130,7 +130,11 @@ > void write( const QString &str, bool appendData ); > void end(); > void finish(); >+ void timerEvent( QTimerEvent *e ); > virtual void setOnHold(bool _onHold); >+ virtual void setAutoClose(bool b=true); >+ virtual bool isWaitingForScripts() const; >+ virtual bool isExecutingScript() const; > > protected: > void reset(); >@@ -169,8 +173,6 @@ > // from CachedObjectClient > void notifyFinished(khtml::CachedObject *finishedObj); > >- virtual bool isWaitingForScripts() const; >- virtual bool isExecutingScript() const; > protected: > // Internal buffers > /////////////////// >@@ -332,6 +334,10 @@ > // line number at which the current <script> started > int scriptStartLineno; > int tagStartLineno; >+ // autoClose mode is used when the tokenizer was created by a script document.writing >+ // on an already loaded document >+ int m_autoCloseTimer; >+ > > #define CBUFLEN 20 > char cBuffer[CBUFLEN+2]; >diff -Naur kdelibs-3.3.2/khtml/khtml_part.cpp kdelibs-3.3.2.new/khtml/khtml_part.cpp >--- kdelibs-3.3.2/khtml/khtml_part.cpp 2005-02-19 15:49:56.000000000 +0300 >+++ kdelibs-3.3.2.new/khtml/khtml_part.cpp 2005-02-19 15:33:06.000000000 +0300 >@@ -1922,6 +1922,18 @@ > } > } > >+void KHTMLPart::resetFromScript() >+{ >+ closeURL(); >+ d->m_bComplete = false; >+ d->m_bLoadEventEmitted = false; >+ disconnect(d->m_doc,SIGNAL(finishedParsing()),this,SLOT(slotFinishedParsing())); >+ connect(d->m_doc,SIGNAL(finishedParsing()),this,SLOT(slotFinishedParsing())); >+ d->m_doc->setParsing(true); >+ >+ emit started( 0L ); >+} >+ > void KHTMLPart::slotFinishedParsing() > { > d->m_doc->setParsing(false); >diff -Naur kdelibs-3.3.2/khtml/khtml_part.h kdelibs-3.3.2.new/khtml/khtml_part.h >--- kdelibs-3.3.2/khtml/khtml_part.h 2005-02-19 15:49:56.000000000 +0300 >+++ kdelibs-3.3.2.new/khtml/khtml_part.h 2005-02-19 15:34:32.000000000 +0300 >@@ -1465,6 +1465,7 @@ > void setStatusBarText( const QString& text, StatusBarPriority p); > > bool restoreURL( const KURL &url ); >+ void resetFromScript(); > void emitSelectionChanged(); > // Returns whether callingHtmlPart may access this part > bool checkFrameAccess(KHTMLPart *callingHtmlPart); >diff -Naur kdelibs-3.3.2/khtml/xml/dom_docimpl.cpp kdelibs-3.3.2.new/khtml/xml/dom_docimpl.cpp >--- kdelibs-3.3.2/khtml/xml/dom_docimpl.cpp 2004-11-28 20:30:54.000000000 +0300 >+++ kdelibs-3.3.2.new/khtml/xml/dom_docimpl.cpp 2005-02-19 15:46:40.000000000 +0300 >@@ -29,6 +29,7 @@ > #include "xml/dom2_rangeimpl.h" > #include "xml/dom2_eventsimpl.h" > #include "xml/xml_tokenizer.h" >+#include "html/htmltokenizer.h" > > #include "css/csshelper.h" > #include "css/cssstyleselector.h" >@@ -1180,7 +1181,7 @@ > // 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()) { >+ if (m_tokenizer && !m_tokenizer->isWaitingForScripts() && !m_tokenizer->isExecutingScript()) { > delete m_tokenizer; > m_tokenizer = 0; > } >@@ -1198,7 +1199,10 @@ > { > if (!m_tokenizer) { > open(); >- write(QString::fromLatin1("<html><title></title><body>")); >+ if (m_view) >+ m_view->part()->resetFromScript(); >+ m_tokenizer->setAutoClose(); >+ write(QString::fromLatin1("<html>")); > } > m_tokenizer->write(text, false); > } >diff -Naur kdelibs-3.3.2/khtml/xml/xml_tokenizer.h kdelibs-3.3.2.new/khtml/xml/xml_tokenizer.h >--- kdelibs-3.3.2/khtml/xml/xml_tokenizer.h 2004-11-28 20:30:55.000000000 +0300 >+++ kdelibs-3.3.2.new/khtml/xml/xml_tokenizer.h 2005-02-19 15:48:51.000000000 +0300 >@@ -121,6 +121,8 @@ > virtual void finish() = 0; > virtual void setOnHold(bool /*_onHold*/) {} > virtual bool isWaitingForScripts() const = 0; >+ virtual bool isExecutingScript() const = 0; >+ virtual void setAutoClose(bool b=true) = 0; > > signals: > void finishedParsing(); >@@ -156,11 +158,13 @@ > virtual void write( const QString &str, bool ); > virtual void end(); > virtual void finish(); >+ virtual void setAutoClose(bool b=true) { qWarning("XMLTokenizer::setAutoClose: stub."); (void)b; } > > // from CachedObjectClient > void notifyFinished(khtml::CachedObject *finishedObj); > > virtual bool isWaitingForScripts() const; >+ virtual bool isExecutingScript() const { return false; } > > protected: > DOM::DocumentPtr *m_doc;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 78058
:
48529
| 51672