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