<rdar://problem/46194315> macOS: WebKit1 does not handle occlusion changes
authorbenjamin@webkit.org <benjamin@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 20 Dec 2018 01:41:35 +0000 (01:41 +0000)
committerbenjamin@webkit.org <benjamin@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 20 Dec 2018 01:41:35 +0000 (01:41 +0000)
commit213071fe99db643396eb12d72b81eb0ddaffeba5
tree6bc87dea34fe3f2a18b349f09bb65e43ea4ab62f
parent31abe70512add212643ab3ac510d1a493bf5c093
<rdar://problem/46194315> macOS: WebKit1 does not handle occlusion changes
https://bugs.webkit.org/show_bug.cgi?id=192821

Reviewed by Chris Dumez.

Source/WebKitLegacy/mac:

When a window becomes occluded, the window server informs the application.
This should be used to suspend any work that is not visible by the user.

WebKit2 handles it just fine, but WebKit1 did not handle the notification.
In some cases, that lead to performance impact (see radar).

This patch adds an observer for the occlusion notification. I tried to stick
with the same names used by WebKit2.

* WebView/WebView.mm:
(-[WebView _isViewVisible]):
(-[WebView addWindowObserversForWindow:]):
(-[WebView removeWindowObservers]):
(-[WebView _windowDidChangeOcclusionState:]):

Tools:

* DumpRenderTree/mac/DumpRenderTree.mm:
(createWebViewAndOffscreenWindow):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239417 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