WKR does not include my nick when commit-queue lands my patch
[WebKit-https.git] / Source / WebKit2 / ChangeLog
1 2017-01-24  Joseph Pecoraro  <pecoraro@apple.com>
2
3         Fold USER_TIMING into WEB_TIMING and make it a RuntimeEnabledFeature
4         https://bugs.webkit.org/show_bug.cgi?id=167394
5
6         Reviewed by Ryosuke Niwa.
7
8         * Configurations/FeatureDefines.xcconfig:
9
10 2017-01-24  Simon Fraser  <simon.fraser@apple.com>
11
12         [iOS WK2] Avoid IOSurface readback for snapshot creation
13         https://bugs.webkit.org/show_bug.cgi?id=167397
14         rdar://problem/30174873
15
16         Reviewed by Tim Horton.
17
18         Use IOSurface::sinkIntoImage() for snapshots, to avoid GPU readback.
19
20         * UIProcess/API/Cocoa/WKWebView.mm:
21         (-[WKWebView _snapshotRect:intoImageOfWidth:completionHandler:]):
22
23 2017-01-24  Tim Horton  <timothy_horton@apple.com>
24
25         Script gets touch events even after navigation swipe begins
26         https://bugs.webkit.org/show_bug.cgi?id=167383
27         <rdar://problem/22938927>
28
29         Reviewed by Simon Fraser.
30
31         * Platform/spi/ios/UIKitSPI.h:
32         * UIProcess/API/Cocoa/WKWebView.mm:
33         (-[WKWebView _isNavigationSwipeGestureRecognizer:]):
34         * UIProcess/API/Cocoa/WKWebViewInternal.h:
35         * UIProcess/Cocoa/ViewGestureController.h:
36         * UIProcess/ios/ViewGestureControllerIOS.mm:
37         (-[WKSwipeTransitionController isNavigationSwipeGestureRecognizer:]):
38         (WebKit::ViewGestureController::isNavigationSwipeGestureRecognizer):
39         * UIProcess/ios/WKContentViewInteraction.mm:
40         (-[WKContentView gestureRecognizer:shouldRequireFailureOfGestureRecognizer:]):
41         Require the navigation swipe gesture recognizer to fail before the
42         UIWebTouchEventsGestureRecognizer can recognize. This way, the page
43         doesn't get touch events during the swipe, which previously led to
44         e.g. carousels scrolling while swiping.
45
46 2017-01-24  Matt Rajca  <mrajca@apple.com>
47
48         Pass down website autoplay policies to media elements
49         https://bugs.webkit.org/show_bug.cgi?id=167355
50
51         Reviewed by Alex Christensen.
52
53         Autoplay policies can be specified at the global web view preferences level or on a per-page
54         basis during navigation. This patch ensures that policies specified on a per-page basis hold
55         precedence over global policies. If no policies are specified during navigation, global
56         policies are used. A WebsiteAutoplayPolicy::Default option has been added to let clients
57         explicitly specify web view defaults should be used.
58
59         * Shared/WebsitePolicies.h:
60         * UIProcess/API/C/WKWebsitePolicies.cpp:
61         (WKWebsitePoliciesGetAutoplayPolicy):
62         (WKWebsitePoliciesSetAutoplayPolicy):
63         * UIProcess/API/C/WKWebsitePolicies.h:
64         * UIProcess/API/Cocoa/_WKWebsitePolicies.h:
65         * UIProcess/API/Cocoa/_WKWebsitePolicies.mm:
66         (-[_WKWebsitePolicies setAutoplayPolicy:]):
67         (-[_WKWebsitePolicies autoplayPolicy]):
68         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
69         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
70
71 2017-01-24  Nan Wang  <n_wang@apple.com>
72
73         AX: Speak Selection does not work in an iframe
74         https://bugs.webkit.org/show_bug.cgi?id=166794
75         <rdar://problem/29913013>
76
77         Reviewed by Chris Fleizach.
78
79         Making sure WebPage::getSelectionOrContentsAsString() is getting the
80         selection content in the right frame. 
81
82         * UIProcess/API/Cocoa/WKWebView.mm:
83         (-[WKWebView _accessibilityRetrieveSpeakSelectionContent]):
84         (-[WKWebView _accessibilityDidGetSpeakSelectionContent:]):
85         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
86         * UIProcess/ios/WKContentViewInteraction.h:
87         * UIProcess/ios/WKContentViewInteraction.mm:
88         (-[WKContentView accessibilityRetrieveSpeakSelectionContent]):
89         * WebProcess/WebPage/WebPage.cpp:
90         (WebKit::WebPage::getSelectionOrContentsAsString):
91
92 2017-01-24  Jer Noble  <jer.noble@apple.com>
93
94         Make _WKFullscreenDelegate available to users of the WebKit2 C-API.
95         https://bugs.webkit.org/show_bug.cgi?id=165255
96
97         Reviewed by Anders Carlsson.
98
99         Add a getter and setter to WKPagePrivate allowing clients to set/get the
100         _WKFullscreenDelegate associated with the page.
101
102         * UIProcess/API/C/mac/WKPagePrivateMac.h:
103         * UIProcess/API/C/mac/WKPagePrivateMac.mm:
104         (WKPageSetFullscreenDelegate):
105         (WKPageGetFullscreenDelegate):
106
107 2017-01-23  Anders Carlsson  <andersca@apple.com>
108
109         The Score Esports crashes on launch
110         https://bugs.webkit.org/show_bug.cgi?id=167338
111         rdar://problem/29948645
112
113         Reviewed by Dan Bernstein.
114
115         * Shared/Cocoa/WKObject.mm:
116         (+[WKObject conformsToProtocol:]):
117         Add a class method implementation in case an app ends up calling +[WKObject conformsToProtocol:] for some reason.
118
119 2017-01-24  Miguel Gomez  <magomez@igalia.com>
120
121         [Coordinated Graphics] Ensure that we're in AC mode before trying to create GraphicsLayers
122         https://bugs.webkit.org/show_bug.cgi?id=167365
123
124         Reviewed by Carlos Garcia Campos.
125
126         When entering AC on demand, the RenderLayerCompositor wants to create the root GraphicsLayer before the
127         AcceleratedDrawingArea is in AC mode. This means there's no LayerTreeHost to request the GraphicsLayerFactory,
128         so no layers are created. Ensure that we are in AC mode before requesting the GraphicsLayerFactory.
129
130         No behaviour change, no new tests.
131
132         * WebProcess/WebPage/AcceleratedDrawingArea.cpp:
133         (WebKit::AcceleratedDrawingArea::graphicsLayerFactory):
134
135 2017-01-23  Carlos Garcia Campos  <cgarcia@igalia.com>
136
137         [GTK] Add API to WebKitWebsiteDataManager to handle website data
138         https://bugs.webkit.org/show_bug.cgi?id=146589
139
140         Reviewed by Michael Catanzaro.
141
142         Add WebKitWebsiteData boxed type to wrap a WebsiteDataRecord and new methods to WebKitWebsiteDataManager to
143         fetch, remove and clear website data.
144
145         * PlatformGTK.cmake: Add new files to compilation.
146         * UIProcess/API/gtk/WebKitWebsiteData.cpp: Added.
147         (_WebKitWebsiteData::_WebKitWebsiteData):
148         (recordContainsSupportedDataTypes): Helper function to check if the WebsiteDataRecord contains any type exposed
149         by our API.
150         (toWebKitWebsiteDataTypes): Convert from WebKit::WebsiteDataType to the GTK+ public API types.
151         (webkitWebsiteDataCreate): Create a new WebKitWebsiteData for the given WebsiteDataRecord if it contains any
152         supported type.
153         (webkitWebsiteDataGetRecord): Returns the wrapped WebsiteDataRecord.
154         (webkit_website_data_ref):
155         (webkit_website_data_unref):
156         (webkit_website_data_get_name): Return the display name.
157         (webkit_website_data_get_types): Returns the mask of types.
158         (webkit_website_data_get_size): Returns the size for the given types.
159         * UIProcess/API/gtk/WebKitWebsiteData.h: Added.
160         * UIProcess/API/gtk/WebKitWebsiteDataManager.cpp:
161         (toWebsiteDataTypes): Convert from GTK+ public API types to WebKit::WebsiteDataType.
162         (webkit_website_data_manager_fetch): Fetch website data of the given types.
163         (webkit_website_data_manager_fetch_finish):
164         (webkit_website_data_manager_remove): Remove the website data of the given types for the given WebKitWebsiteData list.
165         (webkit_website_data_manager_remove_finish):
166         (webkit_website_data_manager_clear): Clear all website data of the given types modified since the given time span.
167         (webkit_website_data_manager_clear_finish):
168         * UIProcess/API/gtk/WebKitWebsiteDataManager.h:
169         * UIProcess/API/gtk/WebKitWebsiteDataPrivate.h: Added.
170         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt: Add new symbols.
171         * UIProcess/API/gtk/docs/webkit2gtk-docs.sgml: Add new section.
172         * UIProcess/API/gtk/webkit2.h: Inlcude WebKitWebsiteData.h
173
174 2017-01-23  Antti Koivisto  <antti@apple.com>
175
176         Maintain ordering when doing speculative loads
177         https://bugs.webkit.org/show_bug.cgi?id=167324
178
179         Forgot to implement a review comment.
180
181         * NetworkProcess/cache/NetworkCacheSubresourcesEntry.cpp:
182         (WebKit::NetworkCache::makeSubresourceInfoVector):
183
184         Allocated initial capacity and use uncheckedAppend.
185
186 2017-01-23  Commit Queue  <commit-queue@webkit.org>
187
188         Unreviewed, rolling out r211062.
189         https://bugs.webkit.org/show_bug.cgi?id=167354
190
191         broke API tests (Requested by alexchristensen on #webkit).
192
193         Reverted changeset:
194
195         "Pass down website autoplay policies to media elements"
196         https://bugs.webkit.org/show_bug.cgi?id=167132
197         http://trac.webkit.org/changeset/211062
198
199 2017-01-23  Antti Koivisto  <antti@apple.com>
200
201         Maintain ordering when doing speculative loads
202         https://bugs.webkit.org/show_bug.cgi?id=167324
203
204         Reviewed by Chris Dumez.
205
206         We currently randomize the ordering of speculative loads because they are serialized as a hash map.
207         It would be better to load in the same order as the requests were originally issued as that is
208         likely to match the order the document needs them.
209
210         * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
211         (WebKit::NetworkCache::SpeculativeLoadManager::startSpeculativeRevalidation):
212         * NetworkProcess/cache/NetworkCacheSubresourcesEntry.cpp:
213         (WebKit::NetworkCache::SubresourceInfo::encode):
214         (WebKit::NetworkCache::SubresourceInfo::decode):
215
216             Include key into SubresourceInfo.
217
218         (WebKit::NetworkCache::makeSubresourcesVector):
219
220             Deduplicate the entries.
221
222         (WebKit::NetworkCache::SubresourcesEntry::SubresourcesEntry):
223         (WebKit::NetworkCache::SubresourcesEntry::updateSubresourceLoads):
224         * NetworkProcess/cache/NetworkCacheSubresourcesEntry.h:
225         (WebKit::NetworkCache::SubresourceInfo::SubresourceInfo):
226         (WebKit::NetworkCache::SubresourceInfo::key):
227         (WebKit::NetworkCache::SubresourceInfo::setTransient):
228         (WebKit::NetworkCache::SubresourcesEntry::subresources):
229
230             Keep the resources in a Vector instead of a HashMap to maintain order.
231
232 2017-01-23  Matt Rajca  <mrajca@apple.com>
233
234         Pass down website autoplay policies to media elements
235         https://bugs.webkit.org/show_bug.cgi?id=167132
236
237         Reviewed by Alex Christensen.
238
239         The playbackRequiresUserGesture APIs are already covered by tests. This patch adds API tests
240         for autoplay website policies.
241
242         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
243         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
244
245 2017-01-23  Joseph Pecoraro  <pecoraro@apple.com>
246
247         Web Inspector: Asserts seen opening and closing Remote Web Inspector windows
248         https://bugs.webkit.org/show_bug.cgi?id=167316
249         <rdar://problem/28891161>
250
251         Reviewed by Alexey Proskuryakov.
252
253         * UIProcess/RemoteWebInspectorProxy.cpp:
254         (WebKit::RemoteWebInspectorProxy::createFrontendPageAndWindow):
255         Assume read access, like the local web inspector, to Web Inspector resources.
256
257         * WebProcess/WebPage/RemoteWebInspectorUI.cpp:
258         (WebKit::RemoteWebInspectorUI::closeWindow):
259         Clear ourselves as the inspector frontend client when closing.
260
261 2017-01-20  Anders Carlsson  <andersca@apple.com>
262
263         When Safari reloads pages with Flash objects after Flash is installed, placeholders don't paint (but do work!)
264         https://bugs.webkit.org/show_bug.cgi?id=167268
265         rdar://problem/29857388
266
267         Reviewed by Sam Weinig.
268
269         * WebProcess/Plugins/WebPluginInfoProvider.h:
270         Make refreshPlugins() private.
271
272         * WebProcess/WebProcess.cpp:
273         (WebKit::WebProcess::refreshPlugins):
274         Call the newly added PluginInfoProvider::refresh().
275
276 2017-01-23  Antti Koivisto  <antti@apple.com>
277
278         Use priorities in speculative revalidation
279         https://bugs.webkit.org/show_bug.cgi?id=167314
280
281         Reviewed by Chris Dumez.
282
283         We currently do all speculative cache operations with 'Medium' priority
284         and network operations with 'Low'. We should use the actual request priorities instead.
285
286         * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
287         (WebKit::NetworkCache::constructRevalidationRequest):
288
289             Use priority when constructing validation request.
290
291         (WebKit::NetworkCache::SpeculativeLoadManager::retrieveEntryFromStorage):
292
293             Use priority when retrieving from cache.
294
295         (WebKit::NetworkCache::SpeculativeLoadManager::preloadEntry):
296         * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.h:
297         * NetworkProcess/cache/NetworkCacheSubresourcesEntry.cpp:
298         (WebKit::NetworkCache::SubresourceInfo::encode):
299         (WebKit::NetworkCache::SubresourceInfo::decode):
300
301             Save and restore the priority.
302
303         * NetworkProcess/cache/NetworkCacheSubresourcesEntry.h:
304         (WebKit::NetworkCache::SubresourceInfo::SubresourceInfo):
305         (WebKit::NetworkCache::SubresourceInfo::priority):
306
307 2017-01-23  Jer Noble  <jer.noble@apple.com>
308
309         Video details does not apear and missing scrubber in Control Center
310         https://bugs.webkit.org/show_bug.cgi?id=167233
311
312         Reviewed by Alex Christensen.
313
314         Make requestActiveNowPlayingSessionInfo() and handleActiveNowPlayingSessionInfoResponse()
315         work in PLATFORM(IOS).
316
317         * UIProcess/API/Cocoa/WKWebView.mm:
318         (-[WKWebView _requestActiveNowPlayingSessionInfo]):
319         (-[WKWebView _handleActiveNowPlayingSessionInfoResponse:title:duration:elapsedTime:]):
320         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
321         * UIProcess/PageClient.h:
322         * UIProcess/WebPageProxy.cpp:
323         (WebKit::WebPageProxy::requestActiveNowPlayingSessionInfo):
324         (WebKit::WebPageProxy::handleActiveNowPlayingSessionInfoResponse):
325         * UIProcess/WebPageProxy.h:
326         * UIProcess/WebPageProxy.messages.in:
327         * UIProcess/ios/PageClientImplIOS.h:
328         * UIProcess/ios/PageClientImplIOS.mm:
329         (WebKit::PageClientImpl::handleActiveNowPlayingSessionInfoResponse):
330         * WebProcess/WebPage/Cocoa/WebPageCocoa.mm:
331         (WebKit::WebPage::requestActiveNowPlayingSessionInfo):
332         * WebProcess/WebPage/WebPage.h:
333         * WebProcess/WebPage/WebPage.messages.in:
334         * WebProcess/WebPage/mac/WebPageMac.mm:
335         (WebKit::WebPage::requestActiveNowPlayingSessionInfo): Deleted.
336
337 2017-01-23  Chris Dumez  <cdumez@apple.com>
338
339         REGRESSION (r211033): ASSERTION FAILED: m_ptr in com.apple.WebCore: WTF::RefPtr<WebCore::Element>::operator* const + 70
340         https://bugs.webkit.org/show_bug.cgi?id=167308
341         <rdar://problem/30144964>
342
343         Unreviewed, do a partial revert of r211033 to fix assertion.
344
345         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
346         (WebKit::WebChromeClient::exitFullScreenForElement):
347         * WebProcess/WebCoreSupport/WebChromeClient.h:
348
349 2017-01-20  Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>
350
351         urlParserEnabled parameter is only encoded for COCOA ports
352         https://bugs.webkit.org/show_bug.cgi?id=167238
353
354         Reviewed by Alex Christensen.
355
356         This leads to URLParser being enabled on the UI process, since it is
357         the default, but disabled on the WebProcess, which is the default for
358         WebProcessCreationParameters, casuing asserts like on tests such as these
359         due to differences in parsing:
360
361         - fast/loader/redirect-to-invalid-url-using-javascript-calls-policy-delegate.html
362         - fast/loader/window-open-to-invalid-url-calls-policy-delegate.html
363         - http/tests/inspector/network/copy-as-curl.html
364
365         * Shared/WebProcessCreationParameters.cpp:
366         (WebKit::WebProcessCreationParameters::encode): encode urlParserEnabled
367         (WebKit::WebProcessCreationParameters::decode): decode urlParserEnabled
368
369 2017-01-20  Darin Adler  <darin@apple.com>
370
371         Remove PassRefPtr from "page" directory of WebCore, also deploy references
372         https://bugs.webkit.org/show_bug.cgi?id=167224
373
374         Reviewed by Chris Dumez.
375
376         * UIProcess/Scrolling/RemoteScrollingTree.cpp:
377         (WebKit::RemoteScrollingTree::createScrollingTreeNode): Return a Ref
378         instead of PassRefPtr.
379         * UIProcess/Scrolling/RemoteScrollingTree.h: Updated for the above.
380
381         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
382         (WKBundlePageInstallPageOverlay): Pass a reference.
383         (WKBundlePageUninstallPageOverlay): Ditto.
384         (WKBundlePageInstallPageOverlayWithAnimation): Ditto.
385         (WKBundlePageUninstallPageOverlayWithAnimation): Ditto.
386         * WebProcess/Plugins/PDF/DeprecatedPDFPlugin.mm:
387         (WebKit::PDFPlugin::jsPDFDocPrint): Ditto.
388         * WebProcess/Plugins/PluginView.cpp:
389         (WebKit::PluginView::focusPluginElement): Ditto.
390         (WebKit::PluginView::setStatusbarText): Ditto.
391
392         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
393         (WebKit::WebChromeClient::elementDidFocus): Updated for changes to ChromeClient.
394         (WebKit::WebChromeClient::elementDidBlur): Ditto.
395         (WebKit::WebChromeClient::makeFirstResponder): Ditto.
396         (WebKit::WebChromeClient::createWindow): Ditto.
397         (WebKit::WebChromeClient::runBeforeUnloadConfirmPanel): Ditto.
398         (WebKit::WebChromeClient::runJavaScriptAlert): Ditto.
399         (WebKit::WebChromeClient::runJavaScriptConfirm): Ditto.
400         (WebKit::WebChromeClient::runJavaScriptPrompt): Ditto.
401         (WebKit::WebChromeClient::contentsSizeChanged): Ditto.
402         (WebKit::WebChromeClient::unavailablePluginButtonClicked): Ditto.
403         (WebKit::WebChromeClient::print): Ditto.
404         (WebKit::WebChromeClient::exceededDatabaseQuota): Ditto.
405         (WebKit::WebChromeClient::reachedApplicationCacheOriginQuota): Ditto.
406         (WebKit::WebChromeClient::createColorChooser): Ditto.
407         (WebKit::WebChromeClient::createPopupMenu): Ditto.
408         (WebKit::WebChromeClient::createSearchPopupMenu): Ditto.
409         (WebKit::WebChromeClient::attachRootGraphicsLayer): Ditto.
410         (WebKit::WebChromeClient::attachViewOverlayGraphicsLayer): Ditto.
411         (WebKit::WebChromeClient::createScrollingCoordinator): Ditto.
412         (WebKit::WebChromeClient::supportsFullScreenForElement): Ditto.
413         (WebKit::WebChromeClient::enterFullScreenForElement): Ditto.
414         (WebKit::WebChromeClient::exitFullScreenForElement): Ditto.
415         (WebKit::WebChromeClient::didAddHeaderLayer): Ditto.
416         (WebKit::WebChromeClient::didAddFooterLayer): Ditto.
417         (WebKit::WebChromeClient::shouldUseTiledBackingForFrameView): Ditto.
418         * WebProcess/WebCoreSupport/WebChromeClient.h: Ditto.
419         * WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm:
420         (WebKit::WebChromeClient::elementDidRefocus): Ditto.
421         (WebKit::WebChromeClient::didReceiveMobileDocType): Ditto.
422         (WebKit::WebChromeClient::observedContentChange): Ditto.
423         (WebKit::WebChromeClient::clearContentChangeObservers): Ditto.
424         (WebKit::WebChromeClient::notifyRevealedSelectionByScrollingFrame): Ditto.
425
426         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
427         (WebKit::WebFrameLoaderClient::dispatchCreatePage): Pass reference.
428         * WebProcess/WebCoreSupport/WebInspectorClient.cpp:
429         (WebKit::WebInspectorClient::~WebInspectorClient): Ditto.
430         (WebKit::WebInspectorClient::hideHighlight): Ditto.
431         (WebKit::WebInspectorClient::showPaintRect): Ditto.
432         * WebProcess/WebPage/FindController.cpp:
433         (WebKit::FindController::updateFindUIAfterPageScroll): Ditto.
434         (WebKit::FindController::hideFindUI): Ditto.
435
436         * WebProcess/WebPage/WebFrame.cpp:
437         (WebKit::WebFrame::createWithCoreMainFrame): Return Ref instead of
438         PassRefPtr.
439         (WebKit::WebFrame::createSubframe): Ditto.
440         (WebKit::WebFrame::create): Ditto.
441         * WebProcess/WebPage/WebFrame.h: Updated for the above.
442
443         * WebProcess/WebPage/WebInspector.cpp:
444         (WebKit::WebInspector::openInNewTab): Pass reference.
445
446         * WebProcess/WebPage/ios/FindControllerIOS.mm:
447         (WebKit::FindController::updateFindIndicator): Use reference.
448         (WebKit::FindController::hideFindIndicator): Ditto.
449
450 2017-01-21  Carlos Garcia Campos  <cgarcia@igalia.com>
451
452         Unreviewed, rolling out r211012.
453
454         It caused a lot of crashes in the network process
455
456         Reverted changeset:
457
458         "[SOUP] Custom protocols don't work in private browsing mode"
459         https://bugs.webkit.org/show_bug.cgi?id=167236
460         http://trac.webkit.org/changeset/211012
461
462 2017-01-20  Joseph Pecoraro  <pecoraro@apple.com>
463
464         Remove never changing IndexedDB RuntimeEnabledFeature
465         https://bugs.webkit.org/show_bug.cgi?id=167278
466
467         Reviewed by Darin Adler.
468
469         * WebProcess/WebProcess.cpp:
470         (WebKit::m_resourceLoadStatisticsStorage):
471
472 2017-01-20  Carlos Garcia Campos  <cgarcia@igalia.com>
473
474         [SOUP] Custom protocols don't work in private browsing mode
475         https://bugs.webkit.org/show_bug.cgi?id=167236
476
477         Reviewed by Sergio Villar Senin.
478
479         We only register them in the default session.
480
481         * NetworkProcess/CustomProtocols/soup/CustomProtocolManagerSoup.cpp:
482         (WebKit::CustomProtocolManager::registerProtocolClass): Set the WEBKIT_TYPE_SOUP_REQUEST_GENERIC as type for
483         custom protocols, and setup custom protocols in all existing sessions.
484         (WebKit::CustomProtocolManager::registerScheme): Use g_type_class_peek instead of g_type_class_ref since we know
485         the class was already created in registerProtocolClass().
486
487 2017-01-20  Brady Eidson  <beidson@apple.com>
488
489         Require a button press on a gamepad for them to be exposed to the DOM.
490         <rdar://problem/28620919> and https://bugs.webkit.org/show_bug.cgi?id=167272
491
492         Reviewed by Alex Christensen.
493
494         * UIProcess/Gamepad/UIGamepadProvider.cpp:
495         (WebKit::UIGamepadProvider::gamepadSyncTimerFired):
496         (WebKit::UIGamepadProvider::platformGamepadInputActivity):
497         * UIProcess/Gamepad/UIGamepadProvider.h:
498
499         * UIProcess/WebPageProxy.cpp:
500         (WebKit::WebPageProxy::gamepadActivity):
501         * UIProcess/WebPageProxy.h:
502
503         * WebProcess/Gamepad/WebGamepadProvider.cpp:
504         (WebKit::WebGamepadProvider::gamepadActivity):
505         * WebProcess/Gamepad/WebGamepadProvider.h:
506
507         * WebProcess/WebPage/WebPage.cpp:
508         (WebKit::WebPage::gamepadActivity):
509         * WebProcess/WebPage/WebPage.h:
510         * WebProcess/WebPage/WebPage.messages.in:
511
512 2017-01-20  Joseph Pecoraro  <pecoraro@apple.com>
513
514         Cleanup RuntimeEnabledFeatures
515         https://bugs.webkit.org/show_bug.cgi?id=167228
516
517         Reviewed by Simon Fraser.
518
519         * WebProcess/WebProcess.cpp:
520         (WebKit::m_resourceLoadStatisticsStorage):
521
522 2017-01-20  Joseph Pecoraro  <pecoraro@apple.com>
523
524         Remove outdated ENABLE(CSP_NEXT) build flag
525         https://bugs.webkit.org/show_bug.cgi?id=167252
526
527         Reviewed by Brent Fulgham.
528
529         * Configurations/FeatureDefines.xcconfig:
530
531 2017-01-20  Alex Christensen  <achristensen@webkit.org>
532
533         Fix Mac CMake build.
534
535         * CMakeLists.txt:
536         * PlatformMac.cmake:
537
538 2017-01-20  Antoine Quint  <graouts@apple.com>
539
540         Web Animations should be off by default and enabled as an experimental feature
541         https://bugs.webkit.org/show_bug.cgi?id=167115
542         <rdar://problem/30048963>
543
544         Reviewed by Joseph Pecoraro.
545
546         Promote, or relegate depending on how you see things, the Web Animations preference
547         to an experimental feature.
548
549         * Shared/WebPreferencesDefinitions.h:
550
551 2017-01-20  Antoine Quint  <graouts@apple.com>
552
553         [Modern Media Controls] Turn modern media controls on by default
554         https://bugs.webkit.org/show_bug.cgi?id=165668
555
556         Reviewed by Dean Jackson.
557
558         Use DEFAULT_EXPERIMENTAL_FEATURES_ENABLED as the default value for modern media controls, which is true.
559
560         * Shared/WebPreferencesDefinitions.h:
561
562 2017-01-20  Carlos Garcia Campos  <cgarcia@igalia.com>
563
564         Unreviewed. Update OptionsGTK.cmake and NEWS for 2.15.3 release.
565
566         * gtk/NEWS: Add release notes for 2.15.3.
567
568 2017-01-19  Carlos Garcia Campos  <cgarcia@igalia.com>
569
570         [Threaded Compositor] Initialize the threaded compositor with the current size
571         https://bugs.webkit.org/show_bug.cgi?id=167196
572
573         Reviewed by Žan Doberšek.
574
575         We are always creating the threaded compositor with an empty size and then a sizeDidChange always happen when
576         the backing store state changes. This is always happening because the threaded compositor is created before the
577         first backing store state, but if we wanted to create it later, for example to enter/leave AC mode on demand,
578         the threaded compositor will not have the viewport size unless the window is resized, or sizeDidChange is called
579         manually when entering AC mode. Creating the threaded compositor is sync and changing the size too, so it's
580         better to do both things at the same time using the same sync operation.
581
582         * Shared/CoordinatedGraphics/SimpleViewportController.cpp:
583         (WebKit::SimpleViewportController::SimpleViewportController): Pass an initial size to the constructor.
584         * Shared/CoordinatedGraphics/SimpleViewportController.h:
585         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
586         (WebKit::ThreadedCompositor::create): Add viewportSize and scaleFactor construction parameters,
587         (WebKit::ThreadedCompositor::ThreadedCompositor): Ditto. Also mark as needs resize if the given size is not empty.
588         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:
589         * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp:
590         (WebKit::ThreadedCoordinatedLayerTreeHost::ThreadedCoordinatedLayerTreeHost): Initialize the threaded compositor
591         with an initial viewport size and scale factor.
592
593 2017-01-19  Chris Dumez  <cdumez@apple.com>
594
595         iterable<> should be enabled on WK1
596         https://bugs.webkit.org/show_bug.cgi?id=167221
597         <rdar://problem/30108531>
598
599         Reviewed by Youenn Fablet.
600
601         * Shared/WebPreferencesDefinitions.h:
602         * WebProcess/InjectedBundle/InjectedBundle.cpp:
603         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
604         * WebProcess/WebPage/WebPage.cpp:
605         (WebKit::WebPage::updatePreferences):
606
607 2017-01-19  Alex Christensen  <achristensen@webkit.org>
608
609         Construct URLSearchParams from array or object
610         https://bugs.webkit.org/show_bug.cgi?id=166973
611
612         Reviewed by Sam Weinig.
613
614         * NetworkProcess/capture/NetworkCaptureManager.cpp:
615         (WebKit::NetworkCapture::Manager::fuzzyMatchURLs):
616         Change std::pair's first/second to WTF::KeyValuePair's key/value.
617
618 2017-01-19  Andy Estes  <aestes@apple.com>
619
620         [iOS] Move the PDF password view into its own class for possible reuse
621         https://bugs.webkit.org/show_bug.cgi?id=167192
622
623         Reviewed by Tim Horton.
624
625         * UIProcess/ios/WKPDFView.h: Stopped conforming to UIDocumentPasswordViewDelegate.
626         * UIProcess/ios/WKPDFView.mm: Changed _passwordView to a WKPasswordView.
627         (-[WKPDFView _passwordViewFrame]): Returns the frame to set on _passwordView.
628         (-[WKPDFView _updatePasswordEntryField]): Removed.
629         (-[WKPDFView _showPasswordEntryField]): Created a WKPasswordView, set a lambda on its
630         userDidEnterPassword property to do the work previously done in -_tryToUnlockWithPassword:,
631         and showed the password view.
632         (-[WKPDFView _keyboardDidShow:]): Moved to WKPasswordView.
633         (-[WKPDFView _hidePasswordEntryField]): Deleted. The userDidEnterPassword lambda now calls
634         -[WKPasswordView hide] when the document is unlocked.
635         (-[WKPDFView userDidEnterPassword:forPasswordView:]): Moved to WKPasswordView.
636         (-[WKPDFView didBeginEditingPassword:inView:]): Ditto.
637         (-[WKPDFView didEndEditingPassword:inView:]): Ditto.
638         (-[WKPDFView _didFailToUnlock]): Ditto.
639         (-[WKPDFView _tryToUnlockWithPassword:]): Moved into _passwordView's userDidEnterPassword lambda.
640         * UIProcess/ios/WKPasswordView.h: Added.
641         * UIProcess/ios/WKPasswordView.mm: Added.
642         (-[WKPasswordView initWithFrame:documentName:]): Created a UIDocumentPasswordView with
643         documentName, set self as its passwordDelegate, and added it as a subview.
644         (-[WKPasswordView layoutSubviews]): Updated _scrollView's contentSize if we are displaying
645         the view.
646         (-[WKPasswordView displayInContentView:]): Saved the scroll view's previous minimum/maximum
647         zoom scale and color, set new values for minimum/maximum zoom scale and color, and added
648         self as a subview of contentView.
649         (-[WKPasswordView hide]): Restored the saved minimum/maximum zoom scale and color on the
650         scroll view and removed self from its superview.
651         (-[WKPasswordView displayPasswordFailureAlert]): Displayed the alert previously shown by
652         -[WKPDFView _didFailToUnlock].
653         (-[WKPasswordView _keyboardDidShow:]): Moved from WKPDFView.
654         (-[WKPasswordView userDidEnterPassword:forPasswordView:]): Retained self and called the
655         _userDidEnterPassword block with the password.
656         (-[WKPasswordView didBeginEditingPassword:inView:]): Moved from WKPDFView.
657         (-[WKPasswordView didEndEditingPassword:inView:]): Ditto.
658         * WebKit2.xcodeproj/project.pbxproj:
659
660 2017-01-19  Chris Dumez  <cdumez@apple.com>
661
662         Make sure HTML validation bubble gets dismissed when its associated element's frame gets detached
663         https://bugs.webkit.org/show_bug.cgi?id=167215
664         <rdar://problem/29885052>
665
666         Reviewed by Andreas Kling.
667
668         Make sure HTML validation bubble gets dismissed when its associated
669         element's frame gets detached and that we do not crash.
670
671         * WebProcess/WebCoreSupport/WebValidationMessageClient.cpp:
672         (WebKit::WebValidationMessageClient::documentDetached):
673         * WebProcess/WebCoreSupport/WebValidationMessageClient.h:
674
675 2017-01-19  Chris Dumez  <cdumez@apple.com>
676
677         Implement per activity state CPU usage reporting using diagnostic logging
678         https://bugs.webkit.org/show_bug.cgi?id=167163
679         <rdar://problem/30058349>
680
681         Reviewed by Andreas Kling.
682
683         Implement per activity state CPU usage reporting using diagnostic logging.
684
685         * Platform/Logging.h:
686         * UIProcess/PerActivityStateCPUUsageSampler.cpp: Added.
687         (WebKit::PerActivityStateCPUUsageSampler::PerActivityStateCPUUsageSampler):
688         (WebKit::PerActivityStateCPUUsageSampler::~PerActivityStateCPUUsageSampler):
689         (WebKit::PerActivityStateCPUUsageSampler::reportWebContentCPUTime):
690         (WebKit::loggingKeyForActivityState):
691         (WebKit::loggingKeyForCPUUsage):
692         (WebKit::PerActivityStateCPUUsageSampler::loggingTimerFired):
693         (WebKit::PerActivityStateCPUUsageSampler::pageForLogging):
694         * UIProcess/PerActivityStateCPUUsageSampler.h: Copied from Source/WebCore/page/ActivityState.h.
695         * UIProcess/WebProcessPool.cpp:
696         (WebKit::WebProcessPool::WebProcessPool):
697         (WebKit::WebProcessPool::reportWebContentCPUTime):
698         * UIProcess/WebProcessPool.h:
699         * UIProcess/WebProcessPool.messages.in:
700         * WebKit2.xcodeproj/project.pbxproj:
701         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
702         (WebKit::WebChromeClient::reportProcessCPUTime):
703         * WebProcess/WebCoreSupport/WebChromeClient.h:
704
705 2017-01-19  Dan Bernstein  <mitz@apple.com>
706
707         Build fix.
708
709         Rubber-stamped by Anders Carlsson.
710
711         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
712         (WebKit::toPKPaymentAuthorizationStatus): Suppressed deprecation warnings.
713
714 2017-01-19  Myles C. Maxfield  <mmaxfield@apple.com>
715
716         [Cocoa] Variation fonts are erroneously disabled on iOS
717         https://bugs.webkit.org/show_bug.cgi?id=167172
718
719         Reviewed by Simon Fraser.
720
721         OpenSource builders don't seem to understand sdk=embedded*.
722
723         * Configurations/FeatureDefines.xcconfig:
724
725 2017-01-18  Anders Carlsson  <andersca@apple.com>
726
727         Install WebKit.apinotes with the public headers of WebKit framework
728         https://bugs.webkit.org/show_bug.cgi?id=167182
729         rdar://problem/29008989
730
731         Reviewed by Sam Weinig.
732
733         * Shared/API/Cocoa/WebKit.apinotes: Added.
734         * WebKit2.xcodeproj/project.pbxproj:
735
736 2017-01-19  Brian Burg  <bburg@apple.com>
737
738         Web Inspector: move Mac-specific automation commands to a separate implementation file
739         https://bugs.webkit.org/show_bug.cgi?id=163297
740         <rdar://problem/28718990>
741
742         Reviewed by Timothy Hatcher.
743
744         Not all Automation commands are available on all platforms. Start splitting out
745         command declarations and implementations based on the target platform.
746
747         * DerivedSources.make:
748         Set an appropriate --platform so the correct backend interface is generated.
749
750         * UIProcess/Automation/Automation.json:
751         Guard commands that should not be available on iOS:
752             - resizeWindowOfBrowsingContext
753             - moveWindowOfBrowsingContext
754             - inspectBrowsingContext
755
756         * UIProcess/Automation/WebAutomationSession.cpp:
757         (WebKit::WebAutomationSession::platformSimulateKeySequence): Deleted.
758         - Move shared convenience macros to header file.
759         - Move out Cocoa-only or Mac-only command implementations.
760
761         * UIProcess/Automation/WebAutomationSession.h:
762         Rearrange some declarations and switch from USE(APPKIT) to PLATFORM(MAC).
763
764         * UIProcess/Automation/WebAutomationSessionMacros.h: Added.
765
766         * UIProcess/Automation/cocoa/WebAutomationSessionCocoa.mm: Added.
767         (WebKit::WebAutomationSession::platformGetBase64EncodedPNGData):
768         Moved from WebAutomationSessionCocoa.mm. Add iOS-specific header includes.
769
770         * UIProcess/Automation/mac/WebAutomationSessionMac.mm: Renamed from Source/WebKit2/UIProcess/Cocoa/WebAutomationSessionCocoa.mm.
771         (WebKit::WebAutomationSession::resizeWindowOfBrowsingContext):
772         (WebKit::WebAutomationSession::moveWindowOfBrowsingContext):
773         (WebKit::WebAutomationSession::inspectBrowsingContext):
774         Move macOS platform command implementations to here. If other desktop ports want
775         to use these commands, we can move them somewhere else later.
776
777         (WebKit::WebAutomationSession::sendSynthesizedEventsToPage):
778         (WebKit::WebAutomationSession::markEventAsSynthesizedForAutomation):
779         (WebKit::WebAutomationSession::wasEventSynthesizedForAutomation):
780         Move out AppKit-specific event simulation code to here.
781
782         (WebKit::WebAutomationSession::platformSimulateMouseInteraction):
783         (WebKit::WebAutomationSession::platformSimulateKeyStroke):
784         (WebKit::WebAutomationSession::platformSimulateKeySequence):
785         Move out Mac platformFoo implementations to here.
786
787         * WebKit2.xcodeproj/project.pbxproj:
788         - Added UIProcess/Automation/{mac,cocoa} groups.
789         - Add new platform-specific implementation files.
790
791 2017-01-19  Carlos Garcia Campos  <cgarcia@igalia.com>
792
793         [GTK] Provide API to set proxy settings
794         https://bugs.webkit.org/show_bug.cgi?id=128674
795
796         Reviewed by Michael Catanzaro.
797
798         Add new method webkit_web_context_set_network_proxy_settings() that allows to set proxy settings in a
799         WebKitWebContext. It receives an enum WebKitNetworkProxyMode with modes Default, NoProxy and Custom, and an
800         optional WebKitNetworkProxySettings that is used when mode is Custom. WebKitNetworkProxySettings is a simple
801         boxed type that user can create to set proxy settins with a similar API to GSimpleProxyResolver.
802
803         * NetworkProcess/NetworkProcess.h:
804         * NetworkProcess/NetworkProcess.messages.in: Add SetNetworkProxySettings message.
805         * NetworkProcess/NetworkProcessCreationParameters.cpp:
806         (WebKit::NetworkProcessCreationParameters::encode): Encode proxy settings.
807         (WebKit::NetworkProcessCreationParameters::decode): Decode proxy settings.
808         * NetworkProcess/NetworkProcessCreationParameters.h:
809         * NetworkProcess/efl/NetworkProcessMainEfl.cpp: Use SoupNetworkSession::setProxySettingsFromEnvironment().
810         * NetworkProcess/soup/NetworkProcessSoup.cpp:
811         (WebKit::NetworkProcess::platformInitializeNetworkProcess): Set proxy settings if provided by the user.
812         (WebKit::NetworkProcess::setNetworkProxySettings): Set global proxy settings and setup the proxy for all
813         existing contexts.
814         * PlatformGTK.cmake: Add new files to compilation.
815         * Shared/WebCoreArgumentCoders.h:
816         * Shared/WebProcessCreationParameters.cpp:
817         (WebKit::WebProcessCreationParameters::encode): Encode proxy settings.
818         (WebKit::WebProcessCreationParameters::decode): Decode proxy settings.
819         * Shared/WebProcessCreationParameters.h:
820         * Shared/soup/WebCoreArgumentCodersSoup.cpp:
821         (IPC::ArgumentCoder<SoupNetworkProxySettings>::encode): Add encoder implementation for SoupNetworkProxySettings.
822         (IPC::ArgumentCoder<SoupNetworkProxySettings>::decode): add decoder implementation for SoupNetworkProxySettings.
823         * UIProcess/API/gtk/WebKitNetworkProxySettings.cpp: Added.
824         (_WebKitNetworkProxySettings::_WebKitNetworkProxySettings):
825         (webkitNetworkProxySettingsGetNetworkProxySettings):
826         (webkit_network_proxy_settings_new): Create a new WebKitNetworkProxySettings with optional default proxy uri and
827         ignore hosts list.
828         (webkit_network_proxy_settings_copy):
829         (webkit_network_proxy_settings_free):
830         (webkit_network_proxy_settings_add_proxy): Add a proxy uri for a given uri scheme.
831         * UIProcess/API/gtk/WebKitNetworkProxySettings.h: Added.
832         * UIProcess/API/gtk/WebKitNetworkProxySettingsPrivate.h: Added.
833         * UIProcess/API/gtk/WebKitWebContext.cpp:
834         (webkit_web_context_set_network_proxy_settings): Set proxy settings.
835         * UIProcess/API/gtk/WebKitWebContext.h:
836         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt: Add new symbols to the documentation.
837         * UIProcess/API/gtk/docs/webkit2gtk-docs.sgml: Add new section for WebKitNetworkProxySettings.
838         * UIProcess/API/gtk/webkit2.h: Include WebKitNetworkProxySettings.h.
839         * UIProcess/WebProcessPool.h: Add m_networkProxySettings and a setter for soup.
840         * UIProcess/efl/WebProcessPoolEfl.cpp:
841         (WebKit::WebProcessPool::platformInitializeWebProcess): Set m_networkProxySettings to parameters.
842         * UIProcess/gtk/WebProcessPoolGtk.cpp:
843         (WebKit::WebProcessPool::platformInitializeWebProcess): Ditto.
844         * UIProcess/soup/WebProcessPoolSoup.cpp:
845         (WebKit::WebProcessPool::platformInitializeNetworkProcess): Ditto.
846         (WebKit::WebProcessPool::setNetworkProxySettings): Update m_networkProxySettings and notify all processes.
847         * WebProcess/WebProcess.h:
848         * WebProcess/WebProcess.messages.in: Add SetNetworkProxySettings message.
849         * WebProcess/efl/WebProcessMainEfl.cpp: Use SoupNetworkSession::setProxySettingsFromEnvironment().
850         * WebProcess/soup/WebProcessSoup.cpp:
851         (WebKit::WebProcess::platformSetCacheModel): Remove comment that is no longer true.
852         (WebKit::WebProcess::platformInitializeWebProcess): Set proxy settings if provided by the user.
853         (WebKit::WebProcess::setNetworkProxySettings): Set global proxy settings and setup the proxy for all
854         existing contexts.
855
856 2017-01-19  Carlos Garcia Campos  <cgarcia@igalia.com>
857
858         [GTK] Do not update the backing store state unnecessarily when page visibility changes
859         https://bugs.webkit.org/show_bug.cgi?id=167195
860
861         Reviewed by Sergio Villar Senin.
862
863         I've noticed that we are receiving UpdateBackingStoreState messages in the web process even when size and scale
864         factor didn't change. That's quite unfortunate because we do a lot of work unnecessarily and we tell the
865         threaded compositor that the size changed. This is not only a problem because it's not true, but also because
866         changing the size is a sync operation in the threaded compositor, so we block the compositing thread for
867         nothing. This is happening because the WebPageProxy notifies the drawing area that the backing store is
868         discardable when the page is not visible, and that always produces a new backing store state. In accelerating
869         compositing mode we don't even have a backing store to discard, so we should check we have something to discard
870         and also make sure we only generate a new backing store state if we really discarded the backing store.
871
872         * UIProcess/DrawingAreaProxyImpl.cpp:
873         (WebKit::DrawingAreaProxyImpl::discardBackingStoreSoon):
874         (WebKit::DrawingAreaProxyImpl::discardBackingStore):
875
876 2017-01-18  Said Abou-Hallawa  <sabouhallawa@apple.com>
877
878         [iOS][WK2] Remove the WebView private configuration contentUpdateFrequency
879         https://bugs.webkit.org/show_bug.cgi?id=167188
880
881         Reviewed by Simon Fraser.
882
883         This patch reverts r209294. This configuration is not needed anymore.
884         The CADisplayLink::preferredFramesPerSecond for WK2 will be set to the
885         default value always.
886
887         * UIProcess/API/APIPageConfiguration.h:
888         (API::PageConfiguration::setAlwaysRunsAtForegroundPriority):
889         (API::PageConfiguration::contentUpdateFrequency): Deleted.
890         (API::PageConfiguration::setContentUpdateFrequency): Deleted.
891         (): Deleted.
892         * UIProcess/API/Cocoa/WKWebView.mm:
893         (-[WKWebView _initializeWithConfiguration:]):
894         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
895         (-[WKWebViewConfiguration init]):
896         (-[WKWebViewConfiguration copyWithZone:]):
897         (-[WKWebViewConfiguration _setAllowsInlineMediaPlaybackAfterFullscreen:]):
898         (-[WKWebViewConfiguration _contentUpdateFrequency]): Deleted.
899         (-[WKWebViewConfiguration _setContentUpdateFrequency:]): Deleted.
900         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
901         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h:
902         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
903         (-[WKOneShotDisplayLinkHandler initWithDrawingAreaProxy:]):
904         (WebKit::RemoteLayerTreeDrawingAreaProxy::contentUpdateFrequency): Deleted.
905
906 2017-01-18  Ryan Haddad  <ryanhaddad@apple.com>
907
908         Unreviewed, rolling out r210848.
909
910         This change introduced media-related LayoutTest failures and
911         crashes on macOS.
912
913         Reverted changeset:
914
915         "[Modern Media Controls] Turn modern media controls on by
916         default"
917         https://bugs.webkit.org/show_bug.cgi?id=165668
918         http://trac.webkit.org/changeset/210848
919
920 2017-01-18  Anders Carlsson  <andersca@apple.com>
921
922         Add instrumentation for when we fail to receive a message
923         https://bugs.webkit.org/show_bug.cgi?id=167179
924
925         Reviewed by Alexey Proskuryakov.
926
927         This will help us diagnose what the error from mach_msg is.
928
929         * Platform/IPC/mac/ConnectionMac.mm:
930         (IPC::readFromMachPort):
931
932 2017-01-18  Alex Christensen  <achristensen@webkit.org>
933
934         Fix CFURLConnection build on Mac
935         https://bugs.webkit.org/show_bug.cgi?id=167168
936
937         Reviewed by Andy Estes.
938
939         * NetworkProcess/Downloads/mac/DownloadMac.mm:
940         (WebKit::Download::resume):
941         (WebKit::Download::platformDidFinish):
942         (WebKit::Download::platformCancelNetworkLoad):
943         (WebKit::Download::startNetworkLoadWithHandle):
944         (WebKit::Download::startNetworkLoad):
945         (WebKit::Download::platformInvalidate):
946         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
947         (WebKit::NetworkDataTaskCocoa::allowsSpecificHTTPSCertificateForHost):
948         (WebKit::serverTrustCredential):
949         * Shared/Authentication/mac/AuthenticationManager.mac.mm:
950         (WebKit::AuthenticationManager::tryUseCertificateInfoForChallenge):
951         * config.h:
952
953 2017-01-18  Alex Christensen  <achristensen@webkit.org>
954
955         Modernize DelayedReply IPC code
956         https://bugs.webkit.org/show_bug.cgi?id=167176
957
958         Reviewed by Brady Eidson.
959
960         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
961         (WebKit::NetworkConnectionToWebProcess::performSynchronousLoad):
962         * NetworkProcess/NetworkConnectionToWebProcess.h:
963         * Platform/IPC/HandleMessage.h:
964         (IPC::callMemberFunctionImpl):
965         (IPC::callMemberFunction):
966         (IPC::handleMessageDelayed):
967         * Scripts/webkit/messages.py:
968         (message_to_struct_declaration):
969         (generate_message_handler):
970         * UIProcess/Databases/DatabaseProcessProxy.cpp:
971         (WebKit::DatabaseProcessProxy::getDatabaseProcessConnection):
972         * UIProcess/Databases/DatabaseProcessProxy.h:
973         * UIProcess/Network/NetworkProcessProxy.cpp:
974         (WebKit::NetworkProcessProxy::getNetworkProcessConnection):
975         (WebKit::NetworkProcessProxy::networkProcessCrashedOrFailedToLaunch):
976         * UIProcess/Network/NetworkProcessProxy.h:
977         * UIProcess/Plugins/PluginProcessManager.cpp:
978         (WebKit::PluginProcessManager::getPluginProcessConnection):
979         * UIProcess/Plugins/PluginProcessManager.h:
980         * UIProcess/Plugins/PluginProcessProxy.cpp:
981         (WebKit::PluginProcessProxy::getPluginProcessConnection):
982         * UIProcess/Plugins/PluginProcessProxy.h:
983         * UIProcess/WebPageProxy.cpp:
984         (WebKit::WebPageProxy::runJavaScriptAlert):
985         (WebKit::WebPageProxy::runJavaScriptConfirm):
986         * UIProcess/WebPageProxy.h:
987         * UIProcess/WebProcessPool.cpp:
988         (WebKit::WebProcessPool::getNetworkProcessConnection):
989         (WebKit::WebProcessPool::getDatabaseProcessConnection):
990         * UIProcess/WebProcessPool.h:
991         * UIProcess/WebProcessProxy.cpp:
992         (WebKit::WebProcessProxy::getPluginProcessConnection):
993         (WebKit::WebProcessProxy::getNetworkProcessConnection):
994         (WebKit::WebProcessProxy::getDatabaseProcessConnection):
995         * UIProcess/WebProcessProxy.h:
996
997 2017-01-18  Alex Christensen  <achristensen@webkit.org>
998
999         Fix CMake build.
1000
1001         * PlatformMac.cmake:
1002
1003 2017-01-18  Megan Gardner  <megan_gardner@apple.com>
1004
1005         Ignore Connection Assertion if we are not using connection to send messages
1006         https://bugs.webkit.org/show_bug.cgi?id=167022
1007
1008         Reviewed by Darin Adler.
1009
1010         Ask the process about a particular connection rather that getting it and making the     
1011         comparison ourselves. 
1012
1013         * UIProcess/ChildProcessProxy.h:
1014         (WebKit::ChildProcessProxy::hasConnection):
1015         Check to see the the ProcessProxy has this particular connection. This get around the assert
1016         that we would run into when just requesting the connection directly.
1017         * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
1018         (WebKit::WebPasteboardProxy::setPasteboardPathnamesForType):
1019         Use the new check instead of getting the raw connection.
1020
1021 2017-01-18  Andreas Kling  <akling@apple.com>
1022
1023         Document::securityOrigin() should return a reference.
1024         <https://webkit.org/b/167124>
1025
1026         Reviewed by Sam Weinig.
1027
1028         * UIProcess/Storage/StorageManager.cpp:
1029         (WebKit::StorageManager::createTransientLocalStorageMap):
1030         * WebProcess/Geolocation/GeolocationPermissionRequestManager.cpp:
1031         (WebKit::GeolocationPermissionRequestManager::startRequestForGeolocation):
1032         * WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp:
1033         (WKBundleFrameCopySecurityOrigin):
1034         * WebProcess/Plugins/PluginView.cpp:
1035         (WebKit::PluginView::storageBlockingStateChanged):
1036         (WebKit::PluginView::performFrameLoadURLRequest):
1037         (WebKit::PluginView::isPrivateBrowsingEnabled):
1038         * WebProcess/Plugins/WebPluginInfoProvider.cpp:
1039         (WebKit::WebPluginInfoProvider::getWebVisiblePluginInfo):
1040         * WebProcess/Storage/StorageAreaMap.cpp:
1041         (WebKit::StorageAreaMap::dispatchSessionStorageEvent):
1042         (WebKit::StorageAreaMap::dispatchLocalStorageEvent):
1043         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1044         (WebKit::WebChromeClient::exceededDatabaseQuota):
1045         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1046         (WebKit::WebFrameLoaderClient::didRunInsecureContent):
1047         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
1048         * WebProcess/WebPage/WebFrame.cpp:
1049         (WebKit::WebFrame::allowsFollowingLink):
1050
1051 2017-01-18  Antoine Quint  <graouts@apple.com>
1052
1053         [Modern Media Controls] Turn modern media controls on by default
1054         https://bugs.webkit.org/show_bug.cgi?id=165668
1055
1056         Reviewed by Dean Jackson.
1057
1058         Use DEFAULT_EXPERIMENTAL_FEATURES_ENABLED as the default value for modern media controls, which is true.
1059
1060         * Shared/WebPreferencesDefinitions.h:
1061
1062 2017-01-15  Darin Adler  <darin@apple.com>
1063
1064         Remove PassRefPtr from "loader" directory of WebCore
1065         https://bugs.webkit.org/show_bug.cgi?id=167055
1066
1067         Reviewed by Alex Christensen.
1068
1069         * Shared/APIWebArchive.h: Use RefPtr&& instead of PassRefPtr.
1070         * Shared/APIWebArchive.mm:
1071         (API::WebArchive::create): Ditto.
1072         (API::WebArchive::WebArchive): Ditto.
1073         (API::WebArchive::subresources): Ditto.
1074         (API::WebArchive::subframeArchives): Ditto.
1075
1076         * Shared/TextCheckerState.h: Initialize data members so classes
1077         using this won't have to explicitly initalize them.
1078
1079         * UIProcess/WebIconDatabase.cpp:
1080         (WebKit::WebIconDatabase::setIconDataForIconURL): Pass a raw
1081         pointer to WebCore.
1082
1083         * UIProcess/WebPageProxy.h: Removed forward declaration of
1084         StringPairVector, not needed here.
1085
1086         * WebProcess/IconDatabase/WebIconDatabaseProxy.cpp:
1087         (WebKit::WebIconDatabaseProxy::WebIconDatabaseProxy): Take a reference.
1088         (WebKit::WebIconDatabaseProxy::retainIconForPageURL): Updated for reference.
1089         (WebKit::WebIconDatabaseProxy::releaseIconForPageURL): Ditto.
1090         (WebKit::WebIconDatabaseProxy::synchronousIconForPageURL): Ditto.
1091         (WebKit::WebIconDatabaseProxy::loadDecisionForIconURL): Ditto.
1092         (WebKit::WebIconDatabaseProxy::receivedIconLoadDecision): Ditto.
1093         (WebKit::WebIconDatabaseProxy::iconDataForIconURL): Ditto.
1094         (WebKit::WebIconDatabaseProxy::setIconURLForPageURL): Ditto.
1095         (WebKit::WebIconDatabaseProxy::setIconDataForIconURL): Ditto.
1096         * WebProcess/IconDatabase/WebIconDatabaseProxy.h: Updated for the above.
1097         Marked the class final, made most functions private and final.
1098
1099         * WebProcess/InjectedBundle/InjectedBundleNavigationAction.cpp:
1100         (WebKit::InjectedBundleNavigationAction::InjectedBundleNavigationAction):
1101         Removed assertion that a pointer is non-null since that pointer is now a
1102         reference. Left use of PassRefPtr here for now.z
1103
1104         * WebProcess/Network/WebLoaderStrategy.cpp:
1105         (WebKit::WebLoaderStrategy::scheduleLoad): Updated since application cache
1106         host is now a reference rather thna a pointer.
1107         * WebProcess/Network/WebResourceLoader.cpp:
1108         (WebKit::WebResourceLoader::willSendRequest): Ditto.
1109         (WebKit::WebResourceLoader::didReceiveResponse): Ditto.
1110         (WebKit::WebResourceLoader::didFailResourceLoad): Ditto.
1111
1112         * WebProcess/Plugins/PluginView.cpp:
1113         (WebKit::buildHTTPHeaders): Got rid of unneeded use of String::format.
1114         (WebKit::PluginView::create): Take a reference instead of PassRefPtr.
1115         (WebKit::PluginView::PluginView): Ditto. Also moved much of the data
1116         member initialization to the class definition.
1117         (WebKit::PluginView::recreateAndInitialize): Take Ref&& instead of PassRefPtr.
1118         (WebKit::PluginView::manualLoadDidReceiveResponse): Updated for change to
1119         ManualStreamState enumeration.
1120         (WebKit::PluginView::manualLoadDidReceiveData): Ditto.
1121         (WebKit::PluginView::manualLoadDidFinishLoading Ditto.):
1122         (WebKit::PluginView::manualLoadDidFail): Ditto.
1123         (WebKit::PluginView::liveResourceData): Return RefPtr insead of PassRefPtr.
1124         (WebKit::PluginView::redeliverManualStream): Updated for ManualStreamState.
1125         * WebProcess/Plugins/PluginView.h: Updated for the above. Also changed
1126         ManualStreamState into an enum class.
1127
1128         * WebProcess/WebCoreSupport/WebChromeClient.cpp: Changed m_page to a reference.
1129         (WebKit::WebChromeClient::runOpenPanel): Take both arguments as references.
1130         * WebProcess/WebCoreSupport/WebChromeClient.h: Updated for the above.
1131
1132         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
1133         (WebKit::WebEditorClient::registerUndoStep): Take reference instead of PassRefPtr.
1134         (WebKit::WebEditorClient::registerRedoStep): Ditto.
1135         * WebProcess/WebCoreSupport/WebEditorClient.h: Updated for the above
1136
1137         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1138         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNewWindowAction):
1139         Updated for change to FrameLoaderClient.
1140         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction): Ditto.
1141         (WebKit::WebFrameLoaderClient::dispatchWillSendSubmitEvent): Ditto.
1142         (WebKit::WebFrameLoaderClient::dispatchWillSubmitForm): Ditto.
1143         (WebKit::WebFrameLoaderClient::createFrame): Ditto.
1144         (WebKit::WebFrameLoaderClient::createPlugin): Ditto.
1145         (WebKit::WebFrameLoaderClient::recreatePlugin): Ditto.
1146         (WebKit::WebFrameLoaderClient::createJavaAppletWidget): Ditto.
1147         (WebKit::WebFrameLoaderClient::createNetworkingContext): Ditto.
1148         (WebKit::WebFrameLoaderClient::didRequestAutocomplete): Ditto.
1149         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h: Updated for the above.
1150
1151         * WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm:
1152         (WebKit::WebChromeClient::didReceiveMobileDocType): Updated since m_page is a
1153         reference now.
1154         (WebKit::WebChromeClient::observedContentChange): Ditto.
1155         (WebKit::WebChromeClient::notifyRevealedSelectionByScrollingFrame): Ditto.
1156         (WebKit::WebChromeClient::didLayout): Ditto.
1157         (WebKit::WebChromeClient::didStartOverflowScroll): Ditto.
1158         (WebKit::WebChromeClient::didEndOverflowScroll): Ditto.
1159         (WebKit::WebChromeClient::hasStablePageScaleFactor): Ditto.
1160         (WebKit::WebChromeClient::showPlaybackTargetPicker): Ditto.
1161         (WebKit::WebChromeClient::eventThrottlingDelay): Ditto.
1162         (WebKit::WebChromeClient::deviceOrientation): Ditto.
1163
1164         * WebProcess/WebPage/WebPage.cpp:
1165         (WebKit::WebPage::WebPage): Pass reference.
1166         (WebKit::WebPage::createPlugin): Return RefPtr instead of PassRefPtr.
1167         (WebKit::WebPage::fromCorePage): Updated for change to WebChromeClient.
1168         (WebKit::WebPage::setHeaderPageBanner): Take pointer instead of PassRefPtr.
1169         (WebKit::WebPage::setFooterPageBanner): Ditto.
1170         (WebKit::WebPage::setActiveOpenPanelResultListener): Take Ref&& instead of
1171         PassRefPtr.
1172         (WebKit::WebPage::currentSelectionAsRange): Return RefPtr instead of PassRefPtr.
1173         (WebKit::WebPage::rangeFromEditingRange): Ditto.
1174         * WebProcess/WebPage/WebPage.h: Updated for the above.
1175
1176         * WebProcess/WebPage/efl/WebPageEfl.cpp:
1177         (WebKit::WebPage::cachedResponseDataForURL): Return RefPtr instead of PassRefPtr.
1178         * WebProcess/WebPage/gtk/WebPageGtk.cpp:
1179         (WebKit::WebPage::cachedResponseDataForURL): Ditto.
1180         * WebProcess/WebPage/ios/WebPageIOS.mm:
1181         (WebKit::WebPage::cachedResponseDataForURL): Ditto.
1182         * WebProcess/WebPage/mac/WebPageMac.mm:
1183         (WebKit::WebPage::cachedResponseDataForURL): Ditto.
1184         (WebKit::WebPage::setTopOverhangImage): Take raw pointer instead of PassRefPtr.
1185         (WebKit::WebPage::setBottomOverhangImage): Ditto.
1186
1187         * WebProcess/WebProcess.cpp:
1188         (WebKit::WebProcess::WebProcess): Pass a reference. Move most initialization to
1189         the class definition.
1190         * WebProcess/WebProcess.h: Updaed for the above.
1191
1192 2017-01-17  Michael Catanzaro  <mcatanzaro@igalia.com>
1193
1194         Unreviewed, rolling out r210834
1195         https://bugs.webkit.org/show_bug.cgi?id=165668
1196
1197         It introduced dozens of test timeouts.
1198
1199         Reverted changeset:
1200         "[Modern Media Controls] Turn modern media controls on by default"
1201         https://bugs.webkit.org/show_bug.cgi?id=165668
1202         http://trac.webkit.org/changeset/210834
1203
1204 2017-01-17  Antti Koivisto  <antti@apple.com>
1205
1206         Persist derived data
1207         https://bugs.webkit.org/show_bug.cgi?id=167136
1208
1209         Reviewed by Andreas Kling.
1210
1211         Add a mechanism for storing arbitrary data into disk cache.
1212
1213         From WebCore level data can be stored using
1214
1215             loaderStrategy()->storeDerivedDataToCache(key, partition, type, data);
1216
1217         The data is keyed with the body hash of a network resource. It can be retrieved along
1218         with the resource by specifying the type in ResourceLoaderOptions. If a related data
1219         blob is found it will be deliver via CachedResource::didRetrieveDerivedDataFromCache()
1220         callback.
1221
1222         This patch adds the mechanism but doesn't yet use it for anything.
1223
1224         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1225         (WebKit::NetworkConnectionToWebProcess::storeDerivedDataToCache):
1226         * NetworkProcess/NetworkConnectionToWebProcess.h:
1227         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
1228         * NetworkProcess/NetworkResourceLoadParameters.cpp:
1229         (WebKit::NetworkResourceLoadParameters::encode):
1230         (WebKit::NetworkResourceLoadParameters::decode):
1231         * NetworkProcess/NetworkResourceLoadParameters.h:
1232         * NetworkProcess/NetworkResourceLoader.cpp:
1233         (WebKit::NetworkResourceLoader::didRetrieveCacheEntry):
1234
1235             Look for related resources to return if needed.
1236
1237         (WebKit::NetworkResourceLoader::sendResultForCacheEntry):
1238         * NetworkProcess/NetworkResourceLoader.h:
1239         * NetworkProcess/cache/NetworkCache.cpp:
1240         (WebKit::NetworkCache::resourceType):
1241          (WebKit::NetworkCache::Cache::retrieveData):
1242         (WebKit::NetworkCache::Cache::storeData):
1243         (WebKit::NetworkCache::Cache::makeCacheKey): Deleted.
1244         * NetworkProcess/cache/NetworkCache.h:
1245         * NetworkProcess/cache/NetworkCacheEntry.cpp:
1246         (WebKit::NetworkCache::Entry::encodeAsStorageRecord):
1247         (WebKit::NetworkCache::Entry::decodeStorageRecord):
1248         * NetworkProcess/cache/NetworkCacheKey.cpp:
1249         (WebKit::NetworkCache::Key::Key):
1250         * NetworkProcess/cache/NetworkCacheKey.h:
1251         (WebKit::NetworkCache::DataKey::encode):
1252         (WebKit::NetworkCache::DataKey::decode):
1253         * NetworkProcess/cache/NetworkCacheStorage.cpp:
1254         (WebKit::NetworkCache::Storage::readRecord):
1255         (WebKit::NetworkCache::Storage::traverse):
1256         * NetworkProcess/cache/NetworkCacheStorage.h:
1257
1258             Return body hash with the Record.
1259
1260         * NetworkProcess/cache/NetworkCacheSubresourcesEntry.cpp:
1261         (WebKit::NetworkCache::SubresourcesEntry::encodeAsStorageRecord):
1262         * Platform/IPC/ArgumentCoders.cpp:
1263         (IPC::ArgumentCoder<SHA1::Digest>::encode):
1264         (IPC::ArgumentCoder<SHA1::Digest>::decode):
1265         * Platform/IPC/ArgumentCoders.h:
1266         * WebProcess/Network/WebLoaderStrategy.cpp:
1267         (WebKit::WebLoaderStrategy::scheduleLoad):
1268         (WebKit::WebLoaderStrategy::storeDerivedDataToCache):
1269         * WebProcess/Network/WebLoaderStrategy.h:
1270         * WebProcess/Network/WebResourceLoader.cpp:
1271         (WebKit::WebResourceLoader::didRetrieveDerivedData):
1272         * WebProcess/Network/WebResourceLoader.h:
1273         * WebProcess/Network/WebResourceLoader.messages.in:
1274
1275 2017-01-17  Antoine Quint  <graouts@apple.com>
1276
1277         [Modern Media Controls] Turn modern media controls on by default
1278         https://bugs.webkit.org/show_bug.cgi?id=165668
1279
1280         Reviewed by Dean Jackson.
1281
1282         Use DEFAULT_EXPERIMENTAL_FEATURES_ENABLED as the default value for modern media controls, which is true.
1283
1284         * Shared/WebPreferencesDefinitions.h:
1285
1286 2017-01-17  Joseph Pecoraro  <pecoraro@apple.com>
1287
1288         ENABLE(USER_TIMING) Not Defined for Apple Windows or OS X Ports
1289         https://bugs.webkit.org/show_bug.cgi?id=116551
1290         <rdar://problem/13949830>
1291
1292         Reviewed by Alex Christensen.
1293
1294         * Configurations/FeatureDefines.xcconfig:
1295
1296 2017-01-17  Filip Pizlo  <fpizlo@apple.com>
1297
1298         JSCell::classInfo() shouldn't have a bunch of mitigations for being called during destruction
1299         https://bugs.webkit.org/show_bug.cgi?id=167066
1300
1301         Reviewed by Keith Miller and Michael Saboff.
1302         
1303         Just remove now-erroneous use of jsCast<>.
1304
1305         * WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp:
1306         (WebKit::NPRuntimeObjectMap::finalize):
1307
1308 2017-01-17  Joseph Pecoraro  <pecoraro@apple.com>
1309
1310         Remove unnecessary includes
1311         https://bugs.webkit.org/show_bug.cgi?id=167114
1312
1313         Reviewed by Alex Christensen.
1314
1315         * WebProcess/WebPage/ios/WebPageIOS.mm:
1316
1317 2017-01-17  Brady Eidson  <beidson@apple.com>
1318
1319         An update to one gamepad's values should only change that gamepad's modified timestamp.
1320         <rdar://problem/28620865> and https://bugs.webkit.org/show_bug.cgi?id=167139
1321
1322         Reviewed by Andy Estes.
1323
1324         Track the lastModifiedTime for a gamepad in the UI process, and pass it along to web processes.
1325
1326         * Shared/Gamepad/GamepadData.cpp:
1327         (WebKit::GamepadData::GamepadData):
1328         (WebKit::GamepadData::encode):
1329         (WebKit::GamepadData::decode):
1330         * Shared/Gamepad/GamepadData.h:
1331         (WebKit::GamepadData::lastUpdateTime):
1332
1333         * UIProcess/Gamepad/UIGamepad.cpp:
1334         (WebKit::UIGamepad::UIGamepad):
1335         (WebKit::UIGamepad::updateFromPlatformGamepad):
1336         (WebKit::UIGamepad::condensedGamepadData):
1337         (WebKit::UIGamepad::fullGamepadData):
1338         * UIProcess/Gamepad/UIGamepad.h:
1339
1340         * WebProcess/Gamepad/WebGamepad.cpp:
1341         (WebKit::WebGamepad::updateValues):
1342
1343 2017-01-17  Anders Carlsson  <andersca@apple.com>
1344
1345         It's not possible to perform a POST request with HTTPBody content in a WKWebView
1346         https://bugs.webkit.org/show_bug.cgi?id=167131
1347         rdar://problem/20464240
1348
1349         Reviewed by Beth Dakin.
1350
1351         Encode/decode the form data if necessary.
1352
1353         * Shared/LoadParameters.cpp:
1354         (WebKit::LoadParameters::encode):
1355         (WebKit::LoadParameters::decode):
1356
1357 2017-01-17  Joseph Pecoraro  <pecoraro@apple.com>
1358
1359         Crash when closing tab with debugger paused
1360         https://bugs.webkit.org/show_bug.cgi?id=161746
1361         <rdar://problem/15607819>
1362
1363         Reviewed by Brian Burg and Brent Fulgham.
1364
1365         * WebProcess/WebPage/WebPage.cpp:
1366         (WebKit::DeferredPageDestructor::createDeferredPageDestructor):
1367         (WebKit::DeferredPageDestructor::DeferredPageDestructor):
1368         (WebKit::DeferredPageDestructor::tryDestruction):
1369         (WebKit::WebPage::close):
1370         Defer destruction of the Page and WebPage if we are in a nested runloop.
1371         Also, proactively close all inspector frontends, including remote frontends.
1372
1373         * WebProcess/WebPage/ios/WebPageIOS.mm:
1374         (WebKit::WebPage::handleSyntheticClick):
1375         (WebKit::WebPage::completeSyntheticClick):
1376         Return early in some cases where a nested run loop may have closed
1377         the WebPage on us while handling JavaScript events.
1378
1379 2017-01-16  Joseph Pecoraro  <pecoraro@apple.com>
1380
1381         Remove the REQUEST_ANIMATION_FRAME flag
1382         https://bugs.webkit.org/show_bug.cgi?id=156980
1383         <rdar://problem/25906849>
1384
1385         Reviewed by Simon Fraser.
1386
1387         * Configurations/FeatureDefines.xcconfig:
1388         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1389         * WebProcess/WebCoreSupport/WebChromeClient.h:
1390         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
1391         (WebKit::CompositingCoordinator::syncDisplayState):
1392         (WebKit::CompositingCoordinator::nextAnimationServiceTime):
1393         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h:
1394         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
1395         (WebKit::CoordinatedLayerTreeHost::scheduleAnimation):
1396         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h:
1397         * WebProcess/WebPage/LayerTreeHost.h:
1398
1399 2017-01-16  Carlos Garcia Campos  <cgarcia@igalia.com>
1400
1401         [SOUP] Accept-language could be set twice in a row for the default context
1402         https://bugs.webkit.org/show_bug.cgi?id=167089
1403
1404         Reviewed by Žan Doberšek.
1405
1406         * NetworkProcess/CustomProtocols/soup/CustomProtocolManagerSoup.cpp:
1407         (WebKit::CustomProtocolManager::registerScheme): Use NetworkStorageSession::getOrCreateSoupNetworkSession().
1408         * NetworkProcess/efl/NetworkProcessMainEfl.cpp:
1409         * NetworkProcess/soup/NetworkProcessSoup.cpp:
1410         (WebKit::NetworkProcess::userPreferredLanguagesChanged): Only set the languages if NetworkStorageSession has a
1411         SoupNetworkSession.
1412         * NetworkProcess/soup/NetworkSessionSoup.cpp:
1413         (WebKit::NetworkSessionSoup::soupSession): Use NetworkStorageSession::getOrCreateSoupNetworkSession().
1414         * WebProcess/Cookies/soup/WebCookieManagerSoup.cpp:
1415         (WebKit::WebCookieManager::setCookiePersistentStorage): Ditto.
1416         * WebProcess/efl/WebProcessMainEfl.cpp:
1417
1418 2017-01-16  Carlos Garcia Campos  <cgarcia@igalia.com>
1419
1420         [SOUP] Fix handling of accept language property
1421         https://bugs.webkit.org/show_bug.cgi?id=166969
1422
1423         Reviewed by Michael Catanzaro.
1424
1425         * NetworkProcess/soup/NetworkProcessSoup.cpp:
1426         (WebKit::buildAcceptLanguages): Moved from WebCore.
1427         (WebKit::NetworkProcess::userPreferredLanguagesChanged): Build the accept language string from the vector and
1428         pass set it to SoupNetworkSession to be used for new sessions, and also to all other existing sessions.
1429
1430 2017-01-14  Tim Horton  <timothy_horton@apple.com>
1431
1432         Remove unused WKView initializer parameter
1433         https://bugs.webkit.org/show_bug.cgi?id=167046
1434
1435         Reviewed by Dan Bernstein.
1436
1437         * UIProcess/API/mac/WKView.mm:
1438         (-[WKView initWithFrame:processPool:configuration:]):
1439         (-[WKView initWithFrame:contextRef:pageGroupRef:relatedToPage:]):
1440         (-[WKView initWithFrame:configurationRef:]):
1441         (-[WKView initWithFrame:processPool:configuration:webView:]): Deleted.
1442         * UIProcess/API/mac/WKViewInternal.h:
1443         Ever since WKWebView stopped having WKView inside it, this parameter
1444         has never been used. Now, it only leads to confusion.
1445
1446 2017-01-13  Joseph Pecoraro  <pecoraro@apple.com>
1447
1448         Remove ENABLE(DETAILS_ELEMENT) guards
1449         https://bugs.webkit.org/show_bug.cgi?id=167042
1450
1451         Reviewed by Alex Christensen.
1452
1453         * Configurations/FeatureDefines.xcconfig:
1454
1455 2017-01-13  Brady Eidson  <beidson@apple.com>
1456
1457         Crash when visiting a webpage that uses Gamepads in a new WebProcess after a previous page has used gamepads..
1458         https://bugs.webkit.org/show_bug.cgi?id=167033
1459
1460         Reviewed by Alex Christensen.
1461
1462         * UIProcess/Gamepad/UIGamepadProvider.cpp:
1463         (WebKit::UIGamepadProvider::processPoolStartedUsingGamepads): Don't schedule a state update here.
1464         (WebKit::UIGamepadProvider::processPoolStoppedUsingGamepads): Ditto.
1465         * UIProcess/Gamepad/UIGamepadProvider.h:
1466         
1467         * UIProcess/WebProcessPool.cpp:
1468         (WebKit::WebProcessPool::startedUsingGamepads): Populate the WebProcess with initial gamepads.
1469
1470 2017-01-11  Darin Adler  <darin@apple.com>
1471
1472         Remove PassRefPtr from more of "platform"
1473         https://bugs.webkit.org/show_bug.cgi?id=166809
1474
1475         Reviewed by Sam Weinig.
1476
1477         * Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.cpp:
1478         (IPC::ArgumentCoder<TextureMapperAnimation>::encode): Updated since timing function
1479         returns a raw pointer.
1480         (IPC::ArgumentCoder<TextureMapperAnimation>::decode): Updated since timing function
1481         setters now takes an rvalue reference.
1482
1483         * WebProcess/Plugins/PDF/DeprecatedPDFPlugin.mm:
1484         (WebKit::PDFPlugin::createScrollbar): Updated since addChild now takes a reference.
1485
1486 2017-01-13  Chris Dumez  <cdumez@apple.com>
1487
1488         [WK2] Add diagnostic logging to measure WebGL usage
1489         https://bugs.webkit.org/show_bug.cgi?id=166730
1490         <rdar://problem/29883469>
1491
1492         Reviewed by Alex Christensen.
1493
1494         Add diagnostic logging to measure high performance WebGL usage. We report
1495         at regular intervals in which WebGL state Safari is:
1496         - Inactive
1497         - ActiveInForegroundTab
1498         - ActiveInBackgroundTabOnly
1499
1500         This should give us an estimate of:
1501         - What % of the time is Safari using high performance graphics
1502         - What % of this time is only due to background tabs
1503
1504         * UIProcess/HighPerformanceGraphicsUsageSampler.cpp: Added.
1505         (WebKit::HighPerformanceGraphicsUsageSampler::HighPerformanceGraphicsUsageSampler):
1506         (WebKit::HighPerformanceGraphicsUsageSampler::timerFired):
1507         * UIProcess/HighPerformanceGraphicsUsageSampler.h: Copied from Source/WebCore/platform/graphics/GraphicsContext3DAttributes.h.
1508         * UIProcess/WebPageProxy.h:
1509         (WebKit::WebPageProxy::setIsUsingHighPerformanceWebGL):
1510         (WebKit::WebPageProxy::isUsingHighPerformanceWebGL):
1511         * UIProcess/WebPageProxy.messages.in:
1512         * UIProcess/WebProcessPool.cpp:
1513         (WebKit::m_highPerformanceGraphicsUsageSampler):
1514         * UIProcess/WebProcessPool.h:
1515         * WebKit2.xcodeproj/project.pbxproj:
1516         * WebProcess/WebPage/WebPage.cpp:
1517         (WebKit::m_userInterfaceLayoutDirection):
1518
1519 2017-01-13  Matt Rajca  <mrajca@apple.com>
1520
1521         Defer use of autoplay heuristics to clients
1522         https://bugs.webkit.org/show_bug.cgi?id=167010
1523
1524         Reviewed by Alex Christensen.
1525
1526         Switch the autoplay policy tristate to an on/off option since clients should run any
1527         heuristics and simply send their final decision to WebKit.
1528
1529         * Shared/WebsitePolicies.h:
1530         (WebKit::WebsitePolicies::encode):
1531         (WebKit::WebsitePolicies::decode):
1532         * UIProcess/API/APIWebsitePolicies.h:
1533         * UIProcess/API/C/WKWebsitePolicies.cpp:
1534         (WKWebsitePoliciesGetAutoplayEnabled):
1535         (WKWebsitePoliciesSetAutoplayEnabled):
1536         (WKWebsitePoliciesGetAutoplayPolicy): Replaced.
1537         (WKWebsitePoliciesSetAutoplayPolicy): Replaced.
1538         * UIProcess/API/C/WKWebsitePolicies.h:
1539         * UIProcess/API/Cocoa/_WKWebsitePolicies.h:
1540         * UIProcess/API/Cocoa/_WKWebsitePolicies.mm:
1541         (-[_WKWebsitePolicies setAutoplayEnabled:]):
1542         (-[_WKWebsitePolicies autoplayEnabled]):
1543         (-[_WKWebsitePolicies setAutoplayPolicy:]): Replaced.
1544         (-[_WKWebsitePolicies autoplayPolicy]): Replaced.
1545
1546 2017-01-13  Carlos Garcia Campos  <cgarcia@igalia.com>
1547
1548         [SOUP] Simplify cookie storage handling
1549         https://bugs.webkit.org/show_bug.cgi?id=166967
1550
1551         Reviewed by Sergio Villar Senin.
1552
1553         Get the SoupSession from NetworkStorageSession::defaultStorageSession().
1554
1555         * NetworkProcess/CustomProtocols/soup/CustomProtocolManagerSoup.cpp:
1556         (WebKit::CustomProtocolManager::registerScheme): Get the SoupSession from NetworkStorageSession::defaultStorageSession().
1557         * NetworkProcess/efl/NetworkProcessMainEfl.cpp: Ditto.
1558         * NetworkProcess/soup/NetworkProcessSoup.cpp:
1559         (WebKit::NetworkProcess::userPreferredLanguagesChanged): Ditto.
1560         (WebKit::NetworkProcess::platformInitializeNetworkProcess): SoupNetworkSession::clearOldSoupCache is static.
1561         * WebProcess/Cookies/soup/WebCookieManagerSoup.cpp:
1562         (WebKit::WebCookieManager::platformGetHTTPCookieAcceptPolicy): Use the cookie storage from NetworkStorageSession::defaultStorageSession().
1563         (WebKit::WebCookieManager::setCookiePersistentStorage): Ditto.
1564         * WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.cpp:
1565         (WebKit::WebFrameNetworkingContext::setCookieAcceptPolicyForAllContexts): Ditto.
1566         * WebProcess/efl/WebProcessMainEfl.cpp:
1567
1568 2017-01-12  Carlos Garcia Campos  <cgarcia@igalia.com>
1569
1570         [SOUP] Do not use the legacy session ID in WebFrameNetworkingContext::storageSession()
1571         https://bugs.webkit.org/show_bug.cgi?id=166970
1572
1573         Reviewed by Sergio Villar Senin.
1574
1575         Get the session for the current page instead.
1576
1577         * WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.cpp:
1578         (WebKit::WebFrameNetworkingContext::storageSession):
1579
1580 2017-01-12  Joseph Pecoraro  <pecoraro@apple.com>
1581
1582         Remove unnecessary includes of Page.h
1583         https://bugs.webkit.org/show_bug.cgi?id=166996
1584
1585         Reviewed by Yusuke Suzuki.
1586
1587         * WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp:
1588
1589 2017-01-12  Chris Dumez  <cdumez@apple.com>
1590
1591         Add KEYBOARD_KEY_ATTRIBUTE / KEYBOARD_CODE_ATTRIBUTE to FeatureDefines.xcconfig
1592         https://bugs.webkit.org/show_bug.cgi?id=166995
1593
1594         Reviewed by Jer Noble.
1595
1596         Add KEYBOARD_KEY_ATTRIBUTE / KEYBOARD_CODE_ATTRIBUTE to FeatureDefines.xcconfig
1597         as some people are having trouble building without it.
1598
1599         * Configurations/FeatureDefines.xcconfig:
1600         * Shared/WebKeyboardEvent.cpp:
1601         (WebKit::WebKeyboardEvent::WebKeyboardEvent):
1602
1603 2017-01-12  Chris Dumez  <cdumez@apple.com>
1604
1605         [iOS] HTML form validation popover sometimes does not go away
1606         https://bugs.webkit.org/show_bug.cgi?id=166990
1607         <rdar://problem/29985957>
1608
1609         Reviewed by Tim Horton.
1610
1611         Update code using ValidationBubble now that it is RefCounted.
1612
1613         * UIProcess/PageClient.h:
1614         * UIProcess/WebPageProxy.h:
1615         * UIProcess/ios/PageClientImplIOS.h:
1616         * UIProcess/ios/PageClientImplIOS.mm:
1617         (WebKit::PageClientImpl::createValidationBubble):
1618         * UIProcess/mac/PageClientImpl.h:
1619         * UIProcess/mac/PageClientImpl.mm:
1620         (WebKit::PageClientImpl::createValidationBubble):
1621
1622 2017-01-12  Enrica Casucci  <enrica@apple.com>
1623
1624         Do not allow selection of editable content when not editing.
1625         https://bugs.webkit.org/show_bug.cgi?id=166897
1626         <rdar://problem/29388806>
1627
1628         Reviewed by Tim Horton.
1629
1630         Test: fast/events/touch/ios/long-press-on-editable.html
1631
1632         When retrieving the position information, we should not consider
1633         as candidates for selection editable elements, since this is only
1634         used for non editable selections.
1635
1636         * WebProcess/WebPage/ios/WebPageIOS.mm:
1637         (WebKit::isAssistableElement): Moved within the file.
1638         (WebKit::WebPage::getPositionInformation):
1639
1640 2017-01-12  Megan Gardner  <megan_gardner@apple.com>
1641
1642         Double Check URLs on UI side before putting in pasteboard
1643         https://bugs.webkit.org/show_bug.cgi?id=166945
1644         <rdar://problem/11187315>
1645
1646         Reviewed by Tim Horton.
1647
1648         Check URLs sent from the web process before putting the on pasteboard.
1649
1650         * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
1651         (WebKit::WebPasteboardProxy::setPasteboardPathnamesForType):
1652         Add a check to make sure the URLs we've received are valid and not compromising to the user's system.
1653
1654         * UIProcess/WebPasteboardProxy.cpp:
1655         (WebKit::WebPasteboardProxy::addWebProcessProxy):
1656         Keep track of the webProcesses associated with the pasteboard proxies specifically, so that we can
1657         use it to check the URLs before putting them on pasteboard.
1658         (WebKit::WebPasteboardProxy::removeWebProcessProxy):
1659         Remove dead webProcesses.
1660
1661         * UIProcess/WebPasteboardProxy.h:
1662         * UIProcess/WebPasteboardProxy.messages.in:
1663         Allow for the connection to be passed in, so that we can determine which webProcess we need to
1664         check the URLs of.
1665
1666         * UIProcess/WebProcessProxy.cpp:
1667         (WebKit::WebProcessProxy::~WebProcessProxy):
1668         Make sure to remove WebProcessProxys from the list stored in WebPasteboardProxy
1669
1670 2017-01-12  Chris Dumez  <cdumez@apple.com>
1671
1672         [iOS] Implement support for KeyboardEvent.code
1673         https://bugs.webkit.org/show_bug.cgi?id=166932
1674         <rdar://problem/29972518>
1675
1676         Reviewed by Darin Adler.
1677
1678         Make sure KeyboardEvent.code is properly initialized on
1679         iOS WK2.
1680
1681         * Shared/WebEvent.h:
1682         * Shared/WebKeyboardEvent.cpp:
1683         (WebKit::WebKeyboardEvent::WebKeyboardEvent):
1684         * Shared/ios/WebIOSEventFactory.mm:
1685         (WebIOSEventFactory::createWebKeyboardEvent):
1686
1687 2017-01-12  Andreas Kling  <akling@apple.com>
1688
1689         WebBackForwardListProxy should remove restored session history items from PageCache on close.
1690         <https://webkit.org/b/166972>
1691         <rdar://problem/28904157>
1692
1693         Reviewed by Brady Eidson.
1694
1695         Register history item ID's from the UIProcess with the associated-items map
1696         so that we can remove any PageCache entries associated with them immediately
1697         when closing a WebPage.
1698
1699         Otherwise they might not get removed until the next PageCache pruning happens.
1700         This patch is a speculative fix for what looks like it might be weirdness
1701         related to a PageCache entry outliving its originating Page.
1702
1703         * WebProcess/WebPage/WebBackForwardListProxy.cpp:
1704         (WebKit::WebBackForwardListProxy::addItemFromUIProcess):
1705         * WebProcess/WebPage/WebBackForwardListProxy.h:
1706         * WebProcess/WebPage/WebPage.cpp:
1707         (WebKit::WebPage::restoreSessionInternal):
1708
1709 2017-01-12  Michael Catanzaro  <mcatanzaro@igalia.com>
1710
1711         [GTK] Correct license on WebKitSecurityOrigin headers
1712
1713         These ought to be LGPLv2+, because the rest of the GTK+ API is LPGLv2+.
1714
1715         * UIProcess/API/gtk/WebKitSecurityOrigin.cpp:
1716         * UIProcess/API/gtk/WebKitSecurityOrigin.h:
1717         * UIProcess/API/gtk/WebKitSecurityOriginPrivate.h:
1718
1719 2017-01-12  Eric Carlson  <eric.carlson@apple.com>
1720
1721         [MediaStream, Mac] Render media stream audio buffers
1722         https://bugs.webkit.org/show_bug.cgi?id=159836
1723         <rdar://problem/27380390>
1724
1725         Unreviewed, revert accidental change.
1726
1727         * WebProcess/com.apple.WebProcess.sb.in:
1728
1729 2017-01-11  Brady Eidson  <beidson@apple.com>
1730
1731         Add IconLoadingDelegate functionality to WKView.
1732         https://bugs.webkit.org/show_bug.cgi?id=166951
1733
1734         Reviewed by Tim Horton.
1735         
1736         * UIProcess/API/mac/WKView.mm:
1737         (-[WKView dealloc]):
1738         (-[WKView maybeInstallIconLoadingClient]): If the subclass implements the delegate method, install the
1739           icon loading client. Otherwise, maintain the normal IconDatabase loading behavior.
1740         (-[WKView initWithFrame:processPool:configuration:webView:]):
1741
1742 2017-01-11  Brent Fulgham  <bfulgham@apple.com>
1743
1744         [WK2][Cocoa] Avoid null dereference in FullScreen code.
1745         https://bugs.webkit.org/show_bug.cgi?id=166957
1746         <rdar://problem/27745004>
1747
1748         Reviewed by Eric Carlson.
1749
1750         * WebProcess/cocoa/WebVideoFullscreenManager.mm:
1751         (WebKit::WebVideoFullscreenManager::didSetupFullscreen): Use protected reference to 'this', and check for valid
1752         page before attempting to use it.
1753
1754 2017-01-11  Anders Carlsson  <andersca@apple.com>
1755
1756         navigator.plugins.refresh and WKContextRefreshPlugIns doesn't pick up changes to already-present plug-ins
1757         https://bugs.webkit.org/show_bug.cgi?id=166942
1758         rdar://problem/29839194
1759
1760         Reviewed by Sam Weinig.
1761
1762         Use _CFBundleCreateUnique so the resulting bundle won't be cached.
1763
1764         * Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm:
1765         (WebKit::NetscapePluginModule::getPluginInfo):
1766
1767 2017-01-11  Anders Carlsson  <andersca@apple.com>
1768
1769         REGRESSION: Crash in com.apple.WebKit: IPC::Connection::sendMessage(std::__1::unique_ptr<IPC::MachMessage, std::__1::default_delete<IPC::MachMessage> >) + 27
1770         https://bugs.webkit.org/show_bug.cgi?id=165854
1771         rdar://problem/29757269
1772
1773         Reviewed by Tim Horton.
1774
1775         * Platform/IPC/mac/ConnectionMac.mm:
1776         (IPC::Connection::sendMessage):
1777         Add assertion.
1778
1779         (IPC::Connection::initializeSendSource):
1780         Turns out the event handler can be called spuriously, so guard against that.
1781
1782 2017-01-11  Chris Dumez  <cdumez@apple.com>
1783
1784         [iOS][WK2] KeyboardEvent.key always returns an empty string
1785         https://bugs.webkit.org/show_bug.cgi?id=166918
1786         <rdar://problem/29861147>
1787
1788         Reviewed by Wenson Hsieh.
1789
1790         Make sure that KeyboardEvent.key gets properly initialized on iOS / WK2.
1791
1792         * Shared/WebEvent.h:
1793         * Shared/WebKeyboardEvent.cpp:
1794         (WebKit::WebKeyboardEvent::WebKeyboardEvent):
1795         * Shared/ios/WebIOSEventFactory.mm:
1796         (WebIOSEventFactory::createWebKeyboardEvent):
1797
1798 2017-01-10  Michael Catanzaro  <mcatanzaro@igalia.com>
1799
1800         [GTK] No way for applications to set notification permissions without waiting for permission request
1801         https://bugs.webkit.org/show_bug.cgi?id=163366
1802
1803         Reviewed by Carlos Garcia Campos.
1804
1805         Websites can check the Notification.permission DOM property to check if they have permission
1806         to show notifications *without triggering a permission request*. But the WebKitGTK+ API has
1807         no way to affirmatively indicate notifications are allowed without a permission request. The
1808         only way is via the permission request API, which is too late. It's a problem for Epiphany.
1809         For example, open the Riot Matrix client in a web app; you will immediately see an info bar
1810         informing the user that Riot does not have permission to send desktop notifications, even
1811         though Epiphany automatically grants notification permission in web app mode when requested.
1812         This problem is not exclusive to web apps; there is simply no way for notification
1813         permission to be set correctly prior to a permission request for it. Fix this by introducing
1814         a webkit_web_context_initialize_notification_permissions() API, and add a signal
1815         WebKitWebContext::initialize-notification-permissions to indicate when it should be called.
1816
1817         * UIProcess/API/gtk/WebKitNotificationProvider.cpp:
1818         (notificationPermissionsCallback):
1819         (WebKitNotificationProvider::create):
1820         (WebKitNotificationProvider::WebKitNotificationProvider):
1821         (WebKitNotificationProvider::notificationPermissions):
1822         (WebKitNotificationProvider::setNotificationPermissions):
1823         * UIProcess/API/gtk/WebKitNotificationProvider.h:
1824         * UIProcess/API/gtk/WebKitSecurityOrigin.cpp:
1825         (webkitSecurityOriginGetSecurityOrigin):
1826         * UIProcess/API/gtk/WebKitSecurityOriginPrivate.h:
1827         * UIProcess/API/gtk/WebKitWebContext.cpp:
1828         (webkitWebContextConstructed):
1829         (webkit_web_context_class_init):
1830         (addOriginToMap):
1831         (webkit_web_context_initialize_notification_permissions):
1832         (webkitWebContextInitializeNotificationPermissions):
1833         * UIProcess/API/gtk/WebKitWebContext.h:
1834         * UIProcess/API/gtk/WebKitWebContextPrivate.h:
1835         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
1836
1837 2017-01-10  Keith Rollin  <krollin@apple.com>
1838
1839         Record/replay: fix range used for fuzzy matching
1840         https://bugs.webkit.org/show_bug.cgi?id=166041
1841
1842         Reviewed by Darin Adler and Alex Christensen.
1843
1844         Because of two bugs, the attempt to determine the range of URLs to
1845         check as part of the process of fuzzy matching was failing. The intent
1846         was to find the range of URLs that started with the same
1847         <scheme://host:port> as a given URL. However, because of a reversed
1848         test, the upper end of the range ended up being the "end()" iterator
1849         of the entire collection of URLs. With that fixed, there was another
1850         bug due to one URL being given as <scheme://host:port> and the other
1851         given as <scheme://host:port/> (note the trailing slash). Both of
1852         these issues are now fixed.
1853
1854         * NetworkProcess/capture/NetworkCaptureManager.cpp:
1855         (WebKit::NetworkCapture::Manager::initialize):
1856         (WebKit::NetworkCapture::Manager::findBestFuzzyMatch):
1857         (WebKit::NetworkCapture::Manager::urlIdentifyingCommonDomain):
1858         * NetworkProcess/capture/NetworkCaptureManager.h:
1859         * NetworkProcess/capture/NetworkCaptureResource.cpp:
1860         (WebKit::NetworkCapture::Resource::url):
1861         (WebKit::NetworkCapture::Resource::urlIdentifyingCommonDomain):
1862         (WebKit::NetworkCapture::Resource::baseURL): Deleted.
1863         * NetworkProcess/capture/NetworkCaptureResource.h:
1864
1865 2017-01-10  Wenson Hsieh  <wenson_hsieh@apple.com>
1866
1867         Implement "proximity" scroll snapping
1868         https://bugs.webkit.org/show_bug.cgi?id=135994
1869         <rdar://problem/18162418>
1870
1871         Reviewed by Dean Jackson.
1872
1873         Adds boilerplate support for plumbing lists of snap offset ranges from the web process to the UI process
1874         alongside the list of snap offsets.
1875
1876         * Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp:
1877         (ArgumentCoder<ScrollingStateScrollingNode>::encode):
1878         (ArgumentCoder<ScrollingStateScrollingNode>::decode):
1879         * Shared/WebCoreArgumentCoders.cpp:
1880         (IPC::ArgumentCoder<ScrollOffsetRange<float>>::encode):
1881         (IPC::ArgumentCoder<ScrollOffsetRange<float>>::decode):
1882         * Shared/WebCoreArgumentCoders.h:
1883         * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:
1884         (-[WKOverflowScrollViewDelegate scrollViewWillEndDragging:withVelocity:targetContentOffset:]):
1885         * UIProcess/ios/RemoteScrollingCoordinatorProxyIOS.mm:
1886
1887         Adjust mainframe proximity scroll snapping logic to not subtract out the top content inset when there is no
1888         active snap offset (i.e. when snapping rests in a snap offset range). Attempting to subtract out the top inset
1889         in this case caused the scroll offset to jump after ending a drag with no momentum in a snap offset range.
1890
1891         (WebKit::RemoteScrollingCoordinatorProxy::adjustTargetContentOffsetForSnapping):
1892         (WebKit::RemoteScrollingCoordinatorProxy::shouldSnapForMainFrameScrolling):
1893         (WebKit::RemoteScrollingCoordinatorProxy::closestSnapOffsetForMainFrameScrolling):
1894
1895 2017-01-10  Zan Dobersek  <zdobersek@igalia.com>
1896
1897         ThreadedCoordinatedLayerTreeHost::renderNextFrame() should short-cut to layer flushing
1898         https://bugs.webkit.org/show_bug.cgi?id=157614
1899
1900         Reviewed by Carlos Garcia Campos.
1901
1902         CoordinatedLayerTreeHost prevents any layer flushes while a previously-commited scene
1903         state is still being rendered on the composition thread. renderNextFrame() is called
1904         once that is complete, and a new layer flush is scheduled.
1905
1906         This change improves the whole ordeal by immediately performing the layer flush only if
1907         it was requested during the time we were waiting on the renderer (i.e. when the latest
1908         scene state was being composited), instead of scheduling it unconditionally.
1909         m_scheduledWhileWaitingForRenderer member variable is added to track that occurrence.
1910
1911         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
1912         (WebKit::CoordinatedLayerTreeHost::scheduleLayerFlush):
1913         (WebKit::CoordinatedLayerTreeHost::renderNextFrame):
1914         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h:
1915
1916 2017-01-09  Chris Dumez  <cdumez@apple.com>
1917
1918         [iOS] Drop VNodeTracker
1919         https://bugs.webkit.org/show_bug.cgi?id=166868
1920         <rdar://problem/29937587>
1921
1922         Reviewed by Andreas Kling.
1923
1924         * WebProcess/cocoa/WebProcessCocoa.mm:
1925         (WebKit::WebProcess::platformInitializeWebProcess):
1926
1927 2017-01-09  Enrica Casucci  <enrica@apple.com>
1928
1929         Selection animation flashing on editable content when zooming.
1930         https://bugs.webkit.org/show_bug.cgi?id=166863
1931         rdar://problem/29931470
1932
1933         Reviewed by Tim Horton.
1934
1935         Implementing _allowAnimatedUpdateSelectionRectView and returning NO,
1936         prevents the selection animation in UIKit.
1937
1938         * UIProcess/ios/WKContentViewInteraction.mm:
1939         (-[WKContentView _allowAnimatedUpdateSelectionRectViews]):
1940
1941 2017-01-06  Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>
1942
1943         [GTK] Should support key and code properties on keyboard events
1944         https://bugs.webkit.org/show_bug.cgi?id=166759
1945
1946         Reviewed by Carlos Garcia Campos.
1947
1948         * Shared/WebEvent.h:
1949         * Shared/WebKeyboardEvent.cpp:
1950         (WebKit::WebKeyboardEvent::WebKeyboardEvent): accept web key value and code on construction.
1951         * Shared/gtk/WebEventFactory.cpp:
1952         (WebKit::WebEventFactory::createWebKeyboardEvent): pass web key value and code on construction.
1953
1954 2017-01-08  Antti Koivisto  <antti@apple.com>
1955
1956         Move cache coders to WTF
1957         https://bugs.webkit.org/show_bug.cgi?id=166825
1958
1959         Rubber-stamped by Sam Weinig.
1960
1961         * NetworkProcess/cache/NetworkCache.h:
1962         * NetworkProcess/cache/NetworkCacheCoder.h: Removed.
1963         * NetworkProcess/cache/NetworkCacheCoders.cpp:
1964         (WebKit::NetworkCache::Coder<AtomicString>::encode): Deleted.
1965         (WebKit::NetworkCache::Coder<AtomicString>::decode): Deleted.
1966         (WebKit::NetworkCache::Coder<CString>::encode): Deleted.
1967         (WebKit::NetworkCache::Coder<CString>::decode): Deleted.
1968         (WebKit::NetworkCache::Coder<String>::encode): Deleted.
1969         (WebKit::NetworkCache::decodeStringText): Deleted.
1970         (WebKit::NetworkCache::Coder<String>::decode): Deleted.
1971         (WebKit::NetworkCache::Coder<SHA1::Digest>::encode): Deleted.
1972         (WebKit::NetworkCache::Coder<SHA1::Digest>::decode): Deleted.
1973         (WebKit::NetworkCache::Coder<WebCore::HTTPHeaderMap>::encode): Deleted.
1974         (WebKit::NetworkCache::Coder<WebCore::HTTPHeaderMap>::decode): Deleted.
1975         * NetworkProcess/cache/NetworkCacheCoders.h:
1976         (): Deleted.
1977         (WebKit::NetworkCache::Coder<std::optional<T>>::encode): Deleted.
1978         (WebKit::NetworkCache::Coder<std::optional<T>>::decode): Deleted.
1979         * NetworkProcess/cache/NetworkCacheCodersCocoa.cpp:
1980         (WebKit::NetworkCache::encodeCFData): Deleted.
1981         (WebKit::NetworkCache::decodeCFData): Deleted.
1982         (WebKit::NetworkCache::encodeSecTrustRef): Deleted.
1983         (WebKit::NetworkCache::decodeSecTrustRef): Deleted.
1984         (WebKit::NetworkCache::encodeCertificateChain): Deleted.
1985         (WebKit::NetworkCache::decodeCertificateChain): Deleted.
1986         (WebKit::NetworkCache::Coder<WebCore::CertificateInfo>::encode): Deleted.
1987         (WebKit::NetworkCache::Coder<WebCore::CertificateInfo>::decode): Deleted.
1988         * NetworkProcess/cache/NetworkCacheDecoder.cpp: Removed.
1989         * NetworkProcess/cache/NetworkCacheDecoder.h: Removed.
1990         * NetworkProcess/cache/NetworkCacheEncoder.cpp: Removed.
1991         * NetworkProcess/cache/NetworkCacheEncoder.h: Removed.
1992         * NetworkProcess/cache/NetworkCacheEntry.cpp:
1993         (WebKit::NetworkCache::Entry::encodeAsStorageRecord):
1994         (WebKit::NetworkCache::Entry::decodeStorageRecord):
1995         * NetworkProcess/cache/NetworkCacheKey.cpp:
1996         (WebKit::NetworkCache::Key::encode):
1997         (WebKit::NetworkCache::Key::decode):
1998         * NetworkProcess/cache/NetworkCacheKey.h:
1999         * NetworkProcess/cache/NetworkCacheStorage.cpp:
2000         (WebKit::NetworkCache::decodeRecordMetaData):
2001         (WebKit::NetworkCache::encodeRecordMetaData):
2002         * NetworkProcess/cache/NetworkCacheSubresourcesEntry.cpp:
2003         (WebKit::NetworkCache::SubresourceInfo::encode):
2004         (WebKit::NetworkCache::SubresourceInfo::decode):
2005         (WebKit::NetworkCache::SubresourcesEntry::encodeAsStorageRecord):
2006         (WebKit::NetworkCache::SubresourcesEntry::decodeStorageRecord):
2007         * NetworkProcess/cache/NetworkCacheSubresourcesEntry.h:
2008         * UIProcess/API/APIUserContentExtensionStore.cpp:
2009         (API::encodeContentExtensionMetaData):
2010         (API::decodeContentExtensionMetaData):
2011         * WebKit2.xcodeproj/project.pbxproj:
2012
2013 2017-01-09  Tomas Popela  <tpopela@redhat.com>
2014
2015         [GTK] Replace WebKitWebSettings with WebKitSettings in documentation
2016         https://bugs.webkit.org/show_bug.cgi?id=166836
2017
2018         Reviewed by Carlos Garcia Campos.
2019
2020         Don't use WebKitWebSettings (it was a WebKit1 thing) in documentation,
2021         but replace it with WebKitSettings.
2022
2023         * UIProcess/API/gtk/WebKitSettings.cpp:
2024         (webkit_settings_class_init):
2025         * UIProcess/API/gtk/WebKitWebView.cpp:
2026
2027 2017-01-06  Darin Adler  <darin@apple.com>
2028
2029         Remove PassRefPtr use from "inspector", "platform/sql", and "platform/text"
2030         https://bugs.webkit.org/show_bug.cgi?id=166797
2031
2032         Reviewed by Alex Christensen.
2033
2034         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
2035         (WebKit::WebEditorClient::requestCheckingOfString): Take a reference
2036         instead of a PassRefPtr.
2037         * WebProcess/WebCoreSupport/WebEditorClient.h: Updated for above change.
2038
2039 2017-01-07  Andy Estes  <aestes@apple.com>
2040
2041         [QuickLook] Consolidate usage of QuickLookHandle into SubresourceLoader
2042         https://bugs.webkit.org/show_bug.cgi?id=166713
2043
2044         Reviewed by Alex Christensen.
2045
2046         * WebProcess/Network/WebResourceLoader.cpp:
2047         (WebKit::WebResourceLoader::didReceiveResponse): Removed QuickLook code.
2048         (WebKit::WebResourceLoader::didReceiveData): Ditto.
2049         (WebKit::WebResourceLoader::didFinishResourceLoad): Ditto.
2050         (WebKit::WebResourceLoader::didFailResourceLoad): Ditto.
2051         (WebKit::WebResourceLoader::didReceiveResource): Ditto.
2052
2053 2017-01-06  Daniel Bates  <dabates@apple.com>
2054
2055         Attempt to fix the EFL build following <http://trac.webkit.org/changeset/210461>
2056         (https://bugs.webkit.org/show_bug.cgi?id=166781)
2057
2058         * UIProcess/API/C/WKWebsitePolicies.cpp:
2059         (WKWebsitePoliciesGetAutoplayPolicy): Invoke ASSERT_NOT_REACHED() and return kWKWebsiteAutoplayPolicyUseHeuristics
2060         if the specified policy is not covered by a switch case.
2061         (WKWebsitePoliciesSetAutoplayPolicy): Substituted "return" for "break" in each switch case and
2062         invoke ASSERT_NOT_REACHED() if the specified policy is not covered by a switch case.
2063
2064 2017-01-06  Matt Rajca  <mrajca@apple.com>
2065
2066         Add infrastructure for sending autoplay website policies to WebKit
2067         https://bugs.webkit.org/show_bug.cgi?id=166781
2068
2069         Reviewed by Alex Christensen.
2070
2071         * Shared/WebsitePolicies.h:
2072         (WebKit::WebsitePolicies::encode):
2073         (WebKit::WebsitePolicies::decode):
2074         * UIProcess/API/APIWebsitePolicies.h:
2075         * UIProcess/API/C/WKWebsitePolicies.cpp:
2076         (WKWebsitePoliciesGetAutoplayPolicy):
2077         (WKWebsitePoliciesSetAutoplayPolicy):
2078         * UIProcess/API/C/WKWebsitePolicies.h:
2079         * UIProcess/API/Cocoa/_WKWebsitePolicies.h:
2080         * UIProcess/API/Cocoa/_WKWebsitePolicies.mm:
2081         (-[_WKWebsitePolicies setAutoplayPolicy:]):
2082         (-[_WKWebsitePolicies autoplayPolicy]):
2083
2084 2017-01-05  Carlos Garcia Campos  <cgarcia@igalia.com>
2085
2086         [SOUP] Network process crash in WebKit::CustomProtocolManagerImpl::didFailWithError
2087         https://bugs.webkit.org/show_bug.cgi?id=165082
2088
2089         Reviewed by Alex Christensen.
2090
2091         CustomProtocolManager uses a Workqueue to receive the IPC messages since r149194. Then we added the Soup
2092         implementation adopting that approach, but without making our implementation thread safe. The crash happens
2093         because the CustomProtocolManager implementation is used by two threads at the same time, the main thread
2094         because of a ping load (probably caused by an image load in the unload handler, I haven't been able to
2095         reproduce the crash) and the work queue thread. The reasons to make CustomProtocolManager use a WorkQueue
2096         are no longer valid because CustomProtocolManager is now only used in the network process and sync loads don't
2097         use any nested run loop, they are just an IPC sync message. So this patch makes CustomProtocolManager a normal
2098         message receiver again to ensure messages are handled in the main thread. It also adds the common implementation
2099         to a new CustomProtocolManager.cpp file shared by Cocoa and Soup based ports.
2100
2101         * CMakeLists.txt: Add CustomProtocolManager.cpp.
2102         * NetworkProcess/CustomProtocols/Cocoa/CustomProtocolManagerCocoa.mm:
2103         (-[WKCustomProtocol initWithRequest:cachedResponse:client:]): Use new CustomProtocolManager API.
2104         (-[WKCustomProtocol startLoading]): Ditto.
2105         (-[WKCustomProtocol stopLoading]): Ditto.
2106         (WebKit::CustomProtocolManager::registerProtocolClass): Register the NSURLProtocol class when not using the
2107         network session.
2108         (WebKit::CustomProtocolManager::didFailWithError): removeCustomProtocol now receives an ID.
2109         (WebKit::CustomProtocolManager::didFinishLoading): Ditto.
2110         * NetworkProcess/CustomProtocols/CustomProtocolManager.cpp: Added.
2111         (WebKit::generateCustomProtocolID): Moved from CustomProtocolManagerCocoa.mm and CustomProtocolManagerSoup.cpp.
2112         (WebKit::CustomProtocolManager::supplementName): Ditto.
2113         (WebKit::CustomProtocolManager::CustomProtocolManager): Also removes the work queue initialization.
2114         (WebKit::CustomProtocolManager::initialize): Copied and modernized the loop.
2115         (WebKit::CustomProtocolManager::addCustomProtocol): Copied from CustomProtocolManagerCocoa.mm.
2116         (WebKit::CustomProtocolManager::removeCustomProtocol): Ditto.
2117         (WebKit::CustomProtocolManager::startLoading): Send the StartLoading message to the proxy.
2118         (WebKit::CustomProtocolManager::stopLoading): Send the StopLoading message to the proxy.
2119         * NetworkProcess/CustomProtocols/CustomProtocolManager.h:
2120         * NetworkProcess/CustomProtocols/soup/CustomProtocolManagerImpl.cpp: Removed.
2121         * NetworkProcess/CustomProtocols/soup/CustomProtocolManagerImpl.h: Removed.
2122         * NetworkProcess/CustomProtocols/soup/CustomProtocolManagerSoup.cpp: Moved the implementation from
2123         CustomProtocolManagerImpl and updated to the new CustomProtocolManager API.
2124         (WebKit::CustomProtocolManager::WebSoupRequestAsyncData::WebSoupRequestAsyncData):
2125         (WebKit::CustomProtocolManager::WebSoupRequestAsyncData::~WebSoupRequestAsyncData):
2126         (WebKit::CustomProtocolManager::registerProtocolClass):
2127         (WebKit::CustomProtocolManager::registerScheme):
2128         (WebKit::CustomProtocolManager::supportsScheme):
2129         (WebKit::CustomProtocolManager::didFailWithError):
2130         (WebKit::CustomProtocolManager::didLoadData):
2131         (WebKit::CustomProtocolManager::didReceiveResponse):
2132         (WebKit::CustomProtocolManager::didFinishLoading):
2133         (WebKit::CustomProtocolManager::wasRedirectedToRequest):
2134         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
2135         (WebKit::globalCustomProtocolManager):
2136         (WebKit::NetworkSessionCocoa::defaultSession):
2137         CustomProtocolManager is no longer refcounted, so just pass a pointer.
2138         A static pointer has the same lifetime as the NetworkProcess object in the NetworkProcess,
2139         and in the WebProcess it will remain nullptr, just like it used to.
2140         * PlatformEfl.cmake:
2141         * PlatformGTK.cmake:
2142         * WebKit2.xcodeproj/project.pbxproj:
2143
2144 2017-01-05  Antti Koivisto  <antti@apple.com>
2145
2146         Use WTF::Function instead of std::function in network cache code
2147         https://bugs.webkit.org/show_bug.cgi?id=166721
2148
2149         Reviewed by Andreas Kling.
2150
2151         Use better move-only type. Fix some unnecessary function copies.
2152
2153         * NetworkProcess/cache/NetworkCache.cpp:
2154         (WebKit::NetworkCache::Cache::retrieve):
2155         (WebKit::NetworkCache::Cache::clear):
2156         * NetworkProcess/cache/NetworkCache.h:
2157         * NetworkProcess/cache/NetworkCacheData.h:
2158         * NetworkProcess/cache/NetworkCacheDataCocoa.mm:
2159         (WebKit::NetworkCache::Data::apply):
2160         * NetworkProcess/cache/NetworkCacheDataSoup.cpp:
2161         (WebKit::NetworkCache::Data::apply):
2162         * NetworkProcess/cache/NetworkCacheFileSystem.cpp:
2163         (WebKit::NetworkCache::traverseDirectory):
2164         * NetworkProcess/cache/NetworkCacheFileSystem.h:
2165         * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
2166         (WebKit::NetworkCache::SpeculativeLoadManager::canRetrieve):
2167         (WebKit::NetworkCache::SpeculativeLoadManager::retrieve):
2168
2169             Split retrieve() to canRetrieve() and retrieve() functions.
2170             This avoids the need to copy the completion handler in the caller.
2171
2172         * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.h:
2173         * NetworkProcess/cache/NetworkCacheStorage.cpp:
2174         (WebKit::NetworkCache::Storage::ReadOperation::ReadOperation):
2175         (WebKit::NetworkCache::Storage::traverse):
2176         (WebKit::NetworkCache::Storage::clear):
2177         * NetworkProcess/cache/NetworkCacheStorage.h:
2178
2179 2017-01-05  Enrica Casucci  <enrica@apple.com>
2180
2181         Unreviewed build fix after https://trac.webkit.org/changeset/210360
2182
2183         * UIProcess/Cocoa/WebViewImpl.mm:
2184         (WebKit::WebViewImpl::performDragOperation):
2185
2186 2017-01-05  Enrica Casucci  <enrica@apple.com>
2187
2188         Support File Promise during drag for macOS.
2189         https://bugs.webkit.org/show_bug.cgi?id=165204
2190         rdar://problem/19595567
2191
2192         Reviewed by Tim Horton.
2193
2194         Adds support for dropping a File Promise in a WKWebView.
2195         The implementation uses new File Promise API available in Sierra.
2196
2197         * Shared/WebCoreArgumentCoders.cpp:
2198         (IPC::ArgumentCoder<DragData>::encode):
2199         (IPC::ArgumentCoder<DragData>::decode):
2200         * Shared/mac/PasteboardTypes.mm:
2201         (WebKit::PasteboardTypes::forURL):
2202         * UIProcess/Cocoa/WebViewImpl.h:
2203         * UIProcess/Cocoa/WebViewImpl.mm:
2204         (WebKit::WebViewImpl::createSandboxExtensionsIfNeeded):
2205         (WebKit::WebViewImpl::performDragOperation):
2206         (WebKit::maybeCreateSandboxExtensionFromPasteboard): Deleted.
2207         (WebKit::createSandboxExtensionsForFileUpload): Deleted.
2208
2209 2017-01-05  Andreas Kling  <akling@apple.com>
2210
2211         Remove ChromeClient::needTouchEvents().
2212         <https://webkit.org/b/166723>
2213
2214         Rubber-stamped by Antti Koivisto.
2215
2216         * WebProcess/WebCoreSupport/WebChromeClient.h:
2217
2218 2017-01-04  Darin Adler  <darin@apple.com>
2219
2220         Remove PassRefPtr use from the "html" directory, other improvements
2221         https://bugs.webkit.org/show_bug.cgi?id=166635
2222
2223         Reviewed by Alex Christensen.
2224
2225         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2226         (WebKit::WebChromeClient::loadIconForFiles): Take a reference instead of a pointer.
2227         * WebProcess/WebCoreSupport/WebChromeClient.h: Ditto.
2228
2229 2017-01-04  Myles C. Maxfield  <mmaxfield@apple.com>
2230
2231         Remove runtime flag for variation fonts
2232         https://bugs.webkit.org/show_bug.cgi?id=164251
2233
2234         Reviewed by Dean Jackson.
2235
2236         * Shared/WebPreferencesDefinitions.h:
2237         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
2238         (WebKit::registerUserDefaultsIfNeeded):
2239         * WebProcess/WebPage/WebPage.cpp:
2240         (WebKit::WebPage::updatePreferences):
2241
2242 2017-01-04  Ryan Haddad  <ryanhaddad@apple.com>
2243
2244         Unreviewed, rolling out r210287.
2245
2246         This change caused editing test failures on macOS.
2247
2248         Reverted changeset:
2249
2250         "Support File Promise during drag for macOS."
2251         https://bugs.webkit.org/show_bug.cgi?id=165204
2252         http://trac.webkit.org/changeset/210287
2253
2254 2017-01-04  Enrica Casucci  <enrica@apple.com>
2255
2256         Support File Promise during drag for macOS.
2257         https://bugs.webkit.org/show_bug.cgi?id=165204
2258         rdar://problem/19595567
2259
2260         Reviewed by Tim Horton.
2261
2262         Adds support for dropping a File Promise in a WKWebView.
2263         The implementation uses new File Promise API available in Sierra.
2264
2265         * Shared/WebCoreArgumentCoders.cpp:
2266         (IPC::ArgumentCoder<DragData>::encode):
2267         (IPC::ArgumentCoder<DragData>::decode):
2268         * Shared/mac/PasteboardTypes.mm:
2269         (WebKit::PasteboardTypes::forURL):
2270         * UIProcess/Cocoa/WebViewImpl.h:
2271         * UIProcess/Cocoa/WebViewImpl.mm:
2272         (WebKit::WebViewImpl::createSandboxExtensionsIfNeeded):
2273         (WebKit::WebViewImpl::performDragOperation):
2274         (WebKit::maybeCreateSandboxExtensionFromPasteboard): Deleted.
2275         (WebKit::createSandboxExtensionsForFileUpload): Deleted.
2276
2277 2017-01-04  Jeremy Jones  <jeremyj@apple.com>
2278
2279         Release pointer lock when page state is reset for any reason, not just for process exited.
2280         https://bugs.webkit.org/show_bug.cgi?id=166654
2281         <rdar://problem/29849769>
2282
2283         Reviewed by Tim Horton.
2284
2285         Pointer lock was not being released when the window is closed.
2286         Move the pointer lock to resetState() so it happens whenever the page is
2287         reset, not just when it is reset after process exit.
2288
2289         * UIProcess/WebPageProxy.cpp:
2290         (WebKit::WebPageProxy::resetState): Release here.
2291         (WebKit::WebPageProxy::resetStateAfterProcessExited): Don't release here.
2292
2293 2017-01-03  Tim Horton  <timothy_horton@apple.com>
2294
2295         NSSpellChecker's recordResponse isn't called for unseen automatic corrections
2296         https://bugs.webkit.org/show_bug.cgi?id=166450
2297         <rdar://problem/29447824>
2298
2299         Reviewed by Darin Adler.
2300
2301         * UIProcess/mac/CorrectionPanel.h:
2302         * UIProcess/mac/CorrectionPanel.mm:
2303         (WebKit::CorrectionPanel::recordAutocorrectionResponse):
2304         (WebKit::CorrectionPanel::handleAcceptedReplacement):
2305         Funnel all calls to recordResponse:toCorrection:forWord:language:inSpellDocumentWithTag:
2306         through recordAutocorrectionResponse, for debugging's sake.
2307         Drop the NSView parameter because we don't need it, just the tag.
2308
2309         * UIProcess/mac/PageClientImpl.mm:
2310         (WebKit::toCorrectionResponse):
2311         (WebKit::PageClientImpl::recordAutocorrectionResponse):
2312         Convert the new AutocorrectionResponseType value to its corresponding
2313         NSCorrectionResponse value.
2314
2315 2017-01-03  Daniel Bates  <dabates@apple.com>
2316
2317         Another attempt to fix the Apple Sierra Release 32-bit Build following <https://trac.webkit.org/changeset/210075>
2318         (https://bugs.webkit.org/show_bug.cgi?id=166367)
2319
2320         Guard more code in WebViewImpl::handleRequestedCandidates() inside HAVE(TOUCH_BAR).
2321         Remove unused local variable weakThis.
2322
2323         * UIProcess/Cocoa/WebViewImpl.mm:
2324         (WebKit::WebViewImpl::handleRequestedCandidates):
2325
2326 2017-01-03  Daniel Bates  <dabates@apple.com>
2327
2328         Attempt to fix the Apple Sierra Release 32-bit Build following <https://trac.webkit.org/changeset/210075>
2329         (https://bugs.webkit.org/show_bug.cgi?id=166367)
2330
2331         Add HAVE(TOUCH_BAR)-guard around code that messages candidateListTouchBarItem() as
2332         candidateListTouchBarItem() is only defined when building with Touch Bar support.
2333
2334         Also added an inline comment to help demarcate the code when building without Touch Bar
2335         support. We should look to clean up WebViewImpl.mm including extracting out the Touch
2336         Bar code to another file or better demarcating it so as to improve the hackability of
2337         this code and prevent breaking the build when building without Touch Bar support.
2338
2339         * UIProcess/Cocoa/WebViewImpl.mm:
2340         (WebKit::WebViewImpl::handleRequestedCandidates):
2341
2342 2017-01-03  Michael Catanzaro  <mcatanzaro@igalia.com> and Carlos Garcia Campos  <cgarcia@igalia.com>
2343
2344         [GTK] Expose WebKitSecurityOrigin API
2345         https://bugs.webkit.org/show_bug.cgi?id=166632
2346
2347         Reviewed by Carlos Garcia Campos.
2348
2349         This API will be useful to have for various purposes, such as setting initial notification
2350         permissions.
2351
2352         * PlatformGTK.cmake:
2353         * UIProcess/API/gtk/WebKitAutocleanups.h:
2354         * UIProcess/API/gtk/WebKitSecurityOrigin.cpp: Added.
2355         (_WebKitSecurityOrigin::_WebKitSecurityOrigin):
2356         (webkitSecurityOriginCreate):
2357         (webkit_security_origin_new):
2358         (webkit_security_origin_new_for_uri):
2359         (webkit_security_origin_ref):
2360         (webkit_security_origin_unref):
2361         (webkit_security_origin_get_protocol):
2362         (webkit_security_origin_get_host):
2363         (webkit_security_origin_get_port):
2364         (webkit_security_origin_is_opaque):
2365         (webkit_security_origin_to_string):
2366         * UIProcess/API/gtk/WebKitSecurityOrigin.h: Added.
2367         * UIProcess/API/gtk/WebKitSecurityOriginPrivate.h: Added.
2368         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
2369         * UIProcess/API/gtk/docs/webkit2gtk-docs.sgml:
2370         * UIProcess/API/gtk/webkit2.h:
2371
2372 2017-01-03  Carlos Garcia Campos  <cgarcia@igalia.com>
2373
2374         [SOUP] Load options allowStoredCredentials = DoNotAllowStoredCredentials with clientCredentialPolicy = MayAskClientForCredentials doesn't work
2375         https://bugs.webkit.org/show_bug.cgi?id=164471
2376
2377         Reviewed by Michael Catanzaro.
2378
2379         When DoNotAllowStoredCredentials is used we disable the SoupAuthManager feature for the message, but that
2380         disables all HTTP authentication, causing the load to always fail with Authorization required even when
2381         clientCredentialPolicy allows to ask the user for credentials. The problem is that even if we don't use the
2382         WebCore credentials for that request, libsoup will always use its internal cache of SoupAuth if we enable the
2383         SoupAuthManager feature. Libsoup 2.57.1 has new API to disable the use of cached credentials for a particular
2384         message, adding the new message flag SOUP_MESSAGE_DO_NOT_USE_AUTH_CACHE.
2385
2386         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
2387         (WebKit::NetworkDataTaskSoup::createRequest): Set SOUP_MESSAGE_DO_NOT_USE_AUTH_CACHE flag to disable cached
2388         credentials for the message if libsoup >= 2.57.1 is used.
2389
2390 2017-01-03  Carlos Garcia Campos  <cgarcia@igalia.com>
2391
2392         [GTK] HTTP auth layout tests are flaky
2393         https://bugs.webkit.org/show_bug.cgi?id=158919
2394
2395         Reviewed by Michael Catanzaro.
2396
2397         Implement NetworkSession::clearCredentials() for soup using the new libsoup API when available.
2398
2399         * NetworkProcess/soup/NetworkSessionSoup.cpp:
2400         (WebKit::NetworkSessionSoup::clearCredentials):
2401         * NetworkProcess/soup/NetworkSessionSoup.h:
2402
2403 2017-01-01  Jeff Miller  <jeffm@apple.com>
2404
2405         Update user-visible copyright strings to include 2017
2406         https://bugs.webkit.org/show_bug.cgi?id=166278
2407
2408         Reviewed by Dan Bernstein.
2409
2410         * DatabaseProcess/EntryPoint/mac/XPCService/DatabaseService/Info.plist:
2411         * Info.plist:
2412         * NetworkProcess/EntryPoint/mac/XPCService/NetworkService/Info-OSX-10.9-10.10.plist:
2413         * NetworkProcess/EntryPoint/mac/XPCService/NetworkService/Info-OSX.plist:
2414         * NetworkProcess/EntryPoint/mac/XPCService/NetworkService/Info-iOS.plist:
2415         * PluginProcess/EntryPoint/mac/XPCService/PluginService.32-64-10.9-10.10.Info.plist:
2416         * PluginProcess/EntryPoint/mac/XPCService/PluginService.32-64.Info.plist:
2417         * WebProcess/EntryPoint/mac/XPCService/WebContentService/Info-OSX-10.9-10.10.plist:
2418         * WebProcess/EntryPoint/mac/XPCService/WebContentService/Info-OSX.plist:
2419         * WebProcess/EntryPoint/mac/XPCService/WebContentService/Info-iOS.plist:
2420
2421 2016-12-30  Darin Adler  <darin@apple.com>
2422
2423         Remove PassRefPtr use from the "dom" directory, related cleanup
2424         https://bugs.webkit.org/show_bug.cgi?id=166569
2425
2426         Reviewed by Alex Christensen.
2427
2428         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2429         (WebKit::WebFrameLoaderClient::dispatchDidReceiveTitle): Updated to use struct.
2430         (WebKit::WebFrameLoaderClient::updateGlobalHistory): Ditto.
2431         (WebKit::WebFrameLoaderClient::setTitle): Ditto.
2432
2433 2016-12-27  Alex Christensen  <achristensen@webkit.org>
2434
2435         reduce PassRefPtr use in WebKit2
2436         https://bugs.webkit.org/show_bug.cgi?id=166452
2437
2438         Reviewed by Yusuke Suzuki.
2439
2440         * Shared/API/c/cg/WKImageCG.cpp:
2441         (WKImageCreateCGImage):
2442         (WKImageCreateFromCGImage):
2443         * Shared/ShareableBitmap.cpp:
2444         (WebKit::ShareableBitmap::createHandle):
2445         * Shared/ShareableBitmap.h:
2446         * Shared/UserData.cpp:
2447         (WebKit::UserData::encode):
2448         (WebKit::UserData::decode):
2449         * Shared/WebImage.cpp:
2450         (WebKit::WebImage::create):
2451         (WebKit::WebImage::WebImage):
2452         * Shared/WebImage.h:
2453         (WebKit::WebImage::bitmap):
2454         * UIProcess/WebPageProxy.cpp:
2455         (WebKit::WebPageProxy::didGetImageForFindMatch):
2456         * UIProcess/mac/WKTextFinderClient.mm:
2457         (-[WKTextFinderClient didGetImageForMatchResult:]):
2458         * WebProcess/Automation/WebAutomationSessionProxy.cpp:
2459         (WebKit::WebAutomationSessionProxy::takeScreenshot):
2460         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.mm:
2461         (-[WKWebProcessPlugInNodeHandle renderedImageWithOptions:]):
2462         * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp:
2463         (WebKit::imageForRect):
2464         (WebKit::InjectedBundleNodeHandle::renderedImage):
2465         (WebKit::InjectedBundleNodeHandle::visibleRange):
2466         (WebKit::InjectedBundleNodeHandle::htmlTableCellElementCellAbove):
2467         (WebKit::InjectedBundleNodeHandle::documentFrame):
2468         (WebKit::InjectedBundleNodeHandle::htmlFrameElementContentFrame):
2469         (WebKit::InjectedBundleNodeHandle::htmlIFrameElementContentFrame):
2470         * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.h:
2471         * WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp:
2472         (WebKit::InjectedBundleRangeHandle::renderedImage):
2473         * WebProcess/WebPage/WebPage.cpp:
2474         (WebKit::WebPage::takeSnapshot):
2475         (WebKit::WebPage::snapshotAtSize):
2476         (WebKit::WebPage::snapshotNode):
2477         (WebKit::WebPage::drawRectToImage):
2478         * WebProcess/WebPage/ios/WebPageIOS.mm:
2479         (WebKit::WebPage::getPositionInformation):
2480         * WebProcess/WebPage/mac/WebPageMac.mm:
2481         (WebKit::WebPage::setTopOverhangImage):
2482         (WebKit::WebPage::setBottomOverhangImage):
2483
2484 2016-12-27  Emanuele Aina  <emanuele.aina@collabora.com>
2485
2486         Ensure NetworkProcess is ready before whitelisting TLS certificates
2487         https://bugs.webkit.org/show_bug.cgi?id=162962
2488
2489         Reviewed by Alex Christensen.
2490
2491         If the API user tries to whitelist TLS certificates before any web
2492         view has been created, the action will be ignored because the
2493         NetworkProcess hasn't been fired up yet.
2494
2495         For example, the snippet below using the GTK+ API does not work,
2496         unless the whitelisting is moved after the web view creation:
2497
2498           webkit_web_context_allow_tls_certificate_for_host(webkit_web_context_get_default(), crt, host);
2499           webView = webkit_web_view_new();
2500
2501         * UIProcess/WebProcessPool.cpp:
2502         (WebKit::WebProcessPool::allowSpecificHTTPSCertificateForHost): Ensure
2503         that the NetworkProcess has been already fired up when adding
2504         certificates, so they can be whitelisted before the first web view is
2505         instantiated.
2506
2507 2016-12-25  Yusuke Suzuki  <utatane.tea@gmail.com>
2508
2509         Propagate the source origin as much as possible
2510         https://bugs.webkit.org/show_bug.cgi?id=166348
2511
2512         Reviewed by Darin Adler.
2513
2514         * WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp:
2515         (WebKit::NPRuntimeObjectMap::evaluate):
2516
2517 2016-12-22  Andy Estes  <aestes@apple.com>
2518
2519         Reduce QuickLook.h include overhead
2520         https://bugs.webkit.org/show_bug.cgi?id=166454
2521
2522         Reviewed by Andreas Kling.
2523
2524         * WebProcess/Network/WebLoaderStrategy.cpp: Included QuickLook.h for QLPreviewProtocol().
2525         * WebProcess/Network/WebResourceLoader.cpp: Included QuickLook.h for QuickLookHandle.
2526         * WebProcess/Network/WebResourceLoader.h: Stopped including QuickLook.h.
2527
2528 2016-12-22  Tim Horton  <timothy_horton@apple.com>
2529
2530         Null deref under WebPageProxy::applicationDidFinishSnapshottingAfterEnteringBackground
2531         https://bugs.webkit.org/show_bug.cgi?id=166433
2532         <rdar://problem/29732407>
2533
2534         Reviewed by Daniel Bates.
2535
2536         * UIProcess/ios/WebPageProxyIOS.mm:
2537         (WebKit::WebPageProxy::applicationDidFinishSnapshottingAfterEnteringBackground):
2538         m_drawingArea can be null if the process is not valid.
2539
2540 2016-12-22  Andy Estes  <aestes@apple.com>
2541
2542         Make WebCore::EditorInsertAction an enum class
2543         https://bugs.webkit.org/show_bug.cgi?id=166424
2544
2545         Reviewed by Brent Fulgham.
2546
2547         * WebProcess/InjectedBundle/API/c/WKBundleAPICast.h:
2548         (WebKit::toAPI):
2549         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
2550         (toWK):
2551
2552 2016-12-22  Zhuo Li  <zachli@apple.com>
2553
2554         [Cocoa] SPI for setloadsImagesAutomatically
2555         https://bugs.webkit.org/show_bug.cgi?id=166401
2556
2557         Reviewed by Darin Adler.
2558
2559         * UIProcess/API/Cocoa/WKPreferences.mm: Call the C API under the hood.
2560         (-[WKPreferences _loadsImagesAutomatically]):
2561         (-[WKPreferences _setLoadsImagesAutomatically:]):
2562
2563         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
2564         Add `_loadsImagesAutomatically` property.
2565
2566 2016-12-22  Eric Carlson  <eric.carlson@apple.com>
2567
2568         AVPlayerLayer isn't available on every system
2569         https://bugs.webkit.org/show_bug.cgi?id=166399
2570
2571         Reviewed by Jer Noble.
2572
2573         * WebProcess/WebPage/mac/PlatformCALayerRemoteCustom.mm: Use SOFT_LINK_CLASS_OPTIONAL.
2574
2575 2016-12-22  Nael Ouedraogo  <nael.ouedraogo@crf.canon.fr>
2576
2577         MediaStream: ASSERTION FAILED: m_ids.size() == m_handles.size() in MediaDeviceSandboxExtensions
2578         https://bugs.webkit.org/show_bug.cgi?id=166328
2579
2580         Reviewed by Eric Carlson.
2581
2582         This assertion failure happens for ports with sandbox extensions disabled. SandboxExtension is empty and
2583         HandleArray:size() always returns 0. Disable creation of MediaDevicesSandboxExtension in UserMediaProcessManager
2584         when building without support of sandbox extension. Disable also WebPage::grantUserMediaDeviceSandboxExtensions
2585         and WebPage::revokeUserMediaDeviceSandboxExtensions which can be avoided when sandbox extension is empty.
2586
2587         * UIProcess/UserMediaProcessManager.cpp:
2588         (WebKit::UserMediaProcessManager::willCreateMediaStream):
2589         (WebKit::UserMediaProcessManager::endedCaptureSession):
2590         * WebProcess/WebPage/WebPage.cpp:
2591         * WebProcess/WebPage/WebPage.h:
2592         * WebProcess/WebPage/WebPage.messages.in:
2593
2594 2016-12-22  Alejandro G. Castro  <alex@igalia.com>
2595
2596         [WebRTC] Add support for runtime PeeConnection setting, required after r209757
2597         https://bugs.webkit.org/show_bug.cgi?id=166346
2598
2599         Reviewed by Carlos Garcia Campos.
2600
2601         After that commit we have to enable the peerConnection runtime
2602         flag if we want webrtc to work. We are not adding a new API for
2603         the moment to control the peerConnection feature.
2604
2605         * UIProcess/API/gtk/WebKitSettings.cpp:
2606         (webkit_settings_set_enable_media_stream): Use the mediaStream
2607         setting to control the peerConnection
2608
2609 2016-12-21  Brent Fulgham  <bfulgham@apple.com>
2610
2611         [Mac][WK2] Stop using file* rules in WebProcess sandbox profiles
2612         https://bugs.webkit.org/show_bug.cgi?id=165824
2613         <rdar://problem/14024823>
2614
2615         Reviewed by Alexey Proskuryakov
2616
2617         Switch from blanket 'file*' sandbox rules, to the specific 'file-read*' and 'file-write*' rules
2618         we actually need.
2619
2620         * DatabaseProcess/mac/com.apple.WebKit.Databases.sb.in:
2621         * PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in:
2622         * WebProcess/com.apple.WebProcess.sb.in:
2623
2624 2016-12-21  Beth Dakin  <bdakin@apple.com>
2625
2626         Holding down on candidates in the TouchBar should show panel on screen
2627         https://bugs.webkit.org/show_bug.cgi?id=166367
2628         -and corresponding-
2629         <rdar://problem/28479236>
2630
2631         Reviewed by Tim Horton.
2632
2633         The showCandidates() helper function is not needed. We can call the AppKit method 
2634         directly at the one call site.
2635         * UIProcess/Cocoa/WebViewImpl.h:
2636         * UIProcess/Cocoa/WebViewImpl.mm:
2637
2638         The panel should appear under the selection, so offset the selection rect.
2639         (WebKit::WebViewImpl::handleRequestedCandidates):
2640
2641         No more showCandidates() since we can call it directly. 
2642         (WebKit::WebViewImpl::showCandidates): Deleted.
2643
2644 2016-12-20  Taras Tsugrii  <ttsugrii@fb.com>
2645
2646         Fix undefined behavior caused by macro expansion producing 'defined'
2647         https://bugs.webkit.org/show_bug.cgi?id=166047
2648
2649         Reviewed by Darin Adler.
2650
2651         * Shared/API/Cocoa/WKFoundation.h:
2652
2653 2016-12-20  Brent Fulgham  <bfulgham@apple.com>
2654
2655         Address some style problems found by static analysis
2656         https://bugs.webkit.org/show_bug.cgi?id=165975
2657
2658         Reviewed by Alex Christensen.
2659
2660         Avoid passing large ANGLE data structures through the ANGLEWebKitBridge methods.
2661
2662         * Shared/WebBackForwardListItem.cpp:
2663         (WebKit::WebBackForwardListItem::create):
2664         (WebKit::WebBackForwardListItem::WebBackForwardListItem):
2665         * Shared/WebBackForwardListItem.h:
2666
2667 2016-12-20  Simon Fraser  <simon.fraser@apple.com>
2668
2669         [iOS WK2] Switching or closing a tab leads to all-white tab content if the status bar is double height
2670         https://bugs.webkit.org/show_bug.cgi?id=166286
2671         rdar://problem/29593525
2672
2673         Reviewed by Tim Horton.
2674
2675         A double-height status bar triggers view resize while snapshotting in the background,
2676         which also triggers calls to _endAnimatedResize on tab resume. However, it was possible
2677         for _endAnimatedResize to re-enter via synchronizeDynamicViewportUpdate()/didCommitLayerTree(),
2678         causing us to use a nil _resizeAnimationView for scale computations, thus setting a zero
2679         scale on the WKContentView.
2680
2681         Fix by checking _dynamicViewportUpdateMode again after the call to synchronizeDynamicViewportUpdate(),
2682         and do a belt-and-braces check for a nil _resizeAnimationView.
2683
2684         * UIProcess/API/Cocoa/WKWebView.mm:
2685         (-[WKWebView _endAnimatedResize]):
2686
2687 2016-12-20  Andy Estes  <aestes@apple.com>
2688
2689         [Cocoa] REGRESSION (r209558): Calling decisionHandler multiple times in webView:decidePolicyForNavigationAction:decisionHandler: leads to a crash
2690         https://bugs.webkit.org/show_bug.cgi?id=165992
2691         <rdar://problem/29693817>
2692
2693         Reviewed by Brady Eidson.
2694
2695         r209558 added additional move semantics to the decisionHandler block passed to
2696         -webView:decidePolicyForNavigationAction:decisionHandler:, resulting in a null pointer
2697         dereference in clients that call the decisionHandler block more than once.
2698
2699         None of the completion handlers we expose in the WebKit API are intended to be called more
2700         than once, and we ASSERT in CompletionHandlerCallChecker::didCallCompletionHandler() that
2701         this doesn't happen.
2702
2703         This change strenghtens that protection by returning immediately in completion handlers
2704         called more than once. And in programs linked on or after WebKit 603.1.17, an NSException is
2705         thrown if a completion handler is called a second time, like we do for completion handlers
2706         that are never called.
2707
2708         New API test: WebKit2.DuplicateCompletionHandlerCalls
2709
2710         * Shared/Cocoa/CompletionHandlerCallChecker.h: Declared completionHandlerHasBeenCalled().
2711         * Shared/Cocoa/CompletionHandlerCallChecker.mm:
2712         (WebKit::shouldThrowExceptionForDuplicateCompletionHandlerCall): Added. Returns true if the
2713         program is linked on or after
2714         LibraryVersion::FirstWithExceptionsForDuplicateCompletionHandlerCalls.
2715         (WebKit::CompletionHandlerCallChecker::completionHandlerHasBeenCalled): Added. Returns
2716         whether or not the completion handler has been called. If it has, and
2717         shouldThrowExceptionForDuplicateCompletionHandlerCall() returns true, throws an
2718         NSInternalInconsistencyException.
2719         * UIProcess/API/Cocoa/WKWebView.mm:
2720         (-[WKWebView _setInputDelegate:]): Added an early return if the completion handler has
2721         already been called.
2722         * UIProcess/Cocoa/NavigationState.mm:
2723         (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction): Ditto.
2724         (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationResponse): Ditto.
2725         (WebKit::NavigationState::NavigationClient::didReceiveAuthenticationChallenge): Ditto.
2726         * UIProcess/Cocoa/UIDelegate.mm:
2727         (WebKit::UIDelegate::UIClient::runJavaScriptAlert): Ditto.
2728         (WebKit::UIDelegate::UIClient::runJavaScriptConfirm): Ditto.
2729         (WebKit::UIDelegate::UIClient::runJavaScriptPrompt): Ditto.
2730         (WebKit::UIDelegate::UIClient::exceededDatabaseQuota): Ditto.
2731         (WebKit::UIDelegate::UIClient::runOpenPanel): Ditto.
2732         (WebKit::UIDelegate::UIClient::reachedApplicationCacheOriginQuota): Ditto.
2733         * UIProcess/Cocoa/VersionChecks.h: Added
2734         FirstWithExceptionsForDuplicateCompletionHandlerCalls with the version number for 603.1.17.
2735
2736 2016-12-20  Dean Jackson  <dino@apple.com>
2737
2738         Remove INDIE_UI
2739         https://bugs.webkit.org/show_bug.cgi?id=165881
2740         <rdar://problem/29672532>
2741
2742         Reviewed by Simon Fraser.
2743
2744         The Indie UI work has been discontinued.
2745
2746         * Configurations/FeatureDefines.xcconfig:
2747
2748 2016-12-20  Wenson Hsieh  <wenson_hsieh@apple.com>
2749
2750         Implement the updated port/area-based Scroll Snap Module Level 1 Spec
2751         https://bugs.webkit.org/show_bug.cgi?id=165317
2752         <rdar://problem/29490956>
2753
2754         Reviewed by Dean Jackson.
2755
2756         Remove unused code for adopting scroll snapping in the PDF plugin.
2757
2758         * WebProcess/Plugins/PDF/PDFPlugin.mm:
2759         (WebKit::PDFPlugin::didCalculateSizes):
2760
2761 2016-12-19  Yusuke Suzuki  <utatane.tea@gmail.com>
2762
2763         [ES6] Enable ES6 Modules
2764         https://bugs.webkit.org/show_bug.cgi?id=165849
2765
2766         Reviewed by Geoffrey Garen.
2767
2768         * Shared/WebPreferencesDefinitions.h:
2769         * UIProcess/API/C/WKPreferences.cpp:
2770         (WKPreferencesSetES6ModulesEnabled): Deleted.
2771         (WKPreferencesGetES6ModulesEnabled): Deleted.
2772         * UIProcess/API/C/WKPreferencesRefPrivate.h:
2773         * WebProcess/InjectedBundle/InjectedBundle.cpp:
2774         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
2775         * WebProcess/WebPage/WebPage.cpp:
2776         (WebKit::WebPage::updatePreferences):
2777
2778 2016-12-19  Keith Rollin  <krollin@apple.com>
2779
2780         Fix unwanted deletion of record/replay files
2781         https://bugs.webkit.org/show_bug.cgi?id=166040
2782
2783         Reviewed by Alex Christensen.
2784
2785         As part of some refactoring, the objects that create the meta files
2786         that are part of the record/replay cache would get deleted. They were
2787         always getting opened in "write" mode", which would truncate the
2788         files. Fix this so that the files are opened in the right modes for
2789         record, replay, and neither.
2790
2791         * NetworkProcess/capture/NetworkCaptureManager.cpp:
2792         (WebKit::NetworkCapture::Manager::initialize):
2793
2794 2016-12-19  Gavin Barraclough  <barraclough@apple.com>
2795
2796         [CSS Parser] Enable CSS Deferred Parsing
2797         https://bugs.webkit.org/show_bug.cgi?id=165869
2798
2799         Unreviewed rollout – looks like this regressed performance.
2800
2801         * Shared/WebPreferencesDefinitions.h:
2802
2803 2016-12-19  Anders Carlsson  <andersca@apple.com>
2804
2805         REGRESSION: Crash in com.apple.WebKit:IPC::Connection::platformCanSendOutgoingMessages() const + 0
2806         https://bugs.webkit.org/show_bug.cgi?id=165817
2807         rdar://problem/29626731
2808
2809         Reviewed by Dan Bernstein.
2810
2811         If the receive right is invalidated before we send the message, the kernel won't be able to create a send right,
2812         and we'll crash due to mach_msg returning MACH_SEND_INVALID_RIGHT.
2813         
2814         Fix this by immediately creating a send right, and passing MACH_MSG_TYPE_MOVE_SEND to the attachment constructor.
2815
2816         * WebProcess/WebPage/WebInspector.cpp:
2817         (WebKit::WebInspector::openFrontendConnection):
2818
2819 2016-12-18  Simon Fraser  <simon.fraser@apple.com>
2820
2821         Expose a way for MiniBrowser to simulate header and footer banners
2822         https://bugs.webkit.org/show_bug.cgi?id=166005
2823
2824         Reviewed by Wenson Hsieh.
2825         
2826         Expose testing SPI that allows a client to simulate the presence of header
2827         and footer banners. These are simply plumbed through to set FrameView's
2828         m_headerHeight and m_footerHeight.
2829
2830         * UIProcess/API/Cocoa/WKWebView.mm:
2831         (-[WKWebView _setHeaderBannerHeightForTesting:]):
2832         (-[WKWebView _setFooterBannerHeightForTesting:]):
2833         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2834         * UIProcess/WebPageProxy.cpp:
2835         (WebKit::WebPageProxy::setHeaderBannerHeightForTesting):
2836         (WebKit::WebPageProxy::setFooterBannerHeightForTesting):
2837         * UIProcess/WebPageProxy.h:
2838         * WebProcess/WebPage/WebPage.cpp:
2839         (WebKit::WebPage::setHeaderBannerHeightForTesting):
2840         (WebKit::WebPage::setFooterBannerHeightForTesting):
2841         * WebProcess/WebPage/WebPage.h:
2842         * WebProcess/WebPage/WebPage.messages.in:
2843
2844 2016-12-16  Dave Hyatt  <hyatt@apple.com>
2845
2846         [CSS Values] Make separate wrapper classes for the deprecated CSS Values OM
2847         https://bugs.webkit.org/show_bug.cgi?id=165968
2848
2849         Reviewed by Andreas Kling.
2850
2851         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSValue.cpp:
2852         (WebKit::kit):
2853         (WebKit::core):
2854         (WebKit::wrapCSSValue):
2855         (webkit_dom_css_value_constructor):
2856         (webkit_dom_css_value_get_css_text):
2857         (webkit_dom_css_value_set_css_text):
2858         (webkit_dom_css_value_get_css_value_type):
2859         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSValuePrivate.h:
2860
2861 2016-12-17  Wenson Hsieh  <wenson_hsieh@apple.com>
2862
2863         Visual viewports: bottom fixed elements disappear behind the keyboard
2864         https://bugs.webkit.org/show_bug.cgi?id=165983
2865         <rdar://problem/29409852>
2866
2867         Reviewed by Simon Fraser.
2868
2869         Accounts for input view bounds in WebPageProxy::computeCustomFixedPositionRect. To do this, we introduce and
2870         pass unobscuredContentRectRespectingInputViewBounds along with the regular unobscuredContentRect (which does not
2871         respect the obscuring keyboard rect). This unobscuredContentRectRespectingInputViewBounds is then used when
2872         computing the origin of the updated layout viewport rect (and also, when we are _not_ below minimum scale),
2873         
2874         Additionally, the size is computed using the (unconstrained) unobscured rect. This is because we previously
2875         would use the document-constrained version of the unobscured rect, which caused the layout viewport to shrink
2876         when approaching the max scroll extents of the document while the keyboard is up, since the unobscured rect
2877         would spill out of the document rect. However, using this unconstrained rect's size also means that if the user
2878         rubber-bands out of the document rect, we would end up pushing the layout viewport rect out of the document,
2879         with no way of adjusting it back in without the user scrolling to push the layout viewport into back document
2880         bounds. To address this, we move the layout rect to be within document bounds after computing its size and
2881         location.
2882
2883         Added a new layout test: fast/visual-viewport/ios/fixed-element-on-bottom-with-keyboard.html, and also tweaked
2884         fixed-caret-position-after-scroll.html to cover these changes.
2885
2886         * Shared/VisibleContentRectUpdateInfo.cpp:
2887         (WebKit::operator<<):
2888         * Shared/VisibleContentRectUpdateInfo.h:
2889         (WebKit::VisibleContentRectUpdateInfo::VisibleContentRectUpdateInfo):
2890         (WebKit::VisibleContentRectUpdateInfo::unobscuredContentRectRespectingInputViewBounds):
2891         * UIProcess/API/Cocoa/WKWebView.mm:
2892         (-[WKWebView _updateContentRectsWithState:]):
2893         (-[WKWebView _inputViewBounds]):
2894
2895         Returns the current bounds of the input view. For testing purposes.
2896
2897         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2898         * UIProcess/WebPageProxy.h:
2899         (WebKit::WebPageProxy::unobscuredContentRectRespectingInputViewBounds):
2900         * UIProcess/ios/RemoteScrollingCoordinatorProxyIOS.mm:
2901         (WebKit::RemoteScrollingCoordinatorProxy::customFixedPositionRect):
2902         * UIProcess/ios/WKContentView.h:
2903         * UIProcess/ios/WKContentView.mm:
2904         (-[WKContentView _computeUnobscuredContentRectRespectingInputViewBounds:unobscuredContentRect:inputViewBounds:scale:]):
2905
2906         Helper to compute the unobscured rect, accounting for the bounds of the current input view.
2907
2908         (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:obscuredInset:inputViewBounds:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]):
2909         (-[WKContentView _didCommitLayerTree:]):
2910         (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:obscuredInset:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]): Deleted.
2911         * UIProcess/ios/WebPageProxyIOS.mm:
2912         (WebKit::WebPageProxy::computeCustomFixedPositionRect):
2913         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
2914         (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
2915
2916 2016-12-16  Ryosuke Niwa  <rniwa@webkit.org>
2917
2918         Deleting a character converted from pinyin after an image causes a Safari crash
2919         https://bugs.webkit.org/show_bug.cgi?id=165839
2920
2921         Reviewed by Darin Adler.
2922
2923         The crash was caused by the payload of the IPC not being decoded correctly when the encoded attributed string
2924         contains a NSTextAttachment but send<> would still gladly send it to the UIProcess.
2925
2926         Fixed it by omitting the image as done in r176412 since encoding NSFileWrapper, etc... would require
2927         quite a bit of work, and IME doesn't really need to see the image in its attributed string.
2928
2929         * WebProcess/WebPage/mac/WebPageMac.mm:
2930         (WebKit::WebPage::attributedSubstringForCharacterRangeAsync): Fixed the bug.
2931
2932 2016-12-16  Andy Estes  <aestes@apple.com>
2933
2934         Add a setting to suppress keyboard input during provisional navigation
2935         https://bugs.webkit.org/show_bug.cgi?id=165830
2936
2937         Reviewed by Brent Fulgham.
2938
2939         * Shared/WebPreferencesDefinitions.h: Defined
2940         shouldSuppressKeyboardDOMEventsDuringProvisionalNavigation.
2941         * UIProcess/API/C/WKPreferences.cpp:
2942         (WKPreferencesSetShouldSuppressKeyboardInputDuringProvisionalNavigation): Added.
2943         (WKPreferencesGetShouldSuppressKeyboardInputDuringProvisionalNavigation): Added.
2944         * UIProcess/API/C/WKPreferencesRefPrivate.h: Declared a getter and setter for the new
2945         preference.
2946         * UIProcess/API/Cocoa/WKPreferences.mm:
2947         (-[WKPreferences _shouldSuppressKeyboardInputDuringProvisionalNavigation]): Added.
2948         (-[WKPreferences _setShouldSuppressKeyboardInputDuringProvisionalNavigation:]): Added.
2949         * UIProcess/API/Cocoa/WKPreferencesPrivate.h: Declared a property for the new preference.
2950         * WebProcess/WebPage/WebPage.cpp:
2951         (WebKit::WebPage::updatePreferences): Mapped the new preference to its corresponding
2952         WebCore::Setting.
2953
2954 2016-12-16  Chris Dumez  <cdumez@apple.com>
2955
2956         HTML form validation bubble should be dismissed on navigation
2957         https://bugs.webkit.org/show_bug.cgi?id=165960
2958         <rdar://problem/29668086>
2959
2960         Reviewed by Simon Fraser.
2961
2962         Dismiss HTML form validation bubble on top-level navigation on WK2.
2963
2964         * UIProcess/WebPageProxy.cpp:
2965         (WebKit::WebPageProxy::didStartProvisionalLoadForFrame):
2966
2967 2016-12-16  Jer Noble  <jer.noble@apple.com>
2968
2969         Small refactor: Use HashCountedSet rather than HashMap<..., int> to store client counts in WebPlaybackSessionManager{,Proxy}.
2970         https://bugs.webkit.org/show_bug.cgi?id=165807
2971
2972         Reviewed by Eric Carlson.
2973
2974         * UIProcess/Cocoa/WebPlaybackSessionManagerProxy.h:
2975         * UIProcess/Cocoa/WebPlaybackSessionManagerProxy.mm:
2976         (WebKit::WebPlaybackSessionManagerProxy::addClientForContext):
2977         (WebKit::WebPlaybackSessionManagerProxy::removeClientForContext):
2978         * WebProcess/cocoa/WebPlaybackSessionManager.h:
2979         * WebProcess/cocoa/WebPlaybackSessionManager.mm:
2980         (WebKit::WebPlaybackSessionManager::addClientForContext):
2981         (WebKit::WebPlaybackSessionManager::removeClientForContext):
2982
2983 2016-12-16  Wenson Hsieh  <wenson_hsieh@apple.com>
2984
2985         Visual viewports: carets and selection UI are incorrectly positioned when editing fixed elements
2986         https://bugs.webkit.org/show_bug.cgi?id=165767
2987         <rdar://problem/29602382>
2988
2989         Reviewed by Simon Fraser.
2990
2991         When focusing an input, the position of the caret on iOS is determined by the overridden layout viewport rect in
2992         the web process. However, this rect is not updated until the end the scroll gesture. Whereas this is fine for
2993         non-fixed inputs since their document location does not change, fixed inputs effectively change their position
2994         in the document as the user scrolls. This causes the caret to be 'left behind' in the document position it was
2995         in at the start of the scroll. To fix this, we deactivate the selection when exiting stable state if the
2996         assisted node is in a fixed position container, and reenable it upon receiving the next stable state EditorState
2997         update (as indicated by postLayoutData().isStableStateUpdate). Additionally, we apply similar treatment to the
2998         web selection assistant -- this time, we need to force the selection view to hide (analagous to deactivating
2999         the text selection assistant) and show it again upon receiving the next selection change update when the WebPage
3000         (in the web process) is stable.
3001
3002         Furthermore, adds test support for querying text caret and selection rects, as well as perform a callback after
3003         the WebPage has indicated that it is stable, both as SPI on the WKWebView.
3004
3005         Covered by 4 new layout tests in fast/editing/caret/ios and fast/editing/selection/ios.
3006
3007         * Platform/spi/ios/UIKitSPI.h:
3008         * Shared/EditorState.cpp:
3009         (WebKit::EditorState::PostLayoutData::encode):
3010         (WebKit::EditorState::PostLayoutData::decode):
3011         * Shared/EditorState.h:
3012
3013         Introduce isStableStateUpdate, which is true when the WebPage is known to be in stable state, as well as
3014         insideFixedPosition, which is true when the current selection is inside a fixed position container.
3015
3016         * Shared/mac/RemoteLayerTreeTransaction.h:
3017         (WebKit::RemoteLayerTreeTransaction::isInStableState):
3018         (WebKit::RemoteLayerTreeTransaction::setIsInStableState):
3019         * Shared/mac/RemoteLayerTreeTransaction.mm:
3020         (WebKit::RemoteLayerTreeTransaction::encode):
3021         (WebKit::RemoteLayerTreeTransaction::decode):
3022         (WebKit::RemoteLayerTreeTransaction::description):
3023         * UIProcess/API/Cocoa/WKWebView.mm:
3024         (-[WKWebView _didCommitLayerTree:]):
3025         (-[WKWebView _uiTextCaretRect]):
3026
3027         Introduced a new SPI method for fetching the current rect of the text assistant's caret view, at keyPath
3028         "selectionView.selection.caretRect".
3029
3030         (-[WKWebView _uiTextSelectionRects]):
3031
3032         Renamed (and refactored) from _uiTextSelectionRectViews, which was previously fetching an array of UIViews. I
3033         found this to cause character-granularity-rect.html to fail due to the array of UIViews here being empty, so I
3034         refactored this to simply return an array of rects from the keyPath "selectionView.selection.selectionRects" for
3035         the text selection assistant and @"selectionView.selectionRects" for the web selection assistant.
3036
3037         (-[WKWebView _doAfterNextStablePresentationUpdate:]):
3038
3039         Runs the given block after both the UI process and web processes agree that the visible content rect state is 
3040         stable. To do this, we fire presentation updates until the UI process (via RemoteLayerTreeTransactions)
3041         discovers that the web page is in stable state. This is used solely for testing purposes.
3042
3043         (-[WKWebView _firePresentationUpdateForPendingStableStatePresentationCallbacks]):
3044         (-[WKWebView _uiTextSelectionRectViews]): Deleted.
3045         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
3046         * UIProcess/WebPageProxy.h:
3047         (WebKit::WebPageProxy::inStableState):
3048         * UIProcess/ios/WKContentView.mm:
3049         (-[WKContentView _didExitStableState]):
3050
3051         Deactivate the text selection if the assisted node is inside a fixed container.
3052
3053         (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:obscuredInset:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]):
3054         * UIProcess/ios/WKContentViewInteraction.h:
3055         * UIProcess/ios/WKContentViewInteraction.mm:
3056         (-[WKContentView setupInteraction]):
3057         (-[WKContentView cleanupInteraction]):
3058         (-[WKContentView shouldHideSelectionWhenScrolling]):
3059         (-[WKContentView _uiTextSelectionRects]):
3060         (-[WKContentView _didEndScrollingOrZooming]):
3061         (-[WKContentView _updateChangedSelection:]):
3062
3063         If the EditorState was created after a stable state update, reactivate the text selection assistant if it exists.
3064         Additionally, if we are deferring the end scrolling selection update until after the first stable editor state
3065         update arrives from the web process, we need to also call [_textSelectionAssistant didEndScrollingOverflow]
3066         and [_webSelectionAssistant didEndScrollingOrZoomingPage] here instead of doing so immediately after scrolling
3067         finishes. This ensures that selection UI (the callout and selection highlights) do not flicker from their old
3068         position to the new position when scrolling finishes.
3069
3070         * WebProcess/WebPage/WebPage.cpp:
3071         (WebKit::WebPage::willCommitLayerTree):
3072         * WebProcess/WebPage/ios/WebPageIOS.mm:
3073         (WebKit::WebPage::platformEditorState):
3074         (WebKit::WebPage::updateVisibleContentRects):
3075
3076         When updating the layout viewport override rect, also recompute the caret if needed and send an updated
3077         EditorState over to the UI process.
3078
3079 2016-12-16  Claudio Saavedra  <csaavedra@igalia.com>
3080
3081         [WK2] SharedMemory: include cleanups
3082         https://bugs.webkit.org/show_bug.cgi?id=165950
3083
3084         Reviewed by Žan Doberšek.
3085
3086         The WTFString include is not needed in the header, so move to the
3087         Unix file. Use the existing UNIX_DOMAIN_SOCKETS define. Also
3088         include the WTFOptional header where needed.
3089
3090         * Platform/SharedMemory.h:
3091         * Platform/unix/SharedMemoryUnix.cpp:
3092
3093 2016-12-16  Joonghun Park  <jh718.park@samsung.com>
3094
3095         [EFL] Fix build break since r209907. Unreviewed.
3096         https://bugs.webkit.org/show_bug.cgi?id=165954
3097
3098         * UIProcess/efl/TextCheckerEfl.cpp: Change the remaining TextBreakIterator to UBreakIterator
3099         (WebKit::nextWordOffset):
3100         (WebKit::TextChecker::checkTextOfParagraph):
3101
3102 2016-12-15  Darin Adler  <darin@apple.com>
3103
3104         Use asString instead of toWTFString, toString, or getString when we already checked isString
3105         https://bugs.webkit.org/show_bug.cgi?id=165895
3106
3107         Reviewed by Yusuke Suzuki.
3108
3109         * WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp:
3110         (WebKit::NPRuntimeObjectMap::convertJSValueToNPVariant): Use asString/value instead of toWTFString.
3111
3112 2016-12-15  Chris Dumez  <cdumez@apple.com>
3113
3114         Make sure HTML validation bubble's state is updated after layout
3115         https://bugs.webkit.org/show_bug.cgi?id=165922
3116         <rdar://problem/29694730>
3117
3118         Reviewed by Simon Fraser.
3119
3120         Make sure HTML validation bubble's state is updated after layout.
3121         In particular, if the validation bubble's associated element has
3122         moved or is no longer visible, we now hide the bubble.
3123
3124         * WebProcess/WebCoreSupport/WebValidationMessageClient.cpp:
3125         (WebKit::WebValidationMessageClient::showValidationMessage):
3126         (WebKit::WebValidationMessageClient::hideValidationMessage):
3127         (WebKit::WebValidationMessageClient::updateValidationBubbleStateIfNeeded):
3128         * WebProcess/WebCoreSupport/WebValidationMessageClient.h:
3129
3130 2016-12-15  Alex Christensen  <achristensen@webkit.org>
3131
3132         Improve NetworkSession logging
3133         https://bugs.webkit.org/show_bug.cgi?id=165941
3134
3135         Reviewed by Tim Horton.
3136
3137         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
3138         (-[WKNetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:]):
3139         (-[WKNetworkSessionDelegate URLSession:task:didCompleteWithError:]):
3140         (-[WKNetworkSessionDelegate URLSession:dataTask:didReceiveResponse:completionHandler:]):
3141         One of the "didReceiveResponse completionHandler (cancel)" messages was wrong,
3142         and other messages could have more useful information without being overwhelming.
3143
3144 2016-12-15  Myles C. Maxfield  <mmaxfield@apple.com>
3145
3146         Sort Xcode project files
3147         https://bugs.webkit.org/show_bug.cgi?id=165937
3148
3149         Reviewed by Simon Fraser.
3150
3151         * WebKit2.xcodeproj/project.pbxproj:
3152
3153 2016-12-15  Anders Carlsson  <andersca@apple.com>
3154
3155         Add more mach_msg logging instrumentation
3156         https://bugs.webkit.org/show_bug.cgi?id=165914
3157
3158         Reviewed by Darin Adler.
3159
3160         * Platform/IPC/mac/ConnectionMac.mm:
3161         (IPC::Connection::sendMessage):
3162         (IPC::Connection::sendOutgoingMessage):
3163         * Platform/IPC/mac/MachMessage.h:
3164         (IPC::MachMessage::messageName):
3165         (IPC::MachMessage::setMessageName):
3166
3167 2016-12-15  Konstantin Tokarev  <annulen@yandex.ru>
3168
3169         Added missing override and final specifiers
3170         https://bugs.webkit.org/show_bug.cgi?id=165903
3171
3172         Reviewed by Darin Adler.
3173
3174         * UIProcess/API/gtk/WebKitGeolocationProvider.h:
3175         * UIProcess/WebFormSubmissionListenerProxy.h:
3176         * UIProcess/WebFramePolicyListenerProxy.h:
3177         * WebProcess/Automation/WebAutomationSessionProxy.h:
3178         * WebProcess/InjectedBundle/API/gtk/DOM/GObjectXPathNSResolver.h:
3179         * WebProcess/MediaCache/WebMediaKeyStorageManager.h:
3180         * WebProcess/Plugins/Netscape/NPRuntimeObjectMap.h:
3181         * WebProcess/WebCoreSupport/WebPlugInClient.h:
3182         * WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.h:
3183         * WebProcess/WebPage/FindController.h:
3184
3185 2016-12-15  Simon Fraser  <simon.fraser@apple.com>
3186
3187         [iOS WK2] Don't disable position:fixed when a form element has focus
3188         https://bugs.webkit.org/show_bug.cgi?id=165891
3189         rdar://problem/29271694
3190
3191         Reviewed by Wenson Hsieh.
3192
3193         Before visual viewports, we had to lay out position:fixed relative to the document rect (effectively
3194         disabling position:fixed) when a form element was focused, to ensure that we could scroll to inputs
3195         inside position:Fixed.
3196
3197         When visual viewports are enabled, we can do a better job of this, and keep position:fixed active.
3198         
3199         Test: fast/visual-viewport/ios/zoomed-focus-in-fixed.html
3200
3201         * UIProcess/API/Cocoa/WKWebView.mm: 
3202         (-[WKWebView _zoomToFocusRect:selectionRect:insideFixed:fontSize:minimumScale:maximumScale:allowScaling:forceScroll:]): Soon this will use
3203         insideFixed to have better scroll-into-view behavior.
3204         (-[WKWebView _zoomToFocusRect:selectionRect:fontSize:minimumScale:maximumScale:allowScaling:forceScroll:]): Deleted.
3205         * UIProcess/API/Cocoa/WKWebViewInternal.h:
3206         * UIProcess/ios/WKContentView.h:
3207         * UIProcess/ios/WKContentView.mm:
3208         (-[WKContentView _zoomToFocusRect:selectionRect:insideFixed:fontSize:minimumScale:maximumScale:allowScaling:forceScroll:]):
3209         (-[WKContentView _zoomToFocusRect:selectionRect:fontSize:minimumScale:maximumScale:allowScaling:forceScroll:]): Deleted.
3210         * UIProcess/ios/WKContentViewInteraction.mm:
3211         (-[WKContentView _displayFormNodeInputView]):
3212         * UIProcess/ios/WebPageProxyIOS.mm:
3213         (WebKit::WebPageProxy::computeCustomFixedPositionRect): Don't fall back to using the documentRect as the fixed
3214         position rect if visual viewports are enabled.
3215         * WebProcess/WebPage/ios/WebPageIOS.mm:
3216         (WebKit::WebPage::getAssistedNodeInformation): Don't reset the customtFixedPositionRect around computing element
3217         coordinates if visual viewports are enabled.
3218
3219 2016-12-15  Andreas Kling  <akling@apple.com>
3220
3221         Always clear RenderLayer backing stores when going into page cache.
3222         <https://webkit.org/b/165901>
3223
3224         Reviewed by Simon Fraser.
3225
3226         * WebProcess/WebProcess.cpp:
3227         (WebKit::WebProcess::WebProcess):
3228
3229 2016-12-15  Darin Adler  <darin@apple.com>
3230
3231         Remove custom binding for MediaDevices
3232         https://bugs.webkit.org/show_bug.cgi?id=165894
3233
3234         Reviewed by Eric Carlson.
3235
3236         * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
3237         Added include of MediaConstraintsImpl.h, now needed because we
3238         removed some unneeded includes from the WebCore headers.
3239
3240 2016-12-15  Dave Hyatt  <hyatt@apple.com>
3241
3242         [CSS Parser] Enable CSS Deferred Parsing
3243         https://bugs.webkit.org/show_bug.cgi?id=165869
3244
3245         Reviewed by Sam Weinig.
3246
3247         * Shared/WebPreferencesDefinitions.h:
3248
3249 2016-12-14  Andreas Kling  <akling@apple.com>
3250
3251         Only send Messages::WebPageProxy::DidSaveToPageCache once when entering page cache.
3252         <https://webkit.org/b/165887>
3253
3254         Reviewed by Brady Eidson.
3255
3256         We were sending one of these IPC messages per frame when a page enters the page cache,
3257         and we really only need one, so only do it for the main frame.
3258
3259         (This message is used to adopt the page cache on the UI process side, in case another
3260         web process currently owns the cache. That happens in WebProcessPool::processDidCachePage().)
3261
3262         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3263         (WebKit::WebFrameLoaderClient::didSaveToPageCache):
3264
3265 2016-12-14  Simon Fraser  <simon.fraser@apple.com>
3266
3267         Fix cause of viewport-related flakiness in iOS tests
3268         https://bugs.webkit.org/show_bug.cgi?id=165878
3269
3270         Reviewed by Tim Horton.
3271
3272         When TestController::platformConfigureViewForTest() changes the view size for a flexible
3273         viewport test, the page would not have updated with the new scale by the time the load event
3274         fired, causing flakiness depending on test order.
3275
3276         This was caused by code added in r170325 that delayed visible content rect updates until
3277         after the UI process has received the transaction after didCommitLoad. So fix by overriding
3278         this mechanism if the view has been resized.
3279
3280         * Shared/VisibleContentRectUpdateInfo.cpp:
3281         (WebKit::VisibleContentRectUpdateInfo::encode):
3282         (WebKit::VisibleContentRectUpdateInfo::decode):
3283         (WebKit::operator<<):
3284         * Shared/VisibleContentRectUpdateInfo.h:
3285         (WebKit::VisibleContentRectUpdateInfo::VisibleContentRectUpdateInfo):
3286         (WebKit::VisibleContentRectUpdateInfo::isFirstUpdateForNewViewSize):
3287         (WebKit::operator==):
3288         * UIProcess/API/Cocoa/WKWebView.mm:
3289         (-[WKWebView _frameOrBoundsChanged]):
3290         (-[WKWebView _updateContentRectsWithState:]):
3291         * UIProcess/DrawingAreaProxy.cpp:
3292         (WebKit::DrawingAreaProxy::setSize):
3293         * UIProcess/DrawingAreaProxy.h:
3294         * UIProcess/WebPageProxy.cpp:
3295         (WebKit::WebPageProxy::WebPageProxy):
3296         * UIProcess/WebPageProxy.h:
3297         * UIProcess/ios/WKContentView.h:
3298         * UIProcess/ios/WKContentView.mm:
3299         (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:obscuredInset:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]):
3300         * WebProcess/WebPage/ios/WebPageIOS.mm:
3301         (WebKit::WebPage::updateVisibleContentRects):
3302
3303 2016-12-04  Sam Weinig  <sam@webkit.org>
3304
3305         [WebIDL] Add support for converting dictionaries to JS
3306         https://bugs.webkit.org/show_bug.cgi?id=165367
3307
3308         Reviewed by Chris Dumez.
3309
3310         * CMakeLists.txt:
3311         Add missing directories to look in for headers.
3312
3313 2016-12-14  Anders Carlsson  <andersca@apple.com>
3314
3315         Add WKContextRefreshPlugIns
3316         https://bugs.webkit.org/show_bug.cgi?id=165879
3317         rdar://problem/29602414
3318
3319         Reviewed by Tim Horton.
3320
3321         * UIProcess/API/C/WKContext.cpp:
3322         (WKContextRefreshPlugIns):
3323         * UIProcess/API/C/WKContext.h:
3324         * UIProcess/WebProcessPool.cpp:
3325         (WebKit::WebProcessPool::refreshPlugins):
3326         * UIProcess/WebProcessPool.h:
3327         * WebProcess/Plugins/WebPluginInfoProvider.h:
3328         * WebProcess/WebProcess.cpp:
3329         (WebKit::WebProcess::refreshPlugins):
3330         * WebProcess/WebProcess.h:
3331         * WebProcess/WebProcess.messages.in:
3332
3333 2016-12-14  Tim Horton  <timothy_horton@apple.com>
3334
3335         API Test Fullscreen.TopContentInset is asserting on Yosemite
3336         https://bugs.webkit.org/show_bug.cgi?id=165877
3337
3338         Reviewed by Brady Eidson.
3339
3340         * UIProcess/WebPageProxy.cpp:
3341         (WebKit::WebPageProxy::setTopContentInset):
3342         * WebProcess/WebPage/WebPage.cpp:
3343         * WebProcess/WebPage/WebPage.h:
3344         * WebProcess/WebPage/WebPage.messages.in:
3345         We don't use fences on Yosemite, but this codepath still tried to.
3346         Instead of guarding with PLATFORM(COCOA), make use of the more accurate
3347         HAVE(COREANIMATION_FENCES) guard.
3348
3349 2016-12-14  Anders Carlsson  <andersca@apple.com>
3350
3351         Add some instrumentation to try to detect a crash on the bots
3352         https://bugs.webkit.org/show_bug.cgi?id=165866
3353
3354         Reviewed by Sam Weinig.
3355
3356         * Platform/IPC/mac/ConnectionMac.mm:
3357         (IPC::Connection::sendMessage):
3358
3359 2016-12-14  Dave Hyatt  <hyatt@apple.com>
3360
3361         [CSS Parser] Implement deferred parsing of properties, @media, @supports and @keyframes
3362         https://bugs.webkit.org/show_bug.cgi?id=165743
3363
3364         Reviewed by Dean Jackson.
3365
3366         Repurpose the newCSSParserEnabled preference for deferred parsing. Just change the name
3367         from "new" to "deferred."
3368
3369         * Shared/WebPreferencesDefinitions.h:
3370         * UIProcess/API/C/WKPreferences.cpp:
3371         (WKPreferencesSetDeferredCSSParserEnabled):
3372         (WKPreferencesGetDeferredCSSParserEnabled):
3373         (WKPreferencesSetNewCSSParserEnabled): Deleted.
3374         (WKPreferencesGetNewCSSParserEnabled): Deleted.
3375         * UIProcess/API/C/WKPreferencesRefPrivate.h:
3376         * WebProcess/WebPage/WebPage.cpp:
3377         (WebKit::WebPage::updatePreferences):
3378
3379 2016-12-14  Brent Fulgham  <bfulgham@apple.com>
3380
3381         Unreviewed test fix after r209806.
3382
3383         Plugin-common doesn't define 'home-subpath'. Instead it has 'home-library-subpath'. Switch to the correct
3384         function. Also, 'home-library-subpath' adds '/Library' to the path, so revise the arguments so that we
3385         do not generate paths like '/home/username/Library/Library/Keychains'.
3386
3387         * PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in:
3388
3389 2016-12-14  Brent Fulgham  <bfulgham@apple.com>
3390
3391         Unreviewed test fix after r209779.
3392
3393         The 'Keygen' element requires the ability to create new keys in '$HOME/Library/Keychains'. Remove the
3394         WebProcess and Plugin sandbox restrictions on per-user Keychain creation to support this use.
3395
3396         * PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in:
3397         * WebProcess/com.apple.WebProcess.sb.in:
3398
3399 2016-12-13  Yusuke Suzuki  <utatane.tea@gmail.com>
3400
3401         Use JSValue::toWTFString instead of calling toString(exec) and value(exec)
3402         https://bugs.webkit.org/show_bug.cgi?id=165795
3403
3404         Reviewed by Saam Barati.
3405
3406         * WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp:
3407         (WebKit::NPRuntimeObjectMap::convertJSValueToNPVariant):
3408
3409 2016-12-14  Enrique Ocaña González  <eocanha@igalia.com>
3410
3411         REGRESSION(r207879-207891): [GStreamer] Introduced many layout test failures and crashes, bots exiting early
3412         https://bugs.webkit.org/show_bug.cgi?id=164022
3413
3414         Reviewed by Xabier Rodriguez-Calvar.
3415
3416         * Shared/WebPreferencesDefinitions.h:
3417         New GStreamerEnabled preference, defaults to true.
3418         * WebProcess/WebPage/WebPage.cpp: Ditto.
3419         (WebKit::WebPage::updatePreferences):
3420
3421 2016-12-13  Commit Queue  <commit-queue@webkit.org>
3422
3423         Unreviewed, rolling out r209792.
3424         https://bugs.webkit.org/show_bug.cgi?id=165841
3425
3426         Cause build failures (Requested by yusukesuzuki on #webkit).
3427
3428         Reverted changeset:
3429
3430         "Use JSValue::toWTFString instead of calling toString(exec)
3431         and value(exec)"
3432         https://bugs.webkit.org/show_bug.cgi?id=165795
3433         http://trac.webkit.org/changeset/209792
3434
3435 2016-12-13  Yusuke Suzuki  <utatane.tea@gmail.com>
3436
3437         Use JSValue::toWTFString instead of calling toString(exec) and value(exec)
3438         https://bugs.webkit.org/show_bug.cgi?id=165795
3439
3440         Reviewed by Saam Barati.
3441
3442         * WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp:
3443         (WebKit::NPRuntimeObjectMap::convertJSValueToNPVariant):
3444
3445 2016-12-13  Alex Christensen  <achristensen@webkit.org>
3446
3447         Fix CMake build.
3448
3449         * PlatformMac.cmake:
3450
3451 2016-12-13  Jer Noble  <jer.noble@apple.com>
3452
3453         Fullscreen in WebKit2 does not restore topContentInset upon exiting; leaves top of page not visible
3454         https://bugs.webkit.org/show_bug.cgi?id=165697