WebCore:
authormitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 8 Jul 2008 16:24:21 +0000 (16:24 +0000)
committermitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 8 Jul 2008 16:24:21 +0000 (16:24 +0000)
commit9a201c15c4fc81d851b06add5bb17a49773a1899
treea57d62a570205a1a0722d0b4b5174adf22c74a2f
parente97103a9101aa3d51023561ec3f8bcc7d1033ffb
WebCore:

        Reviewed by John Sullivan.

        - WebCore part of <rdar://problem/6008409> Need a way to disable updates in offscreen views

        Added a setting, updatesWhenOffscreen(), which controls whether an
        offscreen web view gets marked as needing update when its contents
        change (the existing behavior) or not (a new behavior), in which case it
        will be marked as needing update just before it goes on screen. The
        existing behavior (updating while offscreen) remains the default.

        * WebCore.base.exp: Added Settings::setUpdatesWhenOffscreen().
        * page/FrameView.cpp:
        (WebCore::FrameView::shouldUpdateWhenOffscreen): Added. Returns the
        value from settings.
        * page/FrameView.h:
        * page/Settings.cpp:
        (WebCore::Settings::setUpdatesWhenOffscreen): Added.
        * page/Settings.h:
        (WebCore::Settings::updatesWhenOffscreen): Added.
        * platform/ScrollView.h:
        * platform/mac/ScrollViewMac.mm:
        (WebCore::ScrollView::updateContents): Added code to return early and
        not call -setNeedsDisplayInRect: if the view is not in a visible window
        and the setting is not to update when offscreen.

WebKit/mac:

        Reviewed by John Sullivan.

        - WebKit part of <rdar://problem/6008409> Need a way to disable updates in offscreen views

        * WebView/WebHTMLView.mm:
        (-[WebHTMLView addWindowObservers]): Added code to observe when the
        window goes onscreen.
        (-[WebHTMLView removeWindowObservers]): Added.
        (-[WebHTMLView windowWillOrderOnScreen:]): Added. If the view is set to
        not update when offscreen, calls -setNeedsDisplay: just before it comes
        onscreen.
        * WebView/WebPreferenceKeysPrivate.h: Added preference key.
        * WebView/WebPreferences.m:
        (+[WebPreferences initialize]): Made updates when offscreen on by
        default.
        (-[WebPreferences updatesWhenOffscreen]): Added.
        (-[WebPreferences setUpdatesWhenOffscreen:]): Added.
        * WebView/WebPreferencesPrivate.h:
        * WebView/WebView.mm:
        (-[WebView _preferencesChangedNotification:]): Added code to update the
        updatesWhenOffscreen setting in WebCore.

WebKitLibraries:

        Reviewed by John Sullivan.

        - WebKitSystemInterface part of <rdar://problem/6008409> Need a way to disable updates in offscreen views

        * WebKitSystemInterface.h: Added WKWindowWillOrderOnScreenNotification.
        * libWebKitSystemInterfaceLeopard.a: Updated.
        * libWebKitSystemInterfaceTiger.a: Updated.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@35061 268f45cc-cd09-0410-ab3c-d52691b4dbfc
18 files changed:
WebCore/ChangeLog
WebCore/WebCore.base.exp
WebCore/page/FrameView.cpp
WebCore/page/FrameView.h
WebCore/page/Settings.cpp
WebCore/page/Settings.h
WebCore/platform/ScrollView.h
WebCore/platform/mac/ScrollViewMac.mm
WebKit/mac/ChangeLog
WebKit/mac/WebView/WebHTMLView.mm
WebKit/mac/WebView/WebPreferenceKeysPrivate.h
WebKit/mac/WebView/WebPreferences.m
WebKit/mac/WebView/WebPreferencesPrivate.h
WebKit/mac/WebView/WebView.mm
WebKitLibraries/ChangeLog
WebKitLibraries/WebKitSystemInterface.h
WebKitLibraries/libWebKitSystemInterfaceLeopard.a
WebKitLibraries/libWebKitSystemInterfaceTiger.a