[SOUP] Layout test http/tests/misc/authentication-redirect-3/authentication-sent...
[WebKit-https.git] / Source / WebKit2 / ChangeLog
1 2016-11-05  Carlos Garcia Campos  <cgarcia@igalia.com>
2
3         [SOUP] Layout test http/tests/misc/authentication-redirect-3/authentication-sent-to-redirect-same-origin-with-location-credentials.html fails
4         https://bugs.webkit.org/show_bug.cgi?id=139358
5
6         Reviewed by Michael Catanzaro.
7
8         Stop putting the credentials in the URL unconditionally and ensure we only do that when provided by the URL
9         itself. Libsoup has its own cache of SoupAuth, so we don't need to pass user/pass in the URL for every single
10         request, libsoup will authenticate those automatically.
11
12         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
13         (WebKit::NetworkDataTaskSoup::applyAuthenticationToRequest):
14
15 2016-11-04  Filip Pizlo  <fpizlo@apple.com>
16
17         WTF::ParkingLot should stop using std::chrono because std::chrono::duration casts are prone to overflows
18         https://bugs.webkit.org/show_bug.cgi?id=152045
19
20         Reviewed by Andy Estes.
21
22         * Platform/IPC/Connection.cpp:
23         (IPC::Connection::SyncMessageState::wait):
24         (IPC::Connection::sendMessage):
25         (IPC::Connection::timeoutRespectingIgnoreTimeoutsForTesting):
26         (IPC::Connection::waitForMessage):
27         (IPC::Connection::sendSyncMessage):
28         (IPC::Connection::waitForSyncReply):
29         * Platform/IPC/Connection.h:
30         (IPC::Connection::sendSync):
31         (IPC::Connection::waitForAndDispatchImmediately):
32         * Platform/IPC/MessageSender.h:
33         (IPC::MessageSender::sendSync):
34         * UIProcess/ChildProcessProxy.h:
35         (WebKit::ChildProcessProxy::sendSync):
36         * UIProcess/Network/NetworkProcessProxy.cpp:
37         (WebKit::NetworkProcessProxy::sendProcessWillSuspendImminently):
38         * UIProcess/Storage/StorageManager.cpp:
39         (WebKit::StorageManager::applicationWillTerminate):
40         * UIProcess/WebProcessProxy.cpp:
41         (WebKit::WebProcessProxy::sendProcessWillSuspendImminently):
42         * UIProcess/WebResourceLoadStatisticsStore.cpp:
43         (WebKit::WebResourceLoadStatisticsStore::applicationWillTerminate):
44         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h:
45         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
46         (-[WKOneShotDisplayLinkHandler displayLinkFired:]):
47         (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
48         (WebKit::RemoteLayerTreeDrawingAreaProxy::didRefreshDisplay):
49         (WebKit::RemoteLayerTreeDrawingAreaProxy::waitForDidUpdateActivityState):
50         * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm:
51         (WebKit::TiledCoreAnimationDrawingAreaProxy::waitForDidUpdateActivityState):
52         * UIProcess/mac/WKImmediateActionController.mm:
53         (-[WKImmediateActionController immediateActionRecognizerWillBeginAnimation:]):
54         * UIProcess/mac/WebPageProxyMac.mm:
55         (WebKit::WebPageProxy::stringSelectionForPasteboard):
56         (WebKit::WebPageProxy::dataSelectionForPasteboard):
57         (WebKit::WebPageProxy::readSelectionFromPasteboard):
58         (WebKit::WebPageProxy::shouldDelayWindowOrderingForEvent):
59         (WebKit::WebPageProxy::acceptsFirstMouse):
60         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
61         (WebKit::WebChromeClient::runBeforeUnloadConfirmPanel):
62         (WebKit::WebChromeClient::runJavaScriptAlert):
63         (WebKit::WebChromeClient::runJavaScriptConfirm):
64         (WebKit::WebChromeClient::runJavaScriptPrompt):
65         (WebKit::WebChromeClient::print):
66         (WebKit::WebChromeClient::exceededDatabaseQuota):
67         (WebKit::WebChromeClient::reachedApplicationCacheOriginQuota):
68         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
69         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):
70         * WebProcess/WebPage/WebPage.cpp:
71         (WebKit::WebPage::postSynchronousMessageForTesting):
72
73 2016-11-04  Wenson Hsieh  <wenson_hsieh@apple.com>
74
75         Safari does not emit composition end if blurred for dead key / Japanese IME
76         https://bugs.webkit.org/show_bug.cgi?id=164369
77         <rdar://problem/29050439>
78
79         Reviewed by Ryosuke Niwa.
80
81         Split WebPage::discardedComposition into two steps, where we first discard marked text and then update the
82         editor state. This allows the codepath where we cancel the composition early (before setting the selection) to
83         discard marked text without also forcing an editor state update at the same time. The editor state is later
84         updated in WebPage::didChangeSelection.
85
86         * UIProcess/WebPageProxy.cpp:
87         (WebKit::WebPageProxy::compositionWasCanceled):
88         * UIProcess/WebPageProxy.h:
89         * UIProcess/WebPageProxy.messages.in:
90         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
91         (WebKit::WebEditorClient::canceledComposition):
92         * WebProcess/WebCoreSupport/WebEditorClient.h:
93         * WebProcess/WebPage/WebPage.cpp:
94         (WebKit::WebPage::didChangeSelection):
95         (WebKit::WebPage::discardedComposition):
96         (WebKit::WebPage::canceledComposition):
97         * WebProcess/WebPage/WebPage.h:
98
99 2016-11-04  Alex Christensen  <achristensen@webkit.org>
100
101         Unreviewed, rolling out r208293.
102
103         asserts in API tests.
104
105         Reverted changeset:
106
107         "NetworkSession: Network process crash when converting main
108         resource to download"
109         https://bugs.webkit.org/show_bug.cgi?id=164220
110         http://trac.webkit.org/changeset/208293
111
112 2016-11-04  Said Abou-Hallawa  <sabouhallawa@apple.com>
113
114         Add a setting and preferences to enable/disable async image decoding
115         https://bugs.webkit.org/show_bug.cgi?id=164417
116
117         Reviewed by Simon Fraser.
118
119         Hook up the asyncImageDecodingEnabled setting for WebKit2.
120
121         * Shared/WebPreferencesDefinitions.h:
122         * UIProcess/API/Cocoa/WKPreferences.mm:
123         (-[WKPreferences _asyncImageDecodingEnabled]):
124         (-[WKPreferences _setAsyncImageDecodingEnabled:]):
125         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
126         * WebProcess/InjectedBundle/InjectedBundle.cpp:
127         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
128         * WebProcess/WebPage/WebPage.cpp:
129         (WebKit::WebPage::updatePreferences):
130
131 2016-11-04  Simon Fraser  <simon.fraser@apple.com>
132
133         Rename some ScrollingTree/Node-related functions to reduce the number of uses of "update"
134         https://bugs.webkit.org/show_bug.cgi?id=164420
135
136         Reviewed by Tim Horton.
137
138         Rename:
139             commitNewTreeState -> commitTreeState ("new" was redundant)
140             updateBeforeChildren -> commitStateBeforeChildren
141             updateAfterChildren -> commitStateAfterChildren
142
143
144         * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp:
145         (WebKit::RemoteScrollingCoordinatorProxy::commitScrollingTreeState):
146         (WebKit::RemoteScrollingCoordinatorProxy::updateScrollingTree): Deleted.
147         * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h:
148         * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.h:
149         * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:
150         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::commitStateBeforeChildren):
151         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::commitStateAfterChildren):
152         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::updateBeforeChildren): Deleted.
153         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::updateAfterChildren): Deleted.
154         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
155         (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
156
157 2016-11-04  Carlos Garcia Campos  <cgarcia@igalia.com>
158
159         NetworkSession: Add NetworkDataTask implementation for blobs
160         https://bugs.webkit.org/show_bug.cgi?id=163939
161
162         Reviewed by Alex Christensen.
163
164         Add NetworkDataTaskBlob to handle blobs when using NetworkSession instead of using ResourceHandle. This patch
165         adds more USE(NETWORK_SESSION) ifdefs to not use ResourceHandle in Downloads and NetworkLoad when NetworkSession
166         is enabled.
167
168         * CMakeLists.txt: Add new files to compilation.
169         * NetworkProcess/Downloads/BlobDownloadClient.cpp:
170         * NetworkProcess/Downloads/BlobDownloadClient.h:
171         * NetworkProcess/Downloads/Download.cpp:
172         (WebKit::Download::Download): Split the constructor again and remove the PlatformDownloadTaskRef
173         definitions. Now Cocoa specific constructor receives a NSURLSessionDownloadTask and the general constructor
174         reveices a NetworkDataTask and is used by Soup backend and blobs.
175         (WebKit::Download::~Download):
176         (WebKit::Download::start):
177         (WebKit::Download::startWithHandle):
178         (WebKit::Download::cancel):
179         (WebKit::Download::didReceiveAuthenticationChallenge):
180         (WebKit::Download::didReceiveData):
181         (WebKit::Download::didFinish):
182         (WebKit::Download::platformCancelNetworkLoad): Rename cancelNetworkLoad() as platformCancelNetworkLoad() since
183         this is now used only by Cocoa platform to cancel the NSURLSessionDownloadTask.
184         * NetworkProcess/Downloads/Download.h:
185         (WebKit::Download::Download):
186         (WebKit::Download::suggestedName):
187         (WebKit::Download::request):
188         * NetworkProcess/Downloads/DownloadManager.cpp:
189         (WebKit::DownloadManager::startDownload): Remove blobs specific code when using NetworkSession.
190         (WebKit::DownloadManager::continueDecidePendingDownloadDestination):
191         * NetworkProcess/Downloads/DownloadManager.h:
192         * NetworkProcess/Downloads/cocoa/DownloadCocoa.mm:
193         (WebKit::Download::platformCancelNetworkLoad):
194         * NetworkProcess/Downloads/soup/DownloadSoup.cpp: Removed.
195         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
196         (WebKit::NetworkConnectionToWebProcess::convertMainResourceLoadToDownload): Remove blobs specific code when
197         using NetworkSession.
198         * NetworkProcess/NetworkDataTask.cpp:
199         (WebKit::NetworkDataTask::create): If request is a blob, create a NetworkDataTaskBlob.
200         * NetworkProcess/NetworkDataTask.h: Add invalidateAndCancel pure virtual method.
201         * NetworkProcess/NetworkDataTaskBlob.cpp: Added.
202         (WebKit::NetworkDataTaskBlob::NetworkDataTaskBlob):
203         (WebKit::NetworkDataTaskBlob::~NetworkDataTaskBlob):
204         (WebKit::NetworkDataTaskBlob::clearStream):
205         (WebKit::NetworkDataTaskBlob::resume):
206         (WebKit::NetworkDataTaskBlob::suspend):
207         (WebKit::NetworkDataTaskBlob::cancel):
208         (WebKit::NetworkDataTaskBlob::invalidateAndCancel):
209         (WebKit::NetworkDataTaskBlob::getSizeForNext):
210         (WebKit::NetworkDataTaskBlob::didGetSize):
211         (WebKit::NetworkDataTaskBlob::seek):
212         (WebKit::NetworkDataTaskBlob::didReceiveResponse):
213         (WebKit::NetworkDataTaskBlob::read):
214         (WebKit::NetworkDataTaskBlob::readData):
215         (WebKit::NetworkDataTaskBlob::readFile):
216         (WebKit::NetworkDataTaskBlob::didOpen):
217         (WebKit::NetworkDataTaskBlob::didRead):
218         (WebKit::NetworkDataTaskBlob::consumeData):
219         (WebKit::NetworkDataTaskBlob::setPendingDownloadLocation):
220         (WebKit::NetworkDataTaskBlob::suggestedFilename):
221         (WebKit::NetworkDataTaskBlob::download):
222         (WebKit::NetworkDataTaskBlob::writeDownload):
223         (WebKit::NetworkDataTaskBlob::cleanDownloadFiles):
224         (WebKit::NetworkDataTaskBlob::didFailDownload):
225         (WebKit::NetworkDataTaskBlob::didFinishDownload):
226         (WebKit::NetworkDataTaskBlob::didFail):
227         (WebKit::NetworkDataTaskBlob::didFinish):
228         * NetworkProcess/NetworkDataTaskBlob.h: Added.
229         * NetworkProcess/NetworkLoad.cpp:
230         (WebKit::NetworkLoad::NetworkLoad): Remove blobs specific code when using NetworkSession.
231         (WebKit::NetworkLoad::~NetworkLoad):
232         (WebKit::NetworkLoad::setDefersLoading):
233         (WebKit::NetworkLoad::cancel):
234         (WebKit::NetworkLoad::continueWillSendRequest):
235         (WebKit::NetworkLoad::continueDidReceiveResponse):
236         (WebKit::NetworkLoad::continueCanAuthenticateAgainstProtectionSpace):
237         (WebKit::NetworkLoad::canAuthenticateAgainstProtectionSpaceAsync):
238         * NetworkProcess/NetworkLoad.h:
239         * NetworkProcess/NetworkSession.cpp:
240         (WebKit::NetworkSession::invalidateAndCancel): Moved from NetworkSessionSoup, since this is now used also by blobs.
241         * NetworkProcess/NetworkSession.h:
242         (WebKit::NetworkSession::registerNetworkDataTask): Ditto.
243         (WebKit::NetworkSession::unregisterNetworkDataTask): Ditto.
244         * NetworkProcess/cocoa/NetworkDataTaskCocoa.h: Add invalidateAndCancel() implementation that does nothing
245         because in Cocoa all tasks are invalidated and canceled by the network session.
246         * NetworkProcess/mac/NetworkLoadMac.mm:
247         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
248         (WebKit::NetworkDataTaskSoup::NetworkDataTaskSoup):
249         (WebKit::NetworkDataTaskSoup::~NetworkDataTaskSoup):
250         (WebKit::NetworkDataTaskSoup::download):
251         * NetworkProcess/soup/NetworkDataTaskSoup.h:
252         * NetworkProcess/soup/NetworkSessionSoup.cpp:
253         * NetworkProcess/soup/NetworkSessionSoup.h:
254         * PlatformEfl.cmake: Remove DownloadSoup.cpp from compilation.
255         * PlatformGTK.cmake: Ditto.
256         * WebKit2.xcodeproj/project.pbxproj: Add new files to compilation.
257
258 2016-11-03  Simon Fraser  <simon.fraser@apple.com>
259
260         Give all the geometry classes a single-argument scale() function for consistency
261         https://bugs.webkit.org/show_bug.cgi?id=164400
262
263         Reviewed by Zalan Bujtas.
264         
265         Use single-argument scale() functions.
266
267         * PluginProcess/PluginControllerProxy.cpp:
268         (WebKit::PluginControllerProxy::paint):
269         * Shared/mac/RemoteLayerBackingStore.mm:
270         (WebKit::RemoteLayerBackingStore::drawInContext):
271         * UIProcess/API/Cocoa/WKWebView.mm:
272         (-[WKWebView _didCommitLayerTree:]):
273         (-[WKWebView _takeViewSnapshot]):
274         (-[WKWebView _scrollToContentScrollPosition:scrollOrigin:]):
275         (-[WKWebView _scrollByContentOffset:]):
276         (-[WKWebView _zoomToFocusRect:selectionRect:fontSize:minimumScale:maximumScale:allowScaling:forceScroll:]):
277         * UIProcess/ios/WKContentView.mm:
278         (-[WKContentView _didCommitLayerTree:]):
279         * UIProcess/ios/WKContentViewInteraction.mm:
280         (-[WKContentView _updateTapHighlight]):
281         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
282         (WebKit::RemoteLayerTreeDrawingAreaProxy::indicatorLocation):
283         (WebKit::RemoteLayerTreeDrawingAreaProxy::updateDebugIndicator):
284         * UIProcess/mac/ViewGestureControllerMac.mm:
285         (WebKit::ViewGestureController::scaledMagnificationOrigin):
286         * WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp:
287         (WebKit::InjectedBundleRangeHandle::renderedImage):
288         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
289         (WebKit::NetscapePlugin::snapshot):
290         * WebProcess/Plugins/PDF/PDFPlugin.mm:
291         (WebKit::PDFPlugin::scrollToPoint):
292         * WebProcess/WebPage/WebFrame.cpp:
293         (WebKit::WebFrame::createSelectionSnapshot):
294         * WebProcess/WebPage/WebPage.cpp:
295         (WebKit::WebPage::scalePageInViewCoordinates):
296         (WebKit::WebPage::scaleView):
297         (WebKit::WebPage::snapshotAtSize):
298         (WebKit::WebPage::snapshotNode):
299         (WebKit::WebPage::drawRectToImage):
300         * WebProcess/WebPage/ios/WebPageIOS.mm:
301         (WebKit::WebPage::restorePageState):
302
303 2016-11-03  Chris Dumez  <cdumez@apple.com>
304
305         [WK2][Cocoa] Implement user interface for HTML form validation
306         https://bugs.webkit.org/show_bug.cgi?id=164143
307         <rdar://problem/28944652>
308
309         Reviewed by Simon Fraser.
310
311         Implement the ValidationMessageClient in WebKit2 and have it display
312         a ValidationBubble on Cocoa. ValidationBubble is implemented using
313         native popovers on both Mac and iOS. As a result, Mac and iOS WK2
314         now use native popover for HTML form validation instead of the old
315         Shadow DOM based UI in WebCore.
316
317         The native popover shows at the bottom (or top) of the input and it
318         disapears as soon as the user starts typing or interacts with the
319         view (e.g. tap / scroll / zoom).
320
321         The feature is still disabled at runtime.
322
323         * UIProcess/API/Cocoa/WKWebView.mm:
324         (-[WKWebView _initializeWithConfiguration:]):
325         (-[WKWebView _keyboardWillShow:]):
326         (-[WKWebView _keyboardDidShow:]):
327         (-[WKWebView _contentsOfUserInterfaceItem:]):
328         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
329         * UIProcess/Cocoa/WebPageProxyCocoa.mm:
330         * UIProcess/PageClient.h:
331         * UIProcess/WebPageProxy.cpp:
332         (WebKit::WebPageProxy::handleWheelEvent):
333         (WebKit::WebPageProxy::setPageZoomFactor):
334         (WebKit::WebPageProxy::setPageAndTextZoomFactors):
335         (WebKit::WebPageProxy::pageDidScroll):
336         (WebKit::WebPageProxy::resetState):
337         (WebKit::WebPageProxy::hideValidationMessage):
338         * UIProcess/WebPageProxy.h:
339         (WebKit::WebPageProxy::validationBubble):
340         (WebKit::WebPageProxy::setIsKeyboardAnimatingIn):
341         * UIProcess/WebPageProxy.messages.in:
342         * UIProcess/ios/PageClientImplIOS.h:
343         * UIProcess/ios/PageClientImplIOS.mm:
344         (WebKit::PageClientImpl::createValidationBubble):
345         * UIProcess/ios/WKContentViewInteraction.mm:
346         (-[WKContentView _willStartScrollingOrZooming]):
347         (-[WKContentView scrollViewWillStartPanOrPinchGesture]):
348         (-[WKContentView _didEndScrollingOrZooming]):
349         * UIProcess/ios/WebPageProxyIOS.mm:
350         (WebKit::WebPageProxy::dynamicViewportSizeUpdate):
351         (WebKit::WebPageProxy::potentialTapAtPosition):
352         (WebKit::WebPageProxy::showValidationMessage):
353         (WebKit::WebPageProxy::setIsScrollingOrZooming):
354         * UIProcess/mac/PageClientImpl.h:
355         * UIProcess/mac/PageClientImpl.mm:
356         (WebKit::PageClientImpl::createValidationBubble):
357         * UIProcess/mac/WebPageProxyMac.mm:
358         (WebKit::WebPageProxy::showValidationMessage):
359         * WebKit2.xcodeproj/project.pbxproj:
360         * WebProcess/WebCoreSupport/WebValidationMessageClient.cpp: Copied from Tools/DumpRenderTree/mac/UIScriptControllerMac.mm.
361         (WebKit::WebValidationMessageClient::WebValidationMessageClient):
362         (WebKit::WebValidationMessageClient::~WebValidationMessageClient):
363         (WebKit::WebValidationMessageClient::showValidationMessage):
364         (WebKit::WebValidationMessageClient::hideValidationMessage):
365         (WebKit::WebValidationMessageClient::isValidationMessageVisible):
366         * WebProcess/WebCoreSupport/WebValidationMessageClient.h: Copied from Tools/DumpRenderTree/mac/UIScriptControllerMac.mm.
367         * WebProcess/WebPage/WebPage.cpp:
368         (WebKit::m_userInterfaceLayoutDirection):
369
370 2016-11-03  Tim Horton  <timothy_horton@apple.com>
371
372         Printing to PDF should produce internal links when HTML has internal links
373         https://bugs.webkit.org/show_bug.cgi?id=112081
374         <rdar://problem/5955705>
375
376         Reviewed by Simon Fraser.
377
378         * UIProcess/mac/WKPrintingView.h:
379         * UIProcess/mac/WKPrintingView.mm:
380         (linkDestinationName):
381         (-[WKPrintingView _drawPDFDocument:page:atPoint:]):
382         Propagate link-to-destination annotations (and each page's destinations)
383         into the printed PDF.
384         Generate a unique destination name based on the page and position, because
385         we have lost the fragment name information.
386
387         (-[WKPrintingView drawRect:]):
388         Compute all of the destinations for every page, so that we can add them
389         to the context as we paint the pages (we need the page CTM in order to add them).
390
391 2016-11-03  Alex Christensen  <achristensen@webkit.org>
392
393         Unreviewed, rolling out r208298.
394         https://bugs.webkit.org/show_bug.cgi?id=163939
395
396         caused asan crashes
397
398         Reverted changeset:
399
400         "NetworkSession: Add NetworkDataTask implementation for blobs"
401         https://bugs.webkit.org/show_bug.cgi?id=163939
402         http://trac.webkit.org/changeset/208298
403
404 2016-11-03  Ryan Haddad  <ryanhaddad@apple.com>
405
406         Unreviewed, rolling out r208330.
407
408         This change appears to have caused two editing tests to fail
409         on macOS.
410
411         Reverted changeset:
412
413         "Reduce PassRefPtr use in WebKit2"
414         https://bugs.webkit.org/show_bug.cgi?id=164360
415         http://trac.webkit.org/changeset/208330
416
417 2016-11-03  Dan Bernstein  <mitz@apple.com>
418
419         WKWebView’s _observedRenderingProgressEvents not restored after web process crash
420         https://bugs.webkit.org/show_bug.cgi?id=164368
421         <rdar://problem/29091954>
422
423         Reviewed by Anders Carlsson.
424
425         Test: TestWebKitAPI/Tests/WebKit2Cocoa/ObservedRenderingProgressEventsAfterCrash.mm.
426
427         * Shared/WebPageCreationParameters.cpp:
428         (WebKit::WebPageCreationParameters::encode): Encode new observedLayoutMilestones member.
429         (WebKit::WebPageCreationParameters::decode): Decode it.
430         * Shared/WebPageCreationParameters.h: Declared new observedLayoutMilestones member variable.
431
432         * UIProcess/WebPageProxy.cpp:
433         (WebKit::WebPageProxy::WebPageProxy): Removed initializer for
434           m_wantsSessionRestorationRenderTreeSizeThresholdEvent.
435         (WebKit::WebPageProxy::listenForLayoutMilestones): Update new m_observedLayoutMilestones
436           member variable. Don’t update m_wantsSessionRestorationRenderTreeSizeThresholdEvent.
437         (WebKit::WebPageProxy::creationParameters): Set the observedLayoutMilestones member in the
438           creation parameters.
439
440         * UIProcess/WebPageProxy.h: Declared new member variable, deleted
441           m_wantsSessionRestorationRenderTreeSizeThresholdEvent declaration.
442
443         * UIProcess/ios/WebPageProxyIOS.mm:
444         (WebKit::WebPageProxy::didCommitLayerTree): Rather than using
445           m_wantsSessionRestorationRenderTreeSizeThresholdEvent, use m_observedLayoutMilestones.
446
447         * WebProcess/WebPage/WebPage.cpp:
448         (WebKit::WebPage::WebPage): Add the observed layout milestones from the creation parameters.
449
450 2016-11-02  Alex Christensen  <achristensen@webkit.org>
451
452         Reduce PassRefPtr use in WebKit2
453         https://bugs.webkit.org/show_bug.cgi?id=164360
454
455         Reviewed by Tim Horton.
456
457         * Shared/API/APISecurityOrigin.h:
458         (API::SecurityOrigin::SecurityOrigin):
459         * Shared/API/APISerializedScriptValue.h:
460         (API::SerializedScriptValue::create):
461         (API::SerializedScriptValue::SerializedScriptValue):
462         * Shared/API/c/WKSharedAPICast.h:
463         (WebKit::ProxyingRefPtr::ProxyingRefPtr):
464         (WebKit::toAPI):
465         * Shared/APIWebArchive.h:
466         * Shared/APIWebArchive.mm:
467         (API::WebArchive::create):
468         (API::WebArchive::WebArchive):
469         * UIProcess/API/APIHitTestResult.cpp:
470         (API::HitTestResult::create):
471         * UIProcess/API/APIHitTestResult.h:
472         * UIProcess/API/APIUIClient.h:
473         (API::UIClient::createNewPage):
474         * UIProcess/API/C/WKPage.cpp:
475         (WebKit::RunBeforeUnloadConfirmPanelResultListener::create):
476         (WebKit::RunBeforeUnloadConfirmPanelResultListener::RunBeforeUnloadConfirmPanelResultListener):
477         (WebKit::RunJavaScriptAlertResultListener::create):
478         (WebKit::RunJavaScriptAlertResultListener::RunJavaScriptAlertResultListener):
479         (WebKit::RunJavaScriptConfirmResultListener::create):
480         (WebKit::RunJavaScriptConfirmResultListener::RunJavaScriptConfirmResultListener):
481         (WebKit::RunJavaScriptPromptResultListener::create):
482         (WebKit::RunJavaScriptPromptResultListener::RunJavaScriptPromptResultListener):
483         (WKPageSetPageUIClient):
484         * UIProcess/API/Cocoa/WKWebView.mm:
485         (-[WKWebView _takeViewSnapshot]):
486         * UIProcess/API/Cocoa/WKWebViewInternal.h:
487         * UIProcess/Cocoa/UIDelegate.h:
488         * UIProcess/Cocoa/UIDelegate.mm:
489         (WebKit::UIDelegate::UIClient::createNewPage):
490         * UIProcess/ios/WKGeolocationProviderIOS.mm:
491         (-[WKWebAllowDenyPolicyListener initWithPermissionRequestProxy:]):
492         * UIProcess/mac/WKImmediateActionController.mm:
493         (-[WKImmediateActionController _webHitTestResult]):
494         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
495         (contextMenuItems):
496         (WKBundlePageCopyContextMenuItems):
497         (WKBundlePageCopyContextMenuAtPointInWindow):
498         * WebProcess/UserContent/WebUserContentController.cpp:
499         (WebKit::WebUserMessageHandlerDescriptorProxy::create):
500         * WebProcess/WebPage/WebUndoStep.cpp:
501         (WebKit::WebUndoStep::create):
502         * WebProcess/WebPage/WebUndoStep.h:
503         (WebKit::WebUndoStep::WebUndoStep):
504
505 2016-11-01  Gavin Barraclough  <barraclough@apple.com>
506
507         Remove PageThrottler & all related code
508         https://bugs.webkit.org/show_bug.cgi?id=164302
509
510         Reviewed by Ryosuke Niwa.
511
512         All relevant information now available from the ActivityState.
513
514         * PluginProcess/PluginProcess.cpp:
515         (WebKit::PluginProcess::PluginProcess):
516         (WebKit::PluginProcess::createWebProcessConnection):
517         (WebKit::PluginProcess::audioHardwareDidBecomeActive): Deleted.
518         (WebKit::PluginProcess::audioHardwareDidBecomeInactive): Deleted.
519         * PluginProcess/PluginProcess.h:
520         (): Deleted.
521         * PluginProcess/WebProcessConnection.cpp:
522         (WebKit::WebProcessConnection::audioHardwareDidBecomeActive): Deleted.
523         (WebKit::WebProcessConnection::audioHardwareDidBecomeInactive): Deleted.
524         * PluginProcess/WebProcessConnection.h:
525         * WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp:
526         (WebKit::NPRuntimeObjectMap::evaluate):
527         * WebProcess/Plugins/Plugin.h:
528         (WebKit::Plugin::audioHardwareActivity): Deleted.
529         * WebProcess/Plugins/PluginProcessConnection.cpp:
530         (WebKit::PluginProcessConnection::PluginProcessConnection):
531         (WebKit::PluginProcessConnection::didReceiveMessage):
532         (WebKit::PluginProcessConnection::audioHardwareDidBecomeActive): Deleted.
533         (WebKit::PluginProcessConnection::audioHardwareDidBecomeInactive): Deleted.
534         * WebProcess/Plugins/PluginProcessConnection.h:
535         (WebKit::PluginProcessConnection::supportsAsynchronousPluginInitialization):
536         (WebKit::PluginProcessConnection::audioHardwareActivity): Deleted.
537         * WebProcess/Plugins/PluginProcessConnection.messages.in:
538         * WebProcess/Plugins/PluginProxy.cpp:
539         (WebKit::PluginProxy::audioHardwareActivity): Deleted.
540         * WebProcess/Plugins/PluginProxy.h:
541         * WebProcess/Plugins/PluginView.cpp:
542         (WebKit::PluginView::audioHardwareActivity): Deleted.
543         * WebProcess/Plugins/PluginView.h:
544         * WebProcess/WebPage/WebPage.cpp:
545
546 2016-11-03  Dan Bernstein  <mitz@apple.com>
547
548         REGRESSION (r206247): Painting milestones can be delayed until the next layer flush
549         https://bugs.webkit.org/show_bug.cgi?id=164340
550         <rdar://problem/29074344>
551
552         Reviewed by Tim Horton.
553
554         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h: Declared new helper function.
555         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
556         (WebKit::TiledCoreAnimationDrawingArea::sendPendingNewlyReachedLayoutMilestones): Helper
557           function that sends the message to the UI process and resets
558           m_pendingNewlyReachedLayoutMilestones.
559         (WebKit::TiledCoreAnimationDrawingArea::flushLayers): Wait until after the commit to get the
560           pending milestones and send them to the UI process. This way we don’t miss milestones that
561           fire during the commit.
562
563 2016-11-02  David Kilzer  <ddkilzer@apple.com>
564
565         Bug 164333: Add logging for "WebKit encountered an internal error" messages due to Network process crashes
566         <https://webkit.org/b/164333>
567         <rdar://problem/29072727>
568
569         Reviewed by Alex Christensen.
570
571         * WebProcess/WebProcess.cpp:
572         (WebKit::WebProcess::logDiagnosticMessageForNetworkProcessCrash):
573         Add private method to log diagnostic message.
574         (WebKit::WebProcess::networkProcessConnectionClosed):
575         Call logDiagnosticMessageForNetworkProcessCrash().
576         * WebProcess/WebProcess.h:
577         (WebKit::WebProcess::logDiagnosticMessageForNetworkProcessCrash):
578         Declare new method.
579
580 2016-11-02  Alex Christensen  <achristensen@webkit.org>
581
582         Remove Battery Status API from the tree
583         https://bugs.webkit.org/show_bug.cgi?id=164213
584
585         Reviewed by Sam Weinig.
586
587         * CMakeLists.txt:
588         * PlatformEfl.cmake:
589         * Shared/API/APIObject.h:
590         * Shared/API/c/WKBase.h:
591         * Shared/WebBatteryStatus.cpp: Removed.
592         * Shared/WebBatteryStatus.h: Removed.
593         * UIProcess/API/C/WKAPICast.h:
594         * UIProcess/API/C/WKBatteryManager.cpp: Removed.
595         * UIProcess/API/C/WKBatteryManager.h: Removed.
596         * UIProcess/API/C/WKBatteryStatus.cpp: Removed.
597         * UIProcess/API/C/WKBatteryStatus.h: Removed.
598         * UIProcess/API/C/WKContext.cpp:
599         (WKContextGetBatteryManager): Deleted.
600         * UIProcess/API/C/WKContext.h:
601         * UIProcess/API/efl/ewk_context.cpp:
602         (EwkContext::EwkContext):
603         * UIProcess/API/efl/ewk_context_private.h:
604         * UIProcess/API/efl/ewk_main.cpp:
605         (WebKit::EwkMain::initialize):
606         (WebKit::EwkMain::finalize):
607         (WebKit::EwkMain::shutdownInitializedEFLModules):
608         * UIProcess/API/gtk/WebKitBatteryProvider.cpp: Removed.
609         * UIProcess/API/gtk/WebKitBatteryProvider.h: Removed.
610         * UIProcess/API/gtk/WebKitWebContext.cpp:
611         (webkitWebContextConstructed):
612         * UIProcess/WebBatteryManagerProxy.cpp: Removed.
613         * UIProcess/WebBatteryManagerProxy.h: Removed.
614         * UIProcess/WebBatteryManagerProxy.messages.in: Removed.
615         * UIProcess/WebBatteryProvider.cpp: Removed.
616         * UIProcess/WebBatteryProvider.h: Removed.
617         * UIProcess/WebProcessPool.cpp:
618         (WebKit::m_hiddenPageThrottlingTimer):
619         * UIProcess/efl/BatteryProvider.cpp: Removed.
620         * UIProcess/efl/BatteryProvider.h: Removed.
621         * WebProcess/Battery: Removed.
622         * WebProcess/Battery/WebBatteryManager.cpp: Removed.
623         * WebProcess/Battery/WebBatteryManager.h: Removed.
624         * WebProcess/Battery/WebBatteryManager.messages.in: Removed.
625         * WebProcess/WebCoreSupport/WebBatteryClient.cpp: Removed.
626         * WebProcess/WebCoreSupport/WebBatteryClient.h: Removed.
627         * WebProcess/WebPage/WebPage.cpp:
628         (WebKit::m_userInterfaceLayoutDirection):
629         * WebProcess/WebProcess.cpp:
630         (WebKit::m_resourceLoadStatisticsStorage):
631
632 2016-11-02  Carlos Garcia Campos  <cgarcia@igalia.com>
633
634         NetworkSession: Add NetworkDataTask implementation for blobs
635         https://bugs.webkit.org/show_bug.cgi?id=163939
636
637         Reviewed by Alex Christensen.
638
639         Add NetworkDataTaskBlob to handle blobs when using NetworkSession instead of using ResourceHandle. This patch
640         adds more USE(NETWORK_SESSION) ifdefs to not use ResourceHandle in Downloads and NetworkLoad when NetworkSession
641         is enabled.
642
643         * CMakeLists.txt: Add new files to compilation.
644         * NetworkProcess/Downloads/BlobDownloadClient.cpp:
645         * NetworkProcess/Downloads/BlobDownloadClient.h:
646         * NetworkProcess/Downloads/Download.cpp:
647         (WebKit::Download::Download): Split the constructor again and remove the PlatformDownloadTaskRef
648         definitions. Now Cocoa specific constructor receives a NSURLSessionDownloadTask and the general constructor
649         reveices a NetworkDataTask and is used by Soup backend and blobs.
650         (WebKit::Download::~Download):
651         (WebKit::Download::start):
652         (WebKit::Download::startWithHandle):
653         (WebKit::Download::cancel):
654         (WebKit::Download::didReceiveAuthenticationChallenge):
655         (WebKit::Download::didReceiveData):
656         (WebKit::Download::didFinish):
657         (WebKit::Download::platformCancelNetworkLoad): Rename cancelNetworkLoad() as platformCancelNetworkLoad() since
658         this is now used only by Cocoa platform to cancel the NSURLSessionDownloadTask.
659         * NetworkProcess/Downloads/Download.h:
660         (WebKit::Download::Download):
661         (WebKit::Download::suggestedName):
662         (WebKit::Download::request):
663         * NetworkProcess/Downloads/DownloadManager.cpp:
664         (WebKit::DownloadManager::startDownload): Remove blobs specific code when using NetworkSession.
665         (WebKit::DownloadManager::continueDecidePendingDownloadDestination):
666         * NetworkProcess/Downloads/DownloadManager.h:
667         * NetworkProcess/Downloads/cocoa/DownloadCocoa.mm:
668         (WebKit::Download::platformCancelNetworkLoad):
669         * NetworkProcess/Downloads/soup/DownloadSoup.cpp: Removed.
670         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
671         (WebKit::NetworkConnectionToWebProcess::convertMainResourceLoadToDownload): Remove blobs specific code when
672         using NetworkSession.
673         * NetworkProcess/NetworkDataTask.cpp:
674         (WebKit::NetworkDataTask::create): If request is a blob, create a NetworkDataTaskBlob.
675         * NetworkProcess/NetworkDataTask.h: Add invalidateAndCancel pure virtual method.
676         * NetworkProcess/NetworkDataTaskBlob.cpp: Added.
677         (WebKit::NetworkDataTaskBlob::NetworkDataTaskBlob):
678         (WebKit::NetworkDataTaskBlob::~NetworkDataTaskBlob):
679         (WebKit::NetworkDataTaskBlob::clearStream):
680         (WebKit::NetworkDataTaskBlob::resume):
681         (WebKit::NetworkDataTaskBlob::suspend):
682         (WebKit::NetworkDataTaskBlob::cancel):
683         (WebKit::NetworkDataTaskBlob::invalidateAndCancel):
684         (WebKit::NetworkDataTaskBlob::getSizeForNext):
685         (WebKit::NetworkDataTaskBlob::didGetSize):
686         (WebKit::NetworkDataTaskBlob::seek):
687         (WebKit::NetworkDataTaskBlob::didReceiveResponse):
688         (WebKit::NetworkDataTaskBlob::read):
689         (WebKit::NetworkDataTaskBlob::readData):
690         (WebKit::NetworkDataTaskBlob::readFile):
691         (WebKit::NetworkDataTaskBlob::didOpen):
692         (WebKit::NetworkDataTaskBlob::didRead):
693         (WebKit::NetworkDataTaskBlob::consumeData):
694         (WebKit::NetworkDataTaskBlob::setPendingDownloadLocation):
695         (WebKit::NetworkDataTaskBlob::suggestedFilename):
696         (WebKit::NetworkDataTaskBlob::download):
697         (WebKit::NetworkDataTaskBlob::writeDownload):
698         (WebKit::NetworkDataTaskBlob::cleanDownloadFiles):
699         (WebKit::NetworkDataTaskBlob::didFailDownload):
700         (WebKit::NetworkDataTaskBlob::didFinishDownload):
701         (WebKit::NetworkDataTaskBlob::didFail):
702         (WebKit::NetworkDataTaskBlob::didFinish):
703         * NetworkProcess/NetworkDataTaskBlob.h: Added.
704         * NetworkProcess/NetworkLoad.cpp:
705         (WebKit::NetworkLoad::NetworkLoad): Remove blobs specific code when using NetworkSession.
706         (WebKit::NetworkLoad::~NetworkLoad):
707         (WebKit::NetworkLoad::setDefersLoading):
708         (WebKit::NetworkLoad::cancel):
709         (WebKit::NetworkLoad::continueWillSendRequest):
710         (WebKit::NetworkLoad::continueDidReceiveResponse):
711         (WebKit::NetworkLoad::continueCanAuthenticateAgainstProtectionSpace):
712         (WebKit::NetworkLoad::canAuthenticateAgainstProtectionSpaceAsync):
713         * NetworkProcess/NetworkLoad.h:
714         * NetworkProcess/NetworkSession.cpp:
715         (WebKit::NetworkSession::invalidateAndCancel): Moved from NetworkSessionSoup, since this is now used also by blobs.
716         * NetworkProcess/NetworkSession.h:
717         (WebKit::NetworkSession::registerNetworkDataTask): Ditto.
718         (WebKit::NetworkSession::unregisterNetworkDataTask): Ditto.
719         * NetworkProcess/cocoa/NetworkDataTaskCocoa.h: Add invalidateAndCancel() implementation that does nothing
720         because in Cocoa all tasks are invalidated and canceled by the network session.
721         * NetworkProcess/mac/NetworkLoadMac.mm:
722         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
723         (WebKit::NetworkDataTaskSoup::NetworkDataTaskSoup):
724         (WebKit::NetworkDataTaskSoup::~NetworkDataTaskSoup):
725         (WebKit::NetworkDataTaskSoup::download):
726         * NetworkProcess/soup/NetworkDataTaskSoup.h:
727         * NetworkProcess/soup/NetworkSessionSoup.cpp:
728         * NetworkProcess/soup/NetworkSessionSoup.h:
729         * PlatformEfl.cmake: Remove DownloadSoup.cpp from compilation.
730         * PlatformGTK.cmake: Ditto.
731         * WebKit2.xcodeproj/project.pbxproj: Add new files to compilation.
732
733 2016-11-02  Andy Estes  <aestes@apple.com>
734
735         REGRESSION (r199558): File paths selected for upload are stored using the wrong string encoding
736         https://bugs.webkit.org/show_bug.cgi?id=164311
737         <rdar://problem/26995374>
738
739         Reviewed by Tim Horton.
740
741         -[NSURL fileSystemRepresentation] returns a char* in file system representation, which on
742         iOS is UTF-8, but we were implicitly converting it to a String, which assumes a char* is
743         Latin-1 encoded.
744
745         * UIProcess/ios/forms/WKFileUploadPanel.mm:
746         (-[WKFileUploadPanel _chooseFiles:displayString:iconImage:]): Changed to use fromUTF8() to
747         convert fileURL.fileSystemRepresentation to a String.
748
749 2016-11-02  Carlos Garcia Campos  <cgarcia@igalia.com>
750
751         NetworkSession: Network process crash when converting main resource to download
752         https://bugs.webkit.org/show_bug.cgi?id=164220
753
754         Reviewed by Alex Christensen.
755
756         Right after the main resource load is converted to a download, the web process deletes the ResourceLoader which
757         sends the RemoveLoadIdentifier to the network process and the load is aborted. Sometimes it happens that
758         NetworkResourceLoader::abort() is called while the NetworkLoad is still deciding the destination of the
759         download. In such case, NetworkResourceLoader::didConvertToDownload() has already been called, but not
760         NetworkResourceLoader::didBecomeDownload(). In NetworkResourceLoader::abort() we already handle the case of
761         having a NetworkLoad after NetworkResourceLoader::didConvertToDownload() has been called, to avoid canceling the
762         load in such case, however cleanup() is always called unconditionally and the NetworkLoad is deleted before
763         NetworkResourceLoader::didBecomeDownload() is called. When the NetworkLoad is destroyed the NetworkDataTask
764         client becomes nullptr, leaving it in a state where both the client is nullptr and the download hasn't been
765         created yet. That's not expected to happen and when the response completion handler is called in the
766         NetworkDataTask it tries to use either the client or the download and it crashes.
767
768         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
769         (WebKit::NetworkConnectionToWebProcess::removeLoadIdentifier): Update ASSERT, because abort doesn't cleanup the
770         resource loader in case it's becoming a download.
771         * NetworkProcess/NetworkResourceLoader.cpp:
772         (WebKit::NetworkResourceLoader::didBecomeDownload): Call cleanup() instead of just deleting the network load.
773         (WebKit::NetworkResourceLoader::isBecomingDownload): Helper method to check if the resource load was converted to a
774         download, but didBecomeDownload() hasn't been called yet.
775         (WebKit::NetworkResourceLoader::abort): If the resource load is becoming a download do not call cleanup()
776         because it will be called by didBecomeDownload() later.
777         * NetworkProcess/NetworkResourceLoader.h:
778
779 2016-11-02  David Kilzer  <ddkilzer@apple.com>
780
781         Add logging for "WebKit encountered an internal error" messages
782         <https://webkit.org/b/164272>
783         <rdar://problem/28546064>
784
785         Reviewed by Alex Christensen.
786
787         * NetworkProcess/NetworkResourceLoader.cpp:
788         (WebKit::NetworkResourceLoader::startNetworkLoad):
789         * WebProcess/Network/WebLoaderStrategy.cpp:
790         (WebKit::WebLoaderStrategy::loadResourceSynchronously):
791         * WebProcess/Network/WebResourceLoader.cpp:
792         (WebKit::WebResourceLoader::didReceiveResource):
793         - Add logging for various internalError() events.
794
795 2016-11-02  Carlos Garcia Campos  <cgarcia@igalia.com>
796
797         [GTK] BadDamage X Window System error in WebKit::AcceleratedBackingStoreX11::update when called from WebPageProxy::exitAcceleratedCompositingMode
798         https://bugs.webkit.org/show_bug.cgi?id=164303
799
800         Reviewed by Michael Catanzaro.
801
802         This can happen if the web process exits before the UI process has cleaned up the accelerated surface. Trap
803         BadDrawable and BadDamage X errors and ignore them, while still crashing for any other X error.
804
805         * UIProcess/gtk/AcceleratedBackingStoreX11.cpp:
806         (WebKit::AcceleratedBackingStoreX11::~AcceleratedBackingStoreX11):
807         (WebKit::AcceleratedBackingStoreX11::update):
808
809 2016-11-02  Carlos Garcia Campos  <cgarcia@igalia.com>
810
811         [GTK] Remove FileSystem::filenameToString() and use FileSystem::stringFromFileSystemRepresentation() everywhere instead
812         https://bugs.webkit.org/show_bug.cgi?id=164315
813
814         Reviewed by Michael Catanzaro.
815
816         * Shared/gtk/ProcessExecutablePathGtk.cpp:
817         (WebKit::getExecutablePath):
818         (WebKit::findWebKitProcess):
819         * UIProcess/API/gtk/APIWebsiteDataStoreGtk.cpp:
820         (API::WebsiteDataStore::defaultNetworkCacheDirectory):
821         (API::WebsiteDataStore::cacheDirectoryFileSystemRepresentation):
822         (API::WebsiteDataStore::websiteDataDirectoryFileSystemRepresentation):
823         * UIProcess/API/gtk/WebKitWebContext.cpp:
824         (webkitWebContextConstructed):
825         (webkit_web_context_set_favicon_database_directory):
826         (webkit_web_context_set_additional_plugins_directory):
827         (webkit_web_context_set_disk_cache_directory):
828         * UIProcess/API/gtk/WebKitWebsiteDataManager.cpp:
829         (webkitWebsiteDataManagerGetDataStore):
830         * UIProcess/Plugins/gtk/PluginInfoCache.cpp:
831         (WebKit::PluginInfoCache::PluginInfoCache):
832         * UIProcess/gtk/WebProcessPoolGtk.cpp:
833         (WebKit::WebProcessPool::platformDefaultIconDatabasePath):
834         * WebProcess/gtk/WebGtkExtensionManager.cpp:
835         (WebKit::parseUserData):
836
837 2016-11-02  Romain Bellessort  <romain.bellessort@crf.canon.fr>
838
839         [Readable Streams API] Enable creation of ReadableByteStreamController
840         https://bugs.webkit.org/show_bug.cgi?id=164014
841
842         Reviewed by Youenn Fablet.
843
844         Added flag for the byte stream part of Readable Streams API.
845
846         * Configurations/FeatureDefines.xcconfig:
847
848 2016-11-02  Carlos Garcia Campos  <cgarcia@igalia.com>
849
850         PluginInfoStore::loadPluginsIfNecessary can still load plugins multiple times
851         https://bugs.webkit.org/show_bug.cgi?id=164103
852
853         Reviewed by Michael Catanzaro.
854
855         Follow symlinks when scanning plugins to avoid duplicates.
856
857         * UIProcess/Plugins/gtk/PluginInfoCache.cpp: Bump the cache version to ensure duplicated plugins are removed
858         from the cache.
859         * UIProcess/Plugins/unix/PluginInfoStoreUnix.cpp:
860         (WebKit::PluginInfoStore::pluginPathsInDirectory): Use realpath() to always return the actual file path.
861
862 2016-11-02  Carlos Garcia Campos  <cgarcia@igalia.com>
863
864         [GTK] Plugin process crash in WebKit::NetscapePluginX11::visibilityDidChange with evince browser plugin
865         https://bugs.webkit.org/show_bug.cgi?id=164204
866
867         Reviewed by Michael Catanzaro.
868
869         Check the platform plugin widget is embedded before trying to get its socket window.
870
871         * WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp:
872         (WebKit::NetscapePluginX11::geometryDidChange):
873         (WebKit::NetscapePluginX11::visibilityDidChange):
874
875 2016-11-01  Wenson Hsieh  <wenson_hsieh@apple.com>
876
877         Turn the Input Events runtime flag on by default
878         https://bugs.webkit.org/show_bug.cgi?id=164297
879
880         Reviewed by Ryosuke Niwa.
881
882         * Shared/WebPreferencesDefinitions.h:
883
884 2016-11-01  Jaehun Lim  <ljaehun.lim@samsung.com>
885
886         Unreviewed, EFL build fix after r208225
887
888         Rename ViewState to ActivityState
889
890         * UIProcess/efl/WebView.cpp:
891         (WebKit::WebView::setActive):
892         (WebKit::WebView::setFocused):
893         (WebKit::WebView::setVisible):
894
895 2016-11-01  Alex Christensen  <achristensen@webkit.org>
896
897         Fix CMake build.
898
899         * PlatformMac.cmake:
900
901 2016-11-01  Ryosuke Niwa  <rniwa@webkit.org>
902
903         Remove CUSTOM_ELEMENTS build flag
904         https://bugs.webkit.org/show_bug.cgi?id=164267
905
906         Reviewed by Antti Koivisto.
907
908         Removed the build flag.
909
910         * Configurations/FeatureDefines.xcconfig:
911         * WebProcess/InjectedBundle/InjectedBundle.cpp:
912         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
913         * WebProcess/WebPage/WebPage.cpp:
914         (WebKit::WebPage::updatePreferences):
915
916 2016-11-01  Eric Carlson  <eric.carlson@apple.com>
917
918         [MediaStream] restrict media capture secure connections
919         https://bugs.webkit.org/show_bug.cgi?id=164234
920         <rdar://problem/28944906>
921
922         Reviewed by Alex Christensen.
923
924         * Shared/WebPreferencesDefinitions.h:
925    
926         * UIProcess/API/C/WKPreferences.cpp:
927         (WKPreferencesSetMediaCaptureRequiresSecureConnection):
928         (WKPreferencesGetMediaCaptureRequiresSecureConnection):
929         * UIProcess/API/C/WKPreferencesRefPrivate.h:
930    
931         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
932         (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame): Drive by
933          fix: remove some unused parameters in a lambda call.
934
935         * WebProcess/WebPage/WebPage.cpp:
936         (WebKit::WebPage::updatePreferences):
937
938 2016-11-01  Gavin Barraclough  <barraclough@apple.com>
939
940         Add IsAudible, IsLoading to ActivityState
941         https://bugs.webkit.org/show_bug.cgi?id=164286
942
943         Reviewed by Geoff Garen.
944
945         By computing these values in the UIProcess and passing them to WebContent we can
946         more closely unify iOS & macOS throttling, and remove the PageThrottler class.
947
948         * UIProcess/WebPageProxy.cpp:
949         (WebKit::WebPageProxy::updateActivityState):
950             - Added update for IsAudible, IsLoading flags.
951         (WebKit::WebPageProxy::updateThrottleState):
952             - Read IsAudible, IsLoading flags from ActivityState.
953         (WebKit::WebPageProxy::setMuted):
954             - call activityStateDidChange to trigger update.
955         (WebKit::WebPageProxy::isPlayingMediaDidChange):
956             - call activityStateDidChange to trigger update.
957         * UIProcess/WebPageProxy.h:
958         (WebKit::WebPageProxy::isLoadingChanged):
959             - call activityStateDidChange to trigger update.
960
961 2016-10-31  Gavin Barraclough  <barraclough@apple.com>
962
963         Rename ViewState to ActivityState
964         https://bugs.webkit.org/show_bug.cgi?id=164254
965
966         Reviewed by Andreas Kling.
967
968         We plan to add a couple more flags to ViewState that aren't directly related to the view
969         itself - whether there is an ongoing page load, and whether whether there is audio playback.
970         This will allow viewState (now activityState) to fully drive throttling decisions.
971
972         Renaming this bitfield accordingly.
973
974         * Shared/WebPageCreationParameters.cpp:
975         (WebKit::WebPageCreationParameters::encode):
976         (WebKit::WebPageCreationParameters::decode):
977         * Shared/WebPageCreationParameters.h:
978         * UIProcess/API/Cocoa/WKWebView.mm:
979         (-[WKWebView didMoveToWindow]):
980         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
981         (_WebKitWebViewBasePrivate::_WebKitWebViewBasePrivate):
982         (_WebKitWebViewBasePrivate::updateActivityStateTimerFired):
983         (webkitWebViewBaseScheduleUpdateActivityState):
984         (toplevelWindowFocusInEvent):
985         (toplevelWindowFocusOutEvent):
986         (toplevelWindowStateEvent):
987         (webkitWebViewBaseSetToplevelOnScreenWindow):
988         (webkitWebViewBaseMap):
989         (webkitWebViewBaseUnmap):
990         (webkitWebViewBaseSetFocus):
991         (webkitWebViewBaseIsInWindowActive):
992         (webkitWebViewBaseIsFocused):
993         (webkitWebViewBaseIsVisible):
994         (webkitWebViewBaseIsInWindow):
995         (_WebKitWebViewBasePrivate::updateViewStateTimerFired): Deleted.
996         (webkitWebViewBaseScheduleUpdateViewState): Deleted.
997         * UIProcess/Cocoa/WebViewImpl.mm:
998         (WebKit::WebViewImpl::becomeFirstResponder):
999         (WebKit::WebViewImpl::resignFirstResponder):
1000         (WebKit::WebViewImpl::windowDidOrderOffScreen):
1001         (WebKit::WebViewImpl::windowDidOrderOnScreen):
1002         (WebKit::WebViewImpl::windowDidBecomeKey):
1003         (WebKit::WebViewImpl::windowDidResignKey):
1004         (WebKit::WebViewImpl::windowDidMiniaturize):
1005         (WebKit::WebViewImpl::windowDidDeminiaturize):
1006         (WebKit::WebViewImpl::windowDidChangeOcclusionState):
1007         (WebKit::WebViewImpl::viewDidMoveToWindow):
1008         (WebKit::WebViewImpl::viewDidHide):
1009         (WebKit::WebViewImpl::viewDidUnhide):
1010         (WebKit::WebViewImpl::activeSpaceDidChange):
1011         (WebKit::WebViewImpl::endDeferringViewInWindowChanges):
1012         (WebKit::WebViewImpl::endDeferringViewInWindowChangesSync):
1013         (WebKit::WebViewImpl::prepareForMoveToWindow):
1014         * UIProcess/DrawingAreaProxy.h:
1015         (WebKit::DrawingAreaProxy::waitForDidUpdateActivityState):
1016         (WebKit::DrawingAreaProxy::waitForDidUpdateViewState): Deleted.
1017         * UIProcess/WebPageProxy.cpp:
1018         (WebKit::WebPageProxy::WebPageProxy):
1019         (WebKit::WebPageProxy::reattachToWebProcess):
1020         (WebKit::WebPageProxy::setSuppressVisibilityUpdates):
1021         (WebKit::WebPageProxy::updateActivityState):
1022         (WebKit::WebPageProxy::activityStateDidChange):
1023         (WebKit::WebPageProxy::dispatchActivityStateChange):
1024         (WebKit::WebPageProxy::updateThrottleState):
1025         (WebKit::WebPageProxy::waitForDidUpdateActivityState):
1026         (WebKit::WebPageProxy::creationParameters):
1027         (WebKit::WebPageProxy::installActivityStateChangeCompletionHandler):
1028         (WebKit::WebPageProxy::updateViewState): Deleted.
1029         (WebKit::WebPageProxy::viewStateDidChange): Deleted.
1030         (WebKit::WebPageProxy::dispatchViewStateChange): Deleted.
1031         (WebKit::WebPageProxy::waitForDidUpdateViewState): Deleted.
1032         (WebKit::WebPageProxy::installViewStateChangeCompletionHandler): Deleted.
1033         * UIProcess/WebPageProxy.h:
1034         (WebKit::WebPageProxy::isInWindow):
1035         (WebKit::WebPageProxy::didUpdateActivityState):
1036         (WebKit::WebPageProxy::isViewVisible):
1037         (WebKit::WebPageProxy::didUpdateViewState): Deleted.
1038         * UIProcess/WebPageProxy.messages.in:
1039         * UIProcess/WebProcessProxy.cpp:
1040         (WebKit::WebProcessProxy::windowServerConnectionStateChanged):
1041         * UIProcess/efl/WebView.cpp:
1042         * UIProcess/ios/WKContentView.mm:
1043         (-[WKContentView _applicationDidEnterBackground]):
1044         (-[WKContentView _applicationWillEnterForeground]):
1045         * UIProcess/ios/WKPDFView.mm:
1046         (-[WKPDFView _applicationDidEnterBackground]):
1047         (-[WKPDFView _applicationWillEnterForeground]):
1048         * UIProcess/ios/WebPageProxyIOS.mm:
1049         (WebKit::WebPageProxy::synchronizeDynamicViewportUpdate):
1050         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h:
1051         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
1052         (WebKit::RemoteLayerTreeDrawingAreaProxy::didRefreshDisplay):
1053         (WebKit::RemoteLayerTreeDrawingAreaProxy::waitForDidUpdateActivityState):
1054         (WebKit::RemoteLayerTreeDrawingAreaProxy::waitForDidUpdateViewState): Deleted.
1055         * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.h:
1056         * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm:
1057         (WebKit::TiledCoreAnimationDrawingAreaProxy::waitForDidUpdateActivityState):
1058         (WebKit::TiledCoreAnimationDrawingAreaProxy::waitForDidUpdateViewState): Deleted.
1059         * WebProcess/Plugins/PluginView.cpp:
1060         (WebKit::PluginView::activityStateDidChange):
1061         (WebKit::PluginView::viewStateDidChange): Deleted.
1062         * WebProcess/Plugins/PluginView.h:
1063         * WebProcess/WebPage/AcceleratedDrawingArea.cpp:
1064         (WebKit::AcceleratedDrawingArea::activityStateDidChange):
1065         (WebKit::AcceleratedDrawingArea::viewStateDidChange): Deleted.
1066         * WebProcess/WebPage/AcceleratedDrawingArea.h:
1067         * WebProcess/WebPage/DrawingArea.h:
1068         (WebKit::DrawingArea::activityStateDidChange):
1069         (WebKit::DrawingArea::viewStateDidChange): Deleted.
1070         * WebProcess/WebPage/WebPage.cpp:
1071         (WebKit::m_userInterfaceLayoutDirection):
1072         (WebKit::WebPage::reinitializeWebPage):
1073         (WebKit::WebPage::updateIsInWindow):
1074         (WebKit::WebPage::setActivityState):
1075         (WebKit::WebPage::setViewState): Deleted.
1076         * WebProcess/WebPage/WebPage.h:
1077         (WebKit::WebPage::isVisible):
1078         (WebKit::WebPage::isVisibleOrOccluded):
1079         * WebProcess/WebPage/WebPage.messages.in:
1080         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
1081         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
1082         (WebKit::RemoteLayerTreeDrawingArea::activityStateDidChange):
1083         (WebKit::RemoteLayerTreeDrawingArea::viewStateDidChange): Deleted.
1084         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
1085         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
1086         (WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea):
1087         (WebKit::TiledCoreAnimationDrawingArea::activityStateDidChange):
1088         (WebKit::TiledCoreAnimationDrawingArea::didUpdateActivityStateTimerFired):
1089         (WebKit::TiledCoreAnimationDrawingArea::viewStateDidChange): Deleted.
1090         (WebKit::TiledCoreAnimationDrawingArea::didUpdateViewStateTimerFired): Deleted.
1091
1092 2016-10-31  Jaehun Lim  <ljaehun.lim@samsung.com>
1093
1094         Unreviewed, CMake build fix
1095
1096         Adds #include <WebCore/IDBGetAllRecordsData.h>
1097
1098         * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.cpp:
1099
1100 2016-10-31  Simon Fraser  <simon.fraser@apple.com>
1101
1102         Add basic visual/layout viewport support for fixed position layout
1103         https://bugs.webkit.org/show_bug.cgi?id=164261
1104
1105         Reviewed by Dean Jackson.
1106
1107         Don't make visualViewportEnabled an experimental feature, because I don't want it enabled
1108         by default in WebKitTestRunner (and therefore mismatching DumpRenderTree).
1109
1110         * Shared/WebPreferencesDefinitions.h:
1111
1112 2016-10-29  Filip Pizlo  <fpizlo@apple.com>
1113
1114         JSC should support SharedArrayBuffer
1115         https://bugs.webkit.org/show_bug.cgi?id=163986
1116
1117         Reviewed by Keith Miller.
1118         
1119         Adds some small things we need for SharedArrayBuffer.
1120
1121         * UIProcess/API/C/WKPreferencesRefPrivate.h:
1122         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
1123         * WebProcess/InjectedBundle/InjectedBundle.cpp:
1124         (WebKit::InjectedBundle::createWebDataFromUint8Array):
1125
1126 2016-10-31  Brady Eidson  <beidson@apple.com>
1127
1128         IndexedDB 2.0: Support IDBObjectStore getAll/getAllKeys.
1129         <rdar://problem/28806934> and https://bugs.webkit.org/show_bug.cgi?id=164097
1130
1131         Reviewed by Darin Adler.
1132
1133         - Handle moving "Get All" requests to and from the DatabaseProcess.
1134         - Handle the additional task of creating/passing Sandbox Extensions for
1135           referenced files when necessary. 
1136           
1137         * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.cpp:
1138         (WebKit::WebIDBConnectionToClient::handleGetResult):
1139         (WebKit::WebIDBConnectionToClient::didGetAllRecords):
1140         (WebKit::WebIDBConnectionToClient::getAllRecords):
1141         * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.h:
1142         * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.messages.in:
1143         
1144         * Shared/WebCoreArgumentCoders.h:
1145         
1146         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
1147         (WebKit::WebIDBConnectionToServer::getAllRecords):
1148         (WebKit::preregisterSandboxExtensionsIfNecessary):
1149         (WebKit::WebIDBConnectionToServer::didGetAllRecords):
1150         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h:
1151         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.messages.in:
1152
1153 2016-10-31  Wenson Hsieh  <wenson_hsieh@apple.com>
1154
1155         [WK1] Candidate visibility should not update as a result of selection during a dictionary lookup
1156         https://bugs.webkit.org/show_bug.cgi?id=164236
1157         <rdar://problem/28747712>
1158
1159         Reviewed by Beth Dakin.
1160
1161         See WebCore ChangeLog for more detail. Removes m_isGettingDictionaryPopupInfo from the WebPage in favor of
1162         keeping track of the same state in Editor, so that both the WK1 and WK2 cases can share the same codepath.
1163
1164         * WebProcess/WebPage/WebPage.cpp:
1165         (WebKit::WebPage::didChangeSelection):
1166         * WebProcess/WebPage/WebPage.h:
1167         * WebProcess/WebPage/mac/WebPageMac.mm:
1168         (WebKit::WebPage::dictionaryPopupInfoForRange):
1169
1170 2016-10-31  Simon Fraser  <simon.fraser@apple.com>
1171
1172         Implement IntersectionObserver
1173         https://bugs.webkit.org/show_bug.cgi?id=159475
1174
1175         Reviewed by Ryosuke Niwa.
1176
1177         Add ENABLE_INTERSECTION_OBSERVER, enabled by default.
1178
1179         * Configurations/FeatureDefines.xcconfig:
1180
1181 2016-10-31  Ryan Haddad  <ryanhaddad@apple.com>
1182
1183         Unreviewed, rolling out r208154.
1184
1185         This change caused an assertion failure during API tests on
1186         macOS.
1187
1188         Reverted changeset:
1189
1190         "NetworkSession: Network process crash when converting main
1191         resource to download"
1192         https://bugs.webkit.org/show_bug.cgi?id=164220
1193         http://trac.webkit.org/changeset/208154
1194
1195 2016-10-28  Brent Fulgham  <bfulgham@apple.com>
1196
1197         Do a better job of protecting Frame objects in the context of JavaScript calls
1198         https://bugs.webkit.org/show_bug.cgi?id=164163
1199         <rdar://problem/28955249>
1200
1201         Reviewed by Darin Adler.
1202
1203         * WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp:
1204         (WebKit::InjectedBundleRangeHandle::renderedImage): Protected the Frame.
1205         * WebProcess/WebPage/WebPage.cpp:
1206         (WebKit::WebPage::insertTextAsync): Ditto.
1207         (WebKit::WebPage::setComposition): Ditto.
1208         * WebProcess/WebPage/mac/WebPageMac.mm:
1209         (WebKit::WebPage::insertDictatedTextAsync): Ditto.
1210
1211 2016-10-31  Carlos Garcia Campos  <cgarcia@igalia.com>
1212
1213         NetworkSession: Network process crash when converting main resource to download
1214         https://bugs.webkit.org/show_bug.cgi?id=164220
1215
1216         Reviewed by Alex Christensen.
1217
1218         Right after the main resource load is converted to a download, the web process deletes the ResourceLoader which
1219         sends the RemoveLoadIdentifier to the network process and the load is aborted. Sometimes it happens that
1220         NetworkResourceLoader::abort() is called while the NetworkLoad is still deciding the destination of the
1221         download. In such case, NetworkResourceLoader::didConvertToDownload() has already been called, but not
1222         NetworkResourceLoader::didBecomeDownload(). In NetworkResourceLoader::abort() we already handle the case of
1223         having a NetworkLoad after NetworkResourceLoader::didConvertToDownload() has been called, to avoid canceling the
1224         load in such case, however cleanup() is always called unconditionally and the NetworkLoad is deleted before
1225         NetworkResourceLoader::didBecomeDownload() is called. When the NetworkLoad is destroyed the NetworkDataTask
1226         client becomes nullptr, leaving it in a state where both the client is nullptr and the download hasn't been
1227         created yet. That's not expected to happen and when the response completion handler is called in the
1228         NetworkDataTask it tries to use either the client or the download and it crashes.
1229
1230         * NetworkProcess/NetworkResourceLoader.cpp:
1231         (WebKit::NetworkResourceLoader::didBecomeDownload): Call cleanup() instead of just deleting the network load.
1232         (WebKit::NetworkResourceLoader::abort): If we still have a network load that was converted to a download, do not
1233         call cleanup() because it will be called by didBecomeDownload() later.
1234
1235 2016-10-31  Darin Adler  <darin@apple.com>
1236
1237         Move ChildNode and ParentNode from ExceptionCode to Exception, add support for ExceptionOr<T&>
1238         https://bugs.webkit.org/show_bug.cgi?id=164214
1239
1240         Reviewed by Alex Christensen.
1241
1242         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocument.cpp:
1243         (webkit_dom_document_query_selector): Updated exception handling.
1244         (webkit_dom_document_query_selector_all): Ditto.
1245         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentFragment.cpp:
1246         (webkit_dom_document_fragment_query_selector): Ditto.
1247         (webkit_dom_document_fragment_query_selector_all): Ditto.
1248         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElement.cpp:
1249         (webkit_dom_element_query_selector): Ditto.
1250         (webkit_dom_element_query_selector_all): Ditto.
1251
1252 2016-10-31  Darin Adler  <darin@apple.com>
1253
1254         Convert Document from ExceptionCode to Exception
1255         https://bugs.webkit.org/show_bug.cgi?id=164212
1256
1257         Reviewed by Alex Christensen.
1258
1259         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocument.cpp:
1260         (webkit_dom_document_create_element): Updated exception handling.
1261         (webkit_dom_document_create_cdata_section): Ditto.
1262         (webkit_dom_document_create_processing_instruction): Ditto.
1263         (webkit_dom_document_create_attribute): Ditto.
1264         (webkit_dom_document_import_node): Ditto.
1265         (webkit_dom_document_create_element_ns): Ditto.
1266         (webkit_dom_document_create_attribute_ns): Ditto.
1267         (webkit_dom_document_adopt_node): Ditto.
1268         (webkit_dom_document_create_event): Ditto.
1269         (webkit_dom_document_set_xml_version): Ditto.
1270         (webkit_dom_document_get_cookie): Ditto.
1271         (webkit_dom_document_set_cookie): Ditto.
1272         (webkit_dom_document_set_body): Ditto.
1273         * WebProcess/InjectedBundle/API/mac/WKDOMDocument.mm:
1274         (-[WKDOMDocument createElement:]): Ditto.
1275
1276 2016-10-31  Wenson Hsieh  <wenson_hsieh@apple.com>
1277
1278         Holding down a key to choose an accented character should fire "insertReplacementText" input events
1279         https://bugs.webkit.org/show_bug.cgi?id=164209
1280         <rdar://problem/29019305>
1281
1282         Reviewed by Darin Adler.
1283
1284         When replacing text, call Editor::insertText with the correct TextEventInputType so that WebCore will know to
1285         use EditActionInsertReplacement when creating and applying the corresponding TypingCommand. Additional minor
1286         changes in order to support testing replacement text insertion.
1287
1288         * UIProcess/API/Cocoa/WKWebView.mm:
1289         (-[WKWebView _insertText:replacementRange:]):
1290         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1291         * WebProcess/WebPage/WebPage.cpp:
1292         (WebKit::WebPage::insertTextAsync):
1293
1294 2016-10-30  Darin Adler  <darin@apple.com>
1295
1296         Move Element, NamedNodeMap, and DOMStringMap from ExceptionCode to Exception
1297         https://bugs.webkit.org/show_bug.cgi?id=164206
1298
1299         Reviewed by Chris Dumez.
1300
1301         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNamedNodeMap.cpp:
1302         (webkit_dom_named_node_map_set_named_item): Updated exception handling.
1303         (webkit_dom_named_node_map_remove_named_item): Ditto.
1304         (webkit_dom_named_node_map_set_named_item_ns): Ditto.
1305         (webkit_dom_named_node_map_remove_named_item_ns): Ditto.
1306         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElement.cpp:
1307         (webkit_dom_element_set_attribute): Ditto.
1308         (webkit_dom_element_set_attribute_node): Ditto.
1309         (webkit_dom_element_remove_attribute_node): Ditto.
1310         (webkit_dom_element_set_attribute_ns): Ditto.
1311         (webkit_dom_element_set_attribute_node_ns): Ditto.
1312         (webkit_dom_element_matches): Ditto.
1313         (webkit_dom_element_closest): Ditto.
1314         (webkit_dom_element_webkit_matches_selector): Ditto.
1315         (webkit_dom_element_insert_adjacent_element): Ditto.
1316         (webkit_dom_element_insert_adjacent_html): Ditto.
1317         (webkit_dom_element_insert_adjacent_text): Ditto.
1318         (webkit_dom_element_set_inner_html): Ditto.
1319         (webkit_dom_element_set_outer_html): Ditto.
1320         * WebProcess/InjectedBundle/API/mac/WKDOMElement.mm:
1321         (-[WKDOMElement setAttribute:value:]): Ditto.
1322
1323 2016-10-30  Yusuke Suzuki  <utatane.tea@gmail.com>
1324
1325         [DOM] Introduce WebCore::jsDynamicDowncast
1326         https://bugs.webkit.org/show_bug.cgi?id=164137
1327
1328         Reviewed by Darin Adler.
1329
1330         * WebProcess/Automation/WebAutomationSessionProxy.cpp:
1331         (WebKit::WebAutomationSessionProxy::elementForNodeHandle):
1332
1333 2016-10-29  Darin Adler  <darin@apple.com>
1334
1335         Convert more of DOM from ExceptionCode to Exception
1336         https://bugs.webkit.org/show_bug.cgi?id=164173
1337
1338         Reviewed by Ryosuke Niwa.
1339
1340         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCharacterData.cpp:
1341         (webkit_dom_character_data_substring_data): Updated since this
1342         now uses ExceptionOr.
1343         (webkit_dom_character_data_insert_data): Ditto.
1344         (webkit_dom_character_data_delete_data): Ditto.
1345         (webkit_dom_character_data_replace_data): Ditto.
1346         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDeprecated.cpp:
1347         (webkit_dom_text_replace_whole_text): Ditto.
1348         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMText.cpp:
1349         (webkit_dom_text_split_text): Ditto.
1350
1351 2016-10-28  Darin Adler  <darin@apple.com>
1352
1353         Move all classes in the HTML directory from ExceptionCode to Exception
1354         https://bugs.webkit.org/show_bug.cgi?id=163876
1355
1356         Reviewed by Sam Weinig.
1357
1358         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMTokenList.cpp:
1359         (webkit_dom_dom_token_list_add): Updated exception handling.
1360         (webkit_dom_dom_token_list_remove): Ditto.
1361         (webkit_dom_dom_token_list_toggle): Ditto.
1362         (webkit_dom_dom_token_list_replace): Ditto.
1363         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElement.cpp:
1364         (webkit_dom_element_remove): Ditto.
1365         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLElement.cpp:
1366         (webkit_dom_html_element_set_inner_text): Ditto.
1367         (webkit_dom_html_element_set_outer_text): Ditto.
1368         (webkit_dom_html_element_set_content_editable): Ditto.
1369         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLInputElement.cpp:
1370         (webkit_dom_html_input_element_set_max_length): Ditto.
1371         (webkit_dom_html_input_element_set_size): Ditto.
1372         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLSelectElement.cpp:
1373         (webkit_dom_html_select_element_set_length): Ditto.
1374         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableElement.cpp:
1375         (webkit_dom_html_table_element_insert_row): Ditto.
1376         (webkit_dom_html_table_element_delete_row): Ditto.
1377         (webkit_dom_html_table_element_set_caption): Ditto.
1378         (webkit_dom_html_table_element_set_t_head): Ditto.
1379         (webkit_dom_html_table_element_set_t_foot): Ditto.
1380         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableRowElement.cpp:
1381         (webkit_dom_html_table_row_element_insert_cell): Ditto.
1382         (webkit_dom_html_table_row_element_delete_cell): Ditto.
1383         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableSectionElement.cpp:
1384         (webkit_dom_html_table_section_element_insert_row): Ditto.
1385         (webkit_dom_html_table_section_element_delete_row): Ditto.
1386
1387         * WebProcess/WebPage/WebPage.cpp:
1388         (WebKit::WebPage::editorState): Removed ASSERT_NO_EXCEPTION.
1389
1390         * WebProcess/WebPage/ios/WebPageIOS.mm:
1391         (WebKit::WebPage::setAssistedNodeValueAsNumber): Removed ASSERT_NO_EXCEPTION.
1392
1393         * WebProcess/cocoa/WebPlaybackSessionManager.mm:
1394         (WebKit::WebPlaybackSessionManager::seekableRangesChanged):
1395         Changed the code to use a different interface to TimeRange that does
1396         not involve exceptions.
1397
1398 2016-10-28  Wenson Hsieh  <wenson_hsieh@apple.com>
1399
1400         iOS autocorrection does not trigger an input event of inputType "insertReplacementText"
1401         https://bugs.webkit.org/show_bug.cgi?id=164077
1402         <rdar://problem/28987810>
1403
1404         Reviewed by Simon Fraser.
1405
1406         Small tweak to mark text insertion when autocorrecting as such, as opposed to regular keyboard input.
1407
1408         * WebProcess/WebPage/ios/WebPageIOS.mm:
1409         (WebKit::WebPage::syncApplyAutocorrection):
1410
1411 2016-10-28  Megan Gardner  <megan_gardner@apple.com>
1412
1413         Rename SharedMemoryMac to SharedMemoryCocoa
1414         https://bugs.webkit.org/show_bug.cgi?id=164156
1415
1416         Reviewed by Alex Christensen.
1417
1418         Renamed SharedMemoryMac to SharedMemoryCocoa, as it runs on all cocoa platforms, not exclusively just mac, and
1419         thus should be named to reflect that reality.
1420
1421         * Platform/cocoa: Added.
1422         * Platform/cocoa/SharedMemoryCocoa.cpp: Copied from Source/WebKit2/Platform/mac/SharedMemoryMac.cpp.
1423         * Platform/mac/SharedMemoryMac.cpp: Removed.
1424         * WebKit2.xcodeproj/project.pbxproj:
1425
1426 2016-10-28  Antti Koivisto  <antti@apple.com>
1427
1428         Enable CFNetwork connection cache fast lane for WebKit2
1429         https://bugs.webkit.org/show_bug.cgi?id=164129
1430
1431         Reviewed by Andreas Kling.
1432
1433         The idea of this feature is keep a connection free for higher priority requests so low-priority
1434         image loads can't take all the available connections.
1435
1436         We have this enabled on WK1 but not on WK2. See what enabling it does for performance in bots.
1437
1438         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
1439         (WebKit::initializeNetworkSettings):
1440
1441             Based on code inspection setting kHTTPMinimumFastLanePriority is not sufficient to enable this feature,
1442             kHTTPNumFastLanes needs also be set to a non-zero value. Use the same constants as WK1.
1443             Also enable this on Mac to unify behavior.
1444
1445 2016-10-27  Michael Catanzaro  <mcatanzaro@igalia.com>
1446
1447         [GTK] New stable DOM API headers should be included from webkitdom.h
1448         https://bugs.webkit.org/show_bug.cgi?id=164069
1449
1450         Reviewed by Carlos Garcia Campos.
1451
1452         * WebProcess/InjectedBundle/API/gtk/DOM/webkitdom.h:
1453
1454 2016-10-27  Simon Fraser  <simon.fraser@apple.com>
1455
1456         Fix when building against the MacOSX10.12.sdk where "macos" is not recognized
1457         in the availability macros.
1458
1459         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1460
1461 2016-10-27  Megan Gardner  <megan_gardner@apple.com>
1462
1463         Add support for wide gamut for ShareableBitmap for image popovers
1464         https://bugs.webkit.org/show_bug.cgi?id=164001
1465
1466         Reviewed by Simon Fraser.
1467
1468         Added suppport for wide gamut in ShareableBitmap. SharableBitmaps now know the size of their pixels,
1469         and that data is passed back and forth between the processes. The callers of SharedBitmap will determine
1470         if their image should support wide gamut, but ShareableBitmap will override a set flag on a device that
1471         is incapbable of supporting a wide gamut image.
1472         This makes it possible to show wide gamut images in image popovers on iOS.
1473         This is currently untestable, so no tests added.
1474
1475         * Platform/IPC/Decoder.cpp:
1476         (IPC::Decoder::decode):
1477         * Platform/IPC/Decoder.h:
1478         * Platform/IPC/Encoder.cpp:
1479         (IPC::Encoder::encode):
1480         * Platform/IPC/Encoder.h:
1481         * Shared/ShareableBitmap.cpp:
1482         (WebKit::bytesPerPixel):
1483         (WebKit::ShareableBitmap::Handle::encode):
1484         (WebKit::ShareableBitmap::Handle::decode):
1485         (WebKit::ShareableBitmap::Handle::clear):
1486         (WebKit::ShareableBitmap::create):
1487         (WebKit::ShareableBitmap::createShareable):
1488         (WebKit::ShareableBitmap::createHandle):
1489         (WebKit::ShareableBitmap::ShareableBitmap):
1490         * Shared/ShareableBitmap.h:
1491         (WebKit::ShareableBitmap::numBytesForSize):
1492         (WebKit::ShareableBitmap::sizeInBytes):
1493         * Shared/cg/ShareableBitmapCG.cpp:
1494         (WebKit::bitmapInfo):
1495         (WebKit::ShareableBitmap::createGraphicsContext):
1496         (WebKit::ShareableBitmap::createCGImage):
1497         * WebProcess/WebPage/ios/WebPageIOS.mm:
1498         (WebKit::WebPage::getPositionInformation):
1499
1500 2016-10-27  Wenson Hsieh  <wenson_hsieh@apple.com>
1501
1502         Support "insertFromDrop" and "deleteByDrag" for the InputEvent spec
1503         https://bugs.webkit.org/show_bug.cgi?id=163948
1504         <rdar://problem/28921433>
1505
1506         Reviewed by Darin Adler.
1507
1508         Add support for new drag and drop-related EditAction enum values.
1509
1510         * UIProcess/WebEditCommandProxy.cpp:
1511         (WebKit::WebEditCommandProxy::nameForEditAction):
1512
1513 2016-10-26  Chris Dumez  <cdumez@apple.com>
1514
1515         Replace IDBKeyPath with a WTF::Variant
1516         https://bugs.webkit.org/show_bug.cgi?id=163909
1517
1518         Reviewed by Darin Adler.
1519
1520         Add coders to encode / decode IDBKeyPath type for IPC.
1521
1522         * Shared/Databases/IndexedDB/WebIDBResult.cpp:
1523         * Shared/WebCoreArgumentCoders.cpp:
1524         (IPC::ArgumentCoder<IDBKeyPath>::encode):
1525         (IPC::ArgumentCoder<IDBKeyPath>::decode):
1526         * Shared/WebCoreArgumentCoders.h:
1527         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
1528
1529 2016-10-26  Brian Burg  <bburg@apple.com>
1530
1531         Web Inspector: remove unused bool return value from FrontendChannel::sendMessageToFrontend
1532         https://bugs.webkit.org/show_bug.cgi?id=164046
1533
1534         Reviewed by Joseph Pecoraro.
1535
1536         * WebProcess/WebPage/WebInspector.cpp:
1537         (WebKit::WebInspector::sendMessageToFrontend):
1538         * WebProcess/WebPage/WebInspector.h:
1539
1540 2016-10-26  Eric Carlson  <eric.carlson@apple.com>
1541
1542         [MediaStream] Add "has capture device" bit to media state flags
1543         https://bugs.webkit.org/show_bug.cgi?id=163952
1544
1545         Unreviewed fix after r207839.
1546
1547         * WebProcess/WebPage/WebPage.cpp:
1548         (WebKit::WebPage::setMuted): Take an MutedStateFlags, not a bool.
1549         * WebProcess/WebPage/WebPage.h:
1550
1551 2016-10-26  Carlos Garcia Campos  <cgarcia@igalia.com>
1552
1553         Unreviewed. Update OptionsGTK.cmake and NEWS for 2.15.1 release.
1554
1555         * gtk/NEWS: Add release notes for 2.15.1.
1556
1557 2016-10-26  Carlos Garcia Campos  <cgarcia@igalia.com>
1558
1559         REGRESSION(r206505) [GTK] Build broken with GTK+ 3.14
1560         https://bugs.webkit.org/show_bug.cgi?id=162776
1561
1562         Reviewed by Xabier Rodriguez-Calvar.
1563
1564         Do not use gtk_widget_get_action_group() when GTK+ < 3.16, use g_object_set instead to attach the action group
1565         to the menu widget.
1566
1567         * UIProcess/gtk/WebContextMenuProxyGtk.cpp:
1568         (WebKit::WebContextMenuProxyGtk::append):
1569         (WebKit::WebContextMenuProxyGtk::WebContextMenuProxyGtk):
1570         (WebKit::WebContextMenuProxyGtk::~WebContextMenuProxyGtk):
1571
1572 2016-10-25  Alex Christensen  <achristensen@webkit.org>
1573
1574         CMake build fix.
1575
1576         * PlatformMac.cmake:
1577         * Shared/WebHitTestResultData.cpp:
1578         (WebKit::WebHitTestResultData::WebHitTestResultData):
1579         Explicitly call AtomicString::string to make the String constructor no longer ambiguous.
1580         It couldn't decide whether to use operator const String& or operator NSString*.
1581
1582 2016-10-25  Carlos Garcia Campos  <cgarcia@igalia.com>
1583
1584         [SOUP] Network process assertion in NetworkDataTask::continueHTTPRedirection
1585         https://bugs.webkit.org/show_bug.cgi?id=163941
1586
1587         Reviewed by Michael Catanzaro.
1588
1589         equalLettersIgnoringASCIICase() expects the second argument to be the letters to compare in lowercase, so use
1590         "get" instead of "GET".
1591
1592         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
1593         (WebKit::NetworkDataTaskSoup::continueHTTPRedirection):
1594
1595 2016-10-25  Eric Carlson  <eric.carlson@apple.com>
1596
1597         [MediaStream] Add "has capture device" bit to media state flags
1598         https://bugs.webkit.org/show_bug.cgi?id=163952
1599
1600         Reviewed by Sam Weinig.
1601
1602         * UIProcess/API/C/WKPage.cpp:
1603         (WKPageGetMediaState): Support MediaProducer::HasMediaCaptureDevice.
1604         * UIProcess/API/C/WKPagePrivate.h: Define kWKMediaHasCaptureDevice.
1605
1606 2016-10-25  Commit Queue  <commit-queue@webkit.org>
1607
1608         Unreviewed, rolling out r207827 and r207828.
1609         https://bugs.webkit.org/show_bug.cgi?id=163965
1610
1611         Caused LayoutTest webaudio/web-audio-is-playing.html to time
1612         out on macOS. (Requested by ryanhaddad on #webkit).
1613
1614         Reverted changesets:
1615
1616         "[MediaStream] Add "has capture device" bit to media state
1617         flags"
1618         https://bugs.webkit.org/show_bug.cgi?id=163952
1619         http://trac.webkit.org/changeset/207827
1620
1621         "[MediaStream] Add "has capture device" bit to media state
1622         flags"
1623         https://bugs.webkit.org/show_bug.cgi?id=163952
1624         http://trac.webkit.org/changeset/207828
1625
1626 2016-10-25  Eric Carlson  <eric.carlson@apple.com>
1627
1628         [MediaStream] Add "has capture device" bit to media state flags
1629         https://bugs.webkit.org/show_bug.cgi?id=163952
1630
1631         Reviewed by Sam Weinig.
1632
1633         * UIProcess/API/C/WKPage.cpp:
1634         (WKPageGetMediaState): Support MediaProducer::HasMediaCaptureDevice.
1635         * UIProcess/API/C/WKPagePrivate.h: Define kWKMediaHasCaptureDevice.
1636
1637 2016-10-25  Chris Dumez  <cdumez@apple.com>
1638
1639         Unreviewed, rolling out r207494.
1640
1641         iOS SDK has been updated on the bots now so rollout the
1642         rollout
1643
1644         Reverted changeset:
1645
1646         "Unreviewed, rolling out r207413."
1647         https://bugs.webkit.org/show_bug.cgi?id=163547
1648         http://trac.webkit.org/changeset/207494
1649
1650 2016-10-25  Jonathan Bedard  <jbedard@apple.com>
1651
1652         Unreviewed build fix.
1653
1654         * UIProcess/API/Cocoa/WKWebView.mm:
1655         (-[WKWebView _fullscreenDelegate]): Removed unneeded parenthesis.
1656
1657 2016-10-19  Jer Noble  <jer.noble@apple.com>
1658
1659         Add WKWebView fullscreen delegate SPI
1660         https://bugs.webkit.org/show_bug.cgi?id=163674
1661
1662         Reviewed by Anders Carlsson.
1663
1664         Add a new SPI property to WKWebView allowing clients to be notified when fullscreen mode enters and exits.
1665
1666         * UIProcess/API/APIFullscreenClient.h: Added.
1667         (API::FullscreenClient::~FullscreenClient):
1668         (API::FullscreenClient::willEnterFullscreen):
1669         (API::FullscreenClient::didEnterFullscreen):
1670         (API::FullscreenClient::willExitFullscreen):
1671         (API::FullscreenClient::didExitFullscreen):
1672         * UIProcess/API/Cocoa/WKWebView.mm:
1673         (-[WKWebView _initializeWithConfiguration:]):
1674         (-[WKWebView _setFullscreenDelegate:]):
1675         (-[WKWebView _fullscreenDelegate]):
1676         (-[WKWebView _isInFullscreen]):
1677         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1678         * UIProcess/API/Cocoa/_WKFullscreenDelegate.h: Added.
1679         * UIProcess/Cocoa/FullscreenClient.h: Added.
1680         (WebKit::FullscreenClient::~FullscreenClient):
1681         * UIProcess/Cocoa/FullscreenClient.mm: Added.
1682         (WebKit::FullscreenClient::FullscreenClient):
1683         (WebKit::FullscreenClient::delegate):
1684         (WebKit::FullscreenClient::setDelegate):
1685         (WebKit::FullscreenClient::willEnterFullscreen):
1686         (WebKit::FullscreenClient::didEnterFullscreen):
1687         (WebKit::FullscreenClient::willExitFullscreen):
1688         (WebKit::FullscreenClient::didExitFullscreen):
1689         * UIProcess/WebFullScreenManagerProxy.cpp:
1690         (WebKit::WebFullScreenManagerProxy::willEnterFullScreen):
1691         (WebKit::WebFullScreenManagerProxy::didEnterFullScreen):
1692         (WebKit::WebFullScreenManagerProxy::willExitFullScreen):
1693         (WebKit::WebFullScreenManagerProxy::didExitFullScreen):
1694         * UIProcess/WebPageProxy.cpp:
1695         (WebKit::WebPageProxy::WebPageProxy):
1696         (WebKit::WebPageProxy::setFullscreenClient):
1697         (WebKit::WebPageProxy::fullScreenManager): Deleted.
1698         * UIProcess/WebPageProxy.h:
1699         (WebKit::WebPageProxy::fullscreenClient):
1700         * WebKit2.xcodeproj/project.pbxproj:
1701
1702 2016-10-25  Carlos Garcia Campos  <cgarcia@igalia.com>
1703
1704         Unreviewed. Fix timeouts in 12 GTK+ unit tests after r207812.
1705
1706         * NetworkProcess/NetworkProcessCreationParameters.h: Initialize loadThrottleLatency.
1707
1708 2016-10-25  Carlos Garcia Campos  <cgarcia@igalia.com>
1709
1710         Unreviewed. Fix Soup based ports debug build after r207813.
1711
1712         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
1713         (WebKit::NetworkDataTaskSoup::authenticateCallback):
1714         (WebKit::NetworkDataTaskSoup::requestStartedCallback):
1715
1716 2016-10-25  Andreas Kling  <akling@apple.com>
1717
1718         More PassRefPtr purging in WebCore.
1719         <https://webkit.org/b/163895>
1720
1721         Reviewed by Antti Koivisto.
1722
1723         * WebProcess/Plugins/PDF/DeprecatedPDFPlugin.h:
1724         * WebProcess/Plugins/PDF/DeprecatedPDFPlugin.mm:
1725         (WebKit::PDFPlugin::createScrollbar):
1726
1727 2016-10-25  Carlos Garcia Campos  <cgarcia@igalia.com>
1728
1729         NetworkSession: switch to use subclasses for NetworkSession and NetworkDataTask implementations
1730         https://bugs.webkit.org/show_bug.cgi?id=163777
1731
1732         Reviewed by Alex Christensen.
1733
1734         The subclass model allows us to choose the implementation at run time, so we could add other implementations
1735         like a mock network class to measure performance, and even one for blobs and finally get rid of ResourceHandle
1736         in WebKit2.
1737
1738         * CMakeLists.txt: Add new files to compilation.
1739         * NetworkProcess/NetworkDataTask.cpp: Added.
1740         (WebKit::NetworkDataTask::create): Create a NetworkDataTaskCocoa or NetworkDataTaskSoup.
1741         (WebKit::NetworkDataTask::NetworkDataTask): Move common code from NetworkDataTaskCocoa and NetworkDataTaskSoup
1742         here to handle the early failures.
1743         (WebKit::NetworkDataTask::~NetworkDataTask):
1744         (WebKit::NetworkDataTask::scheduleFailure):
1745         (WebKit::NetworkDataTask::failureTimerFired):
1746         * NetworkProcess/NetworkDataTask.h: Remove platform specific members.
1747         (WebKit::NetworkDataTask::setPendingDownloadLocation): Make it virtual and set the m_pendingDownloadLocation.
1748         (WebKit::NetworkDataTask::suggestedFilename): Make it virtual and const with a default implementation.
1749         (WebKit::NetworkDataTask::setSuggestedFilename): Ditto.
1750         (WebKit::NetworkDataTask::allowsSpecificHTTPSCertificateForHost): Ditto.
1751         * NetworkProcess/NetworkLoad.cpp: Include NetworkDataTaskCocoa.h.
1752         * NetworkProcess/NetworkLoad.h: Include NetworkDataTask.h instead of NetworkSession.h.
1753         * NetworkProcess/NetworkProcess.cpp:
1754         (WebKit::NetworkProcess::NetworkProcess): Use NetworkSessionCocoa.
1755         * NetworkProcess/NetworkSession.cpp:
1756         (WebKit::NetworkSession::create): Create a NetworkSessionCocoa or NetworkSessionSoup.
1757         (WebKit::NetworkSession::defaultSession): In case of cocoa use NetworkSessionCocoa::defaultSession() because of
1758         the custom protocol manager, otherwise simply create a default session.
1759         (WebKit::NetworkSession::networkStorageSession): Move common code from NetworkSessionCocoa and
1760         NetworkSessionSoup here.
1761         (WebKit::NetworkSession::NetworkSession):
1762         (WebKit::NetworkSession::~NetworkSession):
1763         * NetworkProcess/NetworkSession.h: Remove platform specific members.
1764         (WebKit::NetworkSession::invalidateAndCancel): Make it virtual.
1765         (WebKit::NetworkSession::clearCredentials): Ditto.
1766         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp: Include NetworkSession.h.
1767         * NetworkProcess/cocoa/NetworkDataTaskCocoa.h: Added.
1768         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
1769         (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa):
1770         (WebKit::NetworkDataTaskCocoa::~NetworkDataTaskCocoa):
1771         (WebKit::NetworkDataTaskCocoa::didSendData):
1772         (WebKit::NetworkDataTaskCocoa::didReceiveChallenge):
1773         (WebKit::NetworkDataTaskCocoa::didCompleteWithError):
1774         (WebKit::NetworkDataTaskCocoa::didReceiveResponse):
1775         (WebKit::NetworkDataTaskCocoa::didReceiveData):
1776         (WebKit::NetworkDataTaskCocoa::didBecomeDownload):
1777         (WebKit::NetworkDataTaskCocoa::willPerformHTTPRedirection):
1778         (WebKit::NetworkDataTaskCocoa::setPendingDownloadLocation):
1779         (WebKit::NetworkDataTaskCocoa::tryPasswordBasedAuthentication):
1780         (WebKit::NetworkDataTaskCocoa::transferSandboxExtensionToDownload):
1781         (WebKit::NetworkDataTaskCocoa::allowsSpecificHTTPSCertificateForHost):
1782         (WebKit::NetworkDataTaskCocoa::suggestedFilename):
1783         (WebKit::NetworkDataTaskCocoa::cancel):
1784         (WebKit::NetworkDataTaskCocoa::resume):
1785         (WebKit::NetworkDataTaskCocoa::suspend):
1786         (WebKit::NetworkDataTaskCocoa::state):
1787         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
1788         (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
1789         * NetworkProcess/cocoa/NetworkSessionCocoa.h: Added.
1790         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
1791         (-[WKNetworkSessionDelegate initWithNetworkSession:withCredentials:]):
1792         (-[WKNetworkSessionDelegate URLSession:dataTask:didBecomeDownloadTask:]):
1793         (WebKit::configurationForSessionID):
1794         (WebKit::NetworkSessionCocoa::setCustomProtocolManager):
1795         (WebKit::NetworkSessionCocoa::setSourceApplicationAuditTokenData):
1796         (WebKit::NetworkSessionCocoa::setSourceApplicationBundleIdentifier):
1797         (WebKit::NetworkSessionCocoa::setSourceApplicationSecondaryIdentifier):
1798         (WebKit::NetworkSessionCocoa::setCTDataConnectionServiceType):
1799         (WebKit::NetworkSessionCocoa::create):
1800         (WebKit::NetworkSessionCocoa::defaultSession):
1801         (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
1802         (WebKit::NetworkSessionCocoa::~NetworkSessionCocoa):
1803         (WebKit::NetworkSessionCocoa::invalidateAndCancel):
1804         (WebKit::NetworkSessionCocoa::clearCredentials):
1805         (WebKit::NetworkSessionCocoa::dataTaskForIdentifier):
1806         (WebKit::NetworkSessionCocoa::addDownloadID):
1807         (WebKit::NetworkSessionCocoa::downloadID):
1808         (WebKit::NetworkSessionCocoa::takeDownloadID):
1809         * NetworkProcess/mac/RemoteNetworkingContext.mm:
1810         (WebKit::RemoteNetworkingContext::ensurePrivateBrowsingSession):
1811         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
1812         (WebKit::NetworkDataTaskSoup::NetworkDataTaskSoup):
1813         (WebKit::NetworkDataTaskSoup::~NetworkDataTaskSoup):
1814         (WebKit::NetworkDataTaskSoup::suggestedFilename):
1815         (WebKit::NetworkDataTaskSoup::setPendingDownloadLocation):
1816         (WebKit::NetworkDataTaskSoup::createRequest):
1817         (WebKit::NetworkDataTaskSoup::clearRequest):
1818         (WebKit::NetworkDataTaskSoup::resume):
1819         (WebKit::NetworkDataTaskSoup::suspend):
1820         (WebKit::NetworkDataTaskSoup::cancel):
1821         (WebKit::NetworkDataTaskSoup::invalidateAndCancel):
1822         (WebKit::NetworkDataTaskSoup::state):
1823         (WebKit::NetworkDataTaskSoup::timeoutFired):
1824         (WebKit::NetworkDataTaskSoup::startTimeout):
1825         (WebKit::NetworkDataTaskSoup::stopTimeout):
1826         (WebKit::NetworkDataTaskSoup::sendRequestCallback):
1827         (WebKit::NetworkDataTaskSoup::didSendRequest):
1828         (WebKit::NetworkDataTaskSoup::didReceiveResponse):
1829         (WebKit::NetworkDataTaskSoup::tlsErrorsChangedCallback):
1830         (WebKit::NetworkDataTaskSoup::tlsErrorsChanged):
1831         (WebKit::NetworkDataTaskSoup::applyAuthenticationToRequest):
1832         (WebKit::NetworkDataTaskSoup::authenticateCallback):
1833         (WebKit::NetworkDataTaskSoup::authenticate):
1834         (WebKit::NetworkDataTaskSoup::continueAuthenticate):
1835         (WebKit::NetworkDataTaskSoup::skipInputStreamForRedirectionCallback):
1836         (WebKit::NetworkDataTaskSoup::skipInputStreamForRedirection):
1837         (WebKit::NetworkDataTaskSoup::didFinishSkipInputStreamForRedirection):
1838         (WebKit::NetworkDataTaskSoup::shouldStartHTTPRedirection):
1839         (WebKit::NetworkDataTaskSoup::continueHTTPRedirection):
1840         (WebKit::NetworkDataTaskSoup::readCallback):
1841         (WebKit::NetworkDataTaskSoup::read):
1842         (WebKit::NetworkDataTaskSoup::didRead):
1843         (WebKit::NetworkDataTaskSoup::didFinishRead):
1844         (WebKit::NetworkDataTaskSoup::requestNextPartCallback):
1845         (WebKit::NetworkDataTaskSoup::requestNextPart):
1846         (WebKit::NetworkDataTaskSoup::didRequestNextPart):
1847         (WebKit::NetworkDataTaskSoup::didFinishRequestNextPart):
1848         (WebKit::NetworkDataTaskSoup::gotHeadersCallback):
1849         (WebKit::NetworkDataTaskSoup::didGetHeaders):
1850         (WebKit::NetworkDataTaskSoup::wroteBodyDataCallback):
1851         (WebKit::NetworkDataTaskSoup::didWriteBodyData):
1852         (WebKit::NetworkDataTaskSoup::download):
1853         (WebKit::NetworkDataTaskSoup::writeDownloadCallback):
1854         (WebKit::NetworkDataTaskSoup::writeDownload):
1855         (WebKit::NetworkDataTaskSoup::didWriteDownload):
1856         (WebKit::NetworkDataTaskSoup::didFinishDownload):
1857         (WebKit::NetworkDataTaskSoup::didFailDownload):
1858         (WebKit::NetworkDataTaskSoup::cleanDownloadFiles):
1859         (WebKit::NetworkDataTaskSoup::didFail):
1860         (WebKit::NetworkDataTaskSoup::networkEventCallback):
1861         (WebKit::NetworkDataTaskSoup::networkEvent):
1862         (WebKit::NetworkDataTaskSoup::startingCallback):
1863         (WebKit::NetworkDataTaskSoup::requestStartedCallback):
1864         (WebKit::NetworkDataTaskSoup::didStartRequest):
1865         (WebKit::NetworkDataTaskSoup::restartedCallback):
1866         (WebKit::NetworkDataTaskSoup::didRestart):
1867         * NetworkProcess/soup/NetworkDataTaskSoup.h: Added.
1868         * NetworkProcess/soup/NetworkSessionSoup.cpp:
1869         (WebKit::NetworkSessionSoup::NetworkSessionSoup):
1870         (WebKit::NetworkSessionSoup::~NetworkSessionSoup):
1871         (WebKit::NetworkSessionSoup::soupSession):
1872         (WebKit::NetworkSessionSoup::invalidateAndCancel):
1873         * NetworkProcess/soup/NetworkSessionSoup.h: Added.
1874         * NetworkProcess/soup/RemoteNetworkingContextSoup.cpp:
1875         (WebKit::RemoteNetworkingContext::ensurePrivateBrowsingSession): Update to new NetworkSession::create() API.
1876         * PlatformEfl.cmake: Add new files to compilation.
1877         * PlatformGTK.cmake: Ditto.
1878         * WebKit2.xcodeproj/project.pbxproj: Ditto.
1879         * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm:
1880         (WebKit::WebFrameNetworkingContext::ensurePrivateBrowsingSession): Update to new NetworkSession::create() API.
1881         * WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.cpp:
1882         (WebKit::WebFrameNetworkingContext::ensurePrivateBrowsingSession): Ditto.
1883
1884 2016-10-25  Antti Koivisto  <antti@apple.com>
1885
1886         Add support for introducing simulated latency in network process
1887         https://bugs.webkit.org/show_bug.cgi?id=163902
1888
1889         Reviewed by Alex Christensen.
1890
1891         For testing purposes it is useful to have a mechanism for simulating high latency.
1892         This patch adds a basic mechanism that introduces a delay to each response in network
1893         process. In Safari it can be used with
1894
1895              defaults write com.apple.Safari WebKitNetworkLoadThrottleLatencyMilliseconds 200
1896
1897         Setting the delay to 0 disables the feature.
1898
1899         * NetworkProcess/NetworkLoad.cpp:
1900         (WebKit::NetworkLoad::Throttle::Throttle):
1901         (WebKit::NetworkLoad::didReceiveResponseNetworkSession):
1902         (WebKit::NetworkLoad::notifyDidReceiveResponse):
1903         (WebKit::NetworkLoad::didReceiveData):
1904         (WebKit::NetworkLoad::didCompleteWithError):
1905         (WebKit::NetworkLoad::throttleDelayCompleted):
1906         * NetworkProcess/NetworkLoad.h:
1907         * NetworkProcess/NetworkProcess.cpp:
1908         (WebKit::NetworkProcess::initializeNetworkProcess):
1909         * NetworkProcess/NetworkProcess.h:
1910         (WebKit::NetworkProcess::loadThrottleLatency):
1911         * NetworkProcess/NetworkProcessCreationParameters.cpp:
1912         (WebKit::NetworkProcessCreationParameters::encode):
1913         (WebKit::NetworkProcessCreationParameters::decode):
1914         * NetworkProcess/NetworkProcessCreationParameters.h:
1915         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
1916         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
1917
1918 2016-10-24  Dan Bernstein  <mitz@apple.com>
1919
1920         REGRESSION (r206410): Sandbox violations beneath WebProcessProxy::platformIsBeingDebugged
1921         https://bugs.webkit.org/show_bug.cgi?id=163879
1922         <rdar://problem/28728735>
1923
1924         Reviewed by Darin Adler.
1925
1926         * UIProcess/Cocoa/WebProcessProxyCocoa.mm:
1927         (WebKit::WebProcessProxy::platformIsBeingDebugged): Check if the current process, which is
1928           the UI process, is sandboxed before trying to find out if the Web process is being
1929           debugged.
1930
1931 2016-10-21  Alex Christensen  <achristensen@webkit.org>
1932
1933         URL::port should return Optional<uint16_t>
1934         https://bugs.webkit.org/show_bug.cgi?id=163806
1935
1936         Reviewed by Darin Adler.
1937
1938         * NetworkProcess/mac/NetworkProcessMac.mm:
1939         (WebKit::overrideSystemProxies):
1940         * Shared/API/APISecurityOrigin.h:
1941         (API::SecurityOrigin::create):
1942         * Shared/API/APIURL.h:
1943         (API::URL::protocol):
1944         * Shared/API/c/WKSecurityOriginRef.cpp:
1945         (WKSecurityOriginGetPort):
1946         * UIProcess/API/Cocoa/WKSecurityOrigin.mm:
1947         (-[WKSecurityOrigin port]):
1948         * WebProcess/WebPage/WebPage.cpp:
1949         (WebKit::WebPage::canHandleRequest):
1950         * WebProcess/cocoa/WebProcessCocoa.mm:
1951         (WebKit::origin):
1952
1953 2016-10-24  Eric Carlson  <eric.carlson@apple.com>
1954
1955         [MediaStream] Separate media capture and audio playback muting
1956         https://bugs.webkit.org/show_bug.cgi?id=163855
1957         <rdar://problem/28827186>
1958
1959         Reviewed by Darin Adler.
1960
1961         * Shared/WebPageCreationParameters.h: Change 'muted' from bool to MutedStateFlags.
1962
1963         * UIProcess/API/C/WKPage.cpp: Change parameter from bool to WKMediaMutedState.
1964         (WKPageSetMuted):
1965         * UIProcess/API/C/WKPagePrivate.h: Define WKMediaMutedState.
1966
1967         * UIProcess/WebPageProxy.cpp:
1968         (WebKit::WebPageProxy::WebPageProxy):
1969         (WebKit::WebPageProxy::setMuted): m_muted -> m_mutedState.
1970         (WebKit::WebPageProxy::creationParameters): Ditto.
1971         * UIProcess/WebPageProxy.h:
1972
1973         * WebProcess/Plugins/PluginView.cpp:
1974         (WebKit::PluginView::isMuted): page.isMuted -> page.mutedState.
1975
1976         * WebProcess/WebPage/WebPage.messages.in: Change SetMuted parameter.
1977
1978 2016-10-24  Youenn Fablet  <youenn@apple.com>
1979
1980         Activate WEB_RTC compilation flags for Mac bots
1981         https://bugs.webkit.org/show_bug.cgi?id=163886
1982
1983         Reviewed by Eric Carlson.
1984
1985         * Configurations/FeatureDefines.xcconfig:
1986
1987 2016-10-24  Brady Eidson  <beidson@apple.com>
1988
1989         IndexedDB 2.0: Support IDBIndex name assignment.
1990         <rdar://problem/28806932> and https://bugs.webkit.org/show_bug.cgi?id=163805
1991
1992         Reviewed by Alex Christensen.
1993
1994         * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.cpp:
1995         (WebKit::WebIDBConnectionToClient::didRenameIndex):
1996         (WebKit::WebIDBConnectionToClient::renameIndex):
1997         * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.h:
1998         * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.messages.in:
1999
2000         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
2001         (WebKit::WebIDBConnectionToServer::renameIndex):
2002         (WebKit::WebIDBConnectionToServer::didRenameIndex):
2003         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h:
2004         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.messages.in:
2005
2006 2016-10-23  Michael Catanzaro  <mcatanzaro@igalia.com>
2007
2008         [GTK] Remove DO NOT MODIFY headers from files that are no longer autogenerated
2009         https://bugs.webkit.org/show_bug.cgi?id=163867
2010
2011         Reviewed by Darin Adler.
2012
2013         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMAttr.cpp:
2014         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMAttr.h:
2015         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMAttrPrivate.h:
2016         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMBlob.cpp:
2017         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMBlob.h:
2018         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMBlobPrivate.h:
2019         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCDATASection.cpp:
2020         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCDATASection.h:
2021         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCDATASectionPrivate.h:
2022         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSRule.h:
2023         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSRuleList.cpp:
2024         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSRuleList.h:
2025         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSRuleListPrivate.h:
2026         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSRulePrivate.h:
2027         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSStyleDeclaration.h:
2028         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSStyleDeclarationPrivate.h:
2029         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSStyleSheet.h:
2030         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSStyleSheetPrivate.h:
2031         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSValue.h:
2032         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSValuePrivate.h:
2033         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCharacterData.cpp:
2034         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCharacterData.h:
2035         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCharacterDataPrivate.h:
2036         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMComment.cpp:
2037         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMComment.h:
2038         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCommentPrivate.h:
2039         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMImplementation.h:
2040         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMImplementationPrivate.h:
2041         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMSelection.cpp:
2042         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMSelection.h:
2043         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMSelectionPrivate.h:
2044         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMTokenList.cpp:
2045         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMTokenList.h:
2046         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMTokenListPrivate.h:
2047         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMWindow.cpp:
2048         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMWindow.h:
2049         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMWindowPrivate.h:
2050         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMWindowUnstable.h:
2051         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocument.h:
2052         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentFragment.cpp:
2053         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentFragment.h:
2054         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentFragmentPrivate.h:
2055         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentFragmentUnstable.h:
2056         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentPrivate.h:
2057         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentType.cpp:
2058         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentType.h:
2059         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentTypePrivate.h:
2060         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentUnstable.h:
2061         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElement.cpp:
2062         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElement.h:
2063         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElementPrivate.h:
2064         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElementUnstable.h:
2065         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMEvent.cpp:
2066         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMEvent.h:
2067         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMEventPrivate.h:
2068         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMFile.cpp:
2069         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMFile.h:
2070         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMFileList.cpp:
2071         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMFileList.h:
2072         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMFileListPrivate.h:
2073         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMFilePrivate.h:
2074         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAnchorElement.cpp:
2075         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAnchorElement.h:
2076         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAnchorElementPrivate.h:
2077         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAppletElement.cpp:
2078         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAppletElement.h:
2079         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAppletElementPrivate.h:
2080         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAreaElement.cpp:
2081         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAreaElement.h:
2082         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAreaElementPrivate.h:
2083         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBRElement.cpp:
2084         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBRElement.h:
2085         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBRElementPrivate.h:
2086         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBaseElement.cpp:
2087         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBaseElement.h:
2088         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBaseElementPrivate.h:
2089         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBodyElement.cpp:
2090         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBodyElement.h:
2091         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBodyElementPrivate.h:
2092         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLButtonElement.cpp:
2093         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLButtonElement.h:
2094         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLButtonElementPrivate.h:
2095         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLCanvasElement.cpp:
2096         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLCanvasElement.h:
2097         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLCanvasElementPrivate.h:
2098         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLCollection.cpp:
2099         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLCollection.h:
2100         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLCollectionPrivate.h:
2101         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDListElement.cpp:
2102         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDListElement.h:
2103         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDListElementPrivate.h:
2104         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDirectoryElement.cpp:
2105         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDirectoryElement.h:
2106         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDirectoryElementPrivate.h:
2107         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDivElement.cpp:
2108         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDivElement.h:
2109         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDivElementPrivate.h:
2110         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDocument.cpp:
2111         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDocument.h:
2112         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDocumentPrivate.h:
2113         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLElement.cpp:
2114         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLElement.h:
2115         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLElementPrivate.h:
2116         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLElementUnstable.h:
2117         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLEmbedElement.cpp:
2118         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLEmbedElement.h:
2119         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLEmbedElementPrivate.h:
2120         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFieldSetElement.cpp:
2121         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFieldSetElement.h:
2122         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFieldSetElementPrivate.h:
2123         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFontElement.cpp:
2124         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFontElement.h:
2125         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFontElementPrivate.h:
2126         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFormElement.cpp:
2127         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFormElement.h:
2128         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFormElementPrivate.h:
2129         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFrameElement.cpp:
2130         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFrameElement.h:
2131         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFrameElementPrivate.h:
2132         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFrameSetElement.cpp:
2133         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFrameSetElement.h:
2134         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFrameSetElementPrivate.h:
2135         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHRElement.cpp:
2136         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHRElement.h:
2137         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHRElementPrivate.h:
2138         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHeadElement.cpp:
2139         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHeadElement.h:
2140         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHeadElementPrivate.h:
2141         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHeadingElement.cpp:
2142         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHeadingElement.h:
2143         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHeadingElementPrivate.h:
2144         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHtmlElement.cpp:
2145         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHtmlElement.h:
2146         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHtmlElementPrivate.h:
2147         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLIFrameElement.cpp:
2148         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLIFrameElement.h:
2149         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLIFrameElementPrivate.h:
2150         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLImageElement.cpp:
2151         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLImageElement.h:
2152         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLImageElementPrivate.h:
2153         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLInputElement.cpp:
2154         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLInputElement.h:
2155         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLInputElementPrivate.h:
2156         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLIElement.cpp:
2157         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLIElement.h:
2158         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLIElementPrivate.h:
2159         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLabelElement.cpp:
2160         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLabelElement.h:
2161         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLabelElementPrivate.h:
2162         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLegendElement.cpp:
2163         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLegendElement.h:
2164         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLegendElementPrivate.h:
2165         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLinkElement.cpp:
2166         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLinkElement.h:
2167         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLinkElementPrivate.h:
2168         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMapElement.cpp:
2169         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMapElement.h:
2170         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMapElementPrivate.h:
2171         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMarqueeElement.cpp:
2172         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMarqueeElement.h:
2173         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMarqueeElementPrivate.h:
2174         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMenuElement.cpp:
2175         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMenuElement.h:
2176         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMenuElementPrivate.h:
2177         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMetaElement.cpp:
2178         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMetaElement.h:
2179         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMetaElementPrivate.h:
2180         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLModElement.cpp:
2181         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLModElement.h:
2182         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLModElementPrivate.h:
2183         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOListElement.cpp:
2184         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOListElement.h:
2185         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOListElementPrivate.h:
2186         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLObjectElement.cpp:
2187         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLObjectElement.h:
2188         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLObjectElementPrivate.h:
2189         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptGroupElement.cpp:
2190         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptGroupElement.h:
2191         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptGroupElementPrivate.h:
2192         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptionElement.cpp:
2193         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptionElement.h:
2194         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptionElementPrivate.h:
2195         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptionsCollection.cpp:
2196         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptionsCollection.h:
2197         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptionsCollectionPrivate.h:
2198         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLParagraphElement.cpp:
2199         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLParagraphElement.h:
2200         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLParagraphElementPrivate.h:
2201         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLParamElement.cpp:
2202         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLParamElement.h:
2203         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLParamElementPrivate.h:
2204         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLPreElement.cpp:
2205         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLPreElement.h:
2206         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLPreElementPrivate.h:
2207         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLPrivate.cpp:
2208         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLQuoteElement.cpp:
2209         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLQuoteElement.h:
2210         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLQuoteElementPrivate.h:
2211         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLScriptElement.cpp:
2212         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLScriptElement.h:
2213         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLScriptElementPrivate.h:
2214         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLSelectElement.cpp:
2215         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLSelectElement.h:
2216         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLSelectElementPrivate.h:
2217         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLStyleElement.cpp:
2218         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLStyleElement.h:
2219         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLStyleElementPrivate.h:
2220         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableCaptionElement.cpp:
2221         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableCaptionElement.h:
2222         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableCaptionElementPrivate.h:
2223         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableCellElement.cpp:
2224         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableCellElement.h:
2225         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableCellElementPrivate.h:
2226         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableColElement.cpp:
2227         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableColElement.h:
2228         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableColElementPrivate.h:
2229         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableElement.cpp:
2230         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableElement.h:
2231         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableElementPrivate.h:
2232         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableRowElement.cpp:
2233         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableRowElement.h:
2234         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableRowElementPrivate.h:
2235         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableSectionElement.cpp:
2236         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableSectionElement.h:
2237         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableSectionElementPrivate.h:
2238         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTextAreaElement.cpp:
2239         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTextAreaElement.h:
2240         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTextAreaElementPrivate.h:
2241         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTitleElement.cpp:
2242         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTitleElement.h:
2243         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTitleElementPrivate.h:
2244         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLUListElement.cpp:
2245         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLUListElement.h:
2246         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLUListElementPrivate.h:
2247         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMKeyboardEvent.cpp:
2248         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMKeyboardEvent.h:
2249         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMKeyboardEventPrivate.h:
2250         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMMediaList.h:
2251         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMMediaListPrivate.h:
2252         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMMouseEvent.cpp:
2253         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMMouseEvent.h:
2254         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMMouseEventPrivate.h:
2255         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNamedNodeMap.cpp:
2256         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNamedNodeMap.h:
2257         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNamedNodeMapPrivate.h:
2258         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNode.h:
2259         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodeIterator.cpp:
2260         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodeIterator.h:
2261         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodeIteratorPrivate.h:
2262         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodeList.cpp:
2263         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodeList.h:
2264         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodeListPrivate.h:
2265         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodePrivate.h:
2266         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMProcessingInstruction.cpp:
2267         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMProcessingInstruction.h:
2268         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMProcessingInstructionPrivate.h:
2269         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMRange.cpp:
2270         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMRange.h:
2271         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMRangePrivate.h:
2272         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMRangeUnstable.h:
2273         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMStyleSheet.cpp:
2274         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMStyleSheet.h:
2275         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMStyleSheetList.cpp:
2276         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMStyleSheetList.h:
2277         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMStyleSheetListPrivate.h:
2278         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMStyleSheetPrivate.h:
2279         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMText.cpp:
2280         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMText.h:
2281         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMTextPrivate.h:
2282         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMTreeWalker.cpp:
2283         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMTreeWalker.h:
2284         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMTreeWalkerPrivate.h:
2285         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMUIEvent.cpp:
2286         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMUIEvent.h:
2287         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMUIEventPrivate.h:
2288         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMWheelEvent.cpp:
2289         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMWheelEvent.h:
2290         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMWheelEventPrivate.h:
2291         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMXPathExpression.cpp:
2292         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMXPathExpression.h:
2293         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMXPathExpressionPrivate.h:
2294         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMXPathNSResolverPrivate.h:
2295         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMXPathResult.cpp:
2296         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMXPathResult.h:
2297         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMXPathResultPrivate.h:
2298         * WebProcess/InjectedBundle/API/gtk/DOM/webkitdom.h:
2299         * WebProcess/InjectedBundle/API/gtk/DOM/webkitdomautocleanups.h:
2300         * WebProcess/InjectedBundle/API/gtk/DOM/webkitdomdefines.h:
2301
2302 2016-10-23  Chris Dumez  <cdumez@apple.com>
2303
2304         Another unreviewed attempt to fix the WatchOS / TvOS build after r207585.
2305         <rdar://problem/28902292>
2306
2307         Disable USE_CFURLCONNECTION on newer WatchOS / TvOS.
2308
2309         * config.h:
2310
2311 2016-10-23  Chris Dumez  <cdumez@apple.com>
2312
2313         Unreviewed attempt to fix WatchOS / TvOS build after r207585.
2314         <rdar://problem/28902292>
2315
2316         Enable NETWORK_SESSION on those platforms.
2317
2318         * config.h:
2319
2320 2016-10-22  Dan Bernstein  <mitz@apple.com>
2321
2322         [iOS] _webViewWillEndNavigationGesture:withNavigationToBackForwardListItem: is never called
2323         https://bugs.webkit.org/show_bug.cgi?id=163758
2324
2325         Reviewed by Darin Adler.
2326
2327         * UIProcess/ios/ViewGestureControllerIOS.mm:
2328         (WebKit::ViewGestureController::beginSwipeGesture): Don’t reset the interactive update
2329           handler.
2330
2331 2016-10-21  David Kilzer  <ddkilzer@apple.com>
2332
2333         Bug 163762: IntSize::area() should used checked arithmetic
2334         <https://webkit.org/b/163762>
2335
2336         Reviewed by Darin Adler.
2337
2338         * Shared/ShareableBitmap.cpp:
2339         (WebKit::ShareableBitmap::create): Add overflow check and return
2340         nullptr on overflow.
2341         (WebKit::ShareableBitmap::createShareable): Ditto.
2342         (WebKit::ShareableBitmap::create): Change debug assert for
2343         adequate buffer size check into release check.
2344         * Shared/ShareableBitmap.h:
2345         (WebKit::ShareableBitmap::numBytesForSize): Change to return a
2346         Checked<unsigned, RecordOverflow> value.
2347         (WebKit::ShareableBitmap::sizeInBytes):
2348         * Shared/cairo/ShareableBitmapCairo.cpp:
2349         (WebKit::ShareableBitmap::numBytesForSize): Ditto.
2350         * UIProcess/API/Cocoa/WKWebView.mm:
2351         (-[WKWebView _takeViewSnapshot]): Call unsafeGet().
2352
2353 2016-10-21  Eric Carlson  <eric.carlson@apple.com>
2354
2355         [MediaStream] Dynamically generate media capture sandbox extensions
2356         https://bugs.webkit.org/show_bug.cgi?id=154861
2357         <rdar://problem/24909411>
2358
2359         Reviewed by Tim Horton.
2360
2361         * Shared/SandboxExtension.h:
2362         (WebKit::SandboxExtension::createHandleForGenericExtension):
2363         * Shared/mac/SandboxExtensionMac.mm:
2364         (WebKit::wkSandboxExtensionType): Add case for generic handle.
2365         (WebKit::SandboxExtension::createHandleForGenericExtension): New.
2366
2367         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
2368         (WebKit::UserMediaPermissionRequestManagerProxy::invalidateRequests): Clear the list of extensions granted.
2369         (WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasGranted): Extend the web 
2370           process sandbox as necessary.
2371         * UIProcess/UserMediaPermissionRequestManagerProxy.h:
2372
2373         * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
2374         (WebKit::UserMediaPermissionRequestManager::~UserMediaPermissionRequestManager): Revoke all
2375           sandbox extensions.
2376         (WebKit::UserMediaPermissionRequestManager::grantUserMediaDevicesSandboxExtension): Consume
2377           sandbox extensions.
2378         * WebProcess/MediaStream/UserMediaPermissionRequestManager.h:
2379
2380         * WebProcess/WebPage/WebPage.cpp:
2381         (WebKit::WebPage::grantUserMediaDevicesSandboxExtension): Pass-through to user media manager.
2382         * WebProcess/WebPage/WebPage.h:
2383
2384         * WebProcess/WebPage/WebPage.messages.in: Add GrantUserMediaDevicesSandboxExtension.
2385
2386         * WebProcess/com.apple.WebProcess.sb.in: Add rules, defines, and a macro to allow dynamic extensions
2387           for media capture devices.
2388
2389 2016-10-21  Gavin Barraclough  <barraclough@apple.com>
2390
2391         WebPageProxy should not need PageActivityState
2392         https://bugs.webkit.org/show_bug.cgi?id=163821
2393
2394         Reviewed by Geoff Garen.
2395
2396         The PageActivityState is currently plumbed back from WebCore up to the UI process, to
2397         determine whether to enabled process suppression. However the information it contains
2398         (whether a page load is ongoing, whether audio is playing) is already available via
2399         other means. Remove this use of PageActivityState.
2400
2401         * UIProcess/PageLoadState.cpp:
2402         (WebKit::PageLoadState::commitChanges):
2403             - PageLoadState notifies WebPageProxy when loading state changes.
2404         * UIProcess/WebPageProxy.cpp:
2405         (WebKit::WebPageProxy::updateThrottleState):
2406             - Now relies on info from PageLoadState, setMuted, isPlayingMediaDidChange.
2407         (WebKit::WebPageProxy::setMuted):
2408         (WebKit::WebPageProxy::isPlayingMediaDidChange):
2409             - If audio playback state changes we may need to update the throttle state.
2410         (WebKit::WebPageProxy::setPageActivityState): Deleted.
2411             - removed PageActivityState from WK2.
2412         * UIProcess/WebPageProxy.h:
2413         (WebKit::WebPageProxy::isLoadingChanged):
2414             - PageLoadState notifies WebPageProxy when loading state changes.
2415         * UIProcess/WebPageProxy.messages.in:
2416             - removed PageActivityState from WK2.
2417         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2418         (WebKit::WebChromeClient::setPageActivityState): Deleted.
2419             - removed PageActivityState from WK2.
2420         * WebProcess/WebCoreSupport/WebChromeClient.h:
2421             - removed PageActivityState from WK2.
2422         * WebProcess/WebPage/WebPage.cpp:
2423         (WebKit::WebPage::setPageActivityState): Deleted.
2424             - removed PageActivityState from WK2.
2425         * WebProcess/WebPage/WebPage.h:
2426             - removed PageActivityState from WK2.
2427
2428 2016-10-21  Gavin Barraclough  <barraclough@apple.com>
2429
2430         WebPage should take UserActivity directly for user input
2431         https://bugs.webkit.org/show_bug.cgi?id=163813
2432
2433         Reviewed by Anders Carlsson.
2434
2435         When we receive mouse/keyboard events in a page, we want to prevent AppNap. We currently do so
2436         via the PageThrottler. This patch is to just make the WebPage drive the UserActivity directly.
2437
2438         Two reasons to do so: (1) to cleanup & simplify for further refactoring. (2) The current code
2439         isn't really achieving the desired effect. The page setting the flag in the throttler to get
2440         the activity to be set is now a less effective way of achieving this goal, since the
2441         PageActivityState bounces back across to the UI process & then messages back to the WebContent
2442         process to take the UserActivity. These extra hops defeat the purpose of making sure the boost
2443         from the initial message isn't lost.
2444
2445         * WebProcess/WebPage/WebPage.cpp:
2446         (WebKit::m_userActivityHysteresis):
2447             - m_userActivityHysteresis triggers updateUserActivity.
2448         (WebKit::WebPage::setPageSuppressed):
2449             - setPageSuppressed starts/stops m_userActivityHysteresis.
2450         (WebKit::WebPage::updateUserActivity):
2451             - update UserActivity based on state of m_userActivityHysteresis.
2452         (WebKit::WebPage::mouseEvent):
2453         (WebKit::WebPage::wheelEvent):
2454         (WebKit::WebPage::keyEvent):
2455             - input events impulse m_userActivityHysteresis.
2456         * WebProcess/WebPage/WebPage.h:
2457
2458 2016-10-21  Wenson Hsieh  <wenson_hsieh@apple.com>
2459
2460         Support (insertFrom|deleteBy)Composition and (insert|delete)CompositionText inputTypes for InputEvents
2461         https://bugs.webkit.org/show_bug.cgi?id=163460
2462         <rdar://problem/28784142>
2463
2464         Reviewed by Darin Adler.
2465
2466         Handle new EditAction types for inserting/deleting pending/final compositions.
2467
2468         * UIProcess/WebEditCommandProxy.cpp:
2469         (WebKit::WebEditCommandProxy::nameForEditAction):
2470
2471 2016-10-21  Jeremy Jones  <jeremyj@apple.com>
2472
2473         Implement basic pointer lock behavior for WebKit and WebKit2.
2474         https://bugs.webkit.org/show_bug.cgi?id=162745
2475
2476         Reviewed by Simon Fraser.
2477
2478         Enable basic pointer lock functionality by plumbing requests through WebPage IPC.
2479         Pass through mouse movement deltas.
2480         Unlock pointer when view is no longer visible.
2481
2482         * Shared/WebEventConversion.cpp:
2483         (WebKit::WebKit2PlatformMouseEvent::WebKit2PlatformMouseEvent): Pass along mouse movement.
2484         * UIProcess/WebPageProxy.cpp:
2485         (WebKit::WebPageProxy::dispatchViewStateChange): Unlock pointer when page is not visible.
2486         (WebKit::WebPageProxy::requestPointerLock): Hide and disassociate pointer.
2487         (WebKit::WebPageProxy::requestPointerUnlock): Show and associate pointer.
2488         * UIProcess/WebPageProxy.h:
2489         * UIProcess/WebPageProxy.messages.in: Add methods.
2490         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2491         (WebKit::WebChromeClient::requestPointerLock): Pass along to web page.
2492         (WebKit::WebChromeClient::requestPointerUnlock): Ditto.
2493         * WebProcess/WebCoreSupport/WebChromeClient.h:
2494         * WebProcess/WebPage/WebPage.cpp:
2495         (WebKit::WebPage::didAcquirePointerLock): Forward to PointerLockController.
2496         (WebKit::WebPage::didNotAcquirePointerLock): Ditto.
2497         (WebKit::WebPage::didLosePointerLock): Ditto.
2498         * WebProcess/WebPage/WebPage.h:
2499         * WebProcess/WebPage/WebPage.messages.in: Add methods.
2500
2501 2016-10-21  Wenson Hsieh  <wenson_hsieh@apple.com>
2502
2503         Implement InputEvent.getTargetRanges() for the input events spec
2504         https://bugs.webkit.org/show_bug.cgi?id=162947
2505         <rdar://problem/28853079>
2506
2507         Reviewed by Darin Adler.
2508
2509         Boilerplate change to add a runtime guard for InputEvents-related IDL interfaces. See WebCore ChangeLog entry
2510         for more details.
2511
2512         * WebProcess/WebPage/WebPage.cpp:
2513         (WebKit::WebPage::updatePreferences):
2514
2515 2016-10-20  Carlos Garcia Campos  <cgarcia@igalia.com>
2516
2517         [GTK] Configures but fails to link with ENABLE_OPENGL=OFF
2518         https://bugs.webkit.org/show_bug.cgi?id=163449
2519
2520         Reviewed by Michael Catanzaro.
2521
2522         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
2523         (webkitWebViewBaseRealize): Check TEXTURE_MAPPER_GL instead of TEXTURE_MAPPER and also ensure the current
2524         display is X11.
2525         (webkitWebViewBaseUnrealize): Ditto.
2526         (webkitWebViewBaseDidRelaunchWebProcess): Check TEXTURE_MAPPER_GL instead of TEXTURE_MAPPER.
2527         (webkitWebViewBasePageClosed): Ditto.
2528         * UIProcess/AcceleratedDrawingAreaProxy.cpp:
2529         (WebKit::AcceleratedDrawingAreaProxy::didUpdateBackingStoreState): Ditto.
2530         (WebKit::AcceleratedDrawingAreaProxy::waitForAndDispatchDidUpdateBackingStoreState): Check EGL is enabled before
2531         trying to use the WaylandCompositor.
2532         * UIProcess/AcceleratedDrawingAreaProxy.h:
2533         * UIProcess/WebProcessPool.cpp:
2534         (WebKit::WebProcessPool::createNewWebProcess): Ditto.
2535         * UIProcess/gtk/AcceleratedBackingStore.cpp:
2536         (WebKit::AcceleratedBackingStore::create): Ditto.
2537         * UIProcess/gtk/AcceleratedBackingStoreWayland.cpp:
2538         * UIProcess/gtk/WaylandCompositor.cpp:
2539         * UIProcess/gtk/WaylandCompositor.h:
2540         * WebProcess/WebPage/AcceleratedDrawingArea.cpp:
2541         (WebKit::AcceleratedDrawingArea::enterAcceleratedCompositingMode): Check TEXTURE_MAPPER_GL instead of TEXTURE_MAPPER.
2542         * WebProcess/WebPage/AcceleratedDrawingArea.h:
2543         * WebProcess/WebPage/DrawingArea.h:
2544         * WebProcess/WebPage/DrawingArea.messages.in:
2545         * WebProcess/WebPage/LayerTreeHost.h:
2546
2547 2016-10-20  Chris Dumez  <cdumez@apple.com>
2548
2549         "Download Linked File" context menu action should use 'download' attribute as suggested filename
2550         https://bugs.webkit.org/show_bug.cgi?id=163742
2551         <rdar://problem/28840734>
2552
2553         Reviewed by Darin Adler.
2554
2555         Update "Download Linked File" context menu action to use the anchor
2556         element's 'download' attribute as suggested filename for the download.
2557
2558         * NetworkProcess/NetworkProcess.cpp:
2559         (WebKit::NetworkProcess::downloadRequest):
2560         * NetworkProcess/NetworkProcess.h:
2561         * NetworkProcess/NetworkProcess.messages.in:
2562         * Shared/WebHitTestResultData.cpp:
2563         (WebKit::WebHitTestResultData::WebHitTestResultData):
2564         (WebKit::WebHitTestResultData::encode):
2565         (WebKit::WebHitTestResultData::decode):
2566         * Shared/WebHitTestResultData.h:
2567         * UIProcess/WebPageProxy.cpp:
2568         (WebKit::WebPageProxy::contextMenuItemSelected):
2569         * UIProcess/WebProcessPool.cpp:
2570         (WebKit::WebProcessPool::download):
2571         * UIProcess/WebProcessPool.h:
2572         * WebProcess/InjectedBundle/InjectedBundleHitTestResult.cpp:
2573         (WebKit::InjectedBundleHitTestResult::linkSuggestedFilename):
2574
2575 2016-10-19  Myles C. Maxfield  <mmaxfield@apple.com>
2576
2577         [macOS] [iOS] Disable variation fonts on macOS El Capitan and iOS 9
2578         https://bugs.webkit.org/show_bug.cgi?id=163374
2579
2580         Reviewed by Darin Adler.
2581
2582         * Configurations/FeatureDefines.xcconfig:
2583
2584 2016-10-20  Brady Eidson  <beidson@apple.com>
2585
2586         IndexedDB 2.0: Support IDBObjectStore name assignment.
2587         <rdar://problem/28806931> and https://bugs.webkit.org/show_bug.cgi?id=163749
2588
2589         Reviewed by Alex Christensen.
2590
2591         * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.cpp:
2592         (WebKit::WebIDBConnectionToClient::didRenameObjectStore):
2593         (WebKit::WebIDBConnectionToClient::renameObjectStore):
2594         * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.h:
2595         * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.messages.in:
2596
2597         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
2598         (WebKit::WebIDBConnectionToServer::renameObjectStore):
2599         (WebKit::WebIDBConnectionToServer::didRenameObjectStore):
2600         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h:
2601         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.messages.in:
2602
2603 2016-10-20  Carlos Garcia Campos  <cgarcia@igalia.com>
2604
2605         [GTK] Avoid strstr() when checking (E)GL extensions
2606         https://bugs.webkit.org/show_bug.cgi?id=161958
2607
2608         Reviewed by Žan Doberšek.
2609
2610         Use GLContext::isExtensionSupported() instead of strstr().
2611
2612         * UIProcess/gtk/WaylandCompositor.cpp:
2613         (WebKit::WaylandCompositor::initializeEGL):
2614
2615 2016-10-20  Carlos Garcia Campos  <cgarcia@igalia.com>
2616
2617         Wrong use of EGL_DEPTH_SIZE
2618         https://bugs.webkit.org/show_bug.cgi?id=155536
2619
2620         Reviewed by Michael Catanzaro.
2621
2622         Use XErrorTrapper class instead of the custom XErrorHandler.
2623
2624         * PluginProcess/unix/PluginProcessMainUnix.cpp:
2625         (WebKit::PluginProcessMainUnix):
2626
2627 2016-10-19  Carlos Garcia Campos  <cgarcia@igalia.com>
2628
2629         [SOUP] Add NetworkSession implementation and switch to use it
2630         https://bugs.webkit.org/show_bug.cgi?id=163597
2631
2632         Reviewed by Alex Christensen.
2633
2634         Basically move the ResourceHandle implementation to the network process, but modernized, cleaned up, and adapted
2635         to the NetworkSession model.
2636
2637         * CMakeLists.txt: Add new files to compilation.
2638         * NetworkProcess/Downloads/Download.cpp:
2639         (WebKit::Download::Download): Use the same code for all ports using NetworkSession and add missing
2640         initialization of m_sessionID.
2641         * NetworkProcess/Downloads/Download.h:
2642         (WebKit::Download::Download): Define PlatformDownloadTaskRef on every platform to make the constructor common to
2643         all ports using NetworkSession.
2644         * NetworkProcess/Downloads/soup/DownloadSoup.cpp:
2645         (WebKit::Download::cancelNetworkLoad):
2646         (WebKit::Download::platformDidFinish):
2647         * NetworkProcess/NetworkDataTask.h:
2648         (WebKit::NetworkDataTask::pendingDownloadID): Make const.
2649         (WebKit::NetworkDataTask::pendingDownload): Ditto.
2650         (WebKit::NetworkDataTask::pendingDownloadLocation): Ditto.
2651         (WebKit::NetworkDataTask::isDownload): Helper to check if the task is a download.
2652         * NetworkProcess/NetworkLoad.cpp:
2653         (WebKit::NetworkLoad::didReceiveResponseNetworkSession): Use NetworkDataTask::isDownload().
2654         * NetworkProcess/NetworkProcess.cpp:
2655         (WebKit::NetworkProcess::NetworkProcess): NetworkSession::setCustomProtocolManager() is Cocoa only.
2656         * NetworkProcess/NetworkSession.h:
2657         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
2658         (WebKit::NetworkSession::networkStorageSession): Make const.
2659         * NetworkProcess/soup/NetworkDataTaskSoup.cpp: Added.
2660         (WebKit::NetworkDataTask::NetworkDataTask):
2661         (WebKit::NetworkDataTask::~NetworkDataTask):
2662         (WebKit::NetworkDataTask::scheduleFailure):
2663         (WebKit::NetworkDataTask::failureTimerFired):
2664         (WebKit::NetworkDataTask::suggestedFilename):
2665         (WebKit::NetworkDataTask::setSuggestedFilename):
2666         (WebKit::NetworkDataTask::setPendingDownloadLocation):
2667         (WebKit::NetworkDataTask::allowsSpecificHTTPSCertificateForHost):
2668         (WebKit::NetworkDataTask::createRequest):
2669         (WebKit::NetworkDataTask::clearRequest):
2670         (WebKit::NetworkDataTask::resume):
2671         (WebKit::NetworkDataTask::suspend):
2672         (WebKit::NetworkDataTask::cancel):
2673         (WebKit::NetworkDataTask::invalidateAndCancel):
2674         (WebKit::NetworkDataTask::state):
2675         (WebKit::NetworkDataTask::timeoutFired):
2676         (WebKit::NetworkDataTask::startTimeout):
2677         (WebKit::NetworkDataTask::stopTimeout):
2678         (WebKit::NetworkDataTask::sendRequestCallback):
2679         (WebKit::NetworkDataTask::didSendRequest):
2680         (WebKit::NetworkDataTask::didReceiveResponse):
2681         (WebKit::NetworkDataTask::tlsErrorsChangedCallback):
2682         (WebKit::NetworkDataTask::tlsErrorsChanged):
2683         (WebKit::NetworkDataTask::applyAuthenticationToRequest):
2684         (WebKit::NetworkDataTask::authenticateCallback):
2685         (WebKit::isAuthenticationFailureStatusCode):
2686         (WebKit::NetworkDataTask::authenticate):
2687         (WebKit::NetworkDataTask::continueAuthenticate):
2688         (WebKit::NetworkDataTask::skipInputStreamForRedirectionCallback):
2689         (WebKit::NetworkDataTask::skipInputStreamForRedirection):
2690         (WebKit::NetworkDataTask::didFinishSkipInputStreamForRedirection):
2691         (WebKit::shouldRedirectAsGET):
2692         (WebKit::NetworkDataTask::shouldStartHTTPRedirection):
2693         (WebKit::NetworkDataTask::continueHTTPRedirection):
2694         (WebKit::NetworkDataTask::readCallback):
2695         (WebKit::NetworkDataTask::read):
2696         (WebKit::NetworkDataTask::didRead):
2697         (WebKit::NetworkDataTask::didFinishRead):
2698         (WebKit::NetworkDataTask::requestNextPartCallback):
2699         (WebKit::NetworkDataTask::requestNextPart):
2700         (WebKit::NetworkDataTask::didRequestNextPart):
2701         (WebKit::NetworkDataTask::didFinishRequestNextPart):
2702         (WebKit::NetworkDataTask::gotHeadersCallback):
2703         (WebKit::NetworkDataTask::didGetHeaders):
2704         (WebKit::NetworkDataTask::wroteBodyDataCallback):
2705         (WebKit::NetworkDataTask::didWriteBodyData):
2706         (WebKit::NetworkDataTask::download):
2707         (WebKit::NetworkDataTask::writeDownloadCallback):
2708         (WebKit::NetworkDataTask::writeDownload):
2709         (WebKit::NetworkDataTask::didWriteDownload):
2710         (WebKit::NetworkDataTask::didFinishDownload):
2711         (WebKit::NetworkDataTask::didFailDownload):
2712         (WebKit::NetworkDataTask::cleanDownloadFiles):
2713         (WebKit::NetworkDataTask::didFail):
2714         (WebKit::NetworkDataTask::networkEventCallback):
2715         (WebKit::NetworkDataTask::networkEvent):
2716         (WebKit::NetworkDataTask::startingCallback):
2717         (WebKit::NetworkDataTask::requestStartedCallback):
2718         (WebKit::NetworkDataTask::didStartRequest):
2719         (WebKit::NetworkDataTask::restartedCallback):
2720         (WebKit::NetworkDataTask::didRestart):
2721         * NetworkProcess/soup/NetworkSessionSoup.cpp:
2722         (WebKit::NetworkSession::create):
2723         (WebKit::NetworkSession::defaultSession):
2724         (WebKit::NetworkSession::networkStorageSession):
2725         (WebKit::NetworkSession::NetworkSession):
2726         (WebKit::NetworkSession::~NetworkSession):
2727         (WebKit::NetworkSession::soupSession):
2728         (WebKit::NetworkSession::invalidateAndCancel):
2729         (WebKit::NetworkSession::clearCredentials):
2730         * NetworkProcess/soup/RemoteNetworkingContextSoup.cpp:
2731         (WebKit::RemoteNetworkingContext::ensurePrivateBrowsingSession): Add implementation matching
2732         WebFrameNetworkingContext::ensurePrivateBrowsingSession().
2733         (WebKit::RemoteNetworkingContext::storageSession): Do not always return the default session if the given one is
2734         in the global map.
2735         * PlatformEfl.cmake: Ad new files to compilation.
2736         * PlatformGTK.cmake: Ditto.
2737         * WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.cpp:
2738         (WebKit::WebFrameNetworkingContext::ensurePrivateBrowsingSession): Also create a NetworkSession.
2739         * config.h: Enable NetworkSession unconditionally for Soup based ports.
2740
2741 2016-10-19  Alex Christensen  <achristensen@webkit.org>
2742
2743         Revert r207151
2744         https://bugs.webkit.org/show_bug.cgi?id=163675
2745
2746         Reviewed by Brent Fulgham.
2747
2748         * NetworkProcess/Downloads/Download.h:
2749         * NetworkProcess/Downloads/mac/DownloadMac.mm:
2750         * NetworkProcess/NetworkLoad.h:
2751         * NetworkProcess/mac/NetworkLoadMac.mm:
2752         (WebKit::NetworkLoad::willCacheResponseAsync):
2753         * Shared/Authentication/cocoa/AuthenticationManagerCocoa.mm:
2754         (WebKit::AuthenticationManager::receivedCredential):
2755         (WebKit::AuthenticationManager::receivedRequestToContinueWithoutCredential):
2756         (WebKit::AuthenticationManager::receivedCancellation):
2757         (WebKit::AuthenticationManager::receivedRequestToPerformDefaultHandling):
2758         (WebKit::AuthenticationManager::receivedChallengeRejection):
2759         * Shared/WebProcessCreationParameters.cpp:
2760         (WebKit::WebProcessCreationParameters::encode):
2761         (WebKit::WebProcessCreationParameters::decode):
2762         * Shared/WebProcessCreationParameters.h:
2763         * Shared/mac/WebCoreArgumentCodersMac.mm:
2764         (IPC::ArgumentCoder<ResourceRequest>::encodePlatformData):
2765         (IPC::ArgumentCoder<ResourceRequest>::decodePlatformData):
2766         * WebKit2.xcodeproj/project.pbxproj:
2767
2768 2016-10-19  Chris Dumez  <cdumez@apple.com>
2769
2770         [WK2] Expose suggested filename via WKBundleHitTestResult API
2771         https://bugs.webkit.org/show_bug.cgi?id=163693
2772         <rdar://problem/28840734>
2773
2774         Reviewed by Anders Carlsson.
2775
2776         Expose suggested filename via WKBundleHitTestResult API. The implementation
2777         currently relies on the 'download' attribute on anchor / area elements
2778         that we recently started supporting.
2779
2780         * WebProcess/InjectedBundle/API/c/WKBundleHitTestResult.cpp:
2781         (WKBundleHitTestResultCopyLinkSuggestedFilename):
2782         * WebProcess/InjectedBundle/API/c/WKBundleHitTestResult.h:
2783         * WebProcess/InjectedBundle/InjectedBundleHitTestResult.cpp:
2784         (WebKit::InjectedBundleHitTestResult::create):
2785         (WebKit::InjectedBundleHitTestResult::mediaType):
2786         (WebKit::InjectedBundleHitTestResult::linkSuggestedFilename):
2787         (WebKit::InjectedBundleHitTestResult::imageRect):
2788         * WebProcess/InjectedBundle/InjectedBundleHitTestResult.h:
2789
2790 2016-10-19  Ryan Haddad  <ryanhaddad@apple.com>
2791
2792         Unreviewed, rolling out r207557.
2793
2794         This change caused animations/font-variations tests to time
2795         out on pre-Sierra Macs.
2796
2797         Reverted changeset:
2798
2799         "[macOS] [iOS] Disable variation fonts on macOS El Capitan and
2800         iOS 9"
2801         https://bugs.webkit.org/show_bug.cgi?id=163374
2802         http://trac.webkit.org/changeset/207557
2803
2804 2016-10-19  Andy Estes  <aestes@apple.com>
2805
2806         Crash in ASCIICaseInsensitiveHash::hash() when a response has a null MIME type
2807         https://bugs.webkit.org/show_bug.cgi?id=163476
2808         <rdar://problem/26941395>
2809
2810         Reviewed by Andreas Kling.
2811
2812         When custom content providers are registered and a response has a null MIME type, WebPage
2813         will pass a null String to HashSet::contains(). This results in a null pointer dereference,
2814         since the String hash functions do not support null Strings and unconditionally dereference
2815         their StringImpls. Fixed by checking that Strings are non-null before calling
2816         HashSet::contains() on m_mimeTypesWithCustomContentProviders.
2817
2818         New API test: WebKit2.LoadDataWithNilMIMEType.
2819
2820         * WebProcess/WebPage/WebPage.cpp:
2821         (WebKit::WebPage::shouldUseCustomContentProviderForResponse): Checked if mimeType is null
2822         before calling m_mimeTypesWithCustomContentProviders.contains().
2823         (WebKit::WebPage::canShowMIMEType): Ditto.
2824         * WebProcess/WebPage/WebPage.h: Made private the declaration of canPluginHandleResponse().
2825
2826 2016-10-19  Chris Dumez  <cdumez@apple.com>
2827
2828         Move HTML Interactive Form Validation behind an experimental flag
2829         https://bugs.webkit.org/show_bug.cgi?id=163673
2830
2831         Reviewed by Daniel Bates.
2832
2833         Move HTML Interactive Form Validation behind an experimental feature flag
2834         and disable by default until by have a better UI.
2835
2836         * Shared/WebPreferencesDefinitions.h:
2837         * WebProcess/InjectedBundle/InjectedBundle.cpp:
2838         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
2839
2840 2016-10-19  Damian Kaleta  <dkaleta@apple.com>
2841
2842         https://bugs.webkit.org/show_bug.cgi?id=163292
2843
2844         Reviewed by Brady Eidson.
2845         
2846         Added ability to display context menu asynchronously.
2847
2848         * Shared/API/APIObject.h: Added ContextMenuListener.
2849         * Shared/API/c/WKBase.h: Added WKContextMenuListenerRef struct.
2850         * UIProcess/API/APIContextMenuClient.h:
2851         (API::ContextMenuClient::getContextMenuFromProposedMenuAsync): New method that allows showing context menu asynchronously.
2852         * UIProcess/API/C/WKAPICast.h: Added a new mapping for WebContextMenuListenerProxy.
2853         * UIProcess/API/C/WKContextMenuListener.cpp: Added. New class that allow a client to return results asynchronously.
2854         (WKContextMenuListenerGetTypeID):
2855         (WKContextMenuListenerUseContextMenuItems):
2856         * UIProcess/API/C/WKContextMenuListener.h: Added.
2857         * UIProcess/API/C/WKPage.cpp: Added WKPageContextMenuClientV4.
2858         (WKPageSetPageContextMenuClient):
2859         * UIProcess/API/C/WKPageContextMenuClient.h:
2860         * UIProcess/WebContextMenuListenerProxy.cpp: Copied from Source/WebKit2/UIProcess/mac/WebContextMenuProxyMac.h.
2861         (WebKit::WebContextMenuListenerProxy::WebContextMenuListenerProxy):
2862         (WebKit::WebContextMenuListenerProxy::~WebContextMenuListenerProxy):
2863         (WebKit::WebContextMenuListenerProxy::useContextMenuItems): Passes items to m_contextMenuMac.
2864         (WebKit::WebContextMenuListenerProxy::invalidate):
2865         * UIProcess/WebContextMenuListenerProxy.h: Copied from Source/WebKit2/UIProcess/mac/WebContextMenuProxyMac.h.
2866         (WebKit::WebContextMenuListenerProxy::create):
2867         * UIProcess/mac/WebContextMenuProxyMac.h:
2868         * UIProcess/mac/WebContextMenuProxyMac.mm:
2869         (WebKit::WebContextMenuProxyMac::showContextMenuWithItems): Shows context menu.
2870         (WebKit::WebContextMenuProxyMac::showContextMenu): Extracted some logic to showContextMenuWithItems().
2871         * WebKit2.xcodeproj/project.pbxproj:
2872
2873 2016-10-19  Myles C. Maxfield  <mmaxfield@apple.com>
2874
2875         [macOS] [iOS] Disable variation fonts on macOS El Capitan and iOS 9
2876         https://bugs.webkit.org/show_bug.cgi?id=163374
2877
2878         Reviewed by Darin Adler.
2879
2880         * Configurations/FeatureDefines.xcconfig:
2881
2882 2016-10-19  Darin Adler  <darin@apple.com>
2883
2884         Move XPath from ExceptionCode to Exception
2885         https://bugs.webkit.org/show_bug.cgi?id=163656
2886
2887         Reviewed by Chris Dumez.
2888
2889         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocument.cpp:
2890         (webkit_dom_document_create_expression): Use ExceptionOr.
2891         (webkit_dom_document_evaluate): Ditto.
2892         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMXPathExpression.cpp:
2893         (webkit_dom_xpath_expression_evaluate): Ditto.
2894         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMXPathResult.cpp:
2895         (webkit_dom_xpath_result_iterate_next): Ditto.
2896         (webkit_dom_xpath_result_snapshot_item): Ditto.
2897         (webkit_dom_xpath_result_get_number_value): Ditto.
2898         (webkit_dom_xpath_result_get_string_value): Ditto.
2899         (webkit_dom_xpath_result_get_boolean_value): Ditto.
2900         (webkit_dom_xpath_result_get_single_node_value): Ditto.
2901         (webkit_dom_xpath_result_get_snapshot_length): Ditto.
2902
2903 2016-10-19  Carlos Garcia Campos  <cgarcia@igalia.com>
2904
2905         NetworkSession: updatedRequest parameter of NetworkProcess::findPendingDownloadLocation is unused since r206988
2906         https://bugs.webkit.org/show_bug.cgi?id=163588
2907
2908         Reviewed by Alex Christensen.
2909
2910         The parameter was used only for the DownloadProxy::DidStart message that is no longer sent from
2911         findPendingDownloadLocation since r206988.
2912
2913         * NetworkProcess/NetworkDataTask.h:
2914         (WebKit::NetworkDataTask::currentRequest): Removed since it's unused now.
2915         * NetworkProcess/NetworkLoad.cpp:
2916         (WebKit::NetworkLoad::convertTaskToDownload): Update the m_currentRequest and pass it to DidStart message.
2917         (WebKit::NetworkLoad::didReceiveResponseNetworkSession):
2918         * NetworkProcess/NetworkProcess.cpp:
2919         (WebKit::NetworkProcess::findPendingDownloadLocation):
2920         * NetworkProcess/NetworkProcess.h:
2921         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm: Remove currentRequest() implementation.
2922
2923 2016-10-19  Carlos Garcia Campos  <cgarcia@igalia.com>
2924
2925         Unreviewed. Fix GTK+ build after r207522.
2926
2927         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMWindow.cpp:
2928         (webkit_dom_dom_window_webkit_message_handlers_post_message): Use new exceptions.
2929
2930 2016-10-19  Carlos Garcia Campos  <cgarcia@igalia.com>
2931
2932         Unreviewed. Fix GTK+ build after r207497.
2933
2934         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLSelectElement.cpp:
2935         (webkit_dom_html_select_element_add): Update implementation since add() now takes a Variant.
2936
2937 2016-10-18  Simon Fraser  <simon.fraser@apple.com>
2938
2939         Add a MiniBrowser menu item to apply page scale in WK1 and WK2
2940         https://bugs.webkit.org/show_bug.cgi?id=163627
2941
2942         Reviewed by Dean Jackson.
2943
2944         New SPI to set and retrieve page scale.
2945
2946         * UIProcess/API/Cocoa/WKWebView.mm:
2947         (-[WKWebView _setPageScale:withOrigin:]):
2948         (-[WKWebView _pageScale]):
2949         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2950
2951 2016-10-18  Dean Jackson  <dino@apple.com>
2952
2953         Remove CSS_SHAPES feature definition. This should always be on.
2954         https://bugs.webkit.org/show_bug.cgi?id=163628
2955         <rdar://problem/28834613>
2956
2957         Reviewed by Tim Horton.
2958
2959         * Configurations/FeatureDefines.xcconfig:
2960
2961 2016-10-18  Ryan Haddad  <ryanhaddad@apple.com>
2962
2963         Unreviewed, rolling out r207413.
2964
2965         This change broke iOS builds.
2966
2967         Reverted changeset:
2968
2969         "[iOS] Hook up WebPlatformTouchPoint's radiusX / radiusY to
2970         _UIWebTouchPoint.majorRadiusInScreenCoordinates"
2971         https://bugs.webkit.org/show_bug.cgi?id=163547
2972         http://trac.webkit.org/changeset/207413
2973
2974 2016-10-18  Commit Queue  <commit-queue@webkit.org>
2975
2976         Unreviewed, rolling out r207443.
2977         https://bugs.webkit.org/show_bug.cgi?id=163616
2978
2979         "Caused 5% PLT regression" (Requested by krollin on #webkit).
2980
2981         Reverted changeset:
2982
2983         "Crash in ASCIICaseInsensitiveHash::hash() when a response has
2984         a null MIME type"
2985         https://bugs.webkit.org/show_bug.cgi?id=163476
2986         http://trac.webkit.org/changeset/207443
2987
2988 2016-10-18  Megan Gardner  <megan_gardner@apple.com>
2989
2990         Fix build for platforms where HAVE(LINK_PREVIEW) is false
2991         https://bugs.webkit.org/show_bug.cgi?id=163607
2992
2993         Reviewed by Tim Horton.
2994
2995         Added needed # for link preview
2996
2997         * UIProcess/ios/WKContentViewInteraction.mm:
2998         (-[WKContentView _contentsOfUserInterfaceItem:]):
2999
3000 2016-10-18  Joseph Pecoraro  <pecoraro@apple.com>
3001
3002         Remote Web Inspector: Timeline UI not updating while recording
3003         https://bugs.webkit.org/show_bug.cgi?id=163582
3004         <rdar://problem/28766837>
3005
3006         Reviewed by Timothy Hatcher.
3007
3008         * WebProcess/WebPage/RemoteWebInspectorUI.cpp:
3009         (WebKit::RemoteWebInspectorUI::frontendLoaded):
3010         Local inspector windows keep the web view alive and toggle the
3011         WebInspector.visible state depending on whether or not an inspector is
3012         open. Remote Inspector windows go away when closed, so they can always
3013         be marked as open. This matches earlier remote inspector behavior.
3014
3015 2016-10-18  Eric Carlson  <eric.carlson@apple.com>
3016
3017         [MediaStream] Resolve constraints and enumerate devices in the UI process
3018         https://bugs.webkit.org/show_bug.cgi?id=162147
3019         <rdar://problem/28803569>
3020
3021         Reviewed by Darin Adler.
3022         
3023         Restructure gUM constraint validation and MediaDevices.enumerateDevices so all media device
3024         access happens in the UI process.
3025
3026         * Scripts/webkit/messages.py:
3027         (headers_for_type): Special case MediaConstraintsData.
3028
3029         * Shared/WebCoreArgumentCoders.cpp:
3030         (IPC::encodeMediaTrackConstraintSetMap): MediaTrackConstraintSetMap encoder.
3031         (IPC::ArgumentCoder<MediaConstraintsData>::encode): MediaConstraintsData encoder.
3032         (IPC::decodeMediaTrackConstraintSetMap): MediaTrackConstraintSetMap decoder.
3033         (IPC::ArgumentCoder<MediaConstraintsData>::decode): MediaConstraintsData decoder.
3034         (IPC::ArgumentCoder<CaptureDevice>::encode): CaptureDevice enoder.
3035         (IPC::ArgumentCoder<CaptureDevice>::decode): CaptureDevice decoder.
3036         * Shared/WebCoreArgumentCoders.h:
3037
3038         * UIProcess/API/APIUIClient.h:  Remove UserMediaPermissionCheckProxy forward declaration.
3039
3040         * UIProcess/API/C/WKUserMediaPermissionRequest.cpp:
3041         (toWK): Translate UserMediaPermissionRequestDenialReason to UserMediaAccessDenialReason.
3042         (WKUserMediaPermissionRequestDeny): Add "reason" parameter.
3043         * UIProcess/API/C/WKUserMediaPermissionRequest.h:
3044
3045         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
3046         (WebKit::UserMediaPermissionRequestManagerProxy::invalidateRequests): Invalidate pending device requests.
3047         (WebKit::UserMediaPermissionRequestManagerProxy::createRequest): Make private.
3048         (WebKit::toWebCore): Map from UserMediaAccessDenialReason to MediaAccessDenialReason, cast to
3049           uint64_t to pass to web process.
3050         (WebKit::UserMediaPermissionRequestManagerProxy::denyRequest): Send to web process.
3051         (WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasGranted): Ditto.
3052         (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame): Validate
3053           constraints and make sure gUM is enabled before prompting user.
3054         (WebKit::UserMediaPermissionRequestManagerProxy::enumerateMediaDevicesForFrame): New.
3055         (WebKit::UserMediaPermissionRequestManagerProxy::didCompleteUserMediaPermissionCheck): Send 
3056           results of device enumeration to web process.
3057         (WebKit::UserMediaPermissionRequestManagerProxy::didReceiveUserMediaPermissionDecision): Deleted.
3058         (WebKit::UserMediaPermissionRequestManagerProxy::createUserMediaPermissionCheck): Deleted.
3059         * UIProcess/UserMediaPermissionRequestManagerProxy.h:
3060
3061         * UIProcess/UserMediaPermissionRequestProxy.cpp:
3062         (WebKit::UserMediaPermissionRequestProxy::allow):
3063         (WebKit::UserMediaPermissionRequestProxy::deny): Take "reason" parameter.
3064         * UIProcess/UserMediaPermissionRequestProxy.h:
3065
3066         * UIProcess/WebPageProxy.cpp:
3067         (WebKit::WebPageProxy::requestUserMediaPermissionForFrame):
3068         (WebKit::WebPageProxy::enumerateMediaDevicesForFrame):
3069         (WebKit::WebPageProxy::checkUserMediaPermissionForFrame): Deleted.
3070         * UIProcess/WebPageProxy.h:
3071         * UIProcess/WebPageProxy.messages.in:
3072
3073         * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
3074         (WebKit::UserMediaPermissionRequestManager::startUserMediaRequest): userMediaAccessDenied -> deny.
3075           Pass the audio and video constraints to the UI process.
3076         (WebKit::UserMediaPermissionRequestManager::userMediaAccessWasGranted): 
3077         (WebKit::UserMediaPermissionRequestManager::userMediaAccessWasDenied):
3078         (WebKit::UserMediaPermissionRequestManager::enumerateMediaDevices): Send the enumeration request
3079           to the UI process.
3080         (WebKit::UserMediaPermissionRequestManager::cancelMediaDevicesEnumeration):
3081         (WebKit::UserMediaPermissionRequestManager::didCompleteMediaDeviceEnumeration):
3082         (WebKit::UserMediaPermissionRequestManager::didReceiveUserMediaPermissionDecision): Deleted.
3083         (WebKit::UserMediaPermissionRequestManager::startUserMediaPermissionCheck): Deleted.
3084         (WebKit::UserMediaPermissionRequestManager::cancelUserMediaPermissionCheck): Deleted.
3085         (WebKit::UserMediaPermissionRequestManager::didCompleteUserMediaPermissionCheck): Deleted.
3086         * WebProcess/MediaStream/UserMediaPermissionRequestManager.h:
3087
3088         * WebProcess/WebCoreSupport/WebUserMediaClient.cpp:
3089         (WebKit::WebUserMediaClient::enumerateMediaDevices): New.
3090         (WebKit::WebUserMediaClient::cancelMediaDevicesEnumerationRequest): New.
3091         (WebKit::WebUserMediaClient::checkUserMediaPermission): Deleted.
3092         (WebKit::WebUserMediaClient::cancelUserMediaPermissionCheck): Deleted.
3093         * WebProcess/WebCoreSupport/WebUserMediaClient.h:
3094
3095         * WebProcess/WebPage/WebPage.cpp:
3096         (WebKit::WebPage::userMediaAccessWasGranted): New.
3097         (WebKit::WebPage::userMediaAccessWasDenied): Ditto.
3098         (WebKit::WebPage::didCompleteMediaDeviceEnumeration):
3099         (WebKit::WebPage::didReceiveUserMediaPermissionDecision): Deleted.
3100         (WebKit::WebPage::didCompleteUserMediaPermissionCheck): Deleted.
3101         * WebProcess/WebPage/WebPage.h:
3102         * WebProcess/WebPage/WebPage.messages.in:
3103
3104 2016-10-17  Antti Koivisto  <antti@apple.com>
3105
3106         Rename setNeedsStyleRecalc to invalidateStyle
3107         https://bugs.webkit.org/show_bug.cgi?id=163542
3108
3109         Reviewed by Darin Adler.
3110
3111         * WebProcess/Plugins/PluginView.cpp:
3112         (WebKit::PluginView::didInitializePlugin):
3113         (WebKit::PluginView::pluginProcessCrashed):
3114
3115 2016-10-17  Carlos Garcia Campos  <cgarcia@igalia.com>
3116
3117         NetworkSession: PendingDownload is leaked if canceled before willDecidePendingDownloadDestination
3118         https://bugs.webkit.org/show_bug.cgi?id=163545
3119
3120         Reviewed by Alex Christensen.
3121
3122         If a download started by DownloadManager::startDownload() is cancelled before
3123         DownloadManager::willDecidePendingDownloadDestination() is called, DownloadManager::cancelDownload() does
3124         nothing, because the Download hasn't been created yet and m_downloadsWaitingForDestination map doesn't contain
3125         the download ID, and the PendingDownload is never removed from the m_pendingDownloads map.
3126
3127         * NetworkProcess/Downloads/DownloadManager.cpp:
3128         (WebKit::DownloadManager::cancelDownload): Always take the PendingDownload from m_pendingDownloads map. Then, if
3129         the download was already in m_downloadsWaitingForDestination map, get the network data task to properly cancel
3130         it and then call the completion handler to ignore the request. Otherwise cancel the pending download if exists.
3131         * NetworkProcess/Downloads/PendingDownload.cpp:
3132         (WebKit::PendingDownload::cancel): Cancel the network load and notify the UI process that the download was canceled.
3133         * NetworkProcess/Downloads/PendingDownload.h:
3134
3135 2016-10-17  Megan Gardner  <megan_gardner@apple.com>
3136
3137         Add test and infrastructure for link popover
3138         https://bugs.webkit.org/show_bug.cgi?id=163406
3139
3140         Reviewed by Simon Fraser.
3141
3142         Add infrastructure to see when a link popover appears, and what URL it has loaded.
3143
3144         * UIProcess/API/Cocoa/WKWebView.mm:
3145         (-[WKWebView didShowForcePressPreview]):
3146         (-[WKWebView didDismissForcePressPreview]):
3147         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
3148         * UIProcess/ios/WKContentViewInteraction.mm:
3149         (-[WKContentView _contentsOfUserInterfaceItem:]):
3150         (-[WKContentView _presentedViewControllerForPreviewItemController:]):
3151         (-[WKContentView _previewItemController:didDismissPreview:committing:]):
3152         (-[WKContentView _previewItemControllerDidCancelPreview:]):
3153
3154 2016-10-17  Tim Horton  <timothy_horton@apple.com>
3155
3156         REGRESSION (r169805): WKWebView canGoBack returning YES when nothing is in the back-forward list after restoring session state
3157         https://bugs.webkit.org/show_bug.cgi?id=163573
3158         <rdar://problem/28744549>
3159
3160         Reviewed by Dan Bernstein.
3161
3162         * UIProcess/WebPageProxy.cpp:
3163         (WebKit::WebPageProxy::restoreFromSessionState):
3164         Update PageLoadState's canGoBack/canGoForward bits when restoring from
3165         session state, because in the don't-navigate case, nothing else will make this happen,
3166         and it will remain stale.
3167
3168 2016-10-17  Andy Estes  <aestes@apple.com>
3169
3170         Crash in ASCIICaseInsensitiveHash::hash() when a response has a null MIME type
3171         https://bugs.webkit.org/show_bug.cgi?id=163476
3172         <rdar://problem/26941395>
3173
3174         Reviewed by Tim Horton.
3175
3176         When custom content providers are registered and a response has a null MIME type, WebPage
3177         will pass a null String to HashSet::contains(). This results in a null pointer dereference,
3178         since the String hash functions do not support null Strings and unconditionally dereference
3179         their StringImpls. Fixed by checking that Strings are non-null before calling
3180         HashSet::contains() on m_mimeTypesWithCustomContentProviders.
3181
3182         Rearranging WebPage::shouldUseCustomContentProviderForResponse() to call
3183         canPluginHandleResponse() before checking m_mimeTypesWithCustomContentProviders uncovered a
3184         crash in existing layout tests where WebPage::m_mainFrame can be NULL during WebPage
3185         construction (m_mainFrame isn't yet initialized). Fixed this by passing the main Frame to
3186         canPluginHandleResponseInFrame() instead of relying on m_mainFrame.
3187
3188         New API test: WebKit2.LoadDataWithNilMIMEType.
3189
3190         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3191         (WebKit::WebFrameLoaderClient::transitionToCommittedFromCachedFrame): Passed
3192         m_frame->coreFrame() to shouldUseCustomContentProviderForResponse().
3193         (WebKit::WebFrameLoaderClient::transitionToCommittedForNewPage): Ditto.
3194         * WebProcess/WebPage/WebPage.cpp:
3195         (WebKit::WebPage::canPluginHandleResponse): Added a mainFrame parameter and used it instead
3196         of m_mainFrame->coreFrame().
3197         (WebKit::WebPage::shouldUseCustomContentProviderForResponse): Passed mainFrame to
3198         canPluginHandleResponse(), and checked if mimeType is null before calling
3199         m_mimeTypesWithCustomContentProviders.contains().
3200         (WebKit::WebPage::canShowMIMEType): Checked if MIMEType is null before calling
3201         m_mimeTypesWithCustomContentProviders.contains().
3202         * WebProcess/WebPage/WebPage.h: Made canPluginHandleResponse() a private declaration.
3203
3204 2016-10-17  Chris Dumez  <cdumez@apple.com>
3205
3206         [WK2][NetworkCache] PendingFrameLoad objects are sometimes leaked
3207         https://bugs.webkit.org/show_bug.cgi?id=163569
3208         <rdar://problem/28810836>
3209
3210         Reviewed by Antti Koivisto.
3211
3212         PendingFrameLoad objects are created to track frame loads and added to
3213         the m_pendingFrameLoads hash map. These objects are supposed to remove
3214         themselves from the hash map once they detect that the page load has
3215         finished by calling PendingFrameLoad::m_loadCompletionHandler().
3216
3217         PendingFrameLoad::m_loadCompletionHandler() is called from
3218         markLoadAsCompleted() when we detect that the page load has finished
3219         via the m_loadHysteresisActivity HysteresisActivity. We call impulse()
3220         on the HysteresisActivity every time a subresource is loaded in the
3221         frame. The issue is that if no subresource is ever loaded, then we
3222         never call impulse() on the HysteresisActivity, which is therefore
3223         never started. If it nevers starts, then it nevers stops and never
3224         calls markLoadAsCompleted(). To address the problem, we now call
3225         impulse() on the HysteresisActivity as soon as we construct it.
3226
3227         * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
3228
3229 2016-10-17  Jeremy Jones  <jeremyj@apple.com>
3230
3231         Enable keyboard in fullscreen.
3232         https://bugs.webkit.org/show_bug.cgi?id=163146
3233
3234         Reviewed by Jer Noble.
3235
3236         Allow keyboard in fullscreen.
3237
3238         * UIProcess/WebFullScreenManagerProxy.cpp:
3239         (WebKit::WebFullScreenManagerProxy::supportsFullScreen):
3240
3241 2016-10-17  Chris Dumez  <cdumez@apple.com>
3242
3243         Move form.reportValidity() behind InteractiveFormValidation setting
3244         https://bugs.webkit.org/show_bug.cgi?id=163550
3245
3246         Reviewed by Darin Adler.
3247
3248         Enable InteractiveFormValidation setting by default and link it to
3249         RuntimeEnabledFeatures so we can use it in the IDL.
3250
3251         * UIProcess/API/C/WKPreferencesRefPrivate.h:
3252         * WebProcess/WebPage/WebPage.cpp:
3253         (WebKit::WebPage::updatePreferences):
3254
3255 2016-10-17  Gavin Barraclough  <barraclough@apple.com>
3256
3257         UIProcess should determine throttle state for WebContent process
3258         https://bugs.webkit.org/show_bug.cgi?id=163556
3259
3260         Reviewed by Anders Carlsson.
3261
3262         This is a step towards merging page/process throttling code for mac & iOS.
3263
3264         Previously WebPage determined whether to start a UserActivity based on page activity,
3265         visibility and the preference to disable. Now WebPage passes the activity state across
3266         to WebPageProxy, which makes the decision & explicitly instructs WebPage to start/stop
3267         the UserActivity.
3268
3269         * UIProcess/WebPageProxy.cpp:
3270         (WebKit::WebPageProxy::WebPageProxy):
3271             - updateActivityToken + updateProccessSuppressionState -> updateThrottleState
3272         (WebKit::WebPageProxy::reattachToWebProcess):
3273             - updateActivityToken -> updateThrottleState
3274         (WebKit::WebPageProxy::dispatchViewStateChange):
3275             - updateActivityToken -> updateThrottleState
3276         (WebKit::WebPageProxy::setPageActivityState):
3277             - Record activity state passed from WebPage, and update.
3278         (WebKit::WebPageProxy::preferencesDidChange):
3279             - updateProccessSuppressionState -> updateThrottleState
3280         (WebKit::WebPageProxy::updateActivityToken): Deleted.
3281         (WebKit::WebPageProxy::updateProccessSuppressionState): Deleted.
3282         (WebKit::WebPageProxy::updateThrottleState):
3283             - Merged existing updateActivityToken/updateProccessSuppressionState to unified updateThrottleState.
3284             - Compute whether page should be suppressed, and send SetPageSuppressed message accordingly.
3285         * UIProcess/WebPageProxy.h:
3286             - Merged existing updateActivityToken/updateProccessSuppressionState to unified updateThrottleState.
3287             - Added setPageActivityState/m_activityState to report/record page activity.
3288             - Added m_pageSuppressed to prevent redundant message sends.
3289         * UIProcess/WebPageProxy.messages.in:
3290             - Expose SetPageActivityState message (called by WebPage).
3291         * WebProcess/WebPage/WebPage.cpp:
3292         (WebKit::WebPage::WebPage):
3293             - removed m_processSuppressionEnabled
3294             - updateUserActivity -> setPageSuppressed - explicitly set the page to not be suppressed, until WebPageProxy tells us to do so.
3295         (WebKit::WebPage::setPageActivityState):
3296             - post activity state on to WebPageProxy.
3297         (WebKit::WebPage::setPageSuppressed):
3298             - Start/stop USerActivity accordingly.
3299         (WebKit::WebPage::setViewState):
3300             - No longer need to monitor ViewState changes on the WebProcess side.
3301         (WebKit::WebPage::updatePreferences):
3302             - No longer need to monitor preference changes on the WebProcess side.
3303         (WebKit::WebPage::updateUserActivity): Deleted.
3304             - Only updated on reciept of setPageSuppressed message.
3305         * WebProcess/WebPage/WebPage.h:
3306             - Removed m_activityState, m_processSuppressionEnabled, updateUserActivity.
3307             - Added setPageSuppressed message.
3308         * WebProcess/WebPage/WebPage.messages.in:
3309             - Added SetPageSuppressed message.
3310
3311 2016-10-17  Michael Catanzaro  <mcatanzaro@igalia.com>
3312
3313         REGRESSION(r206189): logs error statements when API::URLRequest is canceled
3314         https://bugs.webkit.org/show_bug.cgi?id=163393
3315
3316         Reviewed by Antti Koivisto.
3317
3318         Print this case at normal logging level, not as an error.
3319
3320         * WebProcess/Network/WebLoaderStrategy.cpp:
3321         (WebKit::WebLoaderStrategy::loadResource):
3322
3323 2016-10-17  Chris Dumez  <cdumez@apple.com>
3324
3325         [iOS] Hook up WebPlatformTouchPoint's radiusX / radiusY to _UIWebTouchPoint.majorRadiusInScreenCoordinates
3326         https://bugs.webkit.org/show_bug.cgi?id=163547
3327
3328         Reviewed by Darin Adler.
3329
3330         Hook up WebPlatformTouchPoint's radiusX / radiusY to _UIWebTouchPoint.majorRadiusInScreenCoordinates
3331         now that it is available in UIKit.
3332
3333         * Platform/spi/ios/UIKitSPI.h:
3334         * Shared/ios/NativeWebTouchEventIOS.mm:
3335         (WebKit::NativeWebTouchEvent::extractWebTouchPoint):
3336
3337 2016-10-17  Konstantin Tokarev  <annulen@yandex.ru>
3338
3339         Eleminate code duplication between ResourceRequest encoding/decoding implementations
3340         https://bugs.webkit.org/show_bug.cgi?id=163507
3341
3342         Reviewed by Carlos Garcia Campos.
3343
3344         ResourceRequestBase::encodeWithoutPlatformData() and Soup implementation of
3345         ArgumentCoder<ResourceRequest>::encodePlatformData() share most of the code,
3346         ditto for decoding implementations.
3347
3348         * Shared/soup/WebCoreArgumentCodersSoup.cpp:
3349         (IPC::ArgumentCoder<ResourceRequest>::encodePlatformData):
3350         (IPC::ArgumentCoder<ResourceRequest>::decodePlatformData):
3351
3352 2016-10-17  Michael Catanzaro  <mcatanzaro@igalia.com>
3353
3354         Move user agent quirks to cross-platform location
3355         https://bugs.webkit.org/show_bug.cgi?id=163508
3356
3357         Reviewed by Carlos Garcia Campos.
3358
3359         #include <WebCore/UserAgent.h> instead of <WebCore/UserAgentGtk.h>.
3360
3361         * UIProcess/API/gtk/WebKitSettings.cpp:
3362         * UIProcess/efl/WebPageProxyEfl.cpp:
3363         * UIProcess/gtk/WebPageProxyGtk.cpp:
3364         * WebProcess/WebPage/gtk/WebPageGtk.cpp:
3365
3366 2016-10-17  Carlos Garcia Campos  <cgarcia@igalia.com>
3367
3368         [SOUP] Downloads should always sniff contents
3369         https://bugs.webkit.org/show_bug.cgi?id=163538
3370
3371         Reviewed by Michael Catanzaro.
3372
3373         It's quite common that downloads have weird filenames with no extension, so it would be better if the loader
3374         sniff the contents to guess the mime type.
3375
3376         * NetworkProcess/Downloads/soup/DownloadSoup.cpp:
3377         (WebKit::Download::startNetworkLoad): Pass true for shouldContentSniff parameter of ResourceHandle::create().
3378
3379 2016-10-17  Carlos Garcia Campos  <cgarcia@igalia.com>
3380
3381         [GTK] Switch to use API::DownloadClient instead of the C API client
3382         https://bugs.webkit.org/show_bug.cgi?id=163537
3383
3384         Reviewed by Michael Catanzaro.
3385
3386         The code is simpler and we avoid all the toImpl/toAPI.
3387
3388         * UIProcess/API/gtk/WebKitDownloadClient.cpp:
3389         (attachDownloadClientToContext):
3390         (didStart):
3391         (didReceiveResponse):
3392         (didReceiveData):
3393         (decideDestinationWithSuggestedFilename):
3394         (didCreateDestination):
3395         (didFail):
3396         (didCancel):
3397         (didFinish):
3398
3399 2016-10-17  Manuel Rego Casasnovas  <rego@igalia.com>
3400
3401         [css-grid] Disable CSS Grid Layout runtime flag by default
3402         https://bugs.webkit.org/show_bug.cgi?id=163432
3403
3404         Reviewed by Darin Adler.
3405
3406         It was enabled in r201042, but now Safari Technology Preview
3407         has a UI to switch runtime flags so it doesn't need to be enabled
3408         by default anymore.
3409
3410         * Shared/WebPreferencesDefinitions.h: Disable grid layout runtime flag
3411         by default.
3412
3413 2016-10-16  Darin Adler  <darin@apple.com>
3414
3415         Move CSS classes from ExceptionCode to Exception
3416         https://bugs.webkit.org/show_bug.cgi?id=163494
3417
3418         Reviewed by Sam Weinig.
3419
3420         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSRule.cpp:
3421         (webkit_dom_css_rule_set_css_text): Updated for ExceptionOr.
3422         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSStyleDeclaration.cpp:
3423         (webkit_dom_css_style_declaration_remove_property): Ditto.
3424         (webkit_dom_css_style_declaration_set_property): Ditto.
3425         (webkit_dom_css_style_declaration_set_css_text): Ditto.
3426         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSStyleSheet.cpp:
3427         (webkit_dom_css_style_sheet_insert_rule): Ditto.
3428         (webkit_dom_css_style_sheet_delete_rule): Ditto.
3429         (webkit_dom_css_style_sheet_add_rule): Ditto.
3430         (webkit_dom_css_style_sheet_remove_rule): Ditto.
3431         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSValue.cpp:
3432         (webkit_dom_css_value_set_css_text): Ditto.
3433         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMMediaList.cpp:
3434         (webkit_dom_media_list_delete_medium): Ditto.
3435         (webkit_dom_media_list_append_medium): Ditto.
3436         (webkit_dom_media_list_set_media_text): Ditto.
3437
3438 2016-10-16  Carlos Garcia Campos  <cgarcia@igalia.com>
3439
3440         [GTK] Default WebKitWebsiteDataManager is always leaked in WebKitWebContext
3441         https://bugs.webkit.org/show_bug.cgi?id=163443
3442
3443         Reviewed by Michael Catanzaro.
3444
3445         Adopt the reference returned by webkitWebsiteDataManagerCreate().
3446
3447         * UIProcess/API/gtk/WebKitWebContext.cpp:
3448         (webkitWebContextConstructed):
3449
3450 2016-10-16  Carlos Garcia Campos  <cgarcia@igalia.com>
3451
3452         [GTK] WebKitWebPage URI not updated after URI is modified by InjectedBundlePageResourceLoadClient::willSendRequestForFrame
3453         https://bugs.webkit.org/show_bug.cgi?id=163389
3454
3455         Reviewed by Michael Catanzaro.
3456
3457         Update the page URI also when the load is committed.
3458
3459         * WebProcess/InjectedBundle/API/gtk/WebKitWebPage.cpp:
3460         (getDocumentLoaderURL):
3461         (didStartProvisionalLoadForFrame):
3462         (didReceiveServerRedirectForProvisionalLoadForFrame):
3463         (didCommitLoadForFrame):
3464         (webkitWebPageCreate):
3465         (getProvisionalURLForFrame): Deleted.
3466
3467 2016-10-15  Simon Fraser  <simon.fraser@apple.com>
3468
3469         Sort the project file.
3470
3471         * WebKit2.xcodeproj/project.pbxproj:
3472
3473 2016-10-14  Anders Carlsson  <andersca@apple.com>
3474
3475         Fix Mac build.
3476
3477         * UIProcess/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm:
3478         (WebKit::WebPaymentCoordinatorProxy::platformShowPaymentUI):
3479
3480 2016-10-14  Anders Carlsson  <andersca@apple.com>
3481
3482         Pass on networking settings to the PKPaymentRequest
3483         https://bugs.webkit.org/show_bug.cgi?id=163462
3484         rdar://problem/28567629
3485
3486         Reviewed by Dan Bernstein.
3487
3488         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.h:
3489         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
3490         (WebKit::toPKPaymentRequest):
3491         * UIProcess/ApplePay/ios/WebPaymentCoordinatorProxyIOS.mm:
3492         (WebKit::WebPaymentCoordinatorProxy::platformShowPaymentUI):
3493
3494 2016-10-14  Anders Carlsson  <andersca@apple.com>
3495
3496         Clean up BackForwardClient
3497         https://bugs.webkit.org/show_bug.cgi?id=163454
3498
3499         Reviewed by Sam Weinig.
3500
3501         Remove empty iOS only stubs.
3502
3503         * WebKit2.xcodeproj/project.pbxproj:
3504         * WebProcess/WebPage/WebBackForwardListProxy.h:
3505         * WebProcess/WebPage/ios/WebBackForwardListProxyIOS.mm: Removed.
3506
3507 2016-10-14  Brady Eidson  <beidson@apple.com>
3508
3509         Enable Gamepads by default in WK2.
3510         https://bugs.webkit.org/show_bug.cgi?id=163447
3511
3512         Rubberstamped by Sam Weinig.
3513
3514         * Shared/WebPreferencesDefinitions.h:
3515
3516 2016-10-14  Gavin Barraclough  <barraclough@apple.com>
3517
3518         Add API to restrict WebKit processes to background priority
3519         https://bugs.webkit.org/show_bug.cgi?id=163363
3520
3521         Reviewed by Anders Carlson.
3522
3523         Add API on _WKProcessPoolConfiguration to flag a process pool as 'alwaysRunsAtBackgroundPriority'.
3524         WebContent and Networking processes associated with that pool will only run a background priority,
3525         when they otherwise would have run at foreground priority.
3526
3527         * UIProcess/API/APIProcessPoolConfiguration.h:
3528             - Add m_alwaysRunsAtBackgroundPriority flag to pool configuration object.
3529         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
3530         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
3531         (-[_WKProcessPoolConfiguration alwaysRunsAtBackgroundPriority]):
3532         (-[_WKProcessPoolConfiguration setAlwaysRunsAtBackgroundPriority:]):
3533             - Expose new configuration property through API.
3534         * UIProcess/Network/NetworkProcessProxy.cpp:
3535         (WebKit::NetworkProcessProxy::alwaysRunsAtBackgroundPriority):
3536         * UIProcess/Network/NetworkProcessProxy.h:
3537             - Support ProcessThrottlerClient interface to check if alwaysRunsAtBackgroundPriority is set.
3538         * UIProcess/ProcessThrottler.cpp:
3539         (WebKit::ProcessThrottler::assertionState):
3540             - When determining whether to take a foreground exception check alwaysRunsAtBackgroundPriority.
3541         * UIProcess/ProcessThrottlerClient.h:
3542             - Add interface to access alwaysRunsAtBackgroundPriority state of WebProcess of NetworkProcess.
3543         * UIProcess/WebProcessPool.cpp:
3544         (WebKit::WebProcessPool::WebProcessPool):
3545         * UIProcess/WebProcessPool.h:
3546             - Add m_alwaysRunsAtBackgroundPriority, set by configuration.
3547         * UIProcess/WebProcessProxy.cpp:
3548         (WebKit::WebProcessProxy::alwaysRunsAtBackgroundPriority):
3549         * UIProcess/WebProcessProxy.h:
3550             - Support ProcessThrottlerClient interface to check if alwaysRunsAtBackgroundPriority is set.
3551
3552 2016-10-14  Youenn Fablet  <youenn@apple.com>
3553
3554         Make NetworkCache aware of fetch cache mode
3555         https://bugs.webkit.org/show_bug.cgi?id=163332
3556
3557         Reviewed by Antti Koivisto.
3558
3559         Adding explicit serialization of ResourceRequest cachePolicy since it does no longer map to platform request cache policy.
3560
3561         Added support for:
3562         - Bypassing entirely the network cache in case cache mode is NoStore.
3563         - requiring revalidation in case of cache hit and cache mode is NoCache.
3564         - Not using any entry if cache mode is Reload (but cache can still be updated)
3565
3566         Also made sure that the ResourceRequest::cachePolicy remains the same throughout redirections.
3567
3568         * NetworkProcess/NetworkResourceLoader.cpp:
3569         (WebKit::NetworkResourceLoader::canUseCache):
3570         (WebKit::NetworkResourceLoader::retrieveCacheEntry):
3571         (WebKit::NetworkResourceLoader::continueWillSendRequest):
3572         * NetworkProcess/cache/NetworkCache.cpp:
3573         (WebKit::NetworkCache::cachePolicyAllowsExpired):
3574         (WebKit::NetworkCache::makeRetrieveDecision):
3575         * Shared/mac/WebCoreArgumentCodersMac.mm:
3576         (IPC::ArgumentCoder<ResourceRequest>::encodePlatformData):
3577         (IPC::ArgumentCoder<ResourceRequest>::decodePlatformData):
3578
3579 2016-10-13  Tim Horton  <timothy_horton@apple.com>
3580
3581         Rename the SPI added in r207292 due to post-landing review comments
3582         https://bugs.webkit.org/show_bug.cgi?id=163364
3583         <rdar://problem/28012494>
3584
3585         Reviewed by Simon Fraser.
3586
3587         * UIProcess/API/APIPageConfiguration.h:
3588         (API::PageConfiguration::waitsForPaintAfterViewDidMoveToWindow):
3589         (API::PageConfiguration::setWaitsForPaintAfterViewDidMoveToWindow):
3590         (API::PageConfiguration::shouldWaitForPaintAfterViewDidMoveToWindow): Deleted.
3591         (API::PageConfiguration::setShouldWaitForPaintAfterViewDidMoveToWindow): Deleted.
3592         * UIProcess/API/Cocoa/WKWebView.mm:
3593         (-[WKWebView _initializeWithConfiguration:]):
3594         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
3595         (-[WKWebViewConfiguration init]):
3596         (-[WKWebViewConfiguration copyWithZone:]):
3597         (-[WKWebViewConfiguration _waitsForPaintAfterViewDidMoveToWindow]):
3598         (-[WKWebViewConfiguration _setWaitsForPaintAfterViewDidMoveToWindow:]):
3599         (-[WKWebViewConfiguration _shouldWaitForPaintAfterViewDidMoveToWindow]): Deleted.
3600         (-[WKWebViewConfiguration _setShouldWaitForPaintAfterViewDidMoveToWindow:]): Deleted.
3601         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
3602         * UIProcess/WebPageProxy.cpp:
3603         (WebKit::WebPageProxy::WebPageProxy):
3604         (WebKit::WebPageProxy::dispatchViewStateChange):
3605         * UIProcess/WebPageProxy.h:
3606
3607 2016-10-13  Jonathan Bedard  <jbedard@apple.com>
3608
3609         GTK and EFL on Mac fail to compile WebTextChecker due to missing definition of WKTextCheckerClientBase
3610         https://bugs.webkit.org/show_bug.cgi?id=163346
3611
3612         Reviewed by Daniel Bates.
3613
3614         * UIProcess/API/C/WKTextChecker.cpp: Fixed #ifdefs for GTK and EFL builds on Darwin machines.
3615         * UIProcess/API/C/WKTextChecker.h: Ditto.
3616
3617 2016-10-13  Tim Horton  <timothy_horton@apple.com>
3618
3619         Expose SPI to disable synchronously blocking on painting after parenting a WKWebView
3620         https://bugs.webkit.org/show_bug.cgi?id=163364
3621         <rdar://problem/28012494>
3622
3623         Reviewed by Geoff Garen.
3624
3625         Some clients may not want the default WKWebView behavior where we synchronously
3626         block on the Web process after the first time a WKWebView is re-added to the window,
3627         because they are e.g. parenting re-used WKWebViews while scrolling.
3628
3629         * UIProcess/API/APIPageConfiguration.h:
3630         (API::PageConfiguration::shouldSynchronizeInitialPaintAfterMovingToWindow):
3631         (API::PageConfiguration::setShouldSynchronizeInitialPaintAfterMovingToWindow):
3632         * UIProcess/API/Cocoa/WKWebView.mm:
3633         (-[WKWebView _initializeWithConfiguration:]):
3634         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
3635         (-[WKWebViewConfiguration init]):
3636         (-[WKWebViewConfiguration copyWithZone:]):
3637         (-[WKWebViewConfiguration _shouldSynchronizeInitialPaintAfterMovingToWindow]):
3638         (-[WKWebViewConfiguration _setShouldSynchronizeInitialPaintAfterMovingToWindow:]):
3639         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
3640         * UIProcess/WebPageProxy.h:
3641         * UIProcess/WebPageProxy.cpp:
3642         (WebKit::WebPageProxy::WebPageProxy):
3643         Add and plumb a new WKWebView configuration parameter.
3644
3645         (WebKit::WebPageProxy::dispatchViewStateChange):
3646         If the new configuration parameter is set, don't block the main thread when
3647         a view is reparented.
3648
3649 2016-10-12  Chris Dumez  <cdumez@apple.com>
3650
3651         [Web IDL] Drop support for legacy [ConstructorConditional=*]
3652         https://bugs.webkit.org/show_bug.cgi?id=163368
3653
3654         Reviewed by Ryosuke Niwa.
3655
3656         Drop ENABLE_DOM4_EVENTS_CONSTRUCTOR compiler flag.
3657
3658         * Configurations/FeatureDefines.xcconfig:
3659
3660 2016-10-12  Alex Christensen  <achristensen@webkit.org>
3661
3662         Fix assertion after switching to URLParser
3663         https://bugs.webkit.org/show_bug.cgi?id=163350
3664         rdar://problem/28739938
3665
3666         Reviewed by Brady Eidson.
3667         
3668         Covered by a new API test.
3669
3670         * UIProcess/API/Cocoa/_WKUserStyleSheet.mm:
3671         (-[_WKUserStyleSheet initWithSource:forMainFrameOnly:legacyWhitelist:legacyBlacklist:baseURL:userContentWorld:]):
3672         The { } here is not understood by the compiler to mean WebCore::URL(), but rather the empty constructor for the enum ParsedURLStringTag.
3673         We used to be unsafely trusting that the URL was valid and canonicalized, but with URLParser we are canonicalizing it,
3674         and the assertion (url == m_string) in URL.cpp was failing.
3675
3676 2016-10-12  Anders Carlsson  <andersca@apple.com>
3677
3678         Remove an unused function
3679         https://bugs.webkit.org/show_bug.cgi?id=163341
3680
3681         Reviewed by Dan Bernstein.
3682
3683         * WebProcess/WebPage/WebBackForwardListProxy.cpp:
3684         (WebKit::WebBackForwardListProxy::isActive): Deleted.
3685         * WebProcess/WebPage/WebBackForwardListProxy.h:
3686
3687 2016-10-11  Gyuyoung Kim  <gyuyoung.kim@navercorp.com>
3688
3689         [EFL] Update API tests which are passed or failed
3690         https://bugs.webkit.org/show_bug.cgi?id=163322
3691
3692         Unreviewed, simple on/off API test.
3693
3694         *ewk_favicon_database_clear* has been crashed for a long time, however
3695         *ewk_cookie_manager_permanent_storage* is fine now. So the passing test
3696         is enabled again, and disable the failure tests.
3697
3698         * UIProcess/API/efl/tests/test_ewk2_cookie_manager.cpp:
3699         (TEST_F):
3700         * UIProcess/API/efl/tests/test_ewk2_favicon_database.cpp:
3701         (TEST_F):
3702
3703 2016-10-11  Daniel Bates  <dabates@apple.com>
3704
3705         Attempt to fix the Apple Internal Mac build following r207159
3706         (https://bugs.webkit.org/show_bug.cgi?id=163244)
3707
3708         * UIProcess/API/Cocoa/WKWebView.mm:
3709         (shouldRequireUserGestureToLoadVideo):
3710
3711 2016-10-11  Anders Carlsson  <andersca@apple.com>
3712
3713         Clean up WebPageGroup somewhat
3714         https://bugs.webkit.org/show_bug.cgi?id=163299
3715
3716         Reviewed by Tim Horton.
3717
3718         * Shared/API/c/WKDeprecatedFunctions.cpp:
3719         (WKPageGroupCopyIdentifier):
3720         Move this here from WKPageGroup.
3721
3722         (WKPageGroupAddUserContentFilter):
3723         (WKPageGroupRemoveUserContentFilter):
3724         (WKPageGroupRemoveAllUserContentFilters):
3725         Just call directly into the user content controller.
3726
3727         * UIProcess/API/C/WKPageGroup.cpp:
3728         (WKPageGroupAddUserStyleSheet):
3729         (WKPageGroupRemoveAllUserStyleSheets):
3730         (WKPageGroupAddUserScript):
3731         (WKPageGroupRemoveAllUserScripts):
3732         Just call directly into the user content controller.
3733
3734         * UIProcess/API/C/WKPageGroup.h:
3735         * UIProcess/WebPageGroup.cpp:
3736         (WebKit::WebPageGroup::addUserStyleSheet): Deleted.
3737         (WebKit::WebPageGroup::addUserScript): Deleted.
3738         (WebKit::WebPageGroup::removeAllUserStyleSheets): Deleted.
3739         (WebKit::WebPageGroup::removeAllUserScripts): Deleted.
3740         (WebKit::WebPageGroup::removeAllUserContent): Deleted.
3741         (WebKit::WebPageGroup::addUserContentExtension): Deleted.
3742         (WebKit::WebPageGroup::removeUserContentExtension): Deleted.
3743         (WebKit::WebPageGroup::removeAllUserContentExtensions): Deleted.
3744         Get rid of these, all their callers just call into the user content controller now.
3745
3746         * UIProcess/WebPageGroup.h:
3747         (WebKit::WebPageGroup::identifier): Deleted.
3748         (WebKit::WebPageGroup::sendToAllProcessesInGroup): Deleted.
3749         Remove unused code.
3750
3751 2016-10-11  Daniel Bates  <dabates@apple.com>
3752
3753         [iOS] REGRESSION (r197953): User gesture required to load video in iOS 9-built apps
3754         https://bugs.webkit.org/show_bug.cgi?id=163244
3755         <rdar://problem/27250015>
3756
3757         Reviewed by Jer Noble.
3758
3759         Enable or disable the Setting::requiresUserGestureToLoadVideo() in WebKit depending on the
3760         version of iOS SDK that the app was linked against. We require a user gesture to begin
3761         loading a video as of iOS 10.
3762
3763         * Shared/WebPreferencesDefinitions.h:
3764         * UIProcess/API/Cocoa/WKWebView.mm:
3765         (shouldRequireUserGestureToLoadVideo): Added.
3766         (-[WKWebView _initializeWithConfiguration:]): Set the requiresUserGestureToLoadVideo preference.
3767         * WebProcess/WebPage/WebPage.cpp:
3768         (WebKit::WebPage::updatePreferences): Modified to pass the WebKit requiresUserGestureToLoadVideo
3769         preference to WebCore.
3770
3771 2016-10-11  Alex Christensen  <achristensen@webkit.org>
3772
3773         Remove dead networking code
3774         https://bugs.webkit.org/show_bug.cgi?id=163263
3775
3776         Reviewed by Daniel Bates.
3777
3778         * NetworkProcess/Downloads/Download.h:
3779         * NetworkProcess/Downloads/ios/DownloadIOS.mm: Removed.
3780         * NetworkProcess/Downloads/mac/DownloadMac.mm:
3781         * NetworkProcess/NetworkLoad.h:
3782         * NetworkProcess/mac/NetworkLoadMac.mm:
3783         (WebKit::NetworkLoad::willCacheResponseAsync): Deleted.
3784         * Shared/Authentication/cocoa/AuthenticationManagerCocoa.mm:
3785         (WebKit::AuthenticationManager::receivedCredential):
3786         (WebKit::AuthenticationManager::receivedRequestToContinueWithoutCredential):
3787         (WebKit::AuthenticationManager::receivedCancellation):
3788         (WebKit::AuthenticationManager::receivedRequestToPerformDefaultHandling):
3789         (WebKit::AuthenticationManager::receivedChallengeRejection):
3790         * Shared/WebProcessCreationParameters.cpp:
3791         (WebKit::WebProcessCreationParameters::encode):
3792         (WebKit::WebProcessCreationParameters::decode):
3793         * Shared/WebProcessCreationParameters.h:
3794         * Shared/mac/WebCoreArgumentCodersMac.mm:
3795         (IPC::ArgumentCoder<ResourceRequest>::encodePlatformData):
3796         (IPC::ArgumentCoder<ResourceRequest>::decodePlatformData):
3797         * WebKit2.xcodeproj/project.pbxproj:
3798
3799 2016-10-11  Anders Carlsson  <andersca@apple.com>
3800
3801         Move no longer used functions to WKDeprecatedFunctions.cpp
3802         https://bugs.webkit.org/show_bug.cgi?id=163290
3803
3804         Reviewed by Dan Bernstein.
3805
3806         * Shared/API/c/WKDeprecatedFunctions.cpp:
3807         (WKPageGroupAddUserContentFilter):
3808         (WKPageGroupRemoveUserContentFilter):
3809         (WKPageGroupRemoveAllUserContentFilters):
3810         (WKContextSetProcessModel): Deleted.
3811         * UIProcess/API/C/WKPageGroup.cpp:
3812         (WKPageGroupRemoveAllUserScripts):
3813         (WKPageGroupAddUserContentFilter): Deleted.
3814         (WKPageGroupRemoveUserContentFilter): Deleted.
3815         (WKPageGroupRemoveAllUserContentFilters): Deleted.
3816         * UIProcess/API/C/WKPageGroup.h:
3817
3818 2016-10-11  Konstantin Tokarev  <annulen@yandex.ru>
3819
3820         Use modern for loops for iterating supplement maps
3821         https://bugs.webkit.org/show_bug.cgi?id=163274
3822
3823         Reviewed by Alex Christensen.
3824
3825         * NetworkProcess/NetworkProcess.cpp:
3826         (WebKit::NetworkProcess::initializeNetworkProcess):
3827         (WebKit::NetworkProcess::initializeConnection):
3828         * UIProcess/WebProcessPool.cpp:
3829         (WebKit::WebProcessPool::~WebProcessPool):
3830         (WebKit::WebProcessPool::networkProcessCrashed):
3831         (WebKit::WebProcessPool::databaseProcessCrashed): Iterate by values()
3832         like in other places.
3833
3834 2016-10-11  Wenson Hsieh  <wenson_hsieh@apple.com>
3835
3836         The "Input Events" experimental feature runtime flag should not be on by default
3837         https://bugs.webkit.org/show_bug.cgi?id=163278
3838
3839         Reviewed by Zalan Bujtas.
3840
3841         This was intended to be off by default.
3842
3843         * Shared/WebPreferencesDefinitions.h:
3844
3845 2016-10-10  Zan Dobersek  <zdobersek@igalia.com>
3846
3847         Add ENABLE_ENCRYPTED_MEDIA configuration option
3848         https://bugs.webkit.org/show_bug.cgi?id=163219
3849
3850         Reviewed by Darin Adler.
3851
3852         * Configurations/FeatureDefines.xcconfig:
3853         Add the ENABLE_ENCRYPTED_MEDIA configuration option. It will be used
3854         to enable or disable the new EME implementation at build-time.
3855
3856 2016-10-10  Carlos Garcia Campos  <cgarcia@igalia.com>
3857
3858         NetworkSession: NetworkDataTask is leaked if download finishes in didReceiveResponse completion handler
3859         https://bugs.webkit.org/show_bug.cgi?id=163204
3860
3861         Reviewed by Alex Christensen.
3862
3863         After the completion handler a reference of the NetworkDataTask is saved in m_downloadsAfterDestinationDecided.
3864         If the download failed or was canceled DownloadManager::dataTaskBecameDownloadTask is never called and the data
3865         task is kept in the download manager forever. This patch exposes NSURLSessionTask state property in
3866         NetworkDataTask, so that the download manager can check the task state after the completion handler and return
3867         early if the download finished or was cancelled.
3868
3869         * NetworkProcess/Downloads/DownloadManager.cpp:
3870         (WebKit::DownloadManager::continueDecidePendingDownloadDestination):
3871         * NetworkProcess/NetworkDataTask.h:
3872         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
3873         (WebKit::NetworkDataTask::state):
3874
3875 2016-10-10  Konstantin Tokarev  <annulen@yandex.ru>
3876
3877         Added final specifier to WebInspectorServer and to its overridden methods
3878         https://bugs.webkit.org/show_bug.cgi?id=163228
3879
3880         Reviewed by Darin Adler.
3881
3882         * UIProcess/InspectorServer/WebInspectorServer.h:
3883
3884 2016-10-10  Carlos Garcia Campos  <cgarcia@igalia.com>
3885
3886         [GTK] 2.14.0 Compile Errors: GTK 3.22.1
3887         https://bugs.webkit.org/show_bug.cgi?id=163190
3888
3889         Reviewed by Alex Christensen.
3890
3891         * UIProcess/gtk/AcceleratedBackingStoreX11.cpp: Include gtk.h since we are using gtk_widget_queue_draw().
3892
3893 2016-10-10  Gyuyoung Kim  <gyuyoung.kim@navercorp.com>
3894
3895         [EFL] ewk_context_preferred_languages has been failed since r206949
3896         https://bugs.webkit.org/show_bug.cgi?id=163211
3897
3898         Reviewed by Chris Dumez.
3899
3900         r206949 changed to return value of navigator.language from en-us to en-US
3901         in order to match other browsers and w3c spec. So ewk_context_preferred_languages
3902         needs to change the expected result as well.
3903
3904         * UIProcess/API/efl/tests/test_ewk2_context.cpp:
3905         (TEST_F):
3906
3907 2016-10-10  Carlos Garcia Campos  <cgarcia@igalia.com>
3908
3909         NetworkSession: downloads started by startDownload() can fail before starting from the API point of view
3910         https://bugs.webkit.org/show_bug.cgi?id=163107
3911
3912         Reviewed by Alex Christensen.
3913
3914         In the network process we use a PendingDownload in this case, but in the UI process we always have a single
3915         download proxy. If an error happens before the pending download is converted inot a real download, the DidFail
3916         messages is received in the download proxy before the DidStart one. This is problematic at least for the GTK+
3917         API, because it's common to connect to the started signal and connect to all other signals from there, but in
3918         this case the started signal is never emitted, and then the failed one is not handled. This is not a problem for
3919         downloads started by convertTaskToDownload, because in that case those loads are not considered a download by
3920         the UI process when those early errors happen, and then the web page handles them.
3921
3922         * NetworkProcess/Downloads/PendingDownload.cpp:
3923         (WebKit::PendingDownload::PendingDownload): Send DidStart message right after the network load starts like the
3924         non network session code does.
3925         * NetworkProcess/NetworkLoad.cpp:
3926         (WebKit::NetworkLoad::convertTaskToDownload): Send DidStart message now that the normal load has been converted
3927         into a download.
3928         * NetworkProcess/NetworkProcess.cpp:
3929         (WebKit::NetworkProcess::findPendingDownloadLocation): Do not send DidStart message here.
3930
3931 2016-10-10  Carlos Garcia Campos  <cgarcia@igalia.com>
3932
3933         Network Session: PendingDownload is always nullptr in DownloadManager::dataTaskBecameDownloadTask
3934         https://bugs.webkit.org/show_bug.cgi?id=163006
3935
3936         Reviewed by Alex Christensen.
3937
3938         In DownloadManager::dataTaskBecameDownloadTask() we are supposed to have either a pending download, or a network
3939         data task depending on whether the download was started by startDownload() or convertTaskToDownload. However, in
3940         both cases we do have a data task and never a pending download. In the case of startDownload() the pending
3941         download is removed from m_pendingDownloads in willDecidePendingDownloadDestination(). The task is always
3942         added to m_downloadsWaitingForDestination in willDecidePendingDownloadDestination() and to
3943         m_downloadsAfterDestinationDecided in continueDecidePendingDownloadDestination() in both cases.
3944
3945         * NetworkProcess/Downloads/DownloadManager.cpp:
3946         (WebKit::DownloadManager::dataTaskBecameDownloadTask): Add an ASSERT to ensure we don't have a pending download
3947         at this point and that the download is not already in the map. Remove the download from the
3948         m_downloadsAfterDestinationDecided map, but don't check its result because it might not bein that map if
3949         dataTaskBecameDownloadTask is called synchronously from the didReceiveResponse completion handler.
3950         (WebKit::DownloadManager::willDecidePendingDownloadDestination): Do not take the pending download here, wait
3951         until didReceiveResponse completion handler is called.
3952         (WebKit::DownloadManager::continueDecidePendingDownloadDestination): Take the pending download here ensuring
3953         it's alive while the didReceiveResponse completion handler is called. Also remove invalid early return when
3954         either networkDataTask or completionHandler are nullptr because we are using both unconditionally, we should
3955         return early if both are nullptr to avoid crashes. However, we are checking that the download is in the
3956         m_downloadsWaitingForDestination and in that case we should always have both, so better add asserts there. If
3957         the download is already in the map after the completion handler it means that dataTaskBecameDownloadTask() has
3958         alrady been called, so we can just return in that case.
3959         * NetworkProcess/Downloads/DownloadManager.h:
3960         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
3961         (-[WKNetworkSessionDelegate URLSession:dataTask:didBecomeDownloadTask:]): Protect the NetworkDataTask that can
3962  &nb