WebCore:
authormitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 21 Aug 2008 00:33:29 +0000 (00:33 +0000)
committermitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 21 Aug 2008 00:33:29 +0000 (00:33 +0000)
        Rubber-stamped by John Sullivan.

        - rename shouldUpdateWhileHidden to shouldUpdateWhileOffscreen and
          rename related methods and variables accordingly.

        * WebCore.base.exp:
        * page/FrameView.cpp:
        (WebCore::FrameViewPrivate::FrameViewPrivate):
        (WebCore::FrameView::shouldUpdateWhileOffscreen):
        (WebCore::FrameView::setShouldUpdateWhileOffscreen):
        * page/FrameView.h:
        * platform/ScrollView.h:
        * platform/mac/ScrollViewMac.mm:
        (WebCore::ScrollView::updateContents):

WebKit/mac:

        Rubber-stamped by John Sullivan.

        - rename shouldUpdateWhileHidden to shouldUpdateWhileOffscreen,
          rename related methods and variables accordingly, and make
          -setShouldUpdateWhileOffscreen: and -shouldUpdateWhileOffscreen
          WebView API.

        * WebCoreSupport/WebFrameLoaderClient.mm:
        (WebFrameLoaderClient::transitionToCommittedForNewPage):
        * WebView/WebFrame.mm:
        (-[WebFrame _updateBackgroundAndUpdatesWhileOffscreen]):
        * WebView/WebFrameInternal.h:
        * WebView/WebHTMLView.mm:
        (-[WebHTMLView windowWillOrderOnScreen:]):
        * WebView/WebView.h:
        * WebView/WebView.mm:
        (-[WebViewPrivate init]):
        (-[WebView setBackgroundColor:]):
        (-[WebView setDrawsBackground:]):
        (-[WebView setShouldUpdateWhileOffscreen:]):
        (-[WebView shouldUpdateWhileOffscreen]):
        * WebView/WebViewPrivate.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@35868 268f45cc-cd09-0410-ab3c-d52691b4dbfc

14 files changed:
WebCore/ChangeLog
WebCore/WebCore.base.exp
WebCore/page/FrameView.cpp
WebCore/page/FrameView.h
WebCore/platform/ScrollView.h
WebCore/platform/mac/ScrollViewMac.mm
WebKit/mac/ChangeLog
WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm
WebKit/mac/WebView/WebFrame.mm
WebKit/mac/WebView/WebFrameInternal.h
WebKit/mac/WebView/WebHTMLView.mm
WebKit/mac/WebView/WebView.h
WebKit/mac/WebView/WebView.mm
WebKit/mac/WebView/WebViewPrivate.h

index 096ea28..daa9b03 100644 (file)
@@ -1,3 +1,20 @@
+2008-08-20  Dan Bernstein  <mitz@apple.com>
+
+        Rubber-stamped by John Sullivan.
+
+        - rename shouldUpdateWhileHidden to shouldUpdateWhileOffscreen and
+          rename related methods and variables accordingly.
+
+        * WebCore.base.exp:
+        * page/FrameView.cpp:
+        (WebCore::FrameViewPrivate::FrameViewPrivate):
+        (WebCore::FrameView::shouldUpdateWhileOffscreen):
+        (WebCore::FrameView::setShouldUpdateWhileOffscreen):
+        * page/FrameView.h:
+        * platform/ScrollView.h:
+        * platform/mac/ScrollViewMac.mm:
+        (WebCore::ScrollView::updateContents):
+
 2008-08-20  Brady Eidson  <beidson@apple.com>
 
         Reviewed by Mitzpettel
index 5c17eb8..f7cb624 100644 (file)
@@ -613,7 +613,7 @@ __ZN7WebCore9FrameView14setTransparentEb
 __ZN7WebCore9FrameView15setMarginHeightEi
 __ZN7WebCore9FrameView18updateControlTintsEv
 __ZN7WebCore9FrameView22setBaseBackgroundColorENS_5ColorE
