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