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>
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>
Fix :hover performance regression on wsj.com. Moving my
......
......@@ -299,8 +299,12 @@ static bool isTransitional(const QString &spec, int start)
void HTMLDocumentImpl::close()
{
if (parsing() || loading()) {
return;
}
// First fire the onload.
bool doload = !parsing() && m_tokenizer;
bool doload = !parsing() && !loading() && m_tokenizer;
bool wasNotRedirecting = !view() || view()->part()->d->m_redirectURL.isEmpty();
......
......@@ -533,19 +533,17 @@ void HTMLTokenizer::scriptHandler()
script = false;
scriptCodeSize = scriptCodeResync = 0;
if ( !parser->skipMode() ) {
if ( !m_executingScript && !loadingExtScript ) {
// kdDebug( 6036 ) << "adding pending Output to parsed string" << endl;
if ( !m_executingScript && !loadingExtScript ) {
// kdDebug( 6036 ) << "adding pending Output to parsed string" << endl;
#if APPLE_CHANGES
pendingSrc.prepend(src.current(), src.length());
pendingSrc.prepend(src.current(), src.length());
#else
pendingSrc.prepend(QString(src.current(), src.length());
pendingSrc.prepend(QString(src.current(), src.length()));
#endif
setSrc(pendingSrc);
pendingSrc = QString::null;
}
else if ( !prependingSrc.isEmpty() )
write( prependingSrc, false );
setSrc(pendingSrc);
pendingSrc = QString::null;
} else if ( !prependingSrc.isEmpty() ) {
write( prependingSrc, false );
}
}
......
......@@ -404,6 +404,7 @@ bool KHTMLPart::openURL( const KURL &url )
d->m_bComplete = true;
d->m_doc->setParsing(false);
d->m_doc->setLoading(false);
kdDebug( 6050 ) << "completed..." << endl;
emit completed();
......@@ -519,6 +520,7 @@ bool KHTMLPart::closeURL()
kdDebug( 6050 ) << " was still parsing... calling end " << endl;
slotFinishedParsing();
d->m_doc->setParsing(false);
d->m_doc->setLoading(false);
}
if ( !d->m_workingURL.isEmpty() )
......@@ -1410,6 +1412,7 @@ void KHTMLPart::begin( const KURL &url, int xOffset, int yOffset )
#endif
d->m_doc->setParsing(true);
d->m_doc->setLoading(true);
}
void KHTMLPart::write( const char *str, int len )
......@@ -1623,6 +1626,7 @@ void KHTMLPart::checkCompleted()
// OK, completed.
// Now do what should be done when we are really completed.
d->m_bComplete = true;
d->m_doc->setLoading(false);
checkEmitLoadEvent(); // if we didn't do it before
......@@ -1682,7 +1686,7 @@ void KHTMLPart::checkCompleted()
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 end = d->m_frames.end();
......@@ -2829,6 +2833,10 @@ bool KHTMLPart::processObjectRequest( khtml::ChildFrame *child, const KURL &_url
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 *) ),
this, SLOT( slotChildStarted( KIO::Job *) ) );
connect( part, SIGNAL( completed() ),
......@@ -3237,7 +3245,7 @@ void KHTMLPart::slotChildStarted( KIO::Job *job )
emit d->m_extension->openURLNotify();
}
#endif
d->m_bComplete = false;
emit started( job );
}
}
......
......@@ -295,6 +295,8 @@ public:
void setParsing(bool b) { m_bParsing = b; }
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; }
DOMString textColor() const { return m_textColor; }
......@@ -499,6 +501,7 @@ protected:
bool m_loadingSheet;
bool visuallyOrdered;
bool m_bParsing;
bool m_bLoading;
bool m_docChanged;
bool m_styleSelectorDirty;
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