-__ZN7WebCore9FrameView26setShouldUpdateWhileHiddenEb
+__ZN7WebCore9FrameView29setShouldUpdateWhileOffscreenEb
 __ZN7WebCore9FrameViewC1EPNS_5FrameE
 __ZN7WebCore9HTMLNames10listingTagE
 __ZN7WebCore9HTMLNames13blockquoteTagE
index bc49cec..7785e50 100644 (file)
@@ -69,7 +69,7 @@ public:
         , m_viewportRenderer(0)
         , m_wasScrolledByUser(false)
         , m_inProgrammaticScroll(false)
-        , m_shouldUpdateWhileHidden(true)
+        , m_shouldUpdateWhileOffscreen(true)
     {
         m_isTransparent = false;
         m_baseBackgroundColor = Color::white;
@@ -147,7 +147,7 @@ public:
     IntRect m_repaintRect;
     Vector<IntRect> m_repaintRects;
 
-    bool m_shouldUpdateWhileHidden;
+    bool m_shouldUpdateWhileOffscreen;
 };
 
 FrameView::FrameView(Frame* frame)
@@ -910,14 +910,14 @@ void FrameView::setBaseBackgroundColor(Color bc)
     d->m_baseBackgroundColor = bc;
 }
 
-bool FrameView::shouldUpdateWhileHidden() const
+bool FrameView::shouldUpdateWhileOffscreen() const
 {
-    return d->m_shouldUpdateWhileHidden;
+    return d->m_shouldUpdateWhileOffscreen;
 }
 
-void FrameView::setShouldUpdateWhileHidden(bool shouldUpdateWhileHidden)
+void FrameView::setShouldUpdateWhileOffscreen(bool shouldUpdateWhileOffscreen)
 {
-    d->m_shouldUpdateWhileHidden = shouldUpdateWhileHidden;
+    d->m_shouldUpdateWhileOffscreen = shouldUpdateWhileOffscreen;
 }
 
 void FrameView::scheduleEvent(PassRefPtr<Event> event, PassRefPtr<EventTargetNode> eventTarget, bool tempEvent)
index 16a5c05..f5d86bb 100644 (file)
@@ -103,8 +103,8 @@ public:
     Color baseBackgroundColor() const;
     void setBaseBackgroundColor(Color);
 
-    virtual bool shouldUpdateWhileHidden() const;
-    void setShouldUpdateWhileHidden(bool);
+    virtual bool shouldUpdateWhileOffscreen() const;
+    void setShouldUpdateWhileOffscreen(bool);
 
     void adjustViewSize();
     void initScrollbars();
index e40aad9..026f524 100644 (file)
@@ -105,7 +105,7 @@ namespace WebCore {
         void setStaticBackground(bool);
 
         bool inWindow() const;
-        virtual bool shouldUpdateWhileHidden() const = 0;
+        virtual bool shouldUpdateWhileOffscreen() const = 0;
 
         // For platforms that need to hit test scrollbars from within the engine's event handlers (like Win32).
         PlatformScrollbar* scrollbarUnderMouse(const PlatformMouseEvent& mouseEvent);
index 05cccbf..7ca2e6e 100644 (file)
@@ -240,7 +240,7 @@ void ScrollView::updateContents(const IntRect& rect, bool now)
     BEGIN_BLOCK_OBJC_EXCEPTIONS;
 
     NSView *view = documentView();
-    if (!now && ![[view window] isVisible] && !shouldUpdateWhileHidden())
+    if (!now && ![[view window] isVisible] && !shouldUpdateWhileOffscreen())
         return;
 
     NSRect visibleRect = visibleContentRect();
index b47440d..4d8d69f 100644 (file)
@@ -1,3 +1,28 @@
+2008-08-20  Dan Bernstein  <mitz@apple.com>
+
+        Rubber-stamped by John Sullivan.
+
+        - rename shouldUpdateWhileHidden to shouldUpdateWhileOffscreen,
+          rename related methods and variables accordingly, and make
+          -setShouldUpdateWhileOffscreen: and -shouldUpdateWhileOffscreen
+          WebView API.
+
+        * WebCoreSupport/WebFrameLoaderClient.mm:
+        (WebFrameLoaderClient::transitionToCommittedForNewPage):
+        * WebView/WebFrame.mm:
+        (-[WebFrame _updateBackgroundAndUpdatesWhileOffscreen]):
+        * WebView/WebFrameInternal.h:
+        * WebView/WebHTMLView.mm:
+        (-[WebHTMLView windowWillOrderOnScreen:]):
+        * WebView/WebView.h:
+        * WebView/WebView.mm:
+        (-[WebViewPrivate init]):
+        (-[WebView setBackgroundColor:]):
+        (-[WebView setDrawsBackground:]):
+        (-[WebView setShouldUpdateWhileOffscreen:]):
+        (-[WebView shouldUpdateWhileOffscreen]):
+        * WebView/WebViewPrivate.h:
+
 2008-08-18  Mark Rowe  <mrowe@apple.com>
 
         Reviewed by Darin Adler.
index 147705d..49c44c6 100644 (file)
@@ -956,7 +956,7 @@ void WebFrameLoaderClient::transitionToCommittedForNewPage()
     if (marginHeight >= 0)
         coreView->setMarginHeight(marginHeight);
 
-    [m_webFrame.get() _updateBackgroundAndUpdatesWhileHidden];
+    [m_webFrame.get() _updateBackgroundAndUpdatesWhileOffscreen];
 
     [v _install];
 
index 5cb937f..5a2ea06 100644 (file)
@@ -356,7 +356,7 @@ WebView *getWebView(WebFrame *webFrame)
     _private->coreFrame = 0;
 }
 
-- (void)_updateBackgroundAndUpdatesWhileHidden
+- (void)_updateBackgroundAndUpdatesWhileOffscreen
 {
     WebView *webView = getWebView(self);
     BOOL drawsBackground = [webView drawsBackground];
@@ -379,7 +379,7 @@ WebView *getWebView(WebFrame *webFrame)
             frame->view()->setTransparent(!drawsBackground);
             Color color = colorFromNSColor([backgroundColor colorUsingColorSpaceName:NSDeviceRGBColorSpace]);
             frame->view()->setBaseBackgroundColor(color);
-            frame->view()->setShouldUpdateWhileHidden([webView shouldUpdateWhileHidden]);
+            frame->view()->setShouldUpdateWhileOffscreen([webView shouldUpdateWhileOffscreen]);
         }
     }
 }
index 9fbc124..5f8df19 100644 (file)
@@ -116,7 +116,7 @@ WebView *getWebView(WebFrame *webFrame);
 
 - (void)_clearCoreFrame;
 
-- (void)_updateBackgroundAndUpdatesWhileHidden;
+- (void)_updateBackgroundAndUpdatesWhileOffscreen;
 - (void)_setInternalLoadDelegate:(id)internalLoadDelegate;
 - (id)_internalLoadDelegate;
 #ifndef BUILDING_ON_TIGER
index d281a3c..09fb3e1 100644 (file)
@@ -3061,7 +3061,7 @@ static void _updateFocusedAndActiveStateTimerCallback(CFRunLoopTimerRef timer, v
 
 - (void)windowWillOrderOnScreen:(NSNotification *)notification
 {
-    if (![[self _webView] shouldUpdateWhileHidden])
+    if (![[self _webView] shouldUpdateWhileOffscreen])
         [self setNeedsDisplay:YES];
 }
 
index 6038703..30aa7bd 100644 (file)
@@ -617,6 +617,22 @@ extern NSString *WebViewProgressFinishedNotification;
 - (BOOL)drawsBackground;
 
 /*!
+    @method setShouldUpdateWhileOffscreen:
+    @abstract Sets whether the receiver must update even when it is not in a window that is currently visible.
+    @param updateWhileOffscreen whether the receiver is required to render updates to the web page when it is not in a visible window.
+    @abstract If set to NO, then whenever the web view is not in a visible window, updates to the web page will not necessarily be rendered in the view.
+    However, when the window is made visible, the view will be updated automatically. Not updating while hidden can improve performance. If set to is YES,
+    hidden web views are always updated. This is the default.
+*/
+- (void)setShouldUpdateWhileOffscreen:(BOOL)updateWhileOffscreen;
+
+/*!
+    @method shouldUpdateWhileOffscreen
+    @result Returns whether the web view is always updated even when it is not in a window that is currently visible.
+*/
+- (BOOL)shouldUpdateWhileOffscreen;
+
+/*!
     @method setMainFrameURL:
     @param URLString The URL to load in the mainFrame.
 */
index 2b94142..cca87a4 100644 (file)
@@ -381,7 +381,7 @@ static int pluginDatabaseClientCount = 0;
     BOOL _keyboardUIModeAccessed;
     KeyboardUIMode _keyboardUIMode;
 
-    BOOL shouldUpdateWhileHidden;
+    BOOL shouldUpdateWhileOffscreen;
 }
 @end
 
@@ -489,7 +489,7 @@ static BOOL grammarCheckingEnabled;
     identifierMap = new HashMap<unsigned long, RetainPtr<id> >();
     pluginDatabaseClientCount++;
 
-    shouldUpdateWhileHidden = YES;
+    shouldUpdateWhileOffscreen = YES;
 
     return self;
 }
@@ -1607,7 +1607,7 @@ WebFrameLoadDelegateImplementationCache* WebViewGetFrameLoadDelegateImplementati
     _private->backgroundColor = [backgroundColor retain];
     [old release];
 
-    [[self mainFrame] _updateBackgroundAndUpdatesWhileHidden];
+    [[self mainFrame] _updateBackgroundAndUpdatesWhileOffscreen];
 }
 
 - (NSColor *)backgroundColor
@@ -2883,7 +2883,7 @@ static WebFrame *incrementFrame(WebFrame *curr, BOOL forward, BOOL wrapFlag)
     if (_private->drawsBackground == drawsBackground)
         return;
     _private->drawsBackground = drawsBackground;
-    [[self mainFrame] _updateBackgroundAndUpdatesWhileHidden];
+    [[self mainFrame] _updateBackgroundAndUpdatesWhileOffscreen];
 }
 
 - (BOOL)drawsBackground
@@ -2891,6 +2891,19 @@ static WebFrame *incrementFrame(WebFrame *curr, BOOL forward, BOOL wrapFlag)
     return _private->drawsBackground;
 }
 
+- (void)setShouldUpdateWhileOffscreen:(BOOL)updateWhileOffscreen
+{
+    if (_private->shouldUpdateWhileOffscreen == updateWhileOffscreen)
+        return;
+    _private->shouldUpdateWhileOffscreen = updateWhileOffscreen;
+    [[self mainFrame] _updateBackgroundAndUpdatesWhileOffscreen];
+}
+
+- (BOOL)shouldUpdateWhileOffscreen
+{
+    return _private->shouldUpdateWhileOffscreen;
+}
+
 @end
 
 @implementation WebView (WebIBActions)
@@ -3422,19 +3435,6 @@ static NSAppleEventDescriptor* aeDescFromJSValue(ExecState* exec, JSValue* jsVal
     return [self _resetZoom:sender isTextOnly:NO];
 }
 
-- (BOOL)shouldUpdateWhileHidden
-{
-    return _private->shouldUpdateWhileHidden;
-}
-
-- (void)setShouldUpdateWhileHidden:(BOOL)flag
-{
-    if (_private->shouldUpdateWhileHidden == flag)
-        return;
-    _private->shouldUpdateWhileHidden = flag;
-    [[self mainFrame] _updateBackgroundAndUpdatesWhileHidden];
-}
-
 @end
 
 @implementation WebView (WebViewPrintingPrivate)
index 91a2f57..07e00af 100644 (file)
@@ -176,9 +176,6 @@ typedef enum {
 - (BOOL)canResetPageZoom;
 - (IBAction)resetPageZoom:(id)sender;
 
-- (BOOL)shouldUpdateWhileHidden;
-- (void)setShouldUpdateWhileHidden:(BOOL)flag;
-
 @end
 
 @interface WebView (WebPrivate)