Title: [162655] trunk/Source/WebKit2
Revision
162655
Author
ander...@apple.com
Date
2014-01-23 15:28:54 -0800 (Thu, 23 Jan 2014)

Log Message

Clean up WKView.mm a little
https://bugs.webkit.org/show_bug.cgi?id=127517

Reviewed by Tim Horton.

Remove an unused ivar and migrate to API constants that were added in Lion.

* UIProcess/API/mac/WKView.mm:
(-[WKView setFrameSize:]):
(-[WKView addWindowObserversForWindow:]):
(-[WKView removeWindowObservers]):
(-[WKView viewDidMoveToWindow]):
(-[WKView _windowDidMiniaturize:]):
(-[WKView _windowDidResize:]):
(-[WKView _windowDidChangeBackingProperties:]):

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (162654 => 162655)


--- trunk/Source/WebKit2/ChangeLog	2014-01-23 23:23:51 UTC (rev 162654)
+++ trunk/Source/WebKit2/ChangeLog	2014-01-23 23:28:54 UTC (rev 162655)
@@ -1,5 +1,23 @@
 2014-01-23  Anders Carlsson  <ander...@apple.com>
 
+        Clean up WKView.mm a little
+        https://bugs.webkit.org/show_bug.cgi?id=127517
+
+        Reviewed by Tim Horton.
+
+        Remove an unused ivar and migrate to API constants that were added in Lion.
+
+        * UIProcess/API/mac/WKView.mm:
+        (-[WKView setFrameSize:]):
+        (-[WKView addWindowObserversForWindow:]):
+        (-[WKView removeWindowObservers]):
+        (-[WKView viewDidMoveToWindow]):
+        (-[WKView _windowDidMiniaturize:]):
+        (-[WKView _windowDidResize:]):
+        (-[WKView _windowDidChangeBackingProperties:]):
+
+2014-01-23  Anders Carlsson  <ander...@apple.com>
+
         Try to fix the 32-bit build.
 
         * UIProcess/API/Cocoa/WKPreferences.mm:

Modified: trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm (162654 => 162655)


--- trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm	2014-01-23 23:23:51 UTC (rev 162654)
+++ trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm	2014-01-23 23:28:54 UTC (rev 162655)
@@ -203,12 +203,6 @@
     BOOL _needsViewFrameInWindowCoordinates;
     BOOL _didScheduleWindowAndViewFrameUpdate;
 
-    // Whether the containing window of the WKView has a valid backing store.
-    // The window server invalidates the backing store whenever the window is resized or minimized.
-    // We use this flag to determine when we need to paint the background (white or clear)
-    // when the web process is unresponsive or takes too long to paint.
-    BOOL _windowHasValidBackingStore;
-
     RetainPtr<NSColorSpace> _colorSpace;
 
     RefPtr<WebCore::Image> _promisedImage;
@@ -404,9 +398,6 @@
 
 - (void)setFrameSize:(NSSize)size
 {
-    if (!NSEqualSizes(size, [self frame].size))
-        _data->_windowHasValidBackingStore = NO;
-
     [super setFrameSize:size];
 
     if (![self frameSizeUpdatesDisabled]) {
@@ -1817,10 +1808,6 @@
     return NSMouseInRect(localPoint, visibleThumbRect, [self isFlipped]);
 }
 
-// FIXME: Use AppKit constants for these when they are available.
-static NSString * const windowDidChangeBackingPropertiesNotification = @"NSWindowDidChangeBackingPropertiesNotification";
-static NSString * const backingPropertyOldScaleFactorKey = @"NSBackingPropertyOldScaleFactorKey";
-
 - (void)addWindowObserversForWindow:(NSWindow *)window
 {
     if (window) {
@@ -1841,7 +1828,7 @@
         [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_windowDidOrderOnScreen:) 
                                                      name:@"_NSWindowDidBecomeVisible" object:window];
         [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_windowDidChangeBackingProperties:)
-                                                     name:windowDidChangeBackingPropertiesNotification object:window];
+                                                     name:NSWindowDidChangeBackingPropertiesNotification object:window];
         [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_windowDidChangeScreen:)
                                                      name:NSWindowDidChangeScreenNotification object:window];
 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
@@ -1866,7 +1853,7 @@
     [[NSNotificationCenter defaultCenter] removeObserver:self name:@"NSWindowWillOrderOffScreenNotification" object:window];
     [[NSNotificationCenter defaultCenter] removeObserver:self name:@"NSWindowDidOrderOffScreenNotification" object:window];
     [[NSNotificationCenter defaultCenter] removeObserver:self name:@"_NSWindowDidBecomeVisible" object:window];
-    [[NSNotificationCenter defaultCenter] removeObserver:self name:windowDidChangeBackingPropertiesNotification object:window];
+    [[NSNotificationCenter defaultCenter] removeObserver:self name:NSWindowDidChangeBackingPropertiesNotification object:window];
     [[NSNotificationCenter defaultCenter] removeObserver:self name:NSWindowDidChangeScreenNotification object:window];
 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
     [[NSNotificationCenter defaultCenter] removeObserver:self name:NSWindowDidChangeOcclusionStateNotification object:window];
@@ -1888,7 +1875,6 @@
 - (void)viewDidMoveToWindow
 {
     if ([self window]) {
-        _data->_windowHasValidBackingStore = NO;
         [self doWindowDidChangeScreen];
 
         ViewState::Flags viewStateChanges = ViewState::WindowIsActive | ViewState::IsVisible;
@@ -1955,7 +1941,6 @@
 
 - (void)_windowDidMiniaturize:(NSNotification *)notification
 {
-    _data->_windowHasValidBackingStore = NO;
     _data->_page->viewStateDidChange(ViewState::IsVisible);
 }
 
@@ -1971,8 +1956,6 @@
 
 - (void)_windowDidResize:(NSNotification *)notification
 {
-    _data->_windowHasValidBackingStore = NO;
-
     [self _updateWindowAndViewFrames];
 }
 
@@ -1988,12 +1971,11 @@
 
 - (void)_windowDidChangeBackingProperties:(NSNotification *)notification
 {
-    CGFloat oldBackingScaleFactor = [[notification.userInfo objectForKey:backingPropertyOldScaleFactorKey] doubleValue];
-    CGFloat newBackingScaleFactor = [self _intrinsicDeviceScaleFactor]; 
+    CGFloat oldBackingScaleFactor = [notification.userInfo[NSBackingPropertyOldScaleFactorKey] doubleValue];
+    CGFloat newBackingScaleFactor = [self _intrinsicDeviceScaleFactor];
     if (oldBackingScaleFactor == newBackingScaleFactor)
         return; 
 
-    _data->_windowHasValidBackingStore = NO;
     _data->_page->setIntrinsicDeviceScaleFactor(newBackingScaleFactor);
 }
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to