From kde-commits Sat Aug 23 22:30:56 2008 From: Maks Orlovich Date: Sat, 23 Aug 2008 22:30:56 +0000 To: kde-commits Subject: branches/KDE/4.1/kdelibs/khtml Message-Id: <1219530656.999783.28261.nullmailer () svn ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=121953066621491 SVN commit 851523 by orlovich: Cancels any pending redirections on form submit. Fixes regression in forms/form_checkbox.html and #159932 BUG:159932 M +13 -5 khtml_part.cpp M +2 -0 khtmlpart_p.h --- branches/KDE/4.1/kdelibs/khtml/khtml_part.cpp #851522:851523 @@ -1510,9 +1510,7 @@ connect( partManager(), SIGNAL( activePartChanged( KParts::Part * ) ), this, SLOT( slotActiveFrameChanged( KParts::Part * ) ) ); - d->m_delayRedirect = 0; - d->m_redirectURL.clear(); - d->m_redirectionTimer.stop(); + d->clearRedirection(); d->m_redirectLockHistory = true; d->m_bClearing = false; d->m_frameNameId = 1; @@ -2435,13 +2433,19 @@ } } +void KHTMLPartPrivate::clearRedirection() +{ + m_delayRedirect = 0; + m_redirectURL.clear(); + m_redirectionTimer.stop(); +} + void KHTMLPart::slotRedirect() { kDebug(6050) << this << " slotRedirect()"; QString u = d->m_redirectURL; KUrl url( u ); - d->m_delayRedirect = 0; - d->m_redirectURL.clear(); + d->clearRedirection(); if ( d->isInPageURL(u) ) { @@ -4945,6 +4949,10 @@ i18n( "Submit" ))) return; + // OK. We're actually going to submit stuff. Clear any redirections, + // we should win over them + d->clearRedirection(); + KParts::OpenUrlArguments args; if (!d->m_referrer.isEmpty()) --- branches/KDE/4.1/kdelibs/khtml/khtmlpart_p.h #851522:851523 @@ -488,6 +488,8 @@ KHTMLWalletQueue *m_wq; #endif + void clearRedirection(); + bool isLocalAnchorJump(const KUrl& url); void executeAnchorJump(const KUrl& url, bool lockHistory);