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