3f129d8f3eb127e311f146dad8667753c3b5edf4
[WebKit-https.git] / Source / WebKit2 / ChangeLog
1 2016-06-21  Chris Dumez  <cdumez@apple.com>
2
3         Unreviewed, rolling out r202296.
4
5         Broke basic browsing in Safari
6
7         Reverted changeset:
8
9         "WKWebView with no WKNavigationDelegate does not follow
10         universal links"
11         https://bugs.webkit.org/show_bug.cgi?id=158997
12         http://trac.webkit.org/changeset/202296
13
14 2016-06-21  Anders Carlsson  <andersca@apple.com>
15
16         Fix build.
17
18         * Configurations/FeatureDefines.xcconfig:
19
20 2016-06-21  Anders Carlsson  <andersca@apple.com>
21
22         Begin moving the Apple Pay code to the open source repository
23         https://bugs.webkit.org/show_bug.cgi?id=158998
24
25         Reviewed by Tim Horton.
26
27         * Configurations/FeatureDefines.xcconfig:
28         Add ENABLE_APPLE_PAY.
29
30 2016-06-21  Said Abou-Hallawa  <sabouhallawa@apple,com>
31
32         Add system tracing points for requestAnimationFrame() workflow
33         https://bugs.webkit.org/show_bug.cgi?id=158723
34
35         Reviewed by Simon Fraser.
36
37         Add trace points for requestAnimationFrame().
38
39         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
40         (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
41         (WebKit::RemoteLayerTreeDrawingAreaProxy::didRefreshDisplay):
42         * WebProcess/WebPage/mac/RemoteLayerTreeContext.mm:
43         (WebKit::RemoteLayerTreeContext::buildTransaction):
44         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
45         (WebKit::RemoteLayerTreeDrawingArea::didUpdate):
46         (WebKit::RemoteLayerTreeDrawingArea::BackingStoreFlusher::flush):
47
48 2016-06-21  Sam Weinig  <sam@webkit.org>
49
50         WKWebView with no WKNavigationDelegate does not follow universal links
51         <rdar://problem/24374110>
52         https://bugs.webkit.org/show_bug.cgi?id=158997
53
54         Reviewed by Dan Bernstein.
55
56         API Test:
57              WKWebView.DefaultNavigationDelegate
58
59         * UIProcess/API/Cocoa/WKWebView.mm:
60         (-[WKWebView _initializeWithConfiguration:]):
61         When initializing the WKWebView, set a default navigation client.
62
63         * UIProcess/WebPageProxy.cpp:
64         (WebKit::WebPageProxy::setLoaderClient):
65         Be sure to clear out a navigation client, if present, when setting a loader client,
66         as they are mutually exclusive.
67
68 2016-06-20  Simon Fraser  <simon.fraser@apple.com>
69
70         Focus event dispatched in iframe causes parent document to scroll incorrectly
71         https://bugs.webkit.org/show_bug.cgi?id=158629
72         rdar://problem/26521616
73
74         Reviewed by Tim Horton.
75
76         Pass SelectionRevealMode::Reveal in existing code.
77
78         * WebProcess/WebPage/WebPage.cpp:
79         (WebKit::WebPage::centerSelectionInVisibleArea):
80
81 2016-06-21  Said Abou-Hallawa  <sabouhallawa@apple,com>
82
83         [iOS][WK2] When an animation frame is missed, the UI process should immediately notify the Web process once a frame is committed
84         https://bugs.webkit.org/show_bug.cgi?id=158933
85
86         Reviewed by Simon Fraser.
87
88         When a frame is committed, the UI process schedules a CADisplayLink and waits until
89         the next didRefreshDisplay event is fired. This causes more delay in the scenario
90         where there are frames are dropped. didRefreshDisplay() should be called immediately
91         when commitLayerTree message is received and the last frame was dropped.
92
93         The fix is to have the CADisplayLink active all the times. It should be paused
94         only when we detect at least one frame is dropped. In this case we should not
95         send a message to the UI process since it has not sent the last requested LayerTree.
96         Also we should not waste the CPU time by scheduling a new CADisplayLink since we
97         have not processed the last event. We should resume CADisplayLink timer once a
98         commitLayerTree message is received.
99
100         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h:
101         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
102         (-[WKOneShotDisplayLinkHandler pause]):
103         (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
104         (WebKit::RemoteLayerTreeDrawingAreaProxy::didRefreshDisplay):
105         (-[WKOneShotDisplayLinkHandler displayLinkFired:]):
106
107 2016-06-21  Amir Alavi  <aalavi@apple.com>
108
109         Upstream WKHTTPCookiesForURL from WebKitSystemInterface to OpenSource
110         https://bugs.webkit.org/show_bug.cgi?id=158967
111
112         Reviewed by Brent Fulgham.
113
114         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
115         (InitWebCoreSystemInterface): Deleted.
116
117 2016-06-21  Dan Bernstein  <mitz@apple.com>
118
119         Inlined some picture-in-picture code.
120         https://bugs.webkit.org/show_bug.cgi?id=158977
121
122         Reviewed by Eric Carlsson.
123
124         This code was written primarily by Ada Chan, and originally reviewed by Alex Christensen,
125         Anders Carlsson, Conrad Shultz, Dan Bernstein, Eric Carlson, Jer Noble, Jeremy Jones,
126         Jon Lee, Remy Demarest, and Zach Li.
127
128         * Shared/WebPreferencesStoreDefaultsAdditions.cpp:
129           Define and use DEFAULT_ALLOWS_PICTURE_IN_PICTURE_MEDIA_PLAYBACK.
130
131         * Shared/WebPreferencesStore.cpp:
132         (WebKit::defaults): Removed include of WebPreferencesStoreDefaultsAdditions.cpp now that the
133           default is defined correctly in WebPreferencesStoreDefaultsAdditions.cpp.
134
135         * UIProcess/API/C/WKPreferences.cpp: Inlined WKPreferencesAdditions.cpp.
136         * UIProcess/API/C/WKPreferencesRefPrivate.h: Ditto.
137
138         * WebProcess/cocoa/WebVideoFullscreenManager.mm: Inlined WebVideoFullscreenManagerSupportsVideoFullscreenMac.mm.
139
140 2016-06-21  Carlos Garcia Campos  <cgarcia@igalia.com>
141
142         [GTK] Web view is not redrawn when reparented in force compositing mode
143         https://bugs.webkit.org/show_bug.cgi?id=158689
144
145         Reviewed by Žan Doberšek.
146
147         When the web view is reparented in accelerated compositing mode, the UI process always exits the accelerated
148         mode when the view is unrealized, because the native surface handle for compositing is destroyed, but it doesn't
149         enter again when the view is realized and a new native surface handle for compositing is used. This happens
150         because the UI and Web processes are not in sync regarding whether the page is in accelerated compositing or
151         not. The Web process never exits accelerated mode when compositing mode is forced, but the UI process doesn't
152         check that setting at all.
153
154         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
155         (webkitWebViewBaseResizeRedirectedWindow): Helper function to ensure the redirected window size is properly updated.
156         (webkitWebViewBaseRealize): Resize the redirected window if the view is already in AC mode when realized.
157         (webkitWebViewRenderAcceleratedCompositingResults): Use webkitWebViewBaseResizeRedirectedWindow().
158         (webkitWebViewBaseSizeAllocate): Ditto.
159         (webkitWebViewBaseWillEnterAcceleratedCompositingMode): Ditto.
160         * UIProcess/DrawingAreaProxyImpl.cpp:
161         (WebKit::DrawingAreaProxyImpl::alwaysUseCompositing): Return true in force compositing mode.
162         (WebKit::DrawingAreaProxyImpl::enterAcceleratedCompositingMode): Update assert.
163         (WebKit::DrawingAreaProxyImpl::exitAcceleratedCompositingMode): Do not exit AC mode compositing mode is always enabled.
164         * UIProcess/DrawingAreaProxyImpl.h:
165         (WebKit::DrawingAreaProxyImpl::isInAcceleratedCompositingMode): Return true also in force compositing mode.
166         * UIProcess/gtk/RedirectedXCompositeWindow.cpp:
167         (WebKit::RedirectedXCompositeWindow::surface): Ensure we never return an uninitialized surface to prevent
168         rendering artifacts in in force compositing mode when waiting for the first update on the redirected window.
169
170 2016-06-20  Commit Queue  <commit-queue@webkit.org>
171
172         Unreviewed, rolling out r202243.
173         https://bugs.webkit.org/show_bug.cgi?id=158972
174
175         Broke Windows build and iOS tests (Requested by ap on
176         #webkit).
177
178         Reverted changeset:
179
180         "Focus event dispatched in iframe causes parent document to
181         scroll incorrectly"
182         https://bugs.webkit.org/show_bug.cgi?id=158629
183         http://trac.webkit.org/changeset/202243
184
185 2016-06-20  Brent Fulgham  <bfulgham@apple.com>
186
187         Allow Spotlight suggestions to be read by any process
188         https://bugs.webkit.org/show_bug.cgi?id=158950
189         <rdar://problem/26865374>
190
191         Reviewed by Alexey Proskuryakov.
192
193         Extend sandbox to allow all web processes to read Spotlight results.
194
195         * Resources/PlugInSandboxProfiles/com.apple.WebKit.plugin-common.sb:
196         * WebProcess/com.apple.WebProcess.sb.in:
197
198 2016-06-20  Simon Fraser  <simon.fraser@apple.com>
199
200         Focus event dispatched in iframe causes parent document to scroll incorrectly
201         https://bugs.webkit.org/show_bug.cgi?id=158629
202         rdar://problem/26521616
203
204         Reviewed by Tim Horton.
205
206         Pass SelectionRevealMode::Reveal in existing code.
207
208         * WebProcess/WebPage/WebPage.cpp:
209         (WebKit::WebPage::centerSelectionInVisibleArea):
210
211 2016-06-20  Keith Rollin  <krollin@apple.com>
212
213         Remove RefPtr::release() and change calls sites to use WTFMove()
214         https://bugs.webkit.org/show_bug.cgi?id=158369
215
216         Reviewed by Chris Dumez.
217
218         RefPtr::release() releases its managed pointer awkwardly. It's more
219         direct and clearer to use WTFMove to transfer ownership of the managed
220         pointer.
221
222         As part of this cleanup, also change a lot of explicit data types to
223         'auto'.
224
225         * DatabaseProcess/DatabaseProcess.cpp:
226         (WebKit::DatabaseProcess::createDatabaseToWebProcessConnection):
227         * NetworkProcess/NetworkProcess.cpp:
228         (WebKit::NetworkProcess::createNetworkConnectionToWebProcess):
229         * NetworkProcess/NetworkResourceLoadParameters.cpp:
230         (WebKit::NetworkResourceLoadParameters::decode):
231         * NetworkProcess/cache/NetworkCacheEntry.cpp:
232         (WebKit::NetworkCache::Entry::initializeShareableResourceHandleFromStorageRecord):
233         * Platform/mac/SharedMemoryMac.cpp:
234         (WebKit::SharedMemory::allocate):
235         (WebKit::SharedMemory::create):
236         (WebKit::SharedMemory::map):
237         * PluginProcess/PluginProcess.cpp:
238         (WebKit::PluginProcess::createWebProcessConnection):
239         * Shared/API/Cocoa/WKRemoteObjectCoder.mm:
240         (encodeToObjectStream):
241         * Shared/API/c/WKImage.cpp:
242         (WKImageCreate):
243         * Shared/API/c/WKNumber.cpp:
244         (WKBooleanCreate):
245         (WKDoubleCreate):
246         (WKUInt64Create):
247         * Shared/API/c/WKSecurityOriginRef.cpp:
248         (WKSecurityOriginCreate):
249         * Shared/API/c/WKSerializedScriptValue.cpp:
250         (WKSerializedScriptValueCreate):
251         (WKSerializedScriptValueCreateWithInternalRepresentation):
252         * Shared/API/c/cairo/WKImageCairo.cpp:
253         (WKImageCreateFromCairoSurface):
254         * Shared/API/c/cg/WKImageCG.cpp:
255         (WKImageCreateFromCGImage):
256         * Shared/API/c/mac/WKCertificateInfoMac.mm:
257         (WKCertificateInfoCreateWithCertficateChain):
258         * Shared/API/c/mac/WKObjCTypeWrapperRef.mm:
259         (WKObjCTypeWrapperCreate):
260         * Shared/API/c/mac/WKWebArchive.cpp:
261         (WKWebArchiveCreate):
262         (WKWebArchiveCreateWithData):
263         (WKWebArchiveCreateFromRange):
264         (WKWebArchiveCopyMainResource):
265         (WKWebArchiveCopySubresources):
266         (WKWebArchiveCopySubframeArchives):
267         * Shared/API/c/mac/WKWebArchiveResource.cpp:
268         (WKWebArchiveResourceCreate):
269         * Shared/APIWebArchive.mm:
270         (API::WebArchive::WebArchive):
271         * Shared/Plugins/Netscape/NetscapePluginModule.cpp:
272         (WebKit::NetscapePluginModule::getOrCreate):
273         * Shared/ShareableBitmap.cpp:
274         (WebKit::ShareableBitmap::create):
275         * Shared/ShareableResource.cpp:
276         (WebKit::ShareableResource::map):
277         * Shared/gtk/ArgumentCodersGtk.cpp:
278         (IPC::ArgumentCoder<DragData>::decode):
279         * UIProcess/API/C/CoordinatedGraphics/WKView.cpp:
280         (WKViewCreate):
281         * UIProcess/API/C/WKBatteryStatus.cpp:
282         (WKBatteryStatusCreate):
283         * UIProcess/API/C/WKGeolocationPosition.cpp:
284         (WKGeolocationPositionCreate_b):
285         * UIProcess/API/C/WKGrammarDetail.cpp:
286         (WKGrammarDetailCreate):
287         * UIProcess/API/C/WKPage.cpp:
288         (WKPageCopySessionState):
289         * UIProcess/API/C/WKPageGroup.cpp:
290         (WKPageGroupCreateWithIdentifier):
291         * UIProcess/API/C/WKPreferences.cpp:
292         (WKPreferencesCreate):
293         (WKPreferencesCreateWithIdentifier):
294         (WKPreferencesCreateCopy):
295         * UIProcess/API/C/WKSessionRef.cpp:
296         (WKSessionCreate):
297         * UIProcess/API/C/WKSessionStateRef.cpp:
298         (WKSessionStateCopyData):
299         * UIProcess/API/C/mac/WKContextPrivateMac.mm:
300         (WKContextCopyPlugInInfoForBundleIdentifier):
301         * UIProcess/API/Cocoa/WKWebView.mm:
302         (-[WKWebView loadRequest:]):
303         (-[WKWebView loadFileURL:allowingReadAccessToURL:]):
304         (-[WKWebView loadData:MIMEType:characterEncodingName:baseURL:]):
305         (-[WKWebView goToBackForwardListItem:]):
306         (-[WKWebView goBack]):
307         (-[WKWebView goForward]):
308         (-[WKWebView reload]):
309         (-[WKWebView reloadFromOrigin]):
310         (-[WKWebView _loadData:MIMEType:characterEncodingName:baseURL:userData:]):
311         (-[WKWebView _reloadWithoutContentBlockers]):
312         (-[WKWebView _sessionStateData]):
313         (-[WKWebView _restoreSessionState:andNavigate:]):
314         * UIProcess/API/efl/ewk_database_manager.cpp:
315         (EwkDatabaseManager::createOriginList):
316         * UIProcess/API/efl/ewk_storage_manager.cpp:
317         (EwkStorageManager::createOriginList):
318         * UIProcess/API/gtk/WebKitWebView.cpp:
319         (webkitWebViewCreateNewPage):
320         (webkitWebViewPrintFrame):
321         (getContentsAsMHTMLDataCallback):
322         * UIProcess/Cocoa/SessionStateCoding.mm:
323         (WebKit::encodeSessionState):
324         * UIProcess/GenericCallback.h:
325         (WebKit::CallbackMap::take):
326         * UIProcess/GeolocationPermissionRequestManagerProxy.cpp:
327         (WebKit::GeolocationPermissionRequestManagerProxy::createRequest):
328         * UIProcess/Network/NetworkProcessProxy.cpp:
329         (WebKit::NetworkProcessProxy::didReceiveAuthenticationChallenge):
330         * UIProcess/Notifications/NotificationPermissionRequestManagerProxy.cpp:
331         (WebKit::NotificationPermissionRequestManagerProxy::createRequest):
332         * UIProcess/Plugins/PluginProcessManager.cpp:
333         (WebKit::PluginProcessManager::getOrCreatePluginProcess):
334         * UIProcess/Storage/StorageManager.cpp:
335         (WebKit::StorageManager::StorageArea::setItem):
336         (WebKit::StorageManager::StorageArea::removeItem):
337         (WebKit::StorageManager::createLocalStorageMap):
338         * UIProcess/WebBackForwardList.cpp:
339         (WebKit::WebBackForwardList::addItem):
340         (WebKit::WebBackForwardList::clear):
341         * UIProcess/WebCookieManagerProxy.cpp:
342         (WebKit::WebCookieManagerProxy::getHostnamesWithCookies):
343         (WebKit::WebCookieManagerProxy::getHTTPCookieAcceptPolicy):
344         * UIProcess/WebPageProxy.cpp:
345         (WebKit::WebPageProxy::installViewStateChangeCompletionHandler):
346         * UIProcess/WebPreferences.cpp:
347         (WebKit::WebPreferences::createWithLegacyDefaults):
348         (WebKit::WebPreferences::copy):
349         * UIProcess/WebProcessPool.cpp:
350         (WebKit::WebProcessPool::~WebProcessPool):
351         * UIProcess/mac/ViewSnapshotStore.mm:
352         (WebKit::ViewSnapshotStore::recordSnapshot):
353         * UIProcess/mac/WKImmediateActionController.mm:
354         (-[WKImmediateActionController _webHitTestResult]):
355         * UIProcess/mac/WKPrintingView.mm:
356         (-[WKPrintingView _askPageToComputePageRects]):
357         * UIProcess/mac/WebPageProxyMac.mm:
358         (WebKit::WebPageProxy::setDragImage):
359         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFrame.mm:
360         (-[WKWebProcessPlugInFrame hitTest:]):
361         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInHitTestResult.mm:
362         (-[WKWebProcessPlugInHitTestResult nodeHandle]):
363         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.mm:
364         (+[WKWebProcessPlugInNodeHandle nodeHandleWithJSValue:inContext:]):
365         (-[WKWebProcessPlugInNodeHandle htmlIFrameElementContentFrame]):
366         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInScriptWorld.mm:
367         (+[WKWebProcessPlugInScriptWorld world]):
368         * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
369         (WKBundlePostSynchronousMessage):
370         * WebProcess/InjectedBundle/API/c/WKBundleDOMWindowExtension.cpp:
371         (WKBundleDOMWindowExtensionCreate):
372         * WebProcess/InjectedBundle/API/c/WKBundleHitTestResult.cpp:
373         (WKBundleHitTestResultCopyNodeHandle):
374         (WKBundleHitTestResultCopyURLElementHandle):
375         * WebProcess/InjectedBundle/API/c/WKBundleNavigationAction.cpp:
376         (WKBundleNavigationActionCopyHitTestResult):
377         (WKBundleNavigationActionCopyFormElement):
378         * WebProcess/InjectedBundle/API/c/WKBundleNodeHandle.cpp:
379         (WKBundleNodeHandleCreate):
380         (WKBundleNodeHandleCopyDocument):
381         (WKBundleNodeHandleCopySnapshotWithOptions):
382         (WKBundleNodeHandleCopyVisibleRange):
383         (WKBundleNodeHandleCopyHTMLTableCellElementCellAbove):
384         (WKBundleNodeHandleCopyDocumentFrame):
385         (WKBundleNodeHandleCopyHTMLFrameElementContentFrame):
386         (WKBundleNodeHandleCopyHTMLIFrameElementContentFrame):
387         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
388         (WKBundlePageCreateSnapshotWithOptions):
389         (WKBundlePageCreateSnapshotInViewCoordinates):
390         (WKBundlePageCreateSnapshotInDocumentCoordinates):
391         (WKBundlePageCreateScaledSnapshotInDocumentCoordinates):
392         (WKBundlePagePostSynchronousMessageForTesting):
393         * WebProcess/InjectedBundle/API/c/WKBundleRangeHandle.cpp:
394         (WKBundleRangeHandleCreate):
395         (WKBundleRangeHandleCopySnapshotWithOptions):
396         * WebProcess/InjectedBundle/API/c/WKBundleScriptWorld.cpp:
397         (WKBundleScriptWorldCreateWorld):
398         * WebProcess/InjectedBundle/API/mac/WKDOMNode.mm:
399         (-[WKDOMNode _copyBundleNodeHandleRef]):
400         * WebProcess/InjectedBundle/API/mac/WKDOMRange.mm:
401         (-[WKDOMRange _copyBundleRangeHandleRef]):
402         * WebProcess/InjectedBundle/DOM/InjectedBundleCSSStyleDeclarationHandle.cpp:
403         (WebKit::InjectedBundleCSSStyleDeclarationHandle::getOrCreate):
404         * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp:
405         (WebKit::imageForRect):
406         (WebKit::InjectedBundleNodeHandle::renderedImage):
407         * WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp:
408         (WebKit::InjectedBundleRangeHandle::getOrCreate):
409         * WebProcess/InjectedBundle/InjectedBundle.cpp:
410         (WebKit::InjectedBundle::create):
411         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
412         (WebKit::NetscapePlugin::loadURL):
413         * WebProcess/Plugins/PDF/DeprecatedPDFPlugin.mm:
414         (WebKit::PDFPlugin::createScrollbar):
415         * WebProcess/Storage/StorageAreaMap.cpp:
416         (WebKit::StorageAreaMap::applyChange):
417         * WebProcess/WebCoreSupport/SessionStateConversion.cpp:
418         (WebKit::toFormData):
419         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
420         (WebKit::WebFrameLoaderClient::createPlugin):
421         (WebKit::WebFrameLoaderClient::recreatePlugin):
422         (WebKit::WebFrameLoaderClient::createJavaAppletWidget):
423         (WebKit::WebFrameLoaderClient::createNetworkingContext):
424         * WebProcess/WebCoreSupport/WebInspectorClient.cpp:
425         (WebKit::WebInspectorClient::highlight):
426         * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
427         (WebKit::convertImageToBitmap):
428         * WebProcess/WebPage/FindController.cpp:
429         (WebKit::FindController::updateFindUIAfterPageScroll):
430         * WebProcess/WebPage/VisitedLinkTableController.cpp:
431         (WebKit::VisitedLinkTableController::getOrCreate):
432         (WebKit::VisitedLinkTableController::setVisitedLinkTable):
433         * WebProcess/WebPage/WebFrame.cpp:
434         (WebKit::WebFrame::createWithCoreMainFrame):
435         (WebKit::WebFrame::createSubframe):
436         (WebKit::WebFrame::create):
437         (WebKit::WebFrame::createSelectionSnapshot):
438         * WebProcess/WebPage/WebPage.cpp:
439         (WebKit::WebPage::createPlugin):
440         (WebKit::WebPage::snapshotAtSize):
441         (WebKit::WebPage::snapshotNode):
442         (WebKit::WebPage::willPerformLoadDragDestinationAction):
443         (WebKit::WebPage::SandboxExtensionTracker::didStartProvisionalLoad):
444         (WebKit::WebPage::SandboxExtensionTracker::didCommitProvisionalLoad):
445         (WebKit::WebPage::drawRectToImage):
446         * WebProcess/WebPage/WebPageGroupProxy.cpp:
447         (WebKit::WebPageGroupProxy::create):
448         * WebProcess/WebPage/mac/PlatformCAAnimationRemote.mm:
449         (WebKit::PlatformCAAnimationRemote::Properties::decode):
450         * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
451         (WebKit::PlatformCALayerRemote::create):
452         (WebKit::PlatformCALayerRemote::clone):
453         * WebProcess/WebPage/mac/PlatformCALayerRemoteCustom.mm:
454         (WebKit::PlatformCALayerRemoteCustom::create):
455         (WebKit::PlatformCALayerRemoteCustom::clone):
456         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
457         (WebKit::RemoteLayerTreeDrawingArea::createDisplayRefreshMonitor):
458
459 2016-06-20  Commit Queue  <commit-queue@webkit.org>
460
461         Unreviewed, rolling out r202179.
462         https://bugs.webkit.org/show_bug.cgi?id=158946
463
464         The test either fails or times out 100% of the time (Requested
465         by ap on #webkit).
466
467         Reverted changeset:
468
469         "REGRESSION: Double tap to zoom does not work on yahoo
470         finance"
471         https://bugs.webkit.org/show_bug.cgi?id=158886
472         http://trac.webkit.org/changeset/202179
473
474 2016-06-20  Tim Horton  <timothy_horton@apple.com>
475
476         REGRESSION (r191499): Tab content "jumps" down when focusing tabs that load in the background
477         https://bugs.webkit.org/show_bug.cgi?id=158904
478         <rdar://problem/26025831>
479
480         Reviewed by Sam Weinig.
481
482         * UIProcess/Cocoa/WebViewImpl.h:
483         * UIProcess/Cocoa/WebViewImpl.mm:
484         (WebKit::WebViewImpl::viewDidMoveToWindow):
485         During the large refactor that was r191499, we somehow ended up with two
486         different members for the same thing - one that got written, and one that
487         got read. We should only have one.
488
489 2016-06-20  Tim Horton  <timothy_horton@apple.com>
490
491         Try to fix the iOS build after r202142 and r202224.
492
493         * Shared/mac/RemoteLayerBackingStore.mm:
494         (WebKit::RemoteLayerBackingStore::applyBackingStoreToLayer):
495
496 2016-06-19  Simon Fraser  <simon.fraser@apple.com>
497
498         Fix erroneously commented line added in r202142.
499
500         * Shared/mac/RemoteLayerBackingStore.mm:
501         (WebKit::RemoteLayerBackingStore::applyBackingStoreToLayer):
502
503 2016-06-16  Enrica Casucci  <enrica@apple.com>
504
505         Support configurable autocapitalization.
506         https://bugs.webkit.org/show_bug.cgi?id=158860
507         rdar://problem/26231403
508
509         Reviewed by Tim Horton.
510
511         The behavior of spellchecker should be configurable to avoid
512         unwanted autocapitalization.
513
514         * UIProcess/API/APIPageConfiguration.cpp:
515         (API::PageConfiguration::copy):
516         * UIProcess/API/APIPageConfiguration.h:
517         (API::PageConfiguration::initialCapitalizationEnabled):
518         (API::PageConfiguration::setInitialCapitalizationEnabled):
519         * UIProcess/API/C/WKPageConfigurationRef.cpp:
520         (WKPageConfigurationSetIntialCapitalizationEnabled):
521         * UIProcess/API/C/WKPageConfigurationRef.h:
522         * UIProcess/API/Cocoa/WKWebView.mm:
523         (-[WKWebView _initializeWithConfiguration:]):
524         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
525         (-[WKWebViewConfiguration copyWithZone:]):
526         (-[WKWebViewConfiguration _initialCapitalizationEnabled]):
527         (-[WKWebViewConfiguration _setInitialCapitalizationEnabled:]):
528         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
529         * UIProcess/TextChecker.h:
530         * UIProcess/WebPageProxy.cpp:
531         (WebKit::WebPageProxy::WebPageProxy):
532         (WebKit::WebPageProxy::checkTextOfParagraph):
533         (WebKit::WebPageProxy::getGuessesForWord):
534         * UIProcess/WebPageProxy.h:
535         * UIProcess/efl/TextCheckerEfl.cpp:
536         (WebKit::TextChecker::checkTextOfParagraph):
537         (WebKit::TextChecker::getGuessesForWord):
538         * UIProcess/gtk/TextCheckerGtk.cpp:
539         (WebKit::TextChecker::getGuessesForWord):
540         (WebKit::TextChecker::checkTextOfParagraph):
541         * UIProcess/ios/TextCheckerIOS.mm:
542         (WebKit::TextChecker::checkTextOfParagraph):
543         (WebKit::TextChecker::getGuessesForWord):
544         * UIProcess/mac/TextCheckerMac.mm:
545         (WebKit::TextChecker::checkTextOfParagraph):
546         (WebKit::TextChecker::getGuessesForWord):
547
548 2016-06-17  Chris Dumez  <cdumez@apple.com>
549
550         Use WTF::NoncopyableFunction in NetworkDataTaskClient
551         https://bugs.webkit.org/show_bug.cgi?id=158887
552
553         Reviewed by Alex Christensen.
554
555         Use WTF::NoncopyableFunction in NetworkDataTaskClient instead of std::function
556         and consistently move it around. This avoids some unnecessary copying.
557
558         * NetworkProcess/Downloads/DownloadManager.cpp:
559         (WebKit::DownloadManager::willDecidePendingDownloadDestination):
560         (WebKit::DownloadManager::continueDecidePendingDownloadDestination):
561         * NetworkProcess/Downloads/DownloadManager.h:
562         * NetworkProcess/NetworkDataTask.h:
563         * NetworkProcess/NetworkLoad.cpp:
564         (WebKit::NetworkLoad::willPerformHTTPRedirection):
565         (WebKit::NetworkLoad::didReceiveChallenge):
566         (WebKit::NetworkLoad::didReceiveResponseNetworkSession):
567         (WebKit::NetworkLoad::continueCanAuthenticateAgainstProtectionSpace):
568         * NetworkProcess/NetworkLoad.h:
569         * NetworkProcess/NetworkProcess.cpp:
570         (WebKit::NetworkProcess::findPendingDownloadLocation):
571         * NetworkProcess/NetworkProcess.h:
572         * NetworkProcess/PingLoad.h:
573         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
574         (WebKit::NetworkDataTask::didReceiveChallenge):
575         (WebKit::NetworkDataTask::didReceiveResponse):
576         (WebKit::NetworkDataTask::willPerformHTTPRedirection):
577         (WebKit::NetworkDataTask::tryPasswordBasedAuthentication):
578         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
579         (-[WKNetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:]):
580         * Shared/Authentication/AuthenticationManager.cpp:
581         (WebKit::AuthenticationManager::addChallengeToChallengeMap):
582         (WebKit::AuthenticationManager::coalesceChallengesMatching):
583         (WebKit::AuthenticationManager::didReceiveAuthenticationChallenge):
584         (WebKit::AuthenticationManager::tryUseCertificateInfoForChallenge):
585         (WebKit::AuthenticationManager::useCredentialForSingleChallenge):
586         * Shared/Authentication/AuthenticationManager.h:
587         * Shared/Authentication/mac/AuthenticationManager.mac.mm:
588         (WebKit::AuthenticationManager::tryUseCertificateInfoForChallenge):
589
590 2016-06-17  Antoine Quint  <graouts@apple.com>
591
592         Web video playback controls should have RTL volume slider
593         https://bugs.webkit.org/show_bug.cgi?id=158856
594         <rdar://problem/25971769>
595
596         Reviewed by Tim Horton.
597
598         We now call setUserInterfaceLayoutDirection() on WebCore::Page to propagate
599         the user interface layout direction down to the Web content. To facilitate this,
600         the UserInterfaceLayoutDirection enum is now defined in WebCore.
601
602         * Shared/WebPageCreationParameters.h:
603         * UIProcess/API/Cocoa/WKWebView.mm:
604         (convertSystemLayoutDirection):
605         (toUserInterfaceLayoutDirection):
606         * UIProcess/API/gtk/PageClientImpl.h:
607         * UIProcess/Cocoa/WebViewImpl.h:
608         * UIProcess/Cocoa/WebViewImpl.mm:
609         (WebKit::toUserInterfaceLayoutDirection):
610         (WebKit::WebViewImpl::userInterfaceLayoutDirection):
611         * UIProcess/PageClient.h:
612         * UIProcess/WebPageProxy.cpp:
613         (WebKit::WebPageProxy::userInterfaceLayoutDirection):
614         (WebKit::WebPageProxy::setUserInterfaceLayoutDirection):
615         * UIProcess/WebPageProxy.h:
616         * UIProcess/efl/WebView.h:
617         * UIProcess/ios/PageClientImplIOS.h:
618         * UIProcess/ios/PageClientImplIOS.mm:
619         (WebKit::PageClientImpl::userInterfaceLayoutDirection):
620         * UIProcess/mac/PageClientImpl.h:
621         * UIProcess/mac/PageClientImpl.mm:
622         (WebKit::PageClientImpl::userInterfaceLayoutDirection):
623         * UIProcess/mac/ViewGestureControllerMac.mm:
624         (WebKit::ViewGestureController::PendingSwipeTracker::scrollEventCanBecomeSwipe):
625         (WebKit::ViewGestureController::isPhysicallySwipingLeft):
626         * WebProcess/WebPage/WebPage.cpp:
627         (WebKit::m_userInterfaceLayoutDirection):
628         (WebKit::WebPage::setUserInterfaceLayoutDirection):
629         * WebProcess/WebPage/WebPage.h:
630         * WebProcess/WebPage/mac/WebPageMac.mm:
631         (WebKit::WebPage::performNonEditingBehaviorForSelector):
632
633 2016-06-17  Dean Jackson  <dino@apple.com>
634
635         REGRESSION: Double tap to zoom does not work on yahoo finance
636         https://bugs.webkit.org/show_bug.cgi?id=158886
637         <rdar://problem/24917760>
638
639         Reviewed by Simon Fraser.
640
641         We shouldn't enable fast click on pages that have
642         had to shrink to fit. In other words, we should enable
643         double-tap-to-zoom if the page has already zoomed.
644
645         Test: fast/events/ios/viewport-shrink-to-fit-allows-double-tap.html
646
647         * UIProcess/API/Cocoa/WKWebView.mm:
648         (-[WKWebView _allowsDoubleTapGestures]):
649
650 2016-06-16  Chris Dumez  <cdumez@apple.com>
651
652         No need to ref connection in lambda inside NetworkResourceLoader::tryStoreAsCacheEntry()
653         https://bugs.webkit.org/show_bug.cgi?id=158862
654
655         Reviewed by Darin Adler.
656
657         No need to ref connection in lambda inside NetworkResourceLoader::tryStoreAsCacheEntry().
658         We already ref the NetworkResourceLoader which hold a ref to the connection. Also update
659         the lambda capture to use Ref<> for the NetworkResourceLoader instead of RefPtr<>.
660         Switch callback type from std::function to WTF::NoncopyableFunction so we can capture a
661         Ref<>.
662
663         * NetworkProcess/NetworkResourceLoader.cpp:
664         (WebKit::NetworkResourceLoader::tryStoreAsCacheEntry):
665         * NetworkProcess/cache/NetworkCache.cpp:
666         (WebKit::NetworkCache::Cache::store):
667         * NetworkProcess/cache/NetworkCache.h:
668         * NetworkProcess/cache/NetworkCacheStorage.cpp:
669         (WebKit::NetworkCache::Storage::WriteOperation::WriteOperation):
670         * NetworkProcess/cache/NetworkCacheStorage.h:
671
672 2016-06-16  Chris Dumez  <cdumez@apple.com>
673
674         [WK2] Improve serialization of SubresourcesEntry to network disk cache
675         https://bugs.webkit.org/show_bug.cgi?id=158851
676
677         Reviewed by Antti Koivisto.
678
679         Improve serialization of SubresourcesEntry to network disk cache:
680         - Do not bother serializing SubresourceInfo's first party for cookies
681           and HTTP headers data members if the resource is transient. This is
682           because those are never used for transient resources. This patch also
683           makes it so that we do not even bother initializing those data members
684           if the transient flag is set.
685         - Update SubresourceInfo::encode() / decode() to encode and decode
686           the HTTPHeaderMap data member with the right NetworkCache::Coder
687           template specialization instead of using directly HTTPHeaderMap::decode()
688           and HTTPHeaderMap::encode(). HTTPHeaderMap::decode() / encode() is
689           unsafe in the disk cache case (see r200394).
690
691         Also update entry types as so:
692         - "resource" -> "Resource"
693         - "subresources" -> "SubResources"
694
695         These entry types are used a folder names in the disk cache and other
696         folder names were capitalized. Antti suggested this was a good time
697         to harmonize since we're bumping the cache version.
698
699         * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
700         (WebKit::NetworkCache::constructRevalidationRequest):
701         (WebKit::NetworkCache::SpeculativeLoadManager::startSpeculativeRevalidation):
702         * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.h:
703         * NetworkProcess/cache/NetworkCacheStorage.h:
704         * NetworkProcess/cache/NetworkCacheSubresourcesEntry.cpp:
705         (WebKit::NetworkCache::SubresourceInfo::encode):
706         (WebKit::NetworkCache::SubresourceInfo::decode):
707         * NetworkProcess/cache/NetworkCacheSubresourcesEntry.h:
708         (WebKit::NetworkCache::SubresourceInfo::SubresourceInfo):
709         (WebKit::NetworkCache::SubresourceInfo::isTransient):
710         (WebKit::NetworkCache::SubresourceInfo::firstPartyForCookies):
711         (WebKit::NetworkCache::SubresourceInfo::requestHeaders):
712
713 2016-06-16  Anders Carlsson  <andersca@apple.com>
714
715         Fix macOS Sierra build
716         https://bugs.webkit.org/show_bug.cgi?id=158849
717
718         Reviewed by Tim Horton.
719
720         Add WebCore:: qualifiers for IOSurface, to avoid conflicts with the IOSurface Objective-C class
721         and adopt IOSurface::asLayerContents().
722
723         * Shared/mac/RemoteLayerBackingStore.mm:
724         (WebKit::RemoteLayerBackingStore::decode):
725         (WebKit::RemoteLayerBackingStore::bytesPerPixel):
726         (WebKit::RemoteLayerBackingStore::swapToValidFrontBuffer):
727         (WebKit::RemoteLayerBackingStore::applyBackingStoreToLayer):
728         (WebKit::RemoteLayerBackingStore::setBufferVolatility):
729         (WebKit::RemoteLayerBackingStore::Buffer::discard):
730         * UIProcess/mac/ViewSnapshotStore.mm:
731         (WebKit::ViewSnapshot::create):
732         (WebKit::ViewSnapshot::ViewSnapshot):
733         (WebKit::ViewSnapshot::asLayerContents):
734
735 2016-06-16  Brady Eidson  <beidson@apple.com>
736
737         When a WebsiteDataStore finds no ProcessPools and creates one from scratch, it should represent the data store's config.
738         rdar://problem/26586991 and https://bugs.webkit.org/show_bug.cgi?id=158844
739
740         Reviewed by Anders Carlsson.
741
742         * UIProcess/API/APIProcessPoolConfiguration.cpp:
743         (API::ProcessPoolConfiguration::createWithWebsiteDataStoreConfiguration):
744         * UIProcess/API/APIProcessPoolConfiguration.h:
745
746         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
747         (WebKit::WebsiteDataStore::WebsiteDataStore):
748         (WebKit::WebsiteDataStore::fetchData):
749         (WebKit::WebsiteDataStore::removeData):
750         (WebKit::WebsiteDataStore::processPools):
751         * UIProcess/WebsiteData/WebsiteDataStore.h:
752
753 2016-06-15  Simon Fraser  <simon.fraser@apple.com>
754
755         [iOS WK2] On iPad, indirect focussing of a text field doesn't always scroll to the correct location
756         https://bugs.webkit.org/show_bug.cgi?id=158828
757
758         Reviewed by Enrica Casucci.
759         
760         WebPage::getAssistedNodeInformation() unconditionally set information.selectionRect()
761         to a 1x1 rect at the last interaction location. This caused -[WKWebView _zoomToFocusRect:...]
762         to early return under the !forceScroll clause if the last interaction rect was visible, but
763         the elementRect was not. This would happen, for example, if a click in a <button> focussed
764         an input on some other portion of the page. This behavior is iPad-only, because forceScroll
765         is only NO there.
766         
767         Fix by making getAssistedNodeInformation() only set the selectionRect to the last interaction
768         location if that is inside of the elementRect (this caters to the case where a tap is inside
769         an input which is larger than the screen). Otherwise, set it to the empty rect.
770         
771         Make this testable by allowing a test to opt into the iPad-style scrolling/zooming behavior
772         in this code path (essentially, making forceScroll NO for testing), via testing SPI on WKWebView,
773         plumbed through to WKContentView.
774
775         * UIProcess/API/Cocoa/WKWebView.mm:
776         (-[WKWebView forceIPadStyleZoomOnInputFocus]):
777         (-[WKWebView setForceIPadStyleZoomOnInputFocus:]):
778         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
779         * UIProcess/ios/WKContentViewInteraction.h:
780         * UIProcess/ios/WKContentViewInteraction.mm:
781         (-[WKContentView _displayFormNodeInputView]):
782         (-[WKContentView requiresAccessoryView:]):
783         (-[WKContentView inputAccessoryView]):
784         (-[WKContentView forceIPadStyleZoomOnInputFocus]):
785         (-[WKContentView setForceIPadStyleZoomOnInputFocus:]):
786         (-[WKContentView requiresAccessoryView]): Remove redundant returns, and allow testing to
787         override the "isIPad" condition.
788         * WebProcess/WebPage/ios/WebPageIOS.mm:
789         (WebKit::WebPage::getAssistedNodeInformation):
790
791 2016-06-15  Sam Weinig  <sam@webkit.org>
792
793         Forward/Back keyboard shortcuts need to flip for RTL
794         https://bugs.webkit.org/show_bug.cgi?id=158823
795         <rdar://problem/25975359>
796
797         Reviewed by Darin Adler.
798
799         Pipe the UserInterfaceLayoutDirection down to the WebContentProcess on initialization
800         and when it changes, and use it to flip the behavior of command-left and command-right
801         when in RTL mode.
802
803         Tests:
804             WebKit2_CommandBackForwardTestWKView.LTR
805             WebKit2_CommandBackForwardTestWKView.RTL
806             WebKit2_CommandBackForwardTestWKWebView.LTR
807             WebKit2_CommandBackForwardTestWKWebView.RTL
808
809         * Shared/WebPageCreationParameters.cpp:
810         (WebKit::WebPageCreationParameters::encode):
811         (WebKit::WebPageCreationParameters::decode):
812         * Shared/WebPageCreationParameters.h:
813         * UIProcess/API/Cocoa/WKWebView.mm:
814         (-[WKWebView _webViewPrintFormatter]):
815         (-[WKWebView setSemanticContentAttribute:]):
816         (-[WKWebView _printOperationWithPrintInfo:forFrame:]):
817         (-[WKWebView setUserInterfaceLayoutDirection:]):
818         * UIProcess/API/mac/WKView.mm:
819         (-[WKView setUserInterfaceLayoutDirection:]):
820         * UIProcess/Cocoa/WebViewImpl.h:
821         * UIProcess/Cocoa/WebViewImpl.mm:
822         (WebKit::WebViewImpl::windowIsFrontWindowUnderMouse):
823         (WebKit::toUserInterfaceLayoutDirection):
824         (WebKit::WebViewImpl::userInterfaceLayoutDirection):
825         (WebKit::WebViewImpl::setUserInterfaceLayoutDirection):
826         * UIProcess/WebPageProxy.cpp:
827         (WebKit::WebPageProxy::creationParameters):
828         (WebKit::WebPageProxy::userInterfaceLayoutDirection):
829         (WebKit::WebPageProxy::setUserInterfaceLayoutDirection):
830         * UIProcess/WebPageProxy.h:
831         (WebKit::WebPageProxy::hasHadSelectionChangesFromUserInteraction):
832         * UIProcess/ios/WKContentView.mm:
833         (-[WKContentView _commonInitializationWithProcessPool:configuration:]):
834         * WebProcess/WebPage/WebPage.cpp:
835         (WebKit::m_userInterfaceLayoutDirection):
836         (WebKit::WebPage::setResourceCachingDisabled):
837         (WebKit::WebPage::setUserInterfaceLayoutDirection):
838         (WebKit::m_shouldDispatchFakeMouseMoveEvents): Deleted.
839         * WebProcess/WebPage/WebPage.h:
840         * WebProcess/WebPage/WebPage.messages.in:
841         * WebProcess/WebPage/mac/WebPageMac.mm:
842         (WebKit::WebPage::performNonEditingBehaviorForSelector):
843
844 2016-06-15  Tim Horton  <timothy_horton@apple.com>
845
846         Expose _shouldExpandContentToViewHeightForAutoLayout SPI on WKWebView
847         https://bugs.webkit.org/show_bug.cgi?id=158824
848         <rdar://problem/23713857>
849
850         Reviewed by Simon Fraser.
851
852         Test: TestWebKitAPI/WebKit2.AutoLayoutIntegration
853
854         * UIProcess/API/Cocoa/WKWebView.mm:
855         (-[WKWebView _shouldExpandContentToViewHeightForAutoLayout]):
856         (-[WKWebView _setShouldExpandContentToViewHeightForAutoLayout:]):
857         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
858         This property exists on WKView; expose it on WKWebView.
859
860 2016-06-15  Alex Christensen  <achristensen@webkit.org>
861
862         Revert part of r196034
863         https://bugs.webkit.org/show_bug.cgi?id=158805
864         rdar://problem/26788138
865
866         Reviewed by Dan Bernstein.
867
868         * NetworkProcess/NetworkLoad.cpp:
869         (WebKit::NetworkLoad::~NetworkLoad):
870         If the WebResourceLoader was destroyed and received a canAuthenticateAgainstProtectionSpace
871         but did not send a continueCanAuthenticateAgainstProtectionSpace answer because there's no
872         core loader, then the NetworkLoad will be destroyed.  When this happens, we still need to call
873         the callback for the challenge.
874         * WebProcess/Network/WebResourceLoader.cpp:
875         (WebKit::WebResourceLoader::canAuthenticateAgainstProtectionSpace):
876         If there's no core loader, we can't send IPC.
877
878 2016-06-13  Simon Fraser  <simon.fraser@apple.com>
879
880         [iOS WK2] Make it possible to test the Next/Previous buttons in the keyboard accessory bar
881         https://bugs.webkit.org/show_bug.cgi?id=158714
882
883         Reviewed by Enrica Casucci.
884
885         Add UIScriptController.keyboardAccessoryBar{Next,Previous} and hook it up to the WKContentView
886         method that gets called from UIKit.
887
888         Add a test that exercises it.
889
890         * UIProcess/API/Cocoa/WKWebView.mm:
891         (-[WKWebView keyboardAssistantBarNext]):
892         (-[WKWebView keyboardAssistantBarPrevious]):
893         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
894
895 2016-06-15  Dean Jackson  <dino@apple.com>
896
897         RTL <select> forms are misplaced
898         https://bugs.webkit.org/show_bug.cgi?id=158810
899         <rdar://problem/24847541>
900
901         Reviewed by Eric Carlson.
902
903         AppKit made a change in Sierra that causes popup menus
904         to snap to a different point when the system language is RTL.
905         We need to be more explicit about what directionality
906         we want, and override the location of the popup based
907         on the text direction.
908
909         I also made a small tweak to the fudge offsets we use
910         in order to make button text and menu text to be
911         more consistent.
912
913         Unfortunately since this is just about the location
914         of the popup menu, it's unable to be tested in our
915         current infrastructure.
916
917         * UIProcess/mac/WebPopupMenuProxyMac.mm:
918         (WebKit::WebPopupMenuProxyMac::showPopupMenu):
919
920 2016-06-15  Chris Dumez  <cdumez@apple.com>
921
922         Drop some unnecessary header includes
923         https://bugs.webkit.org/show_bug.cgi?id=158788
924
925         Reviewed by Alexey Proskuryakov.
926
927         Drop some unnecessary header includes in headers to speed up build time.
928
929         * WebProcess/Plugins/PDF/DeprecatedPDFPlugin.mm:
930         * WebProcess/Plugins/PDF/PDFPluginAnnotation.mm:
931         * WebProcess/Plugins/PDF/PDFPluginPasswordField.mm:
932         * WebProcess/Plugins/PDF/PDFPluginTextAnnotation.mm:
933         * WebProcess/Plugins/PluginView.cpp:
934         * WebProcess/WebPage/WebPage.cpp:
935
936 2016-06-15  Romain Bellessort  <romain.bellessort@crf.canon.fr>
937
938         Enabling Shadow DOM for all platforms
939         https://bugs.webkit.org/show_bug.cgi?id=158738
940
941         Reviewed by Ryosuke Niwa.
942
943         Removed Shadow DOM from options (enabled by default)
944         (comprises removal of corresponding preprocessor directives)
945
946         * Configurations/FeatureDefines.xcconfig:
947         * WebProcess/InjectedBundle/InjectedBundle.cpp:
948         * WebProcess/WebPage/WebPage.cpp:
949
950 2016-06-15  Antti Koivisto  <antti@apple.com>
951
952         Vary:Cookie validation doesn't work in private browsing
953         https://bugs.webkit.org/show_bug.cgi?id=158616
954         <rdar://problem/26755067>
955
956         Reviewed by Andreas Kling.
957
958         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
959         (WebKit::WebPlatformStrategies::cookieRequestHeaderFieldValue):
960
961             Implement SessionID version of the function.
962
963         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
964
965 2016-06-14  Chris Dumez  <cdumez@apple.com>
966
967         Avoid constructing a AuthenticationChallenge unnecessarily in the NetworkLoad constructor
968         https://bugs.webkit.org/show_bug.cgi?id=158746
969
970         Reviewed by Darin Adler.
971
972         Avoid constructing a AuthenticationChallenge unnecessarily in the
973         NetworkLoad constructor by using WTF::Optional<> for this data
974         member.
975
976         * NetworkProcess/NetworkLoad.cpp:
977         (WebKit::NetworkLoad::continueCanAuthenticateAgainstProtectionSpace):
978         * NetworkProcess/NetworkLoad.h:
979
980 2016-06-14  Chris Dumez  <cdumez@apple.com>
981
982         Add missing WTFMove() in NetworkResourceLoader::didReceiveResponse()
983         https://bugs.webkit.org/show_bug.cgi?id=158745
984
985         Reviewed by Darin Adler.
986
987         Add missing WTFMove() in NetworkResourceLoader::didReceiveResponse()
988         to avoid copying the ResourceResponse.
989
990         * NetworkProcess/NetworkResourceLoader.cpp:
991
992 2016-06-14  Chris Dumez  <cdumez@apple.com>
993
994         Reduce copying of NetworkLoadParameters
995         https://bugs.webkit.org/show_bug.cgi?id=158744
996
997         Reviewed by Alex Christensen.
998
999         Reduce copying of NetworkLoadParameters by moving it around instead.
1000
1001         * NetworkProcess/Downloads/DownloadManager.cpp:
1002         (WebKit::DownloadManager::startDownload):
1003         * NetworkProcess/Downloads/PendingDownload.cpp:
1004         (WebKit::PendingDownload::PendingDownload):
1005         * NetworkProcess/Downloads/PendingDownload.h:
1006         * NetworkProcess/NetworkLoad.cpp:
1007         (WebKit::NetworkLoad::NetworkLoad):
1008         * NetworkProcess/NetworkLoad.h:
1009         * NetworkProcess/NetworkResourceLoader.cpp:
1010         (WebKit::NetworkResourceLoader::startNetworkLoad):
1011         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
1012         (WebKit::NetworkCache::SpeculativeLoad::SpeculativeLoad):
1013
1014 2016-06-14  Carlos Garcia Campos  <cgarcia@igalia.com>
1015
1016         [ThreadedCompositor] Opening the inspector in a window causes a crash.
1017         https://bugs.webkit.org/show_bug.cgi?id=154444
1018
1019         Reviewed by Žan Doberšek.
1020
1021         The threaded compositor doesn't handle the case of changing or removing the native surface handle. When the web
1022         view is reparented, the current native surface handle is destroyed when the view is removed from the parent, and
1023         a new one is created when added to the new parent. We need to handle this case in the threaded compositor.
1024
1025         * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.cpp:
1026         (WebKit::CompositingRunLoop::stopUpdateTimer): Allow users to stop the update timer.
1027         * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.h:
1028         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
1029         (WebKit::ThreadedCompositor::setNativeSurfaceHandleForCompositing): Use performTaskSync because this is called
1030         from a synchronous IPC message and right after it returns, the current native surface is destroyed by the UI
1031         process. So we need to ensure we finish all pending operations for the current native surface in the compositing
1032         thread before it's destroyed. Then we enable or disable the scene depending on whether the native surface has
1033         been created or destroyed and destroy the current context in case the new handle is 0.
1034         (WebKit::ThreadedCompositor::tryEnsureGLContext): Just renamed to make it clear that it can fail.
1035         (WebKit::ThreadedCompositor::glContext):
1036         (WebKit::ThreadedCompositor::renderLayerTree): Return early if scene is not active.
1037         * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp:
1038         (WebKit::ThreadedCoordinatedLayerTreeHost::setNativeSurfaceHandleForCompositing): Schedule a new layer flush
1039         after the native surface handle changed.
1040
1041 2016-06-14  Carlos Garcia Campos  <cgarcia@igalia.com>
1042
1043         [Threaded Compositor] Modernize and simplify threaded compositor code
1044         https://bugs.webkit.org/show_bug.cgi?id=158615
1045
1046         Reviewed by Žan Doberšek.
1047
1048         * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.cpp:
1049         (WebKit::CompositingRunLoop::performTask): Use NoncopyableFunction.
1050         (WebKit::CompositingRunLoop::performTaskSync): Ditto.
1051         (WebKit::CompositingRunLoop::startUpdateTimer): Just renamed to start instead of set.
1052         (WebKit::CompositingRunLoop::run): Expose run/stop methods instead of the internal RunLoop object.
1053         (WebKit::CompositingRunLoop::stop): Also stop the update timer instead of relying on the caller to do it.
1054         (WebKit::CompositingRunLoop::setUpdateTimer): Deleted.
1055         (WebKit::CompositingRunLoop::stopUpdateTimer): Deleted.
1056         * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.h:
1057         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
1058         (WebKit::ThreadedCompositor::setNativeSurfaceHandleForCompositing): Protects this directly in lambda capture.
1059         (WebKit::ThreadedCompositor::setDeviceScaleFactor): Ditto.
1060         (WebKit::ThreadedCompositor::didChangeViewportSize): Ditto.
1061         (WebKit::ThreadedCompositor::didChangeViewportAttribute): Ditto.
1062         (WebKit::ThreadedCompositor::didChangeContentsSize): Ditto.
1063         (WebKit::ThreadedCompositor::scrollTo): Ditto.
1064         (WebKit::ThreadedCompositor::scrollBy): Ditto.
1065         (WebKit::ThreadedCompositor::updateViewport): Use startUpdateTimer().
1066         (WebKit::ThreadedCompositor::scheduleDisplayImmediately): Ditto.
1067         (WebKit::ThreadedCompositor::didChangeVisibleRect): Improve lambda captures.
1068         (WebKit::ThreadedCompositor::renderLayerTree): Use m_viewportController directly.
1069         (WebKit::ThreadedCompositor::createCompositingThread): Use createThread() version that receives a function.
1070         (WebKit::ThreadedCompositor::runCompositingThread): Use run method and don't stop the update timer when the run
1071         loop finishes.
1072         (WebKit::ThreadedCompositor::terminateCompositingThread): Use stop method.
1073         (WebKit::ThreadedCompositor::ThreadedCompositor): Deleted.
1074         (WebKit::ThreadedCompositor::compositingThreadEntry): Deleted.
1075         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:
1076         (WebKit::ThreadedCompositor::viewportController): Deleted.
1077
1078 2016-06-14  Carlos Garcia Campos  <cgarcia@igalia.com>
1079
1080         [Threaded Compositor] Flickering and rendering artifacts when resizing the web view
1081         https://bugs.webkit.org/show_bug.cgi?id=154070
1082
1083         Reviewed by Žan Doberšek.
1084
1085         Resizing the web view is expected to be a sync operation, the UI process creates a new backing store state ID,
1086         sends UpdateBackingStoreState message with the flag RespondImmediately to the web process and waits up to 500ms
1087         for the reply (DidUpdateBackingStoreState message). When using the threaded compositor, we schedule a task in
1088         the compositing thread to update the viewport size, and return immediately, so that we reply to the UI process
1089         before the compositing thread has actually updated its size. There's a moment in which sizes are out of sync
1090         causing the flickering and rendering artifacts, the UI process continues rendering at the new size, while the
1091         web process is still rendering at the previous size. We can prevent this from happening just by making the
1092         resize task synchronous in the threaded compositor.
1093
1094         * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.cpp:
1095         (WebKit::CompositingRunLoop::performTaskSync): Add sync version of performTask().
1096         * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.h:
1097         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
1098         (WebKit::ThreadedCompositor::didChangeViewportSize): Use performTaskSync().
1099
1100 2016-06-14  Carlos Garcia Campos  <cgarcia@igalia.com>
1101
1102         Unreviewed. Fix Soup downloads after r201943.
1103
1104         This is a follow up of r201943. The DownloadClient used in DownloadSoup was not updated to the new API of the
1105         ResourceHandleClient because it was not using override on the virtual methods, so it was unnoticed. That broke
1106         the downloads soup implementation, because didReceiveResponse is no longer used in the DownloadClient. This
1107         patch updates the DownloadClient to the new ResourceHandleClient API adding also override to all the virtual
1108         methods to prevent this from happening in the future.
1109
1110         * NetworkProcess/Downloads/soup/DownloadSoup.cpp:
1111         (WebKit::Download::start):
1112         (WebKit::Download::startWithHandle):
1113         (WebKit::DownloadClient::DownloadClient):
1114         (WebKit::DownloadClient::downloadFailed):
1115         (WebKit::DownloadClient::didReceiveResponse):
1116         (WebKit::DownloadClient::didReceiveData):
1117         (WebKit::DownloadClient::didFinishLoading):
1118         (WebKit::DownloadClient::didFail):
1119         (WebKit::DownloadClient::wasBlocked): Deleted.
1120         (WebKit::DownloadClient::cannotShowURL): Deleted.
1121         (WebKit::DownloadClient::cancel):
1122         (WebKit::DownloadClient::handleResponse):
1123
1124 2016-06-13  Dan Bernstein  <mitz@apple.com>
1125
1126         [Mac] Web Content service with a restricted entitlement may load arbitrary dylibs
1127         https://bugs.webkit.org/show_bug.cgi?id=156668
1128         <rdar://problem/26714558>
1129
1130         Reviewed by Anders Carlsson.
1131
1132         * Configurations/WebContentService.xcconfig: Enable library validation when the Web Content
1133           service is given the XPC domain extension entitlement when targeting macOS Sierra or later.
1134
1135 2016-06-13  Alex Christensen  <achristensen@webkit.org>
1136
1137         Add WebSocketProvider stub
1138         https://bugs.webkit.org/show_bug.cgi?id=158702
1139
1140         Reviewed by Brady Eidson.
1141
1142         * WebKit2.xcodeproj/project.pbxproj:
1143         * WebProcess/Network/WebSocketProvider.h: Added.
1144         * WebProcess/WebPage/WebPage.cpp:
1145         (WebKit::m_shouldDispatchFakeMouseMoveEvents):
1146
1147 2016-06-10  Ada Chan  <adachan@apple.com>
1148
1149         Use the video element's video box when getting the inline video rect in WebVideoFullscreenManager
1150         https://bugs.webkit.org/show_bug.cgi?id=158351
1151         <rdar://problem/26567938>
1152
1153         Reviewed by Darin Adler.
1154
1155         * WebProcess/cocoa/WebVideoFullscreenManager.mm:
1156         (WebKit::inlineVideoFrame):
1157         (WebKit::WebVideoFullscreenManager::enterVideoFullscreenForVideoElement):
1158         (WebKit::WebVideoFullscreenManager::exitVideoFullscreenForVideoElement):
1159         (WebKit::WebVideoFullscreenManager::fullscreenMayReturnToInline):
1160         (WebKit::WebVideoFullscreenManager::setVideoLayerFrameFenced):
1161         (WebKit::clientRectForElement): Deleted.
1162
1163 2016-06-10  Benjamin Poulain  <bpoulain@apple.com>
1164
1165         Add support for passive event listeners on touch events
1166         https://bugs.webkit.org/show_bug.cgi?id=158601
1167
1168         Reviewed by Simon Fraser.
1169
1170         * Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp:
1171         (ArgumentCoder<ScrollingStateFrameScrollingNode>::encode):
1172         (ArgumentCoder<ScrollingStateFrameScrollingNode>::decode):
1173         (WebKit::dump):
1174         * Shared/WebCoreArgumentCoders.cpp:
1175         (IPC::ArgumentCoder<EventTrackingRegions>::encode):
1176         (IPC::ArgumentCoder<EventTrackingRegions>::decode):
1177         * Shared/WebCoreArgumentCoders.h:
1178         * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp:
1179         (WebKit::RemoteScrollingCoordinatorProxy::eventTrackingTypeForPoint):
1180         (WebKit::RemoteScrollingCoordinatorProxy::isPointInNonFastScrollableRegion): Deleted.
1181         * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h:
1182         * UIProcess/WebPageProxy.cpp:
1183         (WebKit::WebPageProxy::touchEventTrackingType):
1184         The type is the most restrictive type of all the touch points.
1185         If any touch point needs synchronous tracking, everything has to be synchronous.
1186
1187         (WebKit::WebPageProxy::handleTouchEventSynchronously):
1188         This is a very unfortunate design.
1189
1190         The upper layer dealing with UIKit knows about gesture and when something
1191         can be dispatched asynchrnously because a gesture has started.
1192         This layer knows about tracking and can use that extra inforamtion
1193         to dispatch an event asynchrnously anyway.
1194
1195         In the future, we should refactor this to let WebPageProxy
1196         always decide of the dispatch type. I am just concerned changing
1197         the upper layer while we are stabilizing WebKit.
1198
1199         (WebKit::WebPageProxy::handleTouchEventAsynchronously):
1200         (WebKit::WebPageProxy::handleTouchEvent):
1201         (WebKit::WebPageProxy::resetState):
1202         (WebKit::WebPageProxy::WebPageProxy): Deleted.
1203         (WebKit::WebPageProxy::shouldStartTrackingTouchEvents): Deleted.
1204         * UIProcess/WebPageProxy.h:
1205
1206 2016-06-10  Beth Dakin  <bdakin@apple.com>
1207
1208         Add requestExitFullScreen to WKFullScreenWindowController
1209         https://bugs.webkit.org/show_bug.cgi?id=158633
1210         -and corresponding-
1211         rdar://problem/26564036
1212
1213         Reviewed by Tim Horton.
1214
1215         * UIProcess/mac/WKFullScreenWindowController.h:
1216         * UIProcess/mac/WKFullScreenWindowController.mm:
1217         (-[WKFullScreenWindowController requestExitFullScreen]):
1218
1219 2016-06-10  Alex Christensen  <achristensen@webkit.org>
1220
1221         Reduce ResourceResponse copying
1222         https://bugs.webkit.org/show_bug.cgi?id=158232
1223
1224         Reviewed by Darin Adler.
1225
1226         * NetworkProcess/Downloads/PendingDownload.h:
1227         * NetworkProcess/NetworkDataTask.h:
1228         * NetworkProcess/NetworkLoad.cpp:
1229         (WebKit::NetworkLoad::continueDidReceiveResponse):
1230         (WebKit::NetworkLoad::sharedDidReceiveResponse):
1231         (WebKit::NetworkLoad::sharedWillSendRedirectedRequest):
1232         (WebKit::NetworkLoad::didReceiveChallenge):
1233         (WebKit::NetworkLoad::didReceiveResponseNetworkSession):
1234         (WebKit::NetworkLoad::didReceiveResponseAsync):
1235         * NetworkProcess/NetworkLoad.h:
1236         * NetworkProcess/NetworkLoadClient.h:
1237         * NetworkProcess/NetworkResourceLoader.cpp:
1238         (WebKit::NetworkResourceLoader::retrieveCacheEntry):
1239         (WebKit::NetworkResourceLoader::abort):
1240         * NetworkProcess/NetworkResourceLoader.h:
1241         * NetworkProcess/PingLoad.h:
1242         * NetworkProcess/cache/NetworkCacheCoders.h:
1243         (WebKit::NetworkCache::Coder<Optional<T>>::encode):
1244         (WebKit::NetworkCache::Coder<Optional<T>>::decode):
1245         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
1246         (WebKit::NetworkCache::SpeculativeLoad::willSendRedirectedRequest):
1247         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.h:
1248         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
1249         (WebKit::NetworkDataTask::didCompleteWithError):
1250         (WebKit::NetworkDataTask::didReceiveResponse):
1251         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
1252         (-[WKNetworkSessionDelegate URLSession:dataTask:didReceiveResponse:completionHandler:]):
1253         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1254         (WebKit::WebFrameLoaderClient::dispatchDidCommitLoad):
1255         * WebProcess/WebPage/WebFrame.cpp:
1256         (WebKit::WebFrame::url):
1257         (WebKit::WebFrame::certificateInfo):
1258         (WebKit::WebFrame::innerText):
1259
1260 2016-06-09  Ryosuke Niwa  <rniwa@webkit.org>
1261
1262         Add SPI to disable spellchecking on auto-fillable text fields
1263         https://bugs.webkit.org/show_bug.cgi?id=158611
1264
1265         Reviewed by Anders Carlsson.
1266
1267         Added WKBundleNodeHandleSetHTMLInputElementSpellcheckEnabled to disable spellchecking on a text field.
1268
1269         This is used by WebKit2 client which desires to disable spellchecking and notably autocorrection on
1270         login forms, etc... where such feature would interfere with user's actions.
1271
1272         * WebProcess/InjectedBundle/API/c/WKBundleNodeHandle.cpp:
1273         (WKBundleNodeHandleSetHTMLInputElementSpellcheckEnabled): Added.
1274         * WebProcess/InjectedBundle/API/c/WKBundleNodeHandlePrivate.h:
1275         * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp:
1276         (WebKit::InjectedBundleNodeHandle::setHTMLInputElementSpellcheckEnabled): Added.
1277         * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.h:
1278
1279 2016-06-10  Alex Christensen  <achristensen@webkit.org>
1280
1281         Introduce WTF::UniqueRef
1282         https://bugs.webkit.org/show_bug.cgi?id=158596
1283
1284         Reviewed by Brady Eidson.
1285
1286         * WebProcess/WebPage/WebPage.cpp:
1287         (WebKit::m_shouldDispatchFakeMouseMoveEvents):
1288
1289 2016-06-10  Anders Carlsson  <andersca@apple.com>
1290
1291         Remove CommandLine class
1292         https://bugs.webkit.org/show_bug.cgi?id=158628
1293
1294         Reviewed by Tim Horton.
1295
1296         * Shared/CommandLine.h: Removed.
1297         (WebKit::CommandLine::operator[]): Deleted.
1298         * Shared/posix/CommandLinePOSIX.cpp: Removed.
1299         (WebKit::CommandLine::parse): Deleted.
1300         * WebKit2.xcodeproj/project.pbxproj:
1301
1302 2016-06-10  Simon Fraser  <simon.fraser@apple.com>
1303
1304         [iOS WK2] Rare RELEASE_ASSERT under RemoteLayerTreeDrawingArea::flushLayers()
1305         https://bugs.webkit.org/show_bug.cgi?id=158622
1306         rdar://problem/26609452
1307
1308         Reviewed by Tim Horton.
1309         
1310         It's possible for a CADisplayLink to fire after being paused sometimes, possibly
1311         when an app is running another CADisplayLink whose callback takes some time. When
1312         this happens, RemoteLayerTreeDrawingAreaProxy could erroneously send a second
1313         didUpdate() to the web process between commits, which would clear the m_waitingForBackingStoreSwap
1314         flag too early, and allow a subsequent RemoteLayerTreeDrawingArea::flushLayers()
1315         to proceed when the m_pendingBackingStoreFlusher was still flushing.
1316
1317         Fix by preventing two didUpdates from being sent from the UI process between
1318         commits.
1319         
1320         Not easily testable.
1321
1322         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h:
1323         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
1324         (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
1325         (WebKit::RemoteLayerTreeDrawingAreaProxy::didRefreshDisplay):
1326
1327 2016-06-10  Carlos Garcia Campos  <cgarcia@igalia.com>
1328
1329         [Threaded Compositor] Content and viewport sizes are mixed
1330         https://bugs.webkit.org/show_bug.cgi?id=158564
1331
1332         Reviewed by Žan Doberšek.
1333
1334         Make ThreadedCoordinatedLayerTreeHost::sizeDidChange() update the viewport size for consistency with all other
1335         LayerTreeHost implementations and rename viewportSizeChanged() as contentsSizeChanged() and update the contents
1336         size.
1337
1338         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1339         (WebKit::WebChromeClient::contentsSizeChanged): Remove ifdefed code here, the drawing area is notified two lines below.
1340         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedDrawingArea.cpp:
1341         (WebKit::CoordinatedDrawingArea::mainFrameContentSizeChanged): Update the viewport size to the contents size
1342         only when using a fixed layout here instead of in cross-platform code.
1343         * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp:
1344         (WebKit::ThreadedCoordinatedLayerTreeHost::contentsSizeChanged):
1345         (WebKit::ThreadedCoordinatedLayerTreeHost::sizeDidChange):
1346         (WebKit::ThreadedCoordinatedLayerTreeHost::viewportSizeChanged): Deleted.
1347         * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h:
1348         * WebProcess/WebPage/DrawingAreaImpl.cpp:
1349         (WebKit::DrawingAreaImpl::mainFrameContentSizeChanged): Call LayerTreeHost::contentsSizeChanged().
1350         (WebKit::DrawingAreaImpl::updateBackingStoreState): Remove ifdefed code for the threadecd compositor since it's
1351         now consistent with all other LayerTreeHost implementations.
1352         * WebProcess/WebPage/LayerTreeHost.h:
1353
1354 2016-06-10  Carlos Garcia Campos  <cgarcia@igalia.com>
1355
1356         [Threaded Compositor] Make it clear that compositing thread operations are always scheduled from the main thread
1357         https://bugs.webkit.org/show_bug.cgi?id=158562
1358
1359         Reviewed by Žan Doberšek.
1360
1361         The code is written as if the compositor thread could also call callOnCompositingRunLoop() which makes the code
1362         confusing. This patch no longer checks if the task was scheduled in the compositing thread, and instead it adds
1363         an ASSERT to ensure it's always called from the main thread as expected. It also adds some more ASSERTS to ensure
1364         and clarify the methods are called from the expected thread.
1365
1366         * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.cpp:
1367         (WebKit::CompositingRunLoop::performTask):
1368         (WebKit::CompositingRunLoop::callOnCompositingRunLoop): Deleted.
1369         * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.h:
1370         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
1371         (WebKit::ThreadedCompositor::setNativeSurfaceHandleForCompositing):
1372         (WebKit::ThreadedCompositor::setDeviceScaleFactor):
1373         (WebKit::ThreadedCompositor::didChangeViewportSize):
1374         (WebKit::ThreadedCompositor::didChangeViewportAttribute):
1375         (WebKit::ThreadedCompositor::didChangeContentsSize):
1376         (WebKit::ThreadedCompositor::scrollTo):
1377         (WebKit::ThreadedCompositor::scrollBy):
1378         (WebKit::ThreadedCompositor::glContext):
1379         (WebKit::ThreadedCompositor::didChangeVisibleRect):
1380         (WebKit::ThreadedCompositor::renderLayerTree):
1381         (WebKit::ThreadedCompositor::updateSceneState):
1382         (WebKit::ThreadedCompositor::callOnCompositingThread): Deleted.
1383         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:
1384
1385 2016-06-10  Carlos Garcia Campos  <cgarcia@igalia.com>
1386
1387         [GTK] Browser plugins crash under Wayland
1388         https://bugs.webkit.org/show_bug.cgi?id=157605
1389
1390         Reviewed by Michael Catanzaro.
1391
1392         Fail the initialization of windowed plugins if we don't have a platform implementation.
1393
1394         * WebProcess/Plugins/Netscape/unix/NetscapePluginUnix.cpp:
1395         (WebKit::NetscapePlugin::platformPostInitialize):
1396
1397 2016-06-09  Antoine Quint  <graouts@apple.com>
1398
1399         [iOS] -webkit-overflow-scrolling: touch; ignores pointer-events: none;
1400         https://bugs.webkit.org/show_bug.cgi?id=119839
1401         <rdar://problem/9671514>
1402
1403         Reviewed by Simon Fraser.
1404
1405         Propagate a "userInteractionEnabled" flag from the Web process which is used to turn off
1406         user interaction on a UIScrollView created for -webkit-overflow-scrolling: touch.
1407
1408         * Shared/mac/RemoteLayerTreePropertyApplier.mm:
1409         (WebKit::RemoteLayerTreePropertyApplier::applyProperties):
1410         * Shared/mac/RemoteLayerTreeTransaction.h:
1411         * Shared/mac/RemoteLayerTreeTransaction.mm:
1412         (WebKit::RemoteLayerTreeTransaction::LayerProperties::LayerProperties):
1413         (WebKit::RemoteLayerTreeTransaction::LayerProperties::encode):
1414         (WebKit::RemoteLayerTreeTransaction::LayerProperties::decode):
1415         (WebKit::dumpChangedLayers):
1416         * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
1417         (WebKit::PlatformCALayerRemote::userInteractionEnabled):
1418         (WebKit::PlatformCALayerRemote::setUserInteractionEnabled):
1419         * WebProcess/WebPage/mac/PlatformCALayerRemote.h:
1420
1421 2016-06-09  Anders Carlsson  <andersca@apple.com>
1422
1423         Remove OriginAndDatabases.cpp, it's unused
1424         https://bugs.webkit.org/show_bug.cgi?id=158595
1425
1426         Reviewed by Sam Weinig.
1427
1428         * CMakeLists.txt:
1429         * Shared/OriginAndDatabases.cpp: Removed.
1430         (WebKit::OriginAndDatabases::encode): Deleted.
1431         (WebKit::OriginAndDatabases::decode): Deleted.
1432         * Shared/OriginAndDatabases.h: Removed.
1433         * WebKit2.xcodeproj/project.pbxproj:
1434
1435 2016-06-09  Alex Christensen  <achristensen@webkit.org>
1436
1437         Clean up EditorClient lifetime
1438         https://bugs.webkit.org/show_bug.cgi?id=158588
1439
1440         Reviewed by Anders Carlsson.
1441
1442         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
1443         (WebKit::generateTextCheckingRequestID):
1444         (WebKit::WebEditorClient::shouldDeleteRange):
1445         (WebKit::WebEditorClient::pageDestroyed): Deleted.
1446         * WebProcess/WebCoreSupport/WebEditorClient.h:
1447         (WebKit::WebEditorClient::WebEditorClient):
1448         * WebProcess/WebPage/WebPage.cpp:
1449         (WebKit::m_shouldDispatchFakeMouseMoveEvents):
1450
1451 2016-06-09  Andy Estes  <aestes@apple.com>
1452
1453         WKWebView does not render PDF pages in AirPrint
1454         https://bugs.webkit.org/show_bug.cgi?id=151386
1455         rdar://problem/22499157
1456
1457         Reviewed by Tim Horton.
1458
1459         _WKWebViewPrintFormatter originally attempted to handle PDFs, but the code path was never
1460         properly tested since Safari prints PDFs by setting a printingItem on the
1461         UIPrintInteractionController instead of going through a print formatter. The existing code
1462         almost worked, if it weren't for CGContextScaleCTM() scaling each page into oblivion due to
1463         _totalScaleFactor equaling 0.
1464
1465         This patch properly implements -[_WKWebViewPrintFormatter drawInRect:forPageAtIndex:] to
1466         handle drawing both PDFs generated by WebKit and PDFs loaded in the main frame. It also
1467         takes the opportunity to clean up a number of issues in the existing code:
1468
1469         - Handling of -[_WKWebViewPrintFormatter startPage] is now correct. I had previously assumed
1470           this property represented the first page of output to print, but it actually represents
1471           the first page in the overall print job that the print formatter renders. In other words,
1472           regardless of -startPage, the print formatter should always print all its pages.
1473         - Code specific to webpage and PDF printing was factored out into WKContentView and
1474           WKPDFView, respectively. Each conforms to @protocol(_WKWebViewPrintProvider), and
1475           _WKWebViewPrintFormatter accesses the provider via -[WKWebView _printProvider].
1476         - Instead of piping the printed PDF data from WebPageProxy to WKWebView via PageClient, use
1477           the GenericCallback mechanism to have WebPageProxy call a lambda specified by
1478           WKContentView when the printed PDF is available.
1479         - Removed _totalScaleFactor and used CGPDFPageGetDrawingTransform() to transform both
1480           webpages and PDFs. For webpages, _totalScaleFactor will always equal the ratio of the
1481           paper width to the PDF page width, so CGPDFPageGetDrawingTransform() will apply the same
1482           scaling as CGContextScaleCTM(_totalScaleFactor, _totalScaleFactor) would.
1483
1484         * UIProcess/API/Cocoa/WKWebView.mm:
1485         (-[WKWebView _printProvider]): Added. Returns _currentContentView if it conforms to
1486         @protocol(_WKWebViewPrintProvider).
1487         (-[WKWebView _computePageCountAndStartDrawingToPDFForFrame:printInfo:firstPage:computedTotalScaleFactor:]):
1488         Moved code to _wk_pageCountForPrintFormatter in WKContentView and WKPDFView.
1489         (-[WKWebView _endPrinting]): Deleted.
1490         (-[WKWebView _printedDocument]): Deleted.
1491         (-[WKWebView _setPrintedDocument:]): Deleted.
1492         * UIProcess/API/Cocoa/WKWebViewInternal.h: Declared the _printProvider property.
1493         * UIProcess/PageClient.h: Removed didFinishDrawingPagesToPDF().
1494         * UIProcess/WebPageProxy.h: Declared computePagesForPrintingAndDrawToPDF() and
1495         drawToPDFCallback().
1496         * UIProcess/WebPageProxy.messages.in: Renamed DidFinishDrawingPagesToPDF to
1497         DrawToPDFCallback.
1498         * UIProcess/_WKWebViewPrintFormatter.mm: Backed the frameToPrint property with a RetainPtr
1499         ivar so that it doesn't need to be released manually in -dealloc; removed _totalScaleFactor
1500         and _printInfo ivars and added a _printedDocument ivar; removed the property declaration for
1501         webView.
1502         (-[_WKWebViewPrintFormatter frameToPrint]): Added a custom getter for the frameToPrint
1503         property.
1504         (-[_WKWebViewPrintFormatter setFrameToPrint:]): Added a custom setter for the frameToPrint
1505         property.
1506         (-[_WKWebViewPrintFormatter _webView]): Renamed from webView; added an underscore since this
1507         is a private method.
1508         (-[_WKWebViewPrintFormatter _recalcPageCount]): Retrieved the page count from the print
1509         provider and clamped its value to NSIntegerMax.
1510         (-[_WKWebViewPrintFormatter drawInRect:forPageAtIndex:]): Retrieved the printed document
1511         from the print provider if needed; modified the CTM transformations to work for both
1512         webpages and PDFs.
1513         (-[_WKWebViewPrintFormatter dealloc]): Deleted.
1514         (-[_WKWebViewPrintFormatter webView]): Renamed to _webView.
1515         (-[_WKWebViewPrintFormatter rectForPageAtIndex:]): Deleted.
1516         * UIProcess/_WKWebViewPrintFormatterInternal.h: Added. Moved a UIPrintFormatter internal
1517         method declaration to here and defined the _WKWebViewPrintProvider protocol.
1518         * UIProcess/ios/PageClientImplIOS.h: Removed didFinishDrawingPagesToPDF().
1519         * UIProcess/ios/PageClientImplIOS.mm: Ditto.
1520         (WebKit::PageClientImpl::didFinishDrawingPagesToPDF): Deleted.
1521         * UIProcess/ios/WKContentView.mm: Conformed to @protocol(_WKWebViewPrintProvider).
1522         (-[WKContentView _wk_pageCountForPrintFormatter:]): Moved the code to compute page count
1523         from WKWebView to here.
1524         (-[WKContentView _wk_printedDocument]): Moved the code to get the printed document from
1525         WKWebView to here.
1526         * UIProcess/ios/WKPDFView.mm:
1527         (-[WKPDFView _wk_pageCountForPrintFormatter:]): Moved the code to compute the page count
1528         from WKWebView to here; added a call to CGPDFDocumentAllowsPrinting(), returning 0 if
1529         printing is not allowed.
1530         (-[WKPDFView _wk_printedDocument]): Moved the code to get the printed document from
1531         WKWebView to here.
1532         * UIProcess/ios/WebPageProxyIOS.mm:
1533         (WebKit::WebPageProxy::computePagesForPrintingAndDrawToPDF): Registered the callback with
1534         m_callbacks and sent Messages::WebPage::ComputePagesForPrintingAndDrawToPDF; returned the
1535         synchronously-returned page count.
1536         (WebKit::WebPageProxy::drawToPDFCallback): Added to perform the callback when drawing to PDF
1537         is complete.
1538         (WebKit::WebPageProxy::didFinishDrawingPagesToPDF): Deleted.
1539         * WebKit2.xcodeproj/project.pbxproj: Added _WKWebViewPrintFormatterInternal.h.
1540         * WebProcess/WebPage/WebPage.h: Renamed computePagesForPrintingAndStartDrawingToPDF() to
1541         computePagesForPrintingAndDrawToPDF().
1542         * WebProcess/WebPage/WebPage.messages.in: Renamed
1543         ComputePagesForPrintingAndStartDrawingToPDF to ComputePagesForPrintingAndDrawToPDF. Removed
1544         the startPage parameter and added a callbackID.
1545         * WebProcess/WebPage/ios/WebPageIOS.mm:
1546         (WebKit::WebPage::computePagesForPrintingAndDrawToPDF): Renamed from
1547         computePagesForPrintingAndStartDrawingToPDF(). Added a call to endPrinting() after sending
1548         Messages::WebPageProxy::DrawToPDFCallback.
1549         (WebKit::WebPage::computePagesForPrintingAndStartDrawingToPDF): Renamed to
1550         computePagesForPrintingAndDrawToPDF.
1551
1552 2016-06-09  Alex Christensen  <achristensen@webkit.org>
1553
1554         Clean up WebSocket code
1555         https://bugs.webkit.org/show_bug.cgi?id=158551
1556
1557         Reviewed by Darin Adler.
1558
1559         * WebProcess/FileAPI/BlobRegistryProxy.cpp:
1560         (WebKit::BlobRegistryProxy::registerFileBlobURL):
1561         * WebProcess/FileAPI/BlobRegistryProxy.h:
1562
1563 2016-06-09  David Kilzer  <ddkilzer@apple.com>
1564
1565         Update properties for UIWKTextInteractionAssistant
1566         <https://webkit.org/b/158559>
1567
1568         Reviewed by Darin Adler.
1569
1570         * Platform/spi/ios/UIKitSPI.h:
1571         (UIWKTextInteractionAssistant.loupeGesture):
1572         (UIWKTextInteractionAssistant.singleTapGesture):
1573         Change from retain to assign since UIWKTextInteractionAssistant
1574         is not responsible for their lifetime.  Sort alphabetically.
1575
1576 2016-06-09  Michael Saboff  <msaboff@apple.com>
1577
1578         WebKitTestRunner and DumpRenderTree do not handle dangling surrogate characters
1579         https://bugs.webkit.org/show_bug.cgi?id=154863
1580
1581         Reviewed by Alexey Proskuryakov.
1582
1583         Added a non-strict verions of WKStringGetUTF8CString() that will handle dangling
1584         surrogates called WKStringGetUTF8CStringNonStrict().
1585
1586         * Shared/API/c/WKString.cpp:
1587         (WKStringGetUTF8CStringImpl):
1588         (WKStringGetUTF8CString):
1589         (WKStringGetUTF8CStringNonStrict):
1590         * Shared/API/c/WKString.h:
1591
1592 2016-06-09  Carlos Garcia Campos  <cgarcia@igalia.com>
1593
1594         [Threaded Compositor] Many layout tests crash when threaded compositor is enabled
1595         https://bugs.webkit.org/show_bug.cgi?id=158560
1596
1597         Reviewed by Žan Doberšek.
1598
1599         This is because CoordinatedGraphicsLayer::notifyFlushRequired() assumes it has a valid compositor when it's
1600         called. But the compositor is only present when GraphicsLayer::create() is called with a
1601         GraphicsLayerFactory. When running the layout tests, layers are created without a factory because DrawingAreaImpl
1602         is not entering AC mode as expected and the layer tree host is not created, making
1603         DrawingAreaImpl::graphicsLayerFactory() always return nullptr. This happens because DrawingAreaImpl is checking
1604         acceleratedDrawingEnabled setting to decide whether to always use compositing mode or not, and WTR sets that
1605         setting to false (changing its default value). The thing is that acceleratedDrawingEnabled setting doesn't have
1606         any effect in non-Mac ports, what we really want to check there is whether acceleratedCompositingEnabled is true
1607         or false.
1608
1609         * WebProcess/WebPage/DrawingAreaImpl.cpp:
1610         (WebKit::DrawingAreaImpl::updatePreferences):
1611
1612 2016-06-09  Carlos Garcia Campos  <cgarcia@igalia.com>
1613
1614         [Threaded Compositor] Remove ThreadedCompositor::setNeedsDisplay()
1615         https://bugs.webkit.org/show_bug.cgi?id=158523
1616
1617         Reviewed by Michael Catanzaro.
1618
1619         ThreadedCompositor::setNeedsDisplay() is always called from the main thread and schedules a task to the
1620         compositing thread to schedule an immediate update. But RunLoop::Timer is thread-safe so we don't really need to
1621         schedule a task to the update the timer in the compositing thread, we can do that directly in the main
1622         thread. And that's exactly what scheduleDisplayImmediately() does, so we can use it instead of setNeedsDisplay().
1623
1624         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
1625         (WebKit::ThreadedCompositor::setNeedsDisplay(): Deleted.
1626         (WebKit::ThreadedCompositor::updateSceneState):
1627         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:
1628
1629 2016-06-08  Antti Koivisto  <antti@apple.com>
1630
1631         Increase disk cache capacity when there is lots of free space
1632         https://bugs.webkit.org/show_bug.cgi?id=158526
1633
1634         Reviewed by Chris Dumez.
1635
1636         Our maximum disk cache capacity has been 175MB for a very long time. Meanwhile the average resource size has grown
1637         massively. 175MB is now enough for cacheable resources of a few dozen sites at most. Using bigger caches when there is
1638         room for it can reduce network traffic, reduce disk writes, save battery and speed up page loading.
1639
1640         This patch changes cache size for PrimaryWebBrowser cache model
1641
1642         >=16GB free: 175MB -> 500MB
1643         8-16GB free: 150MB -> 250MB
1644
1645         and modestly for DocumentBrowser
1646
1647         >=16GB free: 50MB -> 75MB
1648
1649         Note that if system (on Cocoa platforms) really needs disk space it will wipe out caches so this doesn't reduce
1650         available disk space in scenarios like software installation.
1651
1652         * Shared/CacheModel.cpp:
1653         (WebKit::calculateCacheSizes):
1654
1655 2016-06-08  Youenn Fablet  <youenn.fablet@crf.canon.fr>
1656
1657         Introduce ResourceErrorBase::type
1658         https://bugs.webkit.org/show_bug.cgi?id=158299
1659
1660         Reviewed by Alex Christensen.
1661
1662         * Shared/soup/WebCoreArgumentCodersSoup.cpp:
1663         (IPC::ArgumentCoder<ResourceError>::encodePlatformData):
1664         (IPC::ArgumentCoder<ResourceError>::decodePlatformData):
1665
1666 2016-06-08  Beth Dakin  <bdakin@apple.com>
1667
1668         _web_didAddMediaControlsManager should take a controlsManager as a parameter 
1669         https://bugs.webkit.org/show_bug.cgi?id=158545
1670
1671         Reviewed by Tim Horton.
1672
1673         * UIProcess/Cocoa/WebViewImpl.h:
1674
1675 2016-06-06  Antti Koivisto  <antti@apple.com>
1676
1677         WebKit memory cache doesn't respect Vary header
1678         https://bugs.webkit.org/show_bug.cgi?id=71509
1679         <rdar://problem/26651033>
1680
1681         Reviewed by Sam Weinig.
1682
1683         * NetworkProcess/cache/NetworkCache.cpp:
1684         (WebKit::NetworkCache::makeCacheKey):
1685         (WebKit::NetworkCache::cachePolicyAllowsExpired):
1686         (WebKit::NetworkCache::makeUseDecision):
1687         (WebKit::NetworkCache::Cache::retrieve):
1688         (WebKit::NetworkCache::Cache::store):
1689         (WebKit::NetworkCache::Cache::storeRedirect):
1690         (WebKit::NetworkCache::Cache::update):
1691         (WebKit::NetworkCache::headerValueForVary): Deleted.
1692         (WebKit::NetworkCache::collectVaryingRequestHeaders): Deleted.
1693         (WebKit::NetworkCache::verifyVaryingRequestHeaders): Deleted.
1694
1695             These move to WebCore.
1696
1697 2016-06-08  Carlos Garcia Campos  <cgarcia@igalia.com>
1698
1699         Unreviewed. Fix GTK+ build with threaded compositor enabled after r201802.
1700
1701         * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp:
1702         (WebKit::ThreadedCoordinatedLayerTreeHost::create):
1703
1704 2016-06-08  Carlos Garcia Campos  <cgarcia@igalia.com>
1705
1706         LayerTreeHost should be created with a WebPage reference instead of a pointer
1707         https://bugs.webkit.org/show_bug.cgi?id=158520
1708
1709         Reviewed by Žan Doberšek.
1710
1711         We are indeed creating the LayerTreeHost always from a WebPage reference but getting its address to pass it to
1712         the LayerTreeHost create() function.
1713
1714         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedDrawingArea.cpp:
1715         (WebKit::CoordinatedDrawingArea::enterAcceleratedCompositingMode):
1716         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
1717         (WebKit::CoordinatedLayerTreeHost::create):
1718         (WebKit::CoordinatedLayerTreeHost::CoordinatedLayerTreeHost):
1719         (WebKit::CoordinatedLayerTreeHost::didFlushRootLayer):
1720         (WebKit::CoordinatedLayerTreeHost::performScheduledLayerFlush):
1721         (WebKit::CoordinatedLayerTreeHost::commitSceneState):
1722         (WebKit::CoordinatedLayerTreeHost::deviceOrPageScaleFactorChanged):
1723         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h:
1724         * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp:
1725         (WebKit::ThreadedCoordinatedLayerTreeHost::create):
1726         (WebKit::ThreadedCoordinatedLayerTreeHost::ThreadedCoordinatedLayerTreeHost):
1727         (WebKit::ThreadedCoordinatedLayerTreeHost::deviceOrPageScaleFactorChanged):
1728         (WebKit::ThreadedCoordinatedLayerTreeHost::compositorDidFlushLayers):
1729         (WebKit::ThreadedCoordinatedLayerTreeHost::didScaleFactorChanged):
1730         (WebKit::ThreadedCoordinatedLayerTreeHost::setVisibleContentsRect):
1731         * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h:
1732         * WebProcess/WebPage/DrawingAreaImpl.cpp:
1733         (WebKit::DrawingAreaImpl::enterAcceleratedCompositingMode):
1734         * WebProcess/WebPage/LayerTreeHost.cpp:
1735         (WebKit::LayerTreeHost::create):
1736         (WebKit::LayerTreeHost::LayerTreeHost):
1737         * WebProcess/WebPage/LayerTreeHost.h:
1738         * WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp:
1739         (WebKit::LayerTreeHostGtk::create):
1740         (WebKit::LayerTreeHostGtk::LayerTreeHostGtk):
1741         (WebKit::LayerTreeHostGtk::makeContextCurrent):
1742         (WebKit::LayerTreeHostGtk::deviceOrPageScaleFactorChanged):
1743         (WebKit::LayerTreeHostGtk::paintContents):
1744         (WebKit::LayerTreeHostGtk::deviceScaleFactor):
1745         (WebKit::LayerTreeHostGtk::pageScaleFactor):
1746         (WebKit::LayerTreeHostGtk::flushPendingLayerChanges):
1747         (WebKit::LayerTreeHostGtk::flushAndRenderLayers):
1748         (WebKit::LayerTreeHostGtk::pageBackgroundTransparencyChanged):
1749         (WebKit::LayerTreeHostGtk::initialize): Deleted.
1750         * WebProcess/WebPage/gtk/LayerTreeHostGtk.h:
1751
1752 2016-06-07  Sam Weinig  <sam@webkit.org>
1753
1754         Fix 10.10 build.
1755
1756         * WebProcess/WebPage/mac/PlatformCAAnimationRemote.mm:
1757         (WebKit::addAnimationToLayer):
1758
1759 2016-06-06  Alex Christensen  <achristensen@webkit.org>
1760
1761         Modernize loading code
1762         https://bugs.webkit.org/show_bug.cgi?id=158332
1763
1764         Reviewed by Darin Adler.
1765
1766         * NetworkProcess/Downloads/PendingDownload.h:
1767         * NetworkProcess/NetworkDataTask.h:
1768         (WebKit::NetworkDataTask::client):
1769         * NetworkProcess/NetworkLoad.cpp:
1770         (WebKit::NetworkLoad::didReceiveResponseNetworkSession):
1771         (WebKit::NetworkLoad::didReceiveData):
1772         (WebKit::NetworkLoad::didReceiveBuffer):
1773         * NetworkProcess/NetworkLoad.h:
1774         * NetworkProcess/NetworkLoadClient.h:
1775         * NetworkProcess/NetworkResourceLoader.cpp:
1776         (WebKit::NetworkResourceLoader::didReceiveBuffer):
1777         (WebKit::NetworkResourceLoader::didFinishLoading):
1778         * NetworkProcess/NetworkResourceLoader.h:
1779         * NetworkProcess/PingLoad.h:
1780         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
1781         (WebKit::NetworkCache::SpeculativeLoad::didReceiveBuffer):
1782         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.h:
1783         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
1784         (WebKit::NetworkDataTask::didReceiveResponse):
1785         (WebKit::NetworkDataTask::didReceiveData):
1786         * Shared/WebHitTestResultData.cpp:
1787         * WebProcess/Network/WebResourceLoader.cpp:
1788         (WebKit::WebResourceLoader::didReceiveResource):
1789
1790 2016-06-05  Sam Weinig  <sam@webkit.org>
1791
1792         Add experimental support for spring based CSS animations
1793         https://bugs.webkit.org/show_bug.cgi?id=158403
1794
1795         Reviewed by Dean Jackson.
1796
1797         * Shared/WebCoreArgumentCoders.cpp:
1798         (IPC::ArgumentCoder<StepsTimingFunction>::decode):
1799         (IPC::ArgumentCoder<SpringTimingFunction>::encode):
1800         (IPC::ArgumentCoder<SpringTimingFunction>::decode):
1801         (IPC::ArgumentCoder<FloatPoint>::encode):
1802         * Shared/WebCoreArgumentCoders.h:
1803         * Shared/WebPreferencesDefinitions.h:
1804         * WebProcess/WebPage/WebPage.cpp:
1805         (WebKit::WebPage::updatePreferences):
1806         * WebProcess/WebPage/mac/PlatformCAAnimationRemote.mm:
1807         (WebKit::PlatformCAAnimationRemote::Properties::encode):
1808         (WebKit::PlatformCAAnimationRemote::Properties::decode):
1809         (WebKit::addAnimationToLayer):
1810         Pipe through support for the Spring animation.
1811
1812 2016-06-07  Michael Catanzaro  <mcatanzaro@igalia.com>
1813
1814         [GTK] Hide GTK+ 2 plugins if GTK+ 2 plugin process was built but is not installed
1815         https://bugs.webkit.org/show_bug.cgi?id=158419
1816
1817         Reviewed by Carlos Garcia Campos.
1818
1819         Patch by Alberto Garcia <berto@igalia.com>
1820
1821         * UIProcess/Plugins/unix/PluginInfoStoreUnix.cpp:
1822         (WebKit::PluginInfoStore::getPluginInfo):
1823         * UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp:
1824         (WebKit::PluginProcessProxy::scanPlugin):
1825
1826 2016-06-06  Antoine Quint  <graouts@apple.com>
1827
1828         Position of WebGL <canvas> on iOS is incorrect with CSS borders
1829         https://bugs.webkit.org/show_bug.cgi?id=156790
1830
1831         Reviewed by Simon Fraser.
1832
1833         WebGL layers on iOS are hosted by a WKRemoteView, which applies a transform scaling
1834         its content by the inverse of the device pixel ratio, which affects how positions are
1835         applied to the WebGL layer. The container layer of the layer hosted by a WKRemoteView
1836         then has an inverse transform applied to it in the PlatformCALayerRemoteCustom
1837         constructor. However, the position of a CALayer is not affected by its transform.
1838
1839         The fix for <rdar://problem/18316542> should be specific to video, so we only apply the
1840         scaling in the case of a LayerTypeAVPlayerLayer.
1841
1842         * UIProcess/ios/RemoteLayerTreeHostIOS.mm:
1843         (-[WKRemoteView initWithFrame:contextID:]):
1844         (WebKit::RemoteLayerTreeHost::createLayer):
1845         (-[WKRemoteView initWithFrame:contextID:hostingDeviceScaleFactor:]): Deleted.
1846         * WebProcess/WebPage/mac/PlatformCALayerRemoteCustom.mm:
1847         (WebKit::PlatformCALayerRemoteCustom::PlatformCALayerRemoteCustom):
1848
1849 2016-06-06  Brady Eidson  <beidson@apple.com>
1850
1851         Fix build after r201717
1852
1853         Unreviewed.
1854
1855         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1856         (WebKit::NetworkConnectionToWebProcess::writeBlobsToTemporaryFiles):
1857
1858         * NetworkProcess/NetworkProcess.cpp:
1859         (WebKit::NetworkProcess::grantSandboxExtensionsToDatabaseProcessForBlobs):
1860         * NetworkProcess/NetworkProcess.h:
1861         
1862 2016-06-06  Brady Eidson  <beidson@apple.com>
1863
1864         Modern IDB: Crash seen in IDBConnectionProxy::putOrAdd on GuardMalloc bot
1865         https://bugs.webkit.org/show_bug.cgi?id=158124
1866
1867         Reviewed by Darin Adler.
1868         
1869         * NetworkProcess/FileAPI/NetworkBlobRegistry.cpp:
1870         (WebKit::NetworkBlobRegistry::writeBlobsToTemporaryFiles):
1871         * NetworkProcess/FileAPI/NetworkBlobRegistry.h:
1872         
1873         * WebProcess/FileAPI/BlobRegistryProxy.cpp:
1874         (WebKit::BlobRegistryProxy::writeBlobsToTemporaryFiles):
1875         * WebProcess/FileAPI/BlobRegistryProxy.h:
1876         
1877         * WebProcess/Network/NetworkProcessConnection.cpp:
1878         (WebKit::NetworkProcessConnection::didClose):
1879         (WebKit::NetworkProcessConnection::writeBlobsToTemporaryFiles):
1880         * WebProcess/Network/NetworkProcessConnection.h:
1881
1882 2016-06-06  Commit Queue  <commit-queue@webkit.org>
1883
1884         Unreviewed, rolling out r201706.
1885         https://bugs.webkit.org/show_bug.cgi?id=158427
1886
1887         This change broke the Yosemite build and its LayoutTest is
1888         failing on Mac and iOS testers (Requested by ryanhaddad on
1889         #webkit).
1890
1891         Reverted changeset:
1892
1893         "Add experimental support for spring based CSS animations"
1894         https://bugs.webkit.org/show_bug.cgi?id=158403
1895         http://trac.webkit.org/changeset/201706
1896
1897 2016-06-06  Alex Christensen  <achristensen@webkit.org>
1898
1899         Reduce ResourceRequest copying in loading code
1900         https://bugs.webkit.org/show_bug.cgi?id=158251
1901
1902         Reviewed by Darin Adler.
1903
1904         * NetworkProcess/Downloads/DownloadManager.cpp:
1905         (WebKit::DownloadManager::continueCanAuthenticateAgainstProtectionSpace):
1906         (WebKit::DownloadManager::continueWillSendRequest):
1907         (WebKit::DownloadManager::willDecidePendingDownloadDestination):
1908         * NetworkProcess/Downloads/DownloadManager.h:
1909         * NetworkProcess/Downloads/PendingDownload.cpp:
1910         (WebKit::PendingDownload::PendingDownload):
1911         (WebKit::PendingDownload::willSendRedirectedRequest):
1912         (WebKit::PendingDownload::continueWillSendRequest):
1913         (WebKit::PendingDownload::canAuthenticateAgainstProtectionSpaceAsync):
1914         * NetworkProcess/Downloads/PendingDownload.h:
1915         * NetworkProcess/NetworkDataTask.h:
1916         (WebKit::NetworkDataTask::firstRequest):
1917         * NetworkProcess/NetworkLoad.cpp:
1918         (WebKit::NetworkLoad::cancel):
1919         (WebKit::NetworkLoad::continueWillSendRequest):
1920         (WebKit::NetworkLoad::sharedDidReceiveResponse):
1921         (WebKit::NetworkLoad::sharedWillSendRedirectedRequest):
1922         (WebKit::NetworkLoad::setPendingDownload):
1923         (WebKit::NetworkLoad::willPerformHTTPRedirection):
1924         (WebKit::NetworkLoad::didReceiveChallenge):
1925         (WebKit::NetworkLoad::didFail):
1926         (WebKit::NetworkLoad::willSendRequestAsync):
1927         * NetworkProcess/NetworkLoad.h:
1928         (WebKit::NetworkLoad::currentRequest):
1929         (WebKit::NetworkLoad::clearCurrentRequest):
1930         (WebKit::NetworkLoad::pendingDownloadID):
1931         * NetworkProcess/NetworkLoadClient.h:
1932         * NetworkProcess/NetworkProcess.cpp:
1933         (WebKit::NetworkProcess::continueCanAuthenticateAgainstProtectionSpace):
1934         (WebKit::NetworkProcess::continueWillSendRequest):
1935         (WebKit::NetworkProcess::pendingDownloadCanceled):
1936         * NetworkProcess/NetworkProcess.h:
1937         * NetworkProcess/NetworkResourceLoader.cpp:
1938         (WebKit::NetworkResourceLoader::didFailLoading):
1939         (WebKit::NetworkResourceLoader::willSendRedirectedRequest):
1940         (WebKit::NetworkResourceLoader::continueWillSendRequest):
1941         (WebKit::NetworkResourceLoader::continueDidReceiveResponse):
1942         * NetworkProcess/NetworkResourceLoader.h:
1943         * NetworkProcess/PingLoad.h:
1944         (WebKit::PingLoad::PingLoad):
1945         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
1946         (WebKit::NetworkCache::SpeculativeLoad::~SpeculativeLoad):
1947         (WebKit::NetworkCache::SpeculativeLoad::willSendRedirectedRequest):
1948         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.h:
1949         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
1950         (WebKit::NetworkDataTask::didBecomeDownload):
1951         (WebKit::NetworkDataTask::willPerformHTTPRedirection):
1952         * WebProcess/Network/WebResourceLoader.cpp:
1953         (WebKit::WebResourceLoader::detachFromCoreLoader):
1954         (WebKit::WebResourceLoader::willSendRequest):
1955         * WebProcess/Network/WebResourceLoader.h:
1956
1957 2016-06-05  Sam Weinig  <sam@webkit.org>
1958
1959         Add experimental support for spring based CSS animations
1960         https://bugs.webkit.org/show_bug.cgi?id=158403
1961
1962         Reviewed by Dean Jackson.
1963
1964         * Shared/WebCoreArgumentCoders.cpp:
1965         (IPC::ArgumentCoder<StepsTimingFunction>::decode):
1966         (IPC::ArgumentCoder<SpringTimingFunction>::encode):
1967         (IPC::ArgumentCoder<SpringTimingFunction>::decode):
1968         (IPC::ArgumentCoder<FloatPoint>::encode):
1969         * Shared/WebCoreArgumentCoders.h:
1970         * Shared/WebPreferencesDefinitions.h:
1971         * WebProcess/WebPage/WebPage.cpp:
1972         (WebKit::WebPage::updatePreferences):
1973         * WebProcess/WebPage/mac/PlatformCAAnimationRemote.mm:
1974         (WebKit::PlatformCAAnimationRemote::Properties::encode):
1975         (WebKit::PlatformCAAnimationRemote::Properties::decode):
1976         (WebKit::addAnimationToLayer):
1977         Pipe through support for the Spring animation.
1978
1979 2016-06-05  Yusuke Suzuki  <utatane.tea@gmail.com>
1980
1981         Change ProxyObject.[[Get]] not to use custom accessor
1982         https://bugs.webkit.org/show_bug.cgi?id=157080
1983
1984         Reviewed by Darin Adler.
1985
1986         * WebProcess/Plugins/Netscape/JSNPObject.cpp:
1987         (WebKit::JSNPObject::propertyGetter):
1988         (WebKit::JSNPObject::methodGetter):
1989         * WebProcess/Plugins/Netscape/JSNPObject.h:
1990
1991 2016-06-05  Brady Eidson  <beidson@apple.com>
1992
1993         Unreviewed, rolling out r201694.
1994
1995         201693
1996
1997         Reverted changeset:
1998
1999         "Fix the build after r201693."
2000         https://bugs.webkit.org/show_bug.cgi?id=158394
2001         http://trac.webkit.org/changeset/201694
2002
2003 2016-06-05  Brady Eidson  <beidson@apple.com>
2004
2005         Fix the build after r201693.
2006         https://bugs.webkit.org/show_bug.cgi?id=158394
2007
2008         Reviewed by NOBODY (Build fix).
2009
2010         r201693 landed without the Source/WebKit2 changes, and I didn't have EWS/CQ available to check myself. *sigh*
2011         
2012         * NetworkProcess/FileAPI/NetworkBlobRegistry.cpp:
2013         (WebKit::NetworkBlobRegistry::writeBlobsToTemporaryFiles):
2014         * NetworkProcess/FileAPI/NetworkBlobRegistry.h:
2015         
2016         * WebProcess/FileAPI/BlobRegistryProxy.cpp:
2017         (WebKit::BlobRegistryProxy::writeBlobsToTemporaryFiles):
2018         * WebProcess/FileAPI/BlobRegistryProxy.h:
2019         
2020         * WebProcess/Network/NetworkProcessConnection.cpp:
2021         (WebKit::NetworkProcessConnection::didClose):
2022         (WebKit::NetworkProcessConnection::writeBlobsToTemporaryFiles):
2023         * WebProcess/Network/NetworkProcessConnection.h:
2024
2025 2016-06-03  Commit Queue  <commit-queue@webkit.org>
2026
2027         Unreviewed, rolling out r201663.
2028         https://bugs.webkit.org/show_bug.cgi?id=158374
2029
2030         Broke the Windows build (Requested by andersca on #webkit).
2031
2032         Reverted changeset:
2033
2034         "Rename NoncopyableFunction to Function"
2035         https://bugs.webkit.org/show_bug.cgi?id=158354
2036         http://trac.webkit.org/changeset/201663
2037
2038 2016-06-03  Anders Carlsson  <andersca@apple.com>
2039
2040         Rename NoncopyableFunction to Function
2041         https://bugs.webkit.org/show_bug.cgi?id=158354
2042
2043         Reviewed by Chris Dumez.
2044
2045         * NetworkProcess/NetworkProcess.cpp:
2046         (WebKit::fetchDiskCacheEntries):
2047         (WebKit::NetworkProcess::fetchWebsiteData):
2048         (WebKit::clearDiskCacheEntries):
2049         * NetworkProcess/NetworkProcess.h:
2050         * NetworkProcess/cache/NetworkCache.cpp:
2051         (WebKit::NetworkCache::Cache::traverse):
2052         * NetworkProcess/cache/NetworkCache.h:
2053         * NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp:
2054         (WebKit::NetworkCache::runTaskInQueue):
2055         * NetworkProcess/cache/NetworkCacheStorage.h:
2056
2057 2016-06-03  Chris Dumez  <cdumez@apple.com>
2058
2059         Unreviewed, roll out r196633 as it broke PageCache on iOS for WebKit.org
2060         <rdar://problem/26521101>
2061
2062         * WebProcess/WebPage/VisitedLinkTableController.cpp:
2063         (WebKit::VisitedLinkTableController::setVisitedLinkTable):
2064         (WebKit::VisitedLinkTableController::visitedLinkStateChanged):
2065         (WebKit::VisitedLinkTableController::allVisitedLinkStateChanged):
2066         (WebKit::VisitedLinkTableController::removeAllVisitedLinks):
2067
2068 2016-06-03  Csaba Osztrogonác  <ossy@webkit.org>
2069
2070         Fix the !ENABLE(INDEXED_DATABASE) build after r201575
2071         https://bugs.webkit.org/show_bug.cgi?id=158346
2072
2073         Reviewed by Brady Eidson.
2074
2075         * DatabaseProcess/DatabaseProcess.cpp:
2076         (WebKit::DatabaseProcess::fetchWebsiteData):
2077         (WebKit::DatabaseProcess::deleteWebsiteData):
2078         (WebKit::DatabaseProcess::deleteWebsiteDataForOrigins):
2079
2080 2016-06-02  Chris Dumez  <cdumez@apple.com>
2081
2082         Crash under WebProcess::registerWithStateDumper()
2083         https://bugs.webkit.org/show_bug.cgi?id=158304
2084         <rdar://problem/25329276>
2085
2086         Reviewed by Anders Carlsson.
2087
2088         The issue is that the block in registerWithStateDumper() was executed in
2089         a background thread and is iterating over m_pageMap HashMap. The crash
2090         occurs when a page gets removed from the m_pageMap HashMap while the
2091         block is iterating over this same HashMap in another thread.
2092
2093         The solution proposed is to execute the registerWithStateDumper()'s
2094         block in the main thread.
2095
2096         * WebProcess/cocoa/WebProcessCocoa.mm:
2097         (WebKit::WebProcess::registerWithStateDumper):
2098
2099 2016-06-02  Brady Eidson  <beidson@apple.com>
2100
2101         Overhaul cross-thread use of ResourceRequest, ResourceResponse, and ResourceError.
2102         https://bugs.webkit.org/show_bug.cgi?id=158293
2103
2104         Reviewed by Darin Adler.
2105
2106         * NetworkProcess/cache/NetworkCacheEntry.cpp:
2107         (WebKit::NetworkCache::Entry::Entry):
2108
2109 2016-06-02  Chris Dumez  <cdumez@apple.com>
2110
2111         Modernize various lambda captures
2112         https://bugs.webkit.org/show_bug.cgi?id=158292
2113
2114         Reviewed by Brady Eidson.
2115
2116         Modernize various lambda captures, especially the ones unnecessarily
2117         allocating objects on the heap and destroying them in the lambda.
2118
2119         * NetworkProcess/NetworkProcess.cpp:
2120         (WebKit::fetchDiskCacheEntries):
2121         (WebKit::clearDiskCacheEntries):
2122         (WebKit::NetworkProcess::fetchWebsiteData): Deleted.
2123         * NetworkProcess/cache/NetworkCache.cpp:
2124         (WebKit::NetworkCache::Cache::traverse):
2125         * NetworkProcess/cache/NetworkCache.h:
2126         * NetworkProcess/cache/NetworkCacheStorage.cpp:
2127         (WebKit::NetworkCache::Storage::TraverseOperation::TraverseOperation):
2128         * NetworkProcess/cache/NetworkCacheStorage.h:
2129
2130 2016-06-02  Chris Dumez  <cdumez@apple.com>
2131
2132         Speculative revalidated request returns 200 instead of 304
2133         https://bugs.webkit.org/show_bug.cgi?id=158256
2134
2135         Reviewed by Antti Koivisto and Carlos Garcia Campos.
2136
2137         Already conditional requests coming from WebCore should bypass the
2138         SpeculativeLoadManager. This is because the validation is requested
2139         by WebCore (usually the memory cache) and not our network cache. As
2140         a result, we need to pipe the revalidation response (e.g. 304 status
2141         code) back to WebCore instead of resolving it as disk cache level.
2142
2143         This should fix the /webkit2/WebKitWebResource/response unit test.
2144
2145         * NetworkProcess/cache/NetworkCache.cpp:
2146         (WebKit::NetworkCache::Cache::retrieve):
2147         * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
2148         (WebKit::NetworkCache::requestsHeadersMatch):
2149
2150 2016-06-02  Youenn Fablet  <youenn.fablet@crf.canon.fr>
2151
2152         Use more references in ResourceLoader related code
2153         https://bugs.webkit.org/show_bug.cgi?id=158222
2154
2155         Reviewed by Darin Adler.
2156
2157         * WebProcess/Network/WebLoaderStrategy.cpp:
2158         (WebKit::WebLoaderStrategy::loadResource):
2159         (WebKit::WebLoaderStrategy::schedulePluginStreamLoad):
2160         (WebKit::WebLoaderStrategy::scheduleLoad):
2161         (WebKit::WebLoaderStrategy::scheduleInternallyFailedLoad):
2162         (WebKit::WebLoaderStrategy::startLocalLoad):
2163         (WebKit::WebLoaderStrategy::networkProcessCrashed):
2164         * WebProcess/Network/WebLoaderStrategy.h:
2165         * WebProcess/Network/WebResourceLoader.cpp:
2166         (WebKit::WebResourceLoader::create):
2167         (WebKit::WebResourceLoader::WebResourceLoader):
2168         * WebProcess/Network/WebResourceLoader.h:
2169         * WebProcess/Plugins/PluginView.cpp:
2170         (WebKit::PluginView::Stream::start):
2171
2172 2016-06-01  Yongjun Zhang  <yongjun_zhang@apple.com>
2173
2174         Notify client immediately if network session doesn't exist for a synchronous XHR load.
2175         https://bugs.webkit.org/show_bug.cgi?id=158239
2176         <rdar://problem/26344251>
2177
2178         Reviewed by Brady Eidson.
2179
2180         For a synchronous XHR load, if the network session doesn't exist, we should notify NetworkLoadClient.
2181         Otherwise the Web process could hang when waiting for the synchronous load to finish.
2182
2183         * NetworkProcess/NetworkLoad.cpp:
2184         (WebKit::NetworkLoad::NetworkLoad):
2185
2186 2016-05-31  Brian Burg  <bburg@apple.com>
2187   
2188         REGRESSION(r191907): Can't enter combining diacritic marks in Web Inspector fields
2189         https://bugs.webkit.org/show_bug.cgi?id=158227
2190         <rdar://problem/26232464>
2191
2192         Reviewed by Darin Adler and Alexey Proskuryakov.
2193
2194         Web Inspector uses a WKWebView subclass for the inspector frontend interface.
2195         Since r191907, WKWebView does not have an inner WKView, and instead shares
2196         a WebViewImpl to implement the same methods as WKView. So, WKView is no longer
2197         involved at all when delivering keystrokes to the Web Inspector interface.
2198
2199         This caused a subtle regression where some keystrokes were not being interpreted
2200         in the same way by AppKit because WKWebView does not conform to NSTextInputClient
2201         but WKView does. AppKit won't automatically create a NSTextInputContext for a NSView
2202         unless the subclass is declared as conforming to NSTextInputClient. Thus, the keystroke
2203         never goes through NSTextInputContext machinery which converts the keystroke into
2204         a combining diacritic character.
2205
2206         This regression is covered by a new API test.
2207
2208         * UIProcess/API/Cocoa/WKWebView.mm: mark WKWebView as conforming to NSTextInputClient.
2209
2210 2016-06-01  Dan Bernstein  <mitz@apple.com>
2211
2212         Try to fix ENABLE(IOS_TOUCH_EVENTS) builds.
2213
2214         * WebProcess/WebPage/EventDispatcher.cpp:
2215         (WebKit::EventDispatcher::touchEvent):
2216
2217 2016-05-31  Darin Adler  <darin@apple.com>
2218
2219         Audit RenderObject casts and fix problems and style issues found
2220         https://bugs.webkit.org/show_bug.cgi?id=158221
2221
2222         Reviewed by Chris Dumez.
2223
2224         * Shared/WebRenderObject.cpp:
2225         (WebKit::WebRenderObject::WebRenderObject): Tightened up the code that
2226         builds the tree of objects; fewer local variables.
2227
2228         * WebProcess/Plugins/PluginView.cpp:
2229         (WebKit::PluginView::invalidateRect): Cast to RenderEmbeddedObject since
2230         that is the class used for plug-ins.
2231         (WebKit::PluginView::pluginProcessCrashed): Ditto.
2232         * WebProcess/WebPage/WebPage.cpp:
2233         (WebKit::WebPage::createPlugin): Ditto.
2234         (WebKit::WebPage::plugInIsPrimarySize): Check the renderer for null here.
2235         Did not change this to RenderEmbeddedObject, though, because I wasn't
2236         absolute certain this is only called with that type of renderer.
2237
2238         * WebProcess/WebPage/ios/WebPageIOS.mm:
2239         (WebKit::WebPage::rangeForWebSelectionAtPosition): Tweaked.
2240
2241 2016-06-01  Brady Eidson  <beidson@apple.com>
2242
2243         Modernize lambda usage for all callers of RunLoop::dispatch() (take 2).
2244         https://bugs.webkit.org/show_bug.cgi?id=158277
2245
2246         Reviewed by Chris Dumez.
2247
2248         * NetworkProcess/cache/NetworkCache.cpp:
2249         (WebKit::NetworkCache::Cache::deleteDumpFile):
2250
2251         * Platform/IPC/Connection.cpp:
2252         (IPC::Connection::addWorkQueueMessageReceiver):
2253         (IPC::Connection::removeWorkQueueMessageReceiver):
2254         (IPC::Connection::invalidate):
2255         (IPC::Connection::sendMessage):
2256         (IPC::Connection::processIncomingMessage):
2257         (IPC::Connection::postConnectionDidCloseOnConnectionWorkQueue):
2258
2259         * UIProcess/Storage/LocalStorageDatabaseTracker.cpp:
2260         (WebKit::LocalStorageDatabaseTracker::LocalStorageDatabaseTracker):
2261
2262         * UIProcess/Storage/StorageManager.cpp:
2263         (WebKit::StorageManager::createSessionStorageNamespace):
2264         (WebKit::StorageManager::destroySessionStorageNamespace):
2265         (WebKit::StorageManager::setAllowedSessionStorageNamespaceConnection):
2266         (WebKit::StorageManager::cloneSessionStorageNamespace):
2267         (WebKit::StorageManager::processDidCloseConnection):
2268
2269         * UIProcess/WebResourceLoadStatisticsStore.cpp:
2270         (WebKit::WebResourceLoadStatisticsStore::readDataFromDiskIfNeeded):
2271
2272         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2273         (WebKit::WebsiteDataStore::fetchData):
2274         (WebKit::WebsiteDataStore::removeData):
2275
2276 2016-06-01  Chris Dumez  <cdumez@apple.com>
2277
2278         [iOS] Regression(r200972): Crash under WebKit::WebPage::selectTextWithGranularityAtPoint()
2279         https://bugs.webkit.org/show_bug.cgi?id=158284
2280         <rdar://problem/26573954>
2281
2282         Reviewed by Ryosuke Niwa.
2283
2284         range can be null but r200972 started dereferencing it without null
2285         check. This patch adds a null check for range and uses the pre-r200972
2286         code path if range is null.
2287
2288         * WebProcess/WebPage/ios/WebPageIOS.mm:
2289         (WebKit::WebPage::selectTextWithGranularityAtPoint):
2290
2291 2016-06-01  Brady Eidson  <beidson@apple.com>
2292
2293         Modernize lambda usage for all callers of RunLoop::dispatch().
2294         https://bugs.webkit.org/show_bug.cgi?id=158265
2295
2296         Reviewed by Chris Dumez.
2297
2298         * DatabaseProcess/DatabaseProcess.cpp:
2299         (WebKit::DatabaseProcess::fetchWebsiteData):
2300         (WebKit::DatabaseProcess::deleteWebsiteData):
2301         (WebKit::DatabaseProcess::deleteWebsiteDataForOrigins):
2302         
2303         * NetworkProcess/NetworkProcess.cpp:
2304         (WebKit::fetchDiskCacheEntries):
2305         (WebKit::NetworkProcess::fetchWebsiteData):
2306         
2307         * NetworkProcess/cache/NetworkCacheStorage.cpp:
2308         (WebKit::NetworkCache::Storage::remove):
2309         (WebKit::NetworkCache::retrieveFromMemory):
2310         
2311         * Platform/IPC/Connection.cpp:
2312         (IPC::Connection::SyncMessageState::processIncomingMessage):
2313         (IPC::Connection::processIncomingMessage):
2314         (IPC::Connection::connectionDidClose):
2315         (IPC::Connection::enqueueIncomingMessage):
2316         * Platform/IPC/mac/ConnectionMac.mm:
2317         (IPC::Connection::receiveSourceEventHandler):
2318         
2319         * Shared/mac/CookieStorageShim.mm:
2320         (-[WKNSURLSessionLocal _getCookieHeadersForTask:completionHandler:]):
2321         * UIProcess/API/APIUserContentExtensionStore.cpp:
2322         (API::UserContentExtensionStore::lookupContentExtension):
2323         (API::UserContentExtensionStore::compileContentExtension):
2324         (API::UserContentExtensionStore::removeContentExtension):
2325         
2326         * UIProcess/Launcher/ProcessLauncher.cpp:
2327         (WebKit::ProcessLauncher::ProcessLauncher):
2328         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
2329         (WebKit::connectToService):
2330         
2331         * UIProcess/Storage/StorageManager.cpp:
2332         (WebKit::StorageManager::getSessionStorageOrigins):
2333         (WebKit::StorageManager::deleteSessionStorageOrigins):
2334         (WebKit::StorageManager::deleteSessionStorageEntriesForOrigins):
2335         (WebKit::StorageManager::getLocalStorageOrigins):
2336         (WebKit::StorageManager::getLocalStorageOriginDetails):
2337         (WebKit::StorageManager::deleteLocalStorageEntriesForOrigin):
2338         (WebKit::StorageManager::deleteLocalStorageOriginsModifiedSince):
2339         (WebKit::StorageManager::deleteLocalStorageEntriesForOrigins):
2340         
2341         * UIProcess/WebPageProxy.cpp:
2342         (WebKit::WebPageProxy::isWebProcessResponsive):
2343         
2344         * UIProcess/WebProcessProxy.cpp:
2345         (WebKit::WebProcessProxy::isResponsive):
2346         
2347         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2348         (WebKit::WebsiteDataStore::fetchData):
2349         
2350         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
2351         (WebKit::NetscapePlugin::pluginThreadAsyncCall):
2352         
2353         * WebProcess/Plugins/PluginView.cpp:
2354         (WebKit::PluginView::unprotectPluginFromDestruction):
2355         
2356         * WebProcess/WebPage/EventDispatcher.cpp:
2357         (WebKit::EventDispatcher::wheelEvent):
2358         (WebKit::EventDispatcher::gestureEvent):
2359         (WebKit::EventDispatcher::touchEvent):
2360         
2361         * WebProcess/WebPage/ViewUpdateDispatcher.cpp:
2362         (WebKit::ViewUpdateDispatcher::visibleContentRectUpdate):
2363
2364 2016-05-31  Yusuke Suzuki  <utatane.tea@gmail.com>
2365
2366         Unreviewed, roll out r201481, r201523: 0.3% regression in Octane code-load
2367         https://bugs.webkit.org/show_bug.cgi?id=158249
2368
2369         * UIProcess/API/C/WKPreferencesRefPrivate.h:
2370         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
2371
2372 2016-05-31  Beth Dakin  <bdakin@apple.com>
2373
2374         Add two optional items to WebViewImplDelegate
2375         https://bugs.webkit.org/show_bug.cgi?id=158242
2376         -and corresponding-
2377         rdar://problem/26473095
2378
2379         Reviewed by Tim Horton.
2380
2381         * UIProcess/Cocoa/WebViewImpl.h:
2382
2383 2016-05-31  Jer Noble  <jer.noble@apple.com>
2384
2385         REGRESSION (r201405): trailers.apple.com HUD is missing in fullscreen
2386         https://bugs.webkit.org/show_bug.cgi?id=158156
2387         <rdar://problem/26519589>
2388
2389         Reviewed by Darin Adler.
2390
2391         Only increase the frame of the webView (to account for top content inset) in one dimension.
2392
2393         * UIProcess/mac/WKFullScreenWindowController.mm:
2394         (-[WKFullScreenWindowController enterFullScreen:]):
2395
2396 2016-05-31  Chris Dumez  <cdumez@apple.com>
2397
2398         [iOS] Better deal with WebProcess suspension due to screen locking
2399         https://bugs.webkit.org/show_bug.cgi?id=158229
2400         <rdar://problem/17665473>
2401         <rdar://problem/26554699>
2402
2403         Reviewed by Tim Horton.
2404
2405         When locking the screen while MobileSafari is front-most, we would try keep
2406         trying to mark IOSurfaces as volatile until the 30 seconds timeout was
2407         reached. This patch deals more cleanly with this situation by only trying
2408         to mark IOSurfaces as volatile once if the suspension is due to screen
2409         locking. In such case, it is apparently expected that some IOSurfaces cannot
2410         be marked as volatile so it is enough to try once and let ourselves get
2411         suspended.
2412
2413         This patch also reduces the timeout from 30 seconds to ~3 seconds in the
2414         other suspension cases (e.g. homing out of MobileSafari). If we fail to mark
2415         them as purgeable for 3 seconds for a reason or another, it is no use in
2416         retrying, it is simply not going to happen and there is no reason to delay
2417         process suspension any further.
2418
2419         * WebProcess/WebPage/WebPage.cpp:
2420         (WebKit::WebPage::callVolatilityCompletionHandlers):
2421         (WebKit::WebPage::layerVolatilityTimerFired):
2422         (WebKit::WebPage::markLayersVolatileImmediatelyIfPossible):
2423         (WebKit::WebPage::markLayersVolatile):
2424         * WebProcess/WebPage/WebPage.h:
2425         (WebKit::WebPage::markLayersVolatile):
2426         * WebProcess/WebPage/ios/WebPageIOS.mm:
2427         (WebKit::WebPage::applicationDidEnterBackground):
2428         (WebKit::WebPage::applicationWillEnterForeground):
2429
2430 2016-05-31  Brady Eidson  <beidson@apple.com>
2431
2432         Make createCrossThreadTask() functions return on the stack instead of the heap.
2433         https://bugs.webkit.org/show_bug.cgi?id=158215
2434
2435         Reviewed by Darin Adler.
2436
2437         * DatabaseProcess/DatabaseProcess.cpp:
2438         (WebKit::DatabaseProcess::postDatabaseTask):
2439         (WebKit::DatabaseProcess::performNextDatabaseTask):
2440         (WebKit::DatabaseProcess::fetchWebsiteData):
2441         * DatabaseProcess/DatabaseProcess.h:
2442
2443 2016-05-31  Carlos Garcia Campos  <cgarcia@igalia.com>
2444
2445         Unreviewed. Update OptionsGTK.cmake and NEWS for 2.13.1 release.
2446
2447         * gtk/NEWS: Add release notes for 2.13.1.
2448
2449 2016-05-31  Carlos Garcia Campos  <cgarcia@igalia.com>
2450
2451         Unreviewed. Fix GTK+ clean build after r201504.
2452
2453         * DatabaseProcess/DatabaseProcess.cpp: Add missing include.
2454
2455 2016-05-30  Brady Eidson  <beidson@apple.com>
2456
2457         Move CrossThreadCopier/CrossThreadTask to WTF.
2458         https://bugs.webkit.org/show_bug.cgi?id=158207
2459
2460         Reviewed by Alex Christensen.
2461
2462         * CMakeLists.txt:
2463         * WebKit2.xcodeproj/project.pbxproj:
2464
2465         * DatabaseProcess/DatabaseProcess.cpp:
2466         * DatabaseProcess/DatabaseProcess.h:
2467
2468         * Shared/WebCrossThreadCopier.cpp: Removed.
2469         * Shared/WebCrossThreadCopier.h: Removed.
2470
2471 2016-05-28  Chris Dumez  <cdumez@apple.com>
2472
2473         Templatize NoncopyableFunction class similarly to std::function
2474         https://bugs.webkit.org/show_bug.cgi?id=158185
2475
2476         Reviewed by Darin Adler.
2477
2478         Templatize NoncopyableFunction class similarly to std::function, so
2479         that it can be used as a std::function replacement in more places.
2480
2481         Previously, NoncopyableFunction could only support "void()" lambdas.
2482
2483         * NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp:
2484         (WebKit::NetworkCache::runTaskInQueue):
2485
2486 2016-05-28  Alexey Proskuryakov  <ap@apple.com>
2487
2488         Fix the build with newer clang and other custom configuration options
2489         https://bugs.webkit.org/show_bug.cgi?id=158161
2490
2491         Reviewed by Dan Bernstein.
2492
2493         * NetworkProcess/ios/NetworkProcessIOS.mm: -setAllowsSpecificHTTPSCertificate:forHost:
2494         is now in CFNetworkSPI.h
2495         * NetworkProcess/mac/NetworkProcessMac.mm: Ditto.
2496         * Shared/mac/CookieStorageShimLibrary.cpp:
2497         (WebKit::WebKitCookieStorageShimInitialize): Use more portable std::call_once.
2498
2499 2016-05-28  Chris Dumez  <cdumez@apple.com>
2500
2501         Modernize lambda captures in the network disk cache implementation
2502         https://bugs.webkit.org/show_bug.cgi?id=158179
2503
2504         Reviewed by Darin Adler.
2505
2506         Modernize lambda captures in the network disk cache implementation.
2507
2508         * NetworkProcess/cache/NetworkCache.cpp:
2509         (WebKit::NetworkCache::Cache::retrieve):
2510         (WebKit::NetworkCache::Cache::store):
2511         (WebKit::NetworkCache::Cache::traverse):
2512         * NetworkProcess/cache/NetworkCache.h:
2513         * NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp:
2514         (WebKit::NetworkCache::inputStreamReadReadyCallback):
2515         (WebKit::NetworkCache::outputStreamWriteReadyCallback):
2516         * NetworkProcess/cache/NetworkCacheStatistics.cpp:
2517         (WebKit::NetworkCache::Statistics::initialize):
2518         (WebKit::NetworkCache::Statistics::shrinkIfNeeded):
2519         (WebKit::NetworkCache::Statistics::queryWasEverRequested):
2520         * NetworkProcess/cache/NetworkCacheStatistics.h:
2521         * NetworkProcess/cache/NetworkCacheStorage.cpp:
2522         (WebKit::NetworkCache::Storage::updateFileModificationTime):
2523         (WebKit::NetworkCache::Storage::clear):
2524
2525 2016-05-27  Caitlin Potter  <caitp@igalia.com>
2526
2527         [JSC] implement async functions proposal
2528         https://bugs.webkit.org/show_bug.cgi?id=156147
2529
2530         Reviewed by Yusuke Suzuki.
2531
2532         * UIProcess/API/C/WKPreferencesRefPrivate.h:
2533         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
2534
2535 2016-05-27  Chris Dumez  <cdumez@apple.com>
2536
2537         Improve lambda capture in NetworkCache::Storage::synchronize()
2538         https://bugs.webkit.org/show_bug.cgi?id=158176
2539
2540         Reviewed by Brady Eidson.
2541
2542         Improve lambda capture in NetworkCache::Storage::synchronize(). We can
2543         now capture the std::unique_ptr<> variables directly thanks to:
2544         1. C++14's support for initializer's in lambda captures
2545         2. RunLoop::dispatch() now takes a NoncopyableFunction in instead of
2546            a std::function, allowing us to capture non-copyable variables.
2547
2548         * NetworkProcess/cache/NetworkCacheStorage.cpp:
2549         (WebKit::NetworkCache::Storage::synchronize):
2550
2551 2016-05-27  Jeremy Jones  <jeremyj@apple.com>
2552
2553         Decrease flicker when changing video presentation mode.
2554         https://bugs.webkit.org/show_bug.cgi?id=158148
2555         rdar://problem/24476949
2556
2557         Reviewed by Tim Horton.
2558
2559         Prevent flicker by using setVideoFullscreenLayer with a completion handler to delay 
2560         enter fullscreen and cleanup fullscreen until the video layer has completely been
2561         installed or removed.
2562
2563         * WebProcess/cocoa/WebVideoFullscreenManager.mm:
2564         (WebKit::WebVideoFullscreenManager::didSetupFullscreen):
2565         (WebKit::WebVideoFullscreenManager::didExitFullscreen):
2566
2567 2016-05-27  Chris Dumez  <cdumez@apple.com>
2568
2569         WorkQueue::dispatch() / RunLoop::dispatch() should not copy captured lambda variables
2570         https://bugs.webkit.org/show_bug.cgi?id=158111
2571
2572         Reviewed by Darin Adler.
2573
2574         WorkQueue::dispatch() / RunLoop::dispatch() should not copy captured lambda variables.
2575         These are often used cross-thread and copying the captured lambda variables can be
2576         dangerous (e.g. we do not want to copy a String after calling isolatedCopy() upon
2577         capture).
2578
2579         * NetworkProcess/NetworkProcess.cpp:
2580         (WebKit::clearDiskCacheEntries):
2581         * NetworkProcess/cache/NetworkCache.cpp:
2582         (WebKit::NetworkCache::Cache::clear):
2583         * NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp:
2584         (WebKit::NetworkCache::runTaskInQueue):
2585         * Platform/IPC/Connection.cpp:
2586         (IPC::Connection::processIncomingMessage):
2587         * UIProcess/Storage/StorageManager.cpp:
2588         (WebKit::StorageManager::getSessionStorageOrigins):
2589         (WebKit::StorageManager::deleteSessionStorageOrigins):
2590         (WebKit::StorageManager::deleteSessionStorageEntriesForOrigins):
2591         (WebKit::StorageManager::getLocalStorageOrigins):
2592         (WebKit::StorageManager::getLocalStorageOriginDetails):
2593         (WebKit::StorageManager::deleteLocalStorageOriginsModifiedSince):
2594         (WebKit::StorageManager::deleteLocalStorageEntriesForOrigins):
2595         * UIProcess/Storage/StorageManager.h:
2596
2597 2016-05-27  Alex Christensen  <achristensen@webkit.org>
2598
2599         Expose content extension failure error codes in SPI
2600         https://bugs.webkit.org/show_bug.cgi?id=158095
2601         rdar://problem/26475651
2602
2603         Reviewed by Anders Carlsson.
2604
2605         * UIProcess/API/APIUserContentExtensionStore.cpp:
2606         (API::UserContentExtensionStore::synchronousRemoveAllContentExtensions):
2607         (API::UserContentExtensionStore::invalidateContentExtensionVersion):
2608         Added for testing.
2609         (API::userContentExtensionStoreErrorCategory):
2610         * UIProcess/API/APIUserContentExtensionStore.h:
2611         * UIProcess/API/Cocoa/_WKUserContentExtensionStore.h:
2612         Added the new enum, _WKUserContentExtensionStoreErrorCode.
2613         * UIProcess/API/Cocoa/_WKUserContentExtensionStore.mm:
2614         (-[_WKUserContentExtensionStore compileContentExtensionForIdentifier:encodedContentExtension:completionHandler:]):
2615         Sometimes the error code returned by UserContentExtensionStore::compileContentExtension has the error code from compileRuleList.
2616         When this happens, we want to get the message from the internal compiler error, but we want the NSError's code to always be CompileFailed.
2617         (-[_WKUserContentExtensionStore lookupContentExtensionForIdentifier:completionHandler:]):
2618         (-[_WKUserContentExtensionStore removeContentExtensionForIdentifier:completionHandler:]):
2619         (-[_WKUserContentExtensionStore _removeAllContentExtensions]):
2620         (-[_WKUserContentExtensionStore _invalidateContentExtensionVersionForIdentifier:]):
2621         * UIProcess/API/Cocoa/_WKUserContentExtensionStorePrivate.h:
2622         Added new invalidator for testing.
2623
2624 2016-05-27  Zalan Bujtas  <zalan@apple.com>
2625
2626         Regression(r200972): Webcore::Range::collectSelectionsRects() asserts in startContainer() while selecting text.
2627         https://bugs.webkit.org/show_bug.cgi?id=158155
2628         <rdar://problem/26502712>
2629
2630         Reviewed by Chris Dumez.
2631
2632         This patch ensures that we still have a valid paragraphRange after returning from enclosingTextUnitOfGranularity().
2633
2634         * WebProcess/WebPage/ios/WebPageIOS.mm:
2635         (WebKit::WebPage::selectTextWithGranularityAtPoint):
2636
2637 2016-05-26  Brady Eidson  <beidson@apple.com>
2638
2639         Certain NetworkResourceLoader callbacks can deref a null m_networkLoad.
2640         https://bugs.webkit.org/show_bug.cgi?id=158134
2641
2642         Reviewed by Alex Christensen.
2643
2644         It's legit for m_networkLoad to be null in these callbacks.
2645         
2646         We need null checks, just like we have in many other callbacks in this class.
2647         
2648         * NetworkProcess/NetworkResourceLoader.cpp:
2649         (WebKit::NetworkResourceLoader::continueWillSendRequest):
2650         (WebKit::NetworkResourceLoader::continueCanAuthenticateAgainstProtectionSpace):
2651
2652 2016-05-26  Darin Adler  <darin@apple.com>
2653
2654         Media queries and platform screen modernization and streamlining
2655         https://bugs.webkit.org/show_bug.cgi?id=158067
2656
2657         Reviewed by Alex Christensen.
2658
2659         * Shared/mac/WebEventFactory.mm:
2660         (WebKit::screenForWindow): Deleted.
2661         (WebKit::flipScreenPoint): Deleted.
2662         (WebKit::globalPoint): Deleted.
2663         (WebKit::globalPointForEvent): Use globalPoint function from WebCore so we don't need
2664         copies of everything in here.
2665
2666         * UIProcess/Cocoa/WebViewImpl.mm:
2667         (WebKit::WebViewImpl::windowDidChangeScreen): Removed unneeded type cast.
2668         (WebKit::WebViewImpl::draggedImage): Added type cast since globalPoint now returns an
2669         NSPoint rather than an IntPoint.
2670
2671         * UIProcess/WebPageProxy.h: Use pragma once. Add a WebCore prefix to a use of
2672         PlatformDisplayID, since that is now inside the WebCore namespace.
2673         * WebProcess/WebCoreSupport/WebChromeClient.h: Ditto.
2674         * WebProcess/WebPage/Cocoa/RemoteLayerTreeDisplayRefreshMonitor.h: Ditto.
2675         * WebProcess/WebPage/DrawingArea.h: Ditto.
2676         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h: Ditto.
2677
2678 2016-05-26  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
2679
2680         Purge PassRefPtr in Modules/battery
2681         https://bugs.webkit.org/show_bug.cgi?id=157062
2682
2683         Reviewed by Darin Adler.
2684
2685         Use RefPtr<>& to reduce uses of PassRefPtr in WebKit.
2686
2687         * WebProcess/Battery/WebBatteryManager.cpp:
2688         (WebKit::WebBatteryManager::didChangeBatteryStatus):
2689         (WebKit::WebBatteryManager::updateBatteryStatus):
2690         * WebProcess/WebPage/WebPage.cpp:
2691         (WebKit::m_shouldDispatchFakeMouseMoveEvents):
2692
2693 2016-05-26  Myles C. Maxfield  <mmaxfield@apple.com>
2694
2695         Build fix
2696
2697         Rubber stamped by Lucas Forschler.
2698
2699         * Configurations/DebugRelease.xcconfig:
2700
2701 2016-05-25  Jer Noble  <jer.noble@apple.com>
2702
2703         Flashiness and jumpiness when entering fullscreen
2704         https://bugs.webkit.org/show_bug.cgi?id=158087
2705
2706         Reviewed by Beth Dakin.
2707
2708         Multiple independant sources of jumpiness and flashiness are addressed here:
2709
2710         - Setting the top content inset on the WKView cause a vertical jump during fullscreen
2711         transition. Instead of setting the content inset to 0, take the existing inset into account
2712         when placing the WKView in the NSWindow.
2713
2714         - The enter fullscreen transition causes a white flash due to the NSWindow needing
2715         display before ordering onscreen. Ensure the window has a backing by calling -displayIfNeeded
2716         before entering fullscreen mode.
2717
2718         - The exit fullscreen transition causes a white background color flash for an unknown
2719         reason, but is solved by not making the window's content view layer-backed. Rather than
2720         directly animating the contentView's background color, create a specific background view
2721         and animate it's background color instead.
2722
2723         * UIProcess/mac/WKFullScreenWindowController.h:
2724         * UIProcess/mac/WKFullScreenWindowController.mm:
2725         (-[WKFullScreenWindowController initWithWindow:webView:page:]):
2726         (-[WKFullScreenWindowController enterFullScreen:]):
2727         (-[WKFullScreenWindowController finishedEnterFullScreenAnimation:]):
2728         (-[WKFullScreenWindowController finishedExitFullScreenAnimation:]):
2729         (-[WKFullScreenWindowController _startEnterFullScreenAnimationWithDuration:]):
2730         (-[WKFullScreenWindowController _startExitFullScreenAnimationWithDuration:]):
2731         * WebProcess/FullScreen/WebFullScreenManager.cpp:
2732         (WebKit::WebFullScreenManager::saveScrollPosition): Deleted.
2733         (WebKit::WebFullScreenManager::restoreScrollPosition): Deleted.
2734
2735 2016-05-25  Alex Christensen  <achristensen@webkit.org>
2736
2737         Fix CMake build.
2738
2739         * PlatformMac.cmake:
2740
2741 2016-05-25  Chris Dumez  <cdumez@apple.com>
2742
2743         Simplify a few lambda captures in the network cache code
2744         https://bugs.webkit.org/show_bug.cgi?id=158076
2745
2746         Reviewed by Antti Koivisto.
2747
2748         Simplify a few lambda captures in the network cache code by WTFMoving
2749         upon capture.
2750
2751         * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
2752         (WebKit::NetworkCache::SpeculativeLoadManager::retrieve):
2753         (WebKit::NetworkCache::SpeculativeLoadManager::retrieveEntryFromStorage):
2754         (WebKit::NetworkCache::SpeculativeLoadManager::retrieveSubresourcesEntry):
2755         * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.h:
2756         * NetworkProcess/cache/NetworkCacheStatistics.cpp:
2757         (WebKit::NetworkCache::Statistics::bootstrapFromNetworkCache):
2758         (WebKit::NetworkCache::Statistics::recordNotUsingCacheForRequest):
2759         (WebKit::NetworkCache::Statistics::recordRetrievalFailure):
2760         (WebKit::NetworkCache::Statistics::writeTimerFired):
2761         (WebKit::NetworkCache::Statistics::addHashesToDatabase):
2762         (WebKit::NetworkCache::Statistics::addStoreDecisionsToDatabase):
2763         * NetworkProcess/cache/NetworkCacheStatistics.h:
2764
2765 2016-05-25  Fujii Hironori  <Hironori.Fujii@sony.com>
2766
2767         [Unix] Potential buffer overrun of m_fileDescriptors in readBytesFromSocket of ConnectionUnix.cpp
2768         https://bugs.webkit.org/show_bug.cgi?id=158058
2769
2770         Reviewed by Carlos Garcia Campos.
2771
2772         Memcpy does not check the boundary of m_fileDescriptors in
2773         readBytesFromSocket of ConnectionUnix.cpp.  This is not a problem
2774         in normal cases, but in the case when Web process is hijacked and
2775         malicious IPC packets were sent.  WTF::Vector already has two
2776         members m_capacity and m_size.  There is no need to have a
2777         separate member m_fileDescriptorsSize to remember the number of
2778         remaining data.
2779
2780         * Platform/IPC/Connection.h: Remove members m_readBufferSize and
2781         m_fileDescriptorsSize.
2782         * Platform/IPC/unix/ConnectionUnix.cpp:
2783         (IPC::Connection::platformInitialize): Removed initialization of
2784         m_readBufferSize and m_fileDescriptorsSize.  Reserve initial
2785         capacity for m_readBuffer and m_fileDescriptors.
2786         (IPC::Connection::processMessage): Replace m_readBufferSize and
2787         m_fileDescriptorsSize with m_readBuffer.size() and
2788         m_fileDescriptors.size().  Use Vector::shrink() to reset the
2789         number of remaining data in the buffers.
2790         (IPC::readBytesFromSocket) : Change argument types to WTF::Vector
2791         instead of pointers and sizes.
2792         (IPC::Connection::readyReadHandler): Call new readBytesFromSocket
2793
2794 2016-05-25  Chris Dumez  <cdumez@apple.com>
2795
2796         Update constructRevalidationRequest() to stop returning a unique_ptr<ResourceRequest>
2797         https://bugs.webkit.org/show_bug.cgi?id=158046
2798
2799         Reviewed by Darin Adler.
2800
2801         Update constructRevalidationRequest() to stop returning a unique_ptr<ResourceRequest>
2802         and to return a ResourceRequest instead. There is no reason for it to return a
2803         pointer.
2804
2805         * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
2806         (WebKit::NetworkCache::constructRevalidationRequest):
2807         (WebKit::NetworkCache::SpeculativeLoadManager::PreloadedEntry::PreloadedEntry):
2808         (WebKit::NetworkCache::SpeculativeLoadManager::PreloadedEntry::revalidationRequest):
2809         (WebKit::NetworkCache::SpeculativeLoadManager::addPreloadedEntry):
2810         (WebKit::NetworkCache::SpeculativeLoadManager::revalidateEntry):
2811         * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.h:
2812
2813 2016-05-25  Antoine Quint  <graouts@apple.com>
2814
2815         Elements with backdrop-filter cannot be clipped with clip-path or mask
2816         https://bugs.webkit.org/show_bug.cgi?id=142662
2817         <rdar://problem/20150192>
2818
2819         Reviewed by Dean Jackson.
2820
2821         Ensure layer clones are set up with the same shape path as their original layer.
2822
2823         * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
2824         (WebKit::PlatformCALayerRemote::updateClonedLayerProperties):
2825
2826 2016-05-24  Chris Dumez  <cdumez@apple.com>
2827
2828         Simplify a couple of lambda captures in the network cache code
2829         https://bugs.webkit.org/show_bug.cgi?id=158053
2830
2831         Reviewed by Brady Eidson.
2832
2833         * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
2834         (WebKit::NetworkCache::SpeculativeLoadManager::preloadEntry):
2835         Just capture subResourceInfo instead of allocating a new copy
2836         on the heap. There is no reason we cannot simply capture
2837         subResourceInfo here.
2838
2839         * NetworkProcess/cache/NetworkCacheStorage.cpp:
2840         (WebKit::NetworkCache::Storage::clear):
2841         Use new C++14 capture with initialization to make the code a
2842         bit nicer.
2843
2844 2016-05-24  Conrad Shultz  <conrad_shultz@apple.com>
2845
2846         _WKThumbnailView should expose its snapshot size
2847         https://bugs.webkit.org/show_bug.cgi?id=158049
2848
2849         Reviewed by Tim Horton.
2850
2851         * UIProcess/API/Cocoa/_WKThumbnailView.h:
2852         * UIProcess/API/Cocoa/_WKThumbnailView.mm:
2853         (-[_WKThumbnailView _didTakeSnapshot:]):
2854         Update the new snapshotSize property in a KVO-compliant manner.
2855
2856 2016-05-24  Ryan Haddad  <ryanhaddad@apple.com>
2857
2858         Unreviewed, rolling out r201349.
2859
2860         This change caused compositing tests to assert on iOS
2861         simulator
2862
2863         Reverted changeset:
2864
2865         "Elements with backdrop-filter cannot be clipped with clip-
2866         path or mask"
2867         https://bugs.webkit.org/show_bug.cgi?id=142662
2868         http://trac.webkit.org/changeset/201349
2869
2870 2016-05-24  Ryan Haddad  <ryanhaddad@apple.com>
2871
2872         Unreviewed, rolling out r201341.
2873
2874         This change may have caused LayoutTests to crash on Mac and
2875         iOS
2876
2877         Reverted changeset:
2878
2879         "Use lambda capture with initializer instead of StringCapture"
2880         https://bugs.webkit.org/show_bug.cgi?id=158010
2881         http://trac.webkit.org/changeset/201341
2882
2883 2016-05-24  Alex Christensen  <achristensen@webkit.org>
2884
2885         Fix null pointer dereferencing in WebViewImpl::inputContext
2886         https://bugs.webkit.org/show_bug.cgi?id=158026
2887         rdar://problem/25994093
2888
2889         Reviewed by Tim Horton.
2890
2891         * UIProcess/API/Cocoa/WKWebView.mm:
2892         (-[WKWebView inputContext]):
2893         this was null sometimes in WebViewImpl::inputContext.
2894
2895 2016-05-24  Antoine Quint  <graouts@apple.com>
2896
2897         Elements with backdrop-filter cannot be clipped with clip-path or mask
2898         https://bugs.webkit.org/show_bug.cgi?id=142662
2899         <rdar://problem/20150192>
2900
2901         Reviewed by Dean Jackson.
2902
2903         Ensure layer clones are set up with the same shape path as their original layer.
2904
2905         * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
2906         (WebKit::PlatformCALayerRemote::updateClonedLayerProperties):
2907
2908 2016-05-24  Chelsea Pugh  <cpugh@apple.com>
2909
2910         [iOS] Allow clients to override the type of an input field
2911         https://bugs.webkit.org/show_bug.cgi?id=157995
2912
2913         Reviewed by Dan Bernstein.
2914
2915         * UIProcess/API/Cocoa/_WKFormInputSession.h:
2916         * UIProcess/ios/WKContentViewInteraction.mm:
2917         (-[WKFormInputSession textContentType]): Getter for textContentType.
2918         (-[WKFormInputSession setTextContentType:]): Set the textContentType and reload
2919         input views.
2920         (contentTypeFromFieldName): Factor out switch statement to get text content type
2921         from autofill field name into its own function.
2922         (-[WKContentView textInputTraits]): If the client has set a text content type,
2923         set the traits' content type to that. Otherwise, set the text content type if
2924         there is one based on the assisted node information's autofill field name. If
2925         neither the form input session nor the assisted node info yields a text content
2926         type, set the text content type to nil, its default value.
2927
2928 2016-05-24  Chris Dumez  <cdumez@apple.com>
2929
2930         Use lambda capture with initializer instead of StringCapture
2931         https://bugs.webkit.org/show_bug.cgi?id=158010
2932
2933         Reviewed by Antti Koivisto.
2934
2935         Use lambda capture with initializer instead of StringCapture now that 
2936         we support C++14.
2937
2938         * NetworkProcess/cache/NetworkCache.cpp:
2939         (WebKit::NetworkCache::Cache::deleteDumpFile):
2940         * NetworkProcess/cache/NetworkCacheStatistics.cpp:
2941         (WebKit::NetworkCache::Statistics::initialize):
2942         (WebKit::NetworkCache::Statistics::shrinkIfNeeded):
2943         * NetworkProcess/cache/NetworkCacheStorage.cpp:
2944         (WebKit::NetworkCache::Storage::updateFileModificationTime):
2945         (WebKit::NetworkCache::Storage::clear):
2946         * UIProcess/API/APIUserContentExtensionStore.cpp:
2947         (API::UserContentExtensionStore::lookupContentExtension):
2948         (API::UserContentExtensionStore::compileContentExtension):
2949         (API::UserContentExtensionStore::removeContentExtension):
2950         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2951         (WebKit::WebsiteDataStore::fetchData):
2952         (WebKit::WebsiteDataStore::removeData):
2953
2954 2016-05-24  Chris Dumez  <cdumez@apple.com>
2955
2956         Use auto for some of our lambda function parameters
2957         https://bugs.webkit.org/show_bug.cgi?id=158001
2958
2959         Reviewed by Darin Adler.
2960
2961         Use auto for some of our lambda function parameters now that we build with c++14.
2962
2963         * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.cpp:
2964         (WebKit::WebIDBConnectionToClient::didGetRecord):
2965         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
2966         (WebKit::NetworkConnectionToWebProcess::writeBlobsToTemporaryFiles):
2967         * NetworkProcess/NetworkProcess.cpp:
2968         (WebKit::fetchDiskCacheEntries):
2969         (WebKit::NetworkProcess::fetchWebsiteData):
2970         (WebKit::clearDiskCacheEntries):
2971         * NetworkProcess/NetworkResourceLoader.cpp:
2972         (WebKit::NetworkResourceLoader::retrieveCacheEntry):
2973         (WebKit::NetworkResourceLoader::tryStoreAsCacheEntry):
2974         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
2975         (WebKit::NetworkCache::SpeculativeLoad::didFinishLoading):
2976         * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
2977         (WebKit::NetworkCache::SpeculativeLoadManager::registerLoad):
2978         (WebKit::NetworkCache::SpeculativeLoadManager::retrieveEntryFromStorage):
2979         (WebKit::NetworkCache::SpeculativeLoadManager::revalidateEntry):
2980         (WebKit::NetworkCache::SpeculativeLoadManager::preloadEntry):
2981         (WebKit::NetworkCache::SpeculativeLoadManager::retrieveSubresourcesEntry):
2982         * NetworkProcess/cache/NetworkCacheStorage.cpp:
2983         (WebKit::NetworkCache::Storage::removeFromPendingWriteOperations):
2984         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
2985         (-[WKNetworkSessionDelegate URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:]):
2986         (-[WKNetworkSessionDelegate URLSession:task:_schemeUpgraded:completionHandler:]):
2987         * Shared/API/Cocoa/_WKRemoteObjectInterface.mm:
2988         (-[_WKRemoteObjectInterface debugDescription]):
2989         * UIProcess/API/C/WKApplicationCacheManager.cpp:
2990         (WKApplicationCacheManagerGetApplicationCacheOrigins):
2991         * UIProcess/API/C/WKKeyValueStorageManager.cpp:
2992         (WKKeyValueStorageManagerGetKeyValueStorageOrigins):
2993         (WKKeyValueStorageManagerGetStorageDetailsByOrigin):
2994         * UIProcess/API/C/WKResourceCacheManager.cpp:
2995         (WKResourceCacheManagerGetCacheOrigins):
2996         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
2997         (-[WKWebsiteDataStore _fetchDataRecordsOfTypes:withOptions:completionHandler:]):
2998         * UIProcess/UserContent/WebUserContentControllerProxy.cpp:
2999         (WebKit::WebUserContentControllerProxy::removeAllUserScripts):
3000         (WebKit::WebUserContentControllerProxy::removeAllUserStyleSheets):
3001         (WebKit::WebUserContentControllerProxy::removeAllUserMessageHandlers):
3002         * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
3003         (WebKit::PlatformCALayerRemote::removeAnimationForKey):
3004
3005 2016-05-23  Yusuke Suzuki  <utatane.tea@gmail.com>
3006
3007         Assertion failure for Reflect.get with Proxy and primitive value as explicit receiver
3008         https://bugs.webkit.org/show_bug.cgi?id=157080
3009
3010         Reviewed by Saam Barati.
3011
3012         * WebProcess/Plugins/Netscape/JSNPObject.cpp:
3013         (WebKit::JSNPObject::propertyGetter):
3014         (WebKit::JSNPObject::methodGetter):
3015         * WebProcess/Plugins/Netscape/JSNPObject.h:
3016
3017 2016-05-23  Chris Dumez  <cdumez@apple.com>
3018
3019         Generate bindings code for EventTarget.addEventListener() / removeEventListener()
3020         https://bugs.webkit.org/show_bug.cgi?id=157882
3021
3022         Reviewed by Darin Adler.
3023
3024         Generate bindings code for EventTarget.addEventListener() / removeEventListener()
3025         instead of hardcoding them in the bindings generator.
3026
3027         * WebProcess/Plugins/PDF/PDFPluginAnnotation.h:
3028         * WebProcess/Plugins/PDF/PDFPluginAnnotation.mm:
3029         (WebKit::PDFPluginAnnotation::attach):
3030         (WebKit::PDFPluginAnnotation::~PDFPluginAnnotation):
3031         * WebProcess/Plugins/PDF/PDFPluginPasswordField.mm:
3032         (WebKit::PDFPluginPasswordField::~PDFPluginPasswordField):
3033         (WebKit::PDFPluginPasswordField::createAnnotationElement):
3034         * WebProcess/Plugins/PDF/PDFPluginTextAnnotation.mm:
3035         (WebKit::PDFPluginTextAnnotation::~PDFPluginTextAnnotation):
3036         (WebKit::PDFPluginTextAnnotation::createAnnotationElement):
3037
3038 2016-05-23  Beth Dakin  <bdakin@apple.com>
3039
3040         Need SPI for clients to require a user action to get an editing controls 
3041         manager
3042         https://bugs.webkit.org/show_bug.cgi?id=157992
3043         -and corresponding-
3044         rdar://problem/26379927
3045
3046         Reviewed by Tim Horton.
3047
3048         New SPI _setRequiresUserActionForEditingControlsManager. The SPI defaults to 
3049         False, which means that by default there is no user action requirement to 
3050         have an editing controls manager. The SPI is on WKViewPrivate and 
3051         WKWebViewConfigurationPrivate, and it’s implemented in WebViewImpl.
3052         * UIProcess/API/Cocoa/WKViewPrivate.h:
3053         * UIProcess/API/Cocoa/WKWebView.mm:
3054         (-[WKWebView _initializeWithConfiguration:]):
3055         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
3056         (-[WKWebViewConfiguration init]):
3057         (-[WKWebViewConfiguration copyWithZone:]):
3058         (-[WKWebViewConfiguration _requiresUserActionForEditingControlsManager]):
3059         (-[WKWebViewConfiguration _setRequiresUserActionForEditingControlsManager:]):
3060         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
3061         * UIProcess/API/mac/WKView.mm:
3062         (-[WKView _requiresUserActionForEditingControlsManager]):
3063         (-[WKView _setRequiresUserActionForEditingControlsManager:]):
3064         * UIProcess/Cocoa/WebViewImpl.h:
3065         (WebKit::WebViewImpl::setRequiresUserActionForEditingControlsManager):
3066         (WebKit::WebViewImpl::requiresUserActionForEditingControlsManager):
3067
3068         New message allows the WebProcess to tell the UI process whether the current 
3069         web page has had any selection changes based on user interaction.
3070         * UIProcess/WebPageProxy.cpp:
3071         (WebKit::WebPageProxy::setHasHadSelectionChangesFromUserInteraction):
3072         * UIProcess/WebPageProxy.h:
3073         (WebKit::WebPageProxy::hasHadSelectionChangesFromUserInteraction):
3074         * UIProcess/WebPageProxy.messages.in:
3075
3076         m_userIsInteracting m_hasFocusedDueToUserInteraction used to be iOS only, but 
3077         now we want to track them for Mac as well.
3078         * WebProcess/WebPage/WebPage.cpp:
3079
3080         Handling mouse events and key events will toggle m_userIsInteracting.
3081         (WebKit::WebPage::mouseEvent):
3082         (WebKit::WebPage::keyEvent):
3083
3084         m_userIsInteracting is no longer iOS-only.
3085         (WebKit::WebPage::setInitialFocus):
3086
3087         Send a message to the UI process on page transition to re-set 
3088         hasHadSelectionChangesFromUserInteraction to false.
3089         (WebKit::WebPage::didStartPageTransition):
3090
3091         Send a message to the UI process if this is the first selection change to 
3092         happen as a result of a user action.
3093         (WebKit::WebPage::didChangeSelection):
3094         * WebProcess/WebPage/WebPage.h:
3095
3096 2016-05-23  Alex Christensen  <achristensen@webkit.org>
3097
3098         Add logging for NSURLSession calls
3099         https://bugs.webkit.org/show_bug.cgi?id=157996
3100
3101         Reviewed by Brady Eidson.
3102
3103         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
3104         (WebKit::NetworkDataTask::NetworkDataTask):
3105         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
3106         (toNSURLSessionResponseDisposition):
3107         (-[WKNetworkSessionDelegate URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:]):
3108         (-[WKNetworkSessionDelegate URLSession:task:_schemeUpgraded:completionHandler:]):
3109         (-[WKNetworkSessionDelegate URLSession:dataTask:willCacheResponse:completionHandler:]):
3110         (-[WKNetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:]):
3111         (-[WKNetworkSessionDelegate URLSession:task:didCompleteWithError:]):
3112         (-[WKNetworkSessionDelegate URLSession:dataTask:didReceiveResponse:completionHandler:]):
3113         (-[WKNetworkSessionDelegate URLSession:dataTask:didReceiveData:]):
3114         * Platform/Logging.h:
3115
3116 2016-05-23  Chris Fleizach  <cfleizach@apple.com>
3117
3118         AX: iOS: when bringing focus to a text field we may zoom the page even if author wanted max scale = 1
3119         https://bugs.webkit.org/show_bug.cgi?id=157771
3120
3121         Reviewed by Tim Horton.
3122
3123         * Shared/AssistedNodeInformation.cpp:
3124         (WebKit::AssistedNodeInformation::encode):
3125         (WebKit::AssistedNodeInformation::decode):
3126         * Shared/AssistedNodeInformation.h:
3127         * UIProcess/ios/WKContentViewInteraction.mm:
3128         (-[WKContentView _displayFormNodeInputView]):
3129         * WebProcess/WebPage/ios/WebPageIOS.mm:
3130         (WebKit::WebPage::getAssistedNodeInformation):
3131
3132 2016-05-23  Miguel Gomez  <magomez@igalia.com>
3133
3134         [ThreadedCompositor] Ensure that the BitmapTexture used by CoordinatedBackingStoreTile matches the opacity of the painted surface
3135         https://bugs.webkit.org/show_bug.cgi?id=157942
3136
3137         Reviewed by Žan Doberšek.
3138
3139         * Shared/CoordinatedGraphics/CoordinatedBackingStore.cpp:
3140         (WebKit::CoordinatedBackingStoreTile::swapBuffers):
3141         Reset the BitmapTexture if it doesn't match the opacity required by the surface
3142         that's being painted.
3143
3144 2016-05-22  Carlos Garcia Campos  <cgarcia@igalia.com>
3145
3146         [GTK] Disk cache: enable speculative revalidation
3147         https://bugs.webkit.org/show_bug.cgi?id=157125
3148
3149         Reviewed by Sergio Villar Senin.
3150
3151         * NetworkProcess/soup/NetworkProcessSoup.cpp:
3152         (WebKit::NetworkProcess::platformInitializeNetworkProcess):
3153         * UIProcess/API/gtk/WebKitWebContext.cpp:
3154         (webkitWebContextConstructed):
3155         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
3156         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
3157         * UIProcess/WebProcessPool.cpp:
3158         (WebKit::WebProcessPool::ensureNetworkProcess):
3159         * config.h:
3160
3161 2016-05-22  Brady Eidson  <beidson@apple.com>
3162
3163         Move to C++14.
3164         https://bugs.webkit.org/show_bug.cgi?id=157948
3165
3166         Reviewed by Michael Catanzaro.
3167
3168         * Configurations/Base.xcconfig:
3169
3170         Replace time literal suffixes that have underscores to the forms without
3171         (e.g. 0_ms becomes 0ms):
3172         * NetworkProcess/NetworkResourceLoadParameters.cpp:
3173         (WebKit::NetworkResourceLoadParameters::NetworkResourceLoadParameters):
3174
3175         * NetworkProcess/NetworkResourceLoader.cpp:
3176         (WebKit::NetworkResourceLoader::startNetworkLoad):
3177
3178         * NetworkProcess/cache/NetworkCache.cpp:
3179         (WebKit::NetworkCache::responseHasExpired):
3180         (WebKit::NetworkCache::responseNeedsRevalidation):
3181         (WebKit::NetworkCache::makeStoreDecision):
3182
3183         * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
3184         (WebKit::NetworkCache::responseNeedsRevalidation):
3185
3186         * NetworkProcess/cache/NetworkCacheStorage.cpp:
3187         (WebKit::NetworkCache::Storage::dispatchReadOperation):
3188         (WebKit::NetworkCache::Storage::store):
3189         (WebKit::NetworkCache::computeRecordWorth):
3190
3191         * Shared/mac/RemoteLayerBackingStoreCollection.mm:
3192
3193         * UIProcess/ViewGestureController.cpp:
3194
3195         * WebProcess/Network/WebLoaderStrategy.cpp:
3196         (WebKit::maximumBufferingTime):
3197
3198         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
3199         (WebKit::RemoteLayerTreeDrawingArea::scheduleCompositingLayerFlushImmediately):
3200         (WebKit::RemoteLayerTreeDrawingArea::scheduleCompositingLayerFlush):
3201
3202 2016-05-21  Andy Estes  <aestes@apple.com>
3203
3204         REGRESSION (r188642): All pages are blank when printing a webpage in iOS Safari
3205         https://bugs.webkit.org/show_bug.cgi?id=157924
3206         rdar://problem/22524550
3207
3208         Reviewed by Sam Weinig.
3209
3210         When UIPrintInteractionController asks WKWebView to print a webpage, it does so in several phases. First we're
3211         asked to compute the page count, followed later by a series of messages asking us to draw each page into a
3212         provided CGContext.
3213
3214         When asked for the page count, we send a message to the Web process instructing it to compute and
3215         return the page count synchronously and then immediately start drawing the page for printing. If the drawing has
3216         finished by the time we're asked to print the first page, then we can do so without waiting. But if it hasn't
3217         then we block by calling Connection::waitForMessage(), passing std::chromo::milliseconds::max() as the relative
3218         timeout.
3219         
3220         Prior to r188642, Connection::waitForMessage() called std::condition_variable::wait_for(), which takes a
3221         relative timeout value. r188642 replaced this with WTF::Condition::waitUntil(), which takes an absolute timeout
3222         instead. To convert from relative to absolute, this line was added to Connection::waitForMessage():
3223
3224             Condition::Clock::time_point absoluteTimeout = Condition::Clock::now() + timeout;
3225
3226         std::chrono will convert both operands to a common duration type before performing the addition. When timeout
3227         equals something very large, like milliseconds::max(), this conversion results in signed integer overflow,
3228         giving absoluteTimeout a value less than Clock::now() and making waitForMessage time out immediately.
3229         
3230         To fix this, compute how many milliseconds remain on our clock, and add the smaller of that and the timeout
3231         value to Clock::now() to arrive at an absolute timeout.
3232
3233         * Platform/IPC/Connection.cpp:
3234         (IPC::Connection::waitForMessage):
3235         * UIProcess/API/Cocoa/WKWebView.mm:
3236         (-[WKWebView _printedDocument]): Removed an unnecessary nanoseconds-to-milliseconds conversion.
3237
3238 2016-05-20  Enrica Casucci  <enrica@apple.com>
3239
3240         Drag cannot start if no drag data or custom data is available in the Pasteboard.
3241         https://bugs.webkit.org/show_bug.cgi?id=157911
3242         rdar://problem/24577706
3243
3244         Reviewed by Tim Horton.
3245
3246         We need to make sure there is always one item in common between source and target
3247         of the drag and drop operation.
3248
3249         * UIProcess/Cocoa/WebViewImpl.mm:
3250         (WebKit::WebViewImpl::dragImageForView):
3251
3252 2016-05-20  John Wilander  <wilander@apple.com>
3253
3254         Remove unnecessary PageOverlay client function pageOverlayDestroyed
3255         https://bugs.webkit.org/show_bug.cgi?id=157388
3256         <rdar://problem/25471523>
3257
3258         Reviewed by Tim Horton.
3259
3260         Remove dead PageOverlay code. Almost all of these overrides were empty and
3261         never called. In the case of WebPageOverlay it was never called but had a
3262         function body, causing confusion. There was a fear of dangling pointers in
3263         WebPageOverlay's static hash map between PageOverlays and WebPageOverlays.
3264         Only WebPageOverlay's constructor creates its PageOverlay object and adds it
3265         to the hash map. Its client object is kept in a unique pointer member which
3266         is automatically deleted when the WebPageOverlay object itself is deleted.
3267         This explains why PageOverlayClientImpl::pageOverlayDestroyed in
3268         WKBundlePageOverlay can safely be removed. Finally, WebPageOverlay's
3269         destructor clears the hash map entry for its PageOverlay object. Thus, there
3270         is no need to call WebPageOverlay::pageOverlayDestroyed nor a need for
3271         WebPageOverlay's destructor to call pageOverlayDestroyed on its client.
3272
3273         No new tests. I tried to come up with a WebKit API test for this but I
3274         wasn't able to test presence/absence of WebPageOverlay's map entries since
3275         the map is not exposed.
3276
3277         * WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.cpp:
3278         (WebKit::PageOverlayClientImpl::pageOverlayDestroyed): Deleted.
3279         * WebProcess/Plugins/PDF/PDFPlugin.h:
3280         * WebProcess/Plugins/PDF/PDFPlugin.mm:
3281         (WebKit::PDFPlugin::HUD::pageOverlayDestroyed): Deleted.
3282         * WebProcess/WebCoreSupport/WebInspectorClient.cpp:
3283         * WebProcess/WebCoreSupport/WebInspectorClient.h:
3284         (WebKit::WebInspectorClient::pageOverlayDestroyed): Deleted.
3285         * WebProcess/WebPage/FindController.cpp:
3286         * WebProcess/WebPage/FindController.h:
3287         (WebKit::FindController::pageOverlayDestroyed): Deleted.
3288         * WebProcess/WebPage/WebPageOverlay.cpp:
3289         * WebProcess/WebPage/WebPageOverlay.h:
3290         (WebKit::WebPageOverlay::pageOverlayDestroyed): Deleted.
3291         * WebProcess/WebPage/ios/FindIndicatorOverlayClientIOS.h:
3292         (WebKit::FindIndicatorOverlayClientIOS::pageOverlayDestroyed): Deleted.
3293
3294 2016-05-19  Chris Dumez  <cdumez@apple.com>
3295
3296         Improve compile-time assertions in is<>() / downcast<>()
3297         https://bugs.webkit.org/show_bug.cgi?id=157817
3298
3299         Reviewed by Darin Adler.
3300
3301         Add missing includes.
3302
3303         * WebProcess/WebPage/WebFrame.cpp:
3304         * WebProcess/WebPage/WebPage.cpp:
3305
3306 2016-05-19  Tim Horton  <timothy_horton@apple.com>
3307
3308         Mail crashes under TiledCoreAnimationDrawingAreaProxy::createFenceForGeometryUpdate() when the Web process crashes
3309         https://bugs.webkit.org/show_bug.cgi?id=157927
3310         <rdar://problem/24793374>
3311
3312         Reviewed by Dean Jackson.
3313
3314         * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm:
3315         (WebKit::TiledCoreAnimationDrawingAreaProxy::createFence):
3316         With just the right combination of layout mechanisms and Web Content process
3317         crash timing, it is possible to get a frame change underneath WebPageProxy::processDidCrash,
3318         before the DrawingArea has been nulled out but after the Connection has.
3319         This can lead to a null dereference. I had a lot of trouble writing a API
3320         test for this, though I'm certain it's possible.
3321
3322 2016-05-16  Enrica Casucci  <enrica@apple.com>
3323
3324         No candidate punctuation when typing punctuation in WK2 text field.
3325         https://bugs.webkit.org/show_bug.cgi?id=157773
3326         rdar://problem/23084603
3327
3328         Reviewed by Sam Weinig.
3329
3330         We need to adopt the new addInputString:withFlags:withInputManagerHint function
3331         for this to work propertly.
3332
3333         * Platform/spi/ios/UIKitSPI.h:
3334         * UIProcess/ios/WKContentViewInteraction.mm:
3335         (-[WKContentView _interpretKeyEvent:isCharEvent:]):
3336
3337 2016-05-19  Brady Eidson  <beidson@apple.com>
3338
3339         Finishing off: Modern IDB: Website data store management.
3340         https://bugs.webkit.org/show_bug.cgi?id=157626
3341
3342         Reviewed by Alex Christensen.
3343
3344         * DatabaseProcess/DatabaseProcess.cpp:
3345         (WebKit::DatabaseProcess::deleteWebsiteDataForOrigins):
3346         (WebKit::removeAllDatabasesForOriginPath): Deleted.
3347         (WebKit::DatabaseProcess::deleteIndexedDatabaseEntriesForOrigins): Deleted.
3348         (WebKit::DatabaseProcess::deleteIndexedDatabaseEntriesModifiedSince): Deleted.
3349         * DatabaseProcess/DatabaseProcess.h:
3350
3351 2016-05-19  Brent Fulgham  <bfulgham@apple.com>
3352
3353         [OS X][WK2] Expand sandbox for new mach endpoints
3354         https://bugs.webkit.org/show_bug.cgi?id=157919
3355         <rdar://problem/25238336>
3356
3357         Reviewed by Alexey Proskuryakov.
3358
3359         Grant the WebContent and Networking processes the mach lookup capability for
3360         various Security-related mach endpoints..
3361
3362         * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb:
3363         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
3364
3365 2016-05-19  Brian Burg  <bburg@apple.com>
3366
3367         Web Inspector: CRASH when closing a page while element selection mode is enabled via Develop menu
3368         https://bugs.webkit.org/show_bug.cgi?id=157925
3369         <rdar://problem/26259618>
3370
3371         Reviewed by Joseph Pecoraro.
3372
3373         * WebProcess/WebCoreSupport/WebInspectorClient.cpp:
3374         (WebKit::WebInspectorClient::elementSelectionChanged):
3375         Null-check m_page->inspector() since it will return nullptr if the page
3376         is closed but not yet destructed. This is triggered by teardown code
3377         in InspectorDOMAgent::willDestroyFrontendAndBackend.
3378
3379 2016-05-19  Enrica Casucci  <enrica@apple.com>
3380
3381         Drag cannot start if no drag data is available in the Pasteboard.
3382         https://bugs.webkit.org/show_bug.cgi?id=157911
3383         rdar://problem/24577706
3384
3385         Reviewed by Tim Horton.
3386
3387         Setting dummy data to allow drag to start.
3388
3389         * Shared/mac/PasteboardTypes.h:
3390         * Shared/mac/PasteboardTypes.mm:
3391         * UIProcess/Cocoa/WebViewImpl.mm:
3392         (WebKit::WebViewImpl::registerDraggedTypes):
3393         (WebKit::WebViewImpl::dragImageForView):
3394
3395 2016-05-19  Jer Noble  <jer.noble@apple.com>
3396
3397         [IOS] Add setting to allow playback to continue inline after exiting fullscreen.
3398         https://bugs.webkit.org/show_bug.cgi?id=157912
3399
3400         Reviewed by Eric Carlson.
3401
3402         Add a preference and configuration property to control whether media should be allowed to continue
3403         playing inline when exiting fullscreen.
3404
3405         * Shared/WebPreferencesDefinitions.h:
3406         * UIProcess/API/Cocoa/WKWebView.mm:
3407         (-[WKWebView _initializeWithConfiguration:]):
3408         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
3409         (-[WKWebViewConfiguration init]):
3410         (-[WKWebViewConfiguration encodeWithCoder:]):
3411         (-[WKWebViewConfiguration initWithCoder:]):
3412         (-[WKWebViewConfiguration copyWithZone:]):
3413         (-[WKWebViewConfiguration _allowsInlineMediaPlaybackAfterFullscreen]):
3414         (-[WKWebViewConfiguration _setAllowsInlineMediaPlaybackAfterFullscreen:]):
3415         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
3416         * UIProcess/mac/WKFullScreenWindowController.mm:
3417         (disableScreenUpdates):
3418         (enableScreenUpdates):
3419         (-[WKFullScreenWindowController enterFullScreen:]):
3420         (-[WKFullScreenWindowController finishedEnterFullScreenAnimation:]):
3421         (-[WKFullScreenWindowController exitFullScreen]):
3422         (-[WKFullScreenWindowController beganExitFullScreenWithInitialFrame:finalFrame:]):
3423         (-[WKFullScreenWindowController finishedExitFullScreenAnimation:]):
3424         (-[WKFullScreenWindowController completeFinishExitFullScreenAnimationAfterRepaint]):
3425         (-[WKFullScreenWindowController _startEnterFullScreenAnimationWithDuration:]):
3426         (-[WKFullScreenWindowController _startExitFullScreenAnimationWithDuration:]):
3427         * WebProcess/WebPage/WebPage.cpp:
3428         (WebKit::WebPage::updatePreferences):
3429
3430 2016-05-19  Brian Burg  <bburg@apple.com>
3431
3432         Web Inspector: timelines should not update via requestAnimationFrame unless Web Inspector is visible
3433         https://bugs.webkit.org/show_bug.cgi?id=157897
3434         <rdar://problem/26330802>
3435
3436         Reviewed by Timothy Hatcher.
3437
3438         The UIProcess needs to notify the Inspector frontend when it is truly visible.
3439         The frontend can't use document.visibilityState because it doesn't seem to work
3440         if the inspector frontend's WKWebView is created but not attached to a window.
3441
3442         * UIProcess/WebInspectorProxy.cpp:
3443         (WebKit::WebInspectorProxy::open):
3444         (WebKit::WebInspectorProxy::didClose):
3445         Send visibility updates to the inspector process when the inspector becomes
3446         "visible" or "not visible". It becomes visible if it is attached to the
3447         inspected page's window, or gets its own native window.
3448
3449         * WebProcess/WebPage/WebInspectorUI.cpp:
3450         (WebKit::WebInspectorUI::frontendLoaded):
3451         (WebKit::WebInspectorUI::setDockingUnavailable):
3452         (WebKit::WebInspectorUI::setIsVisible):
3453         Call InspectorFrontendAPI.updateVisibilityState to let the frontend know.
3454
3455         * WebProcess/WebPage/WebInspectorUI.h:
3456         * WebProcess/WebPage/WebInspectorUI.messages.in:
3457         Add new message.
3458
3459 2016-05-19  Brian Burg  <bburg@apple.com>
3460
3461         Web Inspector: use a consistent prefix for injected scripts
3462         https://bugs.webkit.org/show_bug.cgi?id=157715
3463         <rdar://problem/26287188>
3464
3465         Reviewed by Timothy Hatcher.
3466
3467         * CMakeLists.txt:
3468         * DerivedSources.make:
3469         * WebProcess/Automation/WebAutomationSessionProxy.js:
3470
3471 2016-05-18  Anders Carlsson  <andersca@apple.com>
3472
3473         Add WKPreferencesRef getter/setter pair to set RTL mode
3474         https://bugs.webkit.org/show_bug.cgi?id=157873
3475         rdar://problem/26329970
3476
3477         Reviewed by Tim Horton.
3478
3479         * UIProcess/API/C/WKPreferences.cpp:
3480         (WKPreferencesSetUserInterfaceDirectionPolicy):
3481         (WKPreferencesGetUserInterfaceDirectionPolicy):
3482         * UIProcess/API/C/WKPreferencesRef.h:
3483
3484 2016-05-18  Alex Christensen  <achristensen@webkit.org>
3485
3486         Clean up CSS code
3487         https://bugs.webkit.org/show_bug.cgi?id=157808
3488
3489         Reviewed by Chris Dumez.
3490
3491         * UIProcess/Cocoa/WebViewImpl.mm:
3492
3493 2016-05-18  Jer Noble  <jer.noble@apple.com>
3494
3495         Disable default user gesture requirement for audio playback on Mac
3496         https://bugs.webkit.org/show_bug.cgi?id=157820
3497
3498         Reviewed by Sam Weinig.
3499
3500         Disable the WebPreferences and matching WKWebViewConfiguration.mediaTypesRequiringUserActionForPlayback
3501         settings on Mac (and other non-iOS ports).
3502
3503         * Shared/WebPreferencesDefinitions.h:
3504         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
3505         (-[WKWebViewConfiguration init]):
3506
3507 2016-05-18  Alex Christensen  <achristensen@webkit.org>
3508
3509         Build fix when not using CredentialStorage with NetworkSession.
3510
3511         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
3512         (WebKit::NetworkSession::clearCredentials):
3513
3514 2016-05-18  Brady Eidson  <beidson@apple.com>
3515
3516         Fix null-deref crash sporadically seen after http://trac.webkit.org/changeset/201098
3517
3518         No review.
3519
3520         * DatabaseProcess/DatabaseProcess.cpp:
3521         (WebKit::DatabaseProcess::deleteWebsiteData): Don't access m_idbServer directly, as calling
3522           the idbServer() accessor is how you actually get your IDBServer created for you.
3523
3524 2016-05-18  Brian Burg  <bburg@apple.com>
3525
3526         Web Inspector: InspectorFrontendAPI.setTimelineProfilingEnabled should not implicitly show Timelines tab
3527         https://bugs.webkit.org/show_bug.cgi?id=157846
3528
3529         Reviewed by Timothy Hatcher.
3530
3531         Add a separate ShowTimelines message to WebInspector and WebInspectorUI. Have the
3532         start/stop profiling methods in public APIs explicitly call showTimelines() rather than
3533         relying on InspectorFrontendAPI to do it.
3534
3535         * UIProcess/API/C/WKInspector.cpp:
3536         (WKInspectorTogglePageProfiling):
3537         * UIProcess/WebInspectorProxy.cpp:
3538         (WebKit::WebInspectorProxy::showTimelines):
3539         * UIProcess/WebInspectorProxy.h:
3540         * WebProcess/InjectedBundle/API/c/WKBundleInspector.cpp:
3541         (WKBundleInspectorSetPageProfilingEnabled):
3542         * WebProcess/WebPage/WebInspector.cpp:
3543         (WebKit::WebInspector::showTimelines):
3544         * WebProcess/WebPage/WebInspector.h:
3545         * WebProcess/WebPage/WebInspector.messages.in:
3546         * WebProcess/WebPage/WebInspectorUI.cpp:
3547         (WebKit::WebInspectorUI::showTimelines):
3548         * WebProcess/WebPage/WebInspectorUI.h:
3549         * WebProcess/WebPage/WebInspectorUI.messages.in:
3550
3551 2016-05-18  Brady Eidson  <beidson@apple.com>
3552
3553         Modern IDB: Add support for server side closing of open database connections.
3554         https://bugs.webkit.org/show_bug.cgi?id=157843
3555
3556         Reviewed by Alex Christensen.
3557
3558         - Implement the required IDB delegate code.
3559         - Make DatabaseProcess::deleteWebsiteData call the right method in IDB server.
3560
3561         * DatabaseProcess/DatabaseProcess.cpp:
3562         (WebKit::DatabaseProcess::deleteWebsiteData):
3563
3564         * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.cpp:
3565         (WebKit::WebIDBConnectionToClient::didGetRecord):
3566         (WebKit::WebIDBConnectionToClient::didCloseFromServer):
3567         (WebKit::WebIDBConnectionToClient::confirmDidCloseFromServer):
3568         * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.h:
3569         * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.messages.in:
3570
3571         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
3572         (WebKit::WebIDBConnectionToServer::confirmDidCloseFromServer):
3573         (WebKit::WebIDBConnectionToServer::didStartTransaction):
3574         (WebKit::WebIDBConnectionToServer::didCloseFromServer):
3575         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h:
3576         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.messages.in:
3577
3578 2016-05-18  Brady Eidson  <beidson@apple.com>
3579
3580         Modern IDB: Make TestRunner.clearAllDatabases also delete IndexedDB databases (once doing so is supported).
3581         https://bugs.webkit.org/show_bug.cgi?id=157823
3582
3583         Reviewed by Alex Christensen.
3584
3585         * CMakeLists.txt:
3586         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
3587         (WKWebsiteDataStoreRemoveAllIndexedDatabases):
3588         * UIProcess/API/C/WKWebsiteDataStoreRef.h:
3589
3590 2016-05-18  Brian Burg  <bburg@apple.com>
3591
3592         REGRESSION(r200959): "Start Timeline Recording" menu item doesn't start recording
3593         https://bugs.webkit.org/show_bug.cgi?id=157821
3594         <rdar://problem/26335429>
3595
3596         Reviewed by Timothy Hatcher.
3597
3598         In r200959, WebInspectorProxy started sending start/stop profiling
3599         messages directly to the frontend process to avoid the inspected page
3600         process from implicitly showing the frontend. To compensate, the WebKit
3601         API layer was changed to call show() in togglePageProfiling().
3602
3603         Unfortunately, this fix was not quite right, because the ordering of
3604         the Show and StartPageProfiling messages is undefined. The latter has to bounce
3605         from UI to inspected to inspector processes, so the frontend may try
3606         to start profiling before the frontend is shown, causing it to be ignored.
3607
3608         This patch takes a different approach: just remove all implicit show()
3609         calls in the inspected page processes, and bounce both the Show and
3610         StartPageProfiling messages through the inspected page process to ensure
3611         they are handled in order by the frontend process.
3612
3613         * UIProcess/WebInspectorProxy.cpp:
3614         (WebKit::WebInspectorProxy::togglePageProfiling):
3615         Revert to sending to the inspected page process.
3616
3617         * WebProcess/InjectedBundle/API/c/WKBundleInspector.cpp:
3618         (WKBundleInspectorSetPageProfilingEnabled):
3619         Add a call to show() now that the implementation doesn't do it implicitly.
3620
3621         * WebProcess/WebPage/WebInspector.cpp:
3622         (WebKit::WebInspector::startPageProfiling):
3623         (WebKit::WebInspector::stopPageProfiling):
3624         Don't implicitly show the inspector. These methods are only called
3625         through the WKBundleInspector API and via IPC from WebInspectorProxy.
3626
3627 2016-05-17  Beth Dakin  <bdakin@apple.com>
3628
3629         Make handleAcceptedCandidate a public function
3630         https://bugs.webkit.org/show_bug.cgi?id=157763
3631         -and corresponding-
3632         rdar://problem/26206397
3633
3634         Reviewed by Tim Horton.
3635
3636         This patch makes handleAcceptedCandidate a public member of WebViewImpl 
3637         instead of a private member. 
3638         * UIProcess/Cocoa/WebViewImpl.h:
3639         (WebKit::WebViewImpl::createWeakPtr):
3640
3641 2016-05-17  Dean Jackson  <dino@apple.com>
3642
3643         Remove ES6_GENERATORS flag
3644         https://bugs.webkit.org/show_bug.cgi?id=157815
3645         <rdar://problem/26332894>
3646
3647         Reviewed by Geoffrey Garen.
3648
3649         This flag isn't needed. Generators are enabled everywhere and
3650         part of a stable specification.
3651
3652         * Configurations/FeatureDefines.xcconfig:
3653
3654 2016-05-17  Dean Jackson  <dino@apple.com>
3655
3656         Temporarily enable Experimental Features
3657         https://bugs.webkit.org/show_bug.cgi?id=157810
3658         <rdar://problem/26330804>
3659
3660         Reviewed by Anders Carlsson.
3661
3662         We currently don't have good UI for enabling these features,
3663         which would mean Safari Technology Preview users would
3664         never be able to turn them on… unless we enable them by
3665         default temporarily.
3666
3667         * Shared/WebPreferencesDefinitions.h:
3668
3669 2016-05-17  Filip Pizlo  <fpizlo@apple.com>
3670
3671         WTF should know about Language
3672         https://bugs.webkit.org/show_bug.cgi?id=157756
3673
3674         Reviewed by Geoffrey Garen and Alexey Proskuryakov.
3675
3676         Rewires a bunch of includes/imports.
3677
3678         * Shared/mac/RemoteLayerTreePropertyApplier.mm:
3679         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
3680         * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:
3681         * WebProcess/WebPage/mac/PlatformCAAnimationRemote.mm:
3682
3683 2016-05-17  Jer Noble  <jer.noble@apple.com>
3684
3685         Unreviewed GTK+ and EFL bulid fix; make the audio playback user gesture requirement
3686         Cocoa-only.
3687
3688         * Shared/WebPreferencesDefinitions.h:
3689
3690 2016-05-16  Anders Carlsson  <andersca@apple.com>
3691
3692         Add a WKA extension point for WKPreferences SPI
3693         https://bugs.webkit.org/show_bug.cgi?id=157762
3694         rdar://problem/24529203
3695
3696         Reviewed by Sam Weinig.
3697
3698         * UIProcess/API/Cocoa/WKPreferences.mm:
3699
3700 2016-05-16  David Kilzer  <ddkilzer@apple.com>
3701
3702         Action sheets don’t work in presented view controllers
3703         <https://webkit.org/b/157754>
3704         <rdar://problem/26304845>
3705
3706         Reviewed by Anders Carlsson.
3707
3708         * UIProcess/ios/WKActionSheet.mm:
3709         (-[WKActionSheet presentSheetFromRect:]):
3710         (-[WKActionSheet willRotate]):
3711         - Call SPI to get the presenting view controller, since it may
3712           not always be the root view controller.
3713
3714 2016-05-13  Enrica Casucci  <enrica@apple.com>
3715
3716         Text selection is basically impossible on plain text pages.
3717         https://bugs.webkit.org/show_bug.cgi?id=157681
3718         rdar://problem/26065660
3719
3720         Reviewed by Darin Adler.
3721
3722         When dealing with a plain text file, the rules for deciding whether
3723         a position is selectable should be different and we should never
3724         switch to block selection.
3725
3726         * WebProcess/WebPage/ios/WebPageIOS.mm:
3727         (WebKit::WebPage::shouldSwitchToBlockModeForHandle):
3728         (WebKit::rectIsTooBigForSelection): Added helper function.
3729         (WebKit::WebPage::selectTextWithGranularityAtPoint):
3730         (WebKit::WebPage::getPositionInformation):
3731
3732 2016-05-16  Chelsea Pugh  <cpugh@apple.com>
3733
3734         [iOS] Remove dispatch_after in -[WKFormInputSession setSuggestions:]
3735         https://bugs.webkit.org/show_bug.cgi?id=157745
3736
3737         Reviewed by Dan Bernstein.
3738
3739         * UIProcess/ios/WKContentViewInteraction.mm:
3740         (-[WKFormInputSession setSuggestions:]): Remove the dispatch_after since
3741         there is no longer a chance of keyboard suggestions replacing the
3742         suggestions set here.
3743
3744 2016-05-16  Brian Burg  <bburg@apple.com>
3745
3746         Crash simulating keystrokes at WebKit::WebAutomationSession::platformSimulateKeyStroke
3747         https://bugs.webkit.org/show_bug.cgi?id=157737
3748         <rdar://problem/26292946>
3749
3750         Reviewed by Timothy Hatcher.
3751
3752         * UIProcess/Cocoa/WebAutomationSessionCocoa.mm:
3753         (WebKit::WebAutomationSession::platformSimulateKeyStroke):
3754         AppKit expects characters passed to [NSEvent keyEventWithType:...]
3755         to be non-nil even if there are no characters. Initialize characters
3756         to the empty string @"". It will be overwritten if the keystroke should
3757         produce any unicode characters.
3758
3759 2016-05-16  Brian Burg  <bburg@apple.com>
3760
3761         Web Automation: Automation.inspectBrowsingContext should automatically start page profiling
3762         https://bugs.webkit.org/show_bug.cgi?id=157739
3763
3764         Reviewed by Timothy Hatcher.
3765
3766         * UIProcess/API/C/WKInspector.cpp:
3767         (WKInspectorTogglePageProfiling):
3768         Implicitly show the Web Inspector in the C API command to preserve existing behavior.
3769
3770         * UIProcess/Automation/WebAutomationSession.cpp:
3771         (WebKit::WebAutomationSession::inspectorFrontendLoaded):
3772         If the frontend loaded, it was either because the user opened Web Inspector (and
3773         turning on page profiling is harmless), or it was loaded but not shown by the
3774         inspectBrowsingContext command. For the latter, we want to start page profiling
3775         before processing any additional commands so subsequent execution is captured.
3776
3777         * UIProcess/WebInspectorProxy.cpp:
3778         (WebKit::WebInspectorProxy::togglePageProfiling):
3779         Send the start/stop profiling messages directly to the WebInspectorUI process instead of
3780         bouncing through the inspected page's process, which does an implicit show() we don't want.
3781
3782         * UIProcess/WebPageProxy.cpp:
3783         (WebKit::WebPageProxy::inspector): Make it const.
3784         * UIProcess/WebPageProxy.h:
3785
3786 2016-05-16  Conrad Shultz  <conrad_shultz@apple.com>
3787
3788         Fix some deprecation warnings.
3789
3790         * UIProcess/mac/WKPrintingView.mm:
3791         (-[WKPrintingView _drawPDFDocument:page:atPoint:]):
3792         * WebProcess/Plugins/PDF/DeprecatedPDFPlugin.mm:
3793         (WebKit::PDFPlugin::setActiveAnnotation):
3794         (WebKit::PDFPlugin::lookupTextAtLocation):
3795         * WebProcess/Plugins/PDF/PDFPluginChoiceAnnotation.h:
3796         * WebProcess/Plugins/PDF/PDFPluginChoiceAnnotation.mm:
3797         (WebKit::PDFPluginChoiceAnnotation::createAnnotationElement):
3798         * WebProcess/Plugins/PDF/PDFPluginTextAnnotation.h:
3799         * WebProcess/Plugins/PDF/PDFPluginTextAnnotation.mm:
3800         (WebKit::PDFPluginTextAnnotation::createAnnotationElement):
3801         * WebProcess/WebPage/mac/WebPageMac.mm:
3802         (WebKit::drawPDFPage):
3803
3804 2016-04-06  Jer Noble  <jer.noble@apple.com>
3805
3806         [WK2] Add API to WKWebViewConfiguration to control autoplay policy.
3807         https://bugs.webkit.org/show_bug.cgi?id=156312
3808
3809         Reviewed by Dan Bernstein.
3810
3811         Add a new API to WKWebViewConfiguration to allow fine-grained control over when media is allowed
3812         to play without a user gesture, and simultaneously deprecate the existing, all-or-nothing API,
3813         and deprecated the equivalent SPIs.
3814
3815         * UIProcess/API/Cocoa/WKWebView.mm:
3816         (-[WKWebView _initializeWithConfiguration:]):
3817         * UIProcess/API/Cocoa/WKWebViewConfiguration.h:
3818         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
3819         (-[WKWebViewConfiguration init]):
3820         (-[WKWebViewConfiguration encodeWithCoder:]):
3821         (-[WKWebViewConfiguration initWithCoder:]):
3822         (-[WKWebViewConfiguration copyWithZone:]):
3823         (-[WKWebViewConfiguration _requiresUserActionForVideoPlayback]):
3824         (-[WKWebViewConfiguration _setRequiresUserActionForVideoPlayback:]):
3825         (-[WKWebViewConfiguration _requiresUserActionForAudioPlayback]):
3826         (-[WKWebViewConfiguration _setRequiresUserActionForAudioPlayback:]):
3827         (-[WKWebViewConfiguration requiresUserActionForMediaPlayback]):
3828         (-[WKWebViewConfiguration setRequiresUserActionForMediaPlayback:]):
3829         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
3830
3831 2016-05-16  Brian Burg  <bburg@apple.com>
3832
3833         Web Automation: WebAutomationSessionProxy.js gets injected more than once sometimes
3834         https://bugs.webkit.org/show_bug.cgi?id=157716
3835         <rdar://problem/26287306>
3836
3837         Reviewed by Timothy Hatcher.
3838
3839         Whenever a script was injected into a non-normal world by a WebKit client,
3840         the WebProcess's WebAutomationSessionProxy singleton would get a
3841         notification that the window was cleared from the relevant frame.
3842         This notification happens when creating the world's window shell for
3843         the first time.
3844
3845         This code should ignore such notifications that originate from non-main world
3846         contexts. Web Inspector's instrumentation already ignored this, but
3847         the automation session notification comes in via a different WebKit2 layer.
3848
3849         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3850         (WebKit::WebFrameLoaderClient::dispatchDidClearWindowObjectInWorld):
3851
3852 2016-05-13  Dean Jackson  <dino@apple.com>
3853
3854         Fix iOS Build.
3855
3856         * Shared/AssistedNodeInformation.h:
3857         (WebKit::OptionItem::OptionItem):
3858
3859 2016-05-13  Sam Weinig  <sam@webkit.org>
3860
3861         REGRESSION (r200463): Autofill Credit Card expected but got Autofill Contact
3862         <rdar://problem/26251538>
3863         https://bugs.webkit.org/show_bug.cgi?id=157701
3864
3865         Reviewed by Dan Bernstein.
3866
3867         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFrame.mm:
3868         (-[WKWebProcessPlugInFrame _certificateChain]):
3869         We need to do a retain-autorelease here now because the CertificateInfo's that contain the
3870         cached certificate chain, are being destroyed, and therefore destroying the chain, before this
3871         function returns. This used to work when the chain wasn't just a cache, because there was still
3872         a strong reference to it being held by the ResourceResponse's CertificateInfo copy, but now
3873         there is none.
3874
3875 2016-05-13  Dean Jackson  <dino@apple.com>
3876
3877         [iOS] <select> elements popover should render right-aligned when in RTL mode
3878         https://bugs.webkit.org/show_bug.cgi?id=157699
3879         <rdar://problem/26282319>
3880
3881         Reviewed by Simon Fraser.
3882
3883         Some follow-up changes as suggested by Darin in review.
3884
3885         * Shared/AssistedNodeInformation.h: Use initializers so we can
3886         remove the constructors.
3887         (WebKit::OptionItem::OptionItem): Deleted.
3888         (WebKit::AssistedNodeInformation::AssistedNodeInformation): Deleted.
3889         * UIProcess/ios/forms/WKFormSelectPopover.mm: Add a comment to explain
3890         why we are explicitly setting the language.
3891         (-[WKSelectTableViewController initWithView:hasGroups:]):
3892
3893 2016-05-13  Chris Dumez  <cdumez@apple.com>
3894
3895         [NetworkCache] Avoid having to re-parse URLs after deserializing them
3896         https://bugs.webkit.org/show_bug.cgi?id=157660
3897
3898         Reviewed by Darin Adler.
3899
3900         * NetworkProcess/cache/NetworkCacheCoders.cpp:
3901         (WebKit::NetworkCache::Coder<WebCore::CertificateInfo>::encode): Deleted.
3902         (WebKit::NetworkCache::Coder<WebCore::CertificateInfo>::decode): Deleted.
3903         * NetworkProcess/cache/NetworkCacheCoders.h:
3904         Drop template specializations used by our network cache for encoding
3905         / decoding URLs as Strings. This causes us to now rely on
3906         URL::encode() / URL::decode() instead.
3907
3908         * Shared/WebCoreArgumentCoders.cpp:
3909         (IPC::ArgumentCoder<BlobPart>::decode):
3910         Fix bug in BlobPart encoding / decoding. It was encoding the url member
3911         as a URL but decoding it as a String.
3912
3913 2016-05-13  Dan Bernstein  <mitz@apple.com>
3914
3915         Try to fix some non-iOS builds.
3916
3917         * mac/postprocess-framework-headers.sh:
3918
3919 2016-05-13  Ryan Haddad  <ryanhaddad@apple.com>
3920
3921         Attempt to fix the iOS build after r200874
3922
3923         Unreviewed build fix.
3924
3925         * UIProcess/API/Cocoa/WKWebViewConfiguration.h:
3926
3927 2016-05-13  Sam Weinig  <sam@webkit.org>
3928
3929         Rename WKDataDetectorTypeSpotlightSuggestion to WKDataDetectorTypeLookupSuggestion
3930         <rdar://problem/26269611>
3931
3932         Reviewed by Dan Bernstein and Enrica Casucci. 
3933
3934         * Shared/API/Cocoa/WKFoundation.h:
3935         * Shared/API/c/WKDeclarationSpecifiers.h:
3936         * UIProcess/API/Cocoa/WKWebView.mm:
3937         (fromWKDataDetectorTypes):
3938         * UIProcess/API/Cocoa/WKWebViewConfiguration.h:
3939         * mac/postprocess-framework-headers.sh:
3940
3941 2016-05-13  Beth Dakin  <bdakin@apple.com>
3942
3943         Add dyldSPI.h for linked on or after checks, and add one for link preview
3944         https://bugs.webkit.org/show_bug.cgi?id=157401
3945
3946         Reviewed by Darin Adler.
3947
3948         Set _allowsLinkPreview to YES for programs linked on or after 
3949         firstSDKVersionWithLinkPreviewEnabledByDefault.
3950         * UIProcess/API/Cocoa/WKWebView.h:
3951         * UIProcess/API/Cocoa/WKWebView.mm:
3952         (-[WKWebView _initializeWithConfiguration:]):
3953
3954 2016-05-13  Jer Noble  <jer.noble@apple.com>
3955
3956         Fullscreen view attempts to resize when in 2-up mode
3957         https://bugs.webkit.org/show_bug.cgi?id=157558
3958
3959         Reviewed by Darin Adler.
3960
3961         No need to react to NSApplicationDidChangeScreenParametersNotification to resize the
3962         fullscreen window when the screen parameters change; the NSWindow fullscreen machinery
3963         will do that on our behalf.
3964
3965         * UIProcess/mac/WKFullScreenWindowController.mm:
3966         (-[WKFullScreenWindowController windowDidLoad]): Deleted.
3967         (-[WKFullScreenWindowController applicationDidChangeScreenParameters:]): Deleted.
3968
3969 2016-05-13  Antoine Quint  <graouts@apple.com>
3970
3971         [iOS] <select> elements popover should render right-aligned when in RTL mode
3972         https://bugs.webkit.org/show_bug.cgi?id=157672
3973         <rdar://problem/26193442>
3974
3975         Reviewed by Darin Adler.
3976
3977         Add a new isRTL field to the AssistedNodeInformation as specified by the assisted
3978         node's render style and account for it when displaying the table view shown in the
3979         popover attached to the assisted node using the UIView semanticContentAttribute
3980         property.
3981
3982         * Shared/AssistedNodeInformation.cpp:
3983         (WebKit::AssistedNodeInformation::encode):
3984         (WebKit::AssistedNodeInformation::decode):
3985         * Shared/AssistedNodeInformation.h:
3986         (WebKit::AssistedNodeInformation::AssistedNodeInformation):
3987         * UIProcess/ios/forms/WKFormSelectPopover.mm:
3988         (-[WKSelectTableViewController initWithView:hasGroups:]):
3989         (-[WKSelectTableViewController tableView:cellForRowAtIndexPath:]):
3990         * WebProcess/WebPage/ios/WebPageIOS.mm:
3991         (WebKit::WebPage::getAssistedNodeInformation):
3992
3993 2016-05-13  Tina Liu  <iting_liu@apple.com>
3994
3995         Revert r199691.
3996         https://bugs.webkit.org/show_bug.cgi?id=157645
3997         <rdar://problem/26235373>
3998
3999         Reviewed by Darin Adler.
4000
4001         * Shared/WebProcessCreationParameters.cpp:
4002         (WebKit::WebProcessCreationParameters::encode): Deleted.
4003         (WebKit::WebProcessCreationParameters::decode): Deleted.
4004         * Shared/WebProcessCreationParameters.h:
4005         * UIProcess/API/C/mac/WKContextPrivateMac.h:
4006         * UIProcess/API/C/mac/WKContextPrivateMac.mm:
4007         (WKContextSetPrivateBrowsingPluginLoadClientPolicy): Deleted.
4008         * UIProcess/WebProcessPool.cpp:
4009         (WebKit::WebProcessPool::setPluginLoadClientPolicy):
4010         (WebKit::WebProcessPool::createNewWebProcess): Deleted.
4011         (WebKit::WebProcessPool::setPluginLoadClientPolicyForPrivateBrowsing): Deleted.
4012         (WebKit::WebProcessPool::setPrivateBrowsingPluginLoadClientPolicy): Deleted.
4013         (WebKit::WebProcessPool::clearPluginClientPolicies): Deleted.
4014         * UIProcess/WebProcessPool.h:
4015         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
4016         (WebKit::WebPlatformStrategies::setPluginLoadClientPolicy):
4017         (WebKit::WebPlatformStrategies::longestMatchedWildcardHostForHost):
4018         (WebKit::WebPlatformStrategies::replaceHostWithMatchedWildcardHost):
4019         (WebKit::WebPlatformStrategies::pluginLoadClientPolicyForHost):
4020         (WebKit::WebPlatformStrategies::populatePluginCache):
4021         (WebKit::WebPlatformStrategies::setPluginLoadClientPolicyForPrivateBrowsing): Deleted.
4022         (WebKit::WebPlatformStrategies::setPrivateBrowsingPluginLoadClientPolicy): Deleted.
4023         (WebKit::WebPlatformStrategies::clearPluginClientPolicies): Deleted.
4024         (WebKit::WebPlatformStrategies::pluginLoadClientPolicyForHostForPrivateBrowsing): Deleted.
4025         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
4026         * WebProcess/WebProcess.cpp:
4027         (WebKit::WebProcess::initializeWebProcess):
4028         (WebKit::WebProcess::setPluginLoadClientPolicies): Deleted.
4029         (WebKit::WebProcess::setPrivateBrowsingPluginLoadClientPolicy): Deleted.
4030         * WebProcess/WebProcess.h:
4031         * WebProcess/WebProcess.messages.in:
4032
4033 2016-05-12  Daniel Bates  <dabates@apple.com>
4034
4035         Use SecTask SPI to retrieve code signing identifier for user directory suffix
4036         https://bugs.webkit.org/show_bug.cgi?id=157570
4037         <rdar://problem/25706517>
4038
4039         Reviewed by Darin Adler.
4040
4041         It is sufficient to make use of the SecTask SPI to retrieve the code signing
4042         identifier of the embedding client for use in the user directory suffix. This
4043         avoids the need to allow Code Signing Services to have access to the bundle
4044         of the embedding client.
4045
4046         * Shared/mac/ChildProcessMac.mm:
4047         (WebKit::ChildProcess::initializeSandbox): Use the code signing identifier of the
4048         embedding client as part of the user directory suffix if available.
4049         * Shared/mac/CodeSigning.h: Update comment and include header wtf/spi/darwin/XPCSPI.h
4050         for the definition of xpc_connection_t. Renamed codeSigningIdentifier() to codeSigningIdentifierForCurrentProcess()