Cannot change WKWebView scrollView deceleration rate
[WebKit-https.git] / Source / WebKit2 / ChangeLog
1 2015-08-17  Wenson Hsieh  <wenson_hsieh@apple.com>
2
3         Cannot change WKWebView scrollView deceleration rate
4         https://bugs.webkit.org/show_bug.cgi?id=148086
5         <rdar://problem/21893685>
6
7         Reviewed by Simon Fraser.
8
9         Updates the preferred scroll deceleration factor when the scrollView's decelerationRate is explicitly set by the
10         user, so when snap scrolling is inactive and [WKWebView scrollViewWillBeginDragging] sets its scrollView's
11         decelerationRate to the preferred decelerationRate, it will be set to the updated value.
12
13         * UIProcess/ios/WKScrollView.mm:
14         (-[WKScrollView setDecelerationRate:]): Overrides setDecelerationRate to update _preferredScrollDecelerationFactor.
15
16 2015-08-17  Timothy Horton  <timothy_horton@apple.com>
17
18         Adopt shrink-wrapping for TextIndicators on Mac
19         https://bugs.webkit.org/show_bug.cgi?id=148064
20
21         Reviewed by Beth Dakin.
22
23         * Shared/WebCoreArgumentCoders.cpp:
24         (IPC::ArgumentCoder<TextIndicatorData>::encode): Deleted.
25         (IPC::ArgumentCoder<TextIndicatorData>::decode): Deleted.
26         * WebProcess/WebPage/FindController.cpp:
27         (WebKit::FindController::updateFindIndicator):
28         * WebProcess/WebPage/ios/WebPageIOS.mm:
29         (WebKit::WebPage::getPositionInformation):
30         Use the new option, TextIndicatorOptionIncludeMarginIfRangeMatchesSelection,
31         for iOS and FindController, because we can keep the margins in these cases
32         because we don't have to animate to/from the blue highlight.
33
34 2015-08-16  Timothy Horton  <timothy_horton@apple.com>
35
36         Refactor ViewGestureController swipe snapshot removal to be more platform-independent
37         https://bugs.webkit.org/show_bug.cgi?id=148062
38
39         Reviewed by Dan Bernstein.
40
41         * Platform/Logging.h:
42         Add a ViewGestures logging channel.
43
44         * UIProcess/ViewGestureController.cpp: Added.
45         (viewGestureControllersForAllPages):
46         (WebKit::ViewGestureController::ViewGestureController):
47         (WebKit::ViewGestureController::~ViewGestureController):
48         (WebKit::ViewGestureController::gestureControllerForPage):
49         (WebKit::ViewGestureController::didFirstVisuallyNonEmptyLayoutForMainFrame):
50         (WebKit::ViewGestureController::didRepaintAfterNavigation):
51         (WebKit::ViewGestureController::didHitRenderTreeSizeThreshold):
52         (WebKit::ViewGestureController::didRestoreScrollPosition):
53         (WebKit::ViewGestureController::didReachMainFrameLoadTerminalState):
54         (WebKit::ViewGestureController::didSameDocumentNavigationForMainFrame):
55         (WebKit::ViewGestureController::checkForActiveLoads):
56         (WebKit::ViewGestureController::SnapshotRemovalTracker::eventsDescription):
57         (WebKit::ViewGestureController::SnapshotRemovalTracker::SnapshotRemovalTracker):
58         (WebKit::ViewGestureController::SnapshotRemovalTracker::log):
59         (WebKit::ViewGestureController::SnapshotRemovalTracker::start):
60         (WebKit::ViewGestureController::SnapshotRemovalTracker::reset):
61         (WebKit::ViewGestureController::SnapshotRemovalTracker::eventOccurred):
62         (WebKit::ViewGestureController::SnapshotRemovalTracker::cancelOutstandingEvent):
63         (WebKit::ViewGestureController::SnapshotRemovalTracker::fireRemovalCallbackIfPossible):
64         (WebKit::ViewGestureController::SnapshotRemovalTracker::fireRemovalCallbackImmediately):
65         (WebKit::ViewGestureController::SnapshotRemovalTracker::watchdogTimerFired):
66         (WebKit::ViewGestureController::SnapshotRemovalTracker::startWatchdog):
67         Build a platform-independent SnapshotRemovalTracker, which keeps track of
68         various events that we wait for before removing the snapshot. This
69         is constructed from the union of ViewGestureController{IOS, Mac}'s snapshot
70         removal code, and each platform ViewGestureController can specify which
71         events to wait for (because this currently differs slightly).
72
73         Add logging to SnapshotRemovalTracker to make debugging snapshot removal
74         issues much easier.
75
76         * UIProcess/mac/ViewGestureController.h:
77         (WebKit::ViewGestureController::backgroundColorForCurrentSnapshot):
78         (WebKit::ViewGestureController::didFinishLoadForMainFrame):
79         (WebKit::ViewGestureController::didFailLoadForMainFrame):
80
81         * UIProcess/ios/ViewGestureControllerIOS.mm:
82         (WebKit::ViewGestureController::platformTeardown):
83         (WebKit::ViewGestureController::beginSwipeGesture):
84         (WebKit::ViewGestureController::endSwipeGesture):
85         (WebKit::ViewGestureController::setRenderTreeSize):
86         (WebKit::ViewGestureController::willCommitPostSwipeTransitionLayerTree):
87         (WebKit::ViewGestureController::removeSwipeSnapshot):
88         (viewGestureControllersForAllPages): Deleted.
89         (WebKit::ViewGestureController::ViewGestureController): Deleted.
90         (WebKit::ViewGestureController::~ViewGestureController): Deleted.
91         (WebKit::ViewGestureController::didRestoreScrollPosition): Deleted.
92         (WebKit::ViewGestureController::mainFrameLoadDidReachTerminalState): Deleted.
93         (WebKit::ViewGestureController::didSameDocumentNavigationForMainFrame): Deleted.
94         (WebKit::ViewGestureController::activeLoadMonitoringTimerFired): Deleted.
95         (WebKit::ViewGestureController::swipeSnapshotWatchdogTimerFired): Deleted.
96         (WebKit::ViewGestureController::removeSwipeSnapshotIfReady): Deleted.
97         * UIProcess/mac/ViewGestureControllerMac.mm:
98         (WebKit::ViewGestureController::platformTeardown):
99         (WebKit::ViewGestureController::endSwipeGesture):
100         (WebKit::ViewGestureController::forceRepaintIfNeeded):
101         (WebKit::ViewGestureController::removeSwipeSnapshot):
102         (WebKit::ViewGestureController::ViewGestureController): Deleted.
103         (WebKit::ViewGestureController::~ViewGestureController): Deleted.
104         (WebKit::ViewGestureController::beginSwipeGesture): Deleted.
105         (WebKit::ViewGestureController::didHitRenderTreeSizeThreshold): Deleted.
106         (WebKit::ViewGestureController::didFirstVisuallyNonEmptyLayoutForMainFrame): Deleted.
107         (WebKit::ViewGestureController::mainFrameLoadDidReachTerminalState): Deleted.
108         (WebKit::ViewGestureController::didSameDocumentNavigationForMainFrame): Deleted.
109         (WebKit::ViewGestureController::activeLoadMonitoringTimerFired): Deleted.
110         (WebKit::ViewGestureController::swipeSnapshotWatchdogTimerFired): Deleted.
111         (WebKit::ViewGestureController::removeSwipeSnapshotAfterRepaint): Deleted.
112         Move shareable snapshot removal code to a new platform-independent ViewGestureController file.
113         Move the ViewGestureController constructor/destructor to the platform-independent file.
114
115         * UIProcess/mac/ViewGestureController.messages.in:
116         * WebKit2.xcodeproj/project.pbxproj:
117
118 2015-08-11  Andy Estes  <aestes@apple.com>
119
120         [Cocoa] Add redirect support to CustomProtocolManager
121         https://bugs.webkit.org/show_bug.cgi?id=147871
122
123         Reviewed by Dan Bernstein.
124         
125         NSURLProtocols have the ability to generate redirect responses. This change teaches CustomProtocolManager how to handle them.
126
127         * Shared/Network/CustomProtocols/Cocoa/CustomProtocolManagerCocoa.mm:
128         (WebKit::CustomProtocolManager::wasRedirectedToRequest): Called -URLProtocol:wasRedirectedToRequest:redirectResponse: on the NSURLProtocolClient.
129         * Shared/Network/CustomProtocols/CustomProtocolManager.h:
130         * Shared/Network/CustomProtocols/CustomProtocolManager.messages.in: Defined WasRedirectedToRequest.
131         * Shared/Network/CustomProtocols/soup/CustomProtocolManagerSoup.cpp:
132         (WebKit::CustomProtocolManager::wasRedirectedToRequest): Defined empty function.
133         * UIProcess/Network/CustomProtocols/mac/CustomProtocolManagerProxyMac.mm:
134         (-[WKCustomProtocolLoader connection:willSendRequest:redirectResponse:]): If a redirect response is received, send WasRedirectedToRequest and return nil to ignore the redirect.
135
136 2015-08-13  Andy Estes  <aestes@apple.com>
137
138         [Cocoa] Downloads do not start if policy decision is made asynchronously
139         https://bugs.webkit.org/show_bug.cgi?id=147985
140
141         Reviewed by Brady Eidson.
142
143         * WebProcess/Network/WebResourceLoader.cpp: Updated to include SubresourceLoader.h.
144         * WebProcess/WebPage/WebFrame.cpp:
145         (WebKit::WebFrame::convertMainResourceLoadToDownload): Started a new download if the main resource loader is not calling didReceiveResponse.
146
147 2015-08-14  Simon Fraser  <simon.fraser@apple.com>
148
149         Speculative fix for iOS build failure.
150
151         * Shared/mac/RemoteLayerTreeTransaction.h:
152
153 2015-08-14  Philippe Normand  <pnormand@igalia.com>
154
155         Unreviewed, remove dead code after r188385.
156
157         * UIProcess/API/gtk/WebKitUserMediaPermissionRequest.cpp:
158         (webkitUserMediaPermissionRequestAllow): Deleted.
159
160 2015-08-14  Carlos Garcia Campos  <cgarcia@igalia.com>
161
162         Unreviewed. Fix the build with !ENABLE(MEDIA_STREAM) after r188385.
163
164         * UIProcess/API/C/WKUserMediaPermissionRequest.cpp:
165         (WKUserMediaPermissionRequestDeviceNamesVideo):
166         (WKUserMediaPermissionRequestDeviceNamesAudio):
167
168 2015-08-14  Carlos Garcia Campos  <cgarcia@igalia.com>
169
170         Unreviewed. Fix GTK+ build after r188386.
171
172         * UIProcess/API/gtk/WebKitWindowProperties.cpp:
173         (webkitWindowPropertiesUpdateFromWebWindowFeatures):
174
175 2015-08-13  Tim Horton  <timothy_horton@apple.com>
176
177         Performing a Lookup on wrapped text puts the popover arrow in the wrong place (off to the right)
178         https://bugs.webkit.org/show_bug.cgi?id=148012
179         <rdar://problem/19238094>
180
181         Reviewed by Simon Fraser.
182
183         * UIProcess/mac/PageClientImpl.mm:
184         (WebKit::PageClientImpl::didPerformDictionaryLookup):
185         * UIProcess/mac/WKImmediateActionController.mm:
186         (-[WKImmediateActionController _animationControllerForText]):
187         Adopt the new SPI, handing it the first text rect, instead of having it
188         guess where to put the popover.
189
190 2015-08-13  Commit Queue  <commit-queue@webkit.org>
191
192         Unreviewed, rolling out r188418.
193         https://bugs.webkit.org/show_bug.cgi?id=148017
194
195         Fix EFL after the rollout of r188404 (Requested by smfr on
196         #webkit).
197
198         Reverted changeset:
199
200         "[CMake] Unreviewed build fix after r188404"
201         http://trac.webkit.org/changeset/188418
202
203 2015-08-13  Commit Queue  <commit-queue@webkit.org>
204
205         Unreviewed, rolling out r188404.
206         https://bugs.webkit.org/show_bug.cgi?id=148014
207
208         Broke 4 API tests (Requested by smfr on #webkit).
209
210         Reverted changeset:
211
212         "Add WKWindowFeaturesRef and a new modern createNewPage UI
213         client callback"
214         https://bugs.webkit.org/show_bug.cgi?id=147989
215         http://trac.webkit.org/changeset/188404
216
217 2015-08-13  Tim Horton  <timothy_horton@apple.com>
218
219         Try to fix the Gtk/EFL build.
220
221         * WebProcess/WebPage/FindController.cpp:
222         (WebKit::FindController::updateFindIndicator):
223
224 2015-08-13  Tim Horton  <timothy_horton@apple.com>
225
226         Refactor and improve TextIndicator to prepare for tests
227         https://bugs.webkit.org/show_bug.cgi?id=147622
228
229         Reviewed by Simon Fraser.
230
231         * Shared/WebCoreArgumentCoders.cpp:
232         (IPC::encodeOptionalImage):
233         (IPC::decodeOptionalImage):
234         (IPC::ArgumentCoder<TextIndicatorData>::encode):
235         (IPC::ArgumentCoder<TextIndicatorData>::decode):
236         Move encode/decodeOptionalImage to their own functions to avoid duplication.
237
238         * UIProcess/API/mac/WKView.mm:
239         (-[WKView _dictionaryLookupPopoverWillClose:]):
240         (-[WKView _setTextIndicator:]):
241         (-[WKView _setTextIndicator:withLifetime:]):
242         (-[WKView _clearTextIndicatorWithAnimation:]):
243         (-[WKView _dismissContentRelativeChildWindows]):
244         (-[WKView _dismissContentRelativeChildWindowsWithAnimation:]):
245         * UIProcess/API/mac/WKViewInternal.h:
246         * UIProcess/PageClient.h:
247         * UIProcess/WebPageProxy.cpp:
248         (WebKit::WebPageProxy::setTextIndicator):
249         * UIProcess/WebPageProxy.h:
250         * UIProcess/ios/PageClientImplIOS.h:
251         * UIProcess/ios/PageClientImplIOS.mm:
252         (WebKit::PageClientImpl::setTextIndicator):
253         (WebKit::PageClientImpl::clearTextIndicator):
254         * UIProcess/mac/PageClientImpl.h:
255         * UIProcess/mac/PageClientImpl.mm:
256         (WebKit::PageClientImpl::setTextIndicator):
257         (WebKit::PageClientImpl::clearTextIndicator):
258         (WebKit::PageClientImpl::didPerformDictionaryLookup):
259         * UIProcess/mac/WKImmediateActionController.mm:
260         (-[WKImmediateActionController _animationControllerForText]):
261         * WebProcess/WebPage/FindController.cpp:
262         (WebKit::FindController::updateFindIndicator):
263         * WebProcess/WebPage/ios/WebPageIOS.mm:
264         (WebKit::WebPage::getPositionInformation):
265         (WebKit::shouldUseTextIndicatorForLink): Deleted.
266         * WebProcess/WebPage/mac/WebPageMac.mm:
267         (WebKit::WebPage::dictionaryPopupInfoForRange):
268         (WebKit::WebPage::performImmediateActionHitTestAtLocation):
269         Adopt TextIndicatorOptions.
270         Adjust to Range method renames.
271
272 2015-08-13  Jaehun Lim  <ljaehun.lim@samsung.com>
273
274         [CMake] Unreviewed build fix after r188404
275
276         * CMakeLists.txt: Add UIProcess/API/APIWindowFeatures.cpp, UIProcess/API/C/WKWindowFeaturesRef.cpp
277
278 2015-08-13  Wenson Hsieh  <wenson_hsieh@apple.com>
279
280         A focused node should not be assisted when handling touch events synchronously
281         https://bugs.webkit.org/show_bug.cgi?id=147836
282         <rdar://problem/22204108>
283
284         Reviewed by Enrica Casucci.
285
286         Makes interaction with touch handlers no longer assist the currently focused element in the
287         general case. Added plumbing to reassist a currently focused node when dispatching touch events,
288         so that an input that programmatically focuses itself and prevents default on a touch event will
289         be properly assisted when it has been programmatically focused (either through Javascript or the
290         autofocus attribute) prior to receiving the touch event. This patch also removes the now
291         unnecessary special-casing of the Gmail settings app that currently makes the keyboard deploy
292         upon autofocus.
293
294         * UIProcess/ios/WKContentViewInteraction.mm:
295         (-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:userObject:]): Removed
296             special case to avoid the early return for Gmail Add Account.
297         * WebProcess/WebCoreSupport/WebChromeClient.h: Added a handler for refocusing an element.
298         * WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm:
299         (WebKit::WebChromeClient::elementDidRefocus): Makes refocusing an element trigger input
300             assistance on iOS.
301         * WebProcess/WebPage/WebPage.cpp:
302         (WebKit::WebPage::dispatchTouchEvent): Removes logic to focus the currently focused element upon
303             receiving a touch event.
304
305 2015-08-13  Anders Carlsson  <andersca@apple.com>
306
307         Add WKWindowFeaturesRef and a new modern createNewPage UI client callback
308         https://bugs.webkit.org/show_bug.cgi?id=147989
309
310         Reviewed by Tim Horton.
311
312         * Platform/IPC/mac/ConnectionMac.mm:
313         * Shared/API/APIObject.h:
314         * Shared/API/c/WKBase.h:
315         * UIProcess/API/APIWindowFeatures.cpp: Added.
316         * UIProcess/API/APIWindowFeatures.h: Added.
317         * UIProcess/API/C/WKAPICast.h:
318         * UIProcess/API/C/WKPage.cpp:
319         (WKPageSetPageUIClient):
320         * UIProcess/API/C/WKPageUIClient.h:
321         * UIProcess/API/C/WKWindowFeaturesRef.cpp: Added.
322         (WKWindowFeaturesGetTypeID):
323         * UIProcess/API/C/WKWindowFeaturesRef.h: Added.
324         * UIProcess/API/Cocoa/WKWindowFeatures.mm:
325         (-[WKWindowFeatures dealloc]):
326         (-[WKWindowFeatures menuBarVisibility]):
327         (-[WKWindowFeatures statusBarVisibility]):
328         (-[WKWindowFeatures toolbarsVisibility]):
329         (-[WKWindowFeatures allowsResizing]):
330         (-[WKWindowFeatures x]):
331         (-[WKWindowFeatures y]):
332         (-[WKWindowFeatures width]):
333         (-[WKWindowFeatures height]):
334         (-[WKWindowFeatures _apiObject]):
335         (-[WKWindowFeatures _initWithWindowFeatures:]): Deleted.
336         * UIProcess/API/Cocoa/WKWindowFeaturesInternal.h:
337         (WebKit::wrapper):
338         * UIProcess/Cocoa/UIDelegate.mm:
339         (WebKit::UIDelegate::UIClient::createNewPage):
340         * WebKit2.xcodeproj/project.pbxproj:
341
342 2015-08-13  Simon Fraser  <simon.fraser@apple.com>
343
344         FilterOperation.h should not include FilterEffect.h
345         https://bugs.webkit.org/show_bug.cgi?id=147970
346
347         Reviewed by Daniel Bates.
348
349         FilterEffect.h pulls in lots of JSC goop via runtime/Uint8ClampedArray.h,
350         so move its include to FilterOperation.cpp.
351         
352         Causes include bloat because FilterOperation.h is pulled in via RenderStyle.h.
353
354         * UIProcess/ios/WebVideoFullscreenManagerProxy.h:
355
356 2015-08-12  Anders Carlsson  <andersca@apple.com>
357
358         Use WTF::Optional in WindowFeatures
359         https://bugs.webkit.org/show_bug.cgi?id=147956
360
361         Reviewed by Sam Weinig.
362
363         * Shared/WebCoreArgumentCoders.cpp:
364         (IPC::ArgumentCoder<WindowFeatures>::encode): Deleted.
365         (IPC::ArgumentCoder<WindowFeatures>::decode): Deleted.
366         * UIProcess/API/C/WKPage.cpp:
367         (WKPageSetPageUIClient):
368         * UIProcess/API/Cocoa/WKWindowFeatures.mm:
369         (-[WKWindowFeatures _initWithWindowFeatures:]):
370
371 2015-08-13  Matthew Daiter  <mdaiter@apple.com>
372
373         Linking device query ability from WebKit2 to clients
374         https://bugs.webkit.org/show_bug.cgi?id=147263
375         <rdar://problem/21983345>
376
377         Reviewed by Jer Noble.
378
379         * Platform/mac/LayerHostingContext.mm:
380         (WebKit::LayerHostingContext::setColorMatchUntaggedContent):
381         (WebKit::LayerHostingContext::colorMatchUntaggedContent):
382         * UIProcess/API/C/WKUserMediaPermissionRequest.cpp:
383         (WKUserMediaPermissionRequestAllow):
384         (WKUserMediaPermissionRequestDeviceNamesVideo):
385         (WKUserMediaPermissionRequestDeviceNamesAudio):
386         * UIProcess/API/C/WKUserMediaPermissionRequest.h:
387         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
388         (WebKit::UserMediaPermissionRequestManagerProxy::didReceiveUserMediaPermissionDecision): Deleted.
389         * UIProcess/UserMediaPermissionRequestManagerProxy.h:
390         * UIProcess/UserMediaPermissionRequestProxy.cpp:
391         (WebKit::UserMediaPermissionRequestProxy::allow):
392         (WebKit::UserMediaPermissionRequestProxy::deny):
393         * UIProcess/UserMediaPermissionRequestProxy.h:
394         * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
395         (WebKit::UserMediaPermissionRequestManager::didReceiveUserMediaPermissionDecision):
396
397
398 2015-08-12  Alexey Proskuryakov  <ap@apple.com>
399
400         [Mac] WebKit processes should have access to com.apple.nesessionmanager.flow-divert-token
401         https://bugs.webkit.org/show_bug.cgi?id=147949
402         rdar://problem/22254920
403
404         Reviewed by Anders Carlsson.
405
406         * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
407         * WebProcess/com.apple.WebProcess.sb.in:
408
409 2015-08-12  Brian Burg  <bburg@apple.com>
410
411         Web Inspector: CRASH under WebInspector::closeFrontend for some protocol tests
412         https://bugs.webkit.org/show_bug.cgi?id=147948
413
414         Reviewed by Joseph Pecoraro.
415
416         * WebProcess/WebPage/WebInspector.cpp:
417         (WebKit::WebInspector::closeFrontend): Don't invalidate the channel if it's null.
418         * WebProcess/WebPage/WebInspector.h: Add default member variable values.
419
420 2015-08-12  Joseph Pecoraro  <pecoraro@apple.com>
421
422         Web Inspector: Not receiving responses for async request IndexedDB.requestDatabaseNames
423         https://bugs.webkit.org/show_bug.cgi?id=147844
424
425         Reviewed by Brian Burg.
426
427         * WebProcess/Databases/IndexedDB/WebIDBFactoryBackend.cpp:
428         (WebKit::WebIDBFactoryBackend::getDatabaseNames):
429         This method should not return without calling either the success
430         or error callbacks. In this case, it can succeed with an empty list.
431
432 2015-08-12  Enrica Casucci  <enrica@apple.com>
433
434         Element interaction should not be canceled when the menu is already being shown.
435         https://bugs.webkit.org/show_bug.cgi?id=147945
436         rdar://problem/22206433
437
438         Reviewed by Beth Dakin.
439
440         When preview is canceled by the action menu gesture, we should not stop interacting
441         with the element, since the information about the element is used for the menu actions.
442         We now expose a new method in the action sheet assistant to know if the action sheed is
443         being shown and we use this as an indication that we should not stop the interaction
444         with the element.
445
446         * UIProcess/ios/WKActionSheetAssistant.h:
447         * UIProcess/ios/WKActionSheetAssistant.mm:
448         (-[WKActionSheetAssistant isShowingSheet]): Added.
449         * UIProcess/ios/WKContentViewInteraction.mm:
450         (-[WKContentView _interactionStoppedFromPreviewItemController:]): Do not stop
451         the interaction if the sheet is being shown.
452
453 2015-08-12  Matt Rajca  <mrajca@apple.com>
454
455         Fixed the Release build when MEDIA_SESSION is enabled.
456
457         * UIProcess/API/C/WKPage.cpp:
458         (WKPageHandleMediaEvent):
459
460 2015-08-07  Matt Rajca  <mrajca@apple.com>
461
462         Media Session: notify the UI process when media controls are enabled/disabled
463         https://bugs.webkit.org/show_bug.cgi?id=147802
464
465         Reviewed by Eric Carlson.
466
467         * UIProcess/WebMediaSessionFocusManager.cpp:
468         (WebKit::WebMediaSessionFocusManager::playbackAttributeDidChange): Generalized to take different attributes.
469         (WebKit::WebMediaSessionFocusManager::mediaElementIsPlayingDidChange): Deleted.
470         * UIProcess/WebMediaSessionFocusManager.h:
471         * UIProcess/WebPageProxy.cpp:
472         (WebKit::WebPageProxy::isPlayingMediaDidChange): Process new attributes for enabling/disabling media controls.
473
474 2015-08-12  Devin Rousso  <drousso@apple.com>
475
476         Web Inspector: Implement selector highlighting for iOS
477         https://bugs.webkit.org/show_bug.cgi?id=147919
478
479         Reviewed by Timothy Hatcher.
480
481         * UIProcess/WKInspectorHighlightView.mm:
482         (-[WKInspectorHighlightView _layoutForNodeHighlight:offset:]):
483         Added offset parameter to start drawing the highlight at that index of the highlight quad list.
484
485         (-[WKInspectorHighlightView _layoutForNodeListHighlight:]):
486         Loops through the highlight quads and draws a new highlight for every 4 highlight quad objects.
487
488         (-[WKInspectorHighlightView update:]):
489         Now uses the light highlighting for both nodes and lists of nodes.
490
491 2015-08-11  Carlos Garcia Campos  <cgarcia@igalia.com>
492
493         NetworkProcess: DNS prefetch happens in the Web Process
494         https://bugs.webkit.org/show_bug.cgi?id=147824
495
496         Reviewed by Alexey Proskuryakov.
497
498         DNS prefetch requests started in the WebProcess should be sent to
499         the network process when it's enabled.
500
501         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
502         (WebKit::NetworkConnectionToWebProcess::prefetchDNS): Do the
503         actual DNS prefetch.
504         * NetworkProcess/NetworkConnectionToWebProcess.h:
505         * NetworkProcess/NetworkConnectionToWebProcess.messages.in: Add
506         PrefetchDNS message.
507         * WebProcess/InjectedBundle/API/gtk/WebKitWebExtension.cpp:
508         (webkitWebExtensionDidReceiveMessage): Use WebProcess::prefetchDNS().
509         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
510         (WebKit::WebFrameLoaderClient::prefetchDNS): Ditto.
511         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
512         * WebProcess/WebPage/ios/WebPageIOS.mm:
513         (WebKit::WebPage::sendTapHighlightForNodeIfNecessary): Use
514         FrameLoaderClient to do the DNS prefetch.
515         * WebProcess/WebProcess.cpp:
516         (WebKit::WebProcess::prefetchDNS): Send the request to the network
517         process if it's enabled, otherwise do the actual DNS prefetch.
518         * WebProcess/WebProcess.h:
519
520 2015-08-11  Hunseop Jeong  <hs85.jeong@samsung.com>
521
522         Try to fix the EFL build after r188279
523         https://bugs.webkit.org/show_bug.cgi?id=147917
524
525         Reviewed by Gyuyoung Kim.
526
527         Replaced the WKPageLoaderClient with variable name because it is removed in r188279.
528
529         * UIProcess/efl/PageLoadClientEfl.cpp:
530         (WebKit::PageLoadClientEfl::PageLoadClientEfl):
531         * UIProcess/efl/PagePolicyClientEfl.cpp:
532         (WebKit::PagePolicyClientEfl::PagePolicyClientEfl):
533
534 2015-08-11  Andy Estes  <aestes@apple.com>
535
536         Tried again to fix the iOS build.
537
538         * UIProcess/ios/WKGeolocationProviderIOS.mm:
539         (-[WKGeolocationProviderIOS initWithProcessPool:]):
540
541 2015-08-11  Dan Bernstein  <mitz@apple.com>
542
543         Tried to fix the iOS build.
544
545         * UIProcess/ios/WKGeolocationProviderIOS.mm:
546         (-[WKGeolocationProviderIOS initWithProcessPool:]):
547
548 2015-08-11  Andy Estes  <aestes@apple.com>
549
550         WebFrameLoaderClient::dispatchDecidePolicyForResponse() calls an std::function after it's been moved from
551         https://bugs.webkit.org/show_bug.cgi?id=147873
552
553         Reviewed by Alexey Proskuryakov.
554         
555         I noticed during code inspection that we were calling an std::function after WTF::move() has been called on it.
556         Calling an empty std::function results in a C++ exception being thrown. I don't know how to make a sync IPC
557         message fail, so I'm not sure how to test this.
558
559         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
560         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse): Called didReceivePolicyDecision instead.
561
562 2015-08-11  Beth Dakin  <bdakin@apple.com>
563
564         REGRESSION (r188053): Sometimes unable to save an image from Google Search/
565         imgur via long press
566         https://bugs.webkit.org/show_bug.cgi?id=147896
567
568         Reviewed by Enrica Casucci.
569
570         http://trac.webkit.org/changeset/188053 added code to call cleanupSheet when 
571         the long press gesture is cancelled. However, the gesture will be called with 
572         the cancelled state when then user taps an item in the action sheet (such as 
573         “save image”), and sometimes the “cancel” comes in before the image has been 
574         saved. That is a problem because we need to avoid cleaning up the sheet until 
575         after the image is saved. Before that patch, we never cleaned up the sheet on 
576         cancel, so this patch goes back to that behavior. We also have to remove some 
577         assertions that assume that everything will be totally cleaned up when a new 
578         sheet is created, but that is not necessarily true due to interactions 
579         between the preview gesture and the long press gesture. 
580
581         Remove assertions.
582         * UIProcess/ios/WKActionSheetAssistant.mm:
583         (-[WKActionSheetAssistant _createSheetWithElementActions:showLinkTitle:]):
584         (-[WKActionSheetAssistant showImageSheet]):
585         (-[WKActionSheetAssistant showLinkSheet]):
586         (-[WKActionSheetAssistant showDataDetectorsSheet]):
587
588         Revert the part of Enrica’s patch that called cleanupSheet when the gesture 
589         is cancelled.
590         * UIProcess/ios/WKContentViewInteraction.mm:
591         (-[WKContentView _longPressRecognized:]):
592
593 2015-08-11  Anders Carlsson  <andersca@apple.com>
594
595         Remove unversioned client structs from the C SPI
596         https://bugs.webkit.org/show_bug.cgi?id=147894
597
598         Reviewed by Dan Bernstein.
599
600         * Shared/API/c/WKConnectionRef.h:
601         * UIProcess/API/C/WKContext.h:
602         * UIProcess/API/C/WKContextConnectionClient.h:
603         * UIProcess/API/C/WKContextDownloadClient.h:
604         * UIProcess/API/C/WKContextHistoryClient.h:
605         * UIProcess/API/C/WKContextInjectedBundleClient.h:
606         * UIProcess/API/C/WKCookieManager.h:
607         * UIProcess/API/C/WKDatabaseManager.h:
608         * UIProcess/API/C/WKGeolocationManager.h:
609         * UIProcess/API/C/WKIconDatabase.h:
610         * UIProcess/API/C/WKNotificationProvider.h:
611         * UIProcess/API/C/WKPageContextMenuClient.h:
612         * UIProcess/API/C/WKPageDiagnosticLoggingClient.h:
613         * UIProcess/API/C/WKPageFindClient.h:
614         * UIProcess/API/C/WKPageFindMatchesClient.h:
615         * UIProcess/API/C/WKPageFormClient.h:
616         * UIProcess/API/C/WKPageLoaderClient.h:
617         * UIProcess/API/C/WKPagePolicyClient.h:
618         * UIProcess/API/C/WKPageUIClient.h:
619         * WebProcess/InjectedBundle/API/c/WKBundle.h:
620         * WebProcess/InjectedBundle/API/c/WKBundlePageBanner.h:
621         * WebProcess/InjectedBundle/API/c/WKBundlePageContextMenuClient.h:
622         * WebProcess/InjectedBundle/API/c/WKBundlePageDiagnosticLoggingClient.h:
623         * WebProcess/InjectedBundle/API/c/WKBundlePageEditorClient.h:
624         * WebProcess/InjectedBundle/API/c/WKBundlePageFormClient.h:
625         * WebProcess/InjectedBundle/API/c/WKBundlePageFullScreenClient.h:
626         * WebProcess/InjectedBundle/API/c/WKBundlePageLoaderClient.h:
627         * WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.h:
628         * WebProcess/InjectedBundle/API/c/WKBundlePagePolicyClient.h:
629         * WebProcess/InjectedBundle/API/c/WKBundlePageResourceLoadClient.h:
630         * WebProcess/InjectedBundle/API/c/WKBundlePageUIClient.h:
631
632 2015-08-11  Dan Bernstein  <mitz@apple.com>
633
634         Reverted r188255, because it turned out that delegates do nonot need this information.
635
636         * UIProcess/API/APIUIClient.h:
637         (API::UIClient::footerHeight):
638         (API::UIClient::drawHeader):
639         (API::UIClient::drawFooter):
640         (API::UIClient::printFrame):
641         (API::UIClient::canRunModal):
642         (API::UIClient::runModal):
643         * UIProcess/API/C/WKPage.cpp:
644         (WKPageSetPageUIClient):
645         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
646         * UIProcess/Cocoa/UIDelegate.h:
647         * UIProcess/Cocoa/UIDelegate.mm:
648         (WebKit::UIDelegate::UIDelegate):
649         (WebKit::UIDelegate::setDelegate):
650         (WebKit::UIDelegate::UIClient::reachedApplicationCacheOriginQuota):
651         (WebKit::UIDelegate::UIClient::printFrame):
652         (WebKit::UIDelegate::UIClient::close):
653         * UIProcess/WebPageProxy.cpp:
654         (WebKit::WebPageProxy::runOpenPanel):
655         (WebKit::WebPageProxy::printFrame):
656         (WebKit::WebPageProxy::printMainFrame):
657         (WebKit::WebPageProxy::setMediaVolume):
658         * UIProcess/WebPageProxy.h:
659         (WebKit::WebPageProxy::setShouldSendEventsSynchronously):
660         * UIProcess/WebPageProxy.messages.in:
661         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
662         (WebKit::WebChromeClient::print):
663         (WebKit::WebChromeClient::exceededDatabaseQuota):
664
665 2015-08-11  Dan Bernstein  <mitz@apple.com>
666
667         [Cocoa] The UI delegate can't tell if printing was user-initiated
668         https://bugs.webkit.org/show_bug.cgi?id=147869
669
670         Reviewed by Sam Weinig.
671
672         * UIProcess/API/APIUIClient.h:
673         (API::UIClient::printFrame): Added processingUserGesture argument.
674
675         * UIProcess/API/C/WKPage.cpp:
676         (WKPageSetPageUIClient): Updated for new client function signature.
677
678         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: Added userInitiated boolean argument to
679           -_webView:printFrame:.
680
681         * UIProcess/Cocoa/UIDelegate.h: Added bool to m_delegateMethods for the new method.
682         * UIProcess/Cocoa/UIDelegate.mm:
683         (WebKit::UIDelegate::UIDelegate):
684         (WebKit::UIDelegate::setDelegate): Initialized new bool.
685         (WebKit::UIDelegate::UIClient::printFrame): Pass processingUserGesture as the delegate’s
686           userInitiated argument.
687
688         * UIProcess/WebPageProxy.cpp:
689         (WebKit::WebPageProxy::printFrame): Added processingUserGesture argument, passing it along
690           to the client.
691         * UIProcess/WebPageProxy.h:
692
693         * UIProcess/WebPageProxy.messages.in: Added processingUserGesture argument to printFrame.
694
695         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
696         (WebKit::WebChromeClient::print): Pass new argument.
697
698 2015-08-10  Matthew Daiter  <mdaiter@apple.com>
699
700         Add MediaDeviceIdentifier to WebsiteDataTypes
701         https://bugs.webkit.org/show_bug.cgi?id=147853
702
703         Reviewed by Jer Noble.
704
705         * Shared/WebsiteData/WebsiteDataTypes.h:
706
707 2015-08-10  Sam Weinig  <sam@webkit.org>
708
709         Try to fix the 32-bit build.
710
711         * UIProcess/API/mac/WKViewInternal.h:
712
713 2015-08-08  Sam Weinig  <sam@webkit.org>
714
715         Replace WebPageConfiguration with API::PageConfiguration and expose a C-SPI accessor for it
716         https://bugs.webkit.org/show_bug.cgi?id=147811
717
718         Reviewed by Darin Adler.
719
720         - Adds the missing pieces from WebPageConfiguration into API::PageConfiguration.
721         - Adds C-SPI to set and get the WebsiteDataStore on the WKPageConfigurationRef.
722         - Uses API::PageConfiguration to pass configuration information from WKWebView/WKView 
723           to WebPageProxy.
724         - Stores the API::PageConfiguration on the WebPageProxy and exposes a new C-SPI function,
725           WKPageCopyPageConfiguration, to get a copy of it.
726
727         * UIProcess/API/APIPageConfiguration.cpp:
728         (API::PageConfiguration::create):
729         (API::PageConfiguration::PageConfiguration):
730         (API::PageConfiguration::~PageConfiguration):
731         (API::PageConfiguration::copy):
732         (API::PageConfiguration::processPool):
733         (API::PageConfiguration::setRelatedPage):
734         (API::PageConfiguration::visitedLinkProvider):
735         (API::PageConfiguration::setVisitedLinkProvider):
736         (API::PageConfiguration::websiteDataStore):
737         (API::PageConfiguration::setWebsiteDataStore):
738         (API::PageConfiguration::sessionID):
739         (API::PageConfiguration::setSessionID):
740         (API::PageConfiguration::webPageConfiguration): Deleted.
741         * UIProcess/API/APIPageConfiguration.h:
742         (API::PageConfiguration::preferenceValues):
743         (API::PageConfiguration::treatsSHA1SignedCertificatesAsInsecure):
744         (API::PageConfiguration::setTreatsSHA1SignedCertificatesAsInsecure):
745         (API::PageConfiguration::alwaysRunsAtForegroundPriority):
746         (API::PageConfiguration::setAlwaysRunsAtForegroundPriority):
747         (API::PageConfiguration::create): Deleted.
748         * UIProcess/API/C/WKPage.cpp:
749         (WKPageGetPageGroup):
750         (WKPageCopyPageConfiguration):
751         (WKPageLoadURL):
752         * UIProcess/API/C/WKPage.h:
753         * UIProcess/API/C/WKPageConfigurationRef.cpp:
754         (WKPageConfigurationSetRelatedPage):
755         (WKPageConfigurationGetWebsiteDataStore):
756         (WKPageConfigurationSetWebsiteDataStore):
757         * UIProcess/API/C/WKPageConfigurationRef.h:
758         * UIProcess/API/Cocoa/WKWebView.mm:
759         (-[WKWebView initWithFrame:configuration:]):
760         * UIProcess/API/ios/WKViewIOS.mm:
761         (-[WKView _commonInitializationWithContextRef:pageGroupRef:relatedToPage:]):
762         * UIProcess/API/mac/WKView.mm:
763         (-[WKView _setPrimaryTrackingArea:]):
764         (-[WKView initWithFrame:processPool:configuration:webView:]):
765         (-[WKView initWithFrame:contextRef:pageGroupRef:relatedToPage:]):
766         (-[WKView initWithFrame:configurationRef:]):
767         (-[WKView wantsUpdateLayer]):
768         * UIProcess/API/mac/WKViewInternal.h:
769         * UIProcess/WebPageProxy.cpp:
770         (WebKit::WebPageProxy::create):
771         (WebKit::WebPageProxy::WebPageProxy):
772         (WebKit::WebPageProxy::~WebPageProxy):
773         (WebKit::WebPageProxy::configuration):
774         (WebKit::WebPageProxy::processIdentifier):
775         * UIProcess/WebPageProxy.h:
776         (WebKit::WebPageProxy::pageID):
777         (WebKit::WebPageProxy::sessionID):
778         * UIProcess/WebProcessPool.cpp:
779         (WebKit::WebProcessPool::createNewWebProcessRespectingProcessCountLimit):
780         (WebKit::WebProcessPool::createWebPage):
781         (WebKit::WebProcessPool::download):
782         * UIProcess/WebProcessPool.h:
783         * UIProcess/WebProcessProxy.cpp:
784         (WebKit::WebProcessProxy::webPage):
785         (WebKit::WebProcessProxy::createWebPage):
786         * UIProcess/WebProcessProxy.h:
787         (WebKit::WebProcessProxy::processPool):
788         * UIProcess/ios/WKContentView.h:
789         * UIProcess/ios/WKContentView.mm:
790         (-[WKContentView _commonInitializationWithProcessPool:configuration:]):
791         (-[WKContentView initWithFrame:processPool:configuration:webView:]):
792         (-[WKContentView initWithFrame:processPool:configuration:wkView:]):
793         (-[WKContentView dealloc]):
794
795 2015-08-10  Commit Queue  <commit-queue@webkit.org>
796
797         Unreviewed, rolling out r187131 and r187286.
798         https://bugs.webkit.org/show_bug.cgi?id=147839
799
800          Causing mroe frequent crashes with invalid layer bounds
801         (rdar://problem/21465328) (Requested by smfr on #webkit).
802
803         Reverted changesets:
804
805         "[iOS] Menu drop down such as on nike.com does not stay"
806         https://bugs.webkit.org/show_bug.cgi?id=147047
807         http://trac.webkit.org/changeset/187131
808
809         "[iOS] REGRESSION (187131): Loading CuteOverload zooms in to
810         the top left corner."
811         https://bugs.webkit.org/show_bug.cgi?id=147251
812         http://trac.webkit.org/changeset/187286
813
814 2015-08-07  Matt Rajca  <mrajca@apple.com>
815
816         Media Session: generalize isFocusedContentMediaElementPlaying so it works with other playback attributes
817         https://bugs.webkit.org/show_bug.cgi?id=147797
818
819         Reviewed by Simon Fraser.
820
821         * UIProcess/API/C/WKMediaSessionFocusManager.cpp:
822         (WKMediaSessionFocusManagerValueForPlaybackAttribute):
823         (WKMediaSessionFocusManagerIsFocusedContentMediaElementPlaying): Deleted.
824         * UIProcess/API/C/WKMediaSessionFocusManager.h:
825         * UIProcess/WebMediaSessionFocusManager.cpp:
826         (WebKit::WebMediaSessionFocusManager::valueForPlaybackAttribute):
827         (WebKit::WebMediaSessionFocusManager::mediaControlIsEnabledDidChange):
828         (WebKit::WebMediaSessionFocusManager::isFocusedContentMediaElementPlaying): Deleted.
829         (WebKit::WebMediaSessionFocusManager::mediaElementIsPlayingDidChange): Deleted.
830         * UIProcess/WebMediaSessionFocusManager.h:
831
832 2015-08-10  Zan Dobersek  <zdobersek@igalia.com>
833
834         [CoordinatedGraphics] Fix forward declarations of CoordinatedGraphicsLayerState, ViewportAttributes
835         https://bugs.webkit.org/show_bug.cgi?id=147823
836
837         Reviewed by Carlos Garcia Campos.
838
839         * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h:
840         * WebProcess/WebPage/LayerTreeHost.h:
841
842 2015-08-10  Carlos Garcia Campos  <cgarcia@igalia.com>
843
844         [GTK] Crash when the web view is destroyed while the screensaver DBUs proxy is being created
845         https://bugs.webkit.org/show_bug.cgi?id=147780
846
847         Reviewed by Sergio Villar Senin.
848
849         We should cancel the screenSaverInhibitCancellable on
850         dispose. Also use adoptGRef() when creating the cancellable object
851         to not leak it.
852
853         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
854         (webkitWebViewBaseDispose):
855         (webkitWebViewBaseSendInhibitMessageToScreenSaver):
856         (webkitWebViewBaseInhibitScreenSaver):
857
858 2015-08-09  Chris Dumez  <cdumez@apple.com>
859
860         Follow-up nit fixes after r187691.
861         https://bugs.webkit.org/show_bug.cgi?id=128006
862
863         Reviewed by Gavin Barraclough.
864
865         Use modern for-loops instead of explicit iterators.
866
867         * Shared/Authentication/AuthenticationManager.cpp:
868         (WebKit::AuthenticationManager::shouldCoalesceChallenge):
869         (WebKit::AuthenticationManager::coalesceChallengesMatching):
870
871 2015-08-07  Filip Pizlo  <fpizlo@apple.com>
872
873         Lightweight locks should be adaptive
874         https://bugs.webkit.org/show_bug.cgi?id=147545
875
876         Reviewed by Geoffrey Garen.
877
878         * WebProcess/WebPage/EventDispatcher.cpp:
879         (WebKit::EventDispatcher::clearQueuedTouchEventsForPage):
880         (WebKit::EventDispatcher::getQueuedTouchEventsForPage):
881         (WebKit::EventDispatcher::touchEvent):
882         (WebKit::EventDispatcher::dispatchTouchEvents):
883         * WebProcess/WebPage/EventDispatcher.h:
884         * WebProcess/WebPage/ViewUpdateDispatcher.cpp:
885         (WebKit::ViewUpdateDispatcher::visibleContentRectUpdate):
886         (WebKit::ViewUpdateDispatcher::dispatchVisibleContentRectUpdate):
887         * WebProcess/WebPage/ViewUpdateDispatcher.h:
888
889 2015-08-07  Wenson Hsieh  <wenson_hsieh@apple.com>
890
891         Temporarily allow programmatic input assistance for adding Gmail account
892         https://bugs.webkit.org/show_bug.cgi?id=147792
893
894         Reviewed by Enrica Casucci.
895         <rdar://problem/22126518>
896
897         Temporary fix for keyboard input sliding out and immediately back in upon user interaction
898         in the Gmail 2-factor authentication page.
899
900         * UIProcess/ios/WKContentViewInteraction.mm:
901         (-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:userObject:]): Early
902             return no longer triggers due to lack of user interaction when adding a new Gmail account
903             through Settings.
904
905 2015-08-07  Brady Eidson  <beidson@apple.com>
906
907         Move concrete KeyedDecoder/Encoder implementations to WebCore.
908         https://bugs.webkit.org/show_bug.cgi?id=147757.
909
910         Rubberstamped by Andy Estes.
911
912         * DatabaseProcess/IndexedDB/IDBSerialization.cpp:
913         (WebKit::serializeIDBKeyPath):
914         (WebKit::deserializeIDBKeyPath):
915         (WebKit::serializeIDBKeyData):
916         (WebKit::deserializeIDBKeyData):
917         
918         * PlatformEfl.cmake:
919         * PlatformGTK.cmake:
920         * WebKit2.xcodeproj/project.pbxproj:
921
922 2015-08-07  Carlos Garcia Campos  <cgarcia@igalia.com>
923
924         Unreviewed. Fix GTK+ compile warning also introduced in r188121.
925
926         * UIProcess/API/gtk/WebKitInstallMissingMediaPluginsPermissionRequest.cpp:
927         (webkit_install_missing_media_plugins_permission_request_get_description):
928
929 2015-08-07  Carlos Garcia Campos  <cgarcia@igalia.com>
930
931         Unreviewed. Fix GTK+ debug build after r188121.
932
933         * UIProcess/API/gtk/WebKitInstallMissingMediaPluginsPermissionRequest.cpp:
934         (webkit_install_missing_media_plugins_permission_request_get_description):
935
936 2015-08-07  Carlos Garcia Campos  <cgarcia@igalia.com>
937
938         [GStreamer] Do not automatically show PackageKit codec installation notifications
939         https://bugs.webkit.org/show_bug.cgi?id=135973
940
941         Reviewed by Philippe Normand.
942
943         Add InstallMissingMediaPluginsPermissionRequest to ask the API
944         layer whether to allow or deny the installation of missing media
945         plugins. And add a GTK+ implementation based on current permission
946         request API. Replace the
947         PageClientImpl::createGstInstallPluginsContext() with
948         decicePolicyForInstallMissingMediaPluginsPermissionRequest() that
949         passes the InstallMissingMediaPluginsPermissionRequest object to
950         the API layer. The allow method receives the
951         GstInstallPluginsContext now, so that it can be created by the API implementation.
952
953         * PlatformEfl.cmake:
954         * PlatformGTK.cmake:
955         * UIProcess/API/gtk/PageClientImpl.cpp:
956         (WebKit::PageClientImpl::decicePolicyForInstallMissingMediaPluginsPermissionRequest):
957         * UIProcess/API/gtk/PageClientImpl.h:
958         * UIProcess/API/gtk/WebKitInstallMissingMediaPluginsPermissionRequest.cpp: Added.
959         (createGstInstallPluginsContext):
960         (webkitInstallMissingMediaPluginsPermissionRequestAllow):
961         (webkitInstallMissingMediaPluginsPermissionRequestDeny):
962         (webkit_permission_request_interface_init):
963         (webkitInstallMissingMediaPluginsPermissionRequestDispose):
964         (webkit_install_missing_media_plugins_permission_request_class_init):
965         (webkitInstallMissingMediaPluginsPermissionRequestCreate):
966         (webkit_install_missing_media_plugins_permission_request_get_description):
967         * UIProcess/API/gtk/WebKitInstallMissingMediaPluginsPermissionRequest.h: Added.
968         * UIProcess/API/gtk/WebKitInstallMissingMediaPluginsPermissionRequestPrivate.h: Added.
969         * UIProcess/API/gtk/WebKitWebView.cpp:
970         (webkitWebViewRequestInstallMissingMediaPlugins):
971         * UIProcess/API/gtk/WebKitWebViewPrivate.h:
972         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
973         * UIProcess/API/gtk/docs/webkit2gtk-4.0.types:
974         * UIProcess/API/gtk/docs/webkit2gtk-docs.sgml:
975         * UIProcess/API/gtk/webkit2.h:
976         * UIProcess/PageClient.h:
977         * UIProcess/WebPageProxy.h:
978         * UIProcess/WebPageProxy.messages.in:
979         * UIProcess/efl/WebViewEfl.h:
980         * UIProcess/gstreamer/InstallMissingMediaPluginsPermissionRequest.cpp: Copied from Source/WebKit2/UIProcess/gstreamer/WebPageProxyGStreamer.cpp.
981         (WebKit::InstallMissingMediaPluginsPermissionRequest::InstallMissingMediaPluginsPermissionRequest):
982         (WebKit::InstallMissingMediaPluginsPermissionRequest::~InstallMissingMediaPluginsPermissionRequest):
983         (WebKit::InstallMissingMediaPluginsPermissionRequest::allow):
984         (WebKit::InstallMissingMediaPluginsPermissionRequest::deny):
985         (WebKit::InstallMissingMediaPluginsPermissionRequest::didEndRequestInstallMissingMediaPlugins):
986         * UIProcess/gstreamer/InstallMissingMediaPluginsPermissionRequest.h: Copied from Source/WebKit2/WebProcess/WebPage/gstreamer/WebPageGStreamer.cpp.
987         (WebKit::InstallMissingMediaPluginsPermissionRequest::create):
988         (WebKit::InstallMissingMediaPluginsPermissionRequest::page):
989         (WebKit::InstallMissingMediaPluginsPermissionRequest::details):
990         (WebKit::InstallMissingMediaPluginsPermissionRequest::description):
991         * UIProcess/gstreamer/WebPageProxyGStreamer.cpp:
992         (WebKit::WebPageProxy::requestInstallMissingMediaPlugins):
993         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
994         (WebKit::WebChromeClient::requestInstallMissingMediaPlugins):
995         * WebProcess/WebCoreSupport/WebChromeClient.h:
996         * WebProcess/WebPage/WebPage.h:
997         * WebProcess/WebPage/gstreamer/WebPageGStreamer.cpp:
998         (WebKit::WebPage::requestInstallMissingMediaPlugins):
999
1000 2015-08-06  Beth Dakin  <bdakin@apple.com>
1001
1002         TextIndicator can have stale contentImage data and crash
1003         https://bugs.webkit.org/show_bug.cgi?id=147770
1004         -and corresponding-
1005         rdar://problem/22181735
1006
1007         Reviewed by Tim Horton.
1008
1009         If there is no contentImage or contentImageWithHighlight, set them to 
1010         nullptr.
1011         * Shared/WebCoreArgumentCoders.cpp:
1012         (IPC::ArgumentCoder<TextIndicatorData>::decode):
1013
1014 2015-08-06  Dan Bernstein  <mitz@apple.com>
1015
1016         Fixed all the builds after trying to fix the non-HAVE(LINK_PREVIEW) build.
1017
1018         * UIProcess/ios/WKContentViewInteraction.mm:
1019
1020 2015-08-06  Dan Bernstein  <mitz@apple.com>
1021
1022         Fixed the non-HAVE(LINK_PREVIEW) build.
1023
1024         * UIProcess/ios/WKContentViewInteraction.mm:
1025
1026 2015-08-06  Enrica Casucci  <enrica@apple.com>
1027
1028         Cleanup action sheet only when long press is canceled (non ended).
1029         https://bugs.webkit.org/show_bug.cgi?id=147766
1030         rdar://problem/22181842
1031
1032         Reviewed by Tim Horton.
1033
1034         * UIProcess/ios/WKContentViewInteraction.mm:
1035         (-[WKContentView _longPressRecognized:]):
1036
1037 2015-08-06  Matt Rajca  <mrajca@apple.com>
1038
1039         Media Session: notify focus manager clients when the playing state of the focused media element changes
1040         https://bugs.webkit.org/show_bug.cgi?id=147745
1041
1042         Reviewed by Tim Horton.
1043
1044         Added plumbing to allow focus manager's clients to be notified when the focused Content media element begins
1045         playing or is paused.
1046
1047         * UIProcess/API/C/WKMediaSessionFocusManager.cpp:
1048         (WKMediaSessionFocusManagerSetClient):
1049         * UIProcess/API/C/WKMediaSessionFocusManager.h:
1050         * UIProcess/WebMediaSessionFocusManager.cpp:
1051         (WebKit::WebMediaSessionFocusManager::initializeClient):
1052         (WebKit::WebMediaSessionFocusManager::mediaElementIsPlayingDidChange):
1053         * UIProcess/WebMediaSessionFocusManager.h:
1054         * UIProcess/WebMediaSessionFocusManagerClient.cpp:
1055         (WebKit::WebMediaSessionFocusManagerClient::didChangePlaybackAttribute):
1056         * UIProcess/WebMediaSessionFocusManagerClient.h:
1057         * WebKit2.xcodeproj/project.pbxproj:
1058
1059 2015-08-06  Alex Christensen  <achristensen@webkit.org>
1060
1061         Make CMake usable on Mac.
1062         https://bugs.webkit.org/show_bug.cgi?id=147756
1063
1064         Reviewed by Tim Horton.
1065
1066         * PlatformMac.cmake:
1067         DatabaseProcess_SOURCES needs something in order to not have errors when generating build systems from CMake.
1068         This doesn't fix everything, but it can now be used to build jsc again.
1069
1070 2015-08-06  Enrica Casucci  <enrica@apple.com>
1071
1072         Build fix for iOS after http://trac.webkit.org/changeset/188053.
1073
1074         Unreviewed.
1075
1076         * UIProcess/ios/WKContentViewInteraction.mm:
1077         (-[WKContentView _registerPreview]):
1078
1079 2015-08-06  Enrica Casucci  <enrica@apple.com>
1080
1081         Allow long press to cancel link preview.
1082         https://bugs.webkit.org/show_bug.cgi?id=147743
1083         rdar://problem/22128839
1084
1085         Reviewed by Tim Horton.
1086
1087         We should be able to show the context menu at the beginnig of link preview.
1088
1089         * UIProcess/ios/WKContentViewInteraction.h:
1090         * UIProcess/ios/WKContentViewInteraction.mm:
1091         (-[WKContentView _removeDefaultGestureRecognizers]):
1092         (-[WKContentView _addDefaultGestureRecognizers]):
1093         (-[WKContentView gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:]):
1094         (-[WKContentView _longPressRecognized:]):
1095         (-[WKContentView _singleTapRecognized:]):
1096         (-[WKContentView _registerPreview]):
1097         (-[WKContentView _unregisterPreview]):
1098
1099 2015-08-06  Matt Rajca  <mrajca@apple.com>
1100
1101         Media Session: rename isFocusedContentMediaElementPaused and get rid of callback
1102         https://bugs.webkit.org/show_bug.cgi?id=147726
1103
1104         Reviewed by Simon Fraser.
1105
1106         - isFocusedContentMediaElementPaused should be renamed to isFocusedContentMediaElementPlaying to match recent
1107           refactoring work.
1108         - isFocusedContentMediaElementPlaying itself does not need a callback anymore because the value can be returned
1109           directly.
1110
1111         * UIProcess/API/C/WKMediaSessionFocusManager.cpp:
1112         (WKMediaSessionFocusManagerIsFocusedContentMediaElementPlaying): Removed callback and renamed from...
1113         (WKMediaSessionFocusManagerIsFocusedContentMediaElementPaused): Deleted.
1114         * UIProcess/API/C/WKMediaSessionFocusManager.h:
1115         * UIProcess/WebMediaSessionFocusManager.cpp:
1116         (WebKit::WebMediaSessionFocusManager::isFocusedContentMediaElementPlaying): Removed callback and renamed from...
1117         (WebKit::WebMediaSessionFocusManager::isFocusedContentMediaElementPaused): Deleted.
1118         * UIProcess/WebMediaSessionFocusManager.h:
1119
1120 2015-08-06  Csaba Osztrogonác  <ossy@webkit.org>
1121
1122         [EFL] Bump EFL version to 1.15.0
1123         https://bugs.webkit.org/show_bug.cgi?id=147450
1124
1125         Reviewed by Gyuyoung Kim.
1126
1127         * PlatformEfl.cmake:
1128
1129 2015-08-06  Carlos Garcia Campos  <cgarcia@igalia.com>
1130
1131         [GTK] Crash closing a page when a context menu is open
1132         https://bugs.webkit.org/show_bug.cgi?id=147682
1133
1134         Reviewed by Sergio Villar Senin.
1135
1136         Implement WebContextMenuProxy::cancelTracking() to clear the
1137         internal menu when the web page is closed.
1138
1139         * UIProcess/gtk/WebContextMenuProxyGtk.cpp:
1140         (WebKit::WebContextMenuProxyGtk::cancelTracking):
1141         (WebKit::WebContextMenuProxyGtk::~WebContextMenuProxyGtk): Deleted.
1142         * UIProcess/gtk/WebContextMenuProxyGtk.h:
1143
1144 2015-08-04  Matt Rajca  <mrajca@apple.com>
1145
1146         Media Session: push paused state to the media session focus manager instead of polling
1147         https://bugs.webkit.org/show_bug.cgi?id=147633
1148
1149         Reviewed by Simon Fraser.
1150
1151         * UIProcess/WebMediaSessionFocusManager.cpp:
1152         (WebKit::WebMediaSessionFocusManager::isFocusedContentMediaElementPaused): Report whether the focused media
1153          element is currently playing. The callback is no longer necessary and will be removed in a future patch in
1154          favor of returning a value directly.
1155         (WebKit::WebMediaSessionFocusManager::mediaElementIsPlayingDidChange): Keep track of whether the focused media
1156          element is currently playing.
1157         * UIProcess/WebMediaSessionFocusManager.h:
1158         * UIProcess/WebPageProxy.cpp:
1159         (WebKit::WebPageProxy::isPlayingMediaDidChange): If the focused media element begins/ends playing, keep track
1160          of its playing state.
1161         (WebKit::WebPageProxy::isMediaElementPaused): Deleted. We now push media playback state changes instead of
1162          polling.
1163         * UIProcess/WebPageProxy.h: isPlayingMediaDidChange is now passed the ID of the media element that triggered
1164          the 'playing' state change. This can be used in conjunction with the IsSourcePlaying media flag to identify
1165          whether the source element begin/ended playing.
1166         * UIProcess/WebPageProxy.messages.in: Ditto.
1167         * WebProcess/Plugins/PluginView.cpp:
1168         (WebKit::PluginView::setPluginIsPlayingAudio): Since a media element did not trigger this, pass in 0 for the
1169          source media element.
1170         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1171         (WebKit::WebChromeClient::isPlayingMediaDidChange): isPlayingMediaDidChange is now passed the ID of the media
1172          element that triggered the 'playing' state change.
1173         * WebProcess/WebCoreSupport/WebChromeClient.h: Ditto.
1174         * WebProcess/WebPage/WebPage.cpp:
1175         (WebKit::WebPage::isMediaElementPaused): Deleted. We now push media playback state changes instead of polling.
1176         * WebProcess/WebPage/WebPage.h: Ditto.
1177         * WebProcess/WebPage/WebPage.messages.in: Ditto.
1178
1179 2015-08-05  Tim Horton  <timothy_horton@apple.com>
1180
1181         PDFPlugins are clipped in link previews (and remain so when opened)
1182         https://bugs.webkit.org/show_bug.cgi?id=147708
1183         <rdar://problem/22055130>
1184
1185         Reviewed by Simon Fraser.
1186
1187         * UIProcess/API/mac/WKView.mm:
1188         (-[WKView initWithFrame:processPool:configuration:webView:]):
1189         (-[WKView _supportsArbitraryLayoutModes]):
1190         (-[WKView _didCommitLoadForMainFrame]):
1191         (-[WKView _setLayoutMode:]):
1192         (-[WKView _setViewScale:]):
1193         Avoid using any layout mode other than "ViewSize" for main frame PluginDocuments,
1194         because they will often end up behaving incorrectly (especially with PDFPlugin,
1195         which is even more special in that it takes over application of page scale).
1196
1197         Save any incoming changes to the viewScale and layoutMode, and re-apply
1198         them once we load something in the main frame that is *not* a PluginDocument.
1199
1200         * UIProcess/API/mac/WKViewInternal.h:
1201         * WebProcess/WebPage/WebPage.cpp:
1202         (WebKit::WebPage::scalePage):
1203         Make sure to reset WebCore's page scale if the main frame contains a 
1204         PluginDocument that takes care of page scale itself.
1205
1206         (WebKit::WebPage::didCommitLoad):
1207         Do the same thing as what we do in WKView _didCommitLoadForMainFrame,
1208         but without the UI process round-trip, to avoid an ugly flash.
1209
1210         * UIProcess/WebFrameProxy.cpp:
1211         (WebKit::WebFrameProxy::didCommitLoad):
1212         * UIProcess/WebFrameProxy.h:
1213         (WebKit::WebFrameProxy::containsPluginDocument):
1214         * UIProcess/WebPageProxy.cpp:
1215         (WebKit::WebPageProxy::didCommitLoadForFrame):
1216         * UIProcess/WebPageProxy.h:
1217         * UIProcess/WebPageProxy.messages.in:
1218         * UIProcess/mac/PageClientImpl.mm:
1219         (WebKit::PageClientImpl::didCommitLoadForMainFrame):
1220         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1221         (WebKit::WebFrameLoaderClient::dispatchDidCommitLoad):
1222         Plumb and keep track of whether the main frame contains a PluginDocument or not.
1223
1224 2015-08-05  Filip Pizlo  <fpizlo@apple.com>
1225
1226         Unreviewed, roll out http://trac.webkit.org/changeset/187972.
1227
1228         * DatabaseProcess/DatabaseProcess.cpp:
1229         (WebKit::DatabaseProcess::postDatabaseTask):
1230         (WebKit::DatabaseProcess::performNextDatabaseTask):
1231         * DatabaseProcess/DatabaseProcess.h:
1232         * DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp:
1233         (WebKit::UniqueIDBDatabase::shutdown):
1234         (WebKit::UniqueIDBDatabase::postMainThreadTask):
1235         (WebKit::UniqueIDBDatabase::performNextMainThreadTask):
1236         (WebKit::UniqueIDBDatabase::postDatabaseTask):
1237         (WebKit::UniqueIDBDatabase::performNextDatabaseTask):
1238         * DatabaseProcess/IndexedDB/UniqueIDBDatabase.h:
1239         * Platform/IPC/Connection.cpp:
1240         (IPC::Connection::sendSyncMessage):
1241         (IPC::Connection::sendSyncMessageFromSecondaryThread):
1242         (IPC::Connection::waitForSyncReply):
1243         (IPC::Connection::processIncomingSyncReply):
1244         (IPC::Connection::connectionDidClose):
1245         * Platform/IPC/Connection.h:
1246         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
1247         (WebKit::CoordinatedGraphicsScene::appendUpdate):
1248         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h:
1249         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
1250         (WebKit::ThreadedCompositor::createCompositingThread):
1251         (WebKit::ThreadedCompositor::runCompositingThread):
1252         (WebKit::ThreadedCompositor::terminateCompositingThread):
1253         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:
1254         * Shared/Network/CustomProtocols/Cocoa/CustomProtocolManagerCocoa.mm:
1255         (WebKit::CustomProtocolManager::addCustomProtocol):
1256         (WebKit::CustomProtocolManager::removeCustomProtocol):
1257         (WebKit::CustomProtocolManager::registerScheme):
1258         (WebKit::CustomProtocolManager::unregisterScheme):
1259         (WebKit::CustomProtocolManager::supportsScheme):
1260         (WebKit::CustomProtocolManager::protocolForID):
1261         * Shared/Network/CustomProtocols/CustomProtocolManager.h:
1262         * Shared/linux/SeccompFilters/SeccompBroker.cpp:
1263         * WebProcess/Plugins/PluginProcessConnectionManager.cpp:
1264         (WebKit::PluginProcessConnectionManager::getPluginProcessConnection):
1265         (WebKit::PluginProcessConnectionManager::removePluginProcessConnection):
1266         (WebKit::PluginProcessConnectionManager::pluginProcessCrashed):
1267         * WebProcess/Plugins/PluginProcessConnectionManager.h:
1268         * WebProcess/WebPage/EventDispatcher.cpp:
1269         (WebKit::EventDispatcher::addScrollingTreeForPage):
1270         (WebKit::EventDispatcher::removeScrollingTreeForPage):
1271         (WebKit::EventDispatcher::wheelEvent):
1272         * WebProcess/WebPage/EventDispatcher.h:
1273         * WebProcess/soup/WebKitSoupRequestInputStream.cpp:
1274         (webkitSoupRequestInputStreamReadAsync):
1275         (webkitSoupRequestInputStreamAddData):
1276
1277 2015-08-05  Ryosuke Niwa  <rniwa@webkit.org>
1278
1279         WebInspectorProxy should make WKWebView first responder
1280         https://bugs.webkit.org/show_bug.cgi?id=147676
1281
1282         Reviewed by Timothy Hatcher.
1283
1284         Revert r181927 now that WKWebView forwards the first responder role to WKView as needed.
1285
1286         * UIProcess/mac/WebInspectorProxyMac.mm:
1287         (WebKit::WebInspectorProxy::platformBringToFront):
1288         (WebKit::WebInspectorProxy::platformAttach):
1289
1290 2015-08-04  Filip Pizlo  <fpizlo@apple.com>
1291
1292         Rename Mutex to DeprecatedMutex
1293         https://bugs.webkit.org/show_bug.cgi?id=147675
1294
1295         Reviewed by Geoffrey Garen.
1296
1297         * DatabaseProcess/DatabaseProcess.cpp:
1298         (WebKit::DatabaseProcess::postDatabaseTask):
1299         (WebKit::DatabaseProcess::performNextDatabaseTask):
1300         * DatabaseProcess/DatabaseProcess.h:
1301         * DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp:
1302         (WebKit::UniqueIDBDatabase::shutdown):
1303         (WebKit::UniqueIDBDatabase::postMainThreadTask):
1304         (WebKit::UniqueIDBDatabase::performNextMainThreadTask):
1305         (WebKit::UniqueIDBDatabase::postDatabaseTask):
1306         (WebKit::UniqueIDBDatabase::performNextDatabaseTask):
1307         * DatabaseProcess/IndexedDB/UniqueIDBDatabase.h:
1308         * Platform/IPC/Connection.cpp:
1309         (IPC::Connection::sendSyncMessage):
1310         (IPC::Connection::sendSyncMessageFromSecondaryThread):
1311         (IPC::Connection::waitForSyncReply):
1312         (IPC::Connection::processIncomingSyncReply):
1313         (IPC::Connection::connectionDidClose):
1314         * Platform/IPC/Connection.h:
1315         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
1316         (WebKit::CoordinatedGraphicsScene::appendUpdate):
1317         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h:
1318         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
1319         (WebKit::ThreadedCompositor::createCompositingThread):
1320         (WebKit::ThreadedCompositor::runCompositingThread):
1321         (WebKit::ThreadedCompositor::terminateCompositingThread):
1322         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:
1323         * Shared/Network/CustomProtocols/Cocoa/CustomProtocolManagerCocoa.mm:
1324         (WebKit::CustomProtocolManager::addCustomProtocol):
1325         (WebKit::CustomProtocolManager::removeCustomProtocol):
1326         (WebKit::CustomProtocolManager::registerScheme):
1327         (WebKit::CustomProtocolManager::unregisterScheme):
1328         (WebKit::CustomProtocolManager::supportsScheme):
1329         (WebKit::CustomProtocolManager::protocolForID):
1330         * Shared/Network/CustomProtocols/CustomProtocolManager.h:
1331         * Shared/linux/SeccompFilters/SeccompBroker.cpp:
1332         * WebProcess/Plugins/PluginProcessConnectionManager.cpp:
1333         (WebKit::PluginProcessConnectionManager::getPluginProcessConnection):
1334         (WebKit::PluginProcessConnectionManager::removePluginProcessConnection):
1335         (WebKit::PluginProcessConnectionManager::pluginProcessCrashed):
1336         * WebProcess/Plugins/PluginProcessConnectionManager.h:
1337         * WebProcess/WebPage/EventDispatcher.cpp:
1338         (WebKit::EventDispatcher::addScrollingTreeForPage):
1339         (WebKit::EventDispatcher::removeScrollingTreeForPage):
1340         (WebKit::EventDispatcher::wheelEvent):
1341         * WebProcess/WebPage/EventDispatcher.h:
1342         * WebProcess/soup/WebKitSoupRequestInputStream.cpp:
1343         (webkitSoupRequestInputStreamReadAsync):
1344         (webkitSoupRequestInputStreamAddData):
1345
1346 2015-08-05  Daniel Bates  <dabates@apple.com>
1347
1348         REGRESSION (r185111): Clicking phone numbers doesn't prompt to call sometimes
1349         https://bugs.webkit.org/show_bug.cgi?id=147678
1350         <rdar://problem/21827815>
1351
1352         Reviewed by Brady Eidson.
1353
1354         Teach WebKit to save and restore the "should open external URLs" policy.
1355
1356         * Shared/SessionState.cpp:
1357         (WebKit::isValidEnum): Added.
1358         (WebKit::PageState::encode): Modified to encode the "should open external URLs" policy.
1359         (WebKit::PageState::decode): Modified to decode the "should open external URLs" policy.
1360         * Shared/SessionState.h: Added ShouldOpenExternalURLsPolicy to PageState (defaults to WebCore::ShouldOpenExternalURLsPolicy::ShouldNotAllow).
1361         * UIProcess/API/Cocoa/WKWebView.mm:
1362         (-[WKWebView _killWebContentProcessAndResetState]): Added; used in the unit test TestWebKitAPI/Tests/WebKit2Cocoa/ShouldOpenExternalURLsInNewWindowActions.mm.
1363         * UIProcess/API/Cocoa/WKWebViewPrivate.h: Declare -[WKWebView _killWebContentProcessAndResetState].
1364         * UIProcess/mac/LegacySessionStateCoding.cpp: Defined constant sessionHistoryEntryShouldOpenExternalURLsPolicyKey.
1365         (WebKit::encodeSessionHistory): Modified to encode the "should open external URLs" policy.
1366         (WebKit::decodeSessionHistoryEntry): Modified to decode the "should open external URLs" policy.
1367         * WebProcess/WebCoreSupport/SessionStateConversion.cpp:
1368         (WebKit::toPageState): Copy "should open external URLs" policy from specified history item.
1369         (WebKit::toHistoryItem): Apply "should open external URLs" policy from PageState to HistoryItem.
1370
1371 2015-08-04  Antti Koivisto  <antti@apple.com>
1372
1373         Network cache fetches should have timeout
1374         https://bugs.webkit.org/show_bug.cgi?id=147631
1375
1376         Reviewed by Andreas Kling.
1377
1378         System might be under heavy I/O pressure. If it takes long time to get data from disk we should load from network instead.
1379
1380         This patch introduces 1.5s timeout for disk reads. If the last dispatched cache read takes longer than that we cancel all
1381         active and pending reads and just load those resources from network.
1382
1383         * NetworkProcess/cache/NetworkCacheStorage.cpp:
1384         (WebKit::NetworkCache::Storage::ReadOperation::ReadOperation):
1385         (WebKit::NetworkCache::Storage::ReadOperation::cancel):
1386         (WebKit::NetworkCache::Storage::ReadOperation::finish):
1387
1388             Factor to functions.
1389
1390         (WebKit::NetworkCache::Storage::Storage):
1391         (WebKit::NetworkCache::Storage::updateFileModificationTime):
1392         (WebKit::NetworkCache::Storage::dispatchReadOperation):
1393         (WebKit::NetworkCache::Storage::finishReadOperation):
1394         (WebKit::NetworkCache::Storage::cancelAllReadOperations):
1395         (WebKit::NetworkCache::Storage::dispatchPendingReadOperations):
1396         (WebKit::NetworkCache::Storage::dispatchPendingWriteOperations):
1397
1398             Also make dispatch functions transfer the operation ownership.
1399
1400         (WebKit::NetworkCache::shouldStoreBodyAsBlob):
1401         (WebKit::NetworkCache::Storage::dispatchWriteOperation):
1402         * NetworkProcess/cache/NetworkCacheStorage.h:
1403
1404 2015-08-04  Matt Rajca  <mrajca@apple.com>
1405
1406         Media Session: add a focus manager that WebKit clients can use to access the focused media element
1407         https://bugs.webkit.org/show_bug.cgi?id=147629
1408
1409         Reviewed by Tim Horton.
1410
1411         * Shared/API/APIObject.h: Added a new type for the focus manager.
1412         * Shared/API/c/WKBase.h: Added a new type for the focus manager.
1413         * UIProcess/API/C/WKAPICast.h: Added a new type for the focus manager.
1414         * UIProcess/API/C/WKContext.cpp: The "global" focus manager is accessed via WKContext.
1415         (WKContextGetMediaSessionFocusManager):
1416         * UIProcess/API/C/WKContext.h:
1417         * UIProcess/API/C/WKMediaSessionFocusManager.cpp: Added C wrapper for WebMediaSessionFocusManager.
1418         (WKMediaSessionFocusManagerGetTypeID):
1419         (WKMediaSessionFocusManagerIsFocusedContentMediaElementPaused):
1420         * UIProcess/API/C/WKMediaSessionFocusManager.h: Added C wrapper for WebMediaSessionFocusManager.
1421         * UIProcess/WebMediaSessionFocusManager.cpp: Added to keep track of the focused media element in the UI process and let clients query this state.
1422         (WebKit::WebMediaSessionFocusManager::supplementName):
1423         (WebKit::WebMediaSessionFocusManager::create):
1424         (WebKit::WebMediaSessionFocusManager::WebMediaSessionFocusManager):
1425         (WebKit::WebMediaSessionFocusManager::refWebContextSupplement):
1426         (WebKit::WebMediaSessionFocusManager::derefWebContextSupplement):
1427         (WebKit::WebMediaSessionFocusManager::isFocusedContentMediaElementPaused): Check if the media element on the focused page is paused.
1428         (WebKit::WebMediaSessionFocusManager::setFocusedMediaElement): Keep track of the focused page / media element pair.
1429         (WebKit::WebMediaSessionFocusManager::clearFocusedMediaElement): Reset the focused page / media element pair.
1430         * UIProcess/WebMediaSessionFocusManager.h: Added.
1431         * UIProcess/WebPageProxy.cpp:
1432         (WebKit::WebPageProxy::isMediaElementPaused): Updated to take a UnsignedCallback.
1433         (WebKit::WebPageProxy::focusedContentMediaElementDidChange): Store the focused media element in the focus manager.
1434         * UIProcess/WebPageProxy.h:
1435         * UIProcess/WebProcessPool.cpp: Added WebMediaSessionFocusManager as a supplement.
1436         * UIProcess/WebProcessPool.h: WebMediaSessionFocusManager is a supplement, so include its header.
1437         * WebKit2.xcodeproj/project.pbxproj: Added new sources and ran sort-xcode-project.
1438
1439 2015-08-04  Anders Carlsson  <andersca@apple.com>
1440
1441         Get rid of ReasonForCallingAllowPlugins since it's not used anywhere
1442         https://bugs.webkit.org/show_bug.cgi?id=147648
1443
1444         Reviewed by Andreas Kling.
1445
1446         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1447         (WebKit::WebFrameLoaderClient::objectContentType):
1448         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
1449         (WebKit::WebPlatformStrategies::getPluginInfo):
1450         * WebProcess/WebPage/WebPage.cpp:
1451         (WebKit::WebPage::createPlugin):
1452         (WebKit::WebPage::canPluginHandleResponse):
1453         (WebKit::WebPage::canShowMIMEType):
1454
1455 2015-08-04  Alexey Proskuryakov  <ap@apple.com>
1456
1457         Implement NPAPI redirect handling
1458         https://bugs.webkit.org/show_bug.cgi?id=138675
1459         rdar://problem/15779101
1460
1461         Patch by Jeffrey Pfau, updated and tweaked by me.
1462
1463         Reviewed by Anders Carlsson.
1464
1465         * PluginProcess/PluginControllerProxy.cpp:
1466         (WebKit::PluginControllerProxy::loadURL):
1467         (WebKit::PluginControllerProxy::continueStreamLoad):
1468         (WebKit::PluginControllerProxy::cancelStreamLoad):
1469         (WebKit::PluginControllerProxy::didEvaluateJavaScript):
1470         (WebKit::PluginControllerProxy::streamWillSendRequest):
1471         (WebKit::PluginControllerProxy::streamDidReceiveResponse):
1472         * PluginProcess/PluginControllerProxy.h:
1473         * PluginProcess/PluginControllerProxy.messages.in:
1474         * WebProcess/Network/WebResourceLoader.cpp:
1475         (WebKit::WebResourceLoader::willSendRequest):
1476         * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp:
1477         (WebKit::NPN_ConvertPoint):
1478         (WebKit::NPN_URLRedirectResponse):
1479         (WebKit::initializeBrowserFuncs):
1480         (WebKit::netscapeBrowserFuncs):
1481         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
1482         (WebKit::NetscapePlugin::getAuthenticationInfo):
1483         (WebKit::NetscapePlugin::registerRedirect):
1484         (WebKit::NetscapePlugin::urlRedirectResponse):
1485         (WebKit::NetscapePlugin::setIsPlayingAudio):
1486         (WebKit::NetscapePlugin::NPP_URLNotify):
1487         (WebKit::NetscapePlugin::NPP_URLRedirectNotify):
1488         (WebKit::NetscapePlugin::NPP_GetValue):
1489         (WebKit::NetscapePlugin::didEvaluateJavaScript):
1490         (WebKit::NetscapePlugin::streamWillSendRequest):
1491         (WebKit::NetscapePlugin::streamDidReceiveResponse):
1492         * WebProcess/Plugins/Netscape/NetscapePlugin.h:
1493         * WebProcess/Plugins/Netscape/NetscapePluginStream.cpp:
1494         (WebKit::NetscapePluginStream::~NetscapePluginStream):
1495         (WebKit::NetscapePluginStream::willSendRequest):
1496         (WebKit::NetscapePluginStream::didReceiveResponse):
1497         (WebKit::NetscapePluginStream::stop):
1498         (WebKit::NetscapePluginStream::setURL):
1499         (WebKit::NetscapePluginStream::cancel):
1500         * WebProcess/Plugins/Netscape/NetscapePluginStream.h:
1501         (WebKit::NetscapePluginStream::streamID):
1502         (WebKit::NetscapePluginStream::npStream):
1503         * WebProcess/Plugins/PDF/PDFPlugin.h:
1504         * WebProcess/Plugins/Plugin.h:
1505         * WebProcess/Plugins/PluginController.h:
1506         * WebProcess/Plugins/PluginProxy.cpp:
1507         (WebKit::PluginProxy::didEvaluateJavaScript):
1508         (WebKit::PluginProxy::streamWillSendRequest):
1509         (WebKit::PluginProxy::streamDidReceiveResponse):
1510         (WebKit::PluginProxy::setPluginIsPlayingAudio):
1511         (WebKit::PluginProxy::continueStreamLoad):
1512         (WebKit::PluginProxy::cancelStreamLoad):
1513         * WebProcess/Plugins/PluginProxy.h:
1514         * WebProcess/Plugins/PluginProxy.messages.in:
1515         * WebProcess/Plugins/PluginView.cpp:
1516         (WebKit::PluginView::Stream::streamID):
1517         (WebKit::PluginView::Stream::Stream):
1518         (WebKit::PluginView::Stream::cancel):
1519         (WebKit::PluginView::Stream::continueLoad):
1520         (WebKit::buildHTTPHeaders):
1521         (WebKit::lastModifiedDateMS):
1522         (WebKit::PluginView::Stream::willSendRequest):
1523         (WebKit::PluginView::Stream::didReceiveResponse):
1524         (WebKit::PluginView::cancelStreamLoad):
1525         (WebKit::PluginView::continueStreamLoad):
1526         (WebKit::PluginView::cancelManualStreamLoad):
1527         * WebProcess/Plugins/PluginView.h:
1528
1529 2015-08-04  Chris Dumez  <cdumez@apple.com>
1530
1531         Unreviewed, rolling out r187812.
1532
1533         This is not safe
1534
1535         Reverted changeset:
1536
1537         "[WK2] Reserve Vector capacity in VectorArgumentCoder<false,
1538         T, inlineCapacity>::decode()"
1539         https://bugs.webkit.org/show_bug.cgi?id=147619
1540         http://trac.webkit.org/changeset/187812
1541
1542 2015-08-03  Chris Dumez  <cdumez@apple.com>
1543
1544         [WK2] Reserve Vector capacity in VectorArgumentCoder<false, T, inlineCapacity>::decode()
1545         https://bugs.webkit.org/show_bug.cgi?id=147619
1546
1547         Reviewed by Andreas Kling.
1548
1549         Reserve Vector capacity in VectorArgumentCoder<false, T, inlineCapacity>::decode()
1550         as we know the size of the Vector in advance.
1551
1552         * Platform/IPC/ArgumentCoders.h:
1553
1554 2015-08-03  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
1555
1556         [CoordinatedGraphics] Rearrange uses of USE_COORDINATED_GRAPHICS_MULTIPROCESS
1557         https://bugs.webkit.org/show_bug.cgi?id=147256
1558
1559         Reviewed by Benjamin Poulain.
1560
1561         Reduce uses of USE_COORDINATED_GRAPHICS_MULTIPROCESS guard in order to fix build
1562         breaks when USE_COORDINATED_GRAPHICS_MULTIPROCESS is off. This is first step to switch
1563         between multiprocess model to thread model.
1564
1565         * PlatformEfl.cmake:
1566         * Shared/DrawingAreaInfo.h:
1567         * UIProcess/API/C/CoordinatedGraphics/WKView.cpp:
1568         (WKViewFindZoomableAreaForRect):
1569         * UIProcess/CoordinatedGraphics/CoordinatedDrawingAreaProxy.cpp:
1570         (WebKit::CoordinatedDrawingAreaProxy::CoordinatedDrawingAreaProxy):
1571         * UIProcess/CoordinatedGraphics/CoordinatedLayerTreeHostProxy.cpp:
1572         (WebKit::CoordinatedLayerTreeHostProxy::commitCoordinatedGraphicsState):
1573         * UIProcess/CoordinatedGraphics/CoordinatedLayerTreeHostProxy.h:
1574         * UIProcess/CoordinatedGraphics/PageViewportController.cpp:
1575         (WebKit::PageViewportController::pageTransitionViewportReady):
1576         * UIProcess/CoordinatedGraphics/WebPageProxyCoordinatedGraphics.cpp:
1577         * UIProcess/CoordinatedGraphics/WebView.cpp:
1578         * UIProcess/CoordinatedGraphics/WebView.h:
1579         * UIProcess/WebPageProxy.cpp:
1580         (WebKit::WebPageProxy::commitPageTransitionViewport):
1581         * UIProcess/WebPageProxy.h:
1582         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedDrawingArea.cpp:
1583         (WebKit::CoordinatedDrawingArea::CoordinatedDrawingArea):
1584         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedDrawingArea.h:
1585         * WebProcess/WebPage/CoordinatedGraphics/WebPageCoordinatedGraphics.cpp:
1586         * WebProcess/WebPage/DrawingAreaImpl.cpp:
1587         (WebKit::DrawingAreaImpl::DrawingAreaImpl):
1588         * WebProcess/WebPage/DrawingAreaImpl.h:
1589         * WebProcess/WebPage/LayerTreeHost.cpp:
1590         (WebKit::LayerTreeHost::create):
1591         * WebProcess/WebPage/WebPage.cpp:
1592         (WebKit::WebPage::sendViewportAttributesChanged):
1593         (WebKit::WebPage::pageDidRequestScroll):
1594         * WebProcess/WebPage/WebPage.h:
1595         * WebProcess/WebPage/WebPage.messages.in:
1596
1597 2015-08-03  Matt Rajca  <mrajca@apple.com>
1598
1599         Media Session: let UI clients query whether a media element is paused
1600         https://bugs.webkit.org/show_bug.cgi?id=147588
1601
1602         Reviewed by Tim Horton.
1603
1604         Added plumbing to determine if a page's media element is paused.
1605
1606         * UIProcess/WebPageProxy.cpp:
1607         (WebKit::WebPageProxy::isMediaElementPaused):
1608         * UIProcess/WebPageProxy.h:
1609         * WebProcess/WebPage/WebPage.cpp:
1610         (WebKit::WebPage::isMediaElementPaused):
1611         * WebProcess/WebPage/WebPage.h:
1612         * WebProcess/WebPage/WebPage.messages.in:
1613
1614 2015-08-03  Chris Dumez  <cdumez@apple.com>
1615
1616         Make sure error handling code APIUserContentExtensionStore closes open file descriptors
1617         https://bugs.webkit.org/show_bug.cgi?id=147562
1618
1619         Reviewed by Alex Christensen.
1620
1621         Make sure error handling code APIUserContentExtensionStore closes open
1622         file descriptors to avoid leaking them.
1623
1624         * NetworkProcess/cache/NetworkCacheData.cpp:
1625         (WebKit::NetworkCache::adoptAndMapFile):
1626         * UIProcess/API/APIUserContentExtensionStore.cpp:
1627         (API::compiledToFile):
1628
1629 2015-08-03  Beth Dakin  <bdakin@apple.com>
1630
1631         Need WKWebView API to enable/disable link preview
1632         https://bugs.webkit.org/show_bug.cgi?id=147573
1633         -and corresponding-
1634         rdar://problem/22077836
1635
1636         Reviewed by Dan Bernstein.
1637
1638         WKView implementation.
1639         * UIProcess/API/Cocoa/WKViewPrivate.h:
1640
1641         New API. Call into WKView to handle Mac.
1642         * UIProcess/API/Cocoa/WKWebView.h:
1643         * UIProcess/API/Cocoa/WKWebView.mm:
1644         (-[WKWebView initWithFrame:configuration:]):
1645         (-[WKWebView allowsLinkPreview]):
1646         (-[WKWebView setAllowsLinkPreview:]):
1647
1648         Remove the SPI declaration from WKWebViewPrivate in order to make this API.
1649         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1650
1651         Handle the Mac side.
1652         * UIProcess/API/mac/WKView.mm:
1653         (-[WKView viewDidMoveToWindow]):
1654         (-[WKView initWithFrame:processPool:configuration:webView:]):
1655         (-[WKView allowsBackForwardNavigationGestures]):
1656         (-[WKView allowsLinkPreview]):
1657         (-[WKView setAllowsLinkPreview:]):
1658
1659         Don’t register previews when link preview is prevented.
1660         * UIProcess/ios/WKContentViewInteraction.mm:
1661         (-[WKContentView _registerPreview]):
1662
1663 2015-08-03  Tim Horton  <timothy_horton@apple.com>
1664
1665         [iOS] Link previews sometimes don't hide the link highlight
1666         https://bugs.webkit.org/show_bug.cgi?id=147585
1667         <rdar://problem/22119648>
1668
1669         Reviewed by Beth Dakin.
1670
1671         * UIProcess/ios/WKContentViewInteraction.mm:
1672         (-[WKContentView _interactionStartedFromPreviewItemController:]):
1673         (-[WKContentView _interactionStoppedFromPreviewItemController:]):
1674         (-[WKContentView _previewItemController:didDismissPreview:committing:]):
1675         (-[WKContentView _previewItemController:willPresentPreview:forPosition:inSourceView:]): Deleted.
1676         Use interactionStarted/Stopped, which are always called, instead of didDismiss/willPresent,
1677         which are only called if we return a custom view controller from _presentedViewControllerForPreviewItemController.
1678         We continue using didDismiss to inform clients of dismissal because they'll
1679         only care if they customized the view controller.
1680
1681 2015-08-03  Chris Dumez  <cdumez@apple.com>
1682
1683         [WK2][NetworkCache] Do not munmap() on the main thread
1684         https://bugs.webkit.org/show_bug.cgi?id=147569
1685
1686         Reviewed by Geoffrey Garen.
1687
1688         Do not munmap() on the main thread for performance reasons and
1689         consistency as we already make sure to mmap() on another thread.
1690
1691         * NetworkProcess/cache/NetworkCacheDataCocoa.mm:
1692         (WebKit::NetworkCache::Data::adoptMap):
1693
1694 2015-08-03  Wenson Hsieh  <wenson_hsieh@apple.com>
1695
1696         Inputs with the autofocus attribute cause the keyboard to not deploy
1697         https://bugs.webkit.org/show_bug.cgi?id=147555
1698         <rdar://problem/22018044>
1699
1700         Reviewed by Andreas Kling.
1701
1702         Upon submitting a form by pressing "Go" on the keyboard, an <input> on the next page with the
1703         autofocus attribute may become non-interactible. When attempting to tap on the input, nothing
1704         seems to happen. This is because the state of WebPage upon invoking WebPage::elementDidFocus
1705         indicates (incorrectly) that the input element is already focused, and therefore hits an early
1706         return. To solve this, we explicitly reset m_hasFocusedDueToUserInteraction upon transitioning
1707         to a new page.
1708
1709         * WebProcess/WebPage/WebPage.cpp:
1710         (WebKit::WebPage::didStartPageTransition): On iOS, resets m_hasFocusedDueToUserInteraction as
1711             well. It was previously thought that this would be handled by blur() called on the assisted
1712             element when submitting a form. However, pressing "Go" on the iOS keyboard is an implicit
1713             submission and does not trigger a blur event.
1714
1715 2015-08-03  Chris Dumez  <cdumez@apple.com>
1716
1717         Fix error handling case in Cache::dumpContentsToFile()
1718         https://bugs.webkit.org/show_bug.cgi?id=147567
1719
1720         Reviewed by Andreas Kling.
1721
1722         Cache::dumpContentsToFile() was expecting openFile() to return 0 in case
1723         of error. However, it returns invalidPlatformFileHandle, which is -1 on
1724         Unix.
1725
1726         * NetworkProcess/cache/NetworkCache.cpp:
1727         (WebKit::NetworkCache::Cache::dumpContentsToFile):
1728
1729 2015-08-03  Chris Dumez  <cdumez@apple.com>
1730
1731         Make sure WebMemorySampler doesn't leak file descriptor
1732         https://bugs.webkit.org/show_bug.cgi?id=147564
1733
1734         Reviewed by Anders Carlsson.
1735
1736         WebMemorySampler was opening files but never closing them.
1737
1738         * Shared/WebMemorySampler.cpp:
1739         (WebKit::WebMemorySampler::stop):
1740         * Shared/WebMemorySampler.h:
1741
1742 2015-08-03  Carlos Garcia Campos  <cgarcia@igalia.com>
1743
1744         Unreviewed. Update OptionsGTK.cmake and NEWS for 2.9.5 release.
1745
1746         * gtk/NEWS: Add release notes for 2.9.5.
1747
1748 2015-07-27  Matt Rajca  <mrajca@apple.com>
1749
1750         Media Session: inform the UI process when the focused Content media element changes
1751         https://bugs.webkit.org/show_bug.cgi?id=147323
1752
1753         Reviewed by Tim Horton.
1754
1755         * UIProcess/WebPageProxy.cpp:
1756         (WebKit::WebPageProxy::isPlayingMediaDidChange):
1757         * UIProcess/WebPageProxy.h:
1758         * UIProcess/WebPageProxy.messages.in:
1759         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1760         (WebKit::WebChromeClient::focusedContentMediaElementDidChange):
1761         * WebProcess/WebCoreSupport/WebChromeClient.h:
1762
1763 2015-07-31  Chris Dumez  <cdumez@apple.com>
1764
1765         Drop dummy Timer callbacks
1766         https://bugs.webkit.org/show_bug.cgi?id=147516
1767
1768         Reviewed by Alexey Proskuryakov.
1769
1770         Drop dummy Timer callbacks in the code base. A lot of Timer callbacks
1771         do nothing else beside calling a particular method. In such case, we
1772         can use the called method as Timer callback instead.
1773
1774         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
1775         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
1776         (WebKit::RemoteLayerTreeDrawingArea::RemoteLayerTreeDrawingArea):
1777         (WebKit::RemoteLayerTreeDrawingArea::layerFlushTimerFired): Deleted.
1778
1779 2015-07-31  Chris Dumez  <cdumez@apple.com>
1780
1781         [WK2][NetworkCache] Drop HTTP method from NetworkCache::Key
1782         https://bugs.webkit.org/show_bug.cgi?id=143348
1783
1784         Reviewed by Antti Koivisto.
1785
1786         Drop HTTP method from NetworkCache::Key as we only cache GET responses
1787         for now. Even when we start caching HEAD responses, we likely will not
1788         want the method to be part of the key because:
1789         - A HEAD response can be used to update the headers of a previously cached response to GET
1790         - A cached GET response may be used to satisfy subsequent HEAD requests
1791
1792         * NetworkProcess/cache/NetworkCache.cpp:
1793         (WebKit::NetworkCache::makeCacheKey):
1794         * NetworkProcess/cache/NetworkCacheKey.cpp:
1795         (WebKit::NetworkCache::Key::Key):
1796         (WebKit::NetworkCache::Key::operator==):
1797         (WebKit::NetworkCache::Key::decode):
1798         (WebKit::NetworkCache::Key::operator=): Deleted.
1799         (WebKit::NetworkCache::Key::computeHash): Deleted.
1800         (WebKit::NetworkCache::Key::encode): Deleted.
1801         * NetworkProcess/cache/NetworkCacheKey.h:
1802         (WebKit::NetworkCache::Key::method): Deleted.
1803
1804 2015-07-31  Chris Dumez  <cdumez@apple.com>
1805
1806         Coalesce concurrent authentication challenges for the same ProtectionSpace
1807         https://bugs.webkit.org/show_bug.cgi?id=147496
1808         <rdar://problem/16839069>
1809
1810         Reviewed by Alexey Proskuryakov.
1811
1812         Coalesce concurrent authentication challenges for the same ProtectionSpace.
1813         Ideally, this would be done in the network layer but short term, this will
1814         make sure the user no longer gets repeating authentication dialogs for the
1815         same protection space.
1816
1817         This gets rid of a long-standing bug in WebKit / Safari where visiting a
1818         site using HTTP authentication would pop up one authentication dialog for
1819         each subresource being loaded from the network (especially when the main
1820         resource is loaded from the cache).
1821
1822         * Shared/Authentication/AuthenticationManager.cpp:
1823         (WebKit::canCoalesceChallenge):
1824         (WebKit::AuthenticationManager::addChallengeToChallengeMap):
1825         (WebKit::AuthenticationManager::shouldCoalesceChallenge):
1826         (WebKit::AuthenticationManager::coalesceChallengesMatching):
1827         (WebKit::AuthenticationManager::didReceiveAuthenticationChallenge):
1828         (WebKit::AuthenticationManager::useCredentialForChallenge):
1829         (WebKit::AuthenticationManager::useCredentialForSingleChallenge):
1830         (WebKit::AuthenticationManager::continueWithoutCredentialForChallenge):
1831         (WebKit::AuthenticationManager::continueWithoutCredentialForSingleChallenge):
1832         (WebKit::AuthenticationManager::cancelChallenge):
1833         (WebKit::AuthenticationManager::cancelSingleChallenge):
1834         (WebKit::AuthenticationManager::performDefaultHandling):
1835         (WebKit::AuthenticationManager::performDefaultHandlingForSingleChallenge):
1836         (WebKit::AuthenticationManager::rejectProtectionSpaceAndContinue):
1837         (WebKit::AuthenticationManager::rejectProtectionSpaceAndContinueForSingleChallenge):
1838         (WebKit::AuthenticationManager::AuthenticationManager): Deleted.
1839         * Shared/Authentication/AuthenticationManager.h:
1840
1841 2015-07-31  Joseph Pecoraro  <pecoraro@apple.com>
1842
1843         Unreviewed parameter name typo fix.
1844
1845         * UIProcess/API/Cocoa/WKPreferences.mm:
1846         (-[WKPreferences _setHiddenPageDOMTimerThrottlingEnabled:]):
1847
1848 2015-07-31  Carlos Garcia Campos  <cgarcia@igalia.com>
1849
1850         [GTK] NPAPI code crashes on Wayland
1851         https://bugs.webkit.org/show_bug.cgi?id=147297
1852
1853         Reviewed by Žan Doberšek.
1854
1855         Do not crete NPAPI plugins when runing on Wayland, since they are
1856         not supported. ENABLE_NETSCAPE_PLUGIN_API option used to be
1857         incompatible with building with the Wayland target, but now that
1858         we allow to build X11 and Wayland targets at the same time, we
1859         need runtime checks to avoid creating NPAPI plugins in Wayland.
1860
1861         * UIProcess/API/gtk/WebKitSettings.cpp:
1862         (webkit_settings_set_enable_plugins): Do not allow to change the
1863         setting when running in Wayland.
1864         * UIProcess/gtk/WebPreferencesGtk.cpp:
1865         (WebKit::WebPreferences::platformInitializeStore): Initialize
1866         EnablePlugins preference to false when running in Wayland.
1867
1868 2015-07-30  Joseph Pecoraro  <pecoraro@apple.com>
1869
1870         LayoutTests/inspector frequently run slow and timeout when run in WebKit2 but not WebKit1
1871         https://bugs.webkit.org/show_bug.cgi?id=147456
1872
1873         Reviewed by Timothy Hatcher.
1874
1875         By default, WebKit2 WebPage's on PLATFORM(COCOA) enabling DOM Timer
1876         throttling. Under testing, this ends up impacting Web Inspector
1877         tests that create their own WKWebView which never gets displayed
1878         and so gets throttled. Disable throttling on the Inspector's view
1879         during testing.
1880
1881         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
1882         * UIProcess/API/Cocoa/WKPreferences.mm:
1883         (-[WKPreferences _hiddenPageDOMTimerThrottlingEnabled]):
1884         (-[WKPreferences _setHiddenPageDOMTimerThrottlingEnabled:]):
1885         SPI to toggle DOM timer throttling.
1886
1887         * UIProcess/WebInspectorProxy.cpp:
1888         (WebKit::WebInspectorProxy::createInspectorPage):
1889         * UIProcess/WebInspectorProxy.h:
1890         (WebKit::WebInspectorProxy::isUnderTest):
1891         Provide a way to get if we are under test, and set it before
1892         calling into the platform method.
1893
1894         * UIProcess/mac/WebInspectorProxyMac.mm:
1895         (WebKit::WebInspectorProxy::platformCreateInspectorPage):
1896         When testing, disable timer throttling.
1897
1898 2015-07-30  Eric Carlson  <eric.carlson@apple.com>
1899
1900         [iOS] Set AirPlay discovery mode to disabled when page is hidden
1901         https://bugs.webkit.org/show_bug.cgi?id=147455
1902
1903         Reviewed by Enrica Casucci.
1904
1905         * UIProcess/ios/forms/WKAirPlayRoutePicker.mm:
1906         (-[WKAirPlayRoutePicker _dismissAirPlayRoutePickerIPad]): Set discovery mode to disabled after
1907           the picker has been closed.
1908         (-[WKAirPlayRoutePicker showAirPlayPickerIPhone:]): Ditto.
1909
1910 2015-07-29  Dean Jackson  <dino@apple.com>
1911
1912         Don't use (Details) when exposing SPI
1913         https://bugs.webkit.org/show_bug.cgi?id=147426
1914         <rdar://problem/22062407>
1915
1916         Reviewed by Dan Bernstein.
1917
1918         If we are declaring the interface without any implementation,
1919         we should use class extensions.
1920
1921         * Platform/spi/ios/AssertionServicesSPI.h:
1922         * Platform/spi/ios/CorePDFSPI.h:
1923         * Platform/spi/ios/DataDetectorsUISPI.h:
1924         * Platform/spi/ios/ManagedConfigurationSPI.h:
1925         * Platform/spi/ios/UIKitSPI.h:
1926         * Shared/API/Cocoa/WKRemoteObjectCoder.mm:
1927         * Shared/Network/CustomProtocols/Cocoa/CustomProtocolManagerCocoa.mm:
1928         * UIProcess/_WKWebViewPrintFormatter.mm:
1929         * UIProcess/mac/WebPageProxyMac.mm:
1930
1931 2015-07-30  Chris Dumez  <cdumez@apple.com>
1932
1933         [WK2][NetworkCache] Stop closing files on the main thread
1934         https://bugs.webkit.org/show_bug.cgi?id=147410
1935
1936         Reviewed by Andreas Kling.
1937
1938         After r186510, we no longer open cache files on the main thread.
1939         However, we still close them on the main thread. This patch makes
1940         sure we close the files on another thread instead.
1941
1942         * NetworkProcess/cache/NetworkCacheIOChannelCocoa.mm:
1943         (WebKit::NetworkCache::IOChannel::IOChannel):
1944
1945 2015-07-30  Simon Fraser  <simon.fraser@apple.com>
1946
1947         Convert Path applier to use std::function
1948         https://bugs.webkit.org/show_bug.cgi?id=147368
1949
1950         Reviewed by Sam Weinig.
1951
1952         Use std::function for Path::apply().
1953
1954         * Shared/WebCoreArgumentCoders.cpp:
1955         (IPC::pathEncodeApplierFunction):
1956         (IPC::ArgumentCoder<Path>::encode):
1957         (IPC::pathPointCountApplierFunction): Deleted.
1958
1959 2015-07-30  Joonghun Park  <jh718.park@samsung.com>
1960
1961         [EFL] Enable IndexedDB based on DatabaseProcess
1962         https://bugs.webkit.org/show_bug.cgi?id=147221
1963
1964         Reviewed by Csaba Osztrogonác.
1965
1966         * DatabaseProcess/efl/DatabaseProcessMainEfl.cpp: Add ecore_init().
1967         Without this call, it leads to crash when launching DatabaseProcess.
1968         * PlatformEfl.cmake: Add missing include_directory.
1969         * Shared/efl/ProcessExecutablePathEfl.cpp:
1970         (WebKit::executablePathOfDatabaseProcess):
1971         * UIProcess/Launcher/efl/ProcessLauncherEfl.cpp:
1972         (WebKit::ProcessLauncher::launchProcess):
1973         * UIProcess/efl/WebProcessPoolEfl.cpp:
1974         (WebKit::WebProcessPool::legacyPlatformDefaultIndexedDBDatabaseDirectory):
1975         Add default path for indexedDB sqlite3 db file.
1976
1977 2015-07-30  Chris Dumez  <cdumez@apple.com>
1978
1979         Minimize children vector capacity changes in PlatformCALayerRemote::recursiveBuildTransaction()
1980         https://bugs.webkit.org/show_bug.cgi?id=147446
1981
1982         Reviewed by Simon Fraser.
1983
1984         Minimize children vector capacity changes in PlatformCALayerRemote::recursiveBuildTransaction()
1985         by leveraging the fact that we know in advance how many layer IDs are going to be added. We
1986         now set the Vector size from the start, instead of clearing it and then growing the vector
1987         capacity when appending the layer IDs one by one.
1988
1989         * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
1990         (WebKit::PlatformCALayerRemote::recursiveBuildTransaction):
1991
1992 2015-07-30  Chris Dumez  <cdumez@apple.com>
1993
1994         Mark more classes as fast allocated
1995         https://bugs.webkit.org/show_bug.cgi?id=147440
1996
1997         Reviewed by Sam Weinig.
1998
1999         Mark more classes as fast allocated for performance. We heap-allocate
2000         objects of those types throughout the code base.
2001
2002         * NetworkProcess/cache/NetworkCacheStorage.cpp:
2003         * NetworkProcess/cache/NetworkCacheStorage.h:
2004         * Platform/IPC/MessageRecorder.h:
2005         * Platform/mac/LayerHostingContext.h:
2006
2007 2015-07-29  Andy VanWagoner  <thetalecrafter@gmail.com>
2008
2009         Implement basic types for ECMAScript Internationalization API
2010         https://bugs.webkit.org/show_bug.cgi?id=146926
2011
2012         Reviewed by Benjamin Poulain.
2013
2014         * Configurations/FeatureDefines.xcconfig: Enabled INTL.
2015
2016 2015-07-29  Chris Dumez  <cdumez@apple.com>
2017
2018         [WK2] Use FastMalloc in IPC::MessageDecoder
2019         https://bugs.webkit.org/show_bug.cgi?id=147425
2020
2021         Reviewed by Sam Weinig.
2022
2023         Use FastMalloc in IPC::MessageDecoder instead of system malloc, for
2024         performance reasons and consistency.
2025
2026         * Platform/IPC/ArgumentDecoder.cpp:
2027         (IPC::ArgumentDecoder::~ArgumentDecoder):
2028         (IPC::ArgumentDecoder::initialize):
2029
2030 2015-07-29  Enrica Casucci  <enrica@apple.com>
2031
2032         Preview should not start if touch handler prevents default.
2033         https://bugs.webkit.org/show_bug.cgi?id=147423
2034         rdar://problem/22061043
2035
2036         Reviewed by Tim Horton.
2037
2038         We need to check if _highlightLongPressCanClick has not been reset before
2039         we allow the preview. It can be reset by a touch handler preventing default.
2040
2041         * UIProcess/ios/WKContentViewInteraction.mm:
2042         (-[WKContentView _interactionShouldBeginFromPreviewItemController:forPosition:]):
2043
2044 2015-07-29  Chris Fleizach  <cfleizach@apple.com>
2045
2046         AX: iOS: VoiceOver hangs indefinitely when an JS alert appears
2047         https://bugs.webkit.org/show_bug.cgi?id=147386
2048
2049         Reviewed by Dan Bernstein.
2050
2051         Make sure this also builds on iOS8.
2052
2053         * Platform/IPC/mac/ConnectionMac.mm:
2054
2055 2015-07-29  Michael Catanzaro  <mcatanzaro@igalia.com>
2056
2057         [Seccomp] Further improvements to default web process policy
2058         https://bugs.webkit.org/show_bug.cgi?id=142987
2059
2060         Provide various helper functions to allow more flexible construction of
2061         filesystem access policies.
2062
2063         Reviewed by Žan Doberšek.
2064
2065         Improve the policy. Also, remove ifdefs to reduce potential for breakage in non-default
2066         configurations.
2067
2068         * Shared/linux/SeccompFilters/SyscallPolicy.cpp:
2069         (WebKit::SyscallPolicy::addDefaultWebProcessPolicy):
2070
2071 2015-07-29  Chris Dumez  <cdumez@apple.com>
2072
2073         Avoid unnecessarily constructing PlatformMediaSessionManager on Document destruction
2074         https://bugs.webkit.org/show_bug.cgi?id=147398
2075
2076         Reviewed by Jer Noble.
2077
2078         Only call PlatformMediaSessionManager::stopAllMediaPlaybackForProcess() in
2079         destructors if an PlatformMediaSessionManager instance already exists, to 
2080         avoid constructing one unecessarily at that point.
2081
2082         * WebProcess/WebProcess.cpp:
2083         (WebKit::WebProcess::didClose):
2084
2085 2015-07-28  Carlos Garcia Campos  <cgarcia@igalia.com>
2086
2087         [GTK] Add API to set the maximum number of web processes per WebKitWebContext
2088         https://bugs.webkit.org/show_bug.cgi?id=147108
2089
2090         Reviewed by Gustavo Noronha Silva.
2091
2092         * UIProcess/API/gtk/WebKitWebContext.cpp:
2093         (webkit_web_context_set_web_process_count_limit):
2094         (webkit_web_context_get_web_process_count_limit):
2095         * UIProcess/API/gtk/WebKitWebContext.h:
2096         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
2097
2098 2015-07-28  Carlos Garcia Campos  <cgarcia@igalia.com>
2099
2100         [GTK] Fix empty space in popup menus when first item is selected
2101         https://bugs.webkit.org/show_bug.cgi?id=147358
2102
2103         Reviewed by Martin Robinson.
2104
2105         It happens when one of the first elements are selected, because we
2106         try to center the current selection on the combo element. When the
2107         menu is large enough to make the element centered we need to leave
2108         empty space at the beginning. This can be fixed by not scrolling
2109         to center the selected item when it's above the combo
2110         element. This ensure the selected item will always be visible,
2111         even if it's not centered. If the selected item is already
2112         centered or below the combo element, the behaviour doesn't change
2113         and we scroll to center it.
2114
2115         * UIProcess/gtk/WebPopupMenuProxyGtk.cpp:
2116         (WebKit::WebPopupMenuProxyGtk::showPopupMenu):
2117
2118 2015-07-28  Jincheol Jo  <jincheol.jo@navercorp.com>
2119
2120         [EFL] Fix typos in ewk_extension.cpp
2121         https://bugs.webkit.org/show_bug.cgi?id=147396
2122
2123         Reviewed by Gyuyoung Kim.
2124
2125         Fix from toEwkExtendion to toEwkExtension.
2126
2127         * WebProcess/InjectedBundle/API/efl/ewk_extension.cpp:
2128         (toEwkExtension):
2129         (EwkExtension::didCreatePage):
2130         (EwkExtension::willDestroyPage):
2131         (EwkExtension::didReceiveMessage):
2132         (toEwkExtendion): Deleted.
2133
2134 2015-07-28  Alexey Proskuryakov  <ap@apple.com>
2135
2136         Clean up usesAsyncCallbacks handling in ResourceHandle
2137         https://bugs.webkit.org/show_bug.cgi?id=147342
2138
2139         Reviewed by Darin Adler.
2140
2141         Update for a renaming in WebCore.
2142
2143         * NetworkProcess/NetworkResourceLoader.cpp:
2144         (WebKit::NetworkResourceLoader::cleanup):
2145         * Shared/Downloads/soup/DownloadSoup.cpp:
2146         (WebKit::Download::platformInvalidate):
2147
2148 2015-07-28  Chris Fleizach  <cfleizach@apple.com>
2149
2150         AX: iOS: VoiceOver hangs indefinitely when an JS alert appears
2151         https://bugs.webkit.org/show_bug.cgi?id=147386
2152
2153         Reviewed by Anders Carlsson.
2154
2155         Support the iOS platform API to notify accessibility clients when the WebProcess is about to suspend (because of some modal dialog).
2156         Luckily, we did all the hardwork for OSX a few years ago to support this paradigm.         
2157
2158         * Platform/IPC/mac/ConnectionMac.mm:
2159         (IPC::AccessibilityProcessSuspendedNotification):
2160         (IPC::Connection::willSendSyncMessage):
2161         (IPC::Connection::didReceiveSyncReply):
2162
2163 2015-07-28  Yusuke Suzuki  <utatane.tea@gmail.com>
2164
2165         [ES6] Add ENABLE_ES6_MODULES compile time flag with the default value "false"
2166         https://bugs.webkit.org/show_bug.cgi?id=147350
2167
2168         Reviewed by Sam Weinig.
2169
2170         * Configurations/FeatureDefines.xcconfig:
2171
2172 2015-07-28  Said Abou-Hallawa  <sabouhallawa@apple.com>
2173
2174         [iOS] REGRESSION(r168075): Fullscreen web video doesn't pause on screen lock
2175         https://bugs.webkit.org/show_bug.cgi?id=147269
2176
2177         Reviewed by Andreas Kling.
2178
2179         Media elements should pause when the application is going to EnterBackground
2180         under lock regardless whether it is in full screen or not.
2181
2182         * Platform/spi/ios/UIKitSPI.h: Forward declare [UIApplication isSuspendedUnderLock].
2183
2184         * UIProcess/ios/WebPageProxyIOS.mm:
2185         (WebKit::WebPageProxy::applicationDidEnterBackground):
2186         [UIApp isSuspendedUnderLock] can only be called in the UIProcess. We need
2187         to call it here and pass it to the WebPage in the WebProcess as part of the
2188         ApplicationDidEnterBackground message.
2189         
2190         * WebProcess/WebPage/WebPage.h:
2191         * WebProcess/WebPage/WebPage.messages.in: Add the new parameter:
2192         'isSuspendedUnderLock' to the ApplicationDidEnterBackground message.
2193         
2194         * WebProcess/WebPage/ios/WebPageIOS.mm:
2195         (WebKit::WebPage::applicationDidEnterBackground): On iOS, the WebPage needs
2196         to notify the MediaSessionManagerIOS that it received the message 
2197         ApplicationDidEnterBackground.
2198
2199 2015-07-28  Yongjun Zhang  <yongjun_zhang@apple.com>
2200
2201         Bounds in InteractionInformationAtPosition should be always in main frame coordinate space.
2202         https://bugs.webkit.org/show_bug.cgi?id=147372
2203
2204         When we prepare the bounds for InteractionInformationAtPosition, we should convert the rect to
2205         main frame space since WKContent in UIProcess expects it to be in the web view space.
2206
2207         Reviewed by Tim Horton.
2208
2209         * WebProcess/WebPage/ios/WebPageIOS.mm:
2210         (WebKit::WebPage::getPositionInformation): Convert the bounding rect to main frame space if the element is inside a sub-frame.
2211
2212 2015-07-27  Simon Fraser  <simon.fraser@apple.com>
2213
2214         PathApplierFunction should take a reference to a PathElement
2215         https://bugs.webkit.org/show_bug.cgi?id=147337
2216
2217         Reviewed by Dan Bates.
2218
2219         Convert PathApplierFunction to take a const PathElement&, since it can never be null.
2220
2221         * Shared/WebCoreArgumentCoders.cpp:
2222         (IPC::pathPointCountApplierFunction):
2223         (IPC::pathEncodeApplierFunction):
2224
2225 2015-07-28  Jer Noble  <jer.noble@apple.com>
2226
2227         [iOS] Notify fullscreen controller in UIProcess whether external playback is allowed
2228         https://bugs.webkit.org/show_bug.cgi?id=147343
2229
2230         Reviewed by Brady Eidson.
2231
2232         Pass the boolean property wirelessVideoPlaybackDisabled across the UIProcess/WebProcess boundary.
2233
2234         * UIProcess/ios/WebVideoFullscreenManagerProxy.mm:
2235         (WebKit::WebVideoFullscreenManagerProxy::setWirelessVideoPlaybackDisabled):
2236         * WebProcess/ios/WebVideoFullscreenManager.mm:
2237         (WebKit::WebVideoFullscreenInterfaceContext::setWirelessVideoPlaybackDisabled):
2238         (WebKit::WebVideoFullscreenManager::WebVideoFullscreenManager):
2239         (WebKit::WebVideoFullscreenManager::setWirelessVideoPlaybackDisabled):
2240
2241 2015-07-28  Carlos Garcia Campos  <cgarcia@igalia.com>
2242
2243         [GTK] Use fastMalloc instead of g_slice
2244         https://bugs.webkit.org/show_bug.cgi?id=147357
2245
2246         Reviewed by Sergio Villar Senin.
2247
2248         The use of g_slice is no longer encouraged by glib developers.
2249
2250         * UIProcess/API/gtk/WebKitCredential.cpp:
2251         (webkitCredentialCreate):
2252         (webkit_credential_free):
2253         * UIProcess/API/gtk/WebKitJavascriptResult.cpp:
2254         (webkitJavascriptResultCreate):
2255         (webkit_javascript_result_unref):
2256         * UIProcess/API/gtk/WebKitMimeInfo.cpp:
2257         (webkitMimeInfoCreate):
2258         (webkit_mime_info_unref):
2259         * UIProcess/API/gtk/WebKitNavigationAction.cpp:
2260         (webkitNavigationActionCreate):
2261         (webkit_navigation_action_copy):
2262         (webkit_navigation_action_free):
2263         * UIProcess/API/gtk/WebKitPrivate.h:
2264         * UIProcess/API/gtk/WebKitScriptDialog.cpp:
2265         (webkitScriptDialogCopy):
2266         (webkitScriptDialogFree):
2267         * UIProcess/API/gtk/WebKitUserContent.cpp:
2268         (webkit_user_style_sheet_unref):
2269         (webkit_user_style_sheet_new):
2270         (webkit_user_script_unref):
2271         (webkit_user_script_new):
2272
2273 2015-07-27  Dan Bernstein  <mitz@apple.com>
2274
2275         [iOS] REGRESSION (r187376): Form editing buttons are missing from the Shortcut Bar
2276         https://bugs.webkit.org/show_bug.cgi?id=147351
2277
2278         Reviewed by Adele Peterson.
2279
2280         We were relying on -[WKContentView inputAccessoryView] getting called to initialize the form
2281         accessory view, even when that method would always return nil, as it does on iPad. After
2282         r187376, that method changed to initializing the view only when returning it, which caused
2283         this bug.
2284
2285         * UIProcess/ios/WKContentViewInteraction.mm:
2286         (-[WKContentView _displayFormNodeInputView]): Call the new -_ensureFormAccessoryView from
2287         here, when we are going to need the view.
2288         (-[WKContentView _ensureFormAccessoryView]): Moved initialization code from
2289         -inputAccessoryView here, and removed outdated +instancesRespondToSelector: check.
2290         (-[WKContentView inputAccessoryView]): Now calls through -formAccessoryView.
2291         (-[WKContentView formAccessoryView]): Added call to -_ensureFormAccessoryView here.
2292
2293 2015-07-27  Andreas Kling  <akling@apple.com>
2294
2295         WebsiteDataStore should clean up its storage in the network process when destroyed.
2296         <https://webkit.org/b/147349>
2297         <rdar://problem/21838764>
2298
2299         Reviewed by Darin Adler.
2300
2301         Have ~WebsiteDataStore() send a DestroyPrivateBrowsingSession message to all networking processes
2302         for ephemeral sessions. This plugs a NetworkStorageSession leak that could retain a large
2303         CFNetwork object graph.
2304
2305         This complements r187115 which did the same for network process storage owned by
2306         API::Session objects.
2307
2308         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2309         (WebKit::WebsiteDataStore::~WebsiteDataStore):
2310
2311 2015-07-27  Tim Horton  <timothy_horton@apple.com>
2312
2313         First in-window viewStateChange synchronously blocks despite not previously being in-window
2314         https://bugs.webkit.org/show_bug.cgi?id=147344
2315         <rdar://problem/22021772>
2316
2317         Reviewed by Simon Fraser.
2318
2319         * UIProcess/WebPageProxy.cpp:
2320         (WebKit::WebPageProxy::updateViewState):
2321         (WebKit::WebPageProxy::dispatchViewStateChange):
2322         The whole point of m_viewWasEverInWindow was so that we would not
2323         synchronously wait when a view was added to a window for the first time,
2324         only all subsequent times.
2325
2326         However, since m_viewWasEverInWindow was being set *before* being
2327         checked in dispatchViewStateChange, we were always blocking. This is
2328         a huge waste of main-thread time, because there's no reason to wait
2329         for the first paint if you've never seen the view before (and shouldn't
2330         expect it to have content).
2331
2332         Instead, set the flag after dispatching a view state change, so it becomes
2333         "have we ever sent a view state with IsInWindow set" instead.
2334
2335 2015-07-27  Tim Horton  <timothy_horton@apple.com>
2336
2337         [iOS] Long press or link click can sometimes trigger during/after a preview
2338         https://bugs.webkit.org/show_bug.cgi?id=147338
2339         <rdar://problem/22020770>
2340
2341         Reviewed by Enrica Casucci.
2342
2343         * UIProcess/ios/WKContentViewInteraction.mm:
2344         (-[WKContentView _longPressRecognized:]):
2345         Bail if we're previewing.
2346
2347         (-[WKContentView _dataForPreviewItemController:atPosition:type:]):
2348         (-[WKContentView _presentedViewControllerForPreviewItemController:]):
2349         Always avoid allowing clicks and start interaction when previewing a link.
2350
2351 2015-07-27  Andreas Kling  <akling@apple.com>
2352
2353         [iOS] Occasional crashes in WebPage::elementDidBlur()'s async block.
2354         <https://webkit.org/b/147281>
2355         <rdar://problem/21701858>
2356
2357         Reviewed by Anders Carlsson.
2358
2359         Protect the WebPage object until the dispatch_async block has finished.
2360         I have no way to repro this, but there's evidence of some crashing here.
2361
2362         * WebProcess/WebPage/ios/WebPageIOS.mm:
2363         (WebKit::WebPage::elementDidBlur):
2364
2365 2015-07-27  Michael Catanzaro  <mcatanzaro@igalia.com>
2366
2367         [Seccomp] Set appropriate filters when trapping syscalls by default
2368         https://bugs.webkit.org/show_bug.cgi?id=142983
2369
2370         If we trap syscalls by default, we must not set separate filters to trap
2371         anything here, since it will fail causing us to crash.
2372
2373         But also, there are some things we must allow unconditionally even when
2374         trapping by default. sigreturn, obviously. Also, let's whitelist brk
2375         here instead of in platform-specific code.
2376
2377         Reviewed by Žan Doberšek.
2378
2379         * Shared/linux/SeccompFilters/SeccompBroker.cpp:
2380         (WebKit::SeccompBroker::launchProcess): Don't trap sigprocmask or sigaction unless allow is
2381         the default action. Also, allow sigreturn and brk is allow is not the default.
2382         * Shared/linux/SeccompFilters/SeccompFilters.cpp: Added
2383         (WebKit::SeccompFilters::defaultAction):
2384         * Shared/linux/SeccompFilters/SeccompFilters.h: Added defaultAction
2385
2386 2015-07-27  Matthew Daiter  <mdaiter@apple.com>
2387
2388         Renamed duplicate vectors inside UserMediaPermissionRequestProxy
2389         https://bugs.webkit.org/show_bug.cgi?id=147321
2390         <rdar://problem/22011290>
2391
2392         Reviewed by Eric Carlson.
2393
2394         * UIProcess/UserMediaPermissionRequestProxy.cpp:
2395         (WebKit::UserMediaPermissionRequestProxy::UserMediaPermissionRequestProxy):
2396         * UIProcess/UserMediaPermissionRequestProxy.h:
2397         (WebKit::UserMediaPermissionRequestProxy::videoDeviceUIDs):
2398         (WebKit::UserMediaPermissionRequestProxy::audioDeviceUIDs):
2399         (WebKit::UserMediaPermissionRequestProxy::deviceUIDsVideo): Deleted.
2400         (WebKit::UserMediaPermissionRequestProxy::deviceUIDsAudio): Deleted.
2401         * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
2402         (WebKit::UserMediaPermissionRequestManager::startRequest):
2403
2404 2015-07-27  Carlos Garcia Campos  <cgarcia@igalia.com>
2405
2406         [GTK] Pass a GstInstallPluginsContext to gst_install_plugins_async
2407         https://bugs.webkit.org/show_bug.cgi?id=147103
2408
2409         Reviewed by Philippe Normand.
2410
2411         This allows PackageKit to properly position the window and make it
2412         transient to the web view window.
2413
2414         * UIProcess/API/gtk/PageClientImpl.cpp:
2415         (WebKit::PageClientImpl::setCursor): Disambiguate Cursor now that
2416         we include gtkx.h.
2417         (WebKit::PageClientImpl::createGstInstallPluginsContext): Create a
2418         new GstInstallPluginsContext and set the web view window XID when
2419         running on X11.
2420         * UIProcess/API/gtk/PageClientImpl.h:
2421         * UIProcess/PageClient.h:
2422         * UIProcess/efl/WebViewEfl.h:
2423         * UIProcess/gstreamer/WebPageProxyGStreamer.cpp:
2424         (WebKit::WebPageProxy::requestInstallMissingMediaPlugins): Use
2425         PageClient::createGstInstallPluginsContext() to create a new
2426         GstInstallPluginsContext and pass it to gst_install_plugins_async().
2427
2428 2015-07-26  Gwang Yoon Hwang  <yoon@igalia.com>
2429
2430         [ThreadedCompositor] Unreviewed build fix after r186059
2431         https://bugs.webkit.org/show_bug.cgi?id=147315
2432
2433         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
2434         (WebKit::ThreadedCompositor::glContext):
2435         Explicitly cast u_int64 to GLNativeWindowType.
2436         * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h:
2437         (WebKit::ThreadedCoordinatedLayerTreeHost::create):
2438         Update declaration to match with modified definition.
2439
2440
2441 2015-07-26  Chris Dumez  <cdumez@apple.com>
2442
2443         [WK2][iOS] WebContent process main thread should have fixed priority
2444         https://bugs.webkit.org/show_bug.cgi?id=147313
2445         <rdar://problem/22003112>
2446
2447         Reviewed by Darin Adler.
2448
2449         WebContent process main thread should have fixed priority on iOS 9.
2450         Priority decay regresses PLT and fixing the main thread's priority
2451         gives up a ~3% progression on warm PLT (tested on iPhone 5s).
2452
2453         * WebProcess/cocoa/WebProcessCocoa.mm:
2454         (WebKit::WebProcess::platformInitializeWebProcess):
2455
2456 2015-07-26  Dan Bernstein  <mitz@apple.com>
2457
2458         Suppressed an Xcode 7 warning about including a nib in an iOS build product.
2459
2460         * Configurations/BaseLegacyProcess.xcconfig: Exclude xib files on iOS.
2461         * Configurations/BaseXPCService.xcconfig: Ditto.
2462
2463 2015-07-24  Ryosuke Niwa  <rniwa@webkit.org>
2464
2465         iOS 8 build fix attempt after r187215.
2466
2467         * UIProcess/API/Cocoa/WKWebView.mm:
2468         (-[WKWebView _snapshotRect:intoImageOfWidth:completionHandler:]): Deleted.
2469
2470 2015-07-24  Yongjun Zhang  <yongjun_zhang@apple.com>
2471
2472         Don't create UIWebFormAccessory if we don't require accessory view.
2473         https://bugs.webkit.org/show_bug.cgi?id=147283
2474
2475         Don't try to intialize _formAccessoryView if requiresAccessoryView returns false since we don't
2476         need it yet.
2477
2478         Reviewed by Dan Bernstein.
2479
2480         * UIProcess/ios/WKContentViewInteraction.mm:
2481         (-[WKContentView inputAccessoryView]):
2482
2483 2015-07-24  Anders Carlsson  <andersca@apple.com>
2484
2485         WKWebsiteDataStore remove methods don't properly delete cookies
2486         https://bugs.webkit.org/show_bug.cgi?id=147282
2487         rdar://problem/21948230
2488
2489         Reviewed by Sam Weinig.
2490
2491         * NetworkProcess/NetworkProcess.cpp:
2492         (WebKit::NetworkProcess::deleteWebsiteDataForOrigins):
2493         Call deleteCookiesForHostnames instead of iterating over each hostname.
2494
2495         * WebProcess/Cookies/WebCookieManager.cpp:
2496         (WebKit::WebCookieManager::deleteCookiesForHostname):
2497         Call deleteCookiesForHostnames.
2498
2499 2015-07-24  Anders Carlsson  <andersca@apple.com>
2500
2501         Networking process crash in NetworkConnectionToWebProcess::convertMainResourceLoadToDownload while attempting to download a blob
2502         https://bugs.webkit.org/show_bug.cgi?id=147276
2503         rdar://problem/21423353
2504
2505         Reviewed by Andreas Kling.
2506
2507         We currently don't support downloading blobs, so for now just bail if we encounter a null loader inside
2508         convertMainResourceLoadToDownload (which happens when trying to download a blob URL).
2509
2510         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
2511         (WebKit::NetworkConnectionToWebProcess::didCleanupResourceLoader):
2512         Rewrite the assertion to be more clear - it's fine to do an extra hash lookup in debug builds.
2513
2514         (WebKit::NetworkConnectionToWebProcess::convertMainResourceLoadToDownload):
2515         Bail if loader is null.
2516
2517 2015-07-24  Yusuke Suzuki  <utatane.tea@gmail.com>
2518
2519         Remove runtime flags for symbols
2520         https://bugs.webkit.org/show_bug.cgi?id=147246
2521
2522         Reviewed by Alex Christensen.
2523
2524         * UIProcess/API/C/WKPreferencesRefPrivate.h:
2525         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
2526
2527 2015-07-24  Yusuke Suzuki  <utatane.tea@gmail.com>
2528
2529         Object.getOwnPropertySymbols on large list takes very long
2530         https://bugs.webkit.org/show_bug.cgi?id=146137
2531
2532         Reviewed by Mark Lam.
2533
2534         * WebProcess/Plugins/Netscape/NPJSObject.cpp:
2535         (WebKit::NPJSObject::enumerate):
2536
2537 2015-07-24  Simon Fraser  <simon.fraser@apple.com>
2538
2539         Recode.net gets into a continual resize loop in split fullscreen
2540         https://bugs.webkit.org/show_bug.cgi?id=147266
2541         rdar://problem/21409047
2542
2543         Reviewed by Tim Horton.
2544         
2545         In split fullscreen, we use fixed layout and scale to shrink pages down to
2546         fit a given width. This is re-evaluated every time the document width changes.
2547         However some pages, like recode.net, end up continually resizing because
2548         when laid out unconstrained they use a narrower width than when laid out with
2549         a fixed layout size. In fixed layout, they actually use more width than the fixed
2550         layout size.
2551         
2552         Detect and break this cycle by just not re-scaling when we've done one fixed layout,
2553         and the document is now taking more width than the fixed layout width.
2554
2555         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
2556         (WebKit::TiledCoreAnimationDrawingArea::scaleViewToFitDocumentIfNeeded):
2557
2558 2015-07-24  Carlos Garcia Campos  <cgarcia@igalia.com>
2559
2560         [GStreamer] Crashes during plugin installation
2561         https://bugs.webkit.org/show_bug.cgi?id=144099
2562
2563         Reviewed by Philippe Normand.
2564
2565         Move the missing plugins installation to the UI process, ensuring
2566         there's a single installer running and cancelling the request when
2567         the page is closed or the media player is deleted.
2568
2569         * PlatformEfl.cmake: Add new files to compilation.
2570         * PlatformGTK.cmake: Ditto.
2571         * UIProcess/WebPageProxy.h:
2572         * UIProcess/WebPageProxy.messages.in: Add
2573         RequestInstallMissingMediaPlugins message.
2574         * UIProcess/gstreamer/WebPageProxyGStreamer.cpp: Added.
2575         (WebKit::WebPageProxy::requestInstallMissingMediaPlugins): Call
2576         gst_install_plugins_async() and send
2577         DidEndRequestInstallMissingMediaPlugins message back to the web
2578         process when done.
2579         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2580         (WebKit::WebChromeClient::requestInstallMissingMediaPlugins): Call
2581         WebPage::requestInstallMissingMediaPlugins().
2582         * WebProcess/WebCoreSupport/WebChromeClient.h:
2583         * WebProcess/WebPage/WebPage.cpp:
2584         (WebKit::WebPage::close): Invalidate the install missing plugins
2585         request callback.
2586         * WebProcess/WebPage/WebPage.h:
2587         * WebProcess/WebPage/WebPage.messages.in: Add
2588         DidEndRequestInstallMissingMediaPlugins message.
2589         * WebProcess/WebPage/gstreamer/WebPageGStreamer.cpp: Added.
2590         (WebKit::WebPage::requestInstallMissingMediaPlugins): Send
2591         RequestInstallMissingMediaPlugins to the UI process or complete
2592         the request early if there's already a request in progress.
2593         (WebKit::WebPage::didEndRequestInstallMissingMediaPlugins):
2594         Complete the request.
2595
2596 2015-07-24  Carlos Garcia Campos  <cgarcia@igalia.com>
2597
2598         Unreviewed. Fix the build with MEDIA_STREAM disabled after r187282.
2599
2600         RealtimeMediaSource is only defined when MEDIA_STREAM is enabled.
2601
2602         * UIProcess/UserMediaPermissionRequestProxy.cpp:
2603         * UIProcess/UserMediaPermissionRequestProxy.h:
2604
2605 2015-07-24  Carlos Garcia Campos  <cgarcia@igalia.com>
2606
2607         REGRESSION(r187100): [GTK] ASSERTION FAILED: Attempt to access post layout data before receiving it when typing backspace
2608         https://bugs.webkit.org/show_bug.cgi?id=147196
2609
2610         Reviewed by Žan Doberšek.
2611
2612         Do not try to use the PostLayoutData from EditorState when
2613         isMissingPostLayoutData is true. That happens when there's a
2614         layout pending, and EditorStateChanged is sent again after that
2615         layout with the post layout data. So we can just return early and
2616         wait until the second message.
2617
2618         * UIProcess/API/gtk/WebKitEditorState.cpp:
2619         (webkitEditorStateChanged):
2620         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
2621         (webkitWebViewBaseUpdateTextInputState):
2622
2623 2015-07-23  Alex Christensen  <achristensen@webkit.org>
2624
2625         Fix 32-bit build after r187272.
2626
2627         * UIProcess/mac/PageClientImpl.mm:
2628         (WebKit::PageClientImpl::mediaDocumentNaturalSizeChanged):
2629         Added some WK_API_ENABLED.
2630
2631 2015-07-23  Dan Bernstein  <mitz@apple.com>
2632
2633         <rdar://problem/21929532> REGRESSION (r184026): Safari AutoFill with Contact info for phone number is broken
2634         https://bugs.webkit.org/show_bug.cgi?id=147249
2635
2636         Reviewed by Sam Weinig.
2637
2638         * Shared/API/Cocoa/WKRemoteObjectCoder.mm:
2639         (encodeObject): Use encodeString only for strings that encode as NSString or
2640         NSMutableString. It can’t encode arbitrary NSString subclasses.
2641         (decodeObject): Use decodeString for NSMutableString as well.
2642
2643 2015-07-23  Zalan Bujtas  <zalan@apple.com>
2644
2645         [iOS] REGRESSION (187131): Loading CuteOverload zooms in to the top left corner.
2646         https://bugs.webkit.org/show_bug.cgi?id=147251
2647         rdar://problem/21953359
2648
2649         Calling zoomToRect() should result in essentially the same zoom scale as if we
2650         called setZoomScale with the new page scale factor.
2651  
2652         Reviewed by Benjamin Poulain.
2653
2654         * UIProcess/API/Cocoa/WKWebView.mm:
2655         (-[WKWebView _didCommitLayerTree:]):
2656
2657 2015-07-23  Matthew Daiter  <mdaiter@apple.com>
2658
2659         Linking WebKit2 to be able to grab media sources from a UID
2660         https://bugs.webkit.org/show_bug.cgi?id=147202
2661         <rdar://problem/21947608>
2662
2663         Reviewed by Brent Fulgham.
2664
2665         * UIProcess/UserMediaPermissionRequestProxy.cpp:
2666         (WebKit::UserMediaPermissionRequestProxy::getDeviceNameForUID):
2667         * UIProcess/UserMediaPermissionRequestProxy.h:
2668
2669 2015-07-23  Alex Christensen  <achristensen@webkit.org>
2670
2671         Remove compile and runtime flags for promises.
2672         https://bugs.webkit.org/show_bug.cgi?id=147244
2673
2674         Reviewed by Yusuke Suzuki.
2675
2676         * Configurations/FeatureDefines.xcconfig:
2677         * UIProcess/API/C/WKPreferencesRefPrivate.h:
2678         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
2679
2680 2015-07-21  Jer Noble  <jer.noble@apple.com>
2681
2682         Notify the UI delegate when a MediaDocument's natural size changes
2683         https://bugs.webkit.org/show_bug.cgi?id=147182
2684
2685         Reviewed by Simon Fraser.
2686
2687         Pipe notifications of media document natural size changes up from the chrome client, through
2688         to the UIProcess,  through the page client, through the WKWebView, to the UIDelegate.
2689
2690         * UIProcess/API/APIUIClient.h:
2691         (API::UIClient::mediaDocumentNaturalSizeChanged):
2692         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
2693         * UIProcess/API/Cocoa/WKWebView.mm:
2694         (-[WKWebView _mediaDocumentNaturalSizeChanged:]):
2695         * UIProcess/API/Cocoa/WKWebViewInternal.h:
2696         * UIProcess/Cocoa/UIDelegate.h:
2697         * UIProcess/Cocoa/UIDelegate.mm:
2698         (WebKit::UIDelegate::setDelegate):
2699         (WebKit::UIDelegate::UIClient::mediaDocumentNaturalSizeChanged):
2700         * UIProcess/PageClient.h:
2701         * UIProcess/WebPageProxy.cpp:
2702         (WebKit::WebPageProxy::mediaDocumentNaturalSizeChanged):
2703         * UIProcess/WebPageProxy.h:
2704         * UIProcess/WebPageProxy.messages.in:
2705         * UIProcess/ios/PageClientImplIOS.h:
2706         * UIProcess/ios/PageClientImplIOS.mm:
2707         (WebKit::PageClientImpl::mediaDocumentNaturalSizeChanged):
2708         * UIProcess/mac/PageClientImpl.h:
2709         * UIProcess/mac/PageClientImpl.mm:
2710         (WebKit::PageClientImpl::mediaDocumentNaturalSizeChanged):
2711         * WebProcess/WebCoreSupport/WebChromeClient.h:
2712         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2713         (WebKit::WebChromeClient::mediaDocumentNaturalSizeChanged):
2714         * WebProcess/WebPage/WebPage.cpp:
2715         (WebKit::WebPage::mediaDocumentNaturalSizeChanged):
2716         * WebProcess/WebPage/WebPage.h:
2717         * UIProcess/API/gtk/PageClientImpl.h: Add default, empty implementation of new pure-virtual method.
2718         * UIProcess/efl/WebViewEfl.h: Ditto.
2719
2720 2015-07-23  Enrica Casucci  <enrica@apple.com>
2721
2722         Removing one incorrect annotation from the previous change.
2723
2724         Unreviewed.
2725
2726         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
2727
2728 2015-07-23  Enrica Casucci  <enrica@apple.com>
2729
2730         [iOS] Add another preview delegate for didDismissPreview.
2731         https://bugs.webkit.org/show_bug.cgi?id=147241
2732         rdar://problem/21664211
2733
2734         Reviewed by Tim Horton and Yongjun Zhang.
2735
2736         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
2737         * UIProcess/ios/WKContentViewInteraction.mm:
2738         (-[WKContentView _previewItemController:didDismissPreview:committing:]):
2739
2740 2015-07-23  Dan Bernstein  <mitz@apple.com>
2741
2742         <rdar://problem/21910578> Second pass at [iOS] Keyboard shortcuts that take focus away from the web view end up typing a letter into the newly focused field
2743         https://bugs.webkit.org/show_bug.cgi?id=146732
2744
2745         Reviewed by Darin Adler.
2746
2747         * UIProcess/ios/WKContentViewInteraction.mm:
2748         (-[WKContentView _interpretKeyEvent:isCharEvent:]): Rather than checking if the view is
2749         first responder, which it might still be when the Web Content processes invokes this
2750         callback, check if we are in editable content before forwarding the event to the keyboard.
2751
2752 2015-07-23  Jer Noble  <jer.noble@apple.com>
2753
2754         Unreviewed build fix after r187251; rename flag -> allows.
2755
2756         * UIProcess/WebPageProxy.cpp:
2757         (WebKit::WebPageProxy::setAllowsMediaDocumentInlinePlayback):
2758
2759 2015-07-23  Alex Christensen  <achristensen@webkit.org>
2760
2761         [iOS] Unreviewed build fix after r187251.
2762
2763         * UIProcess/WebPageProxy.cpp:
2764         (WebKit::WebPageProxy::setAllowsMediaDocumentInlinePlayback):
2765         Use the correct name for the boolean to pass along to SetAllowsMediaDocumentInlinePlayback.
2766
2767 2015-07-23  Enrica Casucci  <enrica@apple.com>
2768
2769         One more iOS build fix.
2770
2771         Unreviewed.
2772
2773         * Platform/spi/ios/UIKitSPI.h:
2774         * UIProcess/ios/WKContentViewInteraction.h:
2775
2776 2015-07-23  Matthew Daiter  <mdaiter@apple.com>
2777
2778         Bridged passing lists of devices between the UIProcess and the WebProcess
2779         https://bugs.webkit.org/show_bug.cgi?id=147056
2780         <rdar://problem/21883094>
2781
2782         Reviewed by Brent Fulgham.
2783
2784         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp: Modified file
2785         to reflect changes made to the header in the .messages.in file
2786         (WebKit::UserMediaPermissionRequestManagerProxy::createRequest): Ditto
2787         (WebKit::UserMediaPermissionRequestManagerProxy::didReceiveUserMediaPermissionDecision):
2788         * UIProcess/UserMediaPermissionRequestManagerProxy.h: Ditto
2789         * UIProcess/UserMediaPermissionRequestProxy.cpp: Ditto
2790         (WebKit::UserMediaPermissionRequestProxy::UserMediaPermissionRequestProxy):
2791         * UIProcess/UserMediaPermissionRequestProxy.h:
2792         (WebKit::UserMediaPermissionRequestProxy::create):
2793         (WebKit::UserMediaPermissionRequestProxy::deviceUIDsVideo):
2794         (WebKit::UserMediaPermissionRequestProxy::deviceUIDsAudio):
2795         * UIProcess/WebPageProxy.cpp:
2796         (WebKit::WebPageProxy::requestUserMediaPermissionForFrame):
2797         * UIProcess/WebPageProxy.h:
2798         * UIProcess/WebPageProxy.messages.in: Changed heading
2799         * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
2800         (WebKit::UserMediaPermissionRequestManager::startRequest):
2801         (WebKit::UserMediaPermissionRequestManager::didReceiveUserMediaPermissionDecision):
2802         * WebProcess/MediaStream/UserMediaPermissionRequestManager.h:
2803         * WebProcess/WebPage/WebPage.cpp:
2804         (WebKit::WebPage::didReceiveUserMediaPermissionDecision):
2805         * WebProcess/WebPage/WebPage.h:
2806         * WebProcess/WebPage/WebPage.messages.in: Changed heading
2807
2808 2015-07-23  Yongjun Zhang  <yongjun_zhang@apple.com>
2809
2810         Adopt the new _previewItemControllerDidCancelPreview delegate method.
2811         https://bugs.webkit.org/show_bug.cgi?id=147238
2812
2813         Don't allow hightlight long press to trigger tap if the link preview is cancelled because
2814         the link is not preview-able.
2815
2816         Reviewed by Beth Dakin.
2817
2818         * UIProcess/ios/WKContentViewInteraction.mm:
2819         (-[WKContentView _previewItemControllerDidCancelPreview:]): 
2820
2821 2015-07-23  Enrica Casucci  <enrica@apple.com>
2822
2823         iOS build fix after http://trac.webkit.org/changeset/187238.
2824
2825         Unreviewed.
2826
2827         * Platform/spi/ios/UIKitSPI.h:
2828
2829 2015-07-23  Jer Noble  <jer.noble@apple.com>
2830
2831         [WK2] Add a WKWebView property for whether the view is displaying a media document
2832         https://bugs.webkit.org/show_bug.cgi?id=147233
2833
2834         Reviewed by Beth Dakin.
2835
2836         Add a _isDisplayingStandaloneMediaDocument property, which queries the frame for whether
2837         the current MIME type is one which our media engines support.
2838
2839         * UIProcess/API/Cocoa/WKWebView.mm:
2840         (-[WKWebView _isDisplayingStandaloneMediaDocument]):
2841         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2842         * UIProcess/WebFrameProxy.cpp:
2843         (WebKit::WebFrameProxy::isDisplayingStandaloneMediaDocument):
2844         * UIProcess/WebFrameProxy.h:
2845
2846 2015-07-21  Jer Noble  <jer.noble@apple.com>
2847
2848         [iOS] Add an explicit API to allow media documents to (temporarily) play inline
2849         https://bugs.webkit.org/show_bug.cgi?id=147181
2850
2851         Reviewed by Beth Dakin.
2852
2853         Add a WKWebView(Private) API which allows MediaDocuments loaded by the view to play their contents inline, regardless
2854         of whether inline playback is restricted on the current device.
2855
2856         * UIProcess/API/Cocoa/WKWebView.mm:
2857         (-[WKWebView _setRequiresUserActionForMediaPlayback:]): Added. Pass through to WebPageProxy.
2858         (-[WKWebView _allowsMediaDocumentInlinePlayback]): Ditto.
2859         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2860         * UIProcess/WebPageProxy.cpp:
2861         (WebKit::WebPageProxy::allowsMediaDocumentInlinePlayback): Simple getter.
2862         (WebKit::WebPageProxy::setAllowsMediaDocumentInlinePlayback): Set, and conditionally pass the new value to WebPage.
2863         * UIProcess/WebPageProxy.h:
2864         * WebProcess/WebPage/WebPage.cpp:
2865         (WebKit::WebPage::setAllowsMediaDocumentInlinePlayback): Set, and conditionally notify WebCore page of the change.
2866         * WebProcess/WebPage/WebPage.h:
2867         (WebKit::WebPage::allowsMediaDocumentInlinePlayback): Simple getter.
2868         * WebProcess/WebPage/WebPage.messages.in: Add new messages.
2869
2870 2015-07-23  Beth Dakin  <bdakin@apple.com>
2871
2872         Should not allow previews of 1x1 images
2873         https://bugs.webkit.org/show_bug.cgi?id=147237
2874         -and corresponding-
2875         rdar://problem/21968460
2876
2877         Reviewed by Tim Horton.
2878
2879         1x1 images are used on some sites to cover actual images, which leads to a 
2880         misleading preview experience. There is not any reason why you would really 
2881         want to preview an image this small nor any reason to believe that the 
2882         preview would result in anything useful.
2883         * WebProcess/WebPage/ios/WebPageIOS.mm:
2884         (WebKit::WebPage::getPositionInformation):
2885
2886 2015-07-23  Brady Eidson  <beidson@apple.com>
2887
2888         Crash in WebPlatformStrategies::createPingHandle - Deref a null NetworkingContext.
2889         <rdar://problem/21949735> and https://bugs.webkit.org/show_bug.cgi?id=147227
2890
2891         Reviewed by Alexey Proskuryakov.
2892
2893         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
2894         (WebKit::WebPlatformStrategies::createPingHandle): Skip it if there's a null NetworkingContext.
2895
2896 2015-07-23  Tim Horton  <timothy_horton@apple.com>
2897
2898         Remove some files that should have been removed with WebKit2 Windows
2899         https://bugs.webkit.org/show_bug.cgi?id=147223
2900
2901         Reviewed by Csaba Osztrogonác.
2902
2903         * Shared/API/c/cf/WKURLRequestCF.cpp: Removed.
2904         * Shared/API/c/cf/WKURLRequestCF.h: Removed.
2905         * Shared/API/c/cf/WKURLResponseCF.cpp: Removed.
2906         * Shared/API/c/cf/WKURLResponseCF.h: Removed.
2907
2908 2015-07-23  Timothy Horton  <timothy_horton@apple.com>
2909
2910         Fix the build
2911
2912         * Platform/spi/ios/UIKitSPI.h:
2913
2914 2015-07-23  Tim Horton  <timothy_horton@apple.com>
2915
2916         Remove files that were meant to be removed in r173929
2917
2918         * WebProcess/WebPage/mac/WebInspectorMac.mm: Removed.
2919
2920 2015-07-23  Tim Horton  <timothy_horton@apple.com>
2921
2922         Remove files that were meant to be removed in r168213
2923
2924         * UIProcess/API/Cocoa/WKErrorRecoveryAttempting.h: Removed.
2925
2926 2015-07-23  Tim Horton  <timothy_horton@apple.com>
2927
2928         Remove files that were meant to be removed in r168229
2929
2930         * UIProcess/API/Cocoa/WKSession.h: Removed.
2931         * UIProcess/API/Cocoa/WKSession.mm: Removed.
2932         * UIProcess/API/Cocoa/WKSessionInternal.h: Removed.
2933
2934 2015-07-23  Tim Horton  <timothy_horton@apple.com>
2935
2936         Remove files that were meant to be removed in r165014
2937
2938         * WebProcess/WebPage/mac/WKAccessibilityWebPageObject.h: Removed.
2939         * WebProcess/WebPage/mac/WKAccessibilityWebPageObject.mm: Removed.
2940
2941 2015-07-23  Carlos Garcia Campos  <cgarcia@igalia.com>
2942
2943         [GTK] Add API to allow executing editing commands that require an argument
2944         https://bugs.webkit.org/show_bug.cgi?id=146781
2945
2946         Reviewed by Gustavo Noronha Silva.
2947
2948         Commands like InsertImage or CreateLink receive an argument, but
2949         we only have webkit_web_view_execute_editing_command() that
2950         doesn't receive any argument. This patch adds
2951         webkit_web_view_execute_editing_command_with_argument() for those
2952         commands. It also adds WEBKIT_EDITING_COMMAND_INSERT_IMAGE and
2953         WEBKIT_EDITING_COMMAND_CREATE_LINK to the predefined editing commands.
2954
2955         * UIProcess/API/gtk/WebKitEditingCommands.h: Add
2956         WEBKIT_EDITING_COMMAND_INSERT_IMAGE and WEBKIT_EDITING_COMMAND_CREATE_LINK.
2957         * UIProcess/API/gtk/WebKitWebView.cpp:
2958         (webkit_web_view_execute_editing_command_with_argument):
2959         * UIProcess/API/gtk/WebKitWebView.h:
2960         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt: Add new symbols.
2961         * UIProcess/WebPageProxy.cpp:
2962         (WebKit::WebPageProxy::executeEditCommand): Pass also the argument
2963         to the message.
2964         * UIProcess/WebPageProxy.h:
2965         * WebProcess/WebPage/WebPage.cpp:
2966         (WebKit::WebPage::executeEditCommand): Add the argument parameter
2967         to the message handler.
2968         * WebProcess/WebPage/WebPage.h:
2969         * WebProcess/WebPage/WebPage.messages.in: Add argument parameter
2970         to ExecuteEditCommand message.
2971
2972 2015-07-22  Sukolsak Sakshuwong  <sukolsak@gmail.com>
2973
2974         Add ENABLE_WEBASSEMBLY feature flag for WebAssembly
2975         https://bugs.webkit.org/show_bug.cgi?id=147212
2976
2977         Reviewed by Filip Pizlo.
2978
2979         * Configurations/FeatureDefines.xcconfig:
2980
2981 2015-07-22  James Savage  <james.savage@apple.com>
2982
2983         Use updated CoreAnimation snapshot SPI.
2984         https://bugs.webkit.org/show_bug.cgi?id=147197
2985         <rdar://problem/21032083>
2986
2987         Reviewed by Tim Horton.
2988         Patch by James Savage.
2989
2990         * Platform/spi/ios/UIKitSPI.h:
2991         * UIProcess/API/Cocoa/WKWebView.mm:
2992         (-[WKWebView _snapshotRect:intoImageOfWidth:completionHandler:]):
2993
2994 2015-07-22  Timothy Horton  <timothy_horton@apple.com>
2995
2996         Fix the build
2997
2998         * UIProcess/ios/WKContentViewInteraction.mm:
2999         (-[WKContentView setupInteraction]):
3000         (-[WKContentView cleanupInteraction]):
3001
3002 2015-07-22  Commit Queue  <commit-queue@webkit.org>
3003
3004         Unreviewed, rolling out r187196.
3005         https://bugs.webkit.org/show_bug.cgi?id=147213
3006
3007         broke all the iOS builds (Requested by thorton on #webkit).
3008
3009         Reverted changeset:
3010
3011         "Use updated CoreAnimation snapshot SPI."
3012         https://bugs.webkit.org/show_bug.cgi?id=147197
3013         http://trac.webkit.org/changeset/187196
3014
3015 2015-07-22  Tim Horton  <timothy_horton@apple.com>
3016
3017         Fix the build
3018
3019         * UIProcess/ios/WKContentViewInteraction.h:
3020
3021 2015-07-22  Tim Horton  <timothy_horton@apple.com>
3022
3023         [iOS] Adjust the preview architecture
3024         https://bugs.webkit.org/show_bug.cgi?id=147203
3025         <rdar://problem/21945775>
3026
3027         Reviewed by Simon Fraser.
3028
3029         * UIProcess/ios/WKContentViewInteraction.mm:
3030         (-[WKContentView _dataForPreviewItemController:atPosition:type:]):
3031         Link previews should win over image previews if both are possible.
3032
3033 2015-07-22  James Savage  <james.savage@apple.com>
3034
3035         Use updated CoreAnimation snapshot SPI.
3036         https://bugs.webkit.org/show_bug.cgi?id=147197
3037
3038         Reviewed by Tim Horton.
3039
3040         * Platform/spi/ios/UIKitSPI.h:
3041         * UIProcess/API/Cocoa/WKWebView.mm:
3042         (-[WKWebView _snapshotRect:intoImageOfWidth:completionHandler:]):
3043
3044 2015-07-22  Tim Horton  <timothy_horton@apple.com>
3045
3046         [iOS] Adjust the preview architecture
3047         https://bugs.webkit.org/show_bug.cgi?id=147203
3048         <rdar://problem/21945775>
3049
3050         Reviewed by Beth Dakin.
3051
3052         * Platform/spi/ios/UIKitSPI.h:
3053         * UIProcess/API/Cocoa/WKWebView.mm:
3054         (-[WKWebView _setAllowsLinkPreview:]): Deleted.
3055         * UIProcess/ios/WKContentView.mm:
3056         (-[WKContentView willMoveToWindow:]): Deleted.
3057         * UIProcess/ios/WKContentViewInteraction.h:
3058         * UIProcess/ios/WKContentViewInteraction.mm:
3059         (-[WKContentView setupInteraction]):
3060         (-[WKContentView cleanupInteraction]):
3061         (-[WKContentView _registerPreview]):
3062         (-[WKContentView _unregisterPreview]):
3063         (-[WKContentView _interactionShouldBeginFromPreviewItemController:forPosition:]):
3064         (-[WKContentView _dataForPreviewItemController:atPosition:type:]):
3065         (-[WKContentView _presentationRectForPreviewItemController:]):
3066         (-[WKContentView _presentedViewControllerForPreviewItemController:]):
3067         (-[WKContentView _previewItemController:commitPreview:]):
3068         (-[WKContentView _previewItemController:willPresentPreview:forPosition:inSourceView:]):
3069         (-[WKContentView _previewItemController:didDismissPreview:committing:]):
3070         (-[WKContentView _presentationSnapshotForPreviewItemController:]):
3071         (-[WKContentView _presentationRectsForPreviewItemController:]):
3072         (-[WKContentView gestureRecognizerShouldBegin:]): Deleted.
3073         (-[WKContentView _registerPreviewInWindow:]): Deleted.
3074         (-[WKContentView _unregisterPreviewInWindow:]): Deleted.
3075         (-[WKContentView previewViewControllerForPosition:inSourceView:]): Deleted.
3076         (-[WKContentView commitPreviewViewController:]): Deleted.
3077         (-[WKContentView willPresentPreviewViewController:forPosition:inSourceView:]): Deleted.
3078         (-[WKContentView didDismissPreviewViewController:committing:]): Deleted.
3079         Register and unregister in setup/cleanupInteraction instead of when moving between windows.
3080         Implement 'shouldBegin' instead of interacting directly with the recognizer.
3081         Make use of system enums instead of our own.
3082         Let UIPreviewItemController handle shrink-wrapping and the indicator view.
3083
3084 2015-07-22  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
3085
3086         [EFL] Support indexeddb for WK2
3087         https://bugs.webkit.org/show_bug.cgi?id=145867
3088
3089         Reviewed by Csaba Osztrogonác.
3090
3091         Add stub implementation for indexeddb. Move KeyedDecoder and KeyedEncoder from gtk to glib
3092         in order to share it between GTK and EFL ports.
3093
3094         * DatabaseProcess/EntryPoint/unix/DatabaseProcessMain.cpp:
3095         * DatabaseProcess/efl/DatabaseProcessMainEfl.cpp: Copied from Source/WebKit2/DatabaseProcess/EntryPoint/unix/DatabaseProcessMain.cpp.
3096         (WebKit::DatabaseProcessMainUnix):
3097         * PlatformEfl.cmake:
3098         * PlatformGTK.cmake:
3099         * Shared/glib/KeyedDecoder.cpp: Renamed from Source/WebKit2/Shared/gtk/KeyedDecoder.cpp.
3100         (WebKit::KeyedDecoder::KeyedDecoder):
3101         (WebKit::KeyedDecoder::~KeyedDecoder):
3102         (WebKit::KeyedDecoder::dictionaryFromGVariant):
3103         (WebKit::KeyedDecoder::decodeBytes):
3104         (WebKit::KeyedDecoder::decodeSimpleValue):
3105         (WebKit::KeyedDecoder::decodeBool):
3106         (WebKit::KeyedDecoder::decodeUInt32):
3107         (WebKit::KeyedDecoder::decodeInt32):
3108         (WebKit::KeyedDecoder::decodeInt64):
3109         (WebKit::KeyedDecoder::decodeFloat):
3110         (WebKit::KeyedDecoder::decodeDouble):
3111         (WebKit::KeyedDecoder::decodeString):
3112         (WebKit::KeyedDecoder::beginObject):
3113         (WebKit::KeyedDecoder::endObject):
3114         (WebKit::KeyedDecoder::beginArray):
3115         (WebKit::KeyedDecoder::beginArrayElement):
3116         (WebKit::KeyedDecoder::endArrayElement):
3117         (WebKit::KeyedDecoder::endArray):
3118         * Shared/glib/KeyedDecoder.h: Renamed from Source/WebKit2/Shared/gtk/KeyedDecoder.h.
3119         * Shared/glib/KeyedEncoder.cpp: Renamed from Source/WebKit2/Shared/gtk/KeyedEncoder.cpp.
3120         (WebKit::KeyedEncoder::KeyedEncoder):
3121         (WebKit::KeyedEncoder::~KeyedEncoder):
3122         (WebKit::KeyedEncoder::encodeBytes):
3123         (WebKit::KeyedEncoder::encodeBool):
3124         (WebKit::KeyedEncoder::encodeUInt32):
3125         (WebKit::KeyedEncoder::encodeInt32):
3126         (WebKit::KeyedEncoder::encodeInt64):
3127         (WebKit::KeyedEncoder::encodeFloat):
3128         (WebKit::KeyedEncoder::encodeDouble):
3129         (WebKit::KeyedEncoder::encodeString):
3130         (WebKit::KeyedEncoder::beginObject):
3131         (WebKit::KeyedEncoder::endObject):
3132         (WebKit::KeyedEncoder::beginArray):
3133         (WebKit::KeyedEncoder::beginArrayElement):
3134         (WebKit::KeyedEncoder::endArrayElement):
3135         (WebKit::KeyedEncoder::endArray):
3136         (WebKit::KeyedEncoder::finishEncoding):
3137         * Shared/glib/KeyedEncoder.h: Renamed from Source/WebKit2/Shared/gtk/KeyedEncoder.h.
3138         * UIProcess/Databases/efl/DatabaseProcessProxyEfl.cpp: Copied from Source/WebKit2/DatabaseProcess/EntryPoint/unix/DatabaseProcessMain.cpp.
3139         (WebKit::DatabaseProcessProxy::platformGetLaunchOptions):
3140
3141 2015-07-22  Michael Catanzaro  <mcatanzaro@igalia.com>
3142
3143         [Seccomp] Canonicalize filesystem path when whitelisting it
3144         https://bugs.webkit.org/show_bug.cgi?id=142986
3145
3146         Reviewed by Žan Doberšek.
3147
3148         * Shared/linux/SeccompFilters/SyscallPolicy.cpp:
3149         (WebKit::canonicalizeFileName):
3150         (WebKit::SyscallPolicy::addFilePermission):
3151         (WebKit::SyscallPolicy::addDirectoryPermission):
3152
3153 2015-07-21  Simon Fraser  <simon.fraser@apple.com>
3154
3155         Add logging for TiledCoreAnimationDrawingArea resizing
3156         https://bugs.webkit.org/show_bug.cgi?id=147180
3157
3158         Reviewed by Tim Horton.
3159
3160         Add a "Resize" log channel for WebKit2, and use it to log data in scaleViewToFitDocumentIfNeeded().
3161
3162         * Platform/Logging.h:
3163         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
3164         (WebKit::TiledCoreAnimationDrawingArea::scaleViewToFitDocumentIfNeeded):
3165
3166 2015-07-22  Sam Weinig  <sam@webkit.org>
3167
3168         Encode/Decode underlying errors when serializing NSErrors
3169         <rdar://problem/21818117>
3170         https://bugs.webkit.org/show_bug.cgi?id=147199
3171
3172         Reviewed by Anders Carlsson.
3173
3174         * Shared/mac/WebCoreArgumentCodersMac.mm:
3175         (IPC::ArgumentCoder<CertificateInfo>::decode):
3176         (IPC::encodeNSError):
3177         (IPC::ArgumentCoder<ResourceError>::encodePlatformData):
3178         (IPC::decodeNSError):
3179         (IPC::ArgumentCoder<ResourceError>::decodePlatformData):
3180         Break out encoding/decoding of the NSErrors into a helpers so they can be called
3181         for the underlying error.
3182
3183 2015-07-22  Beth Dakin  <bdakin@apple.com>
3184
3185         Animated images should animate in previews
3186         https://bugs.webkit.org/show_bug.cgi?id=147173
3187         -and corresponding-
3188         rdar://problem/21637698
3189
3190         Reviewed by Dan Bernstein.
3191
3192         InteractionInformationAtPosition needs to know if it’s an animated image.
3193         * Shared/InteractionInformationAtPosition.cpp:
3194         (WebKit::InteractionInformationAtPosition::encode):
3195         (WebKit::InteractionInformationAtPosition::decode):
3196         * Shared/InteractionInformationAtPosition.h:
3197
3198         New delegate method to create a link preview view controller for animated 
3199         images.
3200         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
3201
3202         Treat animated images more like link previews.
3203         * UIProcess/ios/WKContentViewInteraction.mm:
3204         (-[WKContentView previewViewControllerForPosition:inSourceView:]):
3205
3206         Set info.isAnimatedImage
3207         * WebProcess/WebPage/ios/WebPageIOS.mm:
3208         (WebKit::WebPage::getPositionInformation):
3209
3210 2015-07-22  Michael Catanzaro  <mcatanzaro@igalia.com>
3211
3212         [Seccomp Filters] Add helpers to get XDG base directory locations
3213         https://bugs.webkit.org/show_bug.cgi?id=142982
3214
3215         Reviewed by Zan Dobersek.
3216
3217         * PlatformEfl.cmake:
3218         * PlatformGTK.cmake:
3219         * Shared/linux/SeccompFilters/XDGBaseDirectory.h: Added.
3220         * Shared/linux/SeccompFilters/XDGBaseDirectoryGLib.cpp: Added.
3221         (WebKit::userHomeDirectory):
3222         (WebKit::userCacheDirectory):
3223         (WebKit::userConfigDirectory):
3224         (WebKit::userDataDirectory):
3225         (WebKit::userRuntimeDirectory):
3226
3227 2015-07-22  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
3228
3229         [EFL][WK2] EWK2ContextTestMultipleProcesses.ewk_context_network_process_model fails to pass
3230         https://bugs.webkit.org/show_bug.cgi?id=142967
3231
3232         Reviewed by Csaba Osztrogonác.
3233
3234         Though processIdentifier() can return 0 when a page is not closed, ewk_context_network_process_model has
3235         not been considered process id can be 0. This patch adds a protection logic which doesn't test when process
3236         id is 0 at the moment.
3237
3238         * UIProcess/API/efl/tests/test_ewk2_context.cpp:
3239         (TEST_F):
3240
3241 2015-07-22  Carlos Garcia Campos  <cgarcia@igalia.com>
3242
3243         Unreviewed. Fix some warnings when generating GTK+ HTML API docs.
3244
3245         * UIProcess/API/gtk/docs/webkit2gtk-docs.sgml: Add
3246         WebKitWebsiteDataManager and WebKitWebEditor.
3247
3248 2015-07-21  Carlos Garcia Campos  <cgarcia@igalia.com>
3249
3250         Unreviewed. Update OptionsGTK.cmake and NEWS for 2.9.4 release.
3251
3252         * gtk/NEWS: Add release notes for 2.9.4.
3253
3254 2015-07-21  Joseph Pecoraro  <pecoraro@apple.com>
3255
3256         Web Inspector: [Mac] "Open Image In New Window" context menu item does nothing on an image
3257         https://bugs.webkit.org/show_bug.cgi?id=147175
3258
3259         Reviewed by Timothy Hatcher.
3260
3261         * UIProcess/mac/WebInspectorProxyMac.mm:
3262         (WebKit::getContextMenuFromProposedMenu):
3263         (WebKit::WebInspectorProxy::platformCreateInspectorPage):
3264         Remove default context menus that won't work in the inspector page.
3265
3266 2015-07-21  Benjamin Poulain  <benjamin@webkit.org>
3267
3268         [Content Extensions] Use a jump table when consecutive transitions have different targets
3269         https://bugs.webkit.org/show_bug.cgi?id=147099
3270
3271         Reviewed by Alex Christensen.
3272
3273         * UIProcess/API/APIUserContentExtensionStore.h:
3274
3275 2015-07-21  Daniel Bates  <dabates@apple.com>
3276
3277         Fix the build following <https://trac.webkit.org/changeset/187129>
3278         (https://bugs.webkit.org/show_bug.cgi?id=147112)
3279
3280         * UIProcess/WebProcessProxy.cpp:
3281         (WebKit::WebProcessProxy::reinstateNetworkProcessAssertionState): Guard implementation with PLATFORM(IOS)
3282         since this logic is specific to the iOS port.
3283
3284 2015-07-21  Simon Fraser  <simon.fraser@apple.com>
3285
3286         Rename the 'View' log channel to 'Printing'
3287         https://bugs.webkit.org/show_bug.cgi?id=147172
3288
3289         Reviewed by Zalan Bujtas.
3290
3291         "View" was a terrible name for a log channel that was all about printing.
3292         Sort the log channels.
3293
3294         * Platform/Logging.h:
3295         * UIProcess/API/mac/WKView.mm:
3296         (-[WKView drawRect:]):
3297         (-[WKView printOperationWithPrintInfo:forFrame:]):
3298         * UIProcess/mac/WKPrintingView.mm:
3299         (-[WKPrintingView _preparePDFDataForPrintingOnSecondaryThread]):
3300         (pageDidComputePageRects):
3301         (-[WKPrintingView knowsPageRange:]):
3302         (-[WKPrintingView drawRect:]):
3303         (-[WKPrintingView rectForPage:]):
3304         (-[WKPrintingView beginDocument]):
3305         (-[WKPrintingView endDocument]):
3306
3307 2015-07-21  Zalan Bujtas  <zalan@apple.com>
3308
3309         [iOS] Menu drop down such as on nike.com does not stay
3310         https://bugs.webkit.org/show_bug.cgi?id=147047
3311         rdar://problem/21046961
3312
3313         Reviewed by Benjamin Poulain.
3314
3315         This is a workaround for unintended scrolling while scaling.
3316         (Based on Benjamin Poulain's WIP patch for webkit.org/b/136904)
3317
3318         In certain cases when scaling would result in moving the scrollview (which would trigger
3319         a scroll event on WebCore side), zoomRect is called instead of setZoomScale to ensure
3320         that the scroll position stays intact.
3321
3322         * UIProcess/API/Cocoa/WKWebView.mm:
3323         (-[WKWebView _didCommitLayerTree:]):
3324
3325 2015-07-21  Daniel Bates  <dabates@apple.com>
3326
3327         WTFCrash() in WebKit::WebProcess::networkConnection()
3328         https://bugs.webkit.org/show_bug.cgi?id=147112
3329         <rdar://problem/18477459>
3330
3331         Reviewed by Gavin Barraclough.
3332
3333         Fixes an issue where a newly launched network process may be jetsam'd because it has not
3334         taken a process assertion between the time it was launched and the time when a web process
3335         makes use of it.
3336
3337         Initially a network process does not have a process assertion. A process assertion is taken
3338         (if one has not been taken) for the network process when a process assertion is taken for at
3339         least one web process. When the network process crashes a WebProcess may ultimately launch a
3340         new network process in WebProcess::networkConnection(). The new network process may be jetsam'd
3341         immediately when the system is under some measure pressure because it has a low jetsam priority,
3342         0 (since it does not have a process assertion and higher priority implies that a process is less
3343         likely to be jetsam'd). And the logic in WebProcess::networkConnection() explicitly calls
3344         CRASH() if the newly launched network process crashes immediately. Towards preventing the newly
3345         launched network process from being jetsam'd we should obtain a process assertion for it.
3346
3347         * UIProcess/WebProcessPool.cpp:
3348         (WebKit::WebProcessPool::WebProcessPool): Initialize m_didNetworkProcessCrash to false.
3349         (WebKit::WebProcessPool::ensureNetworkProcess): If the network process crashed (m_didNetworkProcessCrash == true)
3350         then tell each process in the pool to reinstate their network activity token for the new network process.
3351         (WebKit::WebProcessPool::networkProcessCrashed): Set m_didNetworkProcessCrash to true when the
3352         network process crashed.
3353         * UIProcess/WebProcessPool.h:
3354         * UIProcess/WebProcessProxy.cpp:
3355         (WebKit::WebProcessProxy::reinstateNetworkProcessAssertionState): Added.
3356         (WebKit::WebProcessProxy::didSetAssertionState): Add assert to ensure we never have both
3357         a background- and foreground- activity token for the network process.
3358         * UIProcess/WebProcessProxy.h:
3359
3360 2015-07-21  Daniel Bates  <dabates@apple.com>
3361
3362         ASSERT(m_suspendMessageCount >= 0) fails in ProcessThrottler::didCancelProcessSuspension()
3363         when WebContent process crashes; Network process may never voluntarily suspend
3364         https://bugs.webkit.org/show_bug.cgi?id=147122
3365         <rdar://problem/21906759>
3366
3367         Reviewed by Chris Dumez.
3368
3369         Fixes an issue where the network process may never voluntarily release its process assertion.
3370
3371         Currently the network process always sends both a ProcessReadyToSuspend and CancelPrepareToSuspend
3372         message in response to receiving a PrepareToSuspend message and CancelPrepareToSuspend message,
3373         respectively. The process throttler expects to receive either a ProcessReadyToSuspend message
3374         or a CancelPrepareToSuspend message (and not both) in response to sending the message sequence
3375         PrepareToSuspend, CancelPrepareToSuspend. When a process throttler receives both messages in
3376         response to this sequence then its internal message count becomes imbalanced and it will
3377         never release the process assertion it manages. One user interaction that can cause such an
3378         imbalance, in the process throttler held by NetworkProcessProxy, is switching tabs.
3379
3380         * NetworkProcess/NetworkProcess.cpp:
3381         (WebKit::NetworkProcess::cancelPrepareToSuspend): Do not send message NetworkProcessProxy::DidCancelProcessSuspension. 
3382         * UIProcess/Network/NetworkProcessProxy.cpp:
3383         (WebKit::NetworkProcessProxy::didCancelProcessSuspension): Deleted.
3384         * UIProcess/Network/NetworkProcessProxy.h:
3385         * UIProcess/Network/NetworkProcessProxy.messages.in: Remove message NetworkProcessProxy::DidCancelProcessSuspension.
3386
3387 2015-07-21  Matthew Daiter  <mdaiter@apple.com>
3388
3389         Make sure to invalidate requests for user media after webpage reset
3390         https://bugs.webkit.org/show_bug.cgi?id=147155
3391         <rdar://problem/21924174>
3392
3393         Reviewed by Brent Fulgham.
3394
3395         * UIProcess/WebPageProxy.cpp:
3396         (WebKit::WebPageProxy::resetState): Added user media reset
3397
3398 2015-07-21  Tim Horton  <timothy_horton@apple.com>
3399
3400         [iOS] Avoid using a TextIndicator if there are non-text things to indicate
3401         https://bugs.webkit.org/show_bug.cgi?id=147152
3402         <rdar://problem/21921061>
3403
3404         Reviewed by Beth Dakin.
3405
3406         * UIProcess/ios/WKContentViewInteraction.mm:
3407         (-[WKContentView willPresentPreviewViewController:forPosition:inSourceView:]):
3408         * WebProcess/WebPage/ios/WebPageIOS.mm:
3409         (WebKit::shouldUseTextIndicatorForLink):
3410         (WebKit::WebPage::getPositionInformation):
3411         Fall back to a rectangular area instead of a TextIndicator if there are any
3412         non-inline elements inside the link.
3413
3414 2015-07-21  Andreas Kling  <akling@apple.com>
3415
3416         API::Session should clean up its storage in the network process when destroyed.
3417         <https://webkit.org/b/147139>
3418         <rdar://problem/21838764>
3419
3420         Reviewed by Anders Carlsson.
3421
3422         Have ~Session() send a DestroyPrivateBrowsingSession message to all networking processes
3423         for ephemeral sessions. This plugs a NetworkStorageSession leak that could retain a large
3424         CFNetwork object graph.
3425
3426         * UIProcess/API/APISession.cpp:
3427         (API::Session::~Session):
3428
3429 2015-07-21  Sungmann Cho  <sungmann.cho@navercorp.com>
3430
3431         Make PluginProxy::handleMouseEvent() asynchronous.
3432         https://bugs.webkit.org/show_bug.cgi?id=146142
3433
3434         Reviewed by Anders Carlsson.
3435
3436         PluginProxy::handleMouseEvent() forwards the generated mouse event to PluginControllerProxy
3437         using a synchronous message, but the recipient always reply immediately with the same value("true")
3438         even before handling the received message. So I think PluginProxy::handleMouseEvent() is perfectly
3439         OK to process its messages asynchronously.
3440
3441         * PluginProcess/PluginControllerProxy.cpp:
3442         (WebKit::PluginControllerProxy::handleMouseEvent):
3443         * PluginProcess/PluginControllerProxy.h:
3444         * PluginProcess/PluginControllerProxy.messages.in:
3445         * WebProcess/Plugins/PluginProxy.cpp:
3446         (WebKit::PluginProxy::handleMouseEvent):
3447
3448 2015-07-20  Carlos Garcia Campos  <cgarcia@igalia.com>
3449
3450         [GTK] Add API to be notified about editor state changes
3451         https://bugs.webkit.org/show_bug.cgi?id=145875
3452
3453         Reviewed by Gustavo Noronha Silva.
3454
3455         Add WebKitEditorState object, that is created on demand by the
3456         WebKitWebView and can be used to get the typing attributes of the
3457         editor at the current position or selection.
3458
3459         * PlatformGTK.cmake:
3460         * Shared/EditorState.cpp: Use part of the PostLayoutData struct
3461         for the GTK port too.
3462         (WebKit::EditorState::encode): Encode PostLayoutData for GTK and
3463         remove our custom cursorRect.
3464         (WebKit::EditorState::decode): Decode PostLayoutData for GTK and
3465         remove our custom cursorRect.
3466         (WebKit::EditorState::PostLayoutData::encode): Reorder it to
3467         reduce the amonut of ifdefs.
3468         (WebKit::EditorState::PostLayoutData::decode): Ditto.
3469         * Shared/EditorState.h: Add AttributeStrikeThrough to
3470         TypingAttributes enum.
3471         * UIProcess/API/gtk/PageClientImpl.cpp:
3472         (WebKit::PageClientImpl::selectionDidChange): Rename
3473         updateTextInputState() to selectionDidChange() and also notify the
3474         WebKitWebView.
3475         * UIProcess/API/gtk/PageClientImpl.h:
3476         * UIProcess/API/gtk/WebKitEditorState.cpp: Added.
3477         (webkitEditorStateGetProperty):