Unreviewed, rolling out r239417.
authorryanhaddad@apple.com <ryanhaddad@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 20 Dec 2018 18:32:38 +0000 (18:32 +0000)
committerryanhaddad@apple.com <ryanhaddad@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 20 Dec 2018 18:32:38 +0000 (18:32 +0000)
Introduced two API test failures on macOS.

Reverted changeset:

"<rdar://problem/46194315> macOS: WebKit1 does not handle
occlusion changes"
https://bugs.webkit.org/show_bug.cgi?id=192821
https://trac.webkit.org/changeset/239417

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

Source/WebKitLegacy/mac/ChangeLog
Source/WebKitLegacy/mac/WebView/WebView.mm
Source/WebKitLegacy/mac/WebView/WebViewData.h
Source/WebKitLegacy/mac/WebView/WebViewData.mm
Source/WebKitLegacy/mac/WebView/WebViewPrivate.h
Tools/ChangeLog
Tools/DumpRenderTree/mac/DumpRenderTree.mm

index a7fed47..edbeb51 100644 (file)
@@ -1,3 +1,16 @@
+2018-12-20  Ryan Haddad  <ryanhaddad@apple.com>
+
+        Unreviewed, rolling out r239417.
+
+        Introduced two API test failures on macOS.
+
+        Reverted changeset:
+
+        "<rdar://problem/46194315> macOS: WebKit1 does not handle
+        occlusion changes"
+        https://bugs.webkit.org/show_bug.cgi?id=192821
+        https://trac.webkit.org/changeset/239417
+
 2018-12-20  Brent Fulgham  <bfulgham@apple.com>
 
         WKWebView default UA doesn't freeze the build number
index 2f73283..0110bbd 100644 (file)
@@ -4671,21 +4671,15 @@ IGNORE_WARNINGS_END
 
 - (BOOL)_isViewVisible
 {
-    NSWindow *window = [self window];
-    if (!window)
+    if (![self window])
         return false;
 
-    if (![window isVisible])
+    if (![[self window] isVisible])
         return false;
 
     if ([self isHiddenOrHasHiddenAncestor])
         return false;
 
-#if !PLATFORM(IOS_FAMILY)
-    if (_private->windowOcclusionDetectionEnabled && (window.occlusionState & NSWindowOcclusionStateVisible) != NSWindowOcclusionStateVisible)
-        return false;
-#endif
-
     return true;
 }
 
@@ -5074,18 +5068,6 @@ static Vector<String> toStringVector(NSArray* patterns)
     }
 }
 
