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