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