-#if !PLATFORM(IOS_FAMILY)
-- (BOOL)windowOcclusionDetectionEnabled
-{
-    return _private->windowOcclusionDetectionEnabled;
-}
-
-- (void)setWindowOcclusionDetectionEnabled:(BOOL)flag
-{
-    _private->windowOcclusionDetectionEnabled = flag;
-}
-#endif
-
 - (void)_setPaginationBehavesLikeColumns:(BOOL)behavesLikeColumns
 {
     Page* page = core(self);
@@ -6021,26 +6003,22 @@ static NSString * const backingPropertyOldScaleFactorKey = @"NSBackingPropertyOl
 - (void)addWindowObserversForWindow:(NSWindow *)window
 {
     if (window) {
-        NSNotificationCenter *defaultNotificationCenter = [NSNotificationCenter defaultCenter];
-
-        [defaultNotificationCenter addObserver:self selector:@selector(windowKeyStateChanged:)
+        [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(windowKeyStateChanged:)
             name:NSWindowDidBecomeKeyNotification object:window];
-        [defaultNotificationCenter addObserver:self selector:@selector(windowKeyStateChanged:)
+        [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(windowKeyStateChanged:)
             name:NSWindowDidResignKeyNotification object:window];
-        [defaultNotificationCenter addObserver:self selector:@selector(_windowWillOrderOnScreen:)
+        [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_windowWillOrderOnScreen:)
             name:NSWindowWillOrderOnScreenNotification object:window];
-        [defaultNotificationCenter addObserver:self selector:@selector(_windowWillOrderOffScreen:)
+        [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_windowWillOrderOffScreen:)
             name:NSWindowWillOrderOffScreenNotification object:window];
-        [defaultNotificationCenter addObserver:self selector:@selector(_windowDidChangeBackingProperties:)
+        [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_windowDidChangeBackingProperties:)
             name:windowDidChangeBackingPropertiesNotification object:window];
-        [defaultNotificationCenter addObserver:self selector:@selector(_windowDidChangeScreen:)
+        [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_windowDidChangeScreen:)
             name:NSWindowDidChangeScreenNotification object:window];
-        [defaultNotificationCenter addObserver:self selector:@selector(_windowVisibilityChanged:)
+        [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_windowVisibilityChanged:) 
             name:NSWindowDidMiniaturizeNotification object:window];
-        [defaultNotificationCenter addObserver:self selector:@selector(_windowVisibilityChanged:)
+        [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_windowVisibilityChanged:)
             name:NSWindowDidDeminiaturizeNotification object:window];
-        [defaultNotificationCenter addObserver:self selector:@selector(_windowDidChangeOcclusionState:)
-            name:NSWindowDidChangeOcclusionStateNotification object:window];
         [_private->windowVisibilityObserver startObserving:window];
     }
 }
@@ -6049,26 +6027,22 @@ static NSString * const backingPropertyOldScaleFactorKey = @"NSBackingPropertyOl
 {
     NSWindow *window = [self window];
     if (window) {
-        NSNotificationCenter *defaultNotificationCenter = [NSNotificationCenter defaultCenter];
-
-        [defaultNotificationCenter removeObserver:self
+        [[NSNotificationCenter defaultCenter] removeObserver:self
             name:NSWindowDidBecomeKeyNotification object:window];
-        [defaultNotificationCenter removeObserver:self
+        [[NSNotificationCenter defaultCenter] removeObserver:self
             name:NSWindowDidResignKeyNotification object:window];
-        [defaultNotificationCenter removeObserver:self
+        [[NSNotificationCenter defaultCenter] removeObserver:self
             name:NSWindowWillOrderOnScreenNotification object:window];
-        [defaultNotificationCenter removeObserver:self
+        [[NSNotificationCenter defaultCenter] removeObserver:self
             name:NSWindowWillOrderOffScreenNotification object:window];
-        [defaultNotificationCenter removeObserver:self
+        [[NSNotificationCenter defaultCenter] removeObserver:self
             name:windowDidChangeBackingPropertiesNotification object:window];
-        [defaultNotificationCenter removeObserver:self
+        [[NSNotificationCenter defaultCenter] removeObserver:self
             name:NSWindowDidChangeScreenNotification object:window];
-        [defaultNotificationCenter removeObserver:self
+        [[NSNotificationCenter defaultCenter] removeObserver:self
             name:NSWindowDidMiniaturizeNotification object:window];
-        [defaultNotificationCenter removeObserver:self
+        [[NSNotificationCenter defaultCenter] removeObserver:self
             name:NSWindowDidDeminiaturizeNotification object:window];
-        [defaultNotificationCenter removeObserver:self
-            name:NSWindowDidChangeOcclusionStateNotification object:window];
         [_private->windowVisibilityObserver stopObserving:window];
     }
 }
@@ -6219,12 +6193,6 @@ static NSString * const backingPropertyOldScaleFactorKey = @"NSBackingPropertyOl
 
     _private->page->setDeviceScaleFactor(newBackingScaleFactor);
 }
-
-- (void)_windowDidChangeOcclusionState:(NSNotification *)notification
-{
-    [self _updateVisibilityState];
-}
-
 #else
 - (void)_wakWindowScreenScaleChanged:(NSNotification *)notification
 {
index c77f6ed..da555b9 100644 (file)
@@ -211,7 +211,6 @@ private:
     std::unique_ptr<WebCore::TextIndicatorWindow> textIndicatorWindow;
     BOOL hasInitializedLookupObserver;
     RetainPtr<WebWindowVisibilityObserver> windowVisibilityObserver;
-    BOOL windowOcclusionDetectionEnabled;
     RetainPtr<NSEvent> pressureEvent;
 #endif // PLATFORM(MAC)
 
index 8b49782..a74834a 100644 (file)
@@ -183,10 +183,6 @@ void WebViewLayerFlushScheduler::layerFlushCallback()
     usesPageCache = YES;
     shouldUpdateWhileOffscreen = YES;
 
-#if !PLATFORM(IOS_FAMILY)
-    windowOcclusionDetectionEnabled = YES;
-#endif
-
     zoomMultiplier = 1;
     zoomsTextOnly = NO;
 
index 299fe67..a8be2f6 100644 (file)
@@ -852,11 +852,6 @@ Could be worth adding to the API.
 - (WebPageVisibilityState)_visibilityState;
 - (void)_setVisibilityState:(WebPageVisibilityState)visibilityState isInitialState:(BOOL)isInitialState;
 
-#if !TARGET_OS_IPHONE
-- (BOOL)windowOcclusionDetectionEnabled;
-- (void)setWindowOcclusionDetectionEnabled:(BOOL)flag;
-#endif
-
 // Whether the column-break-{before,after} properties are respected instead of the
 // page-break-{before,after} properties.
 - (void)_setPaginationBehavesLikeColumns:(BOOL)behavesLikeColumns;
index a3936ed..ef554be 100644 (file)
@@ -1,3 +1,16 @@
+2018-12-20  Ryan Haddad  <ryanhaddad@apple.com>
+
+        Unreviewed, rolling out r239417.
+
+        Introduced two API test failures on macOS.
+
+        Reverted changeset:
+
+        "<rdar://problem/46194315> macOS: WebKit1 does not handle
+        occlusion changes"
+        https://bugs.webkit.org/show_bug.cgi?id=192821
+        https://trac.webkit.org/changeset/239417
+
 2018-12-20  Devin Rousso  <drousso@apple.com>
 
         Web Inspector: UIString should take an optional key and description to aid localization
index 721d92c..ae4b213 100644 (file)
@@ -724,7 +724,6 @@ WebView *createWebViewAndOffscreenWindow()
     [WebView registerURLSchemeAsLocal:@"feedsearch"];
 
 #if PLATFORM(MAC)
-    [webView setWindowOcclusionDetectionEnabled:NO];
     [WebView _setFontWhitelist:fontWhitelist()];
 #endif