+2013-02-28 Kiran Muppala <cmuppala@apple.com>
+
+ Add private API to disable WKView window occlusion detection
+ https://bugs.webkit.org/show_bug.cgi?id=111107
+
+ Reviewed by Simon Fraser.
+
+ * UIProcess/API/mac/WKView.mm:
+ (-[WKView _enableWindowOcclusionNotifications]): Check if occlusion
+ detection is enabled before enabling notifications.
+ (windowBecameOccluded): Ditto before changing window occlusion state.
+ (-[WKView initWithFrame:contextRef:pageGroupRef:relatedToPage:]):
+ Initialize occlusion detection enabled flag to "YES".
+ (-[WKView windowOcclusionDetectionEnabled]):
+ (-[WKView setWindowOcclusionDetectionEnabled:]):
+ * UIProcess/API/mac/WKViewPrivate.h:
+
2013-02-28 Anders Carlsson <andersca@apple.com>
Add the notion of an allowed connection to SessionStorageNamespace
NSSize _intrinsicContentSize;
BOOL _expandsToFitContentViaAutoLayout;
BOOL _isWindowOccluded;
+ BOOL _windowOcclusionDetectionEnabled;
}
@end
- (void)_enableWindowOcclusionNotifications
{
#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
+ if (![self windowOcclusionDetectionEnabled])
+ return;
+
NSWindow *window = [self window];
if (!window)
return;
Vector<WKView *>& allViews = [WKView _allViews];
for (size_t i = 0, size = allViews.size(); i < size; ++i) {
WKView *view = allViews[i];
- if ([[view window] windowNumber] == windowID)
+ if ([[view window] windowNumber] == windowID && [view windowOcclusionDetectionEnabled])
[view _setIsWindowOccluded:YES];
}
}
_data->_expandsToFitContentViaAutoLayout = NO;
_data->_intrinsicContentSize = NSMakeSize(NSViewNoInstrinsicMetric, NSViewNoInstrinsicMetric);
+ _data->_windowOcclusionDetectionEnabled = YES;
[self _registerDraggedTypes];
return _data->_viewInWindowChangesDeferredCount;
}
+- (BOOL)windowOcclusionDetectionEnabled
+{
+ return _data->_windowOcclusionDetectionEnabled;
+}
+
+- (void)setWindowOcclusionDetectionEnabled:(BOOL)flag
+{
+ if (_data->_windowOcclusionDetectionEnabled == flag)
+ return;
+ _data->_windowOcclusionDetectionEnabled = flag;
+ if (flag)
+ [self _enableWindowOcclusionNotifications];
+ else
+ [self _disableWindowOcclusionNotifications];
+}
+
@end
@implementation WKResponderChainSink