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