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