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