[iOS] position:fixed inside touch-scrollable overflow is mispositioned
[WebKit-https.git] / Source / WebKit2 / ChangeLog
1 2017-01-30  Simon Fraser  <simon.fraser@apple.com>
2
3         [iOS] position:fixed inside touch-scrollable overflow is mispositioned
4         https://bugs.webkit.org/show_bug.cgi?id=167604
5         rdar://problem/29500273
6
7         Reviewed by Zalan Bujtas.
8
9         Make sure we tell m_webPageProxy.computeCustomFixedPositionRect() when visual viewports are enabled.
10
11         * UIProcess/ios/RemoteScrollingCoordinatorProxyIOS.mm:
12         (WebKit::RemoteScrollingCoordinatorProxy::customFixedPositionRect):
13
14 2017-01-30  Simon Fraser  <simon.fraser@apple.com>
15
16         Fixed elements should not rubber-band in WK2, nor remain at negative offsets
17         https://bugs.webkit.org/show_bug.cgi?id=167484
18         rdar://problem/29453068
19
20         Reviewed by Dean Jackson.
21
22         Pass in StickToViewportBounds as we did before visual viewports.
23
24         * UIProcess/ios/WebPageProxyIOS.mm:
25         (WebKit::WebPageProxy::computeCustomFixedPositionRect):
26
27 2017-01-30  Chris Dumez  <cdumez@apple.com>
28
29         Update DiagnosticLoggingClient::logDiagnosticMessageWithValue() to take in the value as a double
30         https://bugs.webkit.org/show_bug.cgi?id=167536
31
32         Reviewed by Darin Adler.
33
34         Update DiagnosticLoggingClient::logDiagnosticMessageWithValue() to take in the value as a double
35         instead of a string. The value needs to be numeric and the current API is error-prone.
36
37         * NetworkProcess/NetworkProcess.cpp:
38         (WebKit::NetworkProcess::logDiagnosticMessage):
39         (WebKit::NetworkProcess::logDiagnosticMessageWithResult):
40         (WebKit::NetworkProcess::logDiagnosticMessageWithValue):
41         * NetworkProcess/NetworkProcess.h:
42         * Scripts/webkit/messages.py:
43         (headers_for_type):
44         * Shared/WebCoreArgumentCoders.h:
45         * UIProcess/HighPerformanceGraphicsUsageSampler.cpp:
46         (WebKit::HighPerformanceGraphicsUsageSampler::timerFired):
47         * UIProcess/Network/NetworkProcessProxy.cpp:
48         (WebKit::NetworkProcessProxy::logDiagnosticMessage):
49         (WebKit::NetworkProcessProxy::logDiagnosticMessageWithResult):
50         (WebKit::NetworkProcessProxy::logDiagnosticMessageWithValue):
51         * UIProcess/Network/NetworkProcessProxy.h:
52         * UIProcess/Network/NetworkProcessProxy.messages.in:
53         * UIProcess/PerActivityStateCPUUsageSampler.cpp:
54         (WebKit::PerActivityStateCPUUsageSampler::loggingTimerFired):
55         * UIProcess/WebBackForwardList.cpp:
56         (WebKit::WebBackForwardList::goToItem):
57         * UIProcess/WebPageProxy.cpp:
58         (WebKit::WebPageProxy::logDiagnosticMessage):
59         (WebKit::WebPageProxy::logDiagnosticMessageWithResult):
60         (WebKit::WebPageProxy::logDiagnosticMessageWithValue):
61         * UIProcess/WebPageProxy.h:
62         * UIProcess/WebPageProxy.messages.in:
63         * WebProcess/WebCoreSupport/WebDiagnosticLoggingClient.cpp:
64         (WebKit::WebDiagnosticLoggingClient::logDiagnosticMessage):
65         (WebKit::WebDiagnosticLoggingClient::logDiagnosticMessageWithResult):
66         (WebKit::WebDiagnosticLoggingClient::logDiagnosticMessageWithValue):
67         * WebProcess/WebCoreSupport/WebDiagnosticLoggingClient.h:
68
69 2017-01-30  Csaba Osztrogonác  <ossy@webkit.org>
70
71         [Mac][cmake] Fix the build after r211354.
72         https://bugs.webkit.org/show_bug.cgi?id=167565
73
74         Unreviewed buildfix.
75
76         * PlatformMac.cmake:
77
78 2017-01-30  Miguel Gomez  <magomez@igalia.com>
79
80         [GTK] Scrolling iframes, doesn't redraw their content
81         https://bugs.webkit.org/show_bug.cgi?id=167581
82
83         Reviewed by Carlos Garcia Campos.
84
85         Take into account whether we are using AC or not in order to repaint an area after scrolling.
86
87         No behaviour change, no new tests.
88
89         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
90         (WebKit::WebChromeClient::invalidateContentsForSlowScroll):
91
92 2017-01-30  Carlos Garcia Campos  <cgarcia@igalia.com>
93
94         Unreviewed. Fix GTK+ debug build after r211365.
95
96         Remove invalid assert.
97
98         * WebProcess/WebPage/AcceleratedDrawingArea.cpp:
99         (WebKit::AcceleratedDrawingArea::exitAcceleratedCompositingModeNow):
100
101 2017-01-30  Carlos Garcia Campos  <cgarcia@igalia.com>
102
103         [GTK] Do not release OpenGL resource immediately when leaving accelerated compositing mode
104         https://bugs.webkit.org/show_bug.cgi?id=167544
105
106         Reviewed by Michael Catanzaro.
107
108         Sometimes the conditions to be in AC mode or not change quickly, and then we leave AC mode just enter it again
109         after a very short period of time. In those cases we are dropping all the GL resources and the compositor
110         thread, and creating it again. We could keep the layer tree host alive for a while when exiting AC mode, and
111         reuse it if we enter AC mode before the previous one has been discarded. While the previous layer tree host is
112         alive we still need to keep it up to date, for example if the web view is resized or contents size change, and
113         synchronize with the threaded compositor when it becomes the layer tree host again.
114
115         * WebProcess/WebPage/AcceleratedDrawingArea.cpp:
116         (WebKit::AcceleratedDrawingArea::~AcceleratedDrawingArea): Discard the previous layer tree host.
117         (WebKit::AcceleratedDrawingArea::AcceleratedDrawingArea): Initialize the timer to discard the previous layer
118         tree host.
119         (WebKit::AcceleratedDrawingArea::pageBackgroundTransparencyChanged): Notify the previous layer tree host if needed.
120         (WebKit::AcceleratedDrawingArea::mainFrameContentSizeChanged): Ditto.
121         (WebKit::AcceleratedDrawingArea::updateBackingStoreState): Ditto.
122         (WebKit::AcceleratedDrawingArea::enterAcceleratedCompositingMode): Reuse the previous layer tree host if possible.
123         (WebKit::AcceleratedDrawingArea::exitAcceleratedCompositingModeNow): Exit AC mode and save the layer tree host
124         starting a timer of 5 seconds to discard it if not reused.
125         (WebKit::AcceleratedDrawingArea::discardPreviousLayerTreeHost): Invalidate and destroy the previous layer tree host.
126         (WebKit::AcceleratedDrawingArea::didChangeViewportAttributes): Notify the previous layer tree host if needed.
127         (WebKit::AcceleratedDrawingArea::deviceOrPageScaleFactorChanged): Ditto.
128         * WebProcess/WebPage/AcceleratedDrawingArea.h:
129         * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp:
130         (WebKit::ThreadedCoordinatedLayerTreeHost::scrollNonCompositedContents): If it's discardable add the action to
131         be synchronized instead.
132         (WebKit::ThreadedCoordinatedLayerTreeHost::contentsSizeChanged): Ditto.
133         (WebKit::ThreadedCoordinatedLayerTreeHost::deviceOrPageScaleFactorChanged): Ditto.
134         (WebKit::ThreadedCoordinatedLayerTreeHost::pageBackgroundTransparencyChanged): Ditto.
135         (WebKit::ThreadedCoordinatedLayerTreeHost::sizeDidChange): Ditto.
136         (WebKit::ThreadedCoordinatedLayerTreeHost::didChangeViewportAttributes): Ditto.
137         (WebKit::ThreadedCoordinatedLayerTreeHost::setIsDiscardable): When the layer tree host becomes discardable,
138         reset the sync actions and return. When it becomes the real layer tree host again, apply all pending actions to
139         synchronize with the threaded compositor.
140         * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h:
141         * WebProcess/WebPage/DrawingAreaImpl.cpp:
142         (WebKit::DrawingAreaImpl::scroll): Notify the previous layer tree host if needed.
143         (WebKit::DrawingAreaImpl::mainFrameContentSizeChanged): Ditto.
144         (WebKit::DrawingAreaImpl::exitAcceleratedCompositingMode): Use AcceleratedDrawingArea::exitAcceleratedCompositingModeNow().
145         * WebProcess/WebPage/LayerTreeHost.h:
146         (WebKit::LayerTreeHost::setIsDiscardable): Added.
147
148 2017-01-30  Manuel Rego Casasnovas  <rego@igalia.com>
149
150         [GTK] Remove support to enable/disable experimental features
151         https://bugs.webkit.org/show_bug.cgi?id=167586
152
153         Reviewed by Michael Catanzaro.
154
155         As requested in bug #167578 we should remove the support to enable/disable
156         experimental features in WebKitGTK+.
157         One reason is that CSS Grid Layout is going to be enabled by default now,
158         so we don't need it to be in this file.
159         Another is that this support needs to be rewritten to use
160         the enumerable experimental features API.
161
162         * PlatformGTK.cmake:
163         * UIProcess/API/gtk/WebKitSettings.cpp:
164         (webKitSettingsConstructed):
165         * UIProcess/gtk/ExperimentalFeatures.cpp: Removed.
166         * UIProcess/gtk/ExperimentalFeatures.h: Removed.
167
168 2017-01-30  Carlos Garcia Campos  <cgarcia@igalia.com>
169
170         [GTK] Add API to handle the accelerated compositing policy
171         https://bugs.webkit.org/show_bug.cgi?id=167509
172
173         Reviewed by Michael Catanzaro.
174
175         Now that we have brought back the on demand mode, we should allow applications to choose the policy, without
176         having to deal with environment variables. Settings also allows to set different policy depending on the web
177         view, so for example evolution could disable AC for the composer, but leave the on demand mode for the email
178         viewer. This patch adds a single new setting hardware-acceleration-policy to handle both
179         acceleratedCompositingEnabled and forceCompositingMode preferences using an enum with values
180         WEBKIT_HARDWARE_ACCELERATION_POLICY_ON_DEMAND, WEBKIT_HARDWARE_ACCELERATION_POLICY_ALWAYS and
181         WEBKIT_HARDWARE_ACCELERATION_POLICY_NEVER.
182
183         * UIProcess/API/gtk/WebKitSettings.cpp:
184         (webKitSettingsSetProperty): Add setter for hardware-acceleration-policy property.
185         (webKitSettingsGetProperty): Add getter for hardware-acceleration-policy property.
186         (webkit_settings_class_init): Add hardware-acceleration-policy property.
187         (webkit_settings_get_hardware_acceleration_policy): Return policy according to the preferences.
188         (webkit_settings_set_hardware_acceleration_policy): set preferences according to the given policy.
189         * UIProcess/API/gtk/WebKitSettings.h:
190         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt: Add new symbols.
191         * WebProcess/WebPage/DrawingAreaImpl.cpp:
192         (WebKit::DrawingAreaImpl::updatePreferences):
193
194 2017-01-29  Carlos Garcia Campos  <cgarcia@igalia.com>
195
196         [Threaded Compositor] Crash on WebCore::GLContext::version()
197         https://bugs.webkit.org/show_bug.cgi?id=167559
198
199         Reviewed by Michael Catanzaro.
200
201         This is happening because TextureMapperPlatformLayerProxy::compositorThreadUpdateTimerFired() is fired after the
202         threaded compositor is deleted. CoordinatedGraphicsScene::purgeGLResources() should invalidate the proxies
203         before clearing the map.
204
205         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
206         (WebKit::CoordinatedGraphicsScene::purgeGLResources):
207
208 2017-01-29  Nan Wang  <n_wang@apple.com>
209
210         AX: WKContentView needs to implement UITextInput methods to make speak selection highlighting work
211         https://bugs.webkit.org/show_bug.cgi?id=166955
212
213         Reviewed by Ryosuke Niwa.
214
215         Implemented methods that Speak Selection can use to retrieve the word/sentence highlighting rects.
216
217         * Scripts/webkit/messages.py:
218         (headers_for_type):
219         * UIProcess/WebPageProxy.h:
220         * UIProcess/WebPageProxy.messages.in:
221         * UIProcess/ios/WKContentViewInteraction.h:
222         * UIProcess/ios/WKContentViewInteraction.mm:
223         (-[WKContentView webSelectionRectsForSelectionRects:]):
224         (-[WKContentView webSelectionRects]):
225         (-[WKContentView _accessibilityRetrieveRectsEnclosingSelectionOffset:withGranularity:]):
226         (-[WKContentView _accessibilityRetrieveRectsAtSelectionOffset:withText:]):
227         * UIProcess/ios/WebPageProxyIOS.mm:
228         (WebKit::WebPageProxy::selectionRectsCallback):
229         (WebKit::WebPageProxy::requestRectsForGranularityWithSelectionOffset):
230         (WebKit::WebPageProxy::requestRectsAtSelectionOffsetWithText):
231         * WebProcess/WebPage/WebPage.h:
232         * WebProcess/WebPage/WebPage.messages.in:
233         * WebProcess/WebPage/ios/WebPageIOS.mm:
234         (WebKit::visiblePositionForPositionWithOffset):
235         (WebKit::WebPage::getRectsForGranularityWithSelectionOffset):
236         (WebKit::rangeNearPositionMatchesText):
237         (WebKit::WebPage::getRectsAtSelectionOffsetWithText):
238
239 2017-01-29  Dan Bernstein  <mitz@apple.com>
240
241         [iOS] Expose WebCore::DataDetection::detectContentInRange WKWebProcessPlugInRangeHandle
242         https://bugs.webkit.org/show_bug.cgi?id=167565
243
244         Reviewed by Sam Weinig.
245
246         Test: TestWebKitAPI/Tests/WebKit2Cocoa/BundleRangeHandle.mm
247
248         * Shared/API/Cocoa/WKDataDetectorTypes.h: Added. Moved the enum definition from
249           WKWebViewConfiguration.h to here.
250         * Shared/API/Cocoa/WKDataDetectorTypesInternal.h: Added.
251         (fromWKDataDetectorTypes): Moved from WKWebView.mm.
252
253         * UIProcess/API/Cocoa/WKWebView.mm:
254         (fromWKDataDetectorTypes): Moved to WKDataDetectorTypesInternal.h.
255
256         * UIProcess/API/Cocoa/WKWebViewConfiguration.h: Moved WKDataDetectorTypes definition out
257           to WKDataDetectorTypes.h.
258
259         * WebKit2.xcodeproj/project.pbxproj: Added references to new files.
260
261         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInRangeHandle.h:
262         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInRangeHandle.mm:
263         (-[WKWebProcessPlugInRangeHandle detectDataWithTypes:context:]): Added. Calls
264           DataDetection::detectContentInRange.
265
266 2017-01-29  Carlos Garcia Campos  <cgarcia@igalia.com>
267
268         [Coordinated Graphics] WebPage shouldn't use the layerTreeHost directly
269         https://bugs.webkit.org/show_bug.cgi?id=167494
270
271         Reviewed by Michael Catanzaro.
272
273         In Coordinated Graphics we have a couple of methods that the WebPage uses directly from the layer tree host,
274         instead of using the drawing area interface. This patch adds DrawingArea::didChangeViewportAttributes and
275         DrawingArea::deviceOrPageScaleFactorChanged and renames LayerTreeHost::didChangeViewportProperties as
276         LayerTreeHost::didChangeViewportAttributes for consistency.
277
278         * Shared/CoordinatedGraphics/SimpleViewportController.cpp:
279         (WebKit::SimpleViewportController::didChangeViewportAttributes): Receive an rvalue reference to avoid copies.
280         * Shared/CoordinatedGraphics/SimpleViewportController.h:
281         * WebProcess/WebPage/AcceleratedDrawingArea.cpp:
282         (WebKit::AcceleratedDrawingArea::didChangeViewportAttributes): Forward it to the layer tree host if any.
283         (WebKit::AcceleratedDrawingArea::deviceOrPageScaleFactorChanged): Ditto.
284         * WebProcess/WebPage/AcceleratedDrawingArea.h:
285         * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp:
286         (WebKit::ThreadedCoordinatedLayerTreeHost::didChangeViewportAttributes): Renamed and updated to pass an rvalue reference.
287         (WebKit::ThreadedCoordinatedLayerTreeHost::didChangeViewportProperties): Deleted.
288         * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h:
289         * WebProcess/WebPage/DrawingArea.h:
290         * WebProcess/WebPage/LayerTreeHost.h:
291         (WebKit::LayerTreeHost::didChangeViewportAttributes): Renamed and updated to pass an rvalue reference.
292         (WebKit::LayerTreeHost::didChangeViewportProperties): Deleted.
293         * WebProcess/WebPage/WebPage.cpp:
294         (WebKit::WebPage::sendViewportAttributesChanged): Use the drawing area.
295         (WebKit::WebPage::scalePage): Ditto
296         (WebKit::WebPage::setDeviceScaleFactor): Ditto.
297         (WebKit::WebPage::viewportPropertiesDidChange): Ditto.
298
299 2017-01-28  Carlos Garcia Campos  <cgarcia@igalia.com>
300
301         [Threaded Compositor] Crash when detaching the CoordinatedGraphicsScene
302         https://bugs.webkit.org/show_bug.cgi?id=167547
303
304         Reviewed by Michael Catanzaro.
305
306         It seems that commitSceneState() can be called after the CoordinatedGraphicsScene has been detached.
307
308         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
309         (WebKit::CoordinatedGraphicsScene::commitSceneState): Return early if scene has been detached.
310         (WebKit::CoordinatedGraphicsScene::detach): Take the render queue lock before clearing the render queue.
311
312 2017-01-28  Carlos Garcia Campos  <cgarcia@igalia.com>
313
314         [Threaded Compositor] Crash when deleting the compositor run loop
315         https://bugs.webkit.org/show_bug.cgi?id=167545
316
317         Reviewed by Michael Catanzaro.
318
319         The problem is that we are releasing the WorkQueue before the update timer that keeps a reference to the run
320         loop, destroyed by the WorkQueue. So, invalidate the WorkQueue in the next run loop iteration to ensure it
321         happens after the CompositingRunLoop destructor.
322
323         * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.cpp:
324         (WebKit::CompositingRunLoop::~CompositingRunLoop):
325
326 2017-01-28  Carlos Garcia Campos  <cgarcia@igalia.com>
327
328         [GTK] ASSERTION FAILED: !m_layerTreeHost in DrawingAreaImpl::display()
329         https://bugs.webkit.org/show_bug.cgi?id=167548
330
331         Reviewed by Michael Catanzaro.
332
333         The problem is that non accelerated compositing forceRepaint implementation is doing a layout and then calling
334         display. The layout makes the drawing area enter in AC mode and display asserts that we have a layer tree
335         host. forceRepaint shouldn't do the layout because display already does that and it correctly handles the case
336         of entering AC mode during the layout. It shouldn't call setNeedsDisplay either, because that schedules a
337         display, but we are going to display synchronously.
338
339         * WebProcess/WebPage/DrawingAreaImpl.cpp:
340         (WebKit::DrawingAreaImpl::forceRepaint):
341
342 2017-01-28  Tim Horton  <timothy_horton@apple.com>
343
344         Don't flash a tap highlight for the entirety of an editable WKWebView
345         https://bugs.webkit.org/show_bug.cgi?id=167486
346         <rdar://problem/30193996>
347
348         Reviewed by Dan Bernstein.
349
350         * WebProcess/WebPage/ios/WebPageIOS.mm:
351         (WebKit::WebPage::sendTapHighlightForNodeIfNecessary):
352         Bail from providing a tap highlight if we are about to highlight
353         the entire body of an editable web view.
354
355 2017-01-28  Wenson Hsieh  <wenson_hsieh@apple.com>
356
357         Check USE(APPLE_INTERNAL_SDK) instead of specific headers when importing from WebKitAdditions
358         https://bugs.webkit.org/show_bug.cgi?id=167555
359
360         Reviewed by Dan Bernstein.
361
362         Instead of guarding #import <WebKitAdditions/*> on the existence of the imported file, consult
363         USE(APPLE_INTERNAL_SDK) instead.
364
365         * UIProcess/Cocoa/WebPageProxyCocoa.mm:
366         * UIProcess/ios/WKContentViewInteraction.h:
367         * UIProcess/ios/WKContentViewInteraction.mm:
368         * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
369
370 2017-01-28  Yoav Weiss  <yoav@yoav.ws>
371
372         Add Link Preload as an off-by-default experimental feature menu item.
373         https://bugs.webkit.org/show_bug.cgi?id=167201
374
375         Reviewed by Ryosuke Niwa.
376
377         * Shared/WebPreferencesDefinitions.h:
378         * UIProcess/API/C/WKPreferences.cpp:
379         (WKPreferencesSetLinkPreloadEnabled):
380         (WKPreferencesGetLinkPreloadEnabled):
381         * UIProcess/API/C/WKPreferencesRefPrivate.h:
382         * WebProcess/WebPage/WebPage.cpp:
383         (WebKit::WebPage::updatePreferences):
384
385 2017-01-28  Joseph Pecoraro  <pecoraro@apple.com>
386
387         Add User Timing Experimental Feature
388         https://bugs.webkit.org/show_bug.cgi?id=167542
389         <rdar://problem/22746307>
390
391         Reviewed by Ryosuke Niwa.
392
393         * Shared/WebPreferencesDefinitions.h:
394         * UIProcess/API/C/WKPreferences.cpp:
395         (WKPreferencesSetUserTimingEnabled):
396         (WKPreferencesGetUserTimingEnabled):
397         * UIProcess/API/C/WKPreferencesRefPrivate.h:
398         * WebProcess/WebPage/WebPage.cpp:
399         (WebKit::WebPage::updatePreferences):
400         Experimental feature. Off for now while we update ResourceTiming
401         and NavigationTiming to be compatible with Performance Timing 2.
402
403 2017-01-28  Dan Bernstein  <mitz@apple.com>
404
405         <rdar://problem/30247736> WebKit2-7604.1.5 has failed to build: error: only virtual member functions can be marked 'override'
406
407         * UIProcess/ios/PageClientImplIOS.h: Guard the declaration of requestPasswordForQuickLookDocument
408           with USE(QUICK_LOOK) to match the base class.
409         * UIProcess/ios/PageClientImplIOS.mm: Guard the implementation as well.
410
411 2017-01-27  Dan Bernstein  <mitz@apple.com>
412
413         [Cocoa] No way to get the text from a WKWebProcessPlugInRangeHandle
414         https://bugs.webkit.org/show_bug.cgi?id=167535
415
416         Reviewed by Sam Weinig.
417
418         Added a text property to WKWebProcessPlugInRangeHandle.
419
420         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInRangeHandle.h: Declare new property.
421         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInRangeHandle.mm:
422         (-[WKWebProcessPlugInRangeHandle text]): Added. Calls InjectedBundleRangeHandle::text.
423
424         * WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp:
425         (WebKit::InjectedBundleRangeHandle::text): Added. Calls WebCore::Range::text.
426         * WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.h:
427
428 2017-01-27  Alex Christensen  <achristensen@webkit.org>
429
430         Move smartInsertDeleteEnabled to WebPageCreationParameters
431         https://bugs.webkit.org/show_bug.cgi?id=167530
432
433         Reviewed by Brady Eidson.
434
435         * Shared/WebPageCreationParameters.h:
436         * UIProcess/WebPageProxy.cpp:
437         (WebKit::WebPageProxy::initializeWebPage):
438         (WebKit::WebPageProxy::creationParameters):
439         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
440         (WebKit::WebChromeClient::createWindow):
441         * WebProcess/WebPage/WebPage.cpp:
442         (WebKit::WebPage::create):
443         (WebKit::WebPage::WebPage):
444         (WebKit::m_userInterfaceLayoutDirection):
445         (WebKit::WebPage::reinitializeWebPage):
446         * WebProcess/WebPage/WebPage.h:
447         * WebProcess/WebProcess.cpp:
448         (WebKit::WebProcess::createWebPage):
449         * WebProcess/WebProcess.h:
450         Instead of making a WebPage then immediately sending it a message to set smartInsertDeleteEnabled,
451         just call setSmartInsertDeleteEnabled at the end of the WebPage creation.  No change in behaviour.
452
453 2017-01-27  Brady Eidson  <beidson@apple.com>
454
455         IconLoadingClient API doesn't work asynchronously.
456         <rdar://problem/30243429> and https://bugs.webkit.org/show_bug.cgi?id=167532
457
458         Reviewed by Alex Christensen.
459
460         Make a WTF::Function (inherently not compatible with ObjC blocks as they must be copyable)
461         into a std::function, which is copyable.
462
463         * UIProcess/API/APIIconLoadingClient.h:
464         (API::IconLoadingClient::getLoadDecisionForIcon):
465         
466         * UIProcess/API/mac/WKView.mm:
467         (-[WKView maybeInstallIconLoadingClient]):
468         
469         * UIProcess/Cocoa/IconLoadingDelegate.h:
470         * UIProcess/Cocoa/IconLoadingDelegate.mm:
471         (WebKit::IconLoadingDelegate::IconLoadingClient::getLoadDecisionForIcon):
472         
473         * UIProcess/WebPageProxy.cpp:
474         (WebKit::WebPageProxy::getLoadDecisionForIcon):
475
476 2017-01-27  Chris Dumez  <cdumez@apple.com>
477
478         Fix remaining bad uses of logDiagnosticMessageWithValue()
479         https://bugs.webkit.org/show_bug.cgi?id=167526
480
481         Reviewed by Alex Christensen.
482
483         Fix remaining bad uses of logDiagnosticMessageWithValue(). It can only
484         be called with numeric values.
485
486         * NetworkProcess/cache/NetworkCacheStatistics.cpp:
487         (WebKit::NetworkCache::Statistics::recordNotUsingCacheForRequest):
488         (WebKit::NetworkCache::Statistics::recordRetrievalFailure):
489         (WebKit::NetworkCache::Statistics::recordRetrievedCachedEntry):
490         * UIProcess/WebBackForwardList.cpp:
491         (WebKit::WebBackForwardList::goToItem):
492         * WebProcess/WebPage/ios/WebPageIOS.mm:
493         (WebKit::WebPage::willStartUserTriggeredZooming):
494
495 2017-01-27  Chris Dumez  <cdumez@apple.com>
496
497         Round CPU Usage diagnostic logging to 2 significant digits
498         https://bugs.webkit.org/show_bug.cgi?id=167515
499         <rdar://problem/30236297>
500
501         Reviewed by Antti Koivisto.
502
503         Round CPU Usage diagnostic logging to 2 significant digits
504         as requested by diagnostic logging team.
505
506         * UIProcess/PerActivityStateCPUUsageSampler.cpp:
507         (WebKit::toStringRoundingSignificantFigures):
508         (WebKit::PerActivityStateCPUUsageSampler::loggingTimerFired):
509
510 2017-01-27  Carlos Garcia Campos  <cgarcia@igalia.com>
511
512         [Threaded Compositor] Stop creating the GLContext on demand the first time makeContextCurrent is called
513         https://bugs.webkit.org/show_bug.cgi?id=167496
514
515         Reviewed by Žan Doberšek.
516
517         This is causing problems with animations when entering AC mode on demand. What happens is that the threaded
518         compositor is created, then the animation is scheduled and during the first animation iteration the GLContext is
519         created, making the first frame of the animation quite slow. In my computer creating the GLContext takes 0.8
520         seconds. If the animation duration is less than the time it takes to create the GLContext, the animation ends
521         without iterating. This causing timeouts in the bots in tests like
522         animations/animation-iteration-event-destroy-renderer.html that expect webkitAnimationIteration events that
523         never fire.
524
525         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
526         (WebKit::ThreadedCompositor::ThreadedCompositor): Create the GLContext right after the compositing thread is
527         created if we already have a native surface handle.
528         (WebKit::ThreadedCompositor::createGLContext): Helper to create the GLContext.
529         (WebKit::ThreadedCompositor::setNativeSurfaceHandleForCompositing): Create the GLContext when a native surface
530         handle is given.
531         (WebKit::ThreadedCompositor::makeContextCurrent): Deleted.
532         (WebKit::ThreadedCompositor::renderLayerTree): Make the context cunrrent directly here.
533         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:
534
535 2017-01-27  Carlos Garcia Campos  <cgarcia@igalia.com>
536
537         [GTK] Stop forcing accelerated compositing by default
538         https://bugs.webkit.org/show_bug.cgi?id=167492
539
540         Reviewed by Žan Doberšek.
541
542         We are now ready to bring back the on demand accelerated compositing mode with the threaded
543         compositor. Unfortunately, having AC always enabled brought a lot of issues for many people. Not only it
544         requires a lot more memory but also caused rendering issues (or even nothing rendered at all) with some graphics
545         drivers. People started to use WEBKIT_DISABLE_COMPOSITING_MODE as a workaround, but that was not expected to be
546         used by users. So, entering/leaving AC when required by web contents is not actually the solution but a huge
547         improvement for many people. If we are eventually ready to force AC mode again, we'll change this again. Note
548         that we still have WEBKIT_DISABLE_COMPOSITING_MODE, but now also WEBKIT_FORCE_COMPOSITING_MODE for testing and debugging.
549
550         * UIProcess/gtk/WebPreferencesGtk.cpp:
551         (WebKit::WebPreferences::platformInitializeStore):
552
553 2017-01-26  Chris Dumez  <cdumez@apple.com>
554
555         Crash when navigating back to a page in PacheCache when one of its frames has been removed
556         https://bugs.webkit.org/show_bug.cgi?id=167421
557         <rdar://problem/30188490>
558
559         Reviewed by Darin Adler.
560
561         Add a new setting allowing layout tests to enable PageCache in a window
562         that has an opener, for convenience.
563
564         * Shared/WebPreferencesDefinitions.h:
565         * UIProcess/API/C/WKPreferences.cpp:
566         (WKPreferencesSetAllowsPageCacheWithWindowOpener):
567         (WKPreferencesGetAllowsPageCacheWithWindowOpener):
568         * UIProcess/API/C/WKPreferencesRefPrivate.h:
569         * WebProcess/InjectedBundle/InjectedBundle.cpp:
570         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
571         * WebProcess/WebPage/WebPage.cpp:
572         (WebKit::WebPage::updatePreferences):
573
574 2017-01-26  Keith Miller  <keith_miller@apple.com>
575
576         classInfo should take a VM so it is not materialized from the object on each call
577         https://bugs.webkit.org/show_bug.cgi?id=167424
578
579         Rubber Stamped by Michael Saboff.
580
581         Previously, classInfo() would get the VM from the target's
582         MarkedBlock.  Most callers already have a VM on hand, so it is
583         wasteful to compute the VM from the marked block every time. This
584         patch refactors some of the most common callers of classInfo(),
585         jsDynamicCast and inherits to take a VM as well.
586
587         * WebProcess/Automation/WebAutomationSessionProxy.cpp:
588         (WebKit::WebAutomationSessionProxy::elementForNodeHandle):
589         * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp:
590         (WebKit::InjectedBundleNodeHandle::getOrCreate):
591         * WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp:
592         (WebKit::InjectedBundleRangeHandle::getOrCreate):
593         * WebProcess/InjectedBundle/InjectedBundle.cpp:
594         (WebKit::InjectedBundle::reportException):
595         (WebKit::InjectedBundle::webNotificationID):
596         (WebKit::InjectedBundle::createWebDataFromUint8Array):
597         * WebProcess/Plugins/Netscape/JSNPMethod.cpp:
598         (WebKit::JSNPMethod::finishCreation):
599         (WebKit::callMethod):
600         * WebProcess/Plugins/Netscape/JSNPObject.cpp:
601         (WebKit::JSNPObject::finishCreation):
602         (WebKit::callNPJSObject):
603         (WebKit::constructWithConstructor):
604         * WebProcess/Plugins/Netscape/NPJSObject.cpp:
605         (WebKit::NPJSObject::create):
606         * WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp:
607         (WebKit::NPRuntimeObjectMap::getOrCreateNPObject):
608         * WebProcess/WebPage/WebFrame.cpp:
609         (WebKit::WebFrame::frameForContext):
610         (WebKit::WebFrame::counterValue):
611
612 2017-01-26  Chris Dumez  <cdumez@apple.com>
613
614         Fix CPU usage diagnostic logging in PerActivityStateCPUUsageSampler
615         https://bugs.webkit.org/show_bug.cgi?id=167471
616         <rdar://problem/30221723>
617
618         Reviewed by Alex Christensen.
619
620         Fix CPU usage diagnostic logging in PerActivityStateCPUUsageSampler
621         to use numeric values for logDiagnosticMessageWithValue().
622
623         * UIProcess/PerActivityStateCPUUsageSampler.cpp:
624         (WebKit::PerActivityStateCPUUsageSampler::loggingTimerFired):
625         (WebKit::loggingKeyForCPUUsage): Deleted.
626
627 2017-01-26  Jeremy Jones  <jeremyj@apple.com>
628
629         Request pointer unlock on navigation and re-enable pointer-lock tests for WK2.
630         https://bugs.webkit.org/show_bug.cgi?id=166765
631
632         Reviewed by Tim Horton.
633
634         When the main frame is load is committed, pointer lock should end.
635         This resets pointer lock state between tests and allows tests to succeed.
636
637         * UIProcess/WebPageProxy.cpp:
638         (WebKit::WebPageProxy::didCommitLoadForFrame):
639
640 2017-01-26  Chris Dumez  <cdumez@apple.com>
641
642         Fix WebGL diagnostic logging
643         https://bugs.webkit.org/show_bug.cgi?id=167463
644         <rdar://problem/30216981>
645
646         Reviewed by Alex Christensen.
647
648         Fix WebGL diagnostic logging so that it no longer uses logDiagnosticMessageWithValue().
649         This is because the value apparently needs to be numeric on Mac.
650
651         * UIProcess/HighPerformanceGraphicsUsageSampler.cpp:
652         (WebKit::HighPerformanceGraphicsUsageSampler::timerFired):
653
654 2017-01-26  Wenson Hsieh  <wenson_hsieh@apple.com>
655
656         Add support for recognizing data interaction gestures in WebKit2
657         https://bugs.webkit.org/show_bug.cgi?id=167444
658
659         Reviewed by Beth Dakin.
660
661         Adds a new data interaction gesture recognizer, responsible for determining when to begin data interaction. This
662         is a new long press gesture recognizer that fires simultaneously with the existing long press gesture
663         recognizers (for performing long-press actions, and for showing the tap highlight).
664
665         Also tweaks logic for determining whether selection gesture recognizers should fire to account for data
666         interaction -- in particular, we don't want selection gesture recognizers to cause the current selection to
667         change while data interaction is possible. See -hasSelectablePositionAtPoint and -pointIsInAssistedNode for
668         more details.
669
670         * UIProcess/ios/PageClientImplIOS.mm:
671         (WebKit::PageClientImpl::didPerformDataInteractionControllerOperation):
672         (WebKit::PageClientImpl::startDataInteractionWithImage):
673         * UIProcess/ios/WKContentViewInteraction.h:
674         * UIProcess/ios/WKContentViewInteraction.mm:
675         (-[WKContentView _createAndConfigureLongPressGestureRecognizer]):
676         (-[WKContentView setupInteraction]):
677         (-[WKContentView cleanupInteraction]):
678         (-[WKContentView _removeDefaultGestureRecognizers]):
679         (-[WKContentView _addDefaultGestureRecognizers]):
680         (-[WKContentView resignFirstResponder]):
681         (-[WKContentView gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:]):
682         (-[WKContentView gestureRecognizerShouldBegin:]):
683         (-[WKContentView hasSelectablePositionAtPoint:]):
684         (-[WKContentView pointIsInDataInteractionContent:]):
685         (-[WKContentView pointIsInAssistedNode:]):
686
687 2017-01-26  Matt Rajca  <mrajca@apple.com>
688
689         Notify clients when the user plays media otherwise prevented from autoplaying
690         https://bugs.webkit.org/show_bug.cgi?id=167390
691
692         Reviewed by Alex Christensen.
693
694         * UIProcess/API/APIUIClient.h:
695         (API::UIClient::didPlayMediaPreventedFromPlayingWithoutUserGesture):
696         * UIProcess/API/C/WKPage.cpp:
697         (WKPageSetPageUIClient):
698         * UIProcess/API/C/WKPageUIClient.h:
699         * UIProcess/WebPageProxy.cpp:
700         (WebKit::WebPageProxy::didPlayMediaPreventedFromPlayingWithoutUserGesture):
701         * UIProcess/WebPageProxy.h:
702         * UIProcess/WebPageProxy.messages.in:
703         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
704         (WebKit::WebChromeClient::didPlayMediaPreventedFromPlayingWithoutUserGesture):
705         * WebProcess/WebCoreSupport/WebChromeClient.h:
706
707 2017-01-26  Anders Carlsson  <andersca@apple.com>
708
709         Don't use _CFBundleCreateUnique on Yosemite, it's not available there
710         https://bugs.webkit.org/show_bug.cgi?id=167459
711         rdar://problem/30181179
712
713         Reviewed by Beth Dakin.
714
715         * Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm:
716         (WebKit::NetscapePluginModule::getPluginInfo):
717
718 2017-01-26  Alex Christensen  <achristensen@webkit.org>
719
720         Add SPI for updating WebsitePolicies
721         https://bugs.webkit.org/show_bug.cgi?id=167040
722
723         Reviewed by Brady Eidson.
724         
725         In r209558 we added a way to send a WebsitePolicies structure to the WebProcess during navigation.
726         If the UIProcess wants to update these policies on a WKWebView while a page is open, we will
727         need to have SPI for doing so. This adds such SPI, but it's not hooked up to change functionality yet.
728
729         * UIProcess/API/C/WKPage.cpp:
730         (WKPageUpdateWebsitePolicies):
731         * UIProcess/API/C/WKPage.h:
732         * UIProcess/API/Cocoa/WKWebView.mm:
733         (-[WKWebView _updateWebsitePolicies:]):
734         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
735         * UIProcess/WebPageProxy.cpp:
736         (WebKit::WebPageProxy::updateWebsitePolicies):
737         * UIProcess/WebPageProxy.h:
738         * WebProcess/WebPage/WebPage.cpp:
739         (WebKit::WebPage::updateWebsitePolicies):
740         * WebProcess/WebPage/WebPage.h:
741         * WebProcess/WebPage/WebPage.messages.in:
742
743 2017-01-26  Carlos Garcia Campos  <cgarcia@igalia.com>
744
745         [Threaded Compositor] Update also the contents size when creating the threaded compositor
746         https://bugs.webkit.org/show_bug.cgi?id=167452
747
748         Reviewed by Žan Doberšek.
749
750         In r210954 we ensured that the threaded compositor and the viewport controller were created with the initial web
751         page size. If we don't update the contents size, the visible rectangle will be empty and tiles won't be created
752         until contentsSizeDidChange is called. It's even possible, when entering AC mode on demand, that we create the
753         layer tree host after the contents size changed, in which case nothing is rendered unless we resize the window.
754
755         * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp:
756         (WebKit::ThreadedCoordinatedLayerTreeHost::ThreadedCoordinatedLayerTreeHost):
757
758 2017-01-26  Csaba Osztrogonác  <ossy@webkit.org>
759
760         [Mac][cmake] Fix the build after r211160
761         https://bugs.webkit.org/show_bug.cgi?id=167451
762
763         Unreviewed buildfix.
764
765         * UIProcess/API/Cocoa/WKWebView.mm:
766
767 2017-01-25  Ryan Haddad  <ryanhaddad@apple.com>
768
769         Unreviewed, rolling out r211193.
770
771         This change broke internal builds.
772
773         Reverted changeset:
774
775         "Notify clients when the user plays media otherwise prevented
776         from autoplaying"
777         https://bugs.webkit.org/show_bug.cgi?id=167390
778         http://trac.webkit.org/changeset/211193
779
780 2017-01-25  Wenson Hsieh  <wenson_hsieh@apple.com>
781
782         Add infrastructure to support data interaction in WebKit2
783         https://bugs.webkit.org/show_bug.cgi?id=167443
784
785         Reviewed by Simon Fraser.
786
787         Adds plumbing for two new XPC messages: WebPageProxy::DidPerformDataInteractionControllerOperation and
788         WebPage::RequestStartDataInteraction. Additionally, adds a new field to InteractionInformationAtPosition that
789         indicates whether or not there is data to interact with at a given location.
790
791         This patch only adds infrastructure, and does not change any behavior.
792
793         * Shared/ios/InteractionInformationAtPosition.h:
794         * Shared/ios/InteractionInformationAtPosition.mm:
795         (WebKit::InteractionInformationAtPosition::encode):
796         (WebKit::InteractionInformationAtPosition::decode):
797         * UIProcess/PageClient.h:
798         * UIProcess/WebPageProxy.h:
799         * UIProcess/WebPageProxy.messages.in:
800         * UIProcess/ios/PageClientImplIOS.h:
801         * UIProcess/ios/PageClientImplIOS.mm:
802         (WebKit::PageClientImpl::didPerformDataInteractionControllerOperation):
803         (WebKit::PageClientImpl::startDataInteractionWithImage):
804         * UIProcess/ios/WebPageProxyIOS.mm:
805         (WebKit::WebPageProxy::didPerformDataInteractionControllerOperation):
806         (WebKit::requestStartDataInteraction):
807         * UIProcess/mac/PageClientImpl.h:
808         * UIProcess/mac/PageClientImpl.mm:
809         (WebKit::PageClientImpl::didPerformDataInteractionControllerOperation):
810         (WebKit::PageClientImpl::startDataInteractionWithImage):
811         * WebProcess/WebPage/WebPage.cpp:
812         * WebProcess/WebPage/WebPage.h:
813         * WebProcess/WebPage/WebPage.messages.in:
814         * WebProcess/WebPage/ios/WebPageIOS.mm:
815         (WebKit::WebPage::requestStartDataInteraction):
816         (WebKit::WebPage::getPositionInformation):
817
818 2017-01-25  Tim Horton  <timothy_horton@apple.com>
819
820         Stop inheriting from UIWebScrollView, just use UIScrollView
821         https://bugs.webkit.org/show_bug.cgi?id=167440
822         <rdar://problem/7729691>
823
824         Reviewed by Simon Fraser.
825
826         * UIProcess/API/Cocoa/WKWebView.mm:
827         (-[WKWebView scrollViewWillBeginDragging:]):
828         * UIProcess/ios/WKScrollView.h:
829         * UIProcess/ios/WKScrollView.mm:
830         (-[WKScrollView initWithFrame:]): Deleted.
831         (-[WKScrollView setDecelerationRate:]): Deleted.
832         Inherit directly from UIScrollView, no need for UIWebScrollView.
833         Set the few settings we care about directly.
834         This has the side effect of reducing the default rate of scroll deceleration.
835
836 2017-01-25  Matt Rajca  <mrajca@apple.com>
837
838         Notify clients when the user plays media otherwise prevented from autoplaying
839         https://bugs.webkit.org/show_bug.cgi?id=167390
840
841         Reviewed by Alex Christensen.
842
843         * UIProcess/API/APIUIClient.h:
844         (API::UIClient::didPlayMediaPreventedFromPlayingWithoutUserGesture):
845         * UIProcess/API/C/WKPage.cpp:
846         (WKPageSetPageUIClient):
847         * UIProcess/API/C/WKPageUIClient.h:
848         * UIProcess/WebPageProxy.cpp:
849         (WebKit::WebPageProxy::didPlayMediaPreventedFromPlayingWithoutUserGesture):
850         * UIProcess/WebPageProxy.h:
851         * UIProcess/WebPageProxy.messages.in:
852         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
853         (WebKit::WebChromeClient::didPlayMediaPreventedFromPlayingWithoutUserGesture):
854         * WebProcess/WebCoreSupport/WebChromeClient.h:
855
856 2017-01-25  Wenson Hsieh  <wenson_hsieh@apple.com>
857
858         Refactor drag and drop implementation on Mac
859         https://bugs.webkit.org/show_bug.cgi?id=167427
860
861         Reviewed by Enrica Casucci.
862
863         See WebCore ChangeLog for more details.
864
865         * Shared/WebCoreArgumentCoders.cpp:
866         (IPC::ArgumentCoder<DragData>::encode):
867         (IPC::ArgumentCoder<DragData>::decode):
868         * UIProcess/Cocoa/WebPageProxyCocoa.mm:
869         * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
870
871 2017-01-25  Andy Estes  <aestes@apple.com>
872
873         Use #pragma once in a few places
874         https://bugs.webkit.org/show_bug.cgi?id=167435
875
876         Reviewed by Alex Christensen.
877
878         * UIProcess/PageClient.h:
879         * UIProcess/ios/PageClientImplIOS.h:
880         * WebProcess/WebCoreSupport/ios/WebQuickLookHandleClient.h:
881
882 2017-01-25  Andy Estes  <aestes@apple.com>
883
884         [QuickLook] Display a WKPasswordView when a document is password-protected
885         https://bugs.webkit.org/show_bug.cgi?id=167407
886         <rdar://problem/28544527>
887
888         Reviewed by Alex Christensen.
889
890         * UIProcess/API/Cocoa/WKWebView.mm:
891         (-[WKWebView _hidePasswordView]): Added an early return if there is no _passwordView.
892         * UIProcess/PageClient.h: Declared requestPasswordForQuickLookDocument().
893         (WebKit::PageClient::didStartProvisionalLoadForMainFrame): Added an no-op base class
894         implementation.
895         (WebKit::PageClient::didFailProvisionalLoadForMainFrame): Ditto.
896         * UIProcess/WebPageProxy.cpp:
897         (WebKit::WebPageProxy::didStartProvisionalLoadForFrame): Called
898         PageClient::didStartProvisionalLoadForMainFrame() if frame is the main frame.
899         (WebKit::WebPageProxy::didFailProvisionalLoadForFrame): Ditto for
900         PageClient::didFailProvisionalLoadForMainFrame().
901         * UIProcess/WebPageProxy.h: Declared didRequestPasswordForQuickLookDocumentInMainFrame().
902         * UIProcess/WebPageProxy.messages.in: Added message
903         DidRequestPasswordForQuickLookDocumentInMainFrame.
904         * UIProcess/ios/PageClientImplIOS.h: Overrode requestPasswordForQuickLookDocument(),
905         didStartProvisionalLoadForMainFrame(), and didFailProvisionalLoadForMainFrame().
906         * UIProcess/ios/PageClientImplIOS.mm:
907         (WebKit::PageClientImpl::didStartProvisionalLoadForMainFrame): Called
908         -[WKWebView _hidePasswordView].
909         (WebKit::PageClientImpl::didFailProvisionalLoadForMainFrame): Ditto.
910         (WebKit::PageClientImpl::didCommitLoadForMainFrame): Ditto.
911         (WebKit::PageClientImpl::requestPasswordForQuickLookDocument): If there is already a
912         password view, assert that it is for the same fileName. Call
913         -[WKPasswordView showPasswordFailureAlert] and update the userDidEnterPassword block.
914         Otherwise, call -[WKWebView _showPasswordViewWithDocumentName:passwordHandler:].
915         * UIProcess/ios/WebPageProxyIOS.mm:
916         (WebKit::WebPageProxy::didRequestPasswordForQuickLookDocumentInMainFrame): Called
917         PageClient::requestPasswordForQuickLookDocument() with a completion handler that send
918         message WebPage::DidReceivePasswordForQuickLookDocument.
919         * WebProcess/WebCoreSupport/ios/WebQuickLookHandleClient.cpp:
920         (WebKit::passwordCallbacks): Stores a map of page IDs to completion handler functions.
921         (WebKit::WebQuickLookHandleClient::~WebQuickLookHandleClient): Removes the current page ID
922         from passwordCallbacks().
923         (WebKit::WebQuickLookHandleClient::didRequestPassword): Asserts there is no current function
924         for this page ID in passwordCallbacks(), adds completionHandler to passwordCallbacks(), and
925         sends message WebPageProxy::DidRequestPasswordForQuickLookDocumentInMainFrame.
926         (WebKit::WebQuickLookHandleClient::didReceivePassword): Asserts there is a function for this
927         page ID in passwordCallbacks(), takes the completionHandler from passwordCallbacks(), and
928         calls it with the received password.
929         * WebProcess/WebCoreSupport/ios/WebQuickLookHandleClient.h: Declared didReceivePassword()
930         and overrode supportsPasswordEntry() and didRequestPassword().
931         * WebProcess/WebPage/WebPage.h: Declared didReceivePasswordForQuickLookDocument().
932         * WebProcess/WebPage/WebPage.messages.in: Added message
933         DidReceivePasswordForQuickLookDocument.
934         * WebProcess/WebPage/ios/WebPageIOS.mm:
935         (WebKit::WebPage::didReceivePasswordForQuickLookDocument): Called
936         WebQuickLookHandleClient::didReceivePassword() with the received password and current page ID.
937
938 2017-01-25  Youenn Fablet  <youennf@gmail.com>
939
940         [WebRTC] Introduce libwebrtc abstraction for WK1/WK2 implementations
941         https://bugs.webkit.org/show_bug.cgi?id=167294
942
943         Reviewed by Alex Christensen.
944
945         * WebProcess/WebPage/WebPage.cpp:
946         (WebKit::m_userInterfaceLayoutDirection):
947
948 2017-01-25  Andy Estes  <aestes@apple.com>
949
950         [iOS] Move WKPDFView's password view to WKWebView
951         https://bugs.webkit.org/show_bug.cgi?id=167401
952
953         Reviewed by Tim Horton.
954
955         r210943 moved the PDF password view into the new class WKPasswordView but left it as a
956         subview of the WKPDFView. To show the password view for Web content, my original plan was to
957         teach WKContentView to host its own password view, but this turned out not to work. Since
958         QuickLook needs to unlock a document before determining its preview's MIME type, we have to
959         ask for a password during provisional navigation, but if the still-committed document is a
960         PDF then the WKContentView will not be in the view hierarchy.
961
962         To ensure password view visibility, this patch moves the ownership of WKPasswordView to
963         WKWebView and creates an internal API for showing and hiding it. When
964         -_showPasswordViewWithDocumentName:passwordHandler: is called, WKWebView inserts a new
965         WKPasswordView as a subview of the scroll view and hides the current content view. The
966         password view is removed and the current content view is unhidden by -_hidePasswordView.
967
968         This also fixes a bug in WKPDFView where a PDF document is laid out incorrectly if the view
969         size changes while the password view is displayed.
970
971         * UIProcess/API/Cocoa/WKWebView.mm: Declared _passwordView.
972         (-[WKWebView _processDidExit]): Hid the password view.
973         (-[WKWebView _didCommitLayerTree:]): Ignored if not showing the standard content view.
974         (-[WKWebView _restorePageScrollPosition:scrollOrigin:previousObscuredInset:scale:]): Ditto.
975         (-[WKWebView _restorePageStateToUnobscuredCenter:scale:]): Ditto.
976         (-[WKWebView usesStandardContentView]): Changed to return false if _passwordView is non-nil.
977         (-[WKWebView _updateContentRectsWithState:]): Updated _passwordView's frame with the current
978         bounds size.
979         (-[WKWebView _showPasswordViewWithDocumentName:passwordHandler:]): Created a WKPasswordView,
980         called -showInScrollView:, and hid _currentContentView.
981         (-[WKWebView _hidePasswordView]): Removed _passwordView from its superview, set
982         _passwordView to nil, and unhid _currentContentView.
983         (-[WKWebView _passwordView]): Returned _passwordView.
984         (-[WKWebView _beginAnimatedResizeWithUpdates:]): Called -usesStandardContentView instead of
985         checking for a non-nil _customContentView when deciding whether to do a non-animated resize.
986         * UIProcess/API/Cocoa/WKWebViewInternal.h:
987         * UIProcess/ios/WKPDFView.mm: Removed _passwordView.
988         (-[WKPDFView web_setMinimumSize:]): Set m_minimumSize and updated the frame size even when a
989         password view is displayed.
990         (-[WKPDFView _computePageAndDocumentFrames]): Removed password view code.
991         (-[WKPDFView _showPasswordEntryField]): Ditto.
992         (-[WKPDFView _passwordViewFrame]): Deleted.
993         * UIProcess/ios/WKPasswordView.h:
994         * UIProcess/ios/WKPasswordView.mm:
995         (-[WKPasswordView initWithFrame:documentName:]): Stored a copy of documentName in
996         _documentName.
997         (-[WKPasswordView documentName]): Added. Returns _documentName.
998         (-[WKPasswordView showInScrollView:]): Renamed from displayInContentView:. Started saving
999         zoomScale and contentSize.
1000         (-[WKPasswordView hide]): Started restoring zoomeScale and contentSize.
1001         (-[WKPasswordView showPasswordFailureAlert]): Renamed from -displayPasswordFailureAlert.
1002         (-[WKPasswordView displayInContentView:]): Renamed to -showInScrollView:
1003         (-[WKPasswordView displayPasswordFailureAlert]): Renamed to -showPasswordFailureAlert.
1004
1005 2017-01-25  Wenson Hsieh  <wenson_hsieh@apple.com>
1006
1007         Add support for named pasteboards, pasteboard strategies and platform pasteboards
1008         https://bugs.webkit.org/show_bug.cgi?id=167404
1009
1010         Reviewed by Enrica Casucci.
1011
1012         Adds support for delivering the pasteboard name to the UI process when writing to or reading from the pasteboard.
1013
1014         * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
1015         (WebKit::WebPasteboardProxy::writeWebContentToPasteboard):
1016         (WebKit::WebPasteboardProxy::writeImageToPasteboard):
1017         (WebKit::WebPasteboardProxy::writeStringToPasteboard):
1018         (WebKit::WebPasteboardProxy::readStringFromPasteboard):
1019         (WebKit::WebPasteboardProxy::readURLFromPasteboard):
1020         (WebKit::WebPasteboardProxy::readBufferFromPasteboard):
1021         (WebKit::WebPasteboardProxy::getPasteboardItemsCount):
1022         * UIProcess/WebPasteboardProxy.h:
1023         * UIProcess/WebPasteboardProxy.messages.in:
1024         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
1025         (WebKit::WebPlatformStrategies::writeToPasteboard):
1026         (WebKit::WebPlatformStrategies::getPasteboardItemsCount):
1027         (WebKit::WebPlatformStrategies::readBufferFromPasteboard):
1028         (WebKit::WebPlatformStrategies::readURLFromPasteboard):
1029         (WebKit::WebPlatformStrategies::readStringFromPasteboard):
1030         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
1031
1032 2017-01-25  Carlos Garcia Campos  <cgarcia@igalia.com>
1033
1034         [GTK] Icon Database should be in private browsing mode for ephemeral web views
1035         https://bugs.webkit.org/show_bug.cgi?id=167414
1036
1037         Reviewed by Michael Catanzaro.
1038
1039         This is already done by WebProcessPool for the legacy private session setting, but only checking the setting and not
1040         whether there are ephemeral web pages or not.
1041
1042         * UIProcess/API/gtk/WebKitWebContext.cpp:
1043         (webkitWebContextEnableIconDatabasePrivateBrowsingIfNeeded): Enable icon database private browsing if there's
1044         any ephemeral web view.
1045         (webkitWebContextDisableIconDatabasePrivateBrowsingIfNeeded): Disable icon database private browsing if there
1046         aren't ephemeral web views anymore.
1047         (webkit_web_context_set_favicon_database_directory): Enable icon database private browsing if the web context is ephemeral.
1048         (webkitWebContextCreatePageForWebView): Call webkitWebContextEnableIconDatabasePrivateBrowsingIfNeeded().
1049         (webkitWebContextWebViewDestroyed): Call webkitWebContextDisableIconDatabasePrivateBrowsingIfNeeded().
1050         * UIProcess/API/gtk/WebKitWebView.cpp:
1051         (webkitWebViewDispose): Ensure webkitWebContextWebViewDestroyed is called only once.
1052
1053 2017-01-25  Carlos Garcia Campos  <cgarcia@igalia.com>
1054
1055         [GTK] UIProcess from WebKitGtk+ 2.15.x SIGSEGVs because of X Error BadDamage in WebKit::AcceleratedBackingStoreX11::update(WebKit::LayerTreeContext const&) () at Source/WebKit2/UIProcess/gtk/AcceleratedBackingStoreX11.cpp:145
1056         https://bugs.webkit.org/show_bug.cgi?id=165656
1057
1058         Reviewed by Michael Catanzaro.
1059
1060         We are incorrectly handling BadDamage errors because the BadDamage value we pass to the XErrorTrapper is not
1061         the actual error code used by X11. Since XDamage is an extension, it has its own errors and a base error
1062         code. We need to use the base error code we get when calling XDamageQueryExtension to pass the right error code
1063         to the XErrorTrapper.
1064
1065         * UIProcess/gtk/AcceleratedBackingStoreX11.cpp:
1066         (WebKit::AcceleratedBackingStoreX11::create): Get also the damage base error.
1067         (WebKit::xDamageErrorCode): Helper to get the actual error code.
1068         (WebKit::AcceleratedBackingStoreX11::~AcceleratedBackingStoreX11): Use xDamageErrorCode().
1069         (WebKit::AcceleratedBackingStoreX11::update): Ditto.
1070
1071 2017-01-25  Miguel Gomez  <magomez@igalia.com>
1072
1073         [GTK] The inspector is broken when AC support is disabled
1074         https://bugs.webkit.org/show_bug.cgi?id=165237
1075
1076         Reviewed by Carlos Garcia Campos.
1077
1078         WebInspector must not use PageOverlays or GraphicsLayers when AC is not avaialable.
1079
1080         No new tests added.
1081
1082         * WebProcess/WebCoreSupport/WebInspectorClient.cpp:
1083         (WebKit::WebInspectorClient::highlight):
1084         (WebKit::WebInspectorClient::showPaintRect):
1085
1086 2017-01-25  Carlos Garcia Campos  <cgarcia@igalia.com>
1087
1088         [SOUP] Custom protocols don't work in private browsing mode
1089         https://bugs.webkit.org/show_bug.cgi?id=167236
1090
1091         Reviewed by Sergio Villar Senin.
1092
1093         We only register them in the default session, they should be registered in all existing sessions, and also on
1094         newly created ones.
1095
1096         * NetworkProcess/CustomProtocols/soup/CustomProtocolManagerSoup.cpp:
1097         (WebKit::CustomProtocolManager::registerProtocolClass): Set the WEBKIT_TYPE_SOUP_REQUEST_GENERIC as type for
1098         custom protocols.
1099         (WebKit::CustomProtocolManager::registerScheme): Use g_type_class_peek instead of g_type_class_ref since we know
1100         the class was already created in registerProtocolClass(). Setup custom protocols in all existing sessions.
1101
1102 2017-01-24  Carlos Garcia Campos  <cgarcia@igalia.com>
1103
1104         [GTK] Add API to create ephemeral web views and deprecate the private browsing setting
1105         https://bugs.webkit.org/show_bug.cgi?id=167370
1106
1107         Reviewed by Michael Catanzaro.
1108
1109         Add API to create ephemeral WebKitWebView, WebKitWebsiteDataManager and WebKitWebContext.
1110
1111         * UIProcess/API/gtk/WebKitSettings.cpp:
1112         (webKitSettingsSetProperty): Ignore deprecation warnings.
1113         (webKitSettingsGetProperty): Ditto.
1114         (webkit_settings_class_init): Mark WebKitSettings:enable-private-browsing as deprecated.
1115         * UIProcess/API/gtk/WebKitSettings.h:
1116         * UIProcess/API/gtk/WebKitWebContext.cpp:
1117         (webkit_web_context_new_ephemeral): Create an ephemeral WebKitWebContext. This is just a convenient method to
1118         create a WebKitWebContext with an ephemeral WebKitWebsiteDataManager without having to deal with the manager.
1119         (webkit_web_context_is_ephemeral): Return whether the context is ephemeral.
1120         (webkitWebContextCreatePageForWebView): Configure page with the web view WebKitWebsiteDataManager if it has one.
1121         * UIProcess/API/gtk/WebKitWebContext.h:
1122         * UIProcess/API/gtk/WebKitWebView.cpp:
1123         (webkitWebViewConstructed): Check if the WebView is or should be ephemeral and create a non persistent website
1124         data manager if it's an ephemeral web view in a non ephemeral web context.
1125         (webkitWebViewSetProperty): Add setter for is-ephemeral property.
1126         (webkitWebViewGetProperty): Add getter for is-ephemeral property.
1127         (webkit_web_view_class_init): Add is-ephemeral property.
1128         (webkitWebViewHandleAuthenticationChallenge): Check also whether web view is ephemeral.
1129         (webkitWebViewGetWebsiteDataManager): Helper private to return the web view data manager.
1130         (webkit_web_view_new_with_context): Also set is-ephemeral property depending on the context.
1131         (webkit_web_view_is_ephemeral): Return whether the view is ephemeral.
1132         * UIProcess/API/gtk/WebKitWebView.h:
1133         * UIProcess/API/gtk/WebKitWebViewPrivate.h:
1134         * UIProcess/API/gtk/WebKitWebsiteDataManager.cpp:
1135         (webkitWebsiteDataManagerGetProperty): Add setter for is-ephemeral property.
1136         (webkitWebsiteDataManagerSetProperty): Add getter for is-ephemeral property.
1137         (webkit_website_data_manager_class_init): Add is-ephemeral property.
1138         (webkit_website_data_manager_new_ephemeral): Create a new ephemeral WebKitWebsiteDataManager.
1139         (webkit_website_data_manager_is_ephemeral): Return whether the website data manager is ephemeral.
1140         (webkit_website_data_manager_get_base_data_directory): Return nullptr if manager is ephemeral.
1141         (webkit_website_data_manager_get_base_cache_directory): Ditto.
1142         (webkit_website_data_manager_get_local_storage_directory): Ditto.
1143         (webkit_website_data_manager_get_disk_cache_directory): Ditto.
1144         (webkit_website_data_manager_get_offline_application_cache_directory): Ditto.
1145         (webkit_website_data_manager_get_indexeddb_directory): Ditto.
1146         (webkit_website_data_manager_get_websql_directory): Ditto.
1147         * UIProcess/API/gtk/WebKitWebsiteDataManager.h:
1148         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt: Add new symbols.
1149
1150 2017-01-24  Zalan Bujtas  <zalan@apple.com>
1151
1152         Add simple line layout toggle to MiniBrowser
1153         https://bugs.webkit.org/show_bug.cgi?id=167405
1154
1155         Reviewed by Andreas Kling.
1156
1157         * UIProcess/API/Cocoa/WKPreferences.mm:
1158         (-[WKPreferences _simpleLineLayoutEnabled]):
1159         (-[WKPreferences _setSimpleLineLayoutEnabled:]):
1160         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
1161
1162 2017-01-24  Joseph Pecoraro  <pecoraro@apple.com>
1163
1164         Fold USER_TIMING into WEB_TIMING and make it a RuntimeEnabledFeature
1165         https://bugs.webkit.org/show_bug.cgi?id=167394
1166
1167         Reviewed by Ryosuke Niwa.
1168
1169         * Configurations/FeatureDefines.xcconfig:
1170
1171 2017-01-24  Simon Fraser  <simon.fraser@apple.com>
1172
1173         [iOS WK2] Avoid IOSurface readback for snapshot creation
1174         https://bugs.webkit.org/show_bug.cgi?id=167397
1175         rdar://problem/30174873
1176
1177         Reviewed by Tim Horton.
1178
1179         Use IOSurface::sinkIntoImage() for snapshots, to avoid GPU readback.
1180
1181         * UIProcess/API/Cocoa/WKWebView.mm:
1182         (-[WKWebView _snapshotRect:intoImageOfWidth:completionHandler:]):
1183
1184 2017-01-24  Tim Horton  <timothy_horton@apple.com>
1185
1186         Script gets touch events even after navigation swipe begins
1187         https://bugs.webkit.org/show_bug.cgi?id=167383
1188         <rdar://problem/22938927>
1189
1190         Reviewed by Simon Fraser.
1191
1192         * Platform/spi/ios/UIKitSPI.h:
1193         * UIProcess/API/Cocoa/WKWebView.mm:
1194         (-[WKWebView _isNavigationSwipeGestureRecognizer:]):
1195         * UIProcess/API/Cocoa/WKWebViewInternal.h:
1196         * UIProcess/Cocoa/ViewGestureController.h:
1197         * UIProcess/ios/ViewGestureControllerIOS.mm:
1198         (-[WKSwipeTransitionController isNavigationSwipeGestureRecognizer:]):
1199         (WebKit::ViewGestureController::isNavigationSwipeGestureRecognizer):
1200         * UIProcess/ios/WKContentViewInteraction.mm:
1201         (-[WKContentView gestureRecognizer:shouldRequireFailureOfGestureRecognizer:]):
1202         Require the navigation swipe gesture recognizer to fail before the
1203         UIWebTouchEventsGestureRecognizer can recognize. This way, the page
1204         doesn't get touch events during the swipe, which previously led to
1205         e.g. carousels scrolling while swiping.
1206
1207 2017-01-24  Matt Rajca  <mrajca@apple.com>
1208
1209         Pass down website autoplay policies to media elements
1210         https://bugs.webkit.org/show_bug.cgi?id=167355
1211
1212         Reviewed by Alex Christensen.
1213
1214         Autoplay policies can be specified at the global web view preferences level or on a per-page
1215         basis during navigation. This patch ensures that policies specified on a per-page basis hold
1216         precedence over global policies. If no policies are specified during navigation, global
1217         policies are used. A WebsiteAutoplayPolicy::Default option has been added to let clients
1218         explicitly specify web view defaults should be used.
1219
1220         * Shared/WebsitePolicies.h:
1221         * UIProcess/API/C/WKWebsitePolicies.cpp:
1222         (WKWebsitePoliciesGetAutoplayPolicy):
1223         (WKWebsitePoliciesSetAutoplayPolicy):
1224         * UIProcess/API/C/WKWebsitePolicies.h:
1225         * UIProcess/API/Cocoa/_WKWebsitePolicies.h:
1226         * UIProcess/API/Cocoa/_WKWebsitePolicies.mm:
1227         (-[_WKWebsitePolicies setAutoplayPolicy:]):
1228         (-[_WKWebsitePolicies autoplayPolicy]):
1229         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1230         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
1231
1232 2017-01-24  Nan Wang  <n_wang@apple.com>
1233
1234         AX: Speak Selection does not work in an iframe
1235         https://bugs.webkit.org/show_bug.cgi?id=166794
1236         <rdar://problem/29913013>
1237
1238         Reviewed by Chris Fleizach.
1239
1240         Making sure WebPage::getSelectionOrContentsAsString() is getting the
1241         selection content in the right frame. 
1242
1243         * UIProcess/API/Cocoa/WKWebView.mm:
1244         (-[WKWebView _accessibilityRetrieveSpeakSelectionContent]):
1245         (-[WKWebView _accessibilityDidGetSpeakSelectionContent:]):
1246         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1247         * UIProcess/ios/WKContentViewInteraction.h:
1248         * UIProcess/ios/WKContentViewInteraction.mm:
1249         (-[WKContentView accessibilityRetrieveSpeakSelectionContent]):
1250         * WebProcess/WebPage/WebPage.cpp:
1251         (WebKit::WebPage::getSelectionOrContentsAsString):
1252
1253 2017-01-24  Jer Noble  <jer.noble@apple.com>
1254
1255         Make _WKFullscreenDelegate available to users of the WebKit2 C-API.
1256         https://bugs.webkit.org/show_bug.cgi?id=165255
1257
1258         Reviewed by Anders Carlsson.
1259
1260         Add a getter and setter to WKPagePrivate allowing clients to set/get the
1261         _WKFullscreenDelegate associated with the page.
1262
1263         * UIProcess/API/C/mac/WKPagePrivateMac.h:
1264         * UIProcess/API/C/mac/WKPagePrivateMac.mm:
1265         (WKPageSetFullscreenDelegate):
1266         (WKPageGetFullscreenDelegate):
1267
1268 2017-01-23  Anders Carlsson  <andersca@apple.com>
1269
1270         The Score Esports crashes on launch
1271         https://bugs.webkit.org/show_bug.cgi?id=167338
1272         rdar://problem/29948645
1273
1274         Reviewed by Dan Bernstein.
1275
1276         * Shared/Cocoa/WKObject.mm:
1277         (+[WKObject conformsToProtocol:]):
1278         Add a class method implementation in case an app ends up calling +[WKObject conformsToProtocol:] for some reason.
1279
1280 2017-01-24  Miguel Gomez  <magomez@igalia.com>
1281
1282         [Coordinated Graphics] Ensure that we're in AC mode before trying to create GraphicsLayers
1283         https://bugs.webkit.org/show_bug.cgi?id=167365
1284
1285         Reviewed by Carlos Garcia Campos.
1286
1287         When entering AC on demand, the RenderLayerCompositor wants to create the root GraphicsLayer before the
1288         AcceleratedDrawingArea is in AC mode. This means there's no LayerTreeHost to request the GraphicsLayerFactory,
1289         so no layers are created. Ensure that we are in AC mode before requesting the GraphicsLayerFactory.
1290
1291         No behaviour change, no new tests.
1292
1293         * WebProcess/WebPage/AcceleratedDrawingArea.cpp:
1294         (WebKit::AcceleratedDrawingArea::graphicsLayerFactory):
1295
1296 2017-01-23  Carlos Garcia Campos  <cgarcia@igalia.com>
1297
1298         [GTK] Add API to WebKitWebsiteDataManager to handle website data
1299         https://bugs.webkit.org/show_bug.cgi?id=146589
1300
1301         Reviewed by Michael Catanzaro.
1302
1303         Add WebKitWebsiteData boxed type to wrap a WebsiteDataRecord and new methods to WebKitWebsiteDataManager to
1304         fetch, remove and clear website data.
1305
1306         * PlatformGTK.cmake: Add new files to compilation.
1307         * UIProcess/API/gtk/WebKitWebsiteData.cpp: Added.
1308         (_WebKitWebsiteData::_WebKitWebsiteData):
1309         (recordContainsSupportedDataTypes): Helper function to check if the WebsiteDataRecord contains any type exposed
1310         by our API.
1311         (toWebKitWebsiteDataTypes): Convert from WebKit::WebsiteDataType to the GTK+ public API types.
1312         (webkitWebsiteDataCreate): Create a new WebKitWebsiteData for the given WebsiteDataRecord if it contains any
1313         supported type.
1314         (webkitWebsiteDataGetRecord): Returns the wrapped WebsiteDataRecord.
1315         (webkit_website_data_ref):
1316         (webkit_website_data_unref):
1317         (webkit_website_data_get_name): Return the display name.
1318         (webkit_website_data_get_types): Returns the mask of types.
1319         (webkit_website_data_get_size): Returns the size for the given types.
1320         * UIProcess/API/gtk/WebKitWebsiteData.h: Added.
1321         * UIProcess/API/gtk/WebKitWebsiteDataManager.cpp:
1322         (toWebsiteDataTypes): Convert from GTK+ public API types to WebKit::WebsiteDataType.
1323         (webkit_website_data_manager_fetch): Fetch website data of the given types.
1324         (webkit_website_data_manager_fetch_finish):
1325         (webkit_website_data_manager_remove): Remove the website data of the given types for the given WebKitWebsiteData list.
1326         (webkit_website_data_manager_remove_finish):
1327         (webkit_website_data_manager_clear): Clear all website data of the given types modified since the given time span.
1328         (webkit_website_data_manager_clear_finish):
1329         * UIProcess/API/gtk/WebKitWebsiteDataManager.h:
1330         * UIProcess/API/gtk/WebKitWebsiteDataPrivate.h: Added.
1331         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt: Add new symbols.
1332         * UIProcess/API/gtk/docs/webkit2gtk-docs.sgml: Add new section.
1333         * UIProcess/API/gtk/webkit2.h: Inlcude WebKitWebsiteData.h
1334
1335 2017-01-23  Antti Koivisto  <antti@apple.com>
1336
1337         Maintain ordering when doing speculative loads
1338         https://bugs.webkit.org/show_bug.cgi?id=167324
1339
1340         Forgot to implement a review comment.
1341
1342         * NetworkProcess/cache/NetworkCacheSubresourcesEntry.cpp:
1343         (WebKit::NetworkCache::makeSubresourceInfoVector):
1344
1345         Allocated initial capacity and use uncheckedAppend.
1346
1347 2017-01-23  Commit Queue  <commit-queue@webkit.org>
1348
1349         Unreviewed, rolling out r211062.
1350         https://bugs.webkit.org/show_bug.cgi?id=167354
1351
1352         broke API tests (Requested by alexchristensen on #webkit).
1353
1354         Reverted changeset:
1355
1356         "Pass down website autoplay policies to media elements"
1357         https://bugs.webkit.org/show_bug.cgi?id=167132
1358         http://trac.webkit.org/changeset/211062
1359
1360 2017-01-23  Antti Koivisto  <antti@apple.com>
1361
1362         Maintain ordering when doing speculative loads
1363         https://bugs.webkit.org/show_bug.cgi?id=167324
1364
1365         Reviewed by Chris Dumez.
1366
1367         We currently randomize the ordering of speculative loads because they are serialized as a hash map.
1368         It would be better to load in the same order as the requests were originally issued as that is
1369         likely to match the order the document needs them.
1370
1371         * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
1372         (WebKit::NetworkCache::SpeculativeLoadManager::startSpeculativeRevalidation):
1373         * NetworkProcess/cache/NetworkCacheSubresourcesEntry.cpp:
1374         (WebKit::NetworkCache::SubresourceInfo::encode):
1375         (WebKit::NetworkCache::SubresourceInfo::decode):
1376
1377             Include key into SubresourceInfo.
1378
1379         (WebKit::NetworkCache::makeSubresourcesVector):
1380
1381             Deduplicate the entries.
1382
1383         (WebKit::NetworkCache::SubresourcesEntry::SubresourcesEntry):
1384         (WebKit::NetworkCache::SubresourcesEntry::updateSubresourceLoads):
1385         * NetworkProcess/cache/NetworkCacheSubresourcesEntry.h:
1386         (WebKit::NetworkCache::SubresourceInfo::SubresourceInfo):
1387         (WebKit::NetworkCache::SubresourceInfo::key):
1388         (WebKit::NetworkCache::SubresourceInfo::setTransient):
1389         (WebKit::NetworkCache::SubresourcesEntry::subresources):
1390
1391             Keep the resources in a Vector instead of a HashMap to maintain order.
1392
1393 2017-01-23  Matt Rajca  <mrajca@apple.com>
1394
1395         Pass down website autoplay policies to media elements
1396         https://bugs.webkit.org/show_bug.cgi?id=167132
1397
1398         Reviewed by Alex Christensen.
1399
1400         The playbackRequiresUserGesture APIs are already covered by tests. This patch adds API tests
1401         for autoplay website policies.
1402
1403         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1404         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
1405
1406 2017-01-23  Joseph Pecoraro  <pecoraro@apple.com>
1407
1408         Web Inspector: Asserts seen opening and closing Remote Web Inspector windows
1409         https://bugs.webkit.org/show_bug.cgi?id=167316
1410         <rdar://problem/28891161>
1411
1412         Reviewed by Alexey Proskuryakov.
1413
1414         * UIProcess/RemoteWebInspectorProxy.cpp:
1415         (WebKit::RemoteWebInspectorProxy::createFrontendPageAndWindow):
1416         Assume read access, like the local web inspector, to Web Inspector resources.
1417
1418         * WebProcess/WebPage/RemoteWebInspectorUI.cpp:
1419         (WebKit::RemoteWebInspectorUI::closeWindow):
1420         Clear ourselves as the inspector frontend client when closing.
1421
1422 2017-01-20  Anders Carlsson  <andersca@apple.com>
1423
1424         When Safari reloads pages with Flash objects after Flash is installed, placeholders don't paint (but do work!)
1425         https://bugs.webkit.org/show_bug.cgi?id=167268
1426         rdar://problem/29857388
1427
1428         Reviewed by Sam Weinig.
1429
1430         * WebProcess/Plugins/WebPluginInfoProvider.h:
1431         Make refreshPlugins() private.
1432
1433         * WebProcess/WebProcess.cpp:
1434         (WebKit::WebProcess::refreshPlugins):
1435         Call the newly added PluginInfoProvider::refresh().
1436
1437 2017-01-23  Antti Koivisto  <antti@apple.com>
1438
1439         Use priorities in speculative revalidation
1440         https://bugs.webkit.org/show_bug.cgi?id=167314
1441
1442         Reviewed by Chris Dumez.
1443
1444         We currently do all speculative cache operations with 'Medium' priority
1445         and network operations with 'Low'. We should use the actual request priorities instead.
1446
1447         * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
1448         (WebKit::NetworkCache::constructRevalidationRequest):
1449
1450             Use priority when constructing validation request.
1451
1452         (WebKit::NetworkCache::SpeculativeLoadManager::retrieveEntryFromStorage):
1453
1454             Use priority when retrieving from cache.
1455
1456         (WebKit::NetworkCache::SpeculativeLoadManager::preloadEntry):
1457         * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.h:
1458         * NetworkProcess/cache/NetworkCacheSubresourcesEntry.cpp:
1459         (WebKit::NetworkCache::SubresourceInfo::encode):
1460         (WebKit::NetworkCache::SubresourceInfo::decode):
1461
1462             Save and restore the priority.
1463
1464         * NetworkProcess/cache/NetworkCacheSubresourcesEntry.h:
1465         (WebKit::NetworkCache::SubresourceInfo::SubresourceInfo):
1466         (WebKit::NetworkCache::SubresourceInfo::priority):
1467
1468 2017-01-23  Jer Noble  <jer.noble@apple.com>
1469
1470         Video details does not apear and missing scrubber in Control Center
1471         https://bugs.webkit.org/show_bug.cgi?id=167233
1472
1473         Reviewed by Alex Christensen.
1474
1475         Make requestActiveNowPlayingSessionInfo() and handleActiveNowPlayingSessionInfoResponse()
1476         work in PLATFORM(IOS).
1477
1478         * UIProcess/API/Cocoa/WKWebView.mm:
1479         (-[WKWebView _requestActiveNowPlayingSessionInfo]):
1480         (-[WKWebView _handleActiveNowPlayingSessionInfoResponse:title:duration:elapsedTime:]):
1481         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1482         * UIProcess/PageClient.h:
1483         * UIProcess/WebPageProxy.cpp:
1484         (WebKit::WebPageProxy::requestActiveNowPlayingSessionInfo):
1485         (WebKit::WebPageProxy::handleActiveNowPlayingSessionInfoResponse):
1486         * UIProcess/WebPageProxy.h:
1487         * UIProcess/WebPageProxy.messages.in:
1488         * UIProcess/ios/PageClientImplIOS.h:
1489         * UIProcess/ios/PageClientImplIOS.mm:
1490         (WebKit::PageClientImpl::handleActiveNowPlayingSessionInfoResponse):
1491         * WebProcess/WebPage/Cocoa/WebPageCocoa.mm:
1492         (WebKit::WebPage::requestActiveNowPlayingSessionInfo):
1493         * WebProcess/WebPage/WebPage.h:
1494         * WebProcess/WebPage/WebPage.messages.in:
1495         * WebProcess/WebPage/mac/WebPageMac.mm:
1496         (WebKit::WebPage::requestActiveNowPlayingSessionInfo): Deleted.
1497
1498 2017-01-23  Chris Dumez  <cdumez@apple.com>
1499
1500         REGRESSION (r211033): ASSERTION FAILED: m_ptr in com.apple.WebCore: WTF::RefPtr<WebCore::Element>::operator* const + 70
1501         https://bugs.webkit.org/show_bug.cgi?id=167308
1502         <rdar://problem/30144964>
1503
1504         Unreviewed, do a partial revert of r211033 to fix assertion.
1505
1506         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1507         (WebKit::WebChromeClient::exitFullScreenForElement):
1508         * WebProcess/WebCoreSupport/WebChromeClient.h:
1509
1510 2017-01-20  Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>
1511
1512         urlParserEnabled parameter is only encoded for COCOA ports
1513         https://bugs.webkit.org/show_bug.cgi?id=167238
1514
1515         Reviewed by Alex Christensen.
1516
1517         This leads to URLParser being enabled on the UI process, since it is
1518         the default, but disabled on the WebProcess, which is the default for
1519         WebProcessCreationParameters, casuing asserts like on tests such as these
1520         due to differences in parsing:
1521
1522         - fast/loader/redirect-to-invalid-url-using-javascript-calls-policy-delegate.html
1523         - fast/loader/window-open-to-invalid-url-calls-policy-delegate.html
1524         - http/tests/inspector/network/copy-as-curl.html
1525
1526         * Shared/WebProcessCreationParameters.cpp:
1527         (WebKit::WebProcessCreationParameters::encode): encode urlParserEnabled
1528         (WebKit::WebProcessCreationParameters::decode): decode urlParserEnabled
1529
1530 2017-01-20  Darin Adler  <darin@apple.com>
1531
1532         Remove PassRefPtr from "page" directory of WebCore, also deploy references
1533         https://bugs.webkit.org/show_bug.cgi?id=167224
1534
1535         Reviewed by Chris Dumez.
1536
1537         * UIProcess/Scrolling/RemoteScrollingTree.cpp:
1538         (WebKit::RemoteScrollingTree::createScrollingTreeNode): Return a Ref
1539         instead of PassRefPtr.
1540         * UIProcess/Scrolling/RemoteScrollingTree.h: Updated for the above.
1541
1542         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
1543         (WKBundlePageInstallPageOverlay): Pass a reference.
1544         (WKBundlePageUninstallPageOverlay): Ditto.
1545         (WKBundlePageInstallPageOverlayWithAnimation): Ditto.
1546         (WKBundlePageUninstallPageOverlayWithAnimation): Ditto.
1547         * WebProcess/Plugins/PDF/DeprecatedPDFPlugin.mm:
1548         (WebKit::PDFPlugin::jsPDFDocPrint): Ditto.
1549         * WebProcess/Plugins/PluginView.cpp:
1550         (WebKit::PluginView::focusPluginElement): Ditto.
1551         (WebKit::PluginView::setStatusbarText): Ditto.
1552
1553         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1554         (WebKit::WebChromeClient::elementDidFocus): Updated for changes to ChromeClient.
1555         (WebKit::WebChromeClient::elementDidBlur): Ditto.
1556         (WebKit::WebChromeClient::makeFirstResponder): Ditto.
1557         (WebKit::WebChromeClient::createWindow): Ditto.
1558         (WebKit::WebChromeClient::runBeforeUnloadConfirmPanel): Ditto.
1559         (WebKit::WebChromeClient::runJavaScriptAlert): Ditto.
1560         (WebKit::WebChromeClient::runJavaScriptConfirm): Ditto.
1561         (WebKit::WebChromeClient::runJavaScriptPrompt): Ditto.
1562         (WebKit::WebChromeClient::contentsSizeChanged): Ditto.
1563         (WebKit::WebChromeClient::unavailablePluginButtonClicked): Ditto.
1564         (WebKit::WebChromeClient::print): Ditto.
1565         (WebKit::WebChromeClient::exceededDatabaseQuota): Ditto.
1566         (WebKit::WebChromeClient::reachedApplicationCacheOriginQuota): Ditto.
1567         (WebKit::WebChromeClient::createColorChooser): Ditto.
1568         (WebKit::WebChromeClient::createPopupMenu): Ditto.
1569         (WebKit::WebChromeClient::createSearchPopupMenu): Ditto.
1570         (WebKit::WebChromeClient::attachRootGraphicsLayer): Ditto.
1571         (WebKit::WebChromeClient::attachViewOverlayGraphicsLayer): Ditto.
1572         (WebKit::WebChromeClient::createScrollingCoordinator): Ditto.
1573         (WebKit::WebChromeClient::supportsFullScreenForElement): Ditto.
1574         (WebKit::WebChromeClient::enterFullScreenForElement): Ditto.
1575         (WebKit::WebChromeClient::exitFullScreenForElement): Ditto.
1576         (WebKit::WebChromeClient::didAddHeaderLayer): Ditto.
1577         (WebKit::WebChromeClient::didAddFooterLayer): Ditto.
1578         (WebKit::WebChromeClient::shouldUseTiledBackingForFrameView): Ditto.
1579         * WebProcess/WebCoreSupport/WebChromeClient.h: Ditto.
1580         * WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm:
1581         (WebKit::WebChromeClient::elementDidRefocus): Ditto.
1582         (WebKit::WebChromeClient::didReceiveMobileDocType): Ditto.
1583         (WebKit::WebChromeClient::observedContentChange): Ditto.
1584         (WebKit::WebChromeClient::clearContentChangeObservers): Ditto.
1585         (WebKit::WebChromeClient::notifyRevealedSelectionByScrollingFrame): Ditto.
1586
1587         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1588         (WebKit::WebFrameLoaderClient::dispatchCreatePage): Pass reference.
1589         * WebProcess/WebCoreSupport/WebInspectorClient.cpp:
1590         (WebKit::WebInspectorClient::~WebInspectorClient): Ditto.
1591         (WebKit::WebInspectorClient::hideHighlight): Ditto.
1592         (WebKit::WebInspectorClient::showPaintRect): Ditto.
1593         * WebProcess/WebPage/FindController.cpp:
1594         (WebKit::FindController::updateFindUIAfterPageScroll): Ditto.
1595         (WebKit::FindController::hideFindUI): Ditto.
1596
1597         * WebProcess/WebPage/WebFrame.cpp:
1598         (WebKit::WebFrame::createWithCoreMainFrame): Return Ref instead of
1599         PassRefPtr.
1600         (WebKit::WebFrame::createSubframe): Ditto.
1601         (WebKit::WebFrame::create): Ditto.
1602         * WebProcess/WebPage/WebFrame.h: Updated for the above.
1603
1604         * WebProcess/WebPage/WebInspector.cpp:
1605         (WebKit::WebInspector::openInNewTab): Pass reference.
1606
1607         * WebProcess/WebPage/ios/FindControllerIOS.mm:
1608         (WebKit::FindController::updateFindIndicator): Use reference.
1609         (WebKit::FindController::hideFindIndicator): Ditto.
1610
1611 2017-01-21  Carlos Garcia Campos  <cgarcia@igalia.com>
1612
1613         Unreviewed, rolling out r211012.
1614
1615         It caused a lot of crashes in the network process
1616
1617         Reverted changeset:
1618
1619         "[SOUP] Custom protocols don't work in private browsing mode"
1620         https://bugs.webkit.org/show_bug.cgi?id=167236
1621         http://trac.webkit.org/changeset/211012
1622
1623 2017-01-20  Joseph Pecoraro  <pecoraro@apple.com>
1624
1625         Remove never changing IndexedDB RuntimeEnabledFeature
1626         https://bugs.webkit.org/show_bug.cgi?id=167278
1627
1628         Reviewed by Darin Adler.
1629
1630         * WebProcess/WebProcess.cpp:
1631         (WebKit::m_resourceLoadStatisticsStorage):
1632
1633 2017-01-20  Carlos Garcia Campos  <cgarcia@igalia.com>
1634
1635         [SOUP] Custom protocols don't work in private browsing mode
1636         https://bugs.webkit.org/show_bug.cgi?id=167236
1637
1638         Reviewed by Sergio Villar Senin.
1639
1640         We only register them in the default session.
1641
1642         * NetworkProcess/CustomProtocols/soup/CustomProtocolManagerSoup.cpp:
1643         (WebKit::CustomProtocolManager::registerProtocolClass): Set the WEBKIT_TYPE_SOUP_REQUEST_GENERIC as type for
1644         custom protocols, and setup custom protocols in all existing sessions.
1645         (WebKit::CustomProtocolManager::registerScheme): Use g_type_class_peek instead of g_type_class_ref since we know
1646         the class was already created in registerProtocolClass().
1647
1648 2017-01-20  Brady Eidson  <beidson@apple.com>
1649
1650         Require a button press on a gamepad for them to be exposed to the DOM.
1651         <rdar://problem/28620919> and https://bugs.webkit.org/show_bug.cgi?id=167272
1652
1653         Reviewed by Alex Christensen.
1654
1655         * UIProcess/Gamepad/UIGamepadProvider.cpp:
1656         (WebKit::UIGamepadProvider::gamepadSyncTimerFired):
1657         (WebKit::UIGamepadProvider::platformGamepadInputActivity):
1658         * UIProcess/Gamepad/UIGamepadProvider.h:
1659
1660         * UIProcess/WebPageProxy.cpp:
1661         (WebKit::WebPageProxy::gamepadActivity):
1662         * UIProcess/WebPageProxy.h:
1663
1664         * WebProcess/Gamepad/WebGamepadProvider.cpp:
1665         (WebKit::WebGamepadProvider::gamepadActivity):
1666         * WebProcess/Gamepad/WebGamepadProvider.h:
1667
1668         * WebProcess/WebPage/WebPage.cpp:
1669         (WebKit::WebPage::gamepadActivity):
1670         * WebProcess/WebPage/WebPage.h:
1671         * WebProcess/WebPage/WebPage.messages.in:
1672
1673 2017-01-20  Joseph Pecoraro  <pecoraro@apple.com>
1674
1675         Cleanup RuntimeEnabledFeatures
1676         https://bugs.webkit.org/show_bug.cgi?id=167228
1677
1678         Reviewed by Simon Fraser.
1679
1680         * WebProcess/WebProcess.cpp:
1681         (WebKit::m_resourceLoadStatisticsStorage):
1682
1683 2017-01-20  Joseph Pecoraro  <pecoraro@apple.com>
1684
1685         Remove outdated ENABLE(CSP_NEXT) build flag
1686         https://bugs.webkit.org/show_bug.cgi?id=167252
1687
1688         Reviewed by Brent Fulgham.
1689
1690         * Configurations/FeatureDefines.xcconfig:
1691
1692 2017-01-20  Alex Christensen  <achristensen@webkit.org>
1693
1694         Fix Mac CMake build.
1695
1696         * CMakeLists.txt:
1697         * PlatformMac.cmake:
1698
1699 2017-01-20  Antoine Quint  <graouts@apple.com>
1700
1701         Web Animations should be off by default and enabled as an experimental feature
1702         https://bugs.webkit.org/show_bug.cgi?id=167115
1703         <rdar://problem/30048963>
1704
1705         Reviewed by Joseph Pecoraro.
1706
1707         Promote, or relegate depending on how you see things, the Web Animations preference
1708         to an experimental feature.
1709
1710         * Shared/WebPreferencesDefinitions.h:
1711
1712 2017-01-20  Antoine Quint  <graouts@apple.com>
1713
1714         [Modern Media Controls] Turn modern media controls on by default
1715         https://bugs.webkit.org/show_bug.cgi?id=165668
1716
1717         Reviewed by Dean Jackson.
1718
1719         Use DEFAULT_EXPERIMENTAL_FEATURES_ENABLED as the default value for modern media controls, which is true.
1720
1721         * Shared/WebPreferencesDefinitions.h:
1722
1723 2017-01-20  Carlos Garcia Campos  <cgarcia@igalia.com>
1724
1725         Unreviewed. Update OptionsGTK.cmake and NEWS for 2.15.3 release.
1726
1727         * gtk/NEWS: Add release notes for 2.15.3.
1728
1729 2017-01-19  Carlos Garcia Campos  <cgarcia@igalia.com>
1730
1731         [Threaded Compositor] Initialize the threaded compositor with the current size
1732         https://bugs.webkit.org/show_bug.cgi?id=167196
1733
1734         Reviewed by Žan Doberšek.
1735
1736         We are always creating the threaded compositor with an empty size and then a sizeDidChange always happen when
1737         the backing store state changes. This is always happening because the threaded compositor is created before the
1738         first backing store state, but if we wanted to create it later, for example to enter/leave AC mode on demand,
1739         the threaded compositor will not have the viewport size unless the window is resized, or sizeDidChange is called
1740         manually when entering AC mode. Creating the threaded compositor is sync and changing the size too, so it's
1741         better to do both things at the same time using the same sync operation.
1742
1743         * Shared/CoordinatedGraphics/SimpleViewportController.cpp:
1744         (WebKit::SimpleViewportController::SimpleViewportController): Pass an initial size to the constructor.
1745         * Shared/CoordinatedGraphics/SimpleViewportController.h:
1746         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
1747         (WebKit::ThreadedCompositor::create): Add viewportSize and scaleFactor construction parameters,
1748         (WebKit::ThreadedCompositor::ThreadedCompositor): Ditto. Also mark as needs resize if the given size is not empty.
1749         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:
1750         * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp:
1751         (WebKit::ThreadedCoordinatedLayerTreeHost::ThreadedCoordinatedLayerTreeHost): Initialize the threaded compositor
1752         with an initial viewport size and scale factor.
1753
1754 2017-01-19  Chris Dumez  <cdumez@apple.com>
1755
1756         iterable<> should be enabled on WK1
1757         https://bugs.webkit.org/show_bug.cgi?id=167221
1758         <rdar://problem/30108531>
1759
1760         Reviewed by Youenn Fablet.
1761
1762         * Shared/WebPreferencesDefinitions.h:
1763         * WebProcess/InjectedBundle/InjectedBundle.cpp:
1764         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
1765         * WebProcess/WebPage/WebPage.cpp:
1766         (WebKit::WebPage::updatePreferences):
1767
1768 2017-01-19  Alex Christensen  <achristensen@webkit.org>
1769
1770         Construct URLSearchParams from array or object
1771         https://bugs.webkit.org/show_bug.cgi?id=166973
1772
1773         Reviewed by Sam Weinig.
1774
1775         * NetworkProcess/capture/NetworkCaptureManager.cpp:
1776         (WebKit::NetworkCapture::Manager::fuzzyMatchURLs):
1777         Change std::pair's first/second to WTF::KeyValuePair's key/value.
1778
1779 2017-01-19  Andy Estes  <aestes@apple.com>
1780
1781         [iOS] Move the PDF password view into its own class for possible reuse
1782         https://bugs.webkit.org/show_bug.cgi?id=167192
1783
1784         Reviewed by Tim Horton.
1785
1786         * UIProcess/ios/WKPDFView.h: Stopped conforming to UIDocumentPasswordViewDelegate.
1787         * UIProcess/ios/WKPDFView.mm: Changed _passwordView to a WKPasswordView.
1788         (-[WKPDFView _passwordViewFrame]): Returns the frame to set on _passwordView.
1789         (-[WKPDFView _updatePasswordEntryField]): Removed.
1790         (-[WKPDFView _showPasswordEntryField]): Created a WKPasswordView, set a lambda on its
1791         userDidEnterPassword property to do the work previously done in -_tryToUnlockWithPassword:,
1792         and showed the password view.
1793         (-[WKPDFView _keyboardDidShow:]): Moved to WKPasswordView.
1794         (-[WKPDFView _hidePasswordEntryField]): Deleted. The userDidEnterPassword lambda now calls
1795         -[WKPasswordView hide] when the document is unlocked.
1796         (-[WKPDFView userDidEnterPassword:forPasswordView:]): Moved to WKPasswordView.
1797         (-[WKPDFView didBeginEditingPassword:inView:]): Ditto.
1798         (-[WKPDFView didEndEditingPassword:inView:]): Ditto.
1799         (-[WKPDFView _didFailToUnlock]): Ditto.
1800         (-[WKPDFView _tryToUnlockWithPassword:]): Moved into _passwordView's userDidEnterPassword lambda.
1801         * UIProcess/ios/WKPasswordView.h: Added.
1802         * UIProcess/ios/WKPasswordView.mm: Added.
1803         (-[WKPasswordView initWithFrame:documentName:]): Created a UIDocumentPasswordView with
1804         documentName, set self as its passwordDelegate, and added it as a subview.
1805         (-[WKPasswordView layoutSubviews]): Updated _scrollView's contentSize if we are displaying
1806         the view.
1807         (-[WKPasswordView displayInContentView:]): Saved the scroll view's previous minimum/maximum
1808         zoom scale and color, set new values for minimum/maximum zoom scale and color, and added
1809         self as a subview of contentView.
1810         (-[WKPasswordView hide]): Restored the saved minimum/maximum zoom scale and color on the
1811         scroll view and removed self from its superview.
1812         (-[WKPasswordView displayPasswordFailureAlert]): Displayed the alert previously shown by
1813         -[WKPDFView _didFailToUnlock].
1814         (-[WKPasswordView _keyboardDidShow:]): Moved from WKPDFView.
1815         (-[WKPasswordView userDidEnterPassword:forPasswordView:]): Retained self and called the
1816         _userDidEnterPassword block with the password.
1817         (-[WKPasswordView didBeginEditingPassword:inView:]): Moved from WKPDFView.
1818         (-[WKPasswordView didEndEditingPassword:inView:]): Ditto.
1819         * WebKit2.xcodeproj/project.pbxproj:
1820
1821 2017-01-19  Chris Dumez  <cdumez@apple.com>
1822
1823         Make sure HTML validation bubble gets dismissed when its associated element's frame gets detached
1824         https://bugs.webkit.org/show_bug.cgi?id=167215
1825         <rdar://problem/29885052>
1826
1827         Reviewed by Andreas Kling.
1828
1829         Make sure HTML validation bubble gets dismissed when its associated
1830         element's frame gets detached and that we do not crash.
1831
1832         * WebProcess/WebCoreSupport/WebValidationMessageClient.cpp:
1833         (WebKit::WebValidationMessageClient::documentDetached):
1834         * WebProcess/WebCoreSupport/WebValidationMessageClient.h:
1835
1836 2017-01-19  Chris Dumez  <cdumez@apple.com>
1837
1838         Implement per activity state CPU usage reporting using diagnostic logging
1839         https://bugs.webkit.org/show_bug.cgi?id=167163
1840         <rdar://problem/30058349>
1841
1842         Reviewed by Andreas Kling.
1843
1844         Implement per activity state CPU usage reporting using diagnostic logging.
1845
1846         * Platform/Logging.h:
1847         * UIProcess/PerActivityStateCPUUsageSampler.cpp: Added.
1848         (WebKit::PerActivityStateCPUUsageSampler::PerActivityStateCPUUsageSampler):
1849         (WebKit::PerActivityStateCPUUsageSampler::~PerActivityStateCPUUsageSampler):
1850         (WebKit::PerActivityStateCPUUsageSampler::reportWebContentCPUTime):
1851         (WebKit::loggingKeyForActivityState):
1852         (WebKit::loggingKeyForCPUUsage):
1853         (WebKit::PerActivityStateCPUUsageSampler::loggingTimerFired):
1854         (WebKit::PerActivityStateCPUUsageSampler::pageForLogging):
1855         * UIProcess/PerActivityStateCPUUsageSampler.h: Copied from Source/WebCore/page/ActivityState.h.
1856         * UIProcess/WebProcessPool.cpp:
1857         (WebKit::WebProcessPool::WebProcessPool):
1858         (WebKit::WebProcessPool::reportWebContentCPUTime):
1859         * UIProcess/WebProcessPool.h:
1860         * UIProcess/WebProcessPool.messages.in:
1861         * WebKit2.xcodeproj/project.pbxproj:
1862         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1863         (WebKit::WebChromeClient::reportProcessCPUTime):
1864         * WebProcess/WebCoreSupport/WebChromeClient.h:
1865
1866 2017-01-19  Dan Bernstein  <mitz@apple.com>
1867
1868         Build fix.
1869
1870         Rubber-stamped by Anders Carlsson.
1871
1872         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
1873         (WebKit::toPKPaymentAuthorizationStatus): Suppressed deprecation warnings.
1874
1875 2017-01-19  Myles C. Maxfield  <mmaxfield@apple.com>
1876
1877         [Cocoa] Variation fonts are erroneously disabled on iOS
1878         https://bugs.webkit.org/show_bug.cgi?id=167172
1879
1880         Reviewed by Simon Fraser.
1881
1882         OpenSource builders don't seem to understand sdk=embedded*.
1883
1884         * Configurations/FeatureDefines.xcconfig:
1885
1886 2017-01-18  Anders Carlsson  <andersca@apple.com>
1887
1888         Install WebKit.apinotes with the public headers of WebKit framework
1889         https://bugs.webkit.org/show_bug.cgi?id=167182
1890         rdar://problem/29008989
1891
1892         Reviewed by Sam Weinig.
1893
1894         * Shared/API/Cocoa/WebKit.apinotes: Added.
1895         * WebKit2.xcodeproj/project.pbxproj:
1896
1897 2017-01-19  Brian Burg  <bburg@apple.com>
1898
1899         Web Inspector: move Mac-specific automation commands to a separate implementation file
1900         https://bugs.webkit.org/show_bug.cgi?id=163297
1901         <rdar://problem/28718990>
1902
1903         Reviewed by Timothy Hatcher.
1904
1905         Not all Automation commands are available on all platforms. Start splitting out
1906         command declarations and implementations based on the target platform.
1907
1908         * DerivedSources.make:
1909         Set an appropriate --platform so the correct backend interface is generated.
1910
1911         * UIProcess/Automation/Automation.json:
1912         Guard commands that should not be available on iOS:
1913             - resizeWindowOfBrowsingContext
1914             - moveWindowOfBrowsingContext
1915             - inspectBrowsingContext
1916
1917         * UIProcess/Automation/WebAutomationSession.cpp:
1918         (WebKit::WebAutomationSession::platformSimulateKeySequence): Deleted.
1919         - Move shared convenience macros to header file.
1920         - Move out Cocoa-only or Mac-only command implementations.
1921
1922         * UIProcess/Automation/WebAutomationSession.h:
1923         Rearrange some declarations and switch from USE(APPKIT) to PLATFORM(MAC).
1924
1925         * UIProcess/Automation/WebAutomationSessionMacros.h: Added.
1926
1927         * UIProcess/Automation/cocoa/WebAutomationSessionCocoa.mm: Added.
1928         (WebKit::WebAutomationSession::platformGetBase64EncodedPNGData):
1929         Moved from WebAutomationSessionCocoa.mm. Add iOS-specific header includes.
1930
1931         * UIProcess/Automation/mac/WebAutomationSessionMac.mm: Renamed from Source/WebKit2/UIProcess/Cocoa/WebAutomationSessionCocoa.mm.
1932         (WebKit::WebAutomationSession::resizeWindowOfBrowsingContext):
1933         (WebKit::WebAutomationSession::moveWindowOfBrowsingContext):
1934         (WebKit::WebAutomationSession::inspectBrowsingContext):
1935         Move macOS platform command implementations to here. If other desktop ports want
1936         to use these commands, we can move them somewhere else later.
1937
1938         (WebKit::WebAutomationSession::sendSynthesizedEventsToPage):
1939         (WebKit::WebAutomationSession::markEventAsSynthesizedForAutomation):
1940         (WebKit::WebAutomationSession::wasEventSynthesizedForAutomation):
1941         Move out AppKit-specific event simulation code to here.
1942
1943         (WebKit::WebAutomationSession::platformSimulateMouseInteraction):
1944         (WebKit::WebAutomationSession::platformSimulateKeyStroke):
1945         (WebKit::WebAutomationSession::platformSimulateKeySequence):
1946         Move out Mac platformFoo implementations to here.
1947
1948         * WebKit2.xcodeproj/project.pbxproj:
1949         - Added UIProcess/Automation/{mac,cocoa} groups.
1950         - Add new platform-specific implementation files.
1951
1952 2017-01-19  Carlos Garcia Campos  <cgarcia@igalia.com>
1953
1954         [GTK] Provide API to set proxy settings
1955         https://bugs.webkit.org/show_bug.cgi?id=128674
1956
1957         Reviewed by Michael Catanzaro.
1958
1959         Add new method webkit_web_context_set_network_proxy_settings() that allows to set proxy settings in a
1960         WebKitWebContext. It receives an enum WebKitNetworkProxyMode with modes Default, NoProxy and Custom, and an
1961         optional WebKitNetworkProxySettings that is used when mode is Custom. WebKitNetworkProxySettings is a simple
1962         boxed type that user can create to set proxy settins with a similar API to GSimpleProxyResolver.
1963
1964         * NetworkProcess/NetworkProcess.h:
1965         * NetworkProcess/NetworkProcess.messages.in: Add SetNetworkProxySettings message.
1966         * NetworkProcess/NetworkProcessCreationParameters.cpp:
1967         (WebKit::NetworkProcessCreationParameters::encode): Encode proxy settings.
1968         (WebKit::NetworkProcessCreationParameters::decode): Decode proxy settings.
1969         * NetworkProcess/NetworkProcessCreationParameters.h:
1970         * NetworkProcess/efl/NetworkProcessMainEfl.cpp: Use SoupNetworkSession::setProxySettingsFromEnvironment().
1971         * NetworkProcess/soup/NetworkProcessSoup.cpp:
1972         (WebKit::NetworkProcess::platformInitializeNetworkProcess): Set proxy settings if provided by the user.
1973         (WebKit::NetworkProcess::setNetworkProxySettings): Set global proxy settings and setup the proxy for all
1974         existing contexts.
1975         * PlatformGTK.cmake: Add new files to compilation.
1976         * Shared/WebCoreArgumentCoders.h:
1977         * Shared/WebProcessCreationParameters.cpp:
1978         (WebKit::WebProcessCreationParameters::encode): Encode proxy settings.
1979         (WebKit::WebProcessCreationParameters::decode): Decode proxy settings.
1980         * Shared/WebProcessCreationParameters.h:
1981         * Shared/soup/WebCoreArgumentCodersSoup.cpp:
1982         (IPC::ArgumentCoder<SoupNetworkProxySettings>::encode): Add encoder implementation for SoupNetworkProxySettings.
1983         (IPC::ArgumentCoder<SoupNetworkProxySettings>::decode): add decoder implementation for SoupNetworkProxySettings.
1984         * UIProcess/API/gtk/WebKitNetworkProxySettings.cpp: Added.
1985         (_WebKitNetworkProxySettings::_WebKitNetworkProxySettings):
1986         (webkitNetworkProxySettingsGetNetworkProxySettings):
1987         (webkit_network_proxy_settings_new): Create a new WebKitNetworkProxySettings with optional default proxy uri and
1988         ignore hosts list.
1989         (webkit_network_proxy_settings_copy):
1990         (webkit_network_proxy_settings_free):
1991         (webkit_network_proxy_settings_add_proxy): Add a proxy uri for a given uri scheme.
1992         * UIProcess/API/gtk/WebKitNetworkProxySettings.h: Added.
1993         * UIProcess/API/gtk/WebKitNetworkProxySettingsPrivate.h: Added.
1994         * UIProcess/API/gtk/WebKitWebContext.cpp:
1995         (webkit_web_context_set_network_proxy_settings): Set proxy settings.
1996         * UIProcess/API/gtk/WebKitWebContext.h:
1997         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt: Add new symbols to the documentation.
1998         * UIProcess/API/gtk/docs/webkit2gtk-docs.sgml: Add new section for WebKitNetworkProxySettings.
1999         * UIProcess/API/gtk/webkit2.h: Include WebKitNetworkProxySettings.h.
2000         * UIProcess/WebProcessPool.h: Add m_networkProxySettings and a setter for soup.
2001         * UIProcess/efl/WebProcessPoolEfl.cpp:
2002         (WebKit::WebProcessPool::platformInitializeWebProcess): Set m_networkProxySettings to parameters.
2003         * UIProcess/gtk/WebProcessPoolGtk.cpp:
2004         (WebKit::WebProcessPool::platformInitializeWebProcess): Ditto.
2005         * UIProcess/soup/WebProcessPoolSoup.cpp:
2006         (WebKit::WebProcessPool::platformInitializeNetworkProcess): Ditto.
2007         (WebKit::WebProcessPool::setNetworkProxySettings): Update m_networkProxySettings and notify all processes.
2008         * WebProcess/WebProcess.h:
2009         * WebProcess/WebProcess.messages.in: Add SetNetworkProxySettings message.
2010         * WebProcess/efl/WebProcessMainEfl.cpp: Use SoupNetworkSession::setProxySettingsFromEnvironment().
2011         * WebProcess/soup/WebProcessSoup.cpp:
2012         (WebKit::WebProcess::platformSetCacheModel): Remove comment that is no longer true.
2013         (WebKit::WebProcess::platformInitializeWebProcess): Set proxy settings if provided by the user.
2014         (WebKit::WebProcess::setNetworkProxySettings): Set global proxy settings and setup the proxy for all
2015         existing contexts.
2016
2017 2017-01-19  Carlos Garcia Campos  <cgarcia@igalia.com>
2018
2019         [GTK] Do not update the backing store state unnecessarily when page visibility changes
2020         https://bugs.webkit.org/show_bug.cgi?id=167195
2021
2022         Reviewed by Sergio Villar Senin.
2023
2024         I've noticed that we are receiving UpdateBackingStoreState messages in the web process even when size and scale
2025         factor didn't change. That's quite unfortunate because we do a lot of work unnecessarily and we tell the
2026         threaded compositor that the size changed. This is not only a problem because it's not true, but also because
2027         changing the size is a sync operation in the threaded compositor, so we block the compositing thread for
2028         nothing. This is happening because the WebPageProxy notifies the drawing area that the backing store is
2029         discardable when the page is not visible, and that always produces a new backing store state. In accelerating
2030         compositing mode we don't even have a backing store to discard, so we should check we have something to discard
2031         and also make sure we only generate a new backing store state if we really discarded the backing store.
2032
2033         * UIProcess/DrawingAreaProxyImpl.cpp:
2034         (WebKit::DrawingAreaProxyImpl::discardBackingStoreSoon):
2035         (WebKit::DrawingAreaProxyImpl::discardBackingStore):
2036
2037 2017-01-18  Said Abou-Hallawa  <sabouhallawa@apple.com>
2038
2039         [iOS][WK2] Remove the WebView private configuration contentUpdateFrequency
2040         https://bugs.webkit.org/show_bug.cgi?id=167188
2041
2042         Reviewed by Simon Fraser.
2043
2044         This patch reverts r209294. This configuration is not needed anymore.
2045         The CADisplayLink::preferredFramesPerSecond for WK2 will be set to the
2046         default value always.
2047
2048         * UIProcess/API/APIPageConfiguration.h:
2049         (API::PageConfiguration::setAlwaysRunsAtForegroundPriority):
2050         (API::PageConfiguration::contentUpdateFrequency): Deleted.
2051         (API::PageConfiguration::setContentUpdateFrequency): Deleted.
2052         (): Deleted.
2053         * UIProcess/API/Cocoa/WKWebView.mm:
2054         (-[WKWebView _initializeWithConfiguration:]):
2055         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
2056         (-[WKWebViewConfiguration init]):
2057         (-[WKWebViewConfiguration copyWithZone:]):
2058         (-[WKWebViewConfiguration _setAllowsInlineMediaPlaybackAfterFullscreen:]):
2059         (-[WKWebViewConfiguration _contentUpdateFrequency]): Deleted.
2060         (-[WKWebViewConfiguration _setContentUpdateFrequency:]): Deleted.
2061         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
2062         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h:
2063         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
2064         (-[WKOneShotDisplayLinkHandler initWithDrawingAreaProxy:]):
2065         (WebKit::RemoteLayerTreeDrawingAreaProxy::contentUpdateFrequency): Deleted.
2066
2067 2017-01-18  Ryan Haddad  <ryanhaddad@apple.com>
2068
2069         Unreviewed, rolling out r210848.
2070
2071         This change introduced media-related LayoutTest failures and
2072         crashes on macOS.
2073
2074         Reverted changeset:
2075
2076         "[Modern Media Controls] Turn modern media controls on by
2077         default"
2078         https://bugs.webkit.org/show_bug.cgi?id=165668
2079         http://trac.webkit.org/changeset/210848
2080
2081 2017-01-18  Anders Carlsson  <andersca@apple.com>
2082
2083         Add instrumentation for when we fail to receive a message
2084         https://bugs.webkit.org/show_bug.cgi?id=167179
2085
2086         Reviewed by Alexey Proskuryakov.
2087
2088         This will help us diagnose what the error from mach_msg is.
2089
2090         * Platform/IPC/mac/ConnectionMac.mm:
2091         (IPC::readFromMachPort):
2092
2093 2017-01-18  Alex Christensen  <achristensen@webkit.org>
2094
2095         Fix CFURLConnection build on Mac
2096         https://bugs.webkit.org/show_bug.cgi?id=167168
2097
2098         Reviewed by Andy Estes.
2099
2100         * NetworkProcess/Downloads/mac/DownloadMac.mm:
2101         (WebKit::Download::resume):
2102         (WebKit::Download::platformDidFinish):
2103         (WebKit::Download::platformCancelNetworkLoad):
2104         (WebKit::Download::startNetworkLoadWithHandle):
2105         (WebKit::Download::startNetworkLoad):
2106         (WebKit::Download::platformInvalidate):
2107         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
2108         (WebKit::NetworkDataTaskCocoa::allowsSpecificHTTPSCertificateForHost):
2109         (WebKit::serverTrustCredential):
2110         * Shared/Authentication/mac/AuthenticationManager.mac.mm:
2111         (WebKit::AuthenticationManager::tryUseCertificateInfoForChallenge):
2112         * config.h:
2113
2114 2017-01-18  Alex Christensen  <achristensen@webkit.org>
2115
2116         Modernize DelayedReply IPC code
2117         https://bugs.webkit.org/show_bug.cgi?id=167176
2118
2119         Reviewed by Brady Eidson.
2120
2121         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
2122         (WebKit::NetworkConnectionToWebProcess::performSynchronousLoad):
2123         * NetworkProcess/NetworkConnectionToWebProcess.h:
2124         * Platform/IPC/HandleMessage.h:
2125         (IPC::callMemberFunctionImpl):
2126         (IPC::callMemberFunction):
2127         (IPC::handleMessageDelayed):
2128         * Scripts/webkit/messages.py:
2129         (message_to_struct_declaration):
2130         (generate_message_handler):
2131         * UIProcess/Databases/DatabaseProcessProxy.cpp:
2132         (WebKit::DatabaseProcessProxy::getDatabaseProcessConnection):
2133         * UIProcess/Databases/DatabaseProcessProxy.h:
2134         * UIProcess/Network/NetworkProcessProxy.cpp:
2135         (WebKit::NetworkProcessProxy::getNetworkProcessConnection):
2136         (WebKit::NetworkProcessProxy::networkProcessCrashedOrFailedToLaunch):
2137         * UIProcess/Network/NetworkProcessProxy.h:
2138         * UIProcess/Plugins/PluginProcessManager.cpp:
2139         (WebKit::PluginProcessManager::getPluginProcessConnection):
2140         * UIProcess/Plugins/PluginProcessManager.h:
2141         * UIProcess/Plugins/PluginProcessProxy.cpp:
2142         (WebKit::PluginProcessProxy::getPluginProcessConnection):
2143         * UIProcess/Plugins/PluginProcessProxy.h:
2144         * UIProcess/WebPageProxy.cpp:
2145         (WebKit::WebPageProxy::runJavaScriptAlert):
2146         (WebKit::WebPageProxy::runJavaScriptConfirm):
2147         * UIProcess/WebPageProxy.h:
2148         * UIProcess/WebProcessPool.cpp:
2149         (WebKit::WebProcessPool::getNetworkProcessConnection):
2150         (WebKit::WebProcessPool::getDatabaseProcessConnection):
2151         * UIProcess/WebProcessPool.h:
2152         * UIProcess/WebProcessProxy.cpp:
2153         (WebKit::WebProcessProxy::getPluginProcessConnection):
2154         (WebKit::WebProcessProxy::getNetworkProcessConnection):
2155         (WebKit::WebProcessProxy::getDatabaseProcessConnection):
2156         * UIProcess/WebProcessProxy.h:
2157
2158 2017-01-18  Alex Christensen  <achristensen@webkit.org>
2159
2160         Fix CMake build.
2161
2162         * PlatformMac.cmake:
2163
2164 2017-01-18  Megan Gardner  <megan_gardner@apple.com>
2165
2166         Ignore Connection Assertion if we are not using connection to send messages
2167         https://bugs.webkit.org/show_bug.cgi?id=167022
2168
2169         Reviewed by Darin Adler.
2170
2171         Ask the process about a particular connection rather that getting it and making the     
2172         comparison ourselves. 
2173
2174         * UIProcess/ChildProcessProxy.h:
2175         (WebKit::ChildProcessProxy::hasConnection):
2176         Check to see the the ProcessProxy has this particular connection. This get around the assert
2177         that we would run into when just requesting the connection directly.
2178         * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
2179         (WebKit::WebPasteboardProxy::setPasteboardPathnamesForType):
2180         Use the new check instead of getting the raw connection.
2181
2182 2017-01-18  Andreas Kling  <akling@apple.com>
2183
2184         Document::securityOrigin() should return a reference.
2185         <https://webkit.org/b/167124>
2186
2187         Reviewed by Sam Weinig.
2188
2189         * UIProcess/Storage/StorageManager.cpp:
2190         (WebKit::StorageManager::createTransientLocalStorageMap):
2191         * WebProcess/Geolocation/GeolocationPermissionRequestManager.cpp:
2192         (WebKit::GeolocationPermissionRequestManager::startRequestForGeolocation):
2193         * WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp:
2194         (WKBundleFrameCopySecurityOrigin):
2195         * WebProcess/Plugins/PluginView.cpp:
2196         (WebKit::PluginView::storageBlockingStateChanged):
2197         (WebKit::PluginView::performFrameLoadURLRequest):
2198         (WebKit::PluginView::isPrivateBrowsingEnabled):
2199         * WebProcess/Plugins/WebPluginInfoProvider.cpp:
2200         (WebKit::WebPluginInfoProvider::getWebVisiblePluginInfo):
2201         * WebProcess/Storage/StorageAreaMap.cpp:
2202         (WebKit::StorageAreaMap::dispatchSessionStorageEvent):
2203         (WebKit::StorageAreaMap::dispatchLocalStorageEvent):
2204         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2205         (WebKit::WebChromeClient::exceededDatabaseQuota):
2206         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2207         (WebKit::WebFrameLoaderClient::didRunInsecureContent):
2208         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
2209         * WebProcess/WebPage/WebFrame.cpp:
2210         (WebKit::WebFrame::allowsFollowingLink):
2211
2212 2017-01-18  Antoine Quint  <graouts@apple.com>
2213
2214         [Modern Media Controls] Turn modern media controls on by default
2215         https://bugs.webkit.org/show_bug.cgi?id=165668
2216
2217         Reviewed by Dean Jackson.
2218
2219         Use DEFAULT_EXPERIMENTAL_FEATURES_ENABLED as the default value for modern media controls, which is true.
2220
2221         * Shared/WebPreferencesDefinitions.h:
2222
2223 2017-01-15  Darin Adler  <darin@apple.com>
2224
2225         Remove PassRefPtr from "loader" directory of WebCore
2226         https://bugs.webkit.org/show_bug.cgi?id=167055
2227
2228         Reviewed by Alex Christensen.
2229
2230         * Shared/APIWebArchive.h: Use RefPtr&& instead of PassRefPtr.
2231         * Shared/APIWebArchive.mm:
2232         (API::WebArchive::create): Ditto.
2233         (API::WebArchive::WebArchive): Ditto.
2234         (API::WebArchive::subresources): Ditto.
2235         (API::WebArchive::subframeArchives): Ditto.
2236
2237         * Shared/TextCheckerState.h: Initialize data members so classes
2238         using this won't have to explicitly initalize them.
2239
2240         * UIProcess/WebIconDatabase.cpp:
2241         (WebKit::WebIconDatabase::setIconDataForIconURL): Pass a raw
2242         pointer to WebCore.
2243
2244         * UIProcess/WebPageProxy.h: Removed forward declaration of
2245         StringPairVector, not needed here.
2246
2247         * WebProcess/IconDatabase/WebIconDatabaseProxy.cpp:
2248         (WebKit::WebIconDatabaseProxy::WebIconDatabaseProxy): Take a reference.
2249         (WebKit::WebIconDatabaseProxy::retainIconForPageURL): Updated for reference.
2250         (WebKit::WebIconDatabaseProxy::releaseIconForPageURL): Ditto.
2251         (WebKit::WebIconDatabaseProxy::synchronousIconForPageURL): Ditto.
2252         (WebKit::WebIconDatabaseProxy::loadDecisionForIconURL): Ditto.
2253         (WebKit::WebIconDatabaseProxy::receivedIconLoadDecision): Ditto.
2254         (WebKit::WebIconDatabaseProxy::iconDataForIconURL): Ditto.
2255         (WebKit::WebIconDatabaseProxy::setIconURLForPageURL): Ditto.
2256         (WebKit::WebIconDatabaseProxy::setIconDataForIconURL): Ditto.
2257         * WebProcess/IconDatabase/WebIconDatabaseProxy.h: Updated for the above.
2258         Marked the class final, made most functions private and final.
2259
2260         * WebProcess/InjectedBundle/InjectedBundleNavigationAction.cpp:
2261         (WebKit::InjectedBundleNavigationAction::InjectedBundleNavigationAction):
2262         Removed assertion that a pointer is non-null since that pointer is now a
2263         reference. Left use of PassRefPtr here for now.z
2264
2265         * WebProcess/Network/WebLoaderStrategy.cpp:
2266         (WebKit::WebLoaderStrategy::scheduleLoad): Updated since application cache
2267         host is now a reference rather thna a pointer.
2268         * WebProcess/Network/WebResourceLoader.cpp:
2269         (WebKit::WebResourceLoader::willSendRequest): Ditto.
2270         (WebKit::WebResourceLoader::didReceiveResponse): Ditto.
2271         (WebKit::WebResourceLoader::didFailResourceLoad): Ditto.
2272
2273         * WebProcess/Plugins/PluginView.cpp:
2274         (WebKit::buildHTTPHeaders): Got rid of unneeded use of String::format.
2275         (WebKit::PluginView::create): Take a reference instead of PassRefPtr.
2276         (WebKit::PluginView::PluginView): Ditto. Also moved much of the data
2277         member initialization to the class definition.
2278         (WebKit::PluginView::recreateAndInitialize): Take Ref&& instead of PassRefPtr.
2279         (WebKit::PluginView::manualLoadDidReceiveResponse): Updated for change to
2280         ManualStreamState enumeration.
2281         (WebKit::PluginView::manualLoadDidReceiveData): Ditto.
2282         (WebKit::PluginView::manualLoadDidFinishLoading Ditto.):
2283         (WebKit::PluginView::manualLoadDidFail): Ditto.
2284         (WebKit::PluginView::liveResourceData): Return RefPtr insead of PassRefPtr.
2285         (WebKit::PluginView::redeliverManualStream): Updated for ManualStreamState.
2286         * WebProcess/Plugins/PluginView.h: Updated for the above. Also changed
2287         ManualStreamState into an enum class.
2288
2289         * WebProcess/WebCoreSupport/WebChromeClient.cpp: Changed m_page to a reference.
2290         (WebKit::WebChromeClient::runOpenPanel): Take both arguments as references.
2291         * WebProcess/WebCoreSupport/WebChromeClient.h: Updated for the above.
2292
2293         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
2294         (WebKit::WebEditorClient::registerUndoStep): Take reference instead of PassRefPtr.
2295         (WebKit::WebEditorClient::registerRedoStep): Ditto.
2296         * WebProcess/WebCoreSupport/WebEditorClient.h: Updated for the above
2297
2298         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2299         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNewWindowAction):
2300         Updated for change to FrameLoaderClient.
2301         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction): Ditto.
2302         (WebKit::WebFrameLoaderClient::dispatchWillSendSubmitEvent): Ditto.
2303         (WebKit::WebFrameLoaderClient::dispatchWillSubmitForm): Ditto.
2304         (WebKit::WebFrameLoaderClient::createFrame): Ditto.
2305         (WebKit::WebFrameLoaderClient::createPlugin): Ditto.
2306         (WebKit::WebFrameLoaderClient::recreatePlugin): Ditto.
2307         (WebKit::WebFrameLoaderClient::createJavaAppletWidget): Ditto.
2308         (WebKit::WebFrameLoaderClient::createNetworkingContext): Ditto.
2309         (WebKit::WebFrameLoaderClient::didRequestAutocomplete): Ditto.
2310         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h: Updated for the above.
2311
2312         * WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm:
2313         (WebKit::WebChromeClient::didReceiveMobileDocType): Updated since m_page is a
2314         reference now.
2315         (WebKit::WebChromeClient::observedContentChange): Ditto.
2316         (WebKit::WebChromeClient::notifyRevealedSelectionByScrollingFrame): Ditto.
2317         (WebKit::WebChromeClient::didLayout): Ditto.
2318         (WebKit::WebChromeClient::didStartOverflowScroll): Ditto.
2319         (WebKit::WebChromeClient::didEndOverflowScroll): Ditto.
2320         (WebKit::WebChromeClient::hasStablePageScaleFactor): Ditto.
2321         (WebKit::WebChromeClient::showPlaybackTargetPicker): Ditto.
2322         (WebKit::WebChromeClient::eventThrottlingDelay): Ditto.
2323         (WebKit::WebChromeClient::deviceOrientation): Ditto.
2324
2325         * WebProcess/WebPage/WebPage.cpp:
2326         (WebKit::WebPage::WebPage): Pass reference.
2327         (WebKit::WebPage::createPlugin): Return RefPtr instead of PassRefPtr.
2328         (WebKit::WebPage::fromCorePage): Updated for change to WebChromeClient.
2329         (WebKit::WebPage::setHeaderPageBanner): Take pointer instead of PassRefPtr.
2330         (WebKit::WebPage::setFooterPageBanner): Ditto.
2331         (WebKit::WebPage::setActiveOpenPanelResultListener): Take Ref&& instead of
2332         PassRefPtr.
2333         (WebKit::WebPage::currentSelectionAsRange): Return RefPtr instead of PassRefPtr.
2334         (WebKit::WebPage::rangeFromEditingRange): Ditto.
2335         * WebProcess/WebPage/WebPage.h: Updated for the above.
2336
2337         * WebProcess/WebPage/efl/WebPageEfl.cpp:
2338         (WebKit::WebPage::cachedResponseDataForURL): Return RefPtr instead of PassRefPtr.
2339         * WebProcess/WebPage/gtk/WebPageGtk.cpp:
2340         (WebKit::WebPage::cachedResponseDataForURL): Ditto.
2341         * WebProcess/WebPage/ios/WebPageIOS.mm:
2342         (WebKit::WebPage::cachedResponseDataForURL): Ditto.
2343         * WebProcess/WebPage/mac/WebPageMac.mm:
2344         (WebKit::WebPage::cachedResponseDataForURL): Ditto.
2345         (WebKit::WebPage::setTopOverhangImage): Take raw pointer instead of PassRefPtr.
2346         (WebKit::WebPage::setBottomOverhangImage): Ditto.
2347
2348         * WebProcess/WebProcess.cpp:
2349         (WebKit::WebProcess::WebProcess): Pass a reference. Move most initialization to
2350         the class definition.
2351         * WebProcess/WebProcess.h: Updaed for the above.
2352
2353 2017-01-17  Michael Catanzaro  <mcatanzaro@igalia.com>
2354
2355         Unreviewed, rolling out r210834
2356         https://bugs.webkit.org/show_bug.cgi?id=165668
2357
2358         It introduced dozens of test timeouts.
2359
2360         Reverted changeset:
2361         "[Modern Media Controls] Turn modern media controls on by default"
2362         https://bugs.webkit.org/show_bug.cgi?id=165668
2363         http://trac.webkit.org/changeset/210834
2364
2365 2017-01-17  Antti Koivisto  <antti@apple.com>
2366
2367         Persist derived data
2368         https://bugs.webkit.org/show_bug.cgi?id=167136
2369
2370         Reviewed by Andreas Kling.
2371
2372         Add a mechanism for storing arbitrary data into disk cache.
2373
2374         From WebCore level data can be stored using
2375
2376             loaderStrategy()->storeDerivedDataToCache(key, partition, type, data);
2377
2378         The data is keyed with the body hash of a network resource. It can be retrieved along
2379         with the resource by specifying the type in ResourceLoaderOptions. If a related data
2380         blob is found it will be deliver via CachedResource::didRetrieveDerivedDataFromCache()
2381         callback.
2382
2383         This patch adds the mechanism but doesn't yet use it for anything.
2384
2385         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
2386         (WebKit::NetworkConnectionToWebProcess::storeDerivedDataToCache):
2387         * NetworkProcess/NetworkConnectionToWebProcess.h:
2388         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
2389         * NetworkProcess/NetworkResourceLoadParameters.cpp:
2390         (WebKit::NetworkResourceLoadParameters::encode):
2391         (WebKit::NetworkResourceLoadParameters::decode):
2392         * NetworkProcess/NetworkResourceLoadParameters.h:
2393         * NetworkProcess/NetworkResourceLoader.cpp:
2394         (WebKit::NetworkResourceLoader::didRetrieveCacheEntry):
2395
2396             Look for related resources to return if needed.
2397
2398         (WebKit::NetworkResourceLoader::sendResultForCacheEntry):
2399         * NetworkProcess/NetworkResourceLoader.h:
2400         * NetworkProcess/cache/NetworkCache.cpp:
2401         (WebKit::NetworkCache::resourceType):
2402          (WebKit::NetworkCache::Cache::retrieveData):
2403         (WebKit::NetworkCache::Cache::storeData):
2404         (WebKit::NetworkCache::Cache::makeCacheKey): Deleted.
2405         * NetworkProcess/cache/NetworkCache.h:
2406         * NetworkProcess/cache/NetworkCacheEntry.cpp:
2407         (WebKit::NetworkCache::Entry::encodeAsStorageRecord):
2408         (WebKit::NetworkCache::Entry::decodeStorageRecord):
2409         * NetworkProcess/cache/NetworkCacheKey.cpp:
2410         (WebKit::NetworkCache::Key::Key):
2411         * NetworkProcess/cache/NetworkCacheKey.h:
2412         (WebKit::NetworkCache::DataKey::encode):
2413         (WebKit::NetworkCache::DataKey::decode):
2414         * NetworkProcess/cache/NetworkCacheStorage.cpp:
2415         (WebKit::NetworkCache::Storage::readRecord):
2416         (WebKit::NetworkCache::Storage::traverse):
2417         * NetworkProcess/cache/NetworkCacheStorage.h:
2418
2419             Return body hash with the Record.
2420
2421         * NetworkProcess/cache/NetworkCacheSubresourcesEntry.cpp:
2422         (WebKit::NetworkCache::SubresourcesEntry::encodeAsStorageRecord):
2423         * Platform/IPC/ArgumentCoders.cpp:
2424         (IPC::ArgumentCoder<SHA1::Digest>::encode):
2425         (IPC::ArgumentCoder<SHA1::Digest>::decode):
2426         * Platform/IPC/ArgumentCoders.h:
2427         * WebProcess/Network/WebLoaderStrategy.cpp:
2428         (WebKit::WebLoaderStrategy::scheduleLoad):
2429         (WebKit::WebLoaderStrategy::storeDerivedDataToCache):
2430         * WebProcess/Network/WebLoaderStrategy.h:
2431         * WebProcess/Network/WebResourceLoader.cpp:
2432         (WebKit::WebResourceLoader::didRetrieveDerivedData):
2433         * WebProcess/Network/WebResourceLoader.h:
2434         * WebProcess/Network/WebResourceLoader.messages.in:
2435
2436 2017-01-17  Antoine Quint  <graouts@apple.com>
2437
2438         [Modern Media Controls] Turn modern media controls on by default
2439         https://bugs.webkit.org/show_bug.cgi?id=165668
2440
2441         Reviewed by Dean Jackson.
2442
2443         Use DEFAULT_EXPERIMENTAL_FEATURES_ENABLED as the default value for modern media controls, which is true.
2444
2445         * Shared/WebPreferencesDefinitions.h:
2446
2447 2017-01-17  Joseph Pecoraro  <pecoraro@apple.com>
2448
2449         ENABLE(USER_TIMING) Not Defined for Apple Windows or OS X Ports
2450         https://bugs.webkit.org/show_bug.cgi?id=116551
2451         <rdar://problem/13949830>
2452
2453         Reviewed by Alex Christensen.
2454
2455         * Configurations/FeatureDefines.xcconfig:
2456
2457 2017-01-17  Filip Pizlo  <fpizlo@apple.com>
2458
2459         JSCell::classInfo() shouldn't have a bunch of mitigations for being called during destruction
2460         https://bugs.webkit.org/show_bug.cgi?id=167066
2461
2462         Reviewed by Keith Miller and Michael Saboff.
2463         
2464         Just remove now-erroneous use of jsCast<>.
2465
2466         * WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp:
2467         (WebKit::NPRuntimeObjectMap::finalize):
2468
2469 2017-01-17  Joseph Pecoraro  <pecoraro@apple.com>
2470
2471         Remove unnecessary includes
2472         https://bugs.webkit.org/show_bug.cgi?id=167114
2473
2474         Reviewed by Alex Christensen.
2475
2476         * WebProcess/WebPage/ios/WebPageIOS.mm:
2477
2478 2017-01-17  Brady Eidson  <beidson@apple.com>
2479
2480         An update to one gamepad's values should only change that gamepad's modified timestamp.
2481         <rdar://problem/28620865> and https://bugs.webkit.org/show_bug.cgi?id=167139
2482
2483         Reviewed by Andy Estes.
2484
2485         Track the lastModifiedTime for a gamepad in the UI process, and pass it along to web processes.
2486
2487         * Shared/Gamepad/GamepadData.cpp:
2488         (WebKit::GamepadData::GamepadData):
2489         (WebKit::GamepadData::encode):
2490         (WebKit::GamepadData::decode):
2491         * Shared/Gamepad/GamepadData.h:
2492         (WebKit::GamepadData::lastUpdateTime):
2493
2494         * UIProcess/Gamepad/UIGamepad.cpp:
2495         (WebKit::UIGamepad::UIGamepad):
2496         (WebKit::UIGamepad::updateFromPlatformGamepad):
2497         (WebKit::UIGamepad::condensedGamepadData):
2498         (WebKit::UIGamepad::fullGamepadData):
2499         * UIProcess/Gamepad/UIGamepad.h:
2500
2501         * WebProcess/Gamepad/WebGamepad.cpp:
2502         (WebKit::WebGamepad::updateValues):
2503
2504 2017-01-17  Anders Carlsson  <andersca@apple.com>
2505
2506         It's not possible to perform a POST request with HTTPBody content in a WKWebView
2507         https://bugs.webkit.org/show_bug.cgi?id=167131
2508         rdar://problem/20464240
2509
2510         Reviewed by Beth Dakin.
2511
2512         Encode/decode the form data if necessary.
2513
2514         * Shared/LoadParameters.cpp:
2515         (WebKit::LoadParameters::encode):
2516         (WebKit::LoadParameters::decode):
2517
2518 2017-01-17  Joseph Pecoraro  <pecoraro@apple.com>
2519
2520         Crash when closing tab with debugger paused
2521         https://bugs.webkit.org/show_bug.cgi?id=161746
2522         <rdar://problem/15607819>
2523
2524         Reviewed by Brian Burg and Brent Fulgham.
2525
2526         * WebProcess/WebPage/WebPage.cpp:
2527         (WebKit::DeferredPageDestructor::createDeferredPageDestructor):
2528         (WebKit::DeferredPageDestructor::DeferredPageDestructor):
2529         (WebKit::DeferredPageDestructor::tryDestruction):
2530         (WebKit::WebPage::close):
2531         Defer destruction of the Page and WebPage if we are in a nested runloop.
2532         Also, proactively close all inspector frontends, including remote frontends.
2533
2534         * WebProcess/WebPage/ios/WebPageIOS.mm:
2535         (WebKit::WebPage::handleSyntheticClick):
2536         (WebKit::WebPage::completeSyntheticClick):
2537         Return early in some cases where a nested run loop may have closed
2538         the WebPage on us while handling JavaScript events.
2539
2540 2017-01-16  Joseph Pecoraro  <pecoraro@apple.com>
2541
2542         Remove the REQUEST_ANIMATION_FRAME flag
2543         https://bugs.webkit.org/show_bug.cgi?id=156980
2544         <rdar://problem/25906849>
2545
2546         Reviewed by Simon Fraser.
2547
2548         * Configurations/FeatureDefines.xcconfig:
2549         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2550         * WebProcess/WebCoreSupport/WebChromeClient.h:
2551         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
2552         (WebKit::CompositingCoordinator::syncDisplayState):
2553         (WebKit::CompositingCoordinator::nextAnimationServiceTime):
2554         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h:
2555         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
2556         (WebKit::CoordinatedLayerTreeHost::scheduleAnimation):
2557         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h:
2558         * WebProcess/WebPage/LayerTreeHost.h:
2559
2560 2017-01-16  Carlos Garcia Campos  <cgarcia@igalia.com>
2561
2562         [SOUP] Accept-language could be set twice in a row for the default context
2563         https://bugs.webkit.org/show_bug.cgi?id=167089
2564
2565         Reviewed by Žan Doberšek.
2566
2567         * NetworkProcess/CustomProtocols/soup/CustomProtocolManagerSoup.cpp:
2568         (WebKit::CustomProtocolManager::registerScheme): Use NetworkStorageSession::getOrCreateSoupNetworkSession().
2569         * NetworkProcess/efl/NetworkProcessMainEfl.cpp:
2570         * NetworkProcess/soup/NetworkProcessSoup.cpp:
2571         (WebKit::NetworkProcess::userPreferredLanguagesChanged): Only set the languages if NetworkStorageSession has a
2572         SoupNetworkSession.
2573         * NetworkProcess/soup/NetworkSessionSoup.cpp:
2574         (WebKit::NetworkSessionSoup::soupSession): Use NetworkStorageSession::getOrCreateSoupNetworkSession().
2575         * WebProcess/Cookies/soup/WebCookieManagerSoup.cpp:
2576         (WebKit::WebCookieManager::setCookiePersistentStorage): Ditto.
2577         * WebProcess/efl/WebProcessMainEfl.cpp:
2578
2579 2017-01-16  Carlos Garcia Campos  <cgarcia@igalia.com>
2580
2581         [SOUP] Fix handling of accept language property
2582         https://bugs.webkit.org/show_bug.cgi?id=166969
2583
2584         Reviewed by Michael Catanzaro.
2585
2586         * NetworkProcess/soup/NetworkProcessSoup.cpp:
2587         (WebKit::buildAcceptLanguages): Moved from WebCore.
2588         (WebKit::NetworkProcess::userPreferredLanguagesChanged): Build the accept language string from the vector and
2589         pass set it to SoupNetworkSession to be used for new sessions, and also to all other existing sessions.
2590
2591 2017-01-14  Tim Horton  <timothy_horton@apple.com>
2592
2593         Remove unused WKView initializer parameter
2594         https://bugs.webkit.org/show_bug.cgi?id=167046
2595
2596         Reviewed by Dan Bernstein.
2597
2598         * UIProcess/API/mac/WKView.mm:
2599         (-[WKView initWithFrame:processPool:configuration:]):
2600         (-[WKView initWithFrame:contextRef:pageGroupRef:relatedToPage:]):
2601         (-[WKView initWithFrame:configurationRef:]):
2602         (-[WKView initWithFrame:processPool:configuration:webView:]): Deleted.
2603         * UIProcess/API/mac/WKViewInternal.h:
2604         Ever since WKWebView stopped having WKView inside it, this parameter
2605         has never been used. Now, it only leads to confusion.
2606
2607 2017-01-13  Joseph Pecoraro  <pecoraro@apple.com>
2608
2609         Remove ENABLE(DETAILS_ELEMENT) guards
2610         https://bugs.webkit.org/show_bug.cgi?id=167042
2611
2612         Reviewed by Alex Christensen.
2613
2614         * Configurations/FeatureDefines.xcconfig:
2615
2616 2017-01-13  Brady Eidson  <beidson@apple.com>
2617
2618         Crash when visiting a webpage that uses Gamepads in a new WebProcess after a previous page has used gamepads..
2619         https://bugs.webkit.org/show_bug.cgi?id=167033
2620
2621         Reviewed by Alex Christensen.
2622
2623         * UIProcess/Gamepad/UIGamepadProvider.cpp:
2624         (WebKit::UIGamepadProvider::processPoolStartedUsingGamepads): Don't schedule a state update here.
2625         (WebKit::UIGamepadProvider::processPoolStoppedUsingGamepads): Ditto.
2626         * UIProcess/Gamepad/UIGamepadProvider.h:
2627         
2628         * UIProcess/WebProcessPool.cpp:
2629         (WebKit::WebProcessPool::startedUsingGamepads): Populate the WebProcess with initial gamepads.
2630
2631 2017-01-11  Darin Adler  <darin@apple.com>
2632
2633         Remove PassRefPtr from more of "platform"
2634         https://bugs.webkit.org/show_bug.cgi?id=166809
2635
2636         Reviewed by Sam Weinig.
2637
2638         * Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.cpp:
2639         (IPC::ArgumentCoder<TextureMapperAnimation>::encode): Updated since timing function
2640         returns a raw pointer.
2641         (IPC::ArgumentCoder<TextureMapperAnimation>::decode): Updated since timing function
2642         setters now takes an rvalue reference.
2643
2644         * WebProcess/Plugins/PDF/DeprecatedPDFPlugin.mm:
2645         (WebKit::PDFPlugin::createScrollbar): Updated since addChild now takes a reference.
2646
2647 2017-01-13  Chris Dumez  <cdumez@apple.com>
2648
2649         [WK2] Add diagnostic logging to measure WebGL usage
2650         https://bugs.webkit.org/show_bug.cgi?id=166730
2651         <rdar://problem/29883469>
2652
2653         Reviewed by Alex Christensen.
2654
2655         Add diagnostic logging to measure high performance WebGL usage. We report
2656         at regular intervals in which WebGL state Safari is:
2657         - Inactive
2658         - ActiveInForegroundTab
2659         - ActiveInBackgroundTabOnly
2660
2661         This should give us an estimate of:
2662         - What % of the time is Safari using high performance graphics
2663         - What % of this time is only due to background tabs
2664
2665         * UIProcess/HighPerformanceGraphicsUsageSampler.cpp: Added.
2666         (WebKit::HighPerformanceGraphicsUsageSampler::HighPerformanceGraphicsUsageSampler):
2667         (WebKit::HighPerformanceGraphicsUsageSampler::timerFired):
2668         * UIProcess/HighPerformanceGraphicsUsageSampler.h: Copied from Source/WebCore/platform/graphics/GraphicsContext3DAttributes.h.
2669         * UIProcess/WebPageProxy.h:
2670         (WebKit::WebPageProxy::setIsUsingHighPerformanceWebGL):
2671         (WebKit::WebPageProxy::isUsingHighPerformanceWebGL):
2672         * UIProcess/WebPageProxy.messages.in:
2673         * UIProcess/WebProcessPool.cpp:
2674         (WebKit::m_highPerformanceGraphicsUsageSampler):
2675         * UIProcess/WebProcessPool.h:
2676         * WebKit2.xcodeproj/project.pbxproj:
2677         * WebProcess/WebPage/WebPage.cpp:
2678         (WebKit::m_userInterfaceLayoutDirection):
2679
2680 2017-01-13  Matt Rajca  <mrajca@apple.com>
2681
2682         Defer use of autoplay heuristics to clients
2683         https://bugs.webkit.org/show_bug.cgi?id=167010
2684
2685         Reviewed by Alex Christensen.
2686
2687         Switch the autoplay policy tristate to an on/off option since clients should run any
2688         heuristics and simply send their final decision to WebKit.
2689
2690         * Shared/WebsitePolicies.h:
2691         (WebKit::WebsitePolicies::encode):
2692         (WebKit::WebsitePolicies::decode):
2693         * UIProcess/API/APIWebsitePolicies.h:
2694         * UIProcess/API/C/WKWebsitePolicies.cpp:
2695         (WKWebsitePoliciesGetAutoplayEnabled):
2696         (WKWebsitePoliciesSetAutoplayEnabled):
2697         (WKWebsitePoliciesGetAutoplayPolicy): Replaced.
2698         (WKWebsitePoliciesSetAutoplayPolicy): Replaced.
2699         * UIProcess/API/C/WKWebsitePolicies.h:
2700         * UIProcess/API/Cocoa/_WKWebsitePolicies.h:
2701         * UIProcess/API/Cocoa/_WKWebsitePolicies.mm:
2702         (-[_WKWebsitePolicies setAutoplayEnabled:]):
2703         (-[_WKWebsitePolicies autoplayEnabled]):
2704         (-[_WKWebsitePolicies setAutoplayPolicy:]): Replaced.
2705         (-[_WKWebsitePolicies autoplayPolicy]): Replaced.
2706
2707 2017-01-13  Carlos Garcia Campos  <cgarcia@igalia.com>
2708
2709         [SOUP] Simplify cookie storage handling
2710         https://bugs.webkit.org/show_bug.cgi?id=166967
2711
2712         Reviewed by Sergio Villar Senin.
2713
2714         Get the SoupSession from NetworkStorageSession::defaultStorageSession().
2715
2716         * NetworkProcess/CustomProtocols/soup/CustomProtocolManagerSoup.cpp:
2717         (WebKit::CustomProtocolManager::registerScheme): Get the SoupSession from NetworkStorageSession::defaultStorageSession().
2718         * NetworkProcess/efl/NetworkProcessMainEfl.cpp: Ditto.
2719         * NetworkProcess/soup/NetworkProcessSoup.cpp:
2720         (WebKit::NetworkProcess::userPreferredLanguagesChanged): Ditto.
2721         (WebKit::NetworkProcess::platformInitializeNetworkProcess): SoupNetworkSession::clearOldSoupCache is static.
2722         * WebProcess/Cookies/soup/WebCookieManagerSoup.cpp:
2723         (WebKit::WebCookieManager::platformGetHTTPCookieAcceptPolicy): Use the cookie storage from NetworkStorageSession::defaultStorageSession().
2724         (WebKit::WebCookieManager::setCookiePersistentStorage): Ditto.
2725         * WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.cpp:
2726         (WebKit::WebFrameNetworkingContext::setCookieAcceptPolicyForAllContexts): Ditto.
2727         * WebProcess/efl/WebProcessMainEfl.cpp:
2728
2729 2017-01-12  Carlos Garcia Campos  <cgarcia@igalia.com>
2730
2731         [SOUP] Do not use the legacy session ID in WebFrameNetworkingContext::storageSession()
2732         https://bugs.webkit.org/show_bug.cgi?id=166970
2733
2734         Reviewed by Sergio Villar Senin.
2735
2736         Get the session for the current page instead.
2737
2738         * WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.cpp:
2739         (WebKit::WebFrameNetworkingContext::storageSession):
2740
2741 2017-01-12  Joseph Pecoraro  <pecoraro@apple.com>
2742
2743         Remove unnecessary includes of Page.h
2744         https://bugs.webkit.org/show_bug.cgi?id=166996
2745
2746         Reviewed by Yusuke Suzuki.
2747
2748         * WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp:
2749
2750 2017-01-12  Chris Dumez  <cdumez@apple.com>
2751
2752         Add KEYBOARD_KEY_ATTRIBUTE / KEYBOARD_CODE_ATTRIBUTE to FeatureDefines.xcconfig
2753         https://bugs.webkit.org/show_bug.cgi?id=166995
2754
2755         Reviewed by Jer Noble.
2756
2757         Add KEYBOARD_KEY_ATTRIBUTE / KEYBOARD_CODE_ATTRIBUTE to FeatureDefines.xcconfig
2758         as some people are having trouble building without it.
2759
2760         * Configurations/FeatureDefines.xcconfig:
2761         * Shared/WebKeyboardEvent.cpp:
2762         (WebKit::WebKeyboardEvent::WebKeyboardEvent):
2763
2764 2017-01-12  Chris Dumez  <cdumez@apple.com>
2765
2766         [iOS] HTML form validation popover sometimes does not go away
2767         https://bugs.webkit.org/show_bug.cgi?id=166990
2768         <rdar://problem/29985957>
2769
2770         Reviewed by Tim Horton.
2771
2772         Update code using ValidationBubble now that it is RefCounted.
2773
2774         * UIProcess/PageClient.h:
2775         * UIProcess/WebPageProxy.h:
2776         * UIProcess/ios/PageClientImplIOS.h:
2777         * UIProcess/ios/PageClientImplIOS.mm:
2778         (WebKit::PageClientImpl::createValidationBubble):
2779         * UIProcess/mac/PageClientImpl.h:
2780         * UIProcess/mac/PageClientImpl.mm:
2781         (WebKit::PageClientImpl::createValidationBubble):
2782
2783 2017-01-12  Enrica Casucci  <enrica@apple.com>
2784
2785         Do not allow selection of editable content when not editing.
2786         https://bugs.webkit.org/show_bug.cgi?id=166897
2787         <rdar://problem/29388806>
2788
2789         Reviewed by Tim Horton.
2790
2791         Test: fast/events/touch/ios/long-press-on-editable.html
2792
2793         When retrieving the position information, we should not consider
2794         as candidates for selection editable elements, since this is only
2795         used for non editable selections.
2796
2797         * WebProcess/WebPage/ios/WebPageIOS.mm:
2798         (WebKit::isAssistableElement): Moved within the file.
2799         (WebKit::WebPage::getPositionInformation):
2800
2801 2017-01-12  Megan Gardner  <megan_gardner@apple.com>
2802
2803         Double Check URLs on UI side before putting in pasteboard
2804         https://bugs.webkit.org/show_bug.cgi?id=166945
2805         <rdar://problem/11187315>
2806
2807         Reviewed by Tim Horton.
2808
2809         Check URLs sent from the web process before putting the on pasteboard.
2810
2811         * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
2812         (WebKit::WebPasteboardProxy::setPasteboardPathnamesForType):
2813         Add a check to make sure the URLs we've received are valid and not compromising to the user's system.
2814
2815         * UIProcess/WebPasteboardProxy.cpp:
2816         (WebKit::WebPasteboardProxy::addWebProcessProxy):
2817         Keep track of the webProcesses associated with the pasteboard proxies specifically, so that we can
2818         use it to check the URLs before putting them on pasteboard.
2819         (WebKit::WebPasteboardProxy::removeWebProcessProxy):
2820         Remove dead webProcesses.
2821
2822         * UIProcess/WebPasteboardProxy.h:
2823         * UIProcess/WebPasteboardProxy.messages.in:
2824         Allow for the connection to be passed in, so that we can determine which webProcess we need to
2825         check the URLs of.
2826
2827         * UIProcess/WebProcessProxy.cpp:
2828         (WebKit::WebProcessProxy::~WebProcessProxy):
2829         Make sure to remove WebProcessProxys from the list stored in WebPasteboardProxy
2830
2831 2017-01-12  Chris Dumez  <cdumez@apple.com>
2832
2833         [iOS] Implement support for KeyboardEvent.code
2834         https://bugs.webkit.org/show_bug.cgi?id=166932
2835         <rdar://problem/29972518>
2836
2837         Reviewed by Darin Adler.
2838
2839         Make sure KeyboardEvent.code is properly initialized on
2840         iOS WK2.
2841
2842         * Shared/WebEvent.h:
2843         * Shared/WebKeyboardEvent.cpp:
2844         (WebKit::WebKeyboardEvent::WebKeyboardEvent):
2845         * Shared/ios/WebIOSEventFactory.mm:
2846         (WebIOSEventFactory::createWebKeyboardEvent):
2847
2848 2017-01-12  Andreas Kling  <akling@apple.com>
2849
2850         WebBackForwardListProxy should remove restored session history items from PageCache on close.
2851         <https://webkit.org/b/166972>
2852         <rdar://problem/28904157>
2853
2854         Reviewed by Brady Eidson.
2855
2856         Register history item ID's from the UIProcess with the associated-items map
2857         so that we can remove any PageCache entries associated with them immediately
2858         when closing a WebPage.
2859
2860         Otherwise they might not get removed until the next PageCache pruning happens.
2861         This patch is a speculative fix for what looks like it might be weirdness
2862         related to a PageCache entry outliving its originating Page.
2863
2864         * WebProcess/WebPage/WebBackForwardListProxy.cpp:
2865         (WebKit::WebBackForwardListProxy::addItemFromUIProcess):
2866         * WebProcess/WebPage/WebBackForwardListProxy.h:
2867         * WebProcess/WebPage/WebPage.cpp:
2868         (WebKit::WebPage::restoreSessionInternal):
2869
2870 2017-01-12  Michael Catanzaro  <mcatanzaro@igalia.com>
2871
2872         [GTK] Correct license on WebKitSecurityOrigin headers
2873
2874         These ought to be LGPLv2+, because the rest of the GTK+ API is LPGLv2+.
2875
2876         * UIProcess/API/gtk/WebKitSecurityOrigin.cpp:
2877         * UIProcess/API/gtk/WebKitSecurityOrigin.h:
2878         * UIProcess/API/gtk/WebKitSecurityOriginPrivate.h:
2879
2880 2017-01-12  Eric Carlson  <eric.carlson@apple.com>
2881
2882         [MediaStream, Mac] Render media stream audio buffers
2883         https://bugs.webkit.org/show_bug.cgi?id=159836
2884         <rdar://problem/27380390>
2885
2886         Unreviewed, revert accidental change.
2887
2888         * WebProcess/com.apple.WebProcess.sb.in:
2889
2890 2017-01-11  Brady Eidson  <beidson@apple.com>
2891
2892         Add IconLoadingDelegate functionality to WKView.
2893         https://bugs.webkit.org/show_bug.cgi?id=166951
2894
2895         Reviewed by Tim Horton.
2896         
2897         * UIProcess/API/mac/WKView.mm:
2898         (-[WKView dealloc]):
2899         (-[WKView maybeInstallIconLoadingClient]): If the subclass implements the delegate method, install the
2900           icon loading client. Otherwise, maintain the normal IconDatabase loading behavior.
2901         (-[WKView initWithFrame:processPool:configuration:webView:]):
2902
2903 2017-01-11  Brent Fulgham  <bfulgham@apple.com>
2904
2905         [WK2][Cocoa] Avoid null dereference in FullScreen code.
2906         https://bugs.webkit.org/show_bug.cgi?id=166957
2907         <rdar://problem/27745004>
2908
2909         Reviewed by Eric Carlson.
2910
2911         * WebProcess/cocoa/WebVideoFullscreenManager.mm:
2912         (WebKit::WebVideoFullscreenManager::didSetupFullscreen): Use protected reference to 'this', and check for valid
2913         page before attempting to use it.
2914
2915 2017-01-11  Anders Carlsson  <andersca@apple.com>
2916
2917         navigator.plugins.refresh and WKContextRefreshPlugIns doesn't pick up changes to already-present plug-ins
2918         https://bugs.webkit.org/show_bug.cgi?id=166942
2919         rdar://problem/29839194
2920
2921         Reviewed by Sam Weinig.
2922
2923         Use _CFBundleCreateUnique so the resulting bundle won't be cached.
2924
2925         * Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm:
2926         (WebKit::NetscapePluginModule::getPluginInfo):
2927
2928 2017-01-11  Anders Carlsson  <andersca@apple.com>
2929
2930         REGRESSION: Crash in com.apple.WebKit: IPC::Connection::sendMessage(std::__1::unique_ptr<IPC::MachMessage, std::__1::default_delete<IPC::MachMessage> >) + 27
2931         https://bugs.webkit.org/show_bug.cgi?id=165854
2932         rdar://problem/29757269
2933
2934         Reviewed by Tim Horton.
2935
2936         * Platform/IPC/mac/ConnectionMac.mm:
2937         (IPC::Connection::sendMessage):
2938         Add assertion.
2939
2940         (IPC::Connection::initializeSendSource):
2941         Turns out the event handler can be called spuriously, so guard against that.
2942
2943 2017-01-11  Chris Dumez  <cdumez@apple.com>
2944
2945         [iOS][WK2] KeyboardEvent.key always returns an empty string
2946         https://bugs.webkit.org/show_bug.cgi?id=166918
2947         <rdar://problem/29861147>
2948
2949         Reviewed by Wenson Hsieh.
2950
2951         Make sure that KeyboardEvent.key gets properly initialized on iOS / WK2.
2952
2953         * Shared/WebEvent.h:
2954         * Shared/WebKeyboardEvent.cpp:
2955         (WebKit::WebKeyboardEvent::WebKeyboardEvent):
2956         * Shared/ios/WebIOSEventFactory.mm:
2957         (WebIOSEventFactory::createWebKeyboardEvent):
2958
2959 2017-01-10  Michael Catanzaro  <mcatanzaro@igalia.com>
2960
2961         [GTK] No way for applications to set notification permissions without waiting for permission request
2962         https://bugs.webkit.org/show_bug.cgi?id=163366
2963
2964         Reviewed by Carlos Garcia Campos.
2965
2966         Websites can check the Notification.permission DOM property to check if they have permission
2967         to show notifications *without triggering a permission request*. But the WebKitGTK+ API has
2968         no way to affirmatively indicate notifications are allowed without a permission request. The
2969         only way is via the permission request API, which is too late. It's a problem for Epiphany.
2970         For example, open the Riot Matrix client in a web app; you will immediately see an info bar
2971         informing the user that Riot does not have permission to send desktop notifications, even
2972         though Epiphany automatically grants notification permission in web app mode when requested.
2973         This problem is not exclusive to web apps; there is simply no way for notification
2974         permission to be set correctly prior to a permission request for it. Fix this by introducing
2975         a webkit_web_context_initialize_notification_permissions() API, and add a signal
2976         WebKitWebContext::initialize-notification-permissions to indicate when it should be called.
2977
2978         * UIProcess/API/gtk/WebKitNotificationProvider.cpp:
2979         (notificationPermissionsCallback):
2980         (WebKitNotificationProvider::create):
2981         (WebKitNotificationProvider::WebKitNotificationProvider):
2982         (WebKitNotificationProvider::notificationPermissions):
2983         (WebKitNotificationProvider::setNotificationPermissions):
2984         * UIProcess/API/gtk/WebKitNotificationProvider.h:
2985         * UIProcess/API/gtk/WebKitSecurityOrigin.cpp:
2986         (webkitSecurityOriginGetSecurityOrigin):
2987         * UIProcess/API/gtk/WebKitSecurityOriginPrivate.h:
2988         * UIProcess/API/gtk/WebKitWebContext.cpp:
2989         (webkitWebContextConstructed):
2990         (webkit_web_context_class_init):
2991         (addOriginToMap):
2992         (webkit_web_context_initialize_notification_permissions):
2993         (webkitWebContextInitializeNotificationPermissions):
2994         * UIProcess/API/gtk/WebKitWebContext.h:
2995         * UIProcess/API/gtk/WebKitWebContextPrivate.h:
2996         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
2997
2998 2017-01-10  Keith Rollin  <krollin@apple.com>
2999
3000         Record/replay: fix range used for fuzzy matching
3001         https://bugs.webkit.org/show_bug.cgi?id=166041
3002
3003         Reviewed by Darin Adler and Alex Christensen.
3004
3005         Because of two bugs, the attempt to determine the range of URLs to
3006         check as part of the process of fuzzy matching was failing. The intent
3007         was to find the range of URLs that started with the same
3008         <scheme://host:port> as a given URL. However, because of a reversed
3009         test, the upper end of the range ended up being the "end()" iterator
3010         of the entire collection of URLs. With that fixed, there was another
3011         bug due to one URL being given as <scheme://host:port> and the other
3012         given as <scheme://host:port/> (note the trailing slash). Both of
3013         these issues are now fixed.
3014
3015         * NetworkProcess/capture/NetworkCaptureManager.cpp:
3016         (WebKit::NetworkCapture::Manager::initialize):
3017         (WebKit::NetworkCapture::Manager::findBestFuzzyMatch):
3018         (WebKit::NetworkCapture::Manager::urlIdentifyingCommonDomain):
3019         * NetworkProcess/capture/NetworkCaptureManager.h:
3020         * NetworkProcess/capture/NetworkCaptureResource.cpp:
3021         (WebKit::NetworkCapture::Resource::url):
3022         (WebKit::NetworkCapture::Resource::urlIdentifyingCommonDomain):
3023         (WebKit::NetworkCapture::Resource::baseURL): Deleted.
3024         * NetworkProcess/capture/NetworkCaptureResource.h:
3025
3026 2017-01-10  Wenson Hsieh  <wenson_hsieh@apple.com>
3027
3028         Implement "proximity" scroll snapping
3029         https://bugs.webkit.org/show_bug.cgi?id=135994
3030         <rdar://problem/18162418>
3031
3032         Reviewed by Dean Jackson.
3033
3034         Adds boilerplate support for plumbing lists of snap offset ranges from the web process to the UI process
3035         alongside the list of snap offsets.
3036
3037         * Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp:
3038         (ArgumentCoder<ScrollingStateScrollingNode>::encode):
3039         (ArgumentCoder<ScrollingStateScrollingNode>::decode):
3040         * Shared/WebCoreArgumentCoders.cpp:
3041         (IPC::ArgumentCoder<ScrollOffsetRange<float>>::encode):
3042         (IPC::ArgumentCoder<ScrollOffsetRange<float>>::decode):
3043         * Shared/WebCoreArgumentCoders.h:
3044         * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:
3045         (-[WKOverflowScrollViewDelegate scrollViewWillEndDragging:withVelocity:targetContentOffset:]):
3046         * UIProcess/ios/RemoteScrollingCoordinatorProxyIOS.mm:
3047
3048         Adjust mainframe proximity scroll snapping logic to not subtract out the top content inset when there is no
3049         active snap offset (i.e. when snapping rests in a snap offset range). Attempting to subtract out the top inset
3050         in this case caused the scroll offset to jump after ending a drag with no momentum in a snap offset range.
3051
3052         (WebKit::RemoteScrollingCoordinatorProxy::adjustTargetContentOffsetForSnapping):
3053         (WebKit::RemoteScrollingCoordinatorProxy::shouldSnapForMainFrameScrolling):
3054         (WebKit::RemoteScrollingCoordinatorProxy::closestSnapOffsetForMainFrameScrolling):
3055
3056 2017-01-10  Zan Dobersek  <zdobersek@igalia.com>
3057
3058         ThreadedCoordinatedLayerTreeHost::renderNextFrame() should short-cut to layer flushing
3059         https://bugs.webkit.org/show_bug.cgi?id=157614
3060
3061         Reviewed by Carlos Garcia Campos.
3062
3063         CoordinatedLayerTreeHost prevents any layer flushes while a previously-commited scene
3064         state is still being rendered on the composition thread. renderNextFrame() is called
3065         once that is complete, and a new layer flush is scheduled.
3066
3067         This change improves the whole ordeal by immediately performing the layer flush only if
3068         it was requested during the time we were waiting on the renderer (i.e. when the latest
3069         scene state was being composited), instead of scheduling it unconditionally.
3070         m_scheduledWhileWaitingForRenderer member variable is added to track that occurrence.
3071
3072         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
3073         (WebKit::CoordinatedLayerTreeHost::scheduleLayerFlush):
3074         (WebKit::CoordinatedLayerTreeHost::renderNextFrame):
3075         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h:
3076
3077 2017-01-09  Chris Dumez  <cdumez@apple.com>
3078
3079         [iOS] Drop VNodeTracker
3080         https://bugs.webkit.org/show_bug.cgi?id=166868
3081         <rdar://problem/29937587>
3082
3083         Reviewed by Andreas Kling.
3084
3085         * WebProcess/cocoa/WebProcessCocoa.mm:
3086         (WebKit::WebProcess::platformInitializeWebProcess):
3087
3088 2017-01-09  Enrica Casucci  <enrica@apple.com>
3089
3090         Selection animation flashing on editable content when zooming.
3091         https://bugs.webkit.org/show_bug.cgi?id=166863
3092         rdar://problem/29931470
3093
3094         Reviewed by Tim Horton.
3095
3096         Implementing _allowAnimatedUpdateSelectionRectView and returning NO,
3097         prevents the selection animation in UIKit.
3098
3099         * UIProcess/ios/WKContentViewInteraction.mm:
3100         (-[WKContentView _allowAnimatedUpdateSelectionRectViews]):
3101
3102 2017-01-06  Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>
3103
3104         [GTK] Should support key and code properties on keyboard events
3105         https://bugs.webkit.org/show_bug.cgi?id=166759
3106
3107         Reviewed by Carlos Garcia Campos.
3108
3109         * Shared/WebEvent.h:
3110         * Shared/WebKeyboardEvent.cpp:
3111         (WebKit::WebKeyboardEvent::WebKeyboardEvent): accept web key value and code on construction.
3112         * Shared/gtk/WebEventFactory.cpp:
3113         (WebKit::WebEventFactory::createWebKeyboardEvent): pass web key value and code on construction.
3114
3115 2017-01-08  Antti Koivisto  <antti@apple.com>
3116
3117         Move cache coders to WTF
3118         https://bugs.webkit.org/show_bug.cgi?id=166825
3119
3120         Rubber-stamped by Sam Weinig.
3121
3122         * NetworkProcess/cache/NetworkCache.h:
3123         * NetworkProcess/cache/NetworkCacheCoder.h: Removed.
3124         * NetworkProcess/cache/NetworkCacheCoders.cpp:
3125         (WebKit::NetworkCache::Coder<AtomicString>::encode): Deleted.
3126         (WebKit::NetworkCache::Coder<AtomicString>::decode): Deleted.
3127         (WebKit::NetworkCache::Coder<CString>::encode): Deleted.
3128         (WebKit::NetworkCache::Coder<CString>::decode): Deleted.
3129         (WebKit::NetworkCache::Coder<String>::encode): Deleted.
3130         (WebKit::NetworkCache::decodeStringText): Deleted.
3131         (WebKit::NetworkCache::Coder<String>::decode): Deleted.
3132         (WebKit::NetworkCache::Coder<SHA1::Digest>::encode): Deleted.
3133         (WebKit::NetworkCache::Coder<SHA1::Digest>::decode): Deleted.
3134         (WebKit::NetworkCache::Coder<WebCore::HTTPHeaderMap>::encode): Deleted.
3135         (WebKit::NetworkCache::Coder<WebCore::HTTPHeaderMap>::decode): Deleted.
3136         * NetworkProcess/cache/NetworkCacheCoders.h:
3137         (): Deleted.
3138         (WebKit::NetworkCache::Coder<std::optional<T>>::encode): Deleted.
3139         (WebKit::NetworkCache::Coder<std::optional<T>>::decode): Deleted.
3140         * NetworkProcess/cache/NetworkCacheCodersCocoa.cpp:
3141         (WebKit::NetworkCache::encodeCFData): Deleted.
3142         (WebKit::NetworkCache::decodeCFData): Deleted.
3143         (WebKit::NetworkCache::encodeSecTrustRef): Deleted.
3144         (WebKit::NetworkCache::decodeSecTrustRef): Deleted.
3145         (WebKit::NetworkCache::encodeCertificateChain): Deleted.
3146         (WebKit::NetworkCache::decodeCertificateChain): Deleted.
3147         (WebKit::NetworkCache::Coder<WebCore::CertificateInfo>::encode): Deleted.
3148         (WebKit::NetworkCache::Coder<WebCore::CertificateInfo>::decode): Deleted.
3149         * NetworkProcess/cache/NetworkCacheDecoder.cpp: Removed.
3150         * NetworkProcess/cache/NetworkCacheDecoder.h: Removed.
3151         * NetworkProcess/cache/NetworkCacheEncoder.cpp: Removed.
3152         * NetworkProcess/cache/NetworkCacheEncoder.h: Removed.
3153         * NetworkProcess/cache/NetworkCacheEntry.cpp:
3154         (WebKit::NetworkCache::Entry::encodeAsStorageRecord):
3155         (WebKit::NetworkCache::Entry::decodeStorageRecord):
3156         * NetworkProcess/cache/NetworkCacheKey.cpp:
3157         (WebKit::NetworkCache::Key::encode):
3158         (WebKit::NetworkCache::Key::decode):
3159         * NetworkProcess/cache/NetworkCacheKey.h:
3160         * NetworkProcess/cache/NetworkCacheStorage.cpp:
3161         (WebKit::NetworkCache::decodeRecordMetaData):
3162         (WebKit::NetworkCache::encodeRecordMetaData):
3163         * NetworkProcess/cache/NetworkCacheSubresourcesEntry.cpp:
3164         (WebKit::NetworkCache::SubresourceInfo::encode):
3165         (WebKit::NetworkCache::SubresourceInfo::decode):
3166         (WebKit::NetworkCache::SubresourcesEntry::encodeAsStorageRecord):
3167         (WebKit::NetworkCache::SubresourcesEntry::decodeStorageRecord):
3168         * NetworkProcess/cache/NetworkCacheSubresourcesEntry.h:
3169         * UIProcess/API/APIUserContentExtensionStore.cpp:
3170         (API::encodeContentExtensionMetaData):
3171         (API::decodeContentExtensionMetaData):
3172         * WebKit2.xcodeproj/project.pbxproj:
3173
3174 2017-01-09  Tomas Popela  <tpopela@redhat.com>
3175
3176         [GTK] Replace WebKitWebSettings with WebKitSettings in documentation
3177         https://bugs.webkit.org/show_bug.cgi?id=166836
3178
3179         Reviewed by Carlos Garcia Campos.
3180
3181         Don't use WebKitWebSettings (it was a WebKit1 thing) in documentation,
3182         but replace it with WebKitSettings.
3183
3184         * UIProcess/API/gtk/WebKitSettings.cpp:
3185         (webkit_settings_class_init):
3186         * UIProcess/API/gtk/WebKitWebView.cpp:
3187
3188 2017-01-06  Darin Adler  <darin@apple.com>
3189
3190         Remove PassRefPtr use from "inspector", "platform/sql", and "platform/text"
3191         https://bugs.webkit.org/show_bug.cgi?id=166797
3192
3193         Reviewed by Alex Christensen.
3194
3195         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
3196         (WebKit::WebEditorClient::requestCheckingOfString): Take a reference
3197         instead of a PassRefPtr.
3198         * WebProcess/WebCoreSupport/WebEditorClient.h: Updated for above change.
3199
3200 2017-01-07  Andy Estes  <aestes@apple.com>
3201
3202         [QuickLook] Consolidate usage of QuickLookHandle into SubresourceLoader
3203         https://bugs.webkit.org/show_bug.cgi?id=166713
3204
3205         Reviewed by Alex Christensen.
3206
3207         * WebProcess/Network/WebResourceLoader.cpp:
3208         (WebKit::WebResourceLoader::didReceiveResponse): Removed QuickLook code.
3209         (WebKit::WebResourceLoader::didReceiveData): Ditto.
3210         (WebKit::WebResourceLoader::didFinishResourceLoad): Ditto.
3211         (WebKit::WebResourceLoader::didFailResourceLoad): Ditto.
3212         (WebKit::WebResourceLoader::didReceiveResource): Ditto.
3213
3214 2017-01-06  Daniel Bates  <dabates@apple.com>
3215
3216         Attempt to fix the EFL build following <http://trac.webkit.org/changeset/210461>
3217         (https://bugs.webkit.org/show_bug.cgi?id=166781)
3218
3219         * UIProcess/API/C/WKWebsitePolicies.cpp:
3220         (WKWebsitePoliciesGetAutoplayPolicy): Invoke ASSERT_NOT_REACHED() and return kWKWebsiteAutoplayPolicyUseHeuristics
3221         if the specified policy is not covered by a switch case.
3222         (WKWebsitePoliciesSetAutoplayPolicy): Substituted "return" for "break" in each switch case and
3223         invoke ASSERT_NOT_REACHED() if the specified policy is not covered by a switch case.
3224
3225 2017-01-06  Matt Rajca  <mrajca@apple.com>
3226
3227         Add infrastructure for sending autoplay website policies to WebKit
3228         https://bugs.webkit.org/show_bug.cgi?id=166781
3229
3230         Reviewed by Alex Christensen.
3231
3232         * Shared/WebsitePolicies.h:
3233         (WebKit::WebsitePolicies::encode):
3234         (WebKit::WebsitePolicies::decode):
3235         * UIProcess/API/APIWebsitePolicies.h:
3236         * UIProcess/API/C/WKWebsitePolicies.cpp:
3237         (WKWebsitePoliciesGetAutoplayPolicy):
3238         (WKWebsitePoliciesSetAutoplayPolicy):
3239         * UIProcess/API/C/WKWebsitePolicies.h:
3240         * UIProcess/API/Cocoa/_WKWebsitePolicies.h:
3241         * UIProcess/API/Cocoa/_WKWebsitePolicies.mm:
3242         (-[_WKWebsitePolicies setAutoplayPolicy:]):
3243         (-[_WKWebsitePolicies autoplayPolicy]):
3244
3245 2017-01-05  Carlos Garcia Campos  <cgarcia@igalia.com>
3246
3247         [SOUP] Network process crash in WebKit::CustomProtocolManagerImpl::didFailWithError
3248         https://bugs.webkit.org/show_bug.cgi?id=165082
3249
3250         Reviewed by Alex Christensen.
3251
3252         CustomProtocolManager uses a Workqueue to receive the IPC messages since r149194. Then we added the Soup
3253         implementation adopting that approach, but without making our implementation thread safe. The crash happens
3254         because the CustomProtocolManager implementation is used by two threads at the same time, the main thread
3255         because of a ping load (probably caused by an image load in the unload handler, I haven't been able to
3256         reproduce the crash) and the work queue thread. The reasons to make CustomProtocolManager use a WorkQueue
3257         are no longer valid because CustomProtocolManager is now only used in the network process and sync loads don't
3258         use any nested run loop, they are just an IPC sync message. So this patch makes CustomProtocolManager a normal
3259         message receiver again to ensure messages are handled in the main thread. It also adds the common implementation
3260         to a new CustomProtocolManager.cpp file shared by Cocoa and Soup based ports.
3261
3262         * CMakeLists.txt: Add CustomProtocolManager.cpp.
3263         * NetworkProcess/CustomProtocols/Cocoa/CustomProtocolManagerCocoa.mm:
3264         (-[WKCustomProtocol initWithRequest:cachedResponse:client:]): Use new CustomProtocolManager API.
3265         (-[WKCustomProtocol startLoading]): Ditto.
3266         (-[WKCustomProtocol stopLoading]): Ditto.
3267         (WebKit::CustomProtocolManager::registerProtocolClass): Register the NSURLProtocol class when not using the
3268         network session.
3269         (WebKit::CustomProtocolManager::didFailWithError): removeCustomProtocol now receives an ID.
3270         (WebKit::CustomProtocolManager::didFinishLoading): Ditto.
3271         * NetworkProcess/CustomProtocols/CustomProtocolManager.cpp: Added.
3272         (WebKit::generateCustomProtocolID): Moved from CustomProtocolManagerCocoa.mm and CustomProtocolManagerSoup.cpp.
3273         (WebKit::CustomProtocolManager::supplementName): Ditto.
3274         (WebKit::CustomProtocolManager::CustomProtocolManager): Also removes the work queue initialization.
3275         (WebKit::CustomProtocolManager::initialize): Copied and modernized the loop.
3276         (WebKit::CustomProtocolManager::addCustomProtocol): Copied from CustomProtocolManagerCocoa.mm.
3277         (WebKit::CustomProtocolManager::removeCustomProtocol): Ditto.
3278         (WebKit::CustomProtocolManager::startLoading): Send the StartLoading message to the proxy.
3279         (WebKit::CustomProtocolManager::stopLoading): Send the StopLoading message to the proxy.
3280         * NetworkProcess/CustomProtocols/CustomProtocolManager.h:
3281         * NetworkProcess/CustomProtocols/soup/CustomProtocolManagerImpl.cpp: Removed.
3282         * NetworkProcess/CustomProtocols/soup/CustomProtocolManagerImpl.h: Removed.
3283         * NetworkProcess/CustomProtocols/soup/CustomProtocolManagerSoup.cpp: Moved the implementation from
3284         CustomProtocolManagerImpl and updated to the new CustomProtocolManager API.
3285         (WebKit::CustomProtocolManager::WebSoupRequestAsyncData::WebSoupRequestAsyncData):
3286         (WebKit::CustomProtocolManager::WebSoupRequestAsyncData::~WebSoupRequestAsyncData):
3287         (WebKit::CustomProtocolManager::registerProtocolClass):
3288         (WebKit::CustomProtocolManager::registerScheme):
3289         (WebKit::CustomProtocolManager::supportsScheme):
3290         (WebKit::CustomProtocolManager::didFailWithError):
3291         (WebKit::CustomProtocolManager::didLoadData):
3292         (WebKit::CustomProtocolManager::didReceiveResponse):
3293         (WebKit::CustomProtocolManager::didFinishLoading):
3294         (WebKit::CustomProtocolManager::wasRedirectedToRequest):
3295         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
3296         (WebKit::globalCustomProtocolManager):
3297         (WebKit::NetworkSessionCocoa::defaultSession):
3298         CustomProtocolManager is no longer refcounted, so just pass a pointer.
3299         A static pointer has the same lifetime as the NetworkProcess object in the NetworkProcess,
3300         and in the WebProcess it will remain nullptr, just like it used to.
3301         * PlatformEfl.cmake:
3302         * PlatformGTK.cmake:
3303         * WebKit2.xcodeproj/project.pbxproj:
3304
3305 2017-01-05  Antti Koivisto  <antti@apple.com>
3306
3307         Use WTF::Function instead of std::function in network cache code
3308         https://bugs.webkit.org/show_bug.cgi?id=166721
3309
3310         Reviewed by Andreas Kling.
3311
3312         Use better move-only type. Fix some unnecessary function copies.
3313
3314         * NetworkProcess/cache/NetworkCache.cpp:
3315         (WebKit::NetworkCache::Cache::retrieve):
3316         (WebKit::NetworkCache::Cache::clear):
3317         * NetworkProcess/cache/NetworkCache.h:
3318         * NetworkProcess/cache/NetworkCacheData.h:
3319         * NetworkProcess/cache/NetworkCacheDataCocoa.mm:
3320         (WebKit::NetworkCache::Data::apply):
3321         * NetworkProcess/cache/NetworkCacheDataSoup.cpp:
3322         (WebKit::NetworkCache::Data::apply):
3323         * NetworkProcess/cache/NetworkCacheFileSystem.cpp:
3324         (WebKit::NetworkCache::traverseDirectory):
3325         * NetworkProcess/cache/NetworkCacheFileSystem.h:
3326         * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
3327         (WebKit::NetworkCache::SpeculativeLoadManager::canRetrieve):
3328         (WebKit::NetworkCache::SpeculativeLoadManager::retrieve):
3329
3330             Split retrieve() to canRetrieve() and retrieve() functions.
3331             This avoids the need to copy the completion handler in the caller.
3332
3333         * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.h:
3334         * NetworkProcess/cache/NetworkCacheStorage.cpp:
3335         (WebKit::NetworkCache::Storage::ReadOperation::ReadOperation):
3336         (WebKit::NetworkCache::Storage::traverse):
3337         (WebKit::NetworkCache::Storage::clear):
3338         * NetworkProcess/cache/NetworkCacheStorage.h:
3339
3340 2017-01-05  Enrica Casucci  <enrica@apple.com>
3341
3342         Unreviewed build fix after https://trac.webkit.org/changeset/210360
3343
3344         * UIProcess/Cocoa/WebViewImpl.mm:
3345         (WebKit::WebViewImpl::performDragOperation):
3346
3347 2017-01-05  Enrica Casucci  <enrica@apple.com>
3348
3349         Support File Promise during drag for macOS.
3350         https://bugs.webkit.org/show_bug.cgi?id=165204
3351         rdar://problem/19595567
3352
3353         Reviewed by Tim Horton.
3354
3355         Adds support for dropping a File Promise in a WKWebView.
3356         The implementation uses new File Promise API available in Sierra.
3357
3358         * Shared/WebCoreArgumentCoders.cpp:
3359         (IPC::ArgumentCoder<DragData>::encode):
3360         (IPC::ArgumentCoder<DragData>::decode):
3361         * Shared/mac/PasteboardTypes.mm:
3362         (WebKit::PasteboardTypes::forURL):
3363         * UIProcess/Cocoa/WebViewImpl.h:
3364         * UIProcess/Cocoa/WebViewImpl.mm:
3365         (WebKit::WebViewImpl::createSandboxExtensionsIfNeeded):
3366         (WebKit::WebViewImpl::performDragOperation):
3367         (WebKit::maybeCreateSandboxExtensionFromPasteboard): Deleted.
3368         (WebKit::createSandboxExtensionsForFileUpload): Deleted.
3369
3370 2017-01-05  Andreas Kling  <akling@apple.com>
3371
3372         Remove ChromeClient::needTouchEvents().
3373         <https://webkit.org/b/166723>
3374
3375         Rubber-stamped by Antti Koivisto.
3376
3377         * WebProcess/WebCoreSupport/WebChromeClient.h:
3378
3379 2017-01-04  Darin Adler  <darin@apple.com>
3380
3381         Remove PassRefPtr use from the "html" directory, other improvements
3382         https://bugs.webkit.org/show_bug.cgi?id=166635
3383
3384         Reviewed by Alex Christensen.
3385
3386         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
3387         (WebKit::WebChromeClient::loadIconForFiles): Take a reference instead of a pointer.
3388         * WebProcess/WebCoreSupport/WebChromeClient.h: Ditto.
3389
3390 2017-01-04  Myles C. Maxfield  <mmaxfield@apple.com>
3391
3392         Remove runtime flag for variation fonts
3393         https://bugs.webkit.org/show_bug.cgi?id=164251
3394
3395         Reviewed by Dean Jackson.
3396
3397         * Shared/WebPreferencesDefinitions.h:
3398         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
3399         (WebKit::registerUserDefaultsIfNeeded):
3400         * WebProcess/WebPage/WebPage.cpp:
3401         (WebKit::WebPage::updatePreferences):
3402
3403 2017-01-04  Ryan Haddad  <ryanhaddad@apple.com>
3404
3405         Unreviewed, rolling out r210287.
3406
3407         This change caused editing test failures on macOS.
3408
3409         Reverted changeset:
3410
3411         "Support File Promise during drag for macOS."
3412         https://bugs.webkit.org/show_bug.cgi?id=165204
3413         http://trac.webkit.org/changeset/210287
3414
3415 2017-01-04  Enrica Casucci  <enrica@apple.com>
3416
3417         Support File Promise during drag for macOS.
3418         https://bugs.webkit.org/show_bug.cgi?id=165204
3419         rdar://problem/19595567
3420
3421         Reviewed by Tim Horton.
3422
3423         Adds support for dropping a File Promise in a WKWebView.