Changeset 21892 in webkit


Ignore:
Timestamp:
May 30, 2007 6:20:56 AM (17 years ago)
Author:
zbujtas
Message:

2007-05-29 bujtas <zbujtas@gmail.com>

Reviewed by Sachin.
DESC: stop animation on image renderers when browser
is in background
http://bugs.webkit.org/show_bug.cgi?id=13906

Location:
S60/branches/3.1m
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • S60/branches/3.1m/WebCore/BWINS/WEBCOREU.DEF

    r21537 r21892  
    159159        ?StopLoading@CWebCoreBridge@@QAEXH@Z @ 158 NONAME ; void CWebCoreBridge::StopLoading(int)
    160160        ?WindowScriptNPObject@CWebCoreBridge@@QAEPAVNPObject@@XZ @ 159 NONAME ; class NPObject * CWebCoreBridge::WindowScriptNPObject(void)
     161        ?SetDeferAnimations@CWebCoreBridge@@QAEXXZ @ 160 NONAME ; void CWebCoreBridge::SetDeferAnimations(void)
    161162
  • S60/branches/3.1m/WebCore/ChangeLog

    r21537 r21892  
     12007-05-29  bujtas  <zbujtas@gmail.com>
     2
     3        Reviewed by Sachin.
     4        DESC: stop animation on image renderers when browser
     5        is in background
     6        http://bugs.webkit.org/show_bug.cgi?id=13906
     7
     8        * BWINS/WEBCOREU.DEF:
     9        * EABI/WebCoreU.DEF:
     10        * bridge/WebCoreBridge.cpp:
     11        (CWebCoreBridge::SetDeferAnimations):
     12        * bridge/WebCoreBridge.h:
     13        * khtml/misc/loader.cpp:
     14        (CachedImage::setDeferAnimations):
     15        (DocLoader::setShowAnimations):
     16        (DocLoader::setDeferAnimations):
     17        * khtml/misc/loader.h:
     18        (khtml::):
     19        * kwq/KWQKHTMLPart.cpp:
     20        (KWQKHTMLPart::submitForm):
     21        (KWQKHTMLPart::deferAnimations):
     22        * kwq/KWQKHTMLPart.h:
     23
    1242007-05-15  yyadavall  <sriram.yadavalli@nokia.com>
    225
  • S60/branches/3.1m/WebCore/EABI/WebCoreU.DEF

    r21537 r21892  
    162162        _ZN14CWebCoreBridge11StopLoadingEi @ 161 NONAME
    163163        _ZN14CWebCoreBridge20WindowScriptNPObjectEv @ 162 NONAME
     164        _ZN14CWebCoreBridge18SetDeferAnimationsEv @ 163 NONAME
    164165
  • S60/branches/3.1m/WebCore/bridge/WebCoreBridge.cpp

    r21537 r21892  
    29962996}
    29972997
     2998EXPORT_C
     2999void CWebCoreBridge::SetDeferAnimations()
     3000{
     3001    iPart->deferAnimations();
     3002}
     3003
  • S60/branches/3.1m/WebCore/bridge/WebCoreBridge.h

    r21537 r21892  
    502502        IMPORT_C static TBool DefersTimers();
    503503
     504        IMPORT_C void SetDeferAnimations();
     505
    504506    private:
    505507
  • S60/branches/3.1m/WebCore/khtml/misc/loader.cpp

    r19802 r21892  
    10231023}
    10241024
     1025void CachedImage::setDeferAnimations() {
     1026    if (p)
     1027        p->stopAnimations();
     1028}
     1029
    10251030#if !APPLE_CHANGES
    10261031
     
    16071612
    16081613            img->setShowAnimations( showAnimations );
     1614        }
     1615}
     1616
     1617void DocLoader::setDeferAnimations() {
     1618    const CachedObject* co;
     1619    for ( co=m_docObjects.first(); co; co=m_docObjects.next() )
     1620        if ( co->type() == CachedObject::Image )
     1621        {
     1622            CachedImage *img = const_cast<CachedImage*>( static_cast<const CachedImage *>( co ) );
     1623
     1624            img->setDeferAnimations();
    16091625        }
    16101626}
  • S60/branches/3.1m/WebCore/khtml/misc/loader.h

    r14720 r21892  
    390390#endif
    391391        void setShowAnimations( KHTMLSettings::KAnimationAdvice );
     392        void setDeferAnimations();
    392393
    393394        virtual bool schedule() const { return true; }
     
    431432
    432433  // Is set if movie format type ( incremental/animation) was checked
    433   bool typeChecked : 1;
     434    bool typeChecked : 1;
    434435        bool isFullyTransparent : 1;
    435436        bool errorOccured : 1;
     
    534535        void setCachePolicy( KIO::CacheControl cachePolicy );
    535536        void setShowAnimations( KHTMLSettings::KAnimationAdvice );
     537        void setDeferAnimations();
    536538        void removeCachedObject( CachedObject*) const;
    537539
  • S60/branches/3.1m/WebCore/kwq/KWQKHTMLPart.cpp

    r21537 r21892  
    771771        }
    772772    }
    773    
     773
    774774    // Save persisted form data
    775775    if (FormValues()){
     
    41754175}
    41764176
     4177
     4178void KWQKHTMLPart::deferAnimations()
     4179{
     4180    if ( !d )
     4181        return;
     4182
     4183    if ( d->m_doc )
     4184        d->m_doc->docLoader()->setDeferAnimations();
     4185
     4186    ConstFrameIt it = d->m_frames.begin();
     4187    ConstFrameIt end = d->m_frames.end();
     4188    for (; it != end; ++it )
     4189        if ( !( *it ).m_part.isNull() && ( *it ).m_part->inherits( "KHTMLPart" ) ) {
     4190            KParts::ReadOnlyPart* p = ( *it ).m_part;
     4191            static_cast<KWQKHTMLPart*>( p )->deferAnimations();
     4192    }
     4193}
     4194
     4195
  • S60/branches/3.1m/WebCore/kwq/KWQKHTMLPart.h

    r21537 r21892  
    364364
    365365    void setFontSizeLevel( int aLevel );
     366    // suspend animations
     367    void deferAnimations();
     368
    366369private:
    367370
  • S60/branches/3.1m/WebKit/BrowserView/src/WebKitControl.cpp

    r21537 r21892  
    454454        {
    455455        // Create data manager for auto form fill
    456         iFormDataManager = CFormDataManager::NewL(aBrCtl.BrCtlDialogsProvider(),
     456        iFormDataManager = CFormDataManager::NewL(aBrCtl.BrCtlDialogsProvider(), 
    457457            aBrCtl.WebKitControl()->GetBrowserSettingL(TBrCtlDefs::ESettingsAutoFormFillEnabled) );
    458458        }
     
    529529    if( !iDownloadObserver )
    530530        {
    531         // init
     531        // init 
    532532        iDownloadObserver = new (ELeave) CBrCtlDownloadObserver;
    533533        }
     
    586586    //
    587587    LoaderContainerL( aBrCtl );
    588     DownloadObserver();
     588    DownloadObserver();   
    589589    // save pages capability
    590590    iImgRendererFactory->SetSaveImageData( iLoaderContainer->Capabilities() & TBrCtlDefs::ECapabilitySavedPage );
     
    11401140            while( frame )
    11411141                {
    1142                 //Let all connection to close first then Deref()
     1142                //Let all connection to close first then Deref() 
    11431143                //when disconnected by the user.
    11441144                CWebKitFrame* currentFrame = frame;
     
    12021202            }
    12031203        }
    1204 
     1204       
    12051205    CWebKitFrame* frame = &(iWebKitView->MainFrame());
    12061206    while( frame )
     
    12111211        }
    12121212    iSyncCancel = EFalse;
    1213 
    1214     iHistoryController->CancelResetEntryPositionL();
     1213 
     1214    iHistoryController->CancelResetEntryPositionL();   
    12151215    iBrCtl->HandleBrowserLoadEventL( TBrCtlDefs::EEventContentFinished, 0, 0 );
    12161216
     
    16621662    TInt bytesReceived( aReceivedContentSize - item.iBytesReceived );
    16631663
    1664     // Adjust if the total received bytes is different than our estimate
     1664    // Adjust if the total received bytes is different than our estimate 
    16651665    item.iBytesReceived = aReceivedContentSize;
    16661666    if ( item.iBytesReceived > item.iEstimatedLength )
     
    16781678    TInt estimatedBytesForPendingRequests = KWebProgressItemDefaultEstimatedLength *
    16791679                                            numPendingOrLoadingRequests;
    1680 
     1680   
    16811681    // Calculate the amount to increment the progress bar
    16821682    TInt remainingBytes = (( iTotalPageAndResourceBytesToLoad +
     
    18571857        {
    18581858        CWebCoreBridge::SetDefersTimers( ETrue );
     1859        iWebKitView->MainFrame().WebKitBridge().WebCoreBridge().SetDeferAnimations();
    18591860        }
    18601861    }
     
    18701871// back, when our new estimated progress is less then our last estimate. Ie,
    18711872// if we guess we're at 20% and the next chuck makes our guess 18%, we leave the
    1872 // progress bar at 20%.
     1873// progress bar at 20%. 
    18731874// -----------------------------------------------------------------------------
    18741875void CWebKitControl::ProgressUpdate()
     
    22392240            {
    22402241            CWebCoreBridge::SetDefersTimers( ETrue );
     2242            iWebKitView->MainFrame().WebKitBridge().WebCoreBridge().SetDeferAnimations();
    22412243            }
    22422244        else
     
    22502252        iSuspendTimers = EFalse;
    22512253        CWebCoreBridge::SetDefersTimers( EFalse );
     2254        // invalidate the view to wake up animations
     2255        iWebKitView->SyncRepaint( iWebKitView->MainFrame().VisibleRect() );
    22522256        }
    22532257    }
  • S60/branches/3.1m/WebKit/ChangeLog

    r21626 r21892  
     12007-05-29  bujtas  <zbujtas@gmail.com>
     2
     3        Reviewed by Sachin.
     4        DESC: stop animation on image renderers when browser
     5        is in background
     6        http://bugs.webkit.org/show_bug.cgi?id=13906
     7
     8        * BrowserView/src/WebKitControl.cpp:
     9        (CStaticObjectContainer::FormDataManagerHandlerL):
     10        (CStaticObjectContainer::DownloadObserver):
     11        (CStaticObjectContainer::InitializeFactoryObjectsL):
     12        (CWebKitControl::HandleLoaderCommandL):
     13        (CWebKitControl::SyncCancelL):
     14        (CWebKitControl::IncrementProgressForMoreData):
     15        (CWebKitControl::FinalProgressComplete):
     16        (CWebKitControl::ForegroundEvent):
     17
    1182007-05-21  spadma
    219        DESC: Update loc file layout
Note: See TracChangeset for help on using the changeset viewer.