[GTK] Runtime critical warnings when closing a page containing windowed plugins
[WebKit-https.git] / Source / WebKit2 / ChangeLog
1 2015-11-11  Carlos Garcia Campos  <cgarcia@igalia.com>
2
3         [GTK] Runtime critical warnings when closing a page containing windowed plugins
4         https://bugs.webkit.org/show_bug.cgi?id=151132
5
6         Reviewed by Martin Robinson.
7
8         This is because our plugin widget, that is a GtkPlug (derived from
9         GtkWindow), can receive the delete-event signal before
10         NetscapePlugin::platformDestroy is called. The delete-event
11         signal, by default, destroys the window when the signal is not
12         handled. So, after the delete-event the GtkPlug is destroyed, but
13         our pointer hasn't been reset. We can handle the delete-event
14         using gtk_widget_hide_on_delete as callback, so that the plugin
15         widget is hidden instead of destroyed.
16
17         * WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp:
18         (WebKit::NetscapePlugin::platformPostInitializeWindowed):
19
20 2015-11-11  Carlos Garcia Campos  <cgarcia@igalia.com>
21
22         REGRESSION(r191856): [GTK] SOCK_SEQPACKET no longer used after r191856
23         https://bugs.webkit.org/show_bug.cgi?id=151129
24
25         Reviewed by Martin Robinson.
26
27         r191856 unconditionally disabled SOCK_SEQPACKET for GTK port.
28
29         * Platform/IPC/unix/ConnectionUnix.cpp: Use always SOCK_SEQPACKET
30         when available.
31
32 2015-11-10  Alex Christensen  <achristensen@webkit.org>
33
34         Implement authentication challenge handling when using NETWORK_SESSION
35         https://bugs.webkit.org/show_bug.cgi?id=150968
36
37         Reviewed by Antti Koivisto.
38
39         * NetworkProcess/NetworkLoad.cpp:
40         (WebKit::NetworkLoad::didReceiveChallenge):
41         Copy functionality from NetworkLoad::canAuthenticateAgainstProtectionSpaceAsync (which is used when we don't use NETWORK_SESSION)
42         because there is no canAuthenticateAgainstProtectionSpace delegate callback when using NSURLSession, according to
43         https://developer.apple.com/library/ios/documentation/Cocoa/Conceptual/URLLoadingSystem/Articles/AuthenticationChallenges.html
44         Instead, all authentication challenge callbacks go to URLSession:task:didReceiveChallenge:completionHandler:
45         because we do not implement URLSession:didReceiveChallenge:completionHandler:
46         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
47         (-[NetworkSessionDelegate URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:]):
48         (-[NetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:]):
49         (-[NetworkSessionDelegate URLSession:dataTask:didReceiveResponse:completionHandler:]):
50         Make a block copy of the completion handlers so we can copy the std::functions that wrap them into HashMaps and call them later,
51         in this case we call the completion handler after the UIProcess gives us credentials for an authentication challenge.
52         * Shared/Authentication/AuthenticationManager.cpp:
53         (WebKit::AuthenticationManager::AuthenticationManager):
54         (WebKit::AuthenticationManager::addChallengeToChallengeMap):
55         (WebKit::AuthenticationManager::shouldCoalesceChallenge):
56         (WebKit::AuthenticationManager::coalesceChallengesMatching):
57         (WebKit::AuthenticationManager::didReceiveAuthenticationChallenge):
58         Fix an existing bug that caused multiple calls to addChallengeToChallengeMap for one challenge.  This caused too many calls to 
59         the AuthenticationClient methods, which did not cause a problem because they were not one-time-use block copies of completion handlers before.
60         (WebKit::AuthenticationManager::useCredentialForSingleChallenge):
61         (WebKit::AuthenticationManager::continueWithoutCredentialForChallenge):
62         (WebKit::AuthenticationManager::continueWithoutCredentialForSingleChallenge):
63         (WebKit::AuthenticationManager::cancelChallenge):
64         (WebKit::AuthenticationManager::cancelSingleChallenge):
65         (WebKit::AuthenticationManager::performDefaultHandling):
66         (WebKit::AuthenticationManager::performDefaultHandlingForSingleChallenge):
67         (WebKit::AuthenticationManager::rejectProtectionSpaceAndContinue):
68         (WebKit::AuthenticationManager::rejectProtectionSpaceAndContinueForSingleChallenge):
69         Call completion handlers which we stored in a HashMap before doing IPC if we are using NETWORK_SESSION,
70         which has completion handlers instead of continueSomething client calls.
71         * Shared/Authentication/AuthenticationManager.h:
72         (WebKit::AuthenticationManager::outstandingAuthenticationChallengeCount):
73         * Shared/Downloads/Download.cpp:
74         (WebKit::Download::didReceiveAuthenticationChallenge):
75         (WebKit::Download::didReceiveResponse):
76         * Shared/Downloads/DownloadAuthenticationClient.cpp:
77         (WebKit::DownloadAuthenticationClient::receivedChallengeRejection):
78         * Shared/Downloads/DownloadAuthenticationClient.h:
79         Add ifdefs for code related to downloading I will implement later.
80
81 2015-11-10  Simon Fraser  <simon.fraser@apple.com>
82
83         Use different pixel formats for displays that support them
84         https://bugs.webkit.org/show_bug.cgi?id=151122
85         rdar://problem/22846841
86
87         Reviewed by Tim Horton.
88         
89         New the new IOSurface formats when appropriate for the properties of the
90         display.
91
92         * Shared/mac/RemoteLayerBackingStore.mm:
93         (WebKit::bufferFormat):
94         (WebKit::RemoteLayerBackingStore::swapToValidFrontBuffer):
95
96 2015-11-10  Tim Horton  <timothy_horton@apple.com>
97
98         Adopt formal protocols for CA delegates
99         https://bugs.webkit.org/show_bug.cgi?id=151121
100         <rdar://problem/6739193>
101
102         Reviewed by Anders Carlsson.
103
104         * UIProcess/API/Cocoa/WKWebView.mm:
105         * UIProcess/Cocoa/WebViewImpl.mm:
106         * UIProcess/mac/WKTextFinderClient.mm:
107         * UIProcess/mac/WebPageProxyMac.mm:
108         * WebKit2.xcodeproj/project.pbxproj:
109         * WebProcess/cocoa/WebProcessCocoa.mm:
110         Adapt to the split out SPI headers.
111
112         * WebProcess/WebPage/mac/PlatformCAAnimationRemote.mm:
113         Conform!
114
115 2015-11-10  Dan Bernstein  <mitz@apple.com>
116
117         Fixed the build.
118
119         * DatabaseProcess/EntryPoint/mac/XPCService/DatabaseServiceEntryPoint.mm:
120         (DatabaseServiceInitializer):
121         * NetworkProcess/EntryPoint/mac/XPCService/NetworkServiceEntryPoint.mm:
122         (NetworkServiceInitializer):
123         * WebProcess/EntryPoint/mac/XPCService/WebContentServiceEntryPoint.mm:
124         (WebContentServiceInitializer):
125
126 2015-11-10  Chris Dumez  <cdumez@apple.com>
127
128         [WK2][NetworkCache] Rename SpeculativeLoader to SpeculativeLoadManager
129         https://bugs.webkit.org/show_bug.cgi?id=151110
130
131         Reviewed by Alex Christensen.
132
133         Rename SpeculativeLoader to SpeculativeLoadManager for clarity, as it
134         manages all speculative loads.
135
136         * NetworkProcess/cache/NetworkCache.cpp:
137         (WebKit::NetworkCache::Cache::initialize):
138         (WebKit::NetworkCache::Cache::retrieve):
139         * NetworkProcess/cache/NetworkCache.h:
140         * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp: Renamed from Source/WebKit2/NetworkProcess/cache/NetworkCacheSpeculativeLoader.cpp.
141         (WebKit::NetworkCache::subresourcesType):
142         (WebKit::NetworkCache::makeSubresourcesKey):
143         (WebKit::NetworkCache::SpeculativeLoadManager::PendingFrameLoad::PendingFrameLoad):
144         (WebKit::NetworkCache::SpeculativeLoadManager::PendingFrameLoad::registerSubresource):
145         (WebKit::NetworkCache::SpeculativeLoadManager::PendingFrameLoad::encodeAsSubresourcesRecord):
146         (WebKit::NetworkCache::SpeculativeLoadManager::PendingFrameLoad::markAsCompleted):
147         (WebKit::NetworkCache::SpeculativeLoadManager::SpeculativeLoadManager):
148         (WebKit::NetworkCache::SpeculativeLoadManager::~SpeculativeLoadManager):
149         (WebKit::NetworkCache::SpeculativeLoadManager::registerLoad):
150         * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.h: Renamed from Source/WebKit2/NetworkProcess/cache/NetworkCacheSpeculativeLoader.h.
151         * WebKit2.xcodeproj/project.pbxproj:
152
153 2015-11-10  Tim Horton  <timothy_horton@apple.com>
154
155         Add WKWebViewConfiguration SPI for a variety of different ex-preferences
156         https://bugs.webkit.org/show_bug.cgi?id=151070
157         <rdar://problem/23020454>
158
159         Reviewed by Anders Carlsson.
160
161         * UIProcess/API/Cocoa/WKWebView.mm:
162         (-[WKWebView initWithFrame:configuration:]):
163         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
164         (-[WKWebViewConfiguration init]):
165         (-[WKWebViewConfiguration copyWithZone:]):
166         (-[WKWebViewConfiguration _setRespectsImageOrientation:]):
167         (-[WKWebViewConfiguration _respectsImageOrientation]):
168         (-[WKWebViewConfiguration _setPrintsBackgrounds:]):
169         (-[WKWebViewConfiguration _printsBackgrounds]):
170         (-[WKWebViewConfiguration _setIncrementalRenderingSuppressionTimeout:]):
171         (-[WKWebViewConfiguration _incrementalRenderingSuppressionTimeout]):
172         (-[WKWebViewConfiguration _setAllowsJavaScriptMarkup:]):
173         (-[WKWebViewConfiguration _allowsJavaScriptMarkup]):
174         (-[WKWebViewConfiguration _setConvertsPositionStyleOnCopy:]):
175         (-[WKWebViewConfiguration _convertsPositionStyleOnCopy]):
176         (-[WKWebViewConfiguration _setAllowsMetaRefresh:]):
177         (-[WKWebViewConfiguration _allowsMetaRefresh]):
178         (-[WKWebViewConfiguration _setShowsURLsInToolTips:]):
179         (-[WKWebViewConfiguration _showsURLsInToolTips]):
180         (-[WKWebViewConfiguration _setServiceControlsEnabled:]):
181         (-[WKWebViewConfiguration _serviceControlsEnabled]):
182         (-[WKWebViewConfiguration _setImageControlsEnabled:]):
183         (-[WKWebViewConfiguration _imageControlsEnabled]):
184         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
185         Plumb some configuration SPI for various clients.
186
187 2015-11-10  Chris Dumez  <cdumez@apple.com>
188
189         [WK2][iOS] Update WebContent sandbox profile to allow loading injected bundles again
190         https://bugs.webkit.org/show_bug.cgi?id=151102
191         <rdar://problem/23442311>
192
193         Reviewed by Dan Bernstein.
194
195         Update WebContent sandbox profile to allow loading injected bundles again.
196
197         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
198
199 2015-11-10  Carlos Garcia Campos  <cgarcia@igalia.com>
200
201         [UNIX] Environment variable should take precedence over directories in plugin search path
202         https://bugs.webkit.org/show_bug.cgi?id=151096
203
204         Reviewed by Martin Robinson.
205
206         Otherwise you can't override the directories using the env vars
207         for plugins already installed.
208
209         * Shared/Plugins/unix/PluginSearchPath.cpp:
210         (WebKit::pluginsDirectories):
211
212 2015-11-10  Carlos Garcia Campos  <cgarcia@igalia.com>
213
214         [GTK] Use CROSS_PLATFORM_CONTEXT_MENUS
215         https://bugs.webkit.org/show_bug.cgi?id=150642
216
217         Reviewed by Martin Robinson.
218
219         Use CROSS_PLATFORM_CONTEXT_MENUS. Since we can't just use
220         WebContextMenuItemData, because we need to bind a GtkAction to the
221         menu items, this patch adds WebContextMenuItemGtk that derives
222         from WebContextMenuItemData and adds the GtkAction and its own
223         handling of submenu items. WebKitContextMenu and
224         WebKitContextMenuItem no longer deal with the widgets (GtkMenu and
225         GtkMenuItem), that are now created by WebContextMenuProxy when
226         building the popup menu.
227         This patch also removes the support for input methods submenu,
228         since it has been deprecated (and disabled by default) in GTK+ for
229         long time, it has never actually worked (because the menu items
230         don't have a GtkAction associated) and it makes the code more
231         complicated for no benefit.
232
233         * PlatformGTK.cmake:
234         * Shared/gtk/WebContextMenuItemGtk.cpp: Added.
235         (WebKit::gtkStockIDFromContextMenuAction):
236         (WebKit::WebContextMenuItemGtk::WebContextMenuItemGtk):
237         (WebKit::WebContextMenuItemGtk::~WebContextMenuItemGtk):
238         (WebKit::WebContextMenuItemGtk::createGtkActionIfNeeded):
239         * Shared/gtk/WebContextMenuItemGtk.h: Copied from Source/WebKit2/UIProcess/gtk/WebContextMenuProxyGtk.h.
240         (WebKit::WebContextMenuItemGtk::gtkAction):
241         (WebKit::WebContextMenuItemGtk::submenuItems):
242         * UIProcess/API/gtk/WebKitContextMenu.cpp:
243         (webkitContextMenuPopulate):
244         (webkitContextMenuCreate): Deleted.
245         (webkitContextMenuSetParentItem): Deleted.
246         * UIProcess/API/gtk/WebKitContextMenuActions.cpp:
247         (webkitContextMenuActionGetForContextMenuItem):
248         * UIProcess/API/gtk/WebKitContextMenuActionsPrivate.h:
249         * UIProcess/API/gtk/WebKitContextMenuItem.cpp:
250         (webkitContextMenuItemSetSubMenu):
251         (webkitContextMenuItemCreate):
252         (webkitContextMenuItemToWebContextMenuItemGtk):
253         (webkitContextMenuItemToWebContextMenuItemData):
254         (webkit_context_menu_item_new):
255         (webkit_context_menu_item_new_from_stock_action):
256         (webkit_context_menu_item_new_from_stock_action_with_label):
257         (webkit_context_menu_item_new_with_submenu):
258         (webkit_context_menu_item_new_separator):
259         (webkit_context_menu_item_get_action):
260         (webkit_context_menu_item_get_stock_action):
261         (webkit_context_menu_item_is_separator): Deleted.
262         * UIProcess/API/gtk/WebKitContextMenuItemPrivate.h:
263         * UIProcess/API/gtk/WebKitContextMenuPrivate.h:
264         * UIProcess/API/gtk/WebKitWebView.cpp:
265         (webkitWebViewPopulateContextMenu):
266         (contextMenuDismissed): Deleted.
267         (webkitWebViewSubmitFormRequest): Deleted.
268         (webkitWebViewHandleAuthenticationChallenge): Deleted.
269         (webkitWebViewInsecureContentDetected): Deleted.
270         (webkitWebViewEmitRunColorChooser): Deleted.
271         (webkitWebViewRequestInstallMissingMediaPlugins): Deleted.
272         * UIProcess/gtk/WebContextMenuProxyGtk.cpp:
273         (WebKit::contextMenuItemActivatedCallback):
274         (WebKit::WebContextMenuProxyGtk::append):
275         (WebKit::WebContextMenuProxyGtk::populate):
276         (WebKit::WebContextMenuProxyGtk::show):
277         (WebKit::WebContextMenuProxyGtk::WebContextMenuProxyGtk):
278         (WebKit::WebContextMenuProxyGtk::~WebContextMenuProxyGtk):
279         * UIProcess/gtk/WebContextMenuProxyGtk.h:
280         (WebKit::WebContextMenuProxyGtk::gtkMenu):
281         * WebProcess/InjectedBundle/API/gtk/WebKitWebPage.cpp:
282
283 2015-11-09  Carlos Garcia Campos  <cgarcia@igalia.com>
284
285         Unreviewed. Fix GTK+ build after r192184.
286
287         * WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp:
288         (WebKit::LayerTreeHostGtk::initialize):
289         (WebKit::LayerTreeHostGtk::pageBackgroundTransparencyChanged):
290
291 2015-11-09  Eric Carlson  <eric.carlson@apple.com>
292
293         [Mac] Add a mock AppleTV device for testing
294         https://bugs.webkit.org/show_bug.cgi?id=148912
295         <rdar://problem/22596272>
296
297         Reviewed by Tim Horton.
298
299         * Shared/WebCoreArgumentCoders.cpp:
300         (IPC::ArgumentCoder<MediaPlaybackTargetContext>::encode): Update for MediaPlaybackTargetContext changes.
301         (IPC::ArgumentCoder<MediaPlaybackTargetContext>::decode): Ditto.
302         * Shared/WebCoreArgumentCoders.h:
303
304         * Shared/mac/WebCoreArgumentCodersMac.mm:
305         (IPC::ArgumentCoder<MediaPlaybackTargetContext>::encodePlatformData): Ditto.
306         (IPC::ArgumentCoder<MediaPlaybackTargetContext>::decodePlatformData): Ditto.
307
308         * UIProcess/WebPageProxy.cpp:
309         (WebKit::WebPageProxy::setMockMediaPlaybackTargetPickerEnabled): New.
310         (WebKit::WebPageProxy::setMockMediaPlaybackTargetPickerState): Ditto.
311         * UIProcess/WebPageProxy.h:
312
313         * UIProcess/WebPageProxy.messages.in: Add SetMockMediaPlaybackTargetPickerEnabled and 
314           SetMockMediaPlaybackTargetPickerState.
315
316         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
317         (WebKit::WebChromeClient::setMockMediaPlaybackTargetPickerEnabled): New.
318         (WebKit::WebChromeClient::setMockMediaPlaybackTargetPickerState): Ditto.
319         * WebProcess/WebCoreSupport/WebChromeClient.h:
320
321         * WebProcess/WebPage/WebPage.h: MediaPlaybackTargetContext is a class, not a struct.
322
323         * WebProcess/WebPage/WebPage.messages.in: Ditto.
324
325         * WebProcess/WebPage/mac/WebPageMac.mm:
326         (WebKit::WebPage::playbackTargetSelected): Support mock target.
327
328 2015-11-09  Ryuan Choi  <ryuan.choi@navercorp.com>
329
330         [EFL] Crash while opening child webview with EWK_PROCESS_MODEL_MULTIPLE_SECONDARY
331         https://bugs.webkit.org/show_bug.cgi?id=145924
332
333         Reviewed by Gyuyoung Kim.
334
335         There are some crashes when we clicked the link that opens child window
336         via window.open or <a> tag with _blank target if process model is multiple
337         secondary.
338
339         It's because multiple secondary process model tries to assign new webprocess
340         if related page is null. In order to keep the child window in same process
341         with opener, we should pass related page when we create WebPageProxy.
342
343         This patch adds ewk_view_configuration object and ewk_view_add_configuration()
344         to pass related page to WebPageProxy.
345
346         * PlatformEfl.cmake:
347         * UIProcess/API/C/CoordinatedGraphics/WKView.cpp:
348         (WKViewCreate):
349         * UIProcess/API/C/CoordinatedGraphics/WKView.h:
350         * UIProcess/API/efl/EWebKit2.h.in:
351         * UIProcess/API/efl/EwkView.cpp:
352         (EwkView::createNewPage):
353         * UIProcess/API/efl/ewk_view_configuration.cpp: Added.
354         * UIProcess/API/efl/ewk_view_configuration.h: Added.
355         * UIProcess/API/efl/ewk_view_configuration_private.h: Added.
356         * UIProcess/API/efl/ewk_view.cpp:
357         (EWKViewCreate):
358         (ewk_view_smart_add):
359         (ewk_view_add_with_configuration): Added to pass configuration.
360         (ewk_view_add_with_context):
361         * UIProcess/API/efl/ewk_view.h:
362         * UIProcess/API/efl/ewk_view_private.h:
363         * UIProcess/API/efl/tests/UnitTestUtils/EWK2UnitTestBase.cpp:
364         (EWK2UnitTest::EWK2UnitTestBase::waitUntilTitleChangedTo):
365         (EWK2UnitTest::EWK2UnitTestBase::waitUntilNotNull):
366         * UIProcess/API/efl/tests/UnitTestUtils/EWK2UnitTestBase.h:
367         * UIProcess/API/efl/tests/test_ewk2_view.cpp: Added test cases to test window_create smart method.
368         (windowCreateCallback):
369         (TEST_F):
370         (EWK2ViewTestNewWindowWithMultipleProcesses::EWK2ViewTestNewWindowWithMultipleProcesses):
371         * UIProcess/API/efl/tests/test_ewk2_window_features.cpp:
372         (EWK2WindowFeaturesTest::createDefaultWindow):
373         (EWK2WindowFeaturesTest::createWindow):
374         * UIProcess/CoordinatedGraphics/WebView.cpp:
375         (WebKit::WebView::WebView):
376         * UIProcess/CoordinatedGraphics/WebView.h:
377         * UIProcess/efl/WebInspectorProxyEfl.cpp:
378         (WebKit::WebInspectorProxy::platformCreateInspectorPage):
379         * UIProcess/efl/WebViewEfl.cpp:
380         (WebKit::WebView::create):
381         (WebKit::WebViewEfl::WebViewEfl):
382         * UIProcess/efl/WebViewEfl.h:
383
384 2015-11-09  Anders Carlsson  <andersca@apple.com>
385
386         Don't call Vector::uncheckedAppend on a vector that we haven't reserved the capacity for
387         https://bugs.webkit.org/show_bug.cgi?id=151069
388         rdar://problem/23473435
389
390         Reviewed by Tim Horton.
391
392         * Shared/API/Cocoa/_WKRemoteObjectInterface.mm:
393         (initializeMethod):
394
395 2015-11-09  Anders Carlsson  <andersca@apple.com>
396
397         Fix 32-bit build.
398
399         * Shared/API/Cocoa/RemoteObjectRegistry.mm:
400         (WebKit::RemoteObjectRegistry::callReplyBlock):
401
402 2015-11-09  Anders Carlsson  <andersca@apple.com>
403
404         Add reply blocks to _WKRemoteObjectInterface similar to NSXPCConnection
405         https://bugs.webkit.org/show_bug.cgi?id=151056
406         rdar://problem/23222609
407
408         Reviewed by Tim Horton.
409
410         * Platform/spi/Cocoa/NSInvocationSPI.h:
411         Add NSBlockInvocation declaration.
412
413         * Shared/API/Cocoa/RemoteObjectInvocation.mm:
414         (WebKit::RemoteObjectInvocation::encode):
415         Encode true if we have a reply ID.
416
417         * Shared/API/Cocoa/RemoteObjectRegistry.h:
418         Add new members.
419
420         * Shared/API/Cocoa/RemoteObjectRegistry.messages.in:
421         Add new CallReplyBlock message.
422
423         * Shared/API/Cocoa/RemoteObjectRegistry.mm:
424         (WebKit::RemoteObjectRegistry::sendReplyBlock):
425         Just send the CallReplyBlock message.
426
427         (WebKit::RemoteObjectRegistry::callReplyBlock):
428         Call through to _WKRemoteObjectRegistry.
429
430         * Shared/API/Cocoa/WKRemoteObjectCoder.h:
431         Pass an optional reply selector.
432
433         * Shared/API/Cocoa/WKRemoteObjectCoder.mm:
434         (encodeInvocationArguments):
435         Don't hard-code the first argument index.
436
437         (encodeInvocation):
438         Encode block invocations.
439
440         (-[WKRemoteObjectDecoder initWithInterface:rootObjectDictionary:replyToSelector:]):
441         Initialize _replyToSelector.
442
443         (validateClass):
444         NSBlockInvocation doesn't need to conform to NSSecureCoding.
445
446         (decodeInvocationArguments):
447         Don't hard-code the first argument, take it as a parameter instead.
448
449         (decodeInvocation):
450         Decode NSBlockInvocations (reply block invocations).
451
452         (decodeObject):
453         Check for NSBlockInvocation.
454
455         * Shared/API/Cocoa/_WKRemoteObjectInterface.mm:
456         (-[_WKRemoteObjectInterface _methodSignatureForSelector:]):
457         Return null if we can't find the method.
458
459         (-[_WKRemoteObjectInterface _methodSignatureForReplyBlockOfSelector:]):
460         Look up the reply block signature and return it.
461
462         (-[_WKRemoteObjectInterface _allowedArgumentClassesForReplyBlockOfSelector:]):
463         Look up the allowed reply argument classes and return them.
464
465         * Shared/API/Cocoa/_WKRemoteObjectInterfaceInternal.h:
466         Add new methods.
467
468         * Shared/API/Cocoa/_WKRemoteObjectRegistry.mm:
469         (PendingReply::PendingReply):
470         Add new object that represents a pending reply.
471
472         (-[_WKRemoteObjectRegistry _sendInvocation:interface:]):
473         If the invocation has a reply block, add a pending reply to our map.
474
475         (-[_WKRemoteObjectRegistry _invokeMethod:]):
476         If the method we're about to invoke has a reply block, construct a special reply block that calls us back with an invocation.
477         Encode this invocation and send it back across the wire.
478
479         (-[_WKRemoteObjectRegistry _callReplyWithID:blockInvocation:]):
480         Find the pending reply, decode the reply block invocation and call it.
481
482         * Shared/API/Cocoa/_WKRemoteObjectRegistryInternal.h:
483         Add new methods.
484
485 2015-11-09  Tim Horton  <timothy_horton@apple.com>
486
487         Add drawsBackground SPI to WKWebView, and get rid of drawsTransparentBackground from WebKit2
488         https://bugs.webkit.org/show_bug.cgi?id=151054
489         <rdar://problem/22907994>
490
491         Reviewed by Simon Fraser.
492
493         * Shared/WebPageCreationParameters.cpp:
494         (WebKit::WebPageCreationParameters::encode): Deleted.
495         (WebKit::WebPageCreationParameters::decode): Deleted.
496         * Shared/WebPageCreationParameters.h:
497         * UIProcess/API/mac/WKView.mm:
498         (-[WKView setDrawsTransparentBackground:]):
499         (-[WKView drawsTransparentBackground]):
500         * UIProcess/Cocoa/WebViewImpl.h:
501         * UIProcess/Cocoa/WebViewImpl.mm:
502         (WebKit::WebViewImpl::updateLayer):
503         (WebKit::WebViewImpl::setDrawsTransparentBackground): Deleted.
504         (WebKit::WebViewImpl::drawsTransparentBackground): Deleted.
505         * UIProcess/WebPageProxy.cpp:
506         (WebKit::WebPageProxy::WebPageProxy): Deleted.
507         (WebKit::WebPageProxy::setDrawsTransparentBackground): Deleted.
508         (WebKit::WebPageProxy::creationParameters): Deleted.
509         * UIProcess/WebPageProxy.h:
510         (WebKit::WebPageProxy::drawsTransparentBackground): Deleted.
511         * UIProcess/mac/WebInspectorProxyMac.mm:
512         (WebKit::WebInspectorProxy::platformCreateInspectorPage):
513         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
514         (WebKit::WebFrameLoaderClient::transitionToCommittedForNewPage):
515         * WebProcess/WebPage/WebPage.cpp:
516         (WebKit::WebPage::WebPage): Deleted.
517         (WebKit::m_shouldDispatchFakeMouseMoveEvents): Deleted.
518         (WebKit::WebPage::setDrawsTransparentBackground): Deleted.
519         * WebProcess/WebPage/WebPage.h:
520         (WebKit::WebPage::drawsTransparentBackground): Deleted.
521         * WebProcess/WebPage/WebPage.messages.in:
522         Get rid of drawsTransparentBackground. It doesn't seem like there's any observable
523         difference in a layer-backed world. WKView's (set)drawsTransparentBackground
524         will just forward to drawsBackground (inverted).
525
526         * UIProcess/API/Cocoa/WKWebView.mm:
527         (-[WKWebView _webProcessIsResponsive]):
528         Move _webProcessIsResponsive up with the other cross-platform SPI methods, instead
529         of below all of the platform-specific SPI methods.
530
531         (-[WKWebView _drawsBackground]):
532         (-[WKWebView _setDrawsBackground:]):
533         Added.
534
535         (-[WKWebView _drawsTransparentBackground]):
536         (-[WKWebView _setDrawsTransparentBackground:]):
537         Deleted.
538         
539         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
540         Replace drawsTransparentBackground with drawsBackground.
541
542 2015-11-09  Joseph Pecoraro  <pecoraro@apple.com>
543
544         Web Inspector: REGRESSION: 2nd level inspector should not be able to dock to first
545         https://bugs.webkit.org/show_bug.cgi?id=151050
546
547         Reviewed by Brian Burg.
548
549         * UIProcess/mac/WebInspectorProxyMac.mm:
550         (WebKit::WebInspectorProxy::platformCanAttach):
551         Check now that the inspected view can be a WKWebView.
552
553 2015-11-09  Anders Carlsson  <andersca@apple.com>
554
555         Introspect reply block types as well
556         https://bugs.webkit.org/show_bug.cgi?id=151048
557
558         Reviewed by Tim Horton.
559
560         * Shared/API/Cocoa/_WKRemoteObjectInterface.mm:
561         (initializeMethod):
562         (initializeMethods):
563         (-[_WKRemoteObjectInterface debugDescription]):
564
565 2015-11-09  Anders Carlsson  <andersca@apple.com>
566
567         Implement -[_WKRemoteObjectInterface debugDescription] and have it look like the NSXPCInterface equivalent
568         https://bugs.webkit.org/show_bug.cgi?id=151044
569
570         Reviewed by Tim Horton.
571
572         * Shared/API/Cocoa/_WKRemoteObjectInterface.mm:
573         (-[_WKRemoteObjectInterface debugDescription]):
574         (-[_WKRemoteObjectInterface description]): Deleted.
575
576 2015-11-06  Anders Carlsson  <andersca@apple.com>
577
578         Rework the way allowed argument classes are stored
579         https://bugs.webkit.org/show_bug.cgi?id=150992
580
581         Reviewed by Darin Adler.
582
583         Add a separate MethodInfo class so we have someplace to store the reply block arguments.
584         Use HashSet<Class> instead of NSSet. No functionality change intended.
585
586         * Shared/API/Cocoa/WKRemoteObjectCoder.mm:
587         (-[WKRemoteObjectDecoder decodeValueOfObjCType:at:]):
588         (decodeObjectFromObjectStream):
589         (checkIfClassIsAllowed):
590         (decodeInvocationArguments):
591         (decodeObject):
592         (-[WKRemoteObjectDecoder decodeObjectOfClasses:forKey:]):
593         (-[WKRemoteObjectDecoder allowedClasses]):
594         * Shared/API/Cocoa/_WKRemoteObjectInterface.mm:
595         (isContainerClass):
596         (propertyListClasses):
597         (initializeMethod):
598         (initializeMethods):
599         (-[_WKRemoteObjectInterface initWithProtocol:identifier:]):
600         (classesForSelectorArgument):
601         (-[_WKRemoteObjectInterface classesForSelector:argumentIndex:]):
602         (-[_WKRemoteObjectInterface setClasses:forSelector:argumentIndex:]):
603         (-[_WKRemoteObjectInterface _allowedArgumentClassesForSelector:]):
604         (allowedArgumentClassesForMethod): Deleted.
605         (initializeAllowedArgumentClasses): Deleted.
606         * Shared/API/Cocoa/_WKRemoteObjectInterfaceInternal.h:
607
608 2015-11-09  Csaba Osztrogonác  <ossy@webkit.org>
609
610         Unreviewed CMake buildfix after r192113.
611
612         * PlatformMac.cmake: New file added.
613
614 2015-11-09  Csaba Osztrogonác  <ossy@webkit.org>
615
616         Unreviewed speculative CMake buildfix after r192111.
617
618         * CMakeLists.txt: New files added.
619
620 2015-11-08  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
621
622         [EFL] Add UserAgentEFl.cpp|h
623         https://bugs.webkit.org/show_bug.cgi?id=151007
624
625         Reviewed by Darin Adler.
626
627         As other ports EFL port starts to have UserAgentEfl class in order to support more detailed
628         UA.
629
630         * UIProcess/efl/WebPageProxyEfl.cpp:
631         (WebKit::WebPageProxy::standardUserAgent): Call WebCore::standardUserAgent().
632
633 2015-11-07  Simon Fraser  <simon.fraser@apple.com>
634
635         Remove ColorSpace argument to all the drawing calls
636         https://bugs.webkit.org/show_bug.cgi?id=150967
637
638         Reviewed by Darin Adler.
639
640         * Shared/API/c/cg/WKImageCG.cpp:
641         (WKImageCreateFromCGImage):
642         * Shared/ContextMenuContextData.cpp:
643         (WebKit::ContextMenuContextData::ContextMenuContextData):
644         * Shared/WebCoreArgumentCoders.cpp:
645         (IPC::encodeImage):
646         * Shared/mac/RemoteLayerBackingStore.mm:
647         (WebKit::RemoteLayerBackingStore::drawInContext):
648         * UIProcess/API/Cocoa/WKWebView.mm:
649         (-[WKWebView _updateScrollViewBackground]):
650         * UIProcess/WKInspectorHighlightView.mm:
651         (-[WKInspectorHighlightView _layoutForNodeHighlight:offset:]):
652         (-[WKInspectorHighlightView _layoutForRectsHighlight:]):
653         * UIProcess/ios/ViewGestureControllerIOS.mm:
654         (WebKit::ViewGestureController::beginSwipeGesture):
655         * UIProcess/ios/WKContentViewInteraction.mm:
656         (-[WKContentView _updateTapHighlight]):
657         * UIProcess/mac/ViewGestureControllerMac.mm:
658         (WebKit::ViewGestureController::beginSwipeGesture):
659         * WebProcess/WebPage/FindController.cpp:
660         (WebKit::FindController::drawRect):
661         * WebProcess/WebPage/WebFrame.cpp:
662         (WebKit::WebFrame::createSelectionSnapshot):
663         * WebProcess/WebPage/WebPage.cpp:
664         (WebKit::WebPage::snapshotAtSize):
665         * WebProcess/WebPage/ios/FindControllerIOS.mm:
666         (WebKit::FindIndicatorOverlayClientIOS::drawRect):
667         * WebProcess/WebPage/ios/WebPageIOS.mm:
668         (WebKit::WebPage::getPositionInformation):
669         * WebProcess/ios/WebVideoFullscreenManager.mm:
670         (WebKit::WebVideoFullscreenManager::didSetupFullscreen):
671
672 2015-11-07  Simon Fraser  <simon.fraser@apple.com>
673
674         Use ColorSpaceSRGB for image buffers everywhere
675         https://bugs.webkit.org/show_bug.cgi?id=150990
676
677         Reviewed by Zalan Bujtas.
678
679         ColorSpaceSRGB and ColorSpaceDeviceRGB are equivalent now, so convert
680         code that creates image buffers tagged with ColorSpaceDeviceRGB to use ColorSpaceSRGB.
681
682         * Shared/mac/RemoteLayerBackingStore.mm:
683         (WebKit::RemoteLayerBackingStore::decode):
684         (WebKit::RemoteLayerBackingStore::swapToValidFrontBuffer):
685         * UIProcess/API/Cocoa/WKWebView.mm:
686         (-[WKWebView _takeViewSnapshot]):
687         (-[WKWebView _snapshotRect:intoImageOfWidth:completionHandler:]):
688
689 2015-11-06  Brady Eidson  <beidson@apple.com>
690
691         Modern IDB: Make the result data for a "get" request be an IDBGetResult.
692         https://bugs.webkit.org/show_bug.cgi?id=150985
693
694         Reviewed by Alex Christensen.
695
696         * Shared/WebCoreArgumentCoders.cpp:
697         (IPC::ArgumentCoder<IDBGetResult>::encode):
698         (IPC::ArgumentCoder<IDBGetResult>::decode):
699
700 2015-11-06  Tim Horton  <timothy_horton@apple.com>
701
702         Add preliminary (SPI) support for NSTextFinder on WKWebView
703         https://bugs.webkit.org/show_bug.cgi?id=150907
704         <rdar://problem/19171624>
705
706         Reviewed by Darin Adler.
707
708         New API test: WebKit2.FindInPage
709
710         * Platform/spi/mac/AppKitSPI.h:
711         Add some SPI.
712
713         * UIProcess/API/APIFindClient.h:
714         (API::FindClient::didFindString):
715         * UIProcess/API/C/WKPage.cpp:
716         (WKPageSetPageFindClient):
717         * UIProcess/WebPageProxy.cpp:
718         (WebKit::WebPageProxy::didFindString):
719         * UIProcess/WebPageProxy.h:
720         * UIProcess/WebPageProxy.messages.in:
721         * UIProcess/Cocoa/FindClient.h:
722         * UIProcess/Cocoa/FindClient.mm:
723         (WebKit::FindClient::didFindString):
724         Make didFindString return the match rects like didFindStringMatches does.
725
726         * WebProcess/WebPage/FindController.cpp:
727         (WebKit::FindController::updateFindUIAfterPageScroll):
728         (WebKit::FindController::findString):
729         Keep the most recent find match around for incremental find just like we do
730         for the non-incremental version. This way, getImageForFindMatch and selectFindMatch
731         will work for incremental find too!
732
733         * UIProcess/API/Cocoa/WKWebView.mm:
734         (-[WKWebView _ensureTextFinderClient]):
735         (-[WKWebView findMatchesForString:relativeToMatch:findOptions:maxResults:resultCollector:]):
736         (-[WKWebView documentContainerView]):
737         (-[WKWebView getSelectedText:]):
738         (-[WKWebView selectFindMatch:completionHandler:]):
739         Implement NSTextFinder's async client protocol and forward to the new WKTextFinderClient.
740
741         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
742         Privately note our conformance to the aformentioned protocol.
743
744         * UIProcess/mac/WKTextFinderClient.h: Added.
745         * UIProcess/mac/WKTextFinderClient.mm: Added.
746         (WebKit::TextFinderFindClient::TextFinderFindClient):
747         (-[WKTextFinderMatch initWithClient:view:index:rects:]):
748         (-[WKTextFinderMatch containingView]):
749         (-[WKTextFinderMatch textRects]):
750         (-[WKTextFinderMatch generateTextImage:]):
751         (-[WKTextFinderMatch index]):
752         (-[WKTextFinderClient initWithPage:view:]):
753         (-[WKTextFinderClient willDestroyView:]):
754         (-[WKTextFinderClient findMatchesForString:relativeToMatch:findOptions:maxResults:resultCollector:]):
755         (-[WKTextFinderClient getSelectedText:]):
756         (-[WKTextFinderClient selectFindMatch:completionHandler:]):
757         (-[WKTextFinderClient didFindStringMatches:rects:index:]):
758         (-[WKTextFinderClient didGetImageForMatchResult:index:]):
759         (-[WKTextFinderClient didFindString:rects:index:]):
760         (-[WKTextFinderClient didFailToFindString:]):
761         (-[WKTextFinderClient getImageForMatchResult:completionHandler:]):
762         * WebKit2.xcodeproj/project.pbxproj:
763         Add WKTextFinderClient. It installs itself as the FindClient and FindMatchesClient,
764         so you can only use one mechanism or the other.
765
766 2015-11-06  Chris Dumez  <cdumez@apple.com>
767
768         [WK2][SpeculativeRevalidation] Save to disk cache relationship between resources
769         https://bugs.webkit.org/show_bug.cgi?id=150951
770         <rdar://problem/23092196>
771
772         Reviewed by Darin Adler.
773
774         This patch is a first step towards speculative revalidation support in
775         the WebKit network cache. It maps sub-resources to the main resource
776         that caused them to be requested. We then write this information to the
777         network cache, as a list of subresource keys for each main resource,
778         even if the main resource is not cacheable.
779
780         To map sub-resources to main resources, we track the loads happening
781         in each frame and store the key of the main resource for the frame,
782         as well as the key of each sub-resource later loaded in the frame. We
783         use a HysteresisActivity to detect when loads settle down in each frame
784         (no loads happen for a while) and we then write the information to the
785         disk. If a new main resource is loaded in a frame where we were already
786         tracking a load, we save the data to disk before tracking the new load,
787         instead of waiting for the HysteresisActivity to detect the end of the
788         load.
789
790         The feature is currently behind a compile-time flag that is enabled on
791         Mac and iOS only. It is also behind a runtime flag (NSUserDefaults)
792         that is disabled by default.
793
794         * NetworkProcess/NetworkResourceLoader.cpp:
795         (WebKit::NetworkResourceLoader::start):
796         Pass frameID in addition to the pageID. We need to globally identify
797         frames (using <pageID, frameID> pair) to be able to track loads in
798         each frame.
799
800         * NetworkProcess/cache/NetworkCache.cpp:
801         (WebKit::NetworkCache::Cache::initialize):
802         Only initialize the SpeculativeLoader if the
803         enableNetworkCacheSpeculativeRevalidation run-time flag is set.
804
805         (WebKit::NetworkCache::Cache::retrieve):
806         Register the load with the SpeculativeLoader.
807
808         * NetworkProcess/cache/NetworkCacheKey.h:
809         (WebKit::NetworkCache::Key::Key):
810         (WebKit::NetworkCache::Key::isHashTableDeletedValue):
811         (WebKit::NetworkCache::Key::range):
812         (WTF::NetworkCacheKeyHash::hash):
813         (WTF::NetworkCacheKeyHash::equal):
814         (WTF::HashTraits<WebKit::NetworkCache::Key>::isEmptyValue):
815         Add needed HashTraits for NetworkCache::Key so it can be used as key in
816         HashMap / HashSet.
817
818         * NetworkProcess/cache/NetworkCacheSpeculativeLoader.cpp: Added.
819         * NetworkProcess/cache/NetworkCacheSpeculativeLoader.h: Added.
820         Add new NetworkCacheSpeculativeLoader class that takes care of tracking
821         loads in each frame to map subresources to main resources and then write
822         this information to the network disk cache. In the future, this class we
823         also take care of triggering speculative revalidations, thus the naming.
824
825         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
826         (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
827         * NetworkProcess/soup/NetworkProcessSoup.cpp:
828         (WebKit::NetworkProcess::platformInitializeNetworkProcess):
829         * Shared/Network/NetworkProcessCreationParameters.cpp:
830         (WebKit::NetworkProcessCreationParameters::encode):
831         (WebKit::NetworkProcessCreationParameters::decode):
832         * Shared/Network/NetworkProcessCreationParameters.h:
833         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
834         (WebKit::registerUserDefaultsIfNeeded):
835         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
836         Add new NetworkProcess parameter to control at runtime if speculative loading
837         should be enabled or not. It is disabled by default.
838
839         * WebKit2.xcodeproj/project.pbxproj:
840         Add new files to XCode project.
841
842         * config.h:
843         Add ENABLE_NETWORK_CACHE_SPECULATIVE_REVALIDATION build flag for the new
844         feature that is enable by default on COCOA.
845
846 2015-11-06  Chris Dumez  <cdumez@apple.com>
847
848         Unreviewed, remove empty #if block landed by mistake in r192038.
849
850         * NetworkProcess/NetworkLoad.cpp:
851
852 2015-11-06  Philip Chimento  <philip.chimento@gmail.com>
853
854         [GTK] Fails to link libwebkit2gtkinjectedbundle.so on OSX
855         https://bugs.webkit.org/show_bug.cgi?id=144785
856
857         Reviewed by Philippe Normand.
858
859         * PlatformGTK.cmake: Add missing WebKit2 library to list of
860         libraries to link with. Required for OSX build.
861
862 2015-11-05  Nikos Andronikos  <nikos.andronikos-webkit@cisra.canon.com.au>
863
864         Add runtime and compile time flags for enabling Web Animations API and model.
865         https://bugs.webkit.org/show_bug.cgi?id=150914
866
867         Reviewed by Benjamin Poulain.
868
869         Add ENABLE_WEB_ANIMATIONS compile time flag, runtime flag webAnimationsEnabled and Expose WK2 preference for runtime flag.
870
871         * Configurations/FeatureDefines.xcconfig:
872         * Shared/WebPreferencesDefinitions.h:
873         * UIProcess/API/C/WKPreferences.cpp:
874         (WKPreferencesSetWebAnimationsEnabled):
875         (WKPreferencesGetWebAnimationsEnabled):
876         * UIProcess/API/C/WKPreferencesRefPrivate.h:
877         * WebProcess/InjectedBundle/InjectedBundle.cpp:
878         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
879         (WebKit::InjectedBundle::setWebAnimationsEnabled):
880         * WebProcess/InjectedBundle/InjectedBundle.h:
881         * WebProcess/WebPage/WebPage.cpp:
882         (WebKit::WebPage::updatePreferences):
883
884 2015-11-05  Ryuan Choi  <ryuan.choi@navercorp.com>
885
886         [EFL] Separate beforeunload confirm callback from confirm callback
887         https://bugs.webkit.org/show_bug.cgi?id=150964
888
889         Reviewed by Gyuyoung Kim.
890
891         Browser may need to distinguish between beforeunload confirm panel and general confirm panel.
892         For example, browser may want to modify the message or show different buttons from confirm panel
893         such as "Stay Page | Leave Page".
894
895         * UIProcess/API/efl/EwkView.cpp:
896         (EwkView::requestJSBeforeUnloadConfirmPopup):
897         * UIProcess/API/efl/EwkView.h:
898         * UIProcess/API/efl/ewk_view.h:
899         * UIProcess/API/efl/tests/test_ewk2_view.cpp:
900         (TEST_F):
901         * UIProcess/efl/PageUIClientEfl.cpp:
902         (WebKit::PageUIClientEfl::runBeforeUnloadConfirmPanel):
903
904 2015-11-05  Commit Queue  <commit-queue@webkit.org>
905
906         Unreviewed, rolling out r192089.
907         https://bugs.webkit.org/show_bug.cgi?id=150966
908
909         This change broke an existing layout test on Yosemite and
910         Mavericks (Requested by ryanhaddad on #webkit).
911
912         Reverted changeset:
913
914         "Preview on apple.com/contact with all text selected shows a
915         map"
916         https://bugs.webkit.org/show_bug.cgi?id=150963
917         http://trac.webkit.org/changeset/192089
918
919 2015-11-05  Tim Horton  <timothy_horton@apple.com>
920
921         Preview on apple.com/contact with all text selected shows a map
922         https://bugs.webkit.org/show_bug.cgi?id=150963
923         <rdar://problem/23421750>
924
925         Reviewed by Beth Dakin.
926
927         * WebProcess/WebPage/mac/WebPageMac.mm:
928         (WebKit::WebPage::performDictionaryLookupForSelection):
929         In this case, we don't know where we hit, so pass a null VisiblePosition.
930
931 2015-11-05  Geoffrey Garen  <ggaren@apple.com>
932
933         _WKObservablePageState's _webProcessIsResponsive property isn't set to YES when an unresponsive page is reloaded
934         https://bugs.webkit.org/show_bug.cgi?id=150953
935
936         Reviewed by Anders Carlsson.
937
938         * UIProcess/ResponsivenessTimer.cpp:
939         (WebKit::ResponsivenessTimer::processTerminated): Call stop() to
940         indicate that we are responsive again. This gives the client a chance
941         to remove the SPOD cursor, among other things.
942
943         * UIProcess/ResponsivenessTimer.h:
944         (WebKit::ResponsivenessTimer::processTerminated): Anders told me to do this!
945
946         * UIProcess/WebPageProxy.cpp:
947         (WebKit::WebPageProxy::resetStateAfterProcessExited): Be sure to reset
948         the responsiveness timer too, or it will continue thinking we are
949         unresponsive after a crash or a forced load or reload.
950
951 2015-11-05  Anders Carlsson  <andersca@apple.com>
952
953         Move invocation argument encoding out to a separate function
954         https://bugs.webkit.org/show_bug.cgi?id=150950
955
956         Reviewed by Tim Horton.
957
958         * Shared/API/Cocoa/WKRemoteObjectCoder.mm:
959         (encodeInvocationArguments):
960         (encodeInvocation):
961
962 2015-11-05  Chris Dumez  <cdumez@apple.com>
963
964         [WK2] Clean up / Modernize NetworkResourceLoader
965         https://bugs.webkit.org/show_bug.cgi?id=150922
966
967         Reviewed by Andreas Kling.
968
969         Clean up / Modernize NetworkResourceLoader.
970
971         * NetworkProcess/FileAPI/NetworkBlobRegistry.cpp:
972         (WebKit::NetworkBlobRegistry::filesInBlob):
973         * NetworkProcess/FileAPI/NetworkBlobRegistry.h:
974         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
975         (WebKit::NetworkConnectionToWebProcess::scheduleResourceLoad):
976         (WebKit::NetworkConnectionToWebProcess::performSynchronousLoad):
977         * NetworkProcess/NetworkConnectionToWebProcess.h:
978         * NetworkProcess/NetworkResourceLoader.cpp:
979         (WebKit::NetworkResourceLoader::SynchronousLoadData::SynchronousLoadData):
980         (WebKit::sendReplyToSynchronousRequest):
981         (WebKit::NetworkResourceLoader::NetworkResourceLoader):
982         (WebKit::NetworkResourceLoader::startNetworkLoad):
983         (WebKit::NetworkResourceLoader::didFinishLoading):
984         (WebKit::NetworkResourceLoader::willSendRedirectedRequest):
985         (WebKit::NetworkResourceLoader::bufferingTimerFired):
986         (WebKit::NetworkResourceLoader::sendBufferMaybeAborting):
987         (WebKit::NetworkResourceLoader::validateCacheEntry):
988         (WebKit::NetworkResourceLoader::messageSenderConnection):
989         (WebKit::NetworkResourceLoader::invalidateSandboxExtensions):
990         (WebKit::NetworkResourceLoader::~NetworkResourceLoader): Deleted.
991         (WebKit::NetworkResourceLoader::didReceiveBuffer): Deleted.
992         (WebKit::NetworkResourceLoader::didRetrieveCacheEntry): Deleted.
993         (WebKit::NetworkResourceLoader::consumeSandboxExtensions): Deleted.
994         (WebKit::NetworkResourceLoader::sendAbortingOnFailure): Deleted.
995         * NetworkProcess/NetworkResourceLoader.h:
996         * NetworkProcess/mac/NetworkDiskCacheMonitor.h:
997
998 2015-11-05  Chris Dumez  <cdumez@apple.com>
999
1000         Regression(r192038): Safari cannot load any pages
1001         https://bugs.webkit.org/show_bug.cgi?id=150937
1002         <rdar://problem/23413859>
1003
1004         Reviewed by Alex Christensen.
1005
1006         Make sure we use the current "defersLoading" state instead of the
1007         original one when constructing / initializing the NetworkLoad.
1008
1009         * NetworkProcess/NetworkResourceLoader.cpp:
1010         (WebKit::NetworkResourceLoader::startNetworkLoad):
1011
1012 2015-11-05  Ryuan Choi  <ryuan.choi@navercorp.com>
1013
1014         [EFL] Add try_close API to handle beforeunload event
1015         https://bugs.webkit.org/show_bug.cgi?id=150705
1016
1017         Reviewed by Gyuyoung Kim.
1018
1019         This patch adds ewk_view_try_close to have a chance to call confirm callback
1020         for beforeunload event while destryoing webview.
1021
1022         * UIProcess/API/efl/ewk_view.cpp:
1023         (ewk_view_try_close):
1024         * UIProcess/API/efl/ewk_view.h:
1025         * UIProcess/API/efl/tests/test_ewk2_view.cpp:
1026         (EWK2ViewTest::beforeUnloadCallback):
1027         (EWK2ViewTest::windowCloseCallback):
1028         (TEST_F): Added test case for ewk_view_try_close.
1029
1030 2015-11-04  Carlos Garcia Campos  <cgarcia@igalia.com>
1031
1032         [GTK] Epiphany with Debug mode compiled WebKitGtk+ 2.10.3 hits ASSERT_ARG on willEnterAcceleratedCompositingMode
1033         https://bugs.webkit.org/show_bug.cgi?id=150620
1034
1035         Reviewed by Mario Sanchez Prada.
1036
1037         WillEnterAcceleratedCompositingMode message is sent when the
1038         LayerTreeHost is created in the Web Process. This can happen while
1039         there's still a DidUpdateBackingStoreState pending, in which case
1040         we are receiving the new backingStoreStateID, but the current one
1041         hasn't been updated yet.
1042
1043         * UIProcess/DrawingAreaProxyImpl.cpp:
1044         (WebKit::DrawingAreaProxyImpl::willEnterAcceleratedCompositingMode):
1045         Fix the ASSERT to check the given ID is alt least the next one,
1046         and remove the early return since it's valid to not enter AC mode
1047         in the end after the WillEnter message.
1048
1049 2015-11-04  Tim Horton  <timothy_horton@apple.com>
1050
1051         REGRESSION (r191499): 100% repro crash under _prepareForMoveToWindow:
1052         https://bugs.webkit.org/show_bug.cgi?id=150912
1053         <rdar://problem/23402116>
1054
1055         Reviewed by Simon Fraser.
1056
1057         * UIProcess/API/mac/WKView.mm:
1058         (-[WKView _prepareForMoveToWindow:withCompletionHandler:]):
1059
1060 2015-11-04  Chris Dumez  <cdumez@apple.com>
1061
1062         Regression(r192038): Crash in ~SandboxExtension()
1063         https://bugs.webkit.org/show_bug.cgi?id=150898
1064
1065         Reviewed by Alex Christensen.
1066
1067         We are seeing a couple of crashes under ~SandboxExtension() on the bots
1068         after ~SandboxExtension(). The reason is that the SandBoxExtension is
1069         still in use (useCount > 0) when destroyed. This happens due to a bug
1070         in setDefersLoading() that could cause the load to get started more
1071         than once and thus the SandboxExtension to be consumed more than once.
1072
1073         * NetworkProcess/NetworkResourceLoader.cpp:
1074         (WebKit::NetworkResourceLoader::setDefersLoading):
1075         (WebKit::NetworkResourceLoader::consumeSandboxExtensions):
1076
1077 2015-11-04  Chris Dumez  <cdumez@apple.com>
1078
1079         [WK2] Extract networking code out of NetworkResourceLoader class to improve reusability
1080         https://bugs.webkit.org/show_bug.cgi?id=150898
1081
1082         Reviewed by Alex Christensen.
1083
1084         Extract networking code out of NetworkResourceLoader class to improve
1085         reusability (will be used for speculative revalidation) and simplify
1086         the NetworkResourceLoader.
1087
1088         * CMakeLists.txt:
1089         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1090         (WebKit::NetworkConnectionToWebProcess::convertMainResourceLoadToDownload):
1091         * NetworkProcess/NetworkLoad.cpp: Added.
1092         * NetworkProcess/NetworkLoad.h: Added.
1093         * NetworkProcess/NetworkLoadClient.h: Added.
1094         * NetworkProcess/NetworkLoadParameters.cpp: Added.
1095         * NetworkProcess/NetworkLoadParameters.h: Added.
1096         * NetworkProcess/NetworkResourceLoader.cpp:
1097         * NetworkProcess/NetworkResourceLoader.h:
1098         * NetworkProcess/mac/NetworkLoadMac.mm: Added.
1099         * NetworkProcess/mac/NetworkResourceLoaderMac.mm:
1100         (WebKit::NetworkResourceLoader::willCacheResponseAsync):
1101         * WebKit2.xcodeproj/project.pbxproj:
1102
1103 2015-11-04  Beth Dakin  <bdakin@apple.com>
1104
1105         Link preview doesn't work on XHTML pages with Content-Type header as 
1106         `application/xhtml+xml`
1107         https://bugs.webkit.org/show_bug.cgi?id=150740
1108         -and corresponding-
1109         rdar://problem/23063585
1110
1111         Reviewed by Darin Adler.
1112
1113         My original fix for this bug was incorrect in the presence of non-HTML 
1114         elements that happen to have the same local name as HTML elements. Since it 
1115         seems silly to have all of this logic in the UI process to determine whether 
1116         to treat something as a link or an image, this patch fixes the bug by adding 
1117         isLink and isImage to InteractionInformationAtPosition in order to simplify 
1118         everything. The only remaining uses of clickableElementName just use it to 
1119         compare against isNull and isEmpty, so that can be a bool too.
1120
1121         Add isLink and isImage, and turn clickableElementName into isClickableElement
1122         * Shared/InteractionInformationAtPosition.cpp:
1123         (WebKit::InteractionInformationAtPosition::encode):
1124         (WebKit::InteractionInformationAtPosition::decode):
1125         * Shared/InteractionInformationAtPosition.h:
1126
1127         Use the new isLink, isImage, and isClickableElement
1128         * UIProcess/ios/WKContentViewInteraction.mm:
1129         (-[WKContentView _actionForLongPress]):
1130         (-[WKContentView gestureRecognizerShouldBegin:]):
1131         (-[WKContentView _highlightLongPressRecognized:]):
1132         (-[WKContentView _interactionShouldBeginFromPreviewItemController:forPosition:]):
1133         (-[WKContentView _dataForPreviewItemController:atPosition:type:]):
1134
1135         Set everything correctly.
1136         * WebProcess/WebPage/ios/WebPageIOS.mm:
1137         (WebKit::WebPage::getPositionInformation):
1138
1139 2015-11-04  Wenson Hsieh  <wenson_hsieh@apple.com>
1140
1141         Fix crashing fast-clicking WK2 tests on iOS
1142         https://bugs.webkit.org/show_bug.cgi?id=150896
1143         <rdar://problem/23344491>
1144
1145         Reviewed by Simon Fraser.
1146
1147         In order for the modified fast-clicking tests to pass, we can't allow hit-testing to
1148         find the tap highlight view. See the Radar for more UIKit-specific descriptions.
1149
1150         * UIProcess/ios/WKContentViewInteraction.mm:
1151         (-[WKContentView _showTapHighlight]):
1152
1153 2015-11-03  Anders Carlsson  <andersca@apple.com>
1154
1155         PageLoadState::will/didChangeProcessIsResponsive should call observers
1156         https://bugs.webkit.org/show_bug.cgi?id=150870
1157
1158         Reviewed by Dan Bernstein.
1159
1160         * UIProcess/PageLoadState.cpp:
1161         (WebKit::PageLoadState::willChangeProcessIsResponsive):
1162         (WebKit::PageLoadState::didChangeProcessIsResponsive):
1163
1164 2015-11-04  Ryan Haddad  <ryanhaddad@apple.com>
1165
1166         Speculative build fix. Missed the checkin for the changelog with r192029.
1167
1168         * UIProcess/API/Cocoa/WKWebView.mm:
1169
1170 2015-11-03  Andy Estes  <aestes@apple.com>
1171
1172         [Cocoa] Add SPI to warm an initial web process
1173         https://bugs.webkit.org/show_bug.cgi?id=150886
1174
1175         Reviewed by Dan Bernstein.
1176
1177         * UIProcess/API/Cocoa/WKProcessPool.mm:
1178         (-[WKProcessPool _warmInitialProcess]):
1179         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
1180
1181 2015-11-03  Andy Estes  <aestes@apple.com>
1182
1183         [Cocoa] Adopt WKWebViewAdditions
1184         https://bugs.webkit.org/show_bug.cgi?id=150885
1185
1186         Reviewed by Dan Bernstein.
1187
1188         * UIProcess/API/Cocoa/WKWebView.mm:
1189
1190 2015-11-03  Tim Horton  <timothy_horton@apple.com>
1191
1192         Duplicate validateUserInterfaceItem in WKWebView
1193         https://bugs.webkit.org/show_bug.cgi?id=150873
1194
1195         Reviewed by Anders Carlsson.
1196
1197         * UIProcess/API/Cocoa/WKWebView.mm:
1198         (-[WKWebView changeFont:]):
1199         (-[WKWebView startSpeaking:]):
1200         (-[WKWebView validateUserInterfaceItem:]):
1201         (-[WKWebView goBack:]):
1202
1203 2015-11-03  Geoffrey Garen  <ggaren@apple.com>
1204
1205         Provide a way to turn off const in WebKit2.
1206
1207         Reviewed by Sam Weinig.
1208
1209         * Shared/WebProcessCreationParameters.cpp:
1210         (WebKit::WebProcessCreationParameters::encode):
1211         (WebKit::WebProcessCreationParameters::decode):
1212         * Shared/WebProcessCreationParameters.h:
1213         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
1214         (WebKit::WebProcessPool::platformInitializeWebProcess):
1215         * WebProcess/WebProcess.cpp:
1216         (WebKit::WebProcess::initializeWebProcess):
1217
1218 2015-11-03  Alex Christensen  <achristensen@webkit.org>
1219
1220         Create a NetworkSession for each SessionID
1221         https://bugs.webkit.org/show_bug.cgi?id=150857
1222
1223         Reviewed by Anders Carlsson.
1224
1225         This patch renames SessionTracker::session to storageSession and makes a parallel
1226         structure for NetworkSessions.  NetworkSession and NetworkStorageSession should eventually
1227         become the same class in WebCore.  Because not everybody uses NetworkSessions yet,
1228         we keep them separate but created, destroyed, and managed together.
1229
1230         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1231         (WebKit::storageSession):
1232         * NetworkProcess/NetworkProcess.cpp:
1233         (WebKit::NetworkProcess::fetchWebsiteData):
1234         (WebKit::NetworkProcess::deleteWebsiteData):
1235         (WebKit::NetworkProcess::deleteWebsiteDataForOrigins):
1236         * NetworkProcess/NetworkResourceLoader.cpp:
1237         (WebKit::NetworkResourceLoader::startNetworkLoad):
1238         (WebKit::NetworkResourceLoader::abort):
1239         * NetworkProcess/NetworkResourceLoader.h:
1240         * NetworkProcess/NetworkSession.h:
1241         (WebKit::NetworkSessionTaskClient::~NetworkSessionTaskClient):
1242         (WebKit::NetworkDataTask::client):
1243         (WebKit::NetworkDataTask::clearClient):
1244         (WebKit::NetworkingDataTask::client): Deleted.
1245         (WebKit::NetworkingDataTask::clearClient): Deleted.
1246         (WebKit::NetworkSession::~NetworkSession): Deleted.
1247         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
1248         (WebKit::configurationForType):
1249         (WebKit::defaultNetworkSession):
1250         (WebKit::NetworkSession::defaultSession):
1251         (WebKit::NetworkSession::NetworkSession):
1252         (WebKit::NetworkSession::~NetworkSession):
1253         (WebKit::NetworkSession::createDataTaskWithRequest):
1254         (WebKit::NetworkSession::dataTaskForIdentifier):
1255         (WebKit::NetworkDataTask::NetworkDataTask):
1256         (WebKit::NetworkDataTask::~NetworkDataTask):
1257         (WebKit::NetworkDataTask::cancel):
1258         (WebKit::NetworkDataTask::resume):
1259         (WebKit::NetworkDataTask::taskIdentifier):
1260         (WebKit::NetworkSession::create): Deleted.
1261         (WebKit::NetworkSession::singleton): Deleted.
1262         (WebKit::NetworkingDataTask::NetworkingDataTask): Deleted.
1263         (WebKit::NetworkingDataTask::~NetworkingDataTask): Deleted.
1264         (WebKit::NetworkingDataTask::suspend): Deleted.
1265         (WebKit::NetworkingDataTask::resume): Deleted.
1266         (WebKit::NetworkingDataTask::taskIdentifier): Deleted.
1267         * NetworkProcess/mac/RemoteNetworkingContext.mm:
1268         (WebKit::RemoteNetworkingContext::storageSession):
1269         (WebKit::RemoteNetworkingContext::ensurePrivateBrowsingSession):
1270         * Shared/SessionTracker.cpp:
1271         (WebKit::staticStorageSessionMap):
1272         (WebKit::identifierBase):
1273         (WebKit::SessionTracker::storageSessionMap):
1274         (WebKit::SessionTracker::getIdentifierBase):
1275         (WebKit::SessionTracker::storageSession):
1276         (WebKit::staticSessionMap):
1277         (WebKit::SessionTracker::networkSession):
1278         (WebKit::SessionTracker::sessionID):
1279         (WebKit::SessionTracker::setSession):
1280         (WebKit::SessionTracker::destroySession):
1281         (WebKit::SessionTracker::sessionMap): Deleted.
1282         (WebKit::SessionTracker::session): Deleted.
1283         * Shared/SessionTracker.h:
1284         * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm:
1285         (WebKit::WebFrameNetworkingContext::ensurePrivateBrowsingSession):
1286         (WebKit::WebFrameNetworkingContext::setCookieAcceptPolicyForAllContexts):
1287         (WebKit::WebFrameNetworkingContext::storageSession):
1288         * WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.cpp:
1289         (WebKit::WebFrameNetworkingContext::ensurePrivateBrowsingSession):
1290         (WebKit::WebFrameNetworkingContext::setCookieAcceptPolicyForAllContexts):
1291         (WebKit::WebFrameNetworkingContext::storageSession):
1292
1293 2015-11-03  Ryuan Choi  <ryuan.choi@navercorp.com>
1294
1295         [CoordinatedGraphics] invisible webview should not paint the content
1296         https://bugs.webkit.org/show_bug.cgi?id=150662
1297
1298         Reviewed by Darin Adler.
1299
1300         Suspend or resume the painting instead of just initializing m_isPaintingSuspended 
1301         for invisible webview not to paint the content until visibility is changed.
1302
1303         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedDrawingArea.cpp:
1304         (WebKit::CoordinatedDrawingArea::CoordinatedDrawingArea):
1305
1306 2015-11-03  Anders Carlsson  <andersca@apple.com>
1307
1308         Simplify -[_WKRemoteObjectRegistry _invokeMethod:]
1309         https://bugs.webkit.org/show_bug.cgi?id=150844
1310
1311         Reviewed by Tim Horton.
1312
1313         * Shared/API/Cocoa/_WKRemoteObjectRegistry.mm:
1314         (-[_WKRemoteObjectRegistry _invokeMethod:]):
1315         (-[_WKRemoteObjectRegistry _invokeMessageWithInterfaceIdentifier:encodedInvocation:]): Deleted.
1316         * Shared/API/Cocoa/_WKRemoteObjectRegistryInternal.h:
1317
1318 2015-11-02  Anders Carlsson  <andersca@apple.com>
1319
1320         CTTE the responsiveness timer getter
1321         https://bugs.webkit.org/show_bug.cgi?id=150825
1322
1323         Reviewed by Daniel Bates.
1324
1325         * UIProcess/API/C/mac/WKPagePrivateMac.mm:
1326         (-[WKObservablePageState _webProcessIsResponsive]):
1327         * UIProcess/API/Cocoa/WKBrowsingContextController.mm:
1328         (-[WKBrowsingContextController _webProcessIsResponsive]):
1329         * UIProcess/API/Cocoa/WKWebView.mm:
1330         (-[WKWebView _webProcessIsResponsive]):
1331         * UIProcess/WebPageProxy.cpp:
1332         (WebKit::WebPageProxy::reattachToWebProcessForReload):
1333         (WebKit::WebPageProxy::reattachToWebProcessWithItem):
1334         (WebKit::WebPageProxy::tryClose):
1335         (WebKit::WebPageProxy::loadRequest):
1336         (WebKit::WebPageProxy::loadFile):
1337         (WebKit::WebPageProxy::loadData):
1338         (WebKit::WebPageProxy::loadHTMLString):
1339         (WebKit::WebPageProxy::loadAlternateHTMLString):
1340         (WebKit::WebPageProxy::loadPlainTextString):
1341         (WebKit::WebPageProxy::loadWebArchiveData):
1342         (WebKit::WebPageProxy::navigateToPDFLinkWithSimulatedClick):
1343         (WebKit::WebPageProxy::stopLoading):
1344         (WebKit::WebPageProxy::reload):
1345         (WebKit::WebPageProxy::goForward):
1346         (WebKit::WebPageProxy::goBack):
1347         (WebKit::WebPageProxy::goToBackForwardItem):
1348         (WebKit::WebPageProxy::dispatchViewStateChange):
1349         (WebKit::WebPageProxy::handleMouseEvent):
1350         (WebKit::WebPageProxy::sendWheelEvent):
1351         (WebKit::WebPageProxy::handleKeyboardEvent):
1352         (WebKit::WebPageProxy::handleGestureEvent):
1353         (WebKit::WebPageProxy::handleTouchEventSynchronously):
1354         (WebKit::WebPageProxy::handleTouchEvent):
1355         (WebKit::WebPageProxy::closePage):
1356         (WebKit::WebPageProxy::runJavaScriptAlert):
1357         (WebKit::WebPageProxy::runJavaScriptConfirm):
1358         (WebKit::WebPageProxy::runJavaScriptPrompt):
1359         (WebKit::WebPageProxy::runBeforeUnloadConfirmPanel):
1360         (WebKit::WebPageProxy::runOpenPanel):
1361         (WebKit::WebPageProxy::showPopupMenu):
1362         (WebKit::WebPageProxy::internalShowContextMenu):
1363         (WebKit::WebPageProxy::didReceiveEvent):
1364         (WebKit::WebPageProxy::stopResponsivenessTimer):
1365         (WebKit::WebPageProxy::runModal):
1366         (WebKit::WebPageProxy::updateBackingStoreDiscardableState):
1367         * UIProcess/WebProcessProxy.h:
1368         (WebKit::WebProcessProxy::responsivenessTimer):
1369
1370 2015-11-03  Carlos Garcia Campos  <cgarcia@igalia.com>
1371
1372         Unreviewed. Update OptionsGTK.cmake and NEWS for 2.11.1 release.
1373
1374         * gtk/NEWS: Add release notes for 2.11.1.
1375
1376 2015-11-03  Alex Christensen  <achristensen@webkit.org>
1377
1378         Use the same cookie storage as WebCore when using NETWORK_SESSION
1379         https://bugs.webkit.org/show_bug.cgi?id=150833
1380
1381         Reviewed by Antti Koivisto.
1382
1383         This fixes 12 tests when using NETWORK_SESSION.
1384
1385         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
1386         (WebKit::NetworkSession::NetworkSession):
1387
1388 2015-11-03  Alex Christensen  <achristensen@webkit.org>
1389
1390         Clean up NETWORK_SESSION code after r191848
1391         https://bugs.webkit.org/show_bug.cgi?id=150829
1392
1393         Reviewed by Darin Adler.
1394
1395         * NetworkProcess/NetworkResourceLoader.cpp:
1396         (WebKit::NetworkResourceLoader::didReceiveData):
1397         (WebKit::NetworkResourceLoader::didCompleteWithError):
1398         * NetworkProcess/NetworkSession.h:
1399         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
1400         (WebKit::NetworkSession::NetworkSession):
1401         (WebKit::NetworkSession::createDataTaskWithRequest):
1402         (WebKit::NetworkSession::dataTaskForIdentifier):
1403
1404 2015-11-02  Carlos Garcia Campos  <cgarcia@igalia.com>
1405
1406         Unreviewed. Fix GTK+ build after r191924.
1407
1408         * UIProcess/API/gtk/WebKitWebView.cpp:
1409
1410 2015-11-02  Alex Christensen  <achristensen@webkit.org>
1411
1412         Fix CMake build after r191922.
1413
1414         * PlatformMac.cmake:
1415
1416 2015-11-02  Andy Estes  <aestes@apple.com>
1417
1418         Try again to fix the iOS build.
1419
1420         * Shared/mac/PDFKitImports.mm:
1421
1422 2015-11-02  Tim Horton  <timothy_horton@apple.com>
1423
1424         Try to fix the iOS build
1425
1426         * Shared/mac/PDFKitImports.h:
1427
1428 2015-11-02  Tim Horton  <timothy_horton@apple.com>
1429
1430         Address a misssed review comment in r191922
1431
1432         * WebProcess/Plugins/PDF/DeprecatedPDFPlugin.mm:
1433         (WebKit::PDFPlugin::nextMatchForString):
1434
1435 2015-11-02  Anders Carlsson  <andersca@apple.com>
1436
1437         Add KVO-compliant _webProcessIsResponsive property to WKWebView and _WKObservablePageState
1438         https://bugs.webkit.org/show_bug.cgi?id=150818
1439         rdar://problem/22372131
1440
1441         Reviewed by Tim Horton.
1442
1443         * UIProcess/API/C/mac/WKPagePrivateMac.h:
1444         * UIProcess/API/C/mac/WKPagePrivateMac.mm:
1445         (-[WKObservablePageState _webProcessIsResponsive]):
1446         * UIProcess/API/Cocoa/PageLoadStateObserver.h:
1447         * UIProcess/API/Cocoa/WKBrowsingContextController.mm:
1448         (-[WKBrowsingContextController _webProcessIsResponsive]):
1449         * UIProcess/API/Cocoa/WKWebView.mm:
1450         (-[WKWebView _webProcessIsResponsive]):
1451         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1452         * UIProcess/Cocoa/NavigationState.h:
1453         * UIProcess/Cocoa/NavigationState.mm:
1454         (WebKit::NavigationState::willChangeWebProcessIsResponsive):
1455         (WebKit::NavigationState::didChangeWebProcessIsResponsive):
1456         * UIProcess/PageLoadState.cpp:
1457         (WebKit::PageLoadState::willChangeProcessIsResponsive):
1458         (WebKit::PageLoadState::didChangeProcessIsResponsive):
1459         * UIProcess/PageLoadState.h:
1460         * UIProcess/ResponsivenessTimer.cpp:
1461         (WebKit::ResponsivenessTimer::ResponsivenessTimer):
1462         (WebKit::ResponsivenessTimer::timerFired):
1463         (WebKit::ResponsivenessTimer::stop):
1464         * UIProcess/ResponsivenessTimer.h:
1465         * UIProcess/WebPageProxy.cpp:
1466         (WebKit::WebPageProxy::willChangeProcessIsResponsive):
1467         (WebKit::WebPageProxy::didChangeProcessIsResponsive):
1468         * UIProcess/WebPageProxy.h:
1469         * UIProcess/WebProcessProxy.cpp:
1470         (WebKit::WebProcessProxy::WebProcessProxy):
1471         (WebKit::WebProcessProxy::didBecomeUnresponsive):
1472         (WebKit::WebProcessProxy::didBecomeResponsive):
1473         (WebKit::WebProcessProxy::willChangeIsResponsive):
1474         (WebKit::WebProcessProxy::didChangeIsResponsive):
1475         * UIProcess/WebProcessProxy.h:
1476
1477 2015-11-02  Tim Horton  <timothy_horton@apple.com>
1478
1479         PDFPlugin should take advantage of threaded scrolling
1480         https://bugs.webkit.org/show_bug.cgi?id=150037
1481
1482         Reviewed by Anders Carlsson.
1483
1484         Duplicate PDFPlugin, creating PDFPlugin (the modern version), and
1485         DeprecatedPDFPlugin (containing the code that used to be in PDFPlugin
1486         prior to this patch).
1487
1488         The new PDFPlugin differs from the old one in a few significant ways,
1489         and we need to keep both alive for the time being. Significant differences
1490         include:
1491
1492         - PDFPlugin is no longer a ScrollableArea
1493         - PDFPlugin no longer hosts layers owned by PDFKit; instead, it draws
1494           into the page tiles, allowing WebCore's threaded scrolling to do its job
1495         - PDFPlugin now resizes itself to the size of the document
1496         - PDFPlugin doesn't handle zooming itself, it just delegates to the page
1497         - PDFLayerController has large and incompatible API changes
1498         - PDFPlugin now implements more of the HUD behavior, but it's still
1499           painted by PDFLayerController (into a view-relative PageOverlay)
1500
1501         [ File list elided because it's long and useless. ]
1502
1503 2015-11-02  Andy Estes  <aestes@apple.com>
1504
1505         [Cocoa] Add tvOS and watchOS to SUPPORTED_PLATFORMS
1506         https://bugs.webkit.org/show_bug.cgi?id=150819
1507
1508         Reviewed by Dan Bernstein.
1509
1510         This tells Xcode to include these platforms in its Devices dropdown, making it possible to build in the IDE.
1511
1512         * Configurations/Base.xcconfig:
1513
1514 2015-11-02  Anders Carlsson  <andersca@apple.com>
1515
1516         Begin work on supporting reply blocks in _WKRemoteObjectRegistry
1517         https://bugs.webkit.org/show_bug.cgi?id=150739
1518
1519         Reviewed by Tim Horton.
1520
1521         * Platform/spi/Cocoa/BlockSPI.h:
1522         Add SPI header.
1523
1524         * Shared/API/Cocoa/RemoteObjectInvocation.h:
1525         (WebKit::RemoteObjectInvocation::ReplyInfo::ReplyInfo):
1526         (WebKit::RemoteObjectInvocation::replyInfo):
1527         * Shared/API/Cocoa/RemoteObjectInvocation.mm:
1528         (WebKit::RemoteObjectInvocation::RemoteObjectInvocation):
1529         (WebKit::RemoteObjectInvocation::encode):
1530         (WebKit::RemoteObjectInvocation::decode):
1531         Add an optional ReplyInfo struct to RemoteObjectInvocation.
1532
1533         * Shared/API/Cocoa/_WKRemoteObjectRegistry.mm:
1534         (generateReplyIdentifier):
1535         Helper function to generate a reply identifier.
1536
1537         (-[_WKRemoteObjectRegistry _sendInvocation:interface:]):
1538         Do some block parameter validation.
1539
1540         * WebKit2.xcodeproj/project.pbxproj:
1541
1542 2015-11-02  Brent Fulgham  <bfulgham@apple.com>
1543
1544         [iOS] Another unreviewed sandbox update.
1545
1546         * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb: Change copyright.
1547
1548 2015-11-02  Brent Fulgham  <bfulgham@apple.com>
1549
1550         [iOS] Unreviewed sandbox update.
1551
1552         Correcting copyright information.
1553
1554         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
1555
1556 2015-11-02  Tim Horton  <timothy_horton@apple.com>
1557
1558         Get rid of WKWebView's inner WKView (WKView being inside WKWebView leads to weird API issues)
1559         https://bugs.webkit.org/show_bug.cgi?id=150174
1560
1561         Reviewed by Anders Carlsson.
1562
1563         * UIProcess/API/Cocoa/WKWebView.mm:
1564         (-[WKWebView initWithFrame:configuration:]):
1565         (-[WKWebView dealloc]):
1566         (-[WKWebView allowsLinkPreview]):
1567         (-[WKWebView setAllowsLinkPreview:]):
1568         (-[WKWebView acceptsFirstResponder]):
1569         (-[WKWebView becomeFirstResponder]):
1570         (-[WKWebView resignFirstResponder]):
1571         (-[WKWebView viewWillStartLiveResize]):
1572         (-[WKWebView viewDidEndLiveResize]):
1573         (-[WKWebView isFlipped]):
1574         (-[WKWebView intrinsicContentSize]):
1575         (-[WKWebView prepareContentInRect:]):
1576         (-[WKWebView setFrameSize:]):
1577         (-[WKWebView renewGState]):
1578         (-[WKWebView writeSelectionToPasteboard:types:]):
1579         (-[WKWebView centerSelectionInVisibleArea:]):
1580         (-[WKWebView validRequestorForSendType:returnType:]):
1581         (-[WKWebView readSelectionFromPasteboard:]):
1582         (-[WKWebView changeFont:]):
1583         (-[WKWebView validateUserInterfaceItem:]):
1584         (-[WKWebView startSpeaking:]):
1585         (-[WKWebView stopSpeaking:]):
1586         (-[WKWebView showGuessPanel:]):
1587         (-[WKWebView checkSpelling:]):
1588         (-[WKWebView changeSpelling:]):
1589         (-[WKWebView toggleContinuousSpellChecking:]):
1590         (-[WKWebView isGrammarCheckingEnabled]):
1591         (-[WKWebView setGrammarCheckingEnabled:]):
1592         (-[WKWebView toggleGrammarChecking:]):
1593         (-[WKWebView toggleAutomaticSpellingCorrection:]):
1594         (-[WKWebView orderFrontSubstitutionsPanel:]):
1595         (-[WKWebView toggleSmartInsertDelete:]):
1596         (-[WKWebView isAutomaticQuoteSubstitutionEnabled]):
1597         (-[WKWebView setAutomaticQuoteSubstitutionEnabled:]):
1598         (-[WKWebView toggleAutomaticQuoteSubstitution:]):
1599         (-[WKWebView isAutomaticDashSubstitutionEnabled]):
1600         (-[WKWebView setAutomaticDashSubstitutionEnabled:]):
1601         (-[WKWebView toggleAutomaticDashSubstitution:]):
1602         (-[WKWebView isAutomaticLinkDetectionEnabled]):
1603         (-[WKWebView setAutomaticLinkDetectionEnabled:]):
1604         (-[WKWebView toggleAutomaticLinkDetection:]):
1605         (-[WKWebView isAutomaticTextReplacementEnabled]):
1606         (-[WKWebView setAutomaticTextReplacementEnabled:]):
1607         (-[WKWebView toggleAutomaticTextReplacement:]):
1608         (-[WKWebView uppercaseWord:]):
1609         (-[WKWebView lowercaseWord:]):
1610         (-[WKWebView capitalizeWord:]):
1611         (-[WKWebView _wantsKeyDownForEvent:]):
1612         (-[WKWebView scrollWheel:]):
1613         (-[WKWebView swipeWithEvent:]):
1614         (-[WKWebView mouseMoved:]):
1615         (-[WKWebView mouseDown:]):
1616         (-[WKWebView mouseUp:]):
1617         (-[WKWebView mouseDragged:]):
1618         (-[WKWebView mouseEntered:]):
1619         (-[WKWebView mouseExited:]):
1620         (-[WKWebView otherMouseDown:]):
1621         (-[WKWebView otherMouseDragged:]):
1622         (-[WKWebView otherMouseUp:]):
1623         (-[WKWebView rightMouseDown:]):
1624         (-[WKWebView rightMouseDragged:]):
1625         (-[WKWebView rightMouseUp:]):
1626         (-[WKWebView pressureChangeWithEvent:]):
1627         (-[WKWebView acceptsFirstMouse:]):
1628         (-[WKWebView shouldDelayWindowOrderingForEvent:]):
1629         (-[WKWebView doCommandBySelector:]):
1630         (-[WKWebView insertText:]):
1631         (-[WKWebView insertText:replacementRange:]):
1632         (-[WKWebView inputContext]):
1633         (-[WKWebView performKeyEquivalent:]):
1634         (-[WKWebView keyUp:]):
1635         (-[WKWebView keyDown:]):
1636         (-[WKWebView flagsChanged:]):
1637         (-[WKWebView setMarkedText:selectedRange:replacementRange:]):
1638         (-[WKWebView unmarkText]):
1639         (-[WKWebView selectedRange]):
1640         (-[WKWebView hasMarkedText]):
1641         (-[WKWebView markedRange]):
1642         (-[WKWebView attributedSubstringForProposedRange:actualRange:]):
1643         (-[WKWebView characterIndexForPoint:]):
1644         (-[WKWebView firstRectForCharacterRange:actualRange:]):
1645         (-[WKWebView selectedRangeWithCompletionHandler:]):
1646         (-[WKWebView markedRangeWithCompletionHandler:]):
1647         (-[WKWebView hasMarkedTextWithCompletionHandler:]):
1648         (-[WKWebView attributedSubstringForProposedRange:completionHandler:]):
1649         (-[WKWebView firstRectForCharacterRange:completionHandler:]):
1650         (-[WKWebView characterIndexForPoint:completionHandler:]):
1651         (-[WKWebView validAttributesForMarkedText]):
1652         (-[WKWebView draggedImage:endedAt:operation:]):
1653         (-[WKWebView draggingEntered:]):
1654         (-[WKWebView draggingUpdated:]):
1655         (-[WKWebView draggingExited:]):
1656         (-[WKWebView prepareForDragOperation:]):
1657         (-[WKWebView performDragOperation:]):
1658         (-[WKWebView _hitTest:dragTypes:]):
1659         (-[WKWebView _windowResizeMouseLocationIsInVisibleScrollerThumb:]):
1660         (-[WKWebView viewWillMoveToWindow:]):
1661         (-[WKWebView viewDidMoveToWindow]):
1662         (-[WKWebView drawRect:]):
1663         (-[WKWebView isOpaque]):
1664         (-[WKWebView mouseDownCanMoveWindow]):
1665         (-[WKWebView viewDidHide]):
1666         (-[WKWebView viewDidUnhide]):
1667         (-[WKWebView viewDidChangeBackingProperties]):
1668         (-[WKWebView _activeSpaceDidChange:]):
1669         (-[WKWebView accessibilityFocusedUIElement]):
1670         (-[WKWebView accessibilityIsIgnored]):
1671         (-[WKWebView accessibilityHitTest:]):
1672         (-[WKWebView accessibilityAttributeValue:]):
1673         (-[WKWebView hitTest:]):
1674         (-[WKWebView conversationIdentifier]):
1675         (-[WKWebView quickLookWithEvent:]):
1676         (-[WKWebView addTrackingRect:owner:userData:assumeInside:]):
1677         (-[WKWebView _addTrackingRect:owner:userData:assumeInside:useTrackingNum:]):
1678         (-[WKWebView _addTrackingRects:owner:userDataList:assumeInsideList:trackingNums:count:]):
1679         (-[WKWebView removeTrackingRect:]):
1680         (-[WKWebView _removeTrackingRects:count:]):
1681         (-[WKWebView view:stringForToolTip:point:userData:]):
1682         (-[WKWebView pasteboardChangedOwner:]):
1683         (-[WKWebView pasteboard:provideDataForType:]):
1684         (-[WKWebView namesOfPromisedFilesDroppedAtDestination:]):
1685         (-[WKWebView wantsUpdateLayer]):
1686         (-[WKWebView updateLayer]):
1687         (-[WKWebView setAllowsBackForwardNavigationGestures:]):
1688         (-[WKWebView allowsBackForwardNavigationGestures]):
1689         (-[WKWebView smartMagnifyWithEvent:]):
1690         (-[WKWebView setMagnification:centeredAtPoint:]):
1691         (-[WKWebView setMagnification:]):
1692         (-[WKWebView magnification]):
1693         (-[WKWebView setAllowsMagnification:]):
1694         (-[WKWebView allowsMagnification]):
1695         (-[WKWebView magnifyWithEvent:]):
1696         (-[WKWebView rotateWithEvent:]):
1697         (-[WKWebView _web_superInputContext]):
1698         (-[WKWebView _web_superQuickLookWithEvent:]):
1699         (-[WKWebView _web_superSwipeWithEvent:]):
1700         (-[WKWebView _web_superMagnifyWithEvent:]):
1701         (-[WKWebView _web_superSmartMagnifyWithEvent:]):
1702         (-[WKWebView _web_superRemoveTrackingRect:]):
1703         (-[WKWebView _web_superAccessibilityAttributeValue:]):
1704         (-[WKWebView _web_superDoCommandBySelector:]):
1705         (-[WKWebView _web_superPerformKeyEquivalent:]):
1706         (-[WKWebView _web_superKeyDown:]):
1707         (-[WKWebView _web_superHitTest:]):
1708         (-[WKWebView _web_immediateActionAnimationControllerForHitTestResultInternal:withType:userData:]):
1709         (-[WKWebView _web_prepareForImmediateActionAnimation]):
1710         (-[WKWebView _web_cancelImmediateActionAnimation]):
1711         (-[WKWebView _web_completeImmediateActionAnimation]):
1712         (-[WKWebView _web_didChangeContentSize:]):
1713         (-[WKWebView _web_dismissContentRelativeChildWindows]):
1714         (-[WKWebView _web_dismissContentRelativeChildWindowsWithAnimation:]):
1715         (-[WKWebView _web_gestureEventWasNotHandledByWebCore:]):
1716         (-[WKWebView _setEditable:]):
1717         (-[WKWebView _remoteObjectRegistry]):
1718         (-[WKWebView _layoutMode]):
1719         (-[WKWebView _setLayoutMode:]):
1720         (-[WKWebView _setViewScale:]):
1721         (-[WKWebView _drawsTransparentBackground]):
1722         (-[WKWebView _setDrawsTransparentBackground:]):
1723         (-[WKWebView _inspectorAttachmentView]):
1724         (-[WKWebView _setInspectorAttachmentView:]):
1725         (-[WKWebView _windowOcclusionDetectionEnabled]):
1726         (-[WKWebView _setWindowOcclusionDetectionEnabled:]):
1727         (-[WKWebView _setOverrideDeviceScaleFactor:]):
1728         (-[WKWebView _overrideDeviceScaleFactor]):
1729         (-[WKWebView _setTopContentInset:]):
1730         (-[WKWebView _topContentInset]):
1731         (-[WKWebView _pageExtendedBackgroundColor]):
1732         (-[WKWebView _immediateActionAnimationControllerForHitTestResult:withType:userData:]):
1733         (-[WKWebView _setAutomaticallyAdjustsContentInsets:]):
1734         (-[WKWebView _automaticallyAdjustsContentInsets]):
1735         (-[WKWebView _setMinimumLayoutWidth:]):
1736         (-[WKWebView resizeSubviewsWithOldSize:]): Deleted.
1737         (-[WKWebView _ignoresNonWheelEvents]): Deleted.
1738         (-[WKWebView _setIgnoresNonWheelEvents:]): Deleted.
1739         (-[WKWebView _setIntrinsicContentSize:]): Deleted.
1740         * UIProcess/API/Cocoa/WKWebViewInternal.h:
1741         * UIProcess/API/mac/WKView.mm:
1742         (-[WKView _web_superInputContext]):
1743         (-[WKView _web_superQuickLookWithEvent:]):
1744         (-[WKView _web_superSwipeWithEvent:]):
1745         (-[WKView _web_superMagnifyWithEvent:]):
1746         (-[WKView _web_superSmartMagnifyWithEvent:]):
1747         (-[WKView _web_superRemoveTrackingRect:]):
1748         (-[WKView _web_superAccessibilityAttributeValue:]):
1749         (-[WKView _web_superDoCommandBySelector:]):
1750         (-[WKView _web_superPerformKeyEquivalent:]):
1751         (-[WKView _web_superKeyDown:]):
1752         (-[WKView _web_superHitTest:]):
1753         (-[WKView _web_immediateActionAnimationControllerForHitTestResultInternal:withType:userData:]):
1754         (-[WKView _web_prepareForImmediateActionAnimation]):
1755         (-[WKView _web_cancelImmediateActionAnimation]):
1756         (-[WKView _web_completeImmediateActionAnimation]):
1757         (-[WKView _web_didChangeContentSize:]):
1758         (-[WKView _web_dismissContentRelativeChildWindows]):
1759         (-[WKView _web_dismissContentRelativeChildWindowsWithAnimation:]):
1760         (-[WKView _web_gestureEventWasNotHandledByWebCore:]):
1761         (-[WKView _superInputContext]): Deleted.
1762         (-[WKView _superQuickLookWithEvent:]): Deleted.
1763         (-[WKView _superSwipeWithEvent:]): Deleted.
1764         (-[WKView _superMagnifyWithEvent:]): Deleted.
1765         (-[WKView _superSmartMagnifyWithEvent:]): Deleted.
1766         (-[WKView _superRemoveTrackingRect:]): Deleted.
1767         (-[WKView _superAccessibilityAttributeValue:]): Deleted.
1768         (-[WKView _superDoCommandBySelector:]): Deleted.
1769         (-[WKView _superPerformKeyEquivalent:]): Deleted.
1770         (-[WKView _superKeyDown:]): Deleted.
1771         (-[WKView _superHitTest:]): Deleted.
1772         (-[WKView _addFontPanelObserver]): Deleted.
1773         * UIProcess/API/mac/WKViewInternal.h:
1774         * UIProcess/Cocoa/WebViewImpl.h:
1775         * UIProcess/Cocoa/WebViewImpl.mm:
1776         (WebKit::WebViewImpl::hitTest):
1777         (WebKit::WebViewImpl::updateSecureInputState):
1778         (WebKit::WebViewImpl::notifyInputContextAboutDiscardedComposition):
1779         (WebKit::WebViewImpl::executeSavedCommandBySelector):
1780         (WebKit::WebViewImpl::dismissContentRelativeChildWindowsWithAnimation):
1781         (WebKit::WebViewImpl::dismissContentRelativeChildWindowsWithAnimationFromViewOnly):
1782         (WebKit::WebViewImpl::quickLookWithEvent):
1783         (WebKit::WebViewImpl::prepareForImmediateActionAnimation):
1784         (WebKit::WebViewImpl::cancelImmediateActionAnimation):
1785         (WebKit::WebViewImpl::completeImmediateActionAnimation):
1786         (WebKit::WebViewImpl::didChangeContentSize):
1787         (WebKit::WebViewImpl::accessibilityAttributeValue):
1788         (WebKit::WebViewImpl::removeTrackingRect):
1789         (WebKit::WebViewImpl::swipeWithEvent):
1790         (WebKit::WebViewImpl::magnifyWithEvent):
1791         (WebKit::WebViewImpl::smartMagnifyWithEvent):
1792         (WebKit::WebViewImpl::gestureEventWasNotHandledByWebCore):
1793         (WebKit::WebViewImpl::doCommandBySelector):
1794         (WebKit::WebViewImpl::inputContext):
1795         (WebKit::WebViewImpl::performKeyEquivalent):
1796         (WebKit::WebViewImpl::keyDown):
1797         * UIProcess/mac/PageClientImpl.mm:
1798         (WebKit::PageClientImpl::setDragImage):
1799         (WebKit::PageClientImpl::intrinsicContentSizeDidChange): Deleted.
1800         (WebKit::PageClientImpl::immediateActionAnimationControllerForHitTestResult): Deleted.
1801         Plop.
1802
1803 2015-11-02  Anders Carlsson  <andersca@apple.com>
1804
1805         Remove unused API client callback code
1806         https://bugs.webkit.org/show_bug.cgi?id=150813
1807
1808         Reviewed by Tim Horton.
1809
1810         * UIProcess/API/APILoaderClient.h:
1811         (API::LoaderClient::interactionOccurredWhileProcessUnresponsive): Deleted.
1812         * UIProcess/API/C/WKPage.cpp:
1813         (WKPageSetPageLoaderClient): Deleted.
1814         * UIProcess/ResponsivenessTimer.cpp:
1815         (WebKit::ResponsivenessTimer::timerFired):
1816         * UIProcess/ResponsivenessTimer.h:
1817         * UIProcess/WebPageProxy.cpp:
1818         (WebKit::WebPageProxy::interactionOccurredWhileProcessUnresponsive): Deleted.
1819         * UIProcess/WebPageProxy.h:
1820         * UIProcess/WebProcessProxy.cpp:
1821         (WebKit::WebProcessProxy::interactionOccurredWhileUnresponsive): Deleted.
1822         * UIProcess/WebProcessProxy.h:
1823
1824 2015-10-31  Andy Estes  <aestes@apple.com>
1825
1826         Replace iOS-only WebKitSystemInterface calls with SPI
1827         https://bugs.webkit.org/show_bug.cgi?id=150763
1828
1829         Reviewed by Darin Adler.
1830
1831         * Platform/ios/AccessibilityIOS.h: Added.
1832         * Platform/ios/AccessibilityIOS.mm: Added.
1833         (WebKit::newAccessibilityRemoteToken): Upstreamed the implementation of WKAXRemoteToken() from WebKitSystemInterface.
1834         * Shared/WebPreferencesDefinitions.h: Used Settings::defaultMinimumZoomFontSize() instead of WKGetMinimumZoomFontSize().
1835         * Shared/WebPreferencesStore.cpp:
1836         * UIProcess/API/Cocoa/WKWebView.mm:
1837         (shouldAllowPictureInPictureMediaPlayback): Used dyld_get_program_sdk_version() instead of iosExecutableWasLinkedOnOrAfterVersion().
1838         (-[WKWebView _takeViewSnapshot]): Used screenScaleFactor() instead of WKGetScreenScaleFactor().
1839         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
1840         (-[WKWebViewConfiguration init]): Used deviceClass() instead of WKGetDeviceClass().
1841         * UIProcess/ios/WKContentView.mm:
1842         (-[WKContentView _commonInitializationWithProcessPool:configuration:]): Used screenScaleFactor() instead of WKGetScaleFactorForScreen().
1843         (-[WKContentView _updateForScreen:]): Ditto.
1844         (storeAccessibilityRemoteConnectionInformation): Upstreamed the implementation of WKAXStoreRemoteConnectionInformation() from WebKitSystemInterface.
1845         (-[WKContentView _accessibilityRegisterUIProcessTokens]): Used newAccessibilityRemoteToken() and storeAccessibilityRemoteConnectionInformation() instead of WKAXRemoteToken() and WKAXStoreRemoteConnectionInformation().
1846         * UIProcess/ios/WKContentViewInteraction.mm:
1847         * UIProcess/ios/WebPageProxyIOS.mm:
1848         (WebKit::WebPageProxy::screenSize): Used screenSize() instead of WKGetScreenSize().
1849         (WebKit::WebPageProxy::availableScreenSize): Used availableScreenSize() instead of WKGetAvailableScreenSize().
1850         (WebKit::WebPageProxy::textAutosizingWidth): Used screenSize() instead of WKGetScreenSize().
1851         * WebKit2.xcodeproj/project.pbxproj:
1852         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
1853         (InitWebCoreSystemInterface): Deleted.
1854         * WebProcess/WebPage/ios/WebPageIOS.mm:
1855         (WebKit::WebPage::platformInitializeAccessibility): Used newAccessibilityRemoteToken() instead of WKAXRemoteToken().
1856
1857 2015-11-02  Commit Queue  <commit-queue@webkit.org>
1858
1859         Unreviewed, rolling out r191902.
1860         https://bugs.webkit.org/show_bug.cgi?id=150811
1861
1862         This change broke iOS builders (Requested by ryanhaddad on
1863         #webkit).
1864
1865         Reverted changeset:
1866
1867         "Replace iOS-only WebKitSystemInterface calls with SPI"
1868         https://bugs.webkit.org/show_bug.cgi?id=150763
1869         http://trac.webkit.org/changeset/191902
1870
1871 2015-10-31  Andy Estes  <aestes@apple.com>
1872
1873         Replace iOS-only WebKitSystemInterface calls with SPI
1874         https://bugs.webkit.org/show_bug.cgi?id=150763
1875
1876         Reviewed by Darin Adler.
1877
1878         * Platform/ios/AccessibilityIOS.h: Added.
1879         * Platform/ios/AccessibilityIOS.mm: Added.
1880         (WebKit::newAccessibilityRemoteToken): Upstreamed the implementation of WKAXRemoteToken() from WebKitSystemInterface.
1881         * Shared/WebPreferencesDefinitions.h: Used Settings::defaultMinimumZoomFontSize() instead of WKGetMinimumZoomFontSize().
1882         * Shared/WebPreferencesStore.cpp:
1883         * UIProcess/API/Cocoa/WKWebView.mm:
1884         (shouldAllowPictureInPictureMediaPlayback): Used dyld_get_program_sdk_version() instead of iosExecutableWasLinkedOnOrAfterVersion().
1885         (-[WKWebView _takeViewSnapshot]): Used screenScaleFactor() instead of WKGetScreenScaleFactor().
1886         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
1887         (-[WKWebViewConfiguration init]): Used deviceClass() instead of WKGetDeviceClass().
1888         * UIProcess/ios/WKContentView.mm:
1889         (-[WKContentView _commonInitializationWithProcessPool:configuration:]): Used screenScaleFactor() instead of WKGetScaleFactorForScreen().
1890         (-[WKContentView _updateForScreen:]): Ditto.
1891         (storeAccessibilityRemoteConnectionInformation): Upstreamed the implementation of WKAXStoreRemoteConnectionInformation() from WebKitSystemInterface.
1892         (-[WKContentView _accessibilityRegisterUIProcessTokens]): Used newAccessibilityRemoteToken() and storeAccessibilityRemoteConnectionInformation() instead of WKAXRemoteToken() and WKAXStoreRemoteConnectionInformation().
1893         * UIProcess/ios/WKContentViewInteraction.mm:
1894         * UIProcess/ios/WebPageProxyIOS.mm:
1895         (WebKit::WebPageProxy::screenSize): Used screenSize() instead of WKGetScreenSize().
1896         (WebKit::WebPageProxy::availableScreenSize): Used availableScreenSize() instead of WKGetAvailableScreenSize().
1897         (WebKit::WebPageProxy::textAutosizingWidth): Used screenSize() instead of WKGetScreenSize().
1898         * WebKit2.xcodeproj/project.pbxproj:
1899         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
1900         (InitWebCoreSystemInterface): Deleted.
1901         * WebProcess/WebPage/ios/WebPageIOS.mm:
1902         (WebKit::WebPage::platformInitializeAccessibility): Used newAccessibilityRemoteToken() instead of WKAXRemoteToken().
1903
1904 2015-11-02  Yongjun Zhang  <yongjun_zhang@apple.com>
1905
1906         Add objC delegate callback for webProcessDidBecomeResponsive and webProcessDidBecomeUnresponsive.
1907         https://bugs.webkit.org/show_bug.cgi?id=150778
1908
1909         Add methods into WKNavigationDelegatePrivate to notify WebKit client when web process becomes unresponsive
1910         or responsive, which is reported by WebKit::ResponsivenessTimer.
1911
1912         Reviewed by Darin Adler.
1913
1914         * UIProcess/API/APINavigationClient.h: Add two new method processDidBecomeResponsive and processDidBecomeUnresponsive
1915             to NavigationClient; they are called when WebKit::ResponsivenessTimer update its client's state.
1916         (API::NavigationClient::processDidBecomeResponsive):
1917         (API::NavigationClient::processDidBecomeUnresponsive):
1918         * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h: Add two new delegate method to WKNavigationDelegatePrivate:
1919             _webViewWebProcessDidBecomeResponsive: and _webViewWebProcessDidBecomeUnresponsive:
1920         * UIProcess/Cocoa/NavigationState.h: Add new overriding methods processDidBecomeResponsive and processDidBecomeUnresponsive.
1921             Also add a bool member for each method to indicate if the delegate has implement the related method.
1922         * UIProcess/Cocoa/NavigationState.mm:
1923         (WebKit::NavigationState::setNavigationDelegate): Update the new bool members based on the delegate.
1924         (WebKit::NavigationState::NavigationClient::processDidBecomeResponsive): Send the delegate message to navigationDelegate
1925             if _webViewWebProcessDidBecomeResponsive: is implemented.
1926         (WebKit::NavigationState::NavigationClient::processDidBecomeUnresponsive): Ditto.
1927         * UIProcess/WebPageProxy.cpp:
1928         (WebKit::WebPageProxy::processDidBecomeUnresponsive): Call navigationClient's processDidBecomeUnresponsive if the page proxy
1929             has navigationClient.
1930         (WebKit::WebPageProxy::processDidBecomeResponsive):  Call navigationClient's processDidBecomeResponsive if the page proxy
1931             has navigationClient.
1932
1933 2015-11-02  Beth Dakin  <bdakin@apple.com>
1934
1935         Tapping and holding a link should have a share option
1936         https://bugs.webkit.org/show_bug.cgi?id=150693
1937
1938         Reviewed by Dan Bernstein.
1939
1940         This is a follow-up to the original change. This change fixes non-ascii URLs. 
1941         They should maintain their non-ascii characters when they are shared.
1942
1943         * UIProcess/ios/WKContentViewInteraction.mm:
1944         (-[WKContentView actionSheetAssistant:shareElementWithURL:rect:]):
1945         * UIProcess/ios/WKPDFView.mm:
1946         (-[WKPDFView actionSheetAssistant:shareElementWithURL:rect:]):
1947
1948 2015-11-02  Youenn Fablet  <youenn.fablet@crf.canon.fr>
1949
1950         Rename JSDOMWrapper.impl to JSDOMWrapper.wrapped
1951         https://bugs.webkit.org/show_bug.cgi?id=150613
1952
1953         Reviewed by Darin Adler.
1954
1955         * WebProcess/WebPage/WebFrame.cpp:
1956         (WebKit::WebFrame::frameForContext): Renaming impl() to wrapped().
1957         (WebKit::WebFrame::counterValue): Ditto.
1958
1959 2015-11-02  Carlos Garcia Campos  <cgarcia@igalia.com>
1960
1961         [GLIB] Remove support for GSocket main loop sources from GMainLoopSource
1962         https://bugs.webkit.org/show_bug.cgi?id=150772
1963
1964         Reviewed by Žan Doberšek.
1965
1966         Add GSocketMonitor class to be used by Connection to monitor the
1967         availability of the socket file descriptor instead of using a
1968         GMainLoopSource.
1969
1970         * Platform/IPC/Connection.h:
1971         * Platform/IPC/glib/GSocketMonitor.cpp: Added.
1972         (IPC::GSocketMonitor::~GSocketMonitor):
1973         (IPC::GSocketMonitor::socketSourceCallback):
1974         (IPC::GSocketMonitor::start):
1975         (IPC::GSocketMonitor::stop):
1976         * Platform/IPC/glib/GSocketMonitor.h: Added.
1977         * Platform/IPC/unix/ConnectionUnix.cpp:
1978         (IPC::Connection::platformInvalidate):
1979         (IPC::Connection::open):
1980         * PlatformGTK.cmake:
1981
1982 2015-11-01  Carlos Garcia Campos  <cgarcia@igalia.com>
1983
1984         [GTK] Use RunLoop in WorkQueue implementation
1985         https://bugs.webkit.org/show_bug.cgi?id=150770
1986
1987         Reviewed by Darin Adler.
1988
1989         * Platform/IPC/unix/ConnectionUnix.cpp:
1990         (IPC::Connection::open): Get the main context from the WorkQueue Runloop.
1991
1992 2015-11-01  Yusuke Suzuki  <utatane.tea@gmail.com>
1993
1994         [ES6] Support Generator Syntax
1995         https://bugs.webkit.org/show_bug.cgi?id=150769
1996
1997         Reviewed by Geoffrey Garen.
1998
1999         Added ENABLE_ES6_GENERATORS flag.
2000
2001         * Configurations/FeatureDefines.xcconfig:
2002
2003 2015-11-01  Brent Fulgham  <bfulgham@apple.com>
2004
2005         Use convenience function in sandbox profile
2006         https://bugs.webkit.org/show_bug.cgi?id=150732
2007         <rdar://problem/23287894>
2008
2009         Reviewed by Alexey Proskuryakov.
2010
2011         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: Switch to
2012         the 'awd-log-directory' convenience function.
2013
2014 2015-11-01  Joonghun Park  <jh718.park@samsung.com>
2015
2016         [EFL] Fix inappropriate move semantics use in parseAndRemoveEnvironments function
2017         https://bugs.webkit.org/show_bug.cgi?id=150544
2018
2019         Reviewed by Darin Adler.
2020
2021         In parseAndRemoveEnvironments function, it declares its paramerter type as rvalue.
2022         But in ProcessLauncher::launchProcess(), the argument of
2023         parseAndRemoveEnvironments still be used after the call of the function.
2024         Currently the rvalue is not assigned to any other variable in parseAndRemoveEnvironments,
2025         so it doesn't lead to runtime error but use of move semantic
2026         is not appropriate semantically in this case.
2027
2028         * UIProcess/Launcher/efl/ProcessLauncherEfl.cpp:
2029         (WebKit::parseAndRemoveEnvironments):
2030         (WebKit::ProcessLauncher::launchProcess):
2031
2032 2015-11-01  Commit Queue  <commit-queue@webkit.org>
2033
2034         Unreviewed, rolling out r191831.
2035         https://bugs.webkit.org/show_bug.cgi?id=150774
2036
2037         The new test fails (Requested by ap on #webkit).
2038
2039         Reverted changeset:
2040
2041         "Begin work on supporting reply blocks in
2042         _WKRemoteObjectRegistry"
2043         https://bugs.webkit.org/show_bug.cgi?id=150739
2044         http://trac.webkit.org/changeset/191831
2045
2046 2015-11-01  Philip Chimento  <philip.chimento@gmail.com>
2047
2048         [GTK] Fix combinations of PLATFORM(GTK) and OS(DARWIN)
2049         https://bugs.webkit.org/show_bug.cgi?id=144560
2050
2051         Reviewed by Darin Adler.
2052
2053         * NetworkProcess/NetworkProcess.cpp:
2054         (WebKit::NetworkProcess::createNetworkConnectionToWebProcess):
2055         Change order of OS(DARWIN) and USE(UNIX_DOMAIN_SOCKETS) checks,
2056         so that we can use Unix domain sockets even on Darwin for the GTK
2057         platform.
2058         * Platform/IPC/Attachment.cpp: Add USE(UNIX_DOMAIN_SOCKETS) check
2059         to OS(DARWIN) check, in order to support GTK platform on OSX.
2060         * Platform/IPC/Attachment.h: Change order of OS(DARWIN) and
2061         USE(UNIX_DOMAIN_SOCKETS) checks throughout.
2062         (IPC::Attachment::size):
2063         (IPC::Attachment::releaseFileDescriptor):
2064         (IPC::Attachment::fileDescriptor):
2065         (IPC::Attachment::disposition):
2066         (IPC::Attachment::port): 
2067         * Platform/IPC/Connection.h: Ditto.
2068         (IPC::Connection::identifierIsNull):
2069         (IPC::Connection::Identifier::Identifier): 
2070         (IPC::Connection::xpcConnection): 
2071         * Platform/IPC/unix/ConnectionUnix.cpp: Only use SOCK_SEQPACKET
2072         if the platform is not GTK, because otherwise the PLATFORM(GTK)
2073         check below is never reached.
2074         * Platform/SharedMemory.h: Change order of OS(DARWIN) and
2075         USE(UNIX_DOMAIN_SOCKETS) checks.
2076         * PluginProcess/PluginProcess.cpp: Ditto.
2077         (WebKit::PluginProcess::createWebProcessConnection):
2078         * Shared/API/c/WKBase.h: Don't include WKBaseMac.h if building
2079         GTK.
2080         * UIProcess/API/C/WKNativeEvent.h: Don't use Apple API if
2081         building GTK.
2082         * UIProcess/Launcher/ProcessLauncher.cpp: Change to
2083         OS(DARWIN) && !PLATFORM(GTK), in the absence of a better platform
2084         macro such as USE(MACH).
2085         (WebKit::ProcessLauncher::didFinishLaunchingProcess):
2086         * UIProcess/Launcher/ProcessLauncher.h: Ditto.
2087         * UIProcess/Network/NetworkProcessProxy.cpp: Change order of
2088         OS(DARWIN) and PLATFORM(GTK) checks.
2089         (WebKit::NetworkProcessProxy::networkProcessCrashedOrFailedToLaunch):
2090         (WebKit::NetworkProcessProxy::didCreateNetworkConnectionToWebProcess):
2091         * UIProcess/Plugins/PluginProcessProxy.cpp: Ditto.
2092         (WebKit::PluginProcessProxy::pluginProcessCrashedOrFailedToLaunch):
2093         (WebKit::PluginProcessProxy::didCreateWebProcessConnection):
2094         * WebProcess/Plugins/PluginProcessConnectionManager.cpp: Ditto.
2095         (WebKit::PluginProcessConnectionManager::getPluginProcessConnection):
2096         * WebProcess/WebPage/WebInspector.cpp: Ditto.
2097         (WebKit::WebInspector::createInspectorPage):
2098         * WebProcess/WebPage/WebInspectorUI.cpp: Ditto.
2099         (WebKit::WebInspectorUI::establishConnection):
2100         * WebProcess/WebProcess.cpp: Ditto.
2101         (WebKit::WebProcess::ensureNetworkProcessConnection):
2102
2103 2015-11-01  Carlos Garcia Campos  <cgarcia@igalia.com>
2104
2105         [GTK] Use RunLoop::Timer in PluginInfoCache
2106         https://bugs.webkit.org/show_bug.cgi?id=150757
2107
2108         Reviewed by Darin Adler.
2109
2110         Use RunLoop::Timer instead of GMainLoopSource to save the cache
2111         contents in an idle. Also remove the mutex, since RunLoop::Timer
2112         is thread safe and saveToFile() is private and only called by the
2113         main thread loop. Also removed the code to save the file in the
2114         destructor since PluginInfoCache is a singleton and never
2115         destroyed. It's very unlikely that the program finished before the
2116         cache is saved, but even if that happens it would be harmless, the
2117         cache will be saved at some point the next time.
2118
2119         * UIProcess/Plugins/gtk/PluginInfoCache.cpp:
2120         (WebKit::PluginInfoCache::PluginInfoCache):
2121         (WebKit::PluginInfoCache::updatePluginInfo):
2122         (WebKit::PluginInfoCache::~PluginInfoCache):
2123         (WebKit::PluginInfoCache::saveToFile):
2124         * UIProcess/Plugins/gtk/PluginInfoCache.h:
2125
2126 2015-11-01  Carlos Garcia Campos  <cgarcia@igalia.com>
2127
2128         [GTK] Use a RunLoop::Timer to schedule rendering frames in accelerated compositing mode
2129         https://bugs.webkit.org/show_bug.cgi?id=150756
2130
2131         Reviewed by Darin Adler.
2132
2133         Use a RunLoop::Timer instead of a GMainLoopSource for the
2134         accelerated compositing render loop to improve the performance,
2135         since RunLoop::Timer uses a persistent source.
2136         All the logic to schedule rames has been moved to a helper
2137         internal class RenderFrameScheduler.
2138
2139         * WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp:
2140         (WebKit::LayerTreeHostGtk::RenderFrameScheduler::RenderFrameScheduler):
2141         (WebKit::LayerTreeHostGtk::RenderFrameScheduler::~RenderFrameScheduler):
2142         (WebKit::LayerTreeHostGtk::RenderFrameScheduler::start):
2143         (WebKit::LayerTreeHostGtk::RenderFrameScheduler::stop):
2144         (WebKit::shouldSkipNextFrameBecauseOfContinousImmediateFlushes):
2145         (WebKit::LayerTreeHostGtk::RenderFrameScheduler::nextFrame):
2146         (WebKit::LayerTreeHostGtk::RenderFrameScheduler::renderFrame):
2147         (WebKit::LayerTreeHostGtk::LayerTreeHostGtk):
2148         (WebKit::LayerTreeHostGtk::renderFrame):
2149         (WebKit::LayerTreeHostGtk::scheduleLayerFlush):
2150         (WebKit::LayerTreeHostGtk::cancelPendingLayerFlush):
2151         (WebKit::LayerTreeHostGtk::layerFlushTimerFired): Deleted.
2152         * WebProcess/WebPage/gtk/LayerTreeHostGtk.h:
2153
2154 2015-10-31  Andreas Kling  <akling@apple.com>
2155
2156         Add a debug overlay with information about web process resource usage.
2157         <https://webkit.org/b/150599>
2158
2159         Reviewed by Darin Adler.
2160
2161         Add WK2 preferences SPI for showing/hiding the resource usage overlay.
2162
2163         * Shared/WebPreferencesDefinitions.h:
2164         * UIProcess/API/C/WKPreferences.cpp:
2165         (WKPreferencesSetResourceUsageOverlayVisible):
2166         (WKPreferencesGetResourceUsageOverlayVisible):
2167         * UIProcess/API/C/WKPreferencesRefPrivate.h:
2168         * UIProcess/API/Cocoa/WKPreferences.mm:
2169         (-[WKPreferences _resourceUsageOverlayVisible]):
2170         (-[WKPreferences _setResourceUsageOverlayVisible:]):
2171         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
2172         * WebProcess/WebPage/WebPage.cpp:
2173         (WebKit::WebPage::updatePreferences):
2174
2175 2015-10-31  Alex Christensen  <achristensen@webkit.org>
2176
2177         Share more code between NETWORK_SESSION and non-NETWORK_SESSION NetworkResourceLoaders
2178         https://bugs.webkit.org/show_bug.cgi?id=150742
2179
2180         Reviewed by Darin Adler.
2181
2182         r191457 added enough code to NetworkResourceLoader to load most resources successfully if there are no errors.
2183         It passed about 80% of LayoutTests/http and crashed sometimes.
2184         This passes about 95% of LayoutTests/http and does not crash on any of the LayoutTests/http.
2185         It should not change behavior of the non-NETWORK_SESSION code which is currently the default in trunk.
2186
2187         * NetworkProcess/NetworkResourceLoader.cpp:
2188         (WebKit::NetworkResourceLoader::abort):
2189         (WebKit::NetworkResourceLoader::sharedDidReceiveResponse):
2190         (WebKit::NetworkResourceLoader::sharedDidReceiveBuffer):
2191         (WebKit::NetworkResourceLoader::sharedDidFinishLoading):
2192         (WebKit::NetworkResourceLoader::sharedDidFail):
2193         (WebKit::NetworkResourceLoader::sharedWillSendRedirectedRequest):
2194         (WebKit::NetworkResourceLoader::willPerformHTTPRedirection):
2195         (WebKit::NetworkResourceLoader::didReceiveChallenge):
2196         (WebKit::NetworkResourceLoader::didReceiveResponse):
2197         (WebKit::NetworkResourceLoader::didReceiveData):
2198         (WebKit::NetworkResourceLoader::didCompleteWithError):
2199         (WebKit::NetworkResourceLoader::didReceiveResponseAsync):
2200         (WebKit::NetworkResourceLoader::didReceiveBuffer):
2201         (WebKit::NetworkResourceLoader::didFinishLoading):
2202         (WebKit::NetworkResourceLoader::didFail):
2203         (WebKit::NetworkResourceLoader::willSendRequestAsync):
2204         * NetworkProcess/NetworkResourceLoader.h:
2205         * NetworkProcess/NetworkSession.h:
2206         (WebKit::NetworkSessionTaskClient::~NetworkSessionTaskClient):
2207
2208 2015-10-28  Wenson Hsieh  <wenson_hsieh@apple.com>
2209
2210         Inner height behavior when the keyboard is shown should match on WKWebView and MobileSafari
2211         https://bugs.webkit.org/show_bug.cgi?id=150634
2212         <rdar://problem/23202254>
2213
2214         Reviewed by Benjamin Poulain.
2215
2216         Make WKWebView match behavior in Safari by not firing resize events and changing the inner height when showing
2217         or hiding the keyboard. Previously, the WKWebView would do both of the above because we use the scroll view's
2218         contentInset property when no unobscured insets are explicitly set for the WKWebView. To fix this, when updating
2219         the visible content rect of a WKWebView for computing the inner height, we readjust the computed bottom inset
2220         to not take the keyboard height into account. To know how much we need to readjust the inset by, we store the
2221         total amount by which the scroll view's bottom inset has been adjusted due to the keyboard.
2222
2223         We perform this readjustment in _updateVisibleContentRects rather than in _computedContentInset since some users
2224         of _computedContentInset may still expect the bottom inset to account for the keyboard height. However, when
2225         updating visible content rects, we should not account for the keyboard height since we don't want the inner height
2226         to change when showing or hiding the keyboard.
2227
2228         Lastly, while calling _adjustForAutomaticKeyboardInfo, we may end up calling _updateVisibleContentRects. This call
2229         is unnecessary since we call it again immediately after _adjustForAutomaticKeyboardInfo, and it also complicates
2230         the readjustment logic, so it makes sense to prevent the update from happening altogether while we are adjusting
2231         the scroll view's insets due to keyboard changes. Altogether, these changes mean that the computed inner height
2232         will no longer be adjusted for the keyboard height on WKWebViews, matching the behavior observed on mobile Safari.
2233
2234         Test: LayoutTests/fast/events/ios/keyboard-should-not-trigger-resize.html
2235
2236         * UIProcess/API/Cocoa/WKWebView.mm:
2237         (-[WKWebView _updateVisibleContentRects]):
2238         (-[WKWebView _keyboardChangedWithInfo:adjustScrollView:]):
2239
2240 2015-10-30  Anders Carlsson  <andersca@apple.com>
2241
2242         Begin work on supporting reply blocks in _WKRemoteObjectRegistry
2243         https://bugs.webkit.org/show_bug.cgi?id=150739
2244
2245         Reviewed by Tim Horton.
2246
2247         * Platform/spi/Cocoa/BlockSPI.h:
2248         Add SPI header.
2249
2250         * Shared/API/Cocoa/RemoteObjectInvocation.h:
2251         (WebKit::RemoteObjectInvocation::ReplyInfo::ReplyInfo):
2252         (WebKit::RemoteObjectInvocation::replyInfo):
2253         * Shared/API/Cocoa/RemoteObjectInvocation.mm:
2254         (WebKit::RemoteObjectInvocation::RemoteObjectInvocation):
2255         (WebKit::RemoteObjectInvocation::encode):
2256         (WebKit::RemoteObjectInvocation::decode):
2257         Add an optional ReplyInfo struct to RemoteObjectInvocation.
2258
2259         * Shared/API/Cocoa/_WKRemoteObjectRegistry.mm:
2260         (generateReplyIdentifier):
2261         Helper function to generate a reply identifier.
2262
2263         (-[_WKRemoteObjectRegistry _sendInvocation:interface:]):
2264         Do some block parameter validation.
2265
2266         * WebKit2.xcodeproj/project.pbxproj:
2267
2268 2015-10-30  Beth Dakin  <bdakin@apple.com>
2269
2270         Link preview doesn't work on XHTML pages with Content-Type header as 
2271         ‘application/xhtml+xml’
2272         https://bugs.webkit.org/show_bug.cgi?id=150740
2273         -and corresponding-
2274         rdar://problem/23063585
2275
2276         Reviewed by Tim Horton.
2277
2278         For XHTML pages, the element names are lowercase. This patch uses 
2279         equalIgnoringCase to fix the bug.
2280         * UIProcess/ios/WKContentViewInteraction.mm:
2281         (-[WKContentView _actionForLongPress]):
2282         (-[WKContentView _interactionShouldBeginFromPreviewItemController:forPosition:]):
2283         (-[WKContentView _dataForPreviewItemController:atPosition:type:]):
2284
2285 2015-10-30  Tim Horton  <timothy_horton@apple.com>
2286
2287         WKView being inside WKWebView leads to weird API issues
2288         https://bugs.webkit.org/show_bug.cgi?id=150174
2289
2290         Reviewed by Anders Carlsson.
2291
2292         * UIProcess/API/mac/WKView.mm:
2293         (-[WKView initWithFrame:processGroup:browsingContextGroup:relatedToView:]):
2294         (-[WKView prepareContentInRect:]):
2295         (-[WKView initWithFrame:processPool:configuration:webView:]):
2296         (-[WKView pageRef]):
2297         (-[WKView _web_immediateActionAnimationControllerForHitTestResultInternal:withType:userData:]):
2298         (-[WKView dealloc]): Deleted.
2299         * UIProcess/Cocoa/WebViewImpl.h:
2300         (WebKit::WebViewImpl::page):
2301         * UIProcess/Cocoa/WebViewImpl.mm:
2302         (-[WKWindowVisibilityObserver initWithView:impl:]):
2303         (-[WKWindowVisibilityObserver dealloc]):
2304         (-[WKWindowVisibilityObserver _activeSpaceDidChange:]):
2305         (WebKit::WebViewImpl::WebViewImpl):
2306         (WebKit::WebViewImpl::~WebViewImpl):
2307         (WebKit::WebViewImpl::setDrawsBackground):
2308         (WebKit::WebViewImpl::drawsBackground):
2309         (WebKit::WebViewImpl::setDrawsTransparentBackground):
2310         (WebKit::WebViewImpl::drawsTransparentBackground):
2311         (WebKit::WebViewImpl::isOpaque):
2312         (WebKit::WebViewImpl::acceptsFirstMouse):
2313         (WebKit::WebViewImpl::becomeFirstResponder):
2314         (WebKit::WebViewImpl::resignFirstResponder):
2315         (WebKit::WebViewImpl::viewWillStartLiveResize):
2316         (WebKit::WebViewImpl::viewDidEndLiveResize):
2317         (WebKit::WebViewImpl::updateWindowAndViewFrames):
2318         (WebKit::WebViewImpl::setFixedLayoutSize):
2319         (WebKit::WebViewImpl::fixedLayoutSize):
2320         (WebKit::WebViewImpl::isUsingUISideCompositing):
2321         (WebKit::WebViewImpl::setDrawingAreaSize):
2322         (WebKit::WebViewImpl::forceAsyncDrawingAreaSizeUpdate):
2323         (WebKit::WebViewImpl::waitForAsyncDrawingAreaSizeUpdate):
2324         (WebKit::WebViewImpl::updateLayer):
2325         (WebKit::WebViewImpl::drawRect):
2326         (WebKit::WebViewImpl::dispatchSetTopContentInset):
2327         (WebKit::WebViewImpl::prepareContentInRect):
2328         (WebKit::WebViewImpl::updateViewExposedRect):
2329         (WebKit::WebViewImpl::setMinimumSizeForAutoLayout):
2330         (WebKit::WebViewImpl::minimumSizeForAutoLayout):
2331         (WebKit::WebViewImpl::setShouldExpandToViewHeightForAutoLayout):
2332         (WebKit::WebViewImpl::shouldExpandToViewHeightForAutoLayout):
2333         (WebKit::WebViewImpl::setIntrinsicContentSize):
2334         (WebKit::WebViewImpl::setViewScale):
2335         (WebKit::WebViewImpl::viewScale):
2336         (WebKit::WebViewImpl::supportsArbitraryLayoutModes):
2337         (WebKit::WebViewImpl::setOverrideDeviceScaleFactor):
2338         (WebKit::WebViewImpl::windowDidOrderOffScreen):
2339         (WebKit::WebViewImpl::windowDidOrderOnScreen):
2340         (WebKit::WebViewImpl::windowDidBecomeKey):
2341         (WebKit::WebViewImpl::windowDidResignKey):
2342         (WebKit::WebViewImpl::windowDidMiniaturize):
2343         (WebKit::WebViewImpl::windowDidDeminiaturize):
2344         (WebKit::WebViewImpl::windowDidChangeBackingProperties):
2345         (WebKit::WebViewImpl::windowDidChangeScreen):
2346         (WebKit::WebViewImpl::windowDidChangeLayerHosting):
2347         (WebKit::WebViewImpl::windowDidChangeOcclusionState):
2348         (WebKit::WebViewImpl::shouldDelayWindowOrderingForEvent):
2349         (WebKit::WebViewImpl::windowResizeMouseLocationIsInVisibleScrollerThumb):
2350         (WebKit::WebViewImpl::viewDidMoveToWindow):
2351         (WebKit::WebViewImpl::viewDidChangeBackingProperties):
2352         (WebKit::WebViewImpl::viewDidHide):
2353         (WebKit::WebViewImpl::viewDidUnhide):
2354         (WebKit::WebViewImpl::activeSpaceDidChange):
2355         (WebKit::WebViewImpl::postFakeMouseMovedEventForFlagsChangedEvent):
2356         (WebKit::WebViewImpl::setUnderlayColor):
2357         (WebKit::WebViewImpl::underlayColor):
2358         (WebKit::WebViewImpl::pageExtendedBackgroundColor):
2359         (WebKit::WebViewImpl::setOverlayScrollbarStyle):
2360         (WebKit::WebViewImpl::overlayScrollbarStyle):
2361         (WebKit::WebViewImpl::endDeferringViewInWindowChanges):
2362         (WebKit::WebViewImpl::endDeferringViewInWindowChangesSync):
2363         (WebKit::WebViewImpl::prepareForMoveToWindow):
2364         (WebKit::WebViewImpl::updateSecureInputState):
2365         (WebKit::WebViewImpl::setPluginComplexTextInputState):
2366         (WebKit::WebViewImpl::handlePluginComplexTextInputKeyDown):
2367         (WebKit::WebViewImpl::handleAcceptedAlternativeText):
2368         (WebKit::WebViewImpl::pressureChangeWithEvent):
2369         (WebKit::WebViewImpl::isEditable):
2370         (WebKit::WebViewImpl::executeEditCommandForSelector):
2371         (WebKit::WebViewImpl::writeSelectionToPasteboard):
2372         (WebKit::WebViewImpl::readSelectionFromPasteboard):
2373         (WebKit::WebViewImpl::validRequestorForSendAndReturnTypes):
2374         (WebKit::WebViewImpl::centerSelectionInVisibleArea):
2375         (WebKit::WebViewImpl::updateFontPanelIfNeeded):
2376         (WebKit::WebViewImpl::changeFontFromFontPanel):
2377         (WebKit::WebViewImpl::validateUserInterfaceItem):
2378         (WebKit::WebViewImpl::startSpeaking):
2379         (WebKit::WebViewImpl::showGuessPanel):
2380         (WebKit::WebViewImpl::checkSpelling):
2381         (WebKit::WebViewImpl::changeSpelling):
2382         (WebKit::WebViewImpl::toggleContinuousSpellChecking):
2383         (WebKit::WebViewImpl::setGrammarCheckingEnabled):
2384         (WebKit::WebViewImpl::toggleGrammarChecking):
2385         (WebKit::WebViewImpl::toggleAutomaticSpellingCorrection):
2386         (WebKit::WebViewImpl::toggleSmartInsertDelete):
2387         (WebKit::WebViewImpl::setAutomaticQuoteSubstitutionEnabled):
2388         (WebKit::WebViewImpl::toggleAutomaticQuoteSubstitution):
2389         (WebKit::WebViewImpl::setAutomaticDashSubstitutionEnabled):
2390         (WebKit::WebViewImpl::toggleAutomaticDashSubstitution):
2391         (WebKit::WebViewImpl::setAutomaticLinkDetectionEnabled):
2392         (WebKit::WebViewImpl::toggleAutomaticLinkDetection):
2393         (WebKit::WebViewImpl::setAutomaticTextReplacementEnabled):
2394         (WebKit::WebViewImpl::toggleAutomaticTextReplacement):
2395         (WebKit::WebViewImpl::uppercaseWord):
2396         (WebKit::WebViewImpl::lowercaseWord):
2397         (WebKit::WebViewImpl::capitalizeWord):
2398         (WebKit::WebViewImpl::preferencesDidChange):
2399         (WebKit::WebViewImpl::dismissContentRelativeChildWindowsFromViewOnly):
2400         (WebKit::WebViewImpl::quickLookWithEvent):
2401         (WebKit::WebViewImpl::immediateActionAnimationControllerForHitTestResult):
2402         (WebKit::WebViewImpl::didChangeContentSize):
2403         (WebKit::WebViewImpl::setIgnoresNonWheelEvents):
2404         (WebKit::WebViewImpl::updateRemoteAccessibilityRegistration):
2405         (WebKit::WebViewImpl::accessibilityRegisterUIProcessTokens):
2406         (WebKit::WebViewImpl::stringForToolTip):
2407         (WebKit::WebViewImpl::setInspectorAttachmentView):
2408         (WebKit::WebViewImpl::remoteObjectRegistry):
2409         (WebKit::WebViewImpl::browsingContextController):
2410         (WebKit::WebViewImpl::draggedImage):
2411         (WebKit::WebViewImpl::draggingEntered):
2412         (WebKit::WebViewImpl::draggingUpdated):
2413         (WebKit::WebViewImpl::draggingExited):
2414         (WebKit::WebViewImpl::performDragOperation):
2415         (WebKit::WebViewImpl::takeViewSnapshot):
2416         (WebKit::WebViewImpl::saveBackForwardSnapshotForCurrentItem):
2417         (WebKit::WebViewImpl::saveBackForwardSnapshotForItem):
2418         (WebKit::WebViewImpl::setAllowsBackForwardNavigationGestures):
2419         (WebKit::WebViewImpl::setMagnification):
2420         (WebKit::WebViewImpl::magnification):
2421         (WebKit::WebViewImpl::scrollWheel):
2422         (WebKit::WebViewImpl::swipeWithEvent):
2423         (WebKit::WebViewImpl::magnifyWithEvent):
2424         (WebKit::WebViewImpl::rotateWithEvent):
2425         (WebKit::WebViewImpl::doCommandBySelector):
2426         (WebKit::WebViewImpl::insertText):
2427         (WebKit::WebViewImpl::selectedRangeWithCompletionHandler):
2428         (WebKit::WebViewImpl::markedRangeWithCompletionHandler):
2429         (WebKit::WebViewImpl::hasMarkedTextWithCompletionHandler):
2430         (WebKit::WebViewImpl::attributedSubstringForProposedRange):
2431         (WebKit::WebViewImpl::firstRectForCharacterRange):
2432         (WebKit::WebViewImpl::characterIndexForPoint):
2433         (WebKit::WebViewImpl::inputContext):
2434         (WebKit::WebViewImpl::unmarkText):
2435         (WebKit::WebViewImpl::setMarkedText):
2436         (WebKit::WebViewImpl::performKeyEquivalent):
2437         (WebKit::WebViewImpl::keyUp):
2438         (WebKit::WebViewImpl::keyDown):
2439         (WebKit::WebViewImpl::flagsChanged):
2440         (WebKit::WebViewImpl::executeSavedKeypressCommands):
2441         (WebKit::WebViewImpl::selectedRange):
2442         (WebKit::WebViewImpl::hasMarkedText):
2443         (WebKit::WebViewImpl::markedRange):
2444         (WebKit::WebViewImpl::setContentPreparationRect): Deleted.
2445         (WebKit::WebViewImpl::immediateActionAnimationControllerForHitTestResultFromViewOnly): Deleted.
2446         (WebKit::WebViewImpl::destroyRemoteObjectRegistry): Deleted.
2447         * UIProcess/WebPageProxy.h:
2448         (WebKit::WebPageProxy::scrollPinningBehavior):
2449         (WebKit::WebPageProxy::overlayScrollbarStyle):
2450         * UIProcess/WebProcessPool.cpp:
2451         (WebKit::WebProcessPool::createWebPage):
2452         * UIProcess/WebProcessPool.h:
2453         * UIProcess/mac/PageClientImpl.h:
2454         * UIProcess/mac/PageClientImpl.mm:
2455         (WebKit::PageClientImpl::PageClientImpl):
2456         (WebKit::PageClientImpl::createDrawingAreaProxy):
2457         (WebKit::PageClientImpl::viewSize):
2458         (WebKit::PageClientImpl::activeView):
2459         (WebKit::PageClientImpl::activeWindow):
2460         (WebKit::PageClientImpl::isViewFocused):
2461         (WebKit::PageClientImpl::makeFirstResponder):
2462         (WebKit::PageClientImpl::isViewVisible):
2463         (WebKit::PageClientImpl::colorSpace):
2464         (WebKit::PageClientImpl::processDidExit):
2465         (WebKit::PageClientImpl::pageClosed):
2466         (WebKit::PageClientImpl::didRelaunchProcess):
2467         (WebKit::PageClientImpl::preferencesDidChange):
2468         (WebKit::PageClientImpl::toolTipChanged):
2469         (WebKit::PageClientImpl::didCommitLoadForMainFrame):
2470         (WebKit::PageClientImpl::didChangeContentSize):
2471         (WebKit::PageClientImpl::setCursor):
2472         (WebKit::PageClientImpl::registerEditCommand):
2473         (WebKit::PageClientImpl::registerInsertionUndoGrouping):
2474         (WebKit::PageClientImpl::clearAllEditCommands):
2475         (WebKit::PageClientImpl::canUndoRedo):
2476         (WebKit::PageClientImpl::executeUndoRedo):
2477         (WebKit::PageClientImpl::setDragImage):
2478         (WebKit::PageClientImpl::setPromisedDataForImage):
2479         (WebKit::PageClientImpl::setPromisedDataForAttachment):
2480         (WebKit::PageClientImpl::updateSecureInputState):
2481         (WebKit::PageClientImpl::resetSecureInputState):
2482         (WebKit::PageClientImpl::notifyInputContextAboutDiscardedComposition):
2483         (WebKit::PageClientImpl::convertToDeviceSpace):
2484         (WebKit::PageClientImpl::convertToUserSpace):
2485         (WebKit::PageClientImpl::screenToRootView):
2486         (WebKit::PageClientImpl::rootViewToScreen):
2487         (WebKit::PageClientImpl::doneWithKeyEvent):
2488         (WebKit::PageClientImpl::createPopupMenuProxy):
2489         (WebKit::PageClientImpl::createContextMenuProxy):
2490         (WebKit::PageClientImpl::createColorPicker):
2491         (WebKit::PageClientImpl::setTextIndicator):
2492         (WebKit::PageClientImpl::clearTextIndicator):
2493         (WebKit::PageClientImpl::setTextIndicatorAnimationProgress):
2494         (WebKit::PageClientImpl::accessibilityWebProcessTokenReceived):
2495         (WebKit::PageClientImpl::enterAcceleratedCompositingMode):
2496         (WebKit::PageClientImpl::exitAcceleratedCompositingMode):
2497         (WebKit::PageClientImpl::updateAcceleratedCompositingMode):
2498         (WebKit::PageClientImpl::setAcceleratedCompositingRootLayer):
2499         (WebKit::PageClientImpl::acceleratedCompositingRootLayer):
2500         (WebKit::PageClientImpl::takeViewSnapshot):
2501         (WebKit::PageClientImpl::selectionDidChange):
2502         (WebKit::PageClientImpl::wheelEventWasNotHandledByWebCore):
2503         (WebKit::PageClientImpl::gestureEventWasNotHandledByWebCore):
2504         (WebKit::PageClientImpl::pluginFocusOrWindowFocusChanged):
2505         (WebKit::PageClientImpl::setPluginComplexTextInputState):
2506         (WebKit::PageClientImpl::didPerformDictionaryLookup):
2507         (WebKit::PageClientImpl::dismissContentRelativeChildWindows):
2508         (WebKit::PageClientImpl::showCorrectionPanel):
2509         (WebKit::PageClientImpl::recordAutocorrectionResponse):
2510         (WebKit::PageClientImpl::recommendedScrollbarStyleDidChange):
2511         (WebKit::PageClientImpl::intrinsicContentSizeDidChange):
2512         (WebKit::PageClientImpl::executeSavedCommandBySelector):
2513         (WebKit::PageClientImpl::showDictationAlternativeUI):
2514         (WebKit::PageClientImpl::closeFullScreenManager):
2515         (WebKit::PageClientImpl::isFullScreen):
2516         (WebKit::PageClientImpl::enterFullScreen):
2517         (WebKit::PageClientImpl::exitFullScreen):
2518         (WebKit::PageClientImpl::beganEnterFullScreen):
2519         (WebKit::PageClientImpl::beganExitFullScreen):
2520         (WebKit::PageClientImpl::didFirstVisuallyNonEmptyLayoutForMainFrame):
2521         (WebKit::PageClientImpl::didFinishLoadForMainFrame):
2522         (WebKit::PageClientImpl::didFailLoadForMainFrame):
2523         (WebKit::PageClientImpl::didSameDocumentNavigationForMainFrame):
2524         (WebKit::PageClientImpl::removeNavigationGestureSnapshot):
2525         (WebKit::PageClientImpl::boundsOfLayerInLayerBackedWindowCoordinates):
2526         (WebKit::PageClientImpl::didPerformImmediateActionHitTest):
2527         (WebKit::PageClientImpl::immediateActionAnimationControllerForHitTestResult):
2528         (WebKit::PageClientImpl::showPlatformContextMenu):
2529         (WebKit::PageClientImpl::refView):
2530         (WebKit::PageClientImpl::derefView):
2531         (WebKit::PageClientImpl::startWindowDrag):
2532         (WebKit::PageClientImpl::platformWindow):
2533         (WebKit::PageClientImpl::inspectorAttachmentView):
2534         (WebKit::PageClientImpl::remoteObjectRegistry):
2535         * UIProcess/mac/WebColorPickerMac.h:
2536         * UIProcess/mac/WebColorPickerMac.mm:
2537         (WebKit::WebColorPickerMac::create):
2538         (WebKit::WebColorPickerMac::WebColorPickerMac):
2539         (-[WKColorPopoverMac initWithFrame:inView:]):
2540         * UIProcess/mac/WebContextMenuProxyMac.h:
2541         * UIProcess/mac/WebContextMenuProxyMac.mm:
2542         (WebKit::WebContextMenuProxyMac::WebContextMenuProxyMac):
2543         * UIProcess/mac/WebPopupMenuProxyMac.h:
2544         (WebKit::WebPopupMenuProxyMac::create):
2545         * UIProcess/mac/WebPopupMenuProxyMac.mm:
2546         (WebKit::WebPopupMenuProxyMac::WebPopupMenuProxyMac):
2547         Move ownership of WebPageProxy and PageClientImpl to WebViewImpl.
2548
2549 2015-10-30  Alex Christensen  <achristensen@webkit.org>
2550
2551         Fix Mac CMake build after rr191810.
2552
2553         * PlatformMac.cmake:
2554         Add RemoteObjectInvocation.mm.
2555
2556 2015-10-30  Anders Carlsson  <andersca@apple.com>
2557
2558         Add a separate object that represents a remote object invocation
2559         https://bugs.webkit.org/show_bug.cgi?id=150639
2560
2561         Reviewed by Tim Horton.
2562
2563         * Shared/API/Cocoa/RemoteObjectInvocation.h: Copied from Source/WebKit2/Shared/API/Cocoa/RemoteObjectRegistry.h.
2564         (WebKit::RemoteObjectInvocation::interfaceIdentifier):
2565         (WebKit::RemoteObjectInvocation::encodedInvocation):
2566         * Shared/API/Cocoa/RemoteObjectInvocation.mm: Copied from Source/WebKit2/Shared/API/Cocoa/RemoteObjectRegistry.mm.
2567         (WebKit::RemoteObjectInvocation::RemoteObjectInvocation):
2568         (WebKit::RemoteObjectInvocation::encode):
2569         (WebKit::RemoteObjectInvocation::decode):
2570         * Shared/API/Cocoa/RemoteObjectRegistry.h:
2571         * Shared/API/Cocoa/RemoteObjectRegistry.messages.in:
2572         * Shared/API/Cocoa/RemoteObjectRegistry.mm:
2573         (WebKit::RemoteObjectRegistry::sendInvocation):
2574         (WebKit::RemoteObjectRegistry::invokeMethod):
2575         * Shared/API/Cocoa/_WKRemoteObjectRegistry.mm:
2576         (-[_WKRemoteObjectRegistry _sendInvocation:interface:]):
2577         (-[_WKRemoteObjectRegistry _invokeMethod:]):
2578         * Shared/API/Cocoa/_WKRemoteObjectRegistryInternal.h:
2579         * WebKit2.xcodeproj/project.pbxproj:
2580
2581 2015-10-30  Beth Dakin  <bdakin@apple.com>
2582
2583         Another speculative build fix.
2584
2585         * UIProcess/API/Cocoa/_WKElementAction.h:
2586
2587 2015-10-30  Beth Dakin  <bdakin@apple.com>
2588
2589         Speculative build fix.
2590
2591         * Platform/spi/ios/UIKitSPI.h:
2592         * UIProcess/ios/WKContentViewInteraction.mm:
2593
2594 2015-10-30  Tim Horton  <timothy_horton@apple.com>
2595
2596         WKView being inside WKWebView leads to weird API issues
2597         https://bugs.webkit.org/show_bug.cgi?id=150174
2598
2599         Reviewed by Anders Carlsson.
2600
2601         * UIProcess/API/mac/WKView.mm:
2602         (-[WKView mouseMoved:]):
2603         (-[WKView mouseDown:]):
2604         (-[WKView mouseUp:]):
2605         (-[WKView mouseDragged:]):
2606         (-[WKView mouseEntered:]):
2607         (-[WKView mouseExited:]):
2608         (-[WKView otherMouseDown:]):
2609         (-[WKView otherMouseDragged:]):
2610         (-[WKView otherMouseUp:]):
2611         (-[WKView rightMouseDown:]):
2612         (-[WKView rightMouseDragged:]):
2613         (-[WKView rightMouseUp:]):
2614         (-[WKView _updateViewExposedRect]): Deleted.
2615         * UIProcess/Cocoa/WebViewImpl.h:
2616         * UIProcess/Cocoa/WebViewImpl.mm:
2617         (WebKit::WebViewImpl::mouseMoved):
2618         (WebKit::WebViewImpl::mouseDown):
2619         (WebKit::WebViewImpl::mouseUp):
2620         (WebKit::WebViewImpl::mouseDragged):
2621         Move mouse event handling.
2622
2623 2015-10-30  Beth Dakin  <bdakin@apple.com>
2624
2625         Tapping and holding a link should have a share option
2626         https://bugs.webkit.org/show_bug.cgi?id=150693
2627         -and corresponding-
2628         rdar://problem/21319702
2629
2630         Reviewed by Tim Horton.
2631
2632         New _WKElementActionType called _WKElementActionTypeShare.
2633         * UIProcess/API/Cocoa/_WKElementAction.h:
2634         * UIProcess/API/Cocoa/_WKElementAction.mm:
2635         (+[_WKElementAction _elementActionWithType:customTitle:assistant:]):
2636
2637         _WKElementActionTypeShare is part of the default actions for links.
2638         * UIProcess/ios/WKActionSheetAssistant.h:
2639         * UIProcess/ios/WKActionSheetAssistant.mm:
2640         (-[WKActionSheetAssistant defaultActionsForLinkSheet:]):
2641
2642         Handle the sharing part!
2643         * UIProcess/ios/WKContentViewInteraction.mm:
2644         (-[WKContentView actionSheetAssistant:shareElementWithURL:rect:]):
2645
2646         To support this in PDF, PDF need to create a _webSelectionAssistant.
2647         * UIProcess/ios/WKPDFView.mm:
2648         (-[WKPDFView web_initWithFrame:webView:]):
2649         (-[WKPDFView actionSheetAssistant:openElementAtLocation:]):
2650         (-[WKPDFView actionSheetAssistant:shareElementWithURL:rect:]):
2651         (-[WKPDFView actionSheetAssistant:shouldIncludeAppLinkActionsForElement:]):
2652
2653 2015-10-30  Tim Horton  <timothy_horton@apple.com>
2654
2655         WKView being inside WKWebView leads to weird API issues
2656         https://bugs.webkit.org/show_bug.cgi?id=150174
2657
2658         Reviewed by Anders Carlsson.
2659
2660         * UIProcess/API/mac/WKView.mm:
2661         (-[WKView _wantsKeyDownForEvent:]):
2662         (-[WKView acceptsFirstMouse:]):
2663         (-[WKView shouldDelayWindowOrderingForEvent:]):
2664         (-[WKView validAttributesForMarkedText]):
2665         (-[WKView _windowResizeMouseLocationIsInVisibleScrollerThumb:]):
2666         (-[WKView drawRect:]):
2667         (-[WKView isOpaque]):
2668         (-[WKView mouseDownCanMoveWindow]):
2669         (-[WKView viewDidHide]):
2670         (-[WKView viewDidUnhide]):
2671         (-[WKView _activeSpaceDidChange:]):
2672         (-[WKView hitTest:]):
2673         (-[WKView wantsUpdateLayer]):
2674         (-[WKView canChangeFrameLayout:]):
2675         (-[WKView printOperationWithPrintInfo:forFrame:]):
2676         (+[WKView hideWordDefinitionWindow]):
2677         * UIProcess/Cocoa/WebViewImpl.h:
2678         (WebKit::WebViewImpl::wantsUpdateLayer):
2679         (WebKit::WebViewImpl::mouseDownCanMoveWindow):
2680         (WebKit::WebViewImpl::wantsKeyDownForEvent):
2681         (WebKit::WebViewImpl::layerHostingView): Deleted.
2682         * UIProcess/Cocoa/WebViewImpl.mm:
2683         (WebKit::WebViewImpl::isOpaque):
2684         (WebKit::WebViewImpl::acceptsFirstMouse):
2685         (WebKit::WebViewImpl::drawRect):
2686         (WebKit::WebViewImpl::canChangeFrameLayout):
2687         (WebKit::WebViewImpl::printOperationWithPrintInfo):
2688         (WebKit::WebViewImpl::shouldDelayWindowOrderingForEvent):
2689         (WebKit::WebViewImpl::windowResizeMouseLocationIsInVisibleScrollerThumb):
2690         (WebKit::WebViewImpl::viewDidHide):
2691         (WebKit::WebViewImpl::viewDidUnhide):
2692         (WebKit::WebViewImpl::activeSpaceDidChange):
2693         (WebKit::WebViewImpl::hitTest):
2694         (WebKit::WebViewImpl::hideWordDefinitionWindow):
2695         (WebKit::WebViewImpl::validAttributesForMarkedText):
2696         Printing and random bits.
2697
2698 2015-10-30  Anders Carlsson  <andersca@apple.com>
2699
2700         REGRESSION (r191691): Unexpected "Share" context menu when right clicking around inspector
2701         https://bugs.webkit.org/show_bug.cgi?id=150699
2702         rdar://problem/23324522
2703
2704         Reviewed by Tim Horton.
2705
2706         Don't create a share menu item if we have nothing to share.
2707
2708         * UIProcess/mac/WebContextMenuProxyMac.mm:
2709         (WebKit::WebContextMenuProxyMac::createShareMenuItem):
2710
2711 2015-10-30  Tim Horton  <timothy_horton@apple.com>
2712
2713         Initialize some new WebViewImpl members
2714
2715         * UIProcess/Cocoa/WebViewImpl.h:
2716         Oh well.
2717
2718 2015-10-30  Tim Horton  <timothy_horton@apple.com>
2719
2720         Fix the build
2721
2722         * UIProcess/API/mac/WKView.mm:
2723
2724 2015-10-30  Tim Horton  <timothy_horton@apple.com>
2725
2726         Fix the build
2727
2728         * UIProcess/Cocoa/WebViewImpl.h:
2729         * UIProcess/Cocoa/WebViewImpl.mm:
2730         (WebKit::WebViewImpl::collectKeyboardLayoutCommandsForEvent):
2731
2732 2015-10-30  Tim Horton  <timothy_horton@apple.com>
2733
2734         WKView being inside WKWebView leads to weird API issues
2735         https://bugs.webkit.org/show_bug.cgi?id=150174
2736
2737         Reviewed by Darin Adler.
2738
2739         * UIProcess/API/mac/WKView.mm:
2740         (-[WKView doCommandBySelector:]):
2741         (-[WKView insertText:]):
2742         (-[WKView insertText:replacementRange:]):
2743         (-[WKView inputContext]):
2744         (-[WKView performKeyEquivalent:]):
2745         (-[WKView keyUp:]):
2746         (-[WKView keyDown:]):
2747         (-[WKView flagsChanged:]):
2748         (-[WKView setMarkedText:selectedRange:replacementRange:]):
2749         (-[WKView unmarkText]):
2750         (-[WKView selectedRange]):
2751         (-[WKView hasMarkedText]):
2752         (-[WKView markedRange]):
2753         (-[WKView attributedSubstringForProposedRange:actualRange:]):
2754         (-[WKView characterIndexForPoint:]):
2755         (-[WKView firstRectForCharacterRange:actualRange:]):
2756         (-[WKView selectedRangeWithCompletionHandler:]):
2757         (-[WKView markedRangeWithCompletionHandler:]):
2758         (-[WKView hasMarkedTextWithCompletionHandler:]):
2759         (-[WKView attributedSubstringForProposedRange:completionHandler:]):
2760         (-[WKView firstRectForCharacterRange:completionHandler:]):
2761         (-[WKView characterIndexForPoint:completionHandler:]):
2762         (-[WKView _superPerformKeyEquivalent:]):
2763         (-[WKView _superKeyDown:]):
2764         (extractUnderlines): Deleted.
2765         (-[WKView _collectKeyboardLayoutCommandsForEvent:to:]): Deleted.
2766         (-[WKView _interpretKeyEvent:completionHandler:]): Deleted.
2767         (-[WKView NO_RETURN_DUE_TO_ASSERT]): Deleted.
2768         (-[WKView _interpretKeyEvent:savingCommandsTo:]): Deleted.
2769         (-[WKView _executeSavedKeypressCommands]): Deleted.
2770         (-[WKView _doneWithKeyEvent:eventWasHandled:]): Deleted.
2771         * UIProcess/API/mac/WKViewInternal.h:
2772         * UIProcess/Cocoa/WebViewImpl.h:
2773         * UIProcess/Cocoa/WebViewImpl.mm:
2774         (WebKit::WebViewImpl::doneWithKeyEvent):
2775         (WebKit::extractUnderlines):
2776         (WebKit::WebViewImpl::collectKeyboardLayoutCommandsForEvent):
2777         (WebKit::WebViewImpl::interpretKeyEvent):
2778         (WebKit::WebViewImpl::doCommandBySelector):
2779         (WebKit::WebViewImpl::insertText):
2780         (WebKit::WebViewImpl::selectedRangeWithCompletionHandler):
2781         (WebKit::WebViewImpl::markedRangeWithCompletionHandler):
2782         (WebKit::WebViewImpl::hasMarkedTextWithCompletionHandler):
2783         (WebKit::WebViewImpl::attributedSubstringForProposedRange):
2784         (WebKit::WebViewImpl::firstRectForCharacterRange):
2785         (WebKit::WebViewImpl::characterIndexForPoint):
2786         (WebKit::WebViewImpl::inputContext):
2787         (WebKit::WebViewImpl::unmarkText):
2788         (WebKit::WebViewImpl::setMarkedText):
2789         (WebKit::WebViewImpl::selectedRange):
2790         (WebKit::WebViewImpl::hasMarkedText):
2791         (WebKit::WebViewImpl::markedRange):
2792         (WebKit::WebViewImpl::performKeyEquivalent):
2793         (WebKit::WebViewImpl::keyUp):
2794         (WebKit::WebViewImpl::keyDown):
2795         (WebKit::WebViewImpl::flagsChanged):
2796         (WebKit::WebViewImpl::executeSavedKeypressCommands):
2797         * UIProcess/mac/PageClientImpl.mm:
2798         (WebKit::PageClientImpl::doneWithKeyEvent):
2799         Move NSTextInputClient implementation.
2800
2801 2015-10-30  Carlos Garcia Campos  <cgarcia@igalia.com>
2802
2803         [GTK] Move the socket polling off the WorkQueue
2804         https://bugs.webkit.org/show_bug.cgi?id=150593
2805
2806         Reviewed by Anders Carlsson.
2807
2808         Create the socket poll source in Connection::open and attach it to
2809         the connection work queue context.
2810
2811         * Platform/IPC/Connection.h:
2812         * Platform/IPC/unix/ConnectionUnix.cpp:
2813         (IPC::Connection::platformInvalidate):
2814         (IPC::Connection::open):
2815
2816 2015-10-30  Carlos Garcia Campos  <cgarcia@igalia.com>
2817
2818         [GTK] Use RunLoop::Timer instead of GMainLoopSource
2819         https://bugs.webkit.org/show_bug.cgi?id=150592
2820
2821         Reviewed by Žan Doberšek.
2822
2823         * Shared/Downloads/soup/DownloadSoup.cpp:
2824         (WebKit::DownloadClient::DownloadClient):
2825         (WebKit::DownloadClient::didReceiveData):
2826         (WebKit::DownloadClient::handleResponseLater):
2827         * UIProcess/gtk/GestureController.cpp:
2828         (WebKit::GestureController::DragGesture::begin):
2829         (WebKit::GestureController::DragGesture::update):
2830         (WebKit::GestureController::DragGesture::end):
2831         (WebKit::GestureController::DragGesture::longPressFired):
2832         (WebKit::GestureController::DragGesture::DragGesture):
2833         (WebKit::GestureController::ZoomGesture::scaleChanged):
2834         (WebKit::GestureController::ZoomGesture::ZoomGesture):
2835         * UIProcess/gtk/GestureController.h:
2836
2837 2015-10-29  Carlos Garcia Campos  <cgarcia@igalia.com>
2838
2839         [GTK] Use a persistent main loop source in RunLoop glib implementation
2840         https://bugs.webkit.org/show_bug.cgi?id=150590
2841
2842         Reviewed by Žan Doberšek.
2843
2844         Use RunLoop::dispatch() instead of
2845         GMainLoopSource::scheduleAndDeleteOnDestroy in a couple of simple
2846         cases.
2847
2848         * NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp:
2849         (WebKit::NetworkCache::runTaskInQueue):
2850         * UIProcess/gtk/DragAndDropHandler.cpp:
2851         (WebKit::DragAndDropHandler::dragLeave):
2852
2853 2015-10-29  Alex Christensen  <achristensen@webkit.org>
2854
2855         Make WebCore a framework in Mac CMake build
2856         https://bugs.webkit.org/show_bug.cgi?id=150702
2857
2858         Reviewed by Geoffrey Garen.
2859
2860         * PlatformMac.cmake:
2861
2862 2015-10-29  Alex Christensen  <achristensen@webkit.org>
2863
2864         EFL build fix after r191749
2865
2866         * CMakeLists.txt:
2867         Only Mac should include the Cocoa directory.
2868
2869 2015-10-29  Tim Horton  <timothy_horton@apple.com>
2870
2871         WKView being inside WKWebView leads to weird API issues
2872         https://bugs.webkit.org/show_bug.cgi?id=150174
2873
2874         Reviewed by Anders Carlsson.
2875
2876         * Platform/spi/mac/AppKitSPI.h:
2877         * UIProcess/API/mac/WKView.mm:
2878         (-[WKView validRequestorForSendType:returnType:]):
2879         (-[WKView readSelectionFromPasteboard:]):
2880         (-[WKView changeFont:]):
2881         (-[WKView startSpeaking:]):
2882         (-[WKView stopSpeaking:]):
2883         (-[WKView showGuessPanel:]):
2884         (-[WKView checkSpelling:]):
2885         (-[WKView changeSpelling:]):
2886         (-[WKView toggleContinuousSpellChecking:]):
2887         (-[WKView isGrammarCheckingEnabled]):
2888         (-[WKView setGrammarCheckingEnabled:]):
2889         (-[WKView toggleGrammarChecking:]):
2890         (-[WKView toggleAutomaticSpellingCorrection:]):
2891         (-[WKView orderFrontSubstitutionsPanel:]):
2892         (-[WKView toggleSmartInsertDelete:]):
2893         (-[WKView isAutomaticQuoteSubstitutionEnabled]):
2894         (-[WKView setAutomaticQuoteSubstitutionEnabled:]):
2895         (-[WKView toggleAutomaticQuoteSubstitution:]):
2896         (-[WKView isAutomaticDashSubstitutionEnabled]):
2897         (-[WKView setAutomaticDashSubstitutionEnabled:]):
2898         (-[WKView toggleAutomaticDashSubstitution:]):
2899         (-[WKView isAutomaticLinkDetectionEnabled]):
2900         (-[WKView setAutomaticLinkDetectionEnabled:]):
2901         (-[WKView toggleAutomaticLinkDetection:]):
2902         (-[WKView isAutomaticTextReplacementEnabled]):
2903         (-[WKView setAutomaticTextReplacementEnabled:]):
2904         (-[WKView toggleAutomaticTextReplacement:]):
2905         (-[WKView uppercaseWord:]):
2906         (-[WKView lowercaseWord:]):
2907         (-[WKView capitalizeWord:]):
2908         * UIProcess/Cocoa/WebViewImpl.h:
2909         * UIProcess/Cocoa/WebViewImpl.mm:
2910         (WebKit::WebViewImpl::readSelectionFromPasteboard):
2911         (WebKit::WebViewImpl::validRequestorForSendAndReturnTypes):
2912         (WebKit::WebViewImpl::changeFontFromFontPanel):
2913         (WebKit::WebViewImpl::startSpeaking):
2914         (WebKit::WebViewImpl::stopSpeaking):
2915         (WebKit::WebViewImpl::showGuessPanel):
2916         (WebKit::WebViewImpl::checkSpelling):
2917         (WebKit::WebViewImpl::changeSpelling):
2918         (WebKit::WebViewImpl::toggleContinuousSpellChecking):
2919         (WebKit::WebViewImpl::isGrammarCheckingEnabled):
2920         (WebKit::WebViewImpl::setGrammarCheckingEnabled):
2921         (WebKit::WebViewImpl::toggleGrammarChecking):
2922         (WebKit::WebViewImpl::toggleAutomaticSpellingCorrection):
2923         (WebKit::WebViewImpl::orderFrontSubstitutionsPanel):
2924         (WebKit::WebViewImpl::toggleSmartInsertDelete):
2925         (WebKit::WebViewImpl::isAutomaticQuoteSubstitutionEnabled):
2926         (WebKit::WebViewImpl::setAutomaticQuoteSubstitutionEnabled):
2927         (WebKit::WebViewImpl::toggleAutomaticQuoteSubstitution):
2928         (WebKit::WebViewImpl::isAutomaticDashSubstitutionEnabled):
2929         (WebKit::WebViewImpl::setAutomaticDashSubstitutionEnabled):
2930         (WebKit::WebViewImpl::toggleAutomaticDashSubstitution):
2931         (WebKit::WebViewImpl::isAutomaticLinkDetectionEnabled):
2932         (WebKit::WebViewImpl::setAutomaticLinkDetectionEnabled):
2933         (WebKit::WebViewImpl::toggleAutomaticLinkDetection):
2934         (WebKit::WebViewImpl::setAutomaticTextReplacementEnabled):
2935         (WebKit::WebViewImpl::toggleAutomaticTextReplacement):
2936         (WebKit::WebViewImpl::uppercaseWord):
2937         (WebKit::WebViewImpl::lowercaseWord):
2938         (WebKit::WebViewImpl::capitalizeWord):
2939         Move spellcheck and related bits.
2940
2941 2015-10-29  Eric Carlson  <eric.carlson@apple.com>
2942
2943         Revert inadvertent changes
2944         https://bugs.webkit.org/show_bug.cgi?id=150694
2945
2946         Reviewed by Tim Horton.
2947
2948         * WebProcess/com.apple.WebProcess.sb.in:
2949
2950 2015-10-29  Alex Christensen  <achristensen@webkit.org>
2951
2952         CMake build fix.
2953
2954         * CMakeLists.txt:
2955         * PlatformMac.cmake:
2956         I mistakenly added some mac-specific files to the shared CMakeLists.txt.  This puts them in the right place.
2957         * UIProcess/WebPageProxy.cpp:
2958         (WebKit::WebPageProxy::viewWillStartLiveResize):
2959         (WebKit::WebPageProxy::viewDidLeaveWindow):
2960         (WebKit::WebPageProxy::didEndColorPicker):
2961         Add preprocessor enable checks.
2962
2963 2015-10-29  Tim Horton  <timothy_horton@apple.com>
2964
2965         WKView being inside WKWebView leads to weird API issues
2966         https://bugs.webkit.org/show_bug.cgi?id=150174
2967
2968         Reviewed by Darin Adler.
2969
2970         * UIProcess/API/mac/WKView.mm:
2971         (-[WKView browsingContextController]):
2972         (-[WKView validateUserInterfaceItem:]):
2973         (-[WKView saveBackForwardSnapshotForCurrentItem]):
2974         (-[WKView saveBackForwardSnapshotForItem:]):
2975         (-[WKView updateLayer]):
2976         (-[WKView minimumSizeForAutoLayout]):
2977         (-[WKView setMinimumSizeForAutoLayout:]):
2978         (-[WKView shouldExpandToViewHeightForAutoLayout]):
2979         (-[WKView setShouldExpandToViewHeightForAutoLayout:]):
2980         (-[WKView underlayColor]):
2981         (-[WKView setUnderlayColor:]):
2982         (-[WKView _setOverlayScrollbarStyle:]):
2983         (-[WKView _overlayScrollbarStyle]):
2984         (-[WKView _pageExtendedBackgroundColor]):
2985         (-[WKView forceAsyncDrawingAreaSizeUpdate:]):
2986         (-[WKView waitForAsyncDrawingAreaSizeUpdate]):
2987         (-[WKView isUsingUISideCompositing]):
2988         (createSelectorExceptionMap): Deleted.
2989         (commandNameForSelector): Deleted.
2990         (menuItem): Deleted.
2991         (toolbarItem): Deleted.
2992         (-[WKView _setUserInterfaceItemState:enabled:state:]): Deleted.
2993         * UIProcess/Cocoa/WebViewImpl.h:
2994         * UIProcess/Cocoa/WebViewImpl.mm:
2995         (WebKit::WebViewImpl::createDrawingAreaProxy):
2996         (WebKit::WebViewImpl::isUsingUISideCompositing):
2997         (WebKit::WebViewImpl::forceAsyncDrawingAreaSizeUpdate):
2998         (WebKit::WebViewImpl::waitForAsyncDrawingAreaSizeUpdate):
2999         (WebKit::WebViewImpl::updateLayer):
3000         (WebKit::WebViewImpl::setMinimumSizeForAutoLayout):
3001         (WebKit::WebViewImpl::minimumSizeForAutoLayout):
3002         (WebKit::WebViewImpl::setShouldExpandToViewHeightForAutoLayout):
3003         (WebKit::WebViewImpl::shouldExpandToViewHeightForAutoLayout):
3004         (WebKit::WebViewImpl::setUnderlayColor):
3005         (WebKit::WebViewImpl::underlayColor):
3006         (WebKit::WebViewImpl::pageExtendedBackgroundColor):
3007         (WebKit::WebViewImpl::setOverlayScrollbarStyle):
3008         (WebKit::WebViewImpl::overlayScrollbarStyle):
3009         (WebKit::createSelectorExceptionMap):
3010         (WebKit::commandNameForSelector):
3011         (WebKit::WebViewImpl::executeSavedCommandBySelector):
3012         (WebKit::WebViewImpl::executeEditCommandForSelector):
3013         (WebKit::menuItem):
3014         (WebKit::toolbarItem):
3015         (WebKit::WebViewImpl::validateUserInterfaceItem):
3016         (WebKit::WebViewImpl::setUserInterfaceItemState):
3017         (WebKit::WebViewImpl::browsingContextController):
3018         (WebKit::WebViewImpl::saveBackForwardSnapshotForCurrentItem):
3019         (WebKit::WebViewImpl::saveBackForwardSnapshotForItem):
3020         (WebKit::WebViewImpl::executeEditCommand): Deleted.
3021         Move UI validation and a grab-bag of other things.
3022
3023 2015-10-29  Alex Christensen  <achristensen@webkit.org>
3024
3025         Fix Mac CMake build
3026         https://bugs.webkit.org/show_bug.cgi?id=150686
3027
3028         Reviewed by Filip Pizlo.
3029
3030         * CMakeLists.txt:
3031         * PlatformMac.cmake:
3032
3033 2015-10-29  Commit Queue  <commit-queue@webkit.org>
3034
3035         Unreviewed, rolling out r191728.
3036         https://bugs.webkit.org/show_bug.cgi?id=150668
3037
3038         Caused a lot of timeouts in layout tests (Requested by KaL on
3039         #webkit).
3040
3041         Reverted changeset:
3042
3043         "[GTK] Use a persistent main loop source in RunLoop glib
3044         implementation"
3045         https://bugs.webkit.org/show_bug.cgi?id=150590
3046         http://trac.webkit.org/changeset/191728
3047
3048 2015-10-29  Carlos Garcia Campos  <cgarcia@igalia.com>
3049
3050         [GTK] Use a persistent main loop source in RunLoop glib implementation
3051         https://bugs.webkit.org/show_bug.cgi?id=150590
3052
3053         Reviewed by Žan Doberšek.
3054
3055         Use RunLoop::dispatch() instead of
3056         GMainLoopSource::scheduleAndDeleteOnDestroy in a couple of simple
3057         cases.
3058
3059         * NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp:
3060         (WebKit::NetworkCache::runTaskInQueue):
3061         * UIProcess/gtk/DragAndDropHandler.cpp:
3062         (WebKit::DragAndDropHandler::dragLeave):
3063
3064 2015-10-28  Tim Horton  <timothy_horton@apple.com>
3065
3066         Fix the build
3067
3068         * UIProcess/mac/PageClientImpl.mm:
3069         (WebKit::PageClientImpl::startWindowDrag):
3070         (WebKit::PageClientImpl::platformWindow):
3071
3072 2015-10-28  Tim Horton  <timothy_horton@apple.com>
3073
3074         WKView being inside WKWebView leads to weird API issues
3075         https://bugs.webkit.org/show_bug.cgi?id=150174
3076
3077         Reviewed by Anders Carlsson.
3078
3079         * UIProcess/API/C/mac/WKPagePrivateMac.mm:
3080         (WKPageGetObjectRegistry):
3081         * UIProcess/API/Cocoa/WKBrowsingContextController.mm:
3082         (-[WKBrowsingContextController _remoteObjectRegistry]):
3083         * UIProcess/API/mac/WKView.mm:
3084         (-[WKView dealloc]):
3085         (-[WKView _inspectorAttachmentView]):
3086         (-[WKView _setInspectorAttachmentView:]):
3087         (-[WKView windowOcclusionDetectionEnabled]):
3088         (-[WKView setWindowOcclusionDetectionEnabled:]):
3089         (-[WKView _setTotalHeightOfBanners:]):
3090         (-[WKView _totalHeightOfBanners]):
3091         (-[WKView initWithFrame:processPool:configuration:webView:]): Deleted.
3092         (-[WKView _remoteObjectRegistry]): Deleted.
3093         (-[WKView _startWindowDrag]): Deleted.
3094         * UIProcess/API/mac/WKViewInternal.h:
3095         * UIProcess/Cocoa/WebViewImpl.h:
3096         (WebKit::WebViewImpl::setWindowOcclusionDetectionEnabled):
3097         (WebKit::WebViewImpl::windowOcclusionDetectionEnabled):
3098         (WebKit::WebViewImpl::setTotalHeightOfBanners):
3099         (WebKit::WebViewImpl::totalHeightOfBanners):
3100         * UIProcess/Cocoa/WebViewImpl.mm:
3101         (WebKit::WebViewImpl::window):
3102         (WebKit::WebViewImpl::setInspectorAttachmentView):
3103         (WebKit::WebViewImpl::inspectorAttachmentView):
3104         (WebKit::WebViewImpl::remoteObjectRegistry):
3105         (WebKit::WebViewImpl::destroyRemoteObjectRegistry):
3106         * UIProcess/PageClient.h:
3107         * UIProcess/WebPageProxy.h:
3108         * UIProcess/mac/PageClientImpl.h:
3109         * UIProcess/mac/PageClientImpl.mm:
3110         (WebKit::PageClientImpl::isViewVisible):
3111         (WebKit::PageClientImpl::createColorPicker):
3112         (WebKit::PageClientImpl::startWindowDrag):
3113         (WebKit::PageClientImpl::platformWindow):
3114         (WebKit::PageClientImpl::inspectorAttachmentView):
3115         (WebKit::PageClientImpl::remoteObjectRegistry):
3116         * UIProcess/mac/WebInspectorProxyMac.mm:
3117         (WebKit::WebInspectorProxy::platformCreateInspectorPage):
3118         (WebKit::WebInspectorProxy::platformCanAttach):
3119         (WebKit::WebInspectorProxy::platformBringToFront):
3120         (WebKit::WebInspectorProxy::inspectedViewFrameDidChange):
3121         (WebKit::WebInspectorProxy::platformInspectedWindowHeight):
3122         (WebKit::WebInspectorProxy::platformInspectedWindowWidth):
3123         (WebKit::WebInspectorProxy::platformAttach):
3124         (WebKit::WebInspectorProxy::platformDetach):
3125         (WebKit::WebInspectorProxy::platformStartWindowDrag):
3126         * UIProcess/mac/WebPageProxyMac.mm:
3127         (WebKit::WebPageProxy::startWindowDrag):
3128         (WebKit::WebPageProxy::platformWindow):
3129         (WebKit::WebPageProxy::inspectorAttachmentView):
3130         (WebKit::WebPageProxy::remoteObjectRegistry):
3131         (WebKit::WebPageProxy::wkView): Deleted.
3132         Get rid of the wkView() getters on PageClientImpl and WebPageProxy, because
3133         those can't be a thing in the brave new world. Instead, plumb the four
3134         callers through PageClient to WebViewImpl.
3135
3136         Also, move a few more things (banners, window occlusion).
3137
3138 2015-10-27  Anders Carlsson  <andersca@apple.com>
3139
3140         Stub out more of the context menu SPI
3141         https://bugs.webkit.org/show_bug.cgi?id=150606
3142
3143         Reviewed by Dan Bernstein.
3144
3145         Add a delegate method that will allow the client to modify the menu. Also,
3146         add an empty _WKContextMenuElementInfo class and its _WKElementInfo superclass.
3147
3148         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
3149         * UIProcess/API/Cocoa/_WKContextMenuElementInfo.h: Added.
3150         * UIProcess/API/Cocoa/_WKContextMenuElementInfo.mm: Added.
3151         * UIProcess/API/Cocoa/_WKElementInfo.h: Added.
3152         * UIProcess/API/Cocoa/_WKElementInfo.mm: Added.
3153         * UIProcess/Cocoa/UIDelegate.h:
3154         * UIProcess/Cocoa/UIDelegate.mm:
3155         (WebKit::UIDelegate::setDelegate):
3156         (WebKit::UIDelegate::ContextMenuClient::menuFromProposedMenu):
3157         (WebKit::UIDelegate::UIClient::createNewPage):
3158         * UIProcess/mac/WebContextMenuProxyMac.mm:
3159         (WebKit::WebContextMenuProxyMac::showContextMenu):
3160         * WebKit2.xcodeproj/project.pbxproj:
3161
3162 2015-10-28  Anders Carlsson  <andersca@apple.com>
3163
3164         Stop using ContextMenuItem::shareMenuItem in the UI process
3165         https://bugs.webkit.org/show_bug.cgi?id=150578
3166
3167         Reviewed by Tim Horton.
3168
3169         * UIProcess/mac/WebContextMenuProxyMac.h:
3170         * UIProcess/mac/WebContextMenuProxyMac.mm:
3171         (WebKit::WebContextMenuProxyMac::createShareMenuItem):
3172         (WebKit::WebContextMenuProxyMac::createContextMenuItem):
3173         (WebKit::WebContextMenuProxyMac::shareMenuItem): Deleted.
3174
3175 2015-10-28  Tim Horton  <timothy_horton@apple.com>
3176
3177         WKView being inside WKWebView leads to weird API issues
3178         https://bugs.webkit.org/show_bug.cgi?id=150174
3179
3180         Reviewed by Anders Carlsson.
3181
3182         * UIProcess/API/mac/WKView.mm:
3183         (-[WKView _superDoCommandBySelector:]):
3184         (-[WKView _createDrawingAreaProxy]): Deleted.
3185         (-[WKView _processDidExit]): Deleted.
3186         (-[WKView _pageClosed]): Deleted.
3187         (-[WKView _didRelaunchProcess]): Deleted.
3188         (-[WKView _convertToDeviceSpace:]): Deleted.
3189         (-[WKView _convertToUserSpace:]): Deleted.
3190         (-[WKView _executeSavedCommandBySelector:]): Deleted.
3191         (-[WKResponderChainSink initWithResponderChain:]): Deleted.
3192         (-[WKResponderChainSink detach]): Deleted.
3193         (-[WKResponderChainSink didReceiveUnhandledCommand]): Deleted.
3194         (-[WKResponderChainSink noResponderFor:]): Deleted.
3195         (-[WKResponderChainSink doCommandBySelector:]): Deleted.
3196         (-[WKResponderChainSink tryToPerform:with:]): Deleted.
3197         * UIProcess/API/mac/WKViewInternal.h:
3198         * UIProcess/Cocoa/WebViewImpl.h:
3199         * UIProcess/Cocoa/WebViewImpl.mm:
3200         (-[WKResponderChainSink initWithResponderChain:]):
3201         (-[WKResponderChainSink detach]):
3202         (-[WKResponderChainSink didReceiveUnhandledCommand]):
3203         (-[WKResponderChainSink noResponderFor:]):
3204         (-[WKResponderChainSink doCommandBySelector:]):
3205         (-[WKResponderChainSink tryToPerform:with:]):
3206         (WebKit::WebViewImpl::createDrawingAreaProxy):
3207         (WebKit::WebViewImpl::processDidExit):
3208         (WebKit::WebViewImpl::pageClosed):
3209         (WebKit::WebViewImpl::didRelaunchProcess):
3210         (WebKit::WebViewImpl::executeSavedCommandBySelector):
3211         (WebKit::WebViewImpl::resetGestureController): Deleted.
3212         * UIProcess/mac/PageClientImpl.mm:
3213         (WebKit::PageClientImpl::createDrawingAreaProxy):
3214         (WebKit::PageClientImpl::processDidExit):
3215         (WebKit::PageClientImpl::pageClosed):
3216         (WebKit::PageClientImpl::didRelaunchProcess):
3217         (WebKit::PageClientImpl::convertToDeviceSpace):
3218         (WebKit::PageClientImpl::convertToUserSpace):
3219         (WebKit::PageClientImpl::executeSavedCommandBySelector):
3220         Move most of the rest of WKViewInternal.h's methods to WebViewImpl.
3221
3222 2015-10-28  Alex Christensen  <achristensen@webkit.org>
3223
3224         Compile and link with CMake on Mac
3225         https://bugs.webkit.org/show_bug.cgi?id=150632
3226
3227         Reviewed by Tim Horton.
3228
3229         * CMakeLists.txt:
3230         * PlatformEfl.cmake:
3231         * PlatformGTK.cmake:
3232         * PlatformMac.cmake:
3233
3234 2015-10-27  Anders Carlsson  <andersca@apple.com>
3235
3236         Stub out more of the context menu SPI
3237         https://bugs.webkit.org/show_bug.cgi?id=150606
3238
3239         Reviewed by Dan Bernstein.
3240
3241         Add a delegate method that will allow the client to modify the menu. Also,
3242         add an empty _WKContextMenuElementInfo class and its _WKElementInfo superclass.
3243
3244         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
3245         * UIProcess/API/Cocoa/_WKContextMenuElementInfo.h: Added.
3246         * UIProcess/API/Cocoa/_WKContextMenuElementInfo.mm: Added.
3247         * UIProcess/API/Cocoa/_WKElementInfo.h: Added.
3248         * UIProcess/API/Cocoa/_WKElementInfo.mm: Added.
3249         * UIProcess/Cocoa/UIDelegate.h:
3250         * UIProcess/Cocoa/UIDelegate.mm:
3251         (WebKit::UIDelegate::setDelegate):
3252         (WebKit::UIDelegate::ContextMenuClient::menuFromProposedMenu):
3253         (WebKit::UIDelegate::UIClient::createNewPage):
3254         * UIProcess/mac/WebContextMenuProxyMac.mm:
3255         (WebKit::WebContextMenuProxyMac::showContextMenu):
3256         * WebKit2.xcodeproj/project.pbxproj:
3257
3258 2015-10-28  Chris Dumez  <cdumez@apple.com>
3259
3260         Use RunLoopTimer in DataURLDecoder to avoid issues related to runloops
3261         https://bugs.webkit.org/show_bug.cgi?id=150609
3262         <rdar://problem/22702894>
3263
3264         Reviewed by Antti Koivisto.
3265
3266         Move addSchedulePair() call to Page::platformInitialize() so that
3267         RunLoopTimer can be used by any Page, even those that don't have
3268         a WebPage wrapper.
3269
3270         * WebProcess/WebPage/mac/WebPageMac.mm:
3271         (WebKit::WebPage::platformInitialize): Deleted.
3272
3273 2015-10-27  Tim Horton  <timothy_horton@apple.com>
3274
3275         Fix the 32-bit build.
3276
3277         * UIProcess/Cocoa/WebViewImpl.mm:
3278         (WebKit::WebViewImpl::dragImageForView):
3279
3280 2015-10-27  Tim Horton  <timothy_horton@apple.com>
3281
3282         Fix the build.
3283
3284         * UIProcess/Cocoa/WebViewImpl.mm:
3285
3286 2015-10-27  Tim Horton  <timothy_horton@apple.com>
3287
3288         WKView being inside WKWebView leads to weird API issues
3289         https://bugs.webkit.org/show_bug.cgi?id=150174
3290
3291         Reviewed by Anders Carlsson.
3292
3293         * UIProcess/API/mac/WKView.mm:
3294         (-[WKView mouseDown:]):
3295         (-[WKView mouseUp:]):
3296         (-[WKView acceptsFirstMouse:]):
3297         (-[WKView shouldDelayWindowOrderingForEvent:]):
3298         (-[WKView pasteboardChangedOwner:]):
3299         (-[WKView pasteboard:provideDataForType:]):
3300         (-[WKView namesOfPromisedFilesDroppedAtDestination:]):
3301         (-[WKView _startWindowDrag]):
3302         (-[WKView _setMouseDownEvent:]): Deleted.
3303         (-[WKView _colorSpace]): Deleted.
3304         (-[WKView _dragImageForView:withImage:at:linkDrag:]): Deleted.
3305         (matchesExtensionOrEquivalent): Deleted.
3306         (-[WKView _setFileAndURLTypes:withExtension:withTitle:withURL:withVisibleURL:forPasteboard:]): Deleted.
3307         (-[WKView _setPromisedDataForImage:withFileName:withExtension:withTitle:withURL:withVisibleURL:withArchive:forPasteboard:]): Deleted.
3308         (-[WKView _setPromisedDataForAttachment:withExtension:withTitle:withURL:withVisibleURL:forPasteboard:]): Deleted.
3309         (fileExists): Deleted.
3310         (pathWithUniqueFilenameForPath): Deleted.
3311         (-[WKView spellCheckerDocumentTag]): Deleted.
3312         (-[WKView handleAcceptedAlternativeText:]): Deleted.
3313         (-[WKView initWithFrame:processPool:configuration:webView:]): Deleted.
3314         * UIProcess/API/mac/WKViewInternal.h:
3315         * UIProcess/Cocoa/WebViewImpl.h:
3316         * UIProcess/Cocoa/WebViewImpl.mm:
3317         (WebKit::WebViewImpl::handleAcceptedAlternativeText):
3318         (WebKit::WebViewImpl::spellCheckerDocumentTag):
3319         (WebKit::WebViewImpl::startWindowDrag):
3320         (WebKit::WebViewImpl::dragImageForView):
3321         (WebKit::matchesExtensionOrEquivalent):
3322         (WebKit::WebViewImpl::setFileAndURLTypes):
3323         (WebKit::WebViewImpl::setPromisedDataForImage):
3324         (WebKit::WebViewImpl::setPromisedDataForAttachment):
3325         (WebKit::WebViewImpl::pasteboardChangedOwner):
3326         (WebKit::WebViewImpl::provideDataForPasteboard):
3327         (WebKit::fileExists):
3328         (WebKit::pathWithUniqueFilenameForPath):
3329         (WebKit::WebViewImpl::namesOfPromisedFilesDroppedAtDestination):
3330         (WebKit::WebViewImpl::setLastMouseDownEvent):
3331         * UIProcess/mac/CorrectionPanel.h:
3332         * UIProcess/mac/CorrectionPanel.mm:
3333         (WebKit::CorrectionPanel::show):
3334         (WebKit::CorrectionPanel::recordAutocorrectionResponse):
3335         (WebKit::CorrectionPanel::handleAcceptedReplacement):
3336         * UIProcess/mac/PageClientImpl.mm:
3337         (WebKit::PageClientImpl::colorSpace):
3338         (WebKit::PageClientImpl::setDragImage):
3339         (WebKit::PageClientImpl::setPromisedDataForImage):
3340         (WebKit::PageClientImpl::setPromisedDataForAttachment):
3341         (WebKit::PageClientImpl::showCorrectionPanel):
3342         (WebKit::PageClientImpl::recordAutocorrectionResponse):
3343         (WebKit::PageClientImpl::showDictationAlternativeUI):
3344         Move some pasteboard and spellcheck code.
3345
3346 2015-10-27  Wenson Hsieh  <wenson_hsieh@apple.com>
3347
3348         Implement viewport-width-based fast-click heuristic
3349         https://bugs.webkit.org/show_bug.cgi?id=150604
3350         <rdar://problem/23267308>
3351
3352         Reviewed by Simon Fraser.
3353
3354         Implement a new fast-click heuristic that applies to viewports with width = device-width. The basic rules are
3355         as follows: when a page has viewport width = device-width and is at initial zoom scale, we disable double-tapping
3356         in favor of fast-clicking. However, if the viewport scale is not the initial scale, we allow double tapping. For
3357         fast-clicking to remain useful after the user pinch-zooms, we change our double-tap to zoom out behavior to zoom
3358         to the initial scale rather than the minimum scale. For unscalable viewports, we default to fast-clicking behavior,
3359         and for all other viewports not at device-width, we double-tap to zoom and scroll as normal.
3360
3361         This patch removes some logic previously used for our scroll- and zoom-based fast-clicking heuristic, and adds
3362         information about the viewport width and initial scale to RemoteLayerTreeTransactions. This information is then
3363         used by the UI process to determine whether double tapping should be disabled or enabled.
3364
3365         The fast-click heuristic can be turned off through user default preferences, and a tap highlight for debugging
3366         fast-clicking can also be enabled through a user default preference. A red highlight indicates that a single-
3367         tap was slow, whereas a green highlight indicates a fast single-tap.
3368
3369         * Shared/mac/RemoteLayerTreeTransaction.h:
3370         (WebKit::RemoteLayerTreeTransaction::initialScaleFactor):
3371         (WebKit::RemoteLayerTreeTransaction::setInitialScaleFactor):
3372         (WebKit::RemoteLayerTreeTransaction::viewportMetaTagWidth):
3373         (WebKit::RemoteLayerTreeTransaction::setViewportMetaTagWidth):
3374         * Shared/mac/RemoteLayerTreeTransaction.mm:
3375         (WebKit::RemoteLayerTreeTransaction::encode):
3376         (WebKit::RemoteLayerTreeTransaction::decode):
3377         * UIProcess/API/Cocoa/WKWebView.mm:
3378         (-[WKWebView initWithFrame:configuration:]):
3379         (-[WKWebView _processDidExit]):
3380         (-[WKWebView _didCommitLayerTree:]):
3381         (-[WKWebView _zoomToInitialScaleWithOrigin:animated:]):
3382         (-[WKWebView _allowsDoubleTapGestures]):
3383         (-[WKWebView _setViewportMetaTagWidth:]): Deleted.
3384         (-[WKWebView _contentZoomScale]): Deleted.
3385         (-[WKWebView _viewportMetaTagWidth]): Deleted.
3386         (-[WKWebView _viewportIsUserScalable]): Deleted.
3387         * UIProcess/API/Cocoa/WKWebViewInternal.h:
3388         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
3389         * UIProcess/PageClient.h:
3390         * UIProcess/WebPageProxy.h:
3391         * UIProcess/WebPageProxy.messages.in:
3392         * UIProcess/ios/PageClientImplIOS.h:
3393         * UIProcess/ios/PageClientImplIOS.mm:
3394         (WebKit::PageClientImpl::disableDoubleTapGesturesDuringTapIfNecessary):
3395         (WebKit::PageClientImpl::didChangeViewportMetaTagWidth): Deleted.
3396         (WebKit::PageClientImpl::disableDoubleTapGesturesUntilTapIsFinishedIfNecessary): Deleted.
3397         * UIProcess/ios/SmartMagnificationController.h:
3398         * UIProcess/ios/SmartMagnificationController.mm:
3399         (WebKit::SmartMagnificationController::didCollectGeometryForSmartMagnificationGesture):
3400         * UIProcess/ios/WKContentView.h:
3401         * UIProcess/ios/WKContentView.mm:
3402         (-[WKContentView _zoomToInitialScaleWithOrigin:]):
3403         * UIProcess/ios/WKContentViewInteraction.h:
3404         * UIProcess/ios/WKContentViewInteraction.mm:
3405         (-[WKContentView setupInteraction]):
3406         (-[WKContentView _showTapHighlight]):
3407         (-[WKContentView _didGetTapHighlightForRequest:color:quads:topLeftRadius:topRightRadius:bottomLeftRadius:bottomRightRadius:]):
3408         (-[WKContentView _mayDisableDoubleTapGesturesDuringSingleTap]):
3409         (-[WKContentView _disableDoubleTapGesturesDuringTapIfNecessary:]):
3410         (-[WKContentView _finishInteraction]):
3411         (-[WKContentView _endPotentialTapAndEnableDoubleTapGesturesIfNecessary]):
3412         (-[WKContentView _tapHighlightColorForFastClick:]):
3413         (-[WKContentView _setDoubleTapGesturesEnabled:]):
3414         (-[WKContentView _fastClickZoomThreshold]): Deleted.
3415         (-[WKContentView _allowDoubleTapToZoomForCurrentZoomScale:andTargetZoomScale:]): Deleted.
3416         (-[WKContentView _disableDoubleTapGesturesUntilTapIsFinishedIfNecessary:allowsDoubleTapZoom:targetRect:isReplaced:minimumScale:maximumScale:]): Deleted.
3417         * UIProcess/ios/WebPageProxyIOS.mm:
3418         (WebKit::WebPageProxy::disableDoubleTapGesturesDuringTapIfNecessary):
3419         (WebKit::WebPageProxy::viewportMetaTagWidthDidChange): Deleted.
3420         (WebKit::WebPageProxy::disableDoubleTapGesturesUntilTapIsFinishedIfNecessary): Deleted.
3421         * WebProcess/WebPage/ViewGestureGeometryCollector.h:
3422         * WebProcess/WebPage/WebPage.cpp:
3423         (WebKit::WebPage::willCommitLayerTree):
3424         * WebProcess/WebPage/ios/WebPageIOS.mm:
3425         (WebKit::WebPage::potentialTapAtPosition):
3426         (WebKit::WebPage::viewportPropertiesDidChange): Deleted.
3427
3428 2015-10-27  Tim Horton  <timothy_horton@apple.com>
3429
3430         WKView being inside WKWebView leads to weird API issues
3431         https://bugs.webkit.org/show_bug.cgi?id=150174
3432
3433         Reviewed by Anders Carlsson.
3434
3435         * UIProcess/API/mac/WKView.mm:
3436         (-[WKView _superAccessibilityAttributeValue:]):
3437         (-[WKView accessibilityFocusedUIElement]):
3438         (-[WKView accessibilityIsIgnored]):
3439         (-[WKView accessibilityHitTest:]):
3440         (-[WKView accessibilityAttributeValue:]):
3441         (-[WKView _processDidExit]):
3442         (-[WKView _pageClosed]):
3443         (-[WKView _updateRemoteAccessibilityRegistration:]): Deleted.
3444         (-[WKView enableAccessibilityIfNecessary]): Deleted.
3445         (-[WKView _toolTipChangedFrom:to:]): Deleted.
3446         (-[WKView _setAccessibilityWebProcessToken:]): Deleted.
3447         (-[WKView _hasFullScreenWindowController]): Deleted.
3448         (-[WKView _fullScreenWindowController]): Deleted.
3449         (-[WKView _closeFullScreenWindowController]): Deleted.
3450         (-[WKView _setSuppressVisibilityUpdates:]): Deleted.
3451         (-[WKView _suppressVisibilityUpdates]): Deleted.
3452         (-[WKView _primaryTrackingArea]): Deleted.
3453         (-[WKView _setPrimaryTrackingArea:]): Deleted.
3454         (-[WKView initWithFrame:processPool:configuration:webView:]): Deleted.