Title: [176055] branches/safari-600.3-branch/Source/WebKit2
- Revision
- 176055
- Author
- [email protected]
- Date
- 2014-11-12 18:11:14 -0800 (Wed, 12 Nov 2014)
Log Message
Merged r175973. rdar://problems/18855914
Modified Paths
Diff
Modified: branches/safari-600.3-branch/Source/WebKit2/ChangeLog (176054 => 176055)
--- branches/safari-600.3-branch/Source/WebKit2/ChangeLog 2014-11-13 02:11:09 UTC (rev 176054)
+++ branches/safari-600.3-branch/Source/WebKit2/ChangeLog 2014-11-13 02:11:14 UTC (rev 176055)
@@ -1,5 +1,41 @@
2014-11-12 Matthew Hanson <[email protected]>
+ Merge r175973. <rdar://problem/18855914>
+
+ 2014-11-11 Tim Horton <[email protected]>
+
+ Occasional assertion failure under recommendedScrollbarStyleDidChange()
+ https://bugs.webkit.org/show_bug.cgi?id=138604
+ <rdar://problem/18855914>
+
+ Reviewed by Beth Dakin.
+
+ It is possible for AppKit to install tracking areas into our view
+ behind our back, but we have code that depends on knowing exactly
+ the set of tracking areas installed on WKView.
+
+ Make this more robust by keeping a reference to the tracking area we
+ use for many things and manipulating that instead of making assumptions
+ about the total set of tracking areas on WKView.
+
+ * UIProcess/API/mac/WKView.mm:
+ (-[WKView _primaryTrackingArea]):
+ (-[WKView _replacePrimaryTrackingArea:]):
+ Provide a 'primary' tracking area setter/getter.
+
+ (-[WKView initWithFrame:context:configuration:webView:]):
+ Keep a reference to the original tracking area installed at initialization time.
+
+ * UIProcess/API/mac/WKViewInternal.h:
+ * UIProcess/mac/PageClientImpl.mm:
+ (WebKit::PageClientImpl::recommendedScrollbarStyleDidChange):
+ Instead of walking the set of tracking areas, make use of the fact that
+ we know exactly which tracking area we installed, and uninstall just that
+ one, and replace it with our newly-built one.
+
+
+2014-11-12 Matthew Hanson <[email protected]>
+
Merge r175969. <rdar://problem/18932770>
2014-11-11 Timothy Horton <[email protected]>
Modified: branches/safari-600.3-branch/Source/WebKit2/UIProcess/API/mac/WKView.mm (176054 => 176055)
--- branches/safari-600.3-branch/Source/WebKit2/UIProcess/API/mac/WKView.mm 2014-11-13 02:11:09 UTC (rev 176054)
+++ branches/safari-600.3-branch/Source/WebKit2/UIProcess/API/mac/WKView.mm 2014-11-13 02:11:14 UTC (rev 176055)
@@ -170,6 +170,8 @@
RetainPtr<WKBrowsingContextController> _browsingContextController;
#endif
+ RetainPtr<NSTrackingArea> _primaryTrackingArea;
+
// For ToolTips.
NSToolTipTag _lastToolTipTag;
id _trackingRectOwner;
@@ -3493,6 +3495,18 @@
return _data->_page->suppressVisibilityUpdates();
}
+- (NSTrackingArea *)_primaryTrackingArea
+{
+ return _data->_primaryTrackingArea.get();
+}
+
+- (void)_setPrimaryTrackingArea:(NSTrackingArea *)trackingArea
+{
+ [self removeTrackingArea:_data->_primaryTrackingArea.get()];
+ _data->_primaryTrackingArea = trackingArea;
+ [self addTrackingArea:trackingArea];
+}
+
- (instancetype)initWithFrame:(NSRect)frame context:(WebContext&)context configuration:(WebPageConfiguration)webPageConfiguration webView:(WKWebView *)webView
{
self = [super initWithFrame:frame];
@@ -3510,14 +3524,10 @@
else
options |= NSTrackingActiveInKeyWindow;
- NSTrackingArea *trackingArea = [[NSTrackingArea alloc] initWithRect:frame
- options:options
- owner:self
- userInfo:nil];
- [self addTrackingArea:trackingArea];
- [trackingArea release];
+ _data = [[WKViewData alloc] init];
+ _data->_primaryTrackingArea = adoptNS([[NSTrackingArea alloc] initWithRect:frame options:options owner:self userInfo:nil]);
+ [self addTrackingArea:_data->_primaryTrackingArea.get()];
- _data = [[WKViewData alloc] init];
_data->_pageClient = std::make_unique<PageClientImpl>(self, webView);
_data->_page = context.createWebPage(*_data->_pageClient, WTF::move(webPageConfiguration));
_data->_page->setAddsVisitedLinks(context.historyClient().addsVisitedLinks());
Modified: branches/safari-600.3-branch/Source/WebKit2/UIProcess/API/mac/WKViewInternal.h (176054 => 176055)
--- branches/safari-600.3-branch/Source/WebKit2/UIProcess/API/mac/WKViewInternal.h 2014-11-13 02:11:09 UTC (rev 176054)
+++ branches/safari-600.3-branch/Source/WebKit2/UIProcess/API/mac/WKViewInternal.h 2014-11-13 02:11:14 UTC (rev 176055)
@@ -133,4 +133,6 @@
- (void)_dismissActionMenuPopovers;
+@property (nonatomic, retain, setter=_setPrimaryTrackingArea:) NSTrackingArea *_primaryTrackingArea;
+
@end
Modified: branches/safari-600.3-branch/Source/WebKit2/UIProcess/mac/PageClientImpl.mm (176054 => 176055)
--- branches/safari-600.3-branch/Source/WebKit2/UIProcess/mac/PageClientImpl.mm 2014-11-13 02:11:09 UTC (rev 176054)
+++ branches/safari-600.3-branch/Source/WebKit2/UIProcess/mac/PageClientImpl.mm 2014-11-13 02:11:14 UTC (rev 176055)
@@ -585,13 +585,6 @@
void PageClientImpl::recommendedScrollbarStyleDidChange(int32_t newStyle)
{
- NSArray *trackingAreas = [m_wkView trackingAreas];
- NSUInteger count = [trackingAreas count];
- ASSERT(count == 1);
-
- for (NSUInteger i = 0; i < count; ++i)
- [m_wkView removeTrackingArea:[trackingAreas objectAtIndex:i]];
-
// Now re-create a tracking area with the appropriate options given the new scrollbar style
NSTrackingAreaOptions options = NSTrackingMouseMoved | NSTrackingMouseEnteredAndExited | NSTrackingInVisibleRect;
if (newStyle == NSScrollerStyleLegacy)
@@ -599,12 +592,8 @@
else
options |= NSTrackingActiveInKeyWindow;
- NSTrackingArea *trackingArea = [[NSTrackingArea alloc] initWithRect:[m_wkView frame]
- options:options
- owner:m_wkView
- userInfo:nil];
- [m_wkView addTrackingArea:trackingArea];
- [trackingArea release];
+ RetainPtr<NSTrackingArea> trackingArea = adoptNS([[NSTrackingArea alloc] initWithRect:[m_wkView frame] options:options owner:m_wkView userInfo:nil]);
+ [m_wkView _setPrimaryTrackingArea:trackingArea.get()];
}
void PageClientImpl::intrinsicContentSizeDidChange(const IntSize& intrinsicContentSize)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes