Commit 3ddf5d37 authored by mjs's avatar mjs

Reviewed by Ken.

	- fixed 3151982 - missing content at debka.com after iframe is written using document.write
	- fixed 3000234 - javascript problem writing iframe at cycleworld.com

        * khtml/html/htmltokenizer.cpp:
        (HTMLTokenizer::scriptHandler): If we come out of the script with
	the parser in skip mode, don't throw away the whole rest of the
	document - instead, parse it as usual. The parser's skip mode will
	take care of skipping stuff as needed and will detect close tags
	for special tags like <iframe>.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@3363 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 061700e7
2003-01-21 Maciej Stachowiak <mjs@apple.com>
Reviewed by Ken.
- fixed 3151982 - missing content at debka.com after iframe is written using document.write
- fixed 3000234 - javascript problem writing iframe at cycleworld.com
* khtml/html/htmltokenizer.cpp:
(HTMLTokenizer::scriptHandler): If we come out of the script with
the parser in skip mode, don't throw away the whole rest of the
document - instead, parse it as usual. The parser's skip mode will
take care of skipping stuff as needed and will detect close tags
for special tags like <iframe>.
2003-01-20 David Hyatt <hyatt@apple.com> 2003-01-20 David Hyatt <hyatt@apple.com>
Fix :hover performance regression on wsj.com. Moving my Fix :hover performance regression on wsj.com. Moving my
......
2003-01-21 Maciej Stachowiak <mjs@apple.com>
Reviewed by Ken.
- fixed 3151982 - missing content at debka.com after iframe is written using document.write
- fixed 3000234 - javascript problem writing iframe at cycleworld.com
* khtml/html/htmltokenizer.cpp:
(HTMLTokenizer::scriptHandler): If we come out of the script with
the parser in skip mode, don't throw away the whole rest of the
document - instead, parse it as usual. The parser's skip mode will
take care of skipping stuff as needed and will detect close tags
for special tags like <iframe>.
2003-01-20 David Hyatt <hyatt@apple.com> 2003-01-20 David Hyatt <hyatt@apple.com>
Fix :hover performance regression on wsj.com. Moving my Fix :hover performance regression on wsj.com. Moving my
......
...@@ -299,8 +299,12 @@ static bool isTransitional(const QString &spec, int start) ...@@ -299,8 +299,12 @@ static bool isTransitional(const QString &spec, int start)
void HTMLDocumentImpl::close() void HTMLDocumentImpl::close()
{ {
if (parsing() || loading()) {
return;
}
// First fire the onload. // First fire the onload.
bool doload = !parsing() && m_tokenizer; bool doload = !parsing() && !loading() && m_tokenizer;
bool wasNotRedirecting = !view() || view()->part()->d->m_redirectURL.isEmpty(); bool wasNotRedirecting = !view() || view()->part()->d->m_redirectURL.isEmpty();
......
...@@ -533,19 +533,17 @@ void HTMLTokenizer::scriptHandler() ...@@ -533,19 +533,17 @@ void HTMLTokenizer::scriptHandler()
script = false; script = false;
scriptCodeSize = scriptCodeResync = 0; scriptCodeSize = scriptCodeResync = 0;
if ( !parser->skipMode() ) { if ( !m_executingScript && !loadingExtScript ) {
if ( !m_executingScript && !loadingExtScript ) { // kdDebug( 6036 ) << "adding pending Output to parsed string" << endl;
// kdDebug( 6036 ) << "adding pending Output to parsed string" << endl;
#if APPLE_CHANGES #if APPLE_CHANGES
pendingSrc.prepend(src.current(), src.length()); pendingSrc.prepend(src.current(), src.length());
#else #else
pendingSrc.prepend(QString(src.current(), src.length()); pendingSrc.prepend(QString(src.current(), src.length()));
#endif #endif
setSrc(pendingSrc); setSrc(pendingSrc);
pendingSrc = QString::null; pendingSrc = QString::null;
} } else if ( !prependingSrc.isEmpty() ) {
else if ( !prependingSrc.isEmpty() ) write( prependingSrc, false );
write( prependingSrc, false );
} }
} }
......
...@@ -404,6 +404,7 @@ bool KHTMLPart::openURL( const KURL &url ) ...@@ -404,6 +404,7 @@ bool KHTMLPart::openURL( const KURL &url )
d->m_bComplete = true; d->m_bComplete = true;
d->m_doc->setParsing(false); d->m_doc->setParsing(false);
d->m_doc->setLoading(false);
kdDebug( 6050 ) << "completed..." << endl; kdDebug( 6050 ) << "completed..." << endl;
emit completed(); emit completed();
...@@ -519,6 +520,7 @@ bool KHTMLPart::closeURL() ...@@ -519,6 +520,7 @@ bool KHTMLPart::closeURL()
kdDebug( 6050 ) << " was still parsing... calling end " << endl; kdDebug( 6050 ) << " was still parsing... calling end " << endl;
slotFinishedParsing(); slotFinishedParsing();
d->m_doc->setParsing(false); d->m_doc->setParsing(false);
d->m_doc->setLoading(false);
} }
if ( !d->m_workingURL.isEmpty() ) if ( !d->m_workingURL.isEmpty() )
...@@ -1410,6 +1412,7 @@ void KHTMLPart::begin( const KURL &url, int xOffset, int yOffset ) ...@@ -1410,6 +1412,7 @@ void KHTMLPart::begin( const KURL &url, int xOffset, int yOffset )
#endif #endif
d->m_doc->setParsing(true); d->m_doc->setParsing(true);
d->m_doc->setLoading(true);
} }
void KHTMLPart::write( const char *str, int len ) void KHTMLPart::write( const char *str, int len )
...@@ -1623,6 +1626,7 @@ void KHTMLPart::checkCompleted() ...@@ -1623,6 +1626,7 @@ void KHTMLPart::checkCompleted()
// OK, completed. // OK, completed.
// Now do what should be done when we are really completed. // Now do what should be done when we are really completed.
d->m_bComplete = true; d->m_bComplete = true;
d->m_doc->setLoading(false);
checkEmitLoadEvent(); // if we didn't do it before checkEmitLoadEvent(); // if we didn't do it before
...@@ -1682,7 +1686,7 @@ void KHTMLPart::checkCompleted() ...@@ -1682,7 +1686,7 @@ void KHTMLPart::checkCompleted()
void KHTMLPart::checkEmitLoadEvent() void KHTMLPart::checkEmitLoadEvent()
{ {
if ( d->m_bLoadEventEmitted || !d->m_doc || d->m_doc->parsing() ) return; if ( d->m_bLoadEventEmitted || !d->m_doc || d->m_doc->parsing() || d->m_doc->loading() ) return;
ConstFrameIt it = d->m_frames.begin(); ConstFrameIt it = d->m_frames.begin();
ConstFrameIt end = d->m_frames.end(); ConstFrameIt end = d->m_frames.end();
...@@ -2829,6 +2833,10 @@ bool KHTMLPart::processObjectRequest( khtml::ChildFrame *child, const KURL &_url ...@@ -2829,6 +2833,10 @@ bool KHTMLPart::processObjectRequest( khtml::ChildFrame *child, const KURL &_url
if ( child->m_type != khtml::ChildFrame::Object ) if ( child->m_type != khtml::ChildFrame::Object )
{ {
d->m_bComplete = false;
d->m_bLoadEventEmitted = false;
d->m_doc->setLoading(true);
connect( part, SIGNAL( started( KIO::Job *) ), connect( part, SIGNAL( started( KIO::Job *) ),
this, SLOT( slotChildStarted( KIO::Job *) ) ); this, SLOT( slotChildStarted( KIO::Job *) ) );
connect( part, SIGNAL( completed() ), connect( part, SIGNAL( completed() ),
...@@ -3237,7 +3245,7 @@ void KHTMLPart::slotChildStarted( KIO::Job *job ) ...@@ -3237,7 +3245,7 @@ void KHTMLPart::slotChildStarted( KIO::Job *job )
emit d->m_extension->openURLNotify(); emit d->m_extension->openURLNotify();
} }
#endif #endif
d->m_bComplete = false;
emit started( job ); emit started( job );
} }
} }
......
...@@ -295,6 +295,8 @@ public: ...@@ -295,6 +295,8 @@ public:
void setParsing(bool b) { m_bParsing = b; } void setParsing(bool b) { m_bParsing = b; }
bool parsing() const { return m_bParsing; } bool parsing() const { return m_bParsing; }
void setLoading(bool b) { m_bLoading = b; }
bool loading() const { return m_bLoading; }
void setTextColor( DOMString color ) { m_textColor = color; } void setTextColor( DOMString color ) { m_textColor = color; }
DOMString textColor() const { return m_textColor; } DOMString textColor() const { return m_textColor; }
...@@ -499,6 +501,7 @@ protected: ...@@ -499,6 +501,7 @@ protected:
bool m_loadingSheet; bool m_loadingSheet;
bool visuallyOrdered; bool visuallyOrdered;
bool m_bParsing; bool m_bParsing;
bool m_bLoading;
bool m_docChanged; bool m_docChanged;
bool m_styleSelectorDirty; bool m_styleSelectorDirty;
bool m_inStyleRecalc; bool m_inStyleRecalc;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment