Moved handling of frame size changes into its own method.
authormitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 5 Jul 2011 01:54:27 +0000 (01:54 +0000)
committermitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 5 Jul 2011 01:54:27 +0000 (01:54 +0000)
Reviewed by Oliver Hunt.

* WebView/WebFrameView.mm:
(-[WebFrameView _frameSizeChanged]): Added. Moved code here...
(-[WebFrameView setFrameSize:]): ...from here.
* WebView/WebFrameViewInternal.h:

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

Source/WebKit/mac/ChangeLog
Source/WebKit/mac/WebView/WebFrameView.mm
Source/WebKit/mac/WebView/WebFrameViewInternal.h

index e790dc8..0a6f74f 100644 (file)
@@ -1,3 +1,14 @@
+2011-07-04  Dan Bernstein  <mitz@apple.com>
+
+        Moved handling of frame size changes into its own method.
+
+        Reviewed by Oliver Hunt.
+
+        * WebView/WebFrameView.mm:
+        (-[WebFrameView _frameSizeChanged]): Added. Moved code here...
+        (-[WebFrameView setFrameSize:]): ...from here.
+        * WebView/WebFrameViewInternal.h:
+
 2011-07-01  Adele Peterson  <adele@apple.com>
 
         Reviewed by Darin Adler.
index b2a525d..6a90547 100644 (file)
@@ -288,6 +288,17 @@ static inline void addTypesFromClass(NSMutableDictionary *allTypes, Class objCCl
     view->updateCanHaveScrollbars();
 }
 
+- (void)_frameSizeChanged
+{
+    // See WebFrameLoaderClient::provisionalLoadStarted.
+    if ([[[self webFrame] webView] drawsBackground])
+        [[self _scrollView] setDrawsBackground:YES];
+    if (Frame* coreFrame = [self _web_frame]) {
+        if (FrameView* coreFrameView = coreFrame->view())
+            coreFrameView->setNeedsLayout();
+    }
+}
+
 @end
 
 @implementation WebFrameView
@@ -496,15 +507,9 @@ static inline void addTypesFromClass(NSMutableDictionary *allTypes, Class objCCl
 
 - (void)setFrameSize:(NSSize)size
 {
-    if (!NSEqualSizes(size, [self frame].size)) {
-        // See WebFrameLoaderClient::provisionalLoadStarted.
-        if ([[[self webFrame] webView] drawsBackground])
-            [[self _scrollView] setDrawsBackground:YES];
-        if (Frame* coreFrame = [self _web_frame]) {
-            if (FrameView* coreFrameView = coreFrame->view())
-                coreFrameView->setNeedsLayout();
-        }
-    }
+    if (!NSEqualSizes(size, [self frame].size))
+        [self _frameSizeChanged];
+
     [super setFrameSize:size];
 }
 
index 9d7fd80..f7f67b2 100644 (file)
@@ -44,5 +44,6 @@
 + (BOOL)_canShowMIMETypeAsHTML:(NSString *)MIMEType;
 - (WebDynamicScrollBarsView *)_scrollView;
 - (void)_install;
+- (void)_frameSizeChanged;
 
 @end