AX: "(inverted-colors)" media query only matches on page reload; should match on...
[WebKit-https.git] / Source / WebKit2 / ChangeLog
1 2016-11-18  Dean Jackson  <dino@apple.com>
2
3         AX: "(inverted-colors)" media query only matches on page reload; should match on change
4         https://bugs.webkit.org/show_bug.cgi?id=163564
5         <rdar://problem/28807350>
6
7         Reviewed by Simon Fraser.
8
9         Listen for the appropriate notifications that accessibility settings
10         have changed. This is a single notification on macOS, which uses WebViewImpl,
11         and more fine-grained notifications on iOS, using WKWebView.
12
13         When we see the notification, send a message to the WebProcess which will
14         then tell the WebCore::Page.
15
16         * UIProcess/API/Cocoa/WKWebView.mm:
17         (-[WKWebView _initializeWithConfiguration:]):
18         (-[WKWebView _accessibilitySettingsDidChange:]):
19         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
20         * UIProcess/Cocoa/WebViewImpl.h:
21         * UIProcess/Cocoa/WebViewImpl.mm:
22         (-[WKAccessibilitySettingsObserver initWithImpl:]):
23         (-[WKAccessibilitySettingsObserver dealloc]):
24         (-[WKAccessibilitySettingsObserver _settingsDidChange:]):
25         (WebKit::WebViewImpl::WebViewImpl):
26         (WebKit::WebViewImpl::accessibilitySettingsDidChange):
27         * UIProcess/WebPageProxy.cpp:
28         (WebKit::WebPageProxy::accessibilitySettingsDidChange):
29         * UIProcess/WebPageProxy.h:
30         * WebProcess/WebPage/WebPage.cpp:
31         (WebKit::WebPage::accessibilitySettingsDidChange):
32         * WebProcess/WebPage/WebPage.h:
33         * WebProcess/WebPage/WebPage.messages.in:
34
35 2016-11-18  Jeremy Jones  <jeremyj@apple.com>
36
37         USE WK_MAC_TBA for version number in _webViewRequestPointerLock:(WKWebView *)webView WK_API_AVAILABLE(macosx(10.12))
38         https://bugs.webkit.org/show_bug.cgi?id=164962
39
40         Reviewed by Dean Jackson.
41
42         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
43
44 2016-11-18  Enrica Casucci  <enrica@apple.com>
45
46         Refactor drag and drop for WebKit2 to encode DragData message exchange.
47         https://bugs.webkit.org/show_bug.cgi?id=164945
48
49         Reviewed by Tim Horton.
50
51         * Shared/WebCoreArgumentCoders.cpp:
52         (IPC::ArgumentCoder<DragData>::encode):
53         (IPC::ArgumentCoder<DragData>::decode):
54         * Shared/WebCoreArgumentCoders.h:
55         * UIProcess/WebPageProxy.cpp:
56         (WebKit::WebPageProxy::performDragControllerAction):
57         * WebProcess/WebCoreSupport/WebDragClient.cpp:
58         (WebKit::WebDragClient::willPerformDragDestinationAction):
59         (WebKit::WebDragClient::actionMaskForDrag):
60         * WebProcess/WebCoreSupport/WebDragClient.h:
61         * WebProcess/WebPage/WebPage.cpp:
62         (WebKit::WebPage::performDragControllerAction):
63         * WebProcess/WebPage/WebPage.h:
64         * WebProcess/WebPage/WebPage.messages.in:
65
66 2016-11-18  Jeremy Jones  <jeremyj@apple.com>
67
68         Add runtime flag to enable pointer lock. Enable pointer lock feature for mac.
69         https://bugs.webkit.org/show_bug.cgi?id=163801
70
71         Reviewed by Simon Fraser.
72
73         Add SPI to notify client of pointer lock and for client to allow or deny.
74         Unlock pointer when view is not longer active.
75
76         * Configurations/FeatureDefines.xcconfig:
77         * Shared/WebPreferencesDefinitions.h:
78         * UIProcess/API/APIUIClient.h:
79         (API::UIClient::requestPointerLock):
80         (API::UIClient::didLosePointerLock):
81         * UIProcess/API/C/WKPage.cpp:
82         (WKPageSetPageUIClient):
83         (WKPageDidAllowPointerLock):
84         (WKPageDidDenyPointerLock):
85         * UIProcess/API/C/WKPagePrivate.h:
86         * UIProcess/API/C/WKPageUIClient.h:
87         * UIProcess/API/C/WKPreferences.cpp:
88         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
89         * UIProcess/Cocoa/UIDelegate.h:
90         * UIProcess/Cocoa/UIDelegate.mm:
91         (WebKit::UIDelegate::setDelegate):
92         (WebKit::UIDelegate::UIClient::requestPointerLock):
93         (WebKit::UIDelegate::UIClient::didLosePointerLock):
94         * UIProcess/WebPageProxy.cpp:
95         (WebKit::WebPageProxy::dispatchActivityStateChange):
96         (WebKit::WebPageProxy::resetStateAfterProcessExited):
97         (WebKit::WebPageProxy::requestPointerLock):
98         (WebKit::WebPageProxy::didAllowPointerLock):
99         (WebKit::WebPageProxy::didDenyPointerLock):
100         (WebKit::WebPageProxy::requestPointerUnlock):
101         * UIProcess/WebPageProxy.h:
102         * WebProcess/WebPage/WebPage.cpp:
103         (WebKit::WebPage::updatePreferences):
104
105 2016-11-17  Carlos Garcia Campos  <cgarcia@igalia.com>
106
107         Downloads started by context menu actions should also have a web view associated
108         https://bugs.webkit.org/show_bug.cgi?id=164364
109
110         Reviewed by Michael Catanzaro.
111
112         When a request is converted to a download WebPageProxy calls handleDownloadRequest() and clients handle that to
113         associate the web view to the download. When a download is started by a context menu action, WebPageProxy calls
114         WebProcessPool::download() with this as initiatingPage parameter, but clients are not notified in this case.
115
116         * UIProcess/API/gtk/WebKitDownload.cpp:
117         (webkitDownloadCreateForRequest): Deleted.
118         * UIProcess/API/gtk/WebKitDownloadPrivate.h:
119         * UIProcess/API/gtk/WebKitWebContext.cpp:
120         (webkitWebContextStartDownload): Use webkitWebContextGetOrCreateDownload() after WebProcessPool::download()
121         because the WebKitDownload could have already been created by the web view download handler at this point.
122         * UIProcess/API/gtk/WebKitWebView.cpp:
123         (webkit_web_view_download_uri): We no longer need to associate the web view to the download here.
124         * UIProcess/WebProcessPool.cpp:
125         (WebKit::WebProcessPool::download): If an initiatingPage has been passed, call handleDownloadRequest() to notify
126         the page client.
127
128 2016-11-17  Alex Christensen  <achristensen@webkit.org>
129
130         REGRESSION: API test _WKDownload.ConvertResponseToDownload is a flaky timeout
131         https://bugs.webkit.org/show_bug.cgi?id=164631
132
133         Reviewed by Carlos Garcia Campos.
134
135         * NetworkProcess/NetworkResourceLoader.cpp:
136         (WebKit::NetworkResourceLoader::convertToDownload):
137         I could reproduce the flaky failure 100% of the time when not using NETWORK_SESSION
138         by adding a usleep(1000000) in NetworkResourceLoader::convertToDownload.  m_networkLoad
139         was not being set to nullptr before it was being checked in NetworkResourceLoader::abort
140
141 2016-11-17  Alex Christensen  <achristensen@webkit.org>
142
143         Fix CMake build after r208865
144         https://bugs.webkit.org/show_bug.cgi?id=164894
145
146         * PlatformMac.cmake:
147         Add new files.
148
149 2016-11-17  Ryosuke Niwa  <rniwa@webkit.org>
150
151         WKBundleNodeHandleSetHTMLInputElementSpellcheckEnabled should keep text replacement enabled
152         https://bugs.webkit.org/show_bug.cgi?id=164857
153         <rdar://problem/27721742>
154
155         Reviewed by Wenson Hsieh.
156
157         * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp:
158         (WebKit::InjectedBundleNodeHandle::setHTMLInputElementSpellcheckEnabled):
159
160 2016-11-17  John Wilander  <wilander@apple.com>
161
162         Resource load statistics: Cover further data records, count removed data records, and only fire handler when needed
163         https://bugs.webkit.org/show_bug.cgi?id=164659
164
165         Reviewed by Andy Estes.
166
167         * UIProcess/WebResourceLoadStatisticsStore.cpp:
168         (WebKit::WebResourceLoadStatisticsStore::removeDataRecords):
169             Consistent naming with 'remove' rather than 'delete'.
170             Now removes localStorage, IndexDB, disk cache, and memory cache too.
171             Updates statistics with number of times it has removed data records.
172         (WebKit::WebResourceLoadStatisticsStore::resourceLoadStatisticsUpdated):
173             No longer checks whether it has enough data since the classification rules
174             are absolute, not relative.
175         (WebKit::WebResourceLoadStatisticsStore::clearDataRecords): Deleted.
176         * UIProcess/WebResourceLoadStatisticsStore.h:
177             Consistent naming with 'remove' rather than 'delete'.
178
179 2016-11-17  Brady Eidson  <beidson@apple.com>
180
181         Add _WKIconLoadingDelegate SPI.
182         https://bugs.webkit.org/show_bug.cgi?id=164894
183
184         Reviewed by Alex Christensen.
185
186         With this client, WebCore will ask the FrameLoaderClient about each icon found in the <head>.
187
188         WebKit2 will then ask the embedding app - for each icon - if it wants that icon to load.
189
190         For icons the app decides to load, WebKit will pass the data to the app without storing locally.
191
192         * UIProcess/API/APIIconLoadingClient.h: Copied from Source/WebCore/html/LinkIconCollector.h.
193         (API::IconLoadingClient::~IconLoadingClient):
194         (API::IconLoadingClient::getLoadDecisionForIcon):
195
196         * UIProcess/API/Cocoa/WKWebView.mm:
197         (-[WKWebView _initializeWithConfiguration:]):
198         (-[WKWebView _iconLoadingDelegate]):
199         (-[WKWebView _setIconLoadingDelegate:]):
200         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
201
202         * UIProcess/API/Cocoa/_WKIconLoadingDelegate.h: Copied from Source/WebCore/html/LinkIconCollector.h.
203
204         * UIProcess/API/Cocoa/_WKLinkIconParameters.h: Copied from Source/WebCore/html/LinkIconCollector.h.
205         * UIProcess/API/Cocoa/_WKLinkIconParameters.mm: Copied from Source/WebCore/html/LinkIconCollector.h.
206         (-[_WKLinkIconParameters _initWithLinkIcon:]):
207         (-[_WKLinkIconParameters url]):
208         (-[_WKLinkIconParameters mimeType]):
209         (-[_WKLinkIconParameters size]):
210         (-[_WKLinkIconParameters iconType]):
211         * UIProcess/API/Cocoa/_WKLinkIconParametersInternal.h: Copied from Source/WebCore/html/LinkIconCollector.h.
212
213         * UIProcess/Cocoa/IconLoadingDelegate.h: Copied from Source/WebCore/html/LinkIconCollector.h.
214         * UIProcess/Cocoa/IconLoadingDelegate.mm: Added.
215         (WebKit::IconLoadingDelegate::IconLoadingDelegate):
216         (WebKit::IconLoadingDelegate::~IconLoadingDelegate):
217         (WebKit::IconLoadingDelegate::createIconLoadingClient):
218         (WebKit::IconLoadingDelegate::delegate):
219         (WebKit::IconLoadingDelegate::setDelegate):
220         (WebKit::IconLoadingDelegate::IconLoadingClient::IconLoadingClient):
221         (WebKit::IconLoadingDelegate::IconLoadingClient::~IconLoadingClient):
222         (WebKit::IconLoadingDelegate::IconLoadingClient::getLoadDecisionForIcon):
223
224         * UIProcess/WebPageProxy.cpp:
225         (WebKit::WebPageProxy::setIconLoadingClient):
226         (WebKit::WebPageProxy::getLoadDecisionForIcon):
227         (WebKit::WebPageProxy::finishedLoadingIcon):
228         * UIProcess/WebPageProxy.h:
229         (WebKit::WebPageProxy::iconLoadingClient):
230         * UIProcess/WebPageProxy.messages.in:
231
232         * WebKit2.xcodeproj/project.pbxproj:
233
234         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
235         (WebKit::WebFrameLoaderClient::useIconLoadingClient):
236         (WebKit::WebFrameLoaderClient::getLoadDecisionForIcon):
237         (WebKit::WebFrameLoaderClient::finishedLoadingIcon):
238         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
239         (WebKit::WebFrameLoaderClient::setUseIconLoadingClient):
240
241         * WebProcess/WebPage/WebPage.cpp:
242         (WebKit::WebPage::didGetLoadDecisionForIcon):
243         (WebKit::WebPage::setUseIconLoadingClient):
244         * WebProcess/WebPage/WebPage.h:
245         * WebProcess/WebPage/WebPage.messages.in:
246
247 2016-11-17  Saam Barati  <sbarati@apple.com>
248
249         Remove async/await compile time flag and enable tests
250         https://bugs.webkit.org/show_bug.cgi?id=164828
251         <rdar://problem/28639334>
252
253         Reviewed by Yusuke Suzuki.
254
255         * Configurations/FeatureDefines.xcconfig:
256
257 2016-11-17  Yusuke Suzuki  <utatane.tea@gmail.com>
258
259         [JSC] WTF::TemporaryChange with WTF::SetForScope
260         https://bugs.webkit.org/show_bug.cgi?id=164761
261
262         Reviewed by Saam Barati.
263
264         * PluginProcess/PluginControllerProxy.cpp:
265         (WebKit::PluginControllerProxy::initialize):
266         * PluginProcess/WebProcessConnection.cpp:
267         (WebKit::WebProcessConnection::didReceiveMessage):
268         (WebKit::WebProcessConnection::didReceiveSyncMessage):
269         * Shared/API/Cocoa/WKRemoteObjectCoder.mm:
270         (createEncodedObject):
271         (decodeObject):
272         * UIProcess/API/Cocoa/WKWebView.mm:
273         (-[WKWebView _keyboardChangedWithInfo:adjustScrollView:]):
274         * UIProcess/Cocoa/WebViewImpl.mm:
275         (WebKit::WebViewImpl::updateTextTouchBar):
276         * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:
277         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::commitStateAfterChildren):
278         * UIProcess/gtk/WebPasteboardProxyGtk.cpp:
279         (WebKit::WebPasteboardProxy::writeToClipboard):
280         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
281         (WebKit::CompositingCoordinator::flushPendingLayerChanges):
282         (WebKit::CompositingCoordinator::purgeBackingStores):
283         * WebProcess/WebPage/WebPage.cpp:
284         (WebKit::WebPage::mouseEvent):
285         (WebKit::WebPage::keyEvent):
286         (WebKit::WebPage::dispatchTouchEvent):
287         (WebKit::WebPage::setInitialFocus):
288         (WebKit::WebPage::insertTextAsync):
289         * WebProcess/WebPage/ios/WebPageIOS.mm:
290         (WebKit::WebPage::dynamicViewportSizeUpdate):
291         * WebProcess/WebPage/mac/RemoteLayerTreeContext.mm:
292         * WebProcess/WebPage/mac/WebPageMac.mm:
293
294 2016-11-16  Brent Fulgham  <bfulgham@apple.com>
295
296         Unreviewed build fix after r208589
297
298         The generated com.apple.WebKit.plugin-common.sb file was not getting copied into
299         the Resources folder, so was not deployed with WebKit. We need to treat it like
300         com.apple.WebProcess.sb and the other generated files.
301
302         * WebKit2.xcodeproj/project.pbxproj: Tell Xcode to include the generated file in
303         the framework Resources.
304
305 2016-11-16  Yusuke Suzuki  <utatane.tea@gmail.com>
306
307         [ES6][WebCore] Change ES6_MODULES compile time flag to runtime flag
308         https://bugs.webkit.org/show_bug.cgi?id=164827
309
310         Reviewed by Ryosuke Niwa.
311
312         * Configurations/FeatureDefines.xcconfig:
313         * Shared/WebPreferencesDefinitions.h:
314         Annotated ES6 Modules option with DEFAULT_EXPERIMENTAL_FEATURES_ENABLED.
315         * UIProcess/API/C/WKPreferences.cpp:
316         (WKPreferencesSetES6ModulesEnabled):
317         (WKPreferencesGetES6ModulesEnabled):
318         * UIProcess/API/C/WKPreferencesRefPrivate.h:
319         * WebProcess/InjectedBundle/InjectedBundle.cpp:
320         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
321         * WebProcess/WebPage/WebPage.cpp:
322         (WebKit::WebPage::updatePreferences):
323
324 2016-11-16  Simon Fraser  <simon.fraser@apple.com>
325
326         Add logging support to VisibleContentRectUpdateInfo
327         https://bugs.webkit.org/show_bug.cgi?id=164825
328
329         Reviewed by Zalan Bujtas.
330
331         Add TextStream output to VisibleContentRectUpdateInfo. Just piping it into a logging
332         stream does single-line output, so also make a convenience dump() function that will
333         product multiline output. Result look like:
334
335             (VisibleContentRectUpdateInfo
336               (lastLayerTreeTransactionID 54)
337               (exposedContentRect (523.44,1258.63) width=676.20 height=901.60)
338               (unobscuredContentRect (523.44,1293.41) width=676.20 height=866.82)
339               (unobscuredRectInScrollViewCoordinates (0,39.50) width=768 height=984.50)
340               (customFixedPositionRect (219.64,935) width=980 height=1225)
341               (obscuredInset width=0 height=39.50)
342               (scale 1.14)
343               (inStableState 0)
344               (timestamp 736446.61)
345               (verticalVelocity -11.36))
346
347         * Shared/VisibleContentRectUpdateInfo.cpp:
348         (WebKit::VisibleContentRectUpdateInfo::dump):
349         (WebKit::operator<<):
350         * Shared/VisibleContentRectUpdateInfo.h:
351         * UIProcess/ios/WKContentView.mm:
352         (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:obscuredInset:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]):
353
354 2016-11-15  Simon Fraser  <simon.fraser@apple.com>
355
356         [iOS WK2] Scroll view scrolling and zooming animations can keep running across page loads
357         https://bugs.webkit.org/show_bug.cgi?id=164810
358
359         Reviewed by Tim Horton.
360         
361         Scrolling and zooming animations can leak across page loads, which makes tests flakey,
362         and is unexpected by users.
363
364         Tested by scrollingcoordinator/ios/sync-layer-positions-after-scroll.html followed by
365         scrollingcoordinator/ios/ui-scrolling-tree.html
366
367         * UIProcess/API/Cocoa/WKWebView.mm:
368         (-[WKWebView _didCommitLoadForMainFrame]):
369
370 2016-11-15  Jon Lee  <jonlee@apple.com>
371
372         Report active video and audio capture devices separately
373         https://bugs.webkit.org/show_bug.cgi?id=164769
374
375         Reviewed by Eric Carlson.
376
377         Replace kWKMediaHasActiveCaptureDevice with kWKMediaHasActiveAudioCaptureDevice and
378         kWKMediaHasActiveVideoCaptureDevice
379
380         * UIProcess/API/C/WKPage.cpp:
381         (WKPageGetMediaState):
382         * UIProcess/API/C/WKPagePrivate.h:
383         * UIProcess/WebPageProxy.cpp:
384         (WebKit::WebPageProxy::isPlayingMediaDidChange): Update the mask to include the two
385         bits.
386
387 2016-11-14  Simon Fraser  <simon.fraser@apple.com>
388
389         [iOS WK2] Implement support for visual viewports
390         https://bugs.webkit.org/show_bug.cgi?id=164765
391
392         Reviewed by Tim Horton.
393
394         Adopt the visual viewport scrolling model in iOS WK2.
395
396         Pass the parameters used for computing the layout viewport up to WK2 via RemoteLayerTreeTransaction.
397         These are stored on WebPageProxy. When they change, _didCommitLayerTree triggers a -_updateVisibleContentRects.
398         
399         WebPageProxy::computeCustomFixedPositionRect() is the function that computes the "override" layout viewport.
400         It starts with the baseLayoutViewportSize from the web process (which is based on the initial containing block
401         size), then ensures that it's no smaller than the unobscured content rect, since it makes no sense for the
402         layout viewport to be smaller than the visual viewport. The static FrameView::computeLayoutViewportOrigin()
403         is then use to "push" the layout viewport around as the visual viewport changes.
404
405         * Shared/VisibleContentRectUpdateInfo.h:
406         * Shared/WebCoreArgumentCoders.cpp: Encode LayoutSize and LayoutPoint.
407         (IPC::ArgumentCoder<LayoutSize>::encode):
408         (IPC::ArgumentCoder<LayoutSize>::decode):
409         (IPC::ArgumentCoder<LayoutPoint>::encode):
410         (IPC::ArgumentCoder<LayoutPoint>::decode):
411         * Shared/WebCoreArgumentCoders.h:
412         * Shared/mac/RemoteLayerTreeTransaction.h:
413         (WebKit::RemoteLayerTreeTransaction::baseLayoutViewportSize):
414         (WebKit::RemoteLayerTreeTransaction::setBaseLayoutViewportSize):
415         (WebKit::RemoteLayerTreeTransaction::minStableLayoutViewportOrigin):
416         (WebKit::RemoteLayerTreeTransaction::setMinStableLayoutViewportOrigin):
417         (WebKit::RemoteLayerTreeTransaction::maxStableLayoutViewportOrigin):
418         (WebKit::RemoteLayerTreeTransaction::setMaxStableLayoutViewportOrigin):
419         * Shared/mac/RemoteLayerTreeTransaction.mm:
420         (WebKit::RemoteLayerTreeTransaction::encode):
421         (WebKit::RemoteLayerTreeTransaction::decode):
422         (WebKit::RemoteLayerTreeTransaction::description):
423         * UIProcess/API/Cocoa/WKWebView.mm:
424         (-[WKWebView _didCommitLayerTree:]):
425         * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h:
426         (WebKit::RemoteScrollingCoordinatorProxy::visualViewportEnabled): Accessor.
427         * UIProcess/WebPageProxy.h:
428         (WebKit::WebPageProxy::customFixedPositionRect):
429         * UIProcess/ios/RemoteScrollingCoordinatorProxyIOS.mm:
430         (WebKit::RemoteScrollingCoordinatorProxy::customFixedPositionRect):
431         * UIProcess/ios/WKContentView.mm:
432         (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:obscuredInset:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]):
433         (-[WKContentView _didCommitLayerTree:]):
434         * UIProcess/ios/WebPageProxyIOS.mm:
435         (WebKit::WebPageProxy::computeCustomFixedPositionRect): When visual viewports are enabled, compute
436         the layout viewport rect, taking the baseLayoutViewportSize and the current unobscured rect into account.
437         (WebKit::WebPageProxy::updateLayoutViewportParameters):
438         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
439         (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
440         * WebProcess/WebPage/WebPage.cpp: Encode in the transaction the layout viewport parameters (with minor refactor).
441         (WebKit::WebPage::willCommitLayerTree):
442         * WebProcess/WebPage/ios/WebPageIOS.mm:
443         (WebKit::WebPage::updateVisibleContentRects): This is where the web process receives the new override layout viewport
444         from the web process (with some logging).
445
446 2016-11-15  Jon Lee  <jonlee@apple.com>
447
448         Remove HasMediaCaptureDevice
449         https://bugs.webkit.org/show_bug.cgi?id=164767
450         <rdar://problem/29263696>
451
452         Reviewed by Eric Carlson.
453
454         * UIProcess/API/C/WKPage.cpp: Remove kWKMediaHasCaptureDevice.
455         (WKPageGetMediaState):
456         * UIProcess/API/C/WKPagePrivate.h:
457
458 2016-11-15  Daniel Bates  <dabates@apple.com>
459
460         Disallow loads using HTTP 0.9 at the ResourceHandle/NetworkDataTask level
461         https://bugs.webkit.org/show_bug.cgi?id=164662
462         <rdar://problem/29268514>
463
464         Reviewed by Alex Christensen and Brady Eidson.
465
466         Make changes to NetworkDataTask similar to the changes made to ResourceHandle so as to
467         disallow non-default port HTTP 0.9 loads when using the ENABLE(NETWORK_SESSION) networking
468         code path in WebKit2.
469
470         * NetworkProcess/NetworkDataTask.cpp:
471         (WebKit::NetworkDataTask::didReceiveResponse): Added. Fail the load if it is using HTTP 0.9.
472         Otherwise notify the client that we received a response.
473         * NetworkProcess/NetworkDataTask.h:
474         * NetworkProcess/NetworkDataTaskBlob.cpp:
475         (WebKit::NetworkDataTaskBlob::resume): Substitute dispatchDidReceiveResponse() for didReceiveResponse()
476         as the latter has been renamed to the former.
477         (WebKit::NetworkDataTaskBlob::getSizeForNext): Ditto.
478         (WebKit::NetworkDataTaskBlob::dispatchDidReceiveResponse): Renamed from didReceiveResponse().
479         * NetworkProcess/NetworkDataTaskBlob.h:
480         * NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
481         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
482         (WebKit::NetworkDataTaskCocoa::didReceiveResponse): Deleted.
483         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
484         (WebKit::NetworkDataTaskSoup::didSendRequest): Substitute dispatchDidReceiveResponse() for didReceiveResponse()
485         as the latter has been renamed to the former.
486         (WebKit::NetworkDataTaskSoup::dispatchDidReceiveResponse): Renamed from didReceiveResponse(). Also
487         remove the local variable response and inline its value into the call to ResourceHandle::didReceiveResponse()
488         as this variable is used exactly once in this function and its name does not describe its purpose any more
489         than its value.
490         (WebKit::NetworkDataTaskSoup::didRequestNextPart): Substitute dispatchDidReceiveResponse() for didReceiveResponse()
491         as the latter has been renamed to the former.
492         * NetworkProcess/soup/NetworkDataTaskSoup.h:
493
494 2016-11-14  Alex Christensen  <achristensen@webkit.org>
495
496         Move SecurityOrigin::createFromDatabaseIdentifier to SecurityOriginData
497         https://bugs.webkit.org/show_bug.cgi?id=164720
498
499         Reviewed by Brady Eidson.
500
501         * DatabaseProcess/DatabaseProcess.cpp:
502         (WebKit::DatabaseProcess::indexedDatabaseOrigins):
503         * DatabaseProcess/DatabaseProcess.h:
504         * NetworkProcess/NetworkProcess.cpp:
505         (WebKit::fetchDiskCacheEntries):
506         * Shared/API/c/WKSecurityOriginRef.cpp:
507         (WKSecurityOriginCreateFromDatabaseIdentifier):
508         * Shared/WebsiteData/WebsiteData.cpp:
509         (WebKit::WebsiteData::Entry::encode):
510         (WebKit::WebsiteData::Entry::decode):
511         * Shared/WebsiteData/WebsiteData.h:
512         * UIProcess/API/C/WKKeyValueStorageManager.cpp:
513         (WKKeyValueStorageManagerGetStorageDetailsByOrigin):
514         * UIProcess/Storage/LocalStorageDatabaseTracker.cpp:
515         (WebKit::LocalStorageDatabaseTracker::deleteDatabasesModifiedSince):
516         (WebKit::LocalStorageDatabaseTracker::origins):
517         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
518         (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame):
519         (WebKit::UserMediaPermissionRequestManagerProxy::enumerateMediaDevicesForFrame):
520         * UIProcess/WebPageProxy.cpp:
521         (WebKit::WebPageProxy::exceededDatabaseQuota):
522         (WebKit::WebPageProxy::reachedApplicationCacheOriginQuota):
523         (WebKit::WebPageProxy::requestGeolocationPermissionForFrame):
524         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
525         (WebKit::WebsiteDataStore::fetchData):
526         (WebKit::WebsiteDataStore::removeData):
527         (WebKit::WebsiteDataStore::mediaKeyOrigins):
528         * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
529         (WKBundleSetDatabaseQuota):
530         * WebProcess/MediaCache/WebMediaKeyStorageManager.cpp:
531         (WebKit::WebMediaKeyStorageManager::getMediaKeyOrigins):
532         * WebProcess/Storage/StorageAreaImpl.cpp:
533         (WebKit::StorageAreaImpl::create):
534         (WebKit::StorageAreaImpl::StorageAreaImpl):
535         (WebKit::StorageAreaImpl::securityOrigin):
536         * WebProcess/Storage/StorageAreaImpl.h:
537         * WebProcess/Storage/StorageAreaMap.cpp:
538         (WebKit::StorageAreaMap::dispatchSessionStorageEvent):
539         (WebKit::StorageAreaMap::dispatchLocalStorageEvent):
540         * WebProcess/Storage/StorageAreaMap.h:
541         (WebKit::StorageAreaMap::securityOrigin):
542         * WebProcess/Storage/StorageNamespaceImpl.cpp:
543         (WebKit::StorageNamespaceImpl::didDestroyStorageAreaMap):
544         (WebKit::StorageNamespaceImpl::storageArea):
545         * WebProcess/Storage/StorageNamespaceImpl.h:
546         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
547         (WebKit::WebChromeClient::exceededDatabaseQuota):
548         * WebProcess/WebProcess.cpp:
549         (WebKit::WebProcess::fetchWebsiteData):
550
551 2016-11-14  Brent Fulgham  <bfulgham@apple.com>
552
553         [Mac][iOS][WK2] Tighten permissions to change CapsLock delay
554         https://bugs.webkit.org/show_bug.cgi?id=164725
555         <rdar://problem/28970910>
556
557         Reviewed by Alexey Proskuryakov.
558
559         * PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in: Limit access
560         to the IOKit connection that actually needs it.
561
562 2016-11-14  Brent Fulgham  <bfulgham@apple.com>
563
564         Unreviewed sandbox fix after r208702
565
566         Correct version check to avoid breaking users in Safari Technology Preview
567         or WebKit nightlies.
568
569         * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
570         * WebProcess/com.apple.WebProcess.sb.in:
571
572 2016-11-14  Pranjal Jumde  <pjumde@apple.com>
573
574         Keychain access in WebKit should be limited to a single process. Earlier this was blocked on the networking framework requiring direct access to keychain, this will be resolved in the upcoming version of macOS.
575         https://bugs.webkit.org/show_bug.cgi?id=163710
576         <rdar://problem/24357468>
577
578         Reviewed by Darin Adler.
579
580         * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
581         * WebProcess/com.apple.WebProcess.sb.in:
582
583 2016-11-13  Darin Adler  <darin@apple.com>
584
585         Remove many includes of ExceptionCode.h
586         https://bugs.webkit.org/show_bug.cgi?id=164706
587
588         Reviewed by Alex Christensen.
589
590         * WebProcess/Storage/StorageAreaImpl.cpp: Removed include of ExceptionCode.h.
591
592 2016-11-13  Darin Adler  <darin@apple.com>
593
594         Fix exception handling in SQL database code, streamline and update code
595         https://bugs.webkit.org/show_bug.cgi?id=164685
596
597         Reviewed by Sam Weinig.
598
599         * UIProcess/API/efl/ewk_database_manager.cpp:
600         (EwkDatabaseManager::getDatabaseOrigins): Update for change to the
601         DatabaseTracker::origins function.
602         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
603         (WebKit::WebsiteDataStore::fetchData): Use DatabaseTracker.
604         (WebKit::WebsiteDataStore::removeData): Ditto.
605         * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
606         (WKBundleSetDatabaseQuota): Ditto.
607         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
608         (WebKit::WebChromeClient::exceededDatabaseQuota): Ditto.
609         * WebProcess/WebProcess.cpp:
610         (WebKit::WebProcess::processWillSuspendImminently): Ditto.
611
612 2016-11-12  Simon Fraser  <simon.fraser@apple.com>
613
614         Add a way to get the UI-side scrolling tree as text via UIScriptController
615         https://bugs.webkit.org/show_bug.cgi?id=164697
616
617         Reviewed by Zalan Bujtas.
618
619         Add a property to WKWebView to retrieve the scrolling tree as text, for testing.
620         Expose it via the RemoteScrollingCoordinatorProxy.
621
622         * UIProcess/API/Cocoa/WKWebView.mm:
623         (-[WKWebView _scrollingTreeAsText]):
624         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
625         * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp:
626         (WebKit::RemoteScrollingCoordinatorProxy::scrollingTreeAsText):
627         * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h:
628
629 2016-11-12  Daniel Bates  <dabates@apple.com>
630
631         Incorrect release log message emitted when waiting/not waiting for the WebProcess continue a load
632         https://bugs.webkit.org/show_bug.cgi?id=164605
633
634         Reviewed by Darin Adler.
635
636         Currently we emit a release log message of the form "didReceiveResponse: Should wait for
637         message from WebContent process ..." when we are not waiting for the WebProcess and emit
638         a message of the form "didReceiveResponse: Should not wait for message from WebContent
639         process" when we are waiting on the WebProcess. Invert these messages to reflect whether
640         we are waiting for the WebProcess to send message NetworkResourceLoader::ContinueDidReceiveResponsewhether.
641
642         For the main resource NetworkResourceLoader::didReceiveResponse() returns ShouldContinueDidReceiveResponse::No
643         because we are waiting for the WebProcess to send message NetworkResourceLoader::ContinueDidReceiveResponse
644         to continue the load. For a subresource we do not need to wait for the WebProcess to allow the load to continue
645         and hence NetworkResourceLoader::didReceiveResponse() returns ShouldContinueDidReceiveResponse::Yes.
646
647         * NetworkProcess/NetworkResourceLoader.cpp:
648
649 2016-11-12  Simon Fraser  <simon.fraser@apple.com>
650
651         [iOS WK2] Share some code with Mac for post-async-scroll state reconciliation
652         https://bugs.webkit.org/show_bug.cgi?id=164694
653
654         Reviewed by Zalan Bujtas.
655
656         Rather than calling FrameView directly, call reconcileScrollingState() on the scrolling
657         coordinator.
658
659         * WebProcess/WebPage/ios/WebPageIOS.mm:
660         (WebKit::WebPage::updateVisibleContentRects):
661
662 2016-11-12  Brian Burg  <bburg@apple.com>
663
664         Web Automation: terminate the automation session if the web process crashes
665         https://bugs.webkit.org/show_bug.cgi?id=164671
666         <rdar://problem/29028964>
667
668         Reviewed by Joseph Pecoraro.
669
670         * UIProcess/Automation/WebAutomationSession.h:
671         * UIProcess/Automation/WebAutomationSession.cpp:
672         (WebKit::WebAutomationSession::disconnect):
673         (WebKit::WebAutomationSession::terminate):
674         Factor out code that disconnects the remote, unpairs, and notifies the client.
675         Then, expose terminate() which can be called without a FrontendChannel.
676         Calling this causes the _WKAutomationDelegate to clear the local-side session in the
677         browser, and disconnecting from the remote will hang up the remote-side session.
678
679         * UIProcess/WebPageProxy.cpp:
680         (WebKit::WebPageProxy::processDidCrash):
681         Terminate the session.
682
683 2016-11-11  Alex Christensen  <achristensen@webkit.org>
684
685         Use SecurityOriginData as keys in StorageManager
686         https://bugs.webkit.org/show_bug.cgi?id=159834
687         <rdar://problem/27346948>
688
689         Reviewed by Brady Eidson.
690
691         * Platform/IPC/HandleMessage.h:
692         (IPC::callMemberFunctionImpl):
693         Add a missing std::forward so we can use this callMemberFunctionImpl with rvalues.
694         * UIProcess/API/C/WKApplicationCacheManager.cpp:
695         (WKApplicationCacheManagerGetApplicationCacheOrigins):
696         (WKApplicationCacheManagerDeleteEntriesForOrigin):
697         * UIProcess/API/C/WKKeyValueStorageManager.cpp:
698         (WKKeyValueStorageManagerGetKeyValueStorageOrigins):
699         (WKKeyValueStorageManagerDeleteEntriesForOrigin):
700         * UIProcess/API/C/WKResourceCacheManager.cpp:
701         (WKResourceCacheManagerGetCacheOrigins):
702         (WKResourceCacheManagerClearCacheForOrigin):
703         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
704         (-[WKWebsiteDataStore _fetchDataRecordsOfTypes:withOptions:completionHandler:]):
705         * UIProcess/Databases/DatabaseProcessProxy.cpp:
706         (WebKit::DatabaseProcessProxy::deleteWebsiteDataForOrigins):
707         * UIProcess/Databases/DatabaseProcessProxy.h:
708         * UIProcess/Network/NetworkProcessProxy.cpp:
709         (WebKit::NetworkProcessProxy::getNetworkProcessConnection):
710         (WebKit::NetworkProcessProxy::deleteWebsiteDataForOrigins):
711         * UIProcess/Network/NetworkProcessProxy.h:
712         * UIProcess/Storage/LocalStorageDatabase.cpp:
713         (WebKit::LocalStorageDatabase::create):
714         (WebKit::LocalStorageDatabase::LocalStorageDatabase):
715         (WebKit::LocalStorageDatabase::openDatabase):
716         (WebKit::LocalStorageDatabase::close):
717         * UIProcess/Storage/LocalStorageDatabase.h:
718         * UIProcess/Storage/LocalStorageDatabaseTracker.cpp:
719         (WebKit::LocalStorageDatabaseTracker::databasePath):
720         (WebKit::LocalStorageDatabaseTracker::didOpenDatabaseWithOrigin):
721         (WebKit::LocalStorageDatabaseTracker::deleteDatabaseWithOrigin):
722         (WebKit::LocalStorageDatabaseTracker::deleteDatabasesModifiedSince):
723         (WebKit::LocalStorageDatabaseTracker::origins):
724         * UIProcess/Storage/LocalStorageDatabaseTracker.h:
725         * UIProcess/Storage/StorageManager.cpp:
726         (WebKit::StorageManager::StorageArea::securityOrigin):
727         (WebKit::StorageManager::TransientLocalStorageNamespace::getOrCreateStorageArea):
728         (WebKit::StorageManager::TransientLocalStorageNamespace::origins):
729         (WebKit::StorageManager::TransientLocalStorageNamespace::clearStorageAreasMatchingOrigin):
730         (WebKit::StorageManager::StorageArea::StorageArea):
731         (WebKit::StorageManager::StorageArea::clone):
732         (WebKit::StorageManager::StorageArea::items):
733         (WebKit::StorageManager::StorageArea::openDatabaseAndImportItemsIfNeeded):
734         (WebKit::StorageManager::LocalStorageNamespace::didDestroyStorageArea):
735         (WebKit::StorageManager::LocalStorageNamespace::clearStorageAreasMatchingOrigin):
736         (WebKit::StorageManager::LocalStorageNamespace::clearAllStorageAreas):
737         (WebKit::StorageManager::SessionStorageNamespace::origins):
738         (WebKit::StorageManager::SessionStorageNamespace::clearStorageAreasMatchingOrigin):
739         (WebKit::StorageManager::SessionStorageNamespace::cloneTo):
740         (WebKit::StorageManager::getSessionStorageOrigins):
741         (WebKit::StorageManager::deleteSessionStorageOrigins):
742         (WebKit::StorageManager::deleteSessionStorageEntriesForOrigins):
743         (WebKit::StorageManager::getLocalStorageOrigins):
744         (WebKit::StorageManager::deleteLocalStorageEntriesForOrigin):
745         (WebKit::StorageManager::deleteLocalStorageOriginsModifiedSince):
746         (WebKit::StorageManager::deleteLocalStorageEntriesForOrigins):
747         (WebKit::StorageManager::createLocalStorageMap):
748         (WebKit::StorageManager::createTransientLocalStorageMap):
749         (WebKit::StorageManager::createSessionStorageMap):
750         (WebKit::StorageManager::getOrCreateLocalStorageNamespace):
751         (WebKit::StorageManager::getOrCreateTransientLocalStorageNamespace):
752         (WebKit::StorageManager::StorageArea::create): Deleted.
753         (WebKit::StorageManager::LocalStorageNamespace::getOrCreateStorageArea): Deleted.
754         (WebKit::StorageManager::SessionStorageNamespace::getOrCreateStorageArea): Deleted.
755         * UIProcess/Storage/StorageManager.h:
756         * UIProcess/WebProcessProxy.cpp:
757         (WebKit::WebProcessProxy::deleteWebsiteDataForOrigins):
758         * UIProcess/WebProcessProxy.h:
759         * UIProcess/WebsiteData/WebsiteDataRecord.cpp:
760         (WebKit::WebsiteDataRecord::displayNameForOrigin):
761         (WebKit::WebsiteDataRecord::add):
762         * UIProcess/WebsiteData/WebsiteDataRecord.h:
763         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
764         (WebKit::WebsiteDataStore::fetchData):
765         (WebKit::WebsiteDataStore::removeData):
766         (WebKit::WebsiteDataStore::mediaKeyOrigins):
767         (WebKit::WebsiteDataStore::removeMediaKeys):
768         * UIProcess/WebsiteData/WebsiteDataStore.h:
769         Fewer SecurityOrigin uses in the UIProcess!  Hooray!
770
771 2016-11-11  Ryosuke Niwa  <rniwa@webkit.org>
772
773         Hovering over a slotted Text node clears hover state
774         https://bugs.webkit.org/show_bug.cgi?id=164002
775         <rdar://problem/29040471>
776
777         Reviewed by Simon Fraser.
778
779         * WebProcess/WebPage/WebPage.cpp:
780         (WebKit::WebPage::determinePrimarySnapshottedPlugIn):
781         * WebProcess/WebPage/mac/WebPageMac.mm:
782         (WebKit::WebPage::performImmediateActionHitTestAtLocation):
783
784 2016-11-11  Wenson Hsieh  <wenson_hsieh@apple.com>
785
786         [WK2] autocorrect and autocapitalize attributes do not work in contenteditable elements
787         https://bugs.webkit.org/show_bug.cgi?id=164538
788         <rdar://problem/8418711>
789
790         Reviewed by Ryosuke Niwa.
791
792         Consult HTMLElement::autocorrect() and HTMLElement::autocapitalizeType() when assembling the assisted node
793         information for the currently assisted node.
794
795         * Shared/AssistedNodeInformation.h:
796         * UIProcess/ios/WKContentViewInteraction.mm:
797         (toUITextAutocapitalize):
798         * WebProcess/WebPage/ios/WebPageIOS.mm:
799         (WebKit::WebPage::getAssistedNodeInformation):
800
801 2016-11-11  Beth Dakin  <bdakin@apple.com>
802
803         Move to modern TouchBar methods
804         https://bugs.webkit.org/show_bug.cgi?id=164655
805         -and corresponding-
806         rdar://problem/29226911
807
808         Reviewed by Wenson Hsieh.
809
810         customizationDefaultItemIdentifiers -> defaultItemIdentifiers
811         itemIdentifiers -> defaultItemIdentifiers
812         defaultItems -> templateItems
813
814         * UIProcess/Cocoa/WebViewImpl.mm:
815         (WebKit::plainTextTouchBarDefaultItemIdentifiers):
816         (WebKit::richTextTouchBarDefaultItemIdentifiers):
817         (WebKit::WebViewImpl::setUpTextTouchBar):
818         (WebKit::WebViewImpl::updateTextTouchBar):
819         (WebKit::plainTextTouchBarCustomizationDefaultItemIdentifiers): Deleted.
820         (WebKit::richTextTouchBarCustomizationDefaultItemIdentifiers): Deleted.
821
822 2016-11-11  Brent Fulgham  <bfulgham@apple.com>
823
824         Get rid of old sandbox rules for OS's we no longer support
825         https://bugs.webkit.org/show_bug.cgi?id=164638
826
827         Reviewed by Simon Fraser.
828
829         Clean up the various sandbox profiles to get rid of rules that applied to operating system
830         versions we no longer support, or were added in support of bugs that have long since been
831         fixed.
832
833         This should introduce no change in behavior.
834
835         * DatabaseProcess/mac/com.apple.WebKit.Databases.sb.in:
836         * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
837         * PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in:
838         * Resources/PlugInSandboxProfiles/com.oracle.java.JavaAppletPlugin.sb:
839         * WebProcess/com.apple.WebProcess.sb.in:
840
841 2016-11-11  Brady Eidson  <beidson@apple.com>
842
843         IndexedDB 2.0: "close pending flag" and firing blocked events all need fixing.
844         https://bugs.webkit.org/show_bug.cgi?id=164641
845
846         Reviewed by Alex Christensen.
847
848         * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.cpp:
849         (WebKit::WebIDBConnectionToClient::databaseConnectionPendingClose):
850         * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.h:
851         * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.messages.in:
852
853         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
854         (WebKit::WebIDBConnectionToServer::databaseConnectionPendingClose):
855         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h:
856
857 2016-11-11  Eric Carlson  <eric.carlson@apple.com>
858
859         [MediaStream] defer resolution of getUserMedia promise made in a background tab
860         https://bugs.webkit.org/show_bug.cgi?id=164643
861         <rdar://problem/29048317>
862
863         Reviewed by Brady Eidson.
864
865         Do not ask for user for access to capture devices when the document does not
866         allow media to play, wait until playback is allowed.
867
868         * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
869         (WebKit::UserMediaPermissionRequestManager::startUserMediaRequest):
870         (WebKit::UserMediaPermissionRequestManager::sendUserMediaRequest):
871         (WebKit::UserMediaPermissionRequestManager::mediaCanStart):
872         (WebKit::UserMediaPermissionRequestManager::grantUserMediaDevicesSandboxExtension):
873         * WebProcess/MediaStream/UserMediaPermissionRequestManager.h:
874         * WebProcess/Plugins/PluginView.cpp:
875         (WebKit::PluginView::mediaCanStart):
876         * WebProcess/Plugins/PluginView.h:
877
878 2016-11-11  Darin Adler  <darin@apple.com>
879
880         Move Node from ExceptionCode to ExceptionOr
881         https://bugs.webkit.org/show_bug.cgi?id=164515
882
883         Reviewed by Sam Weinig.
884
885         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLSelectElement.cpp:
886         (webkit_dom_html_select_element_remove): Updated exception handling.
887         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNode.cpp:
888         (webkit_dom_node_insert_before): Ditto.
889         (webkit_dom_node_replace_child): Ditto.
890         (webkit_dom_node_remove_child): Ditto.
891         (webkit_dom_node_append_child): Ditto.
892         (webkit_dom_node_clone_node_with_error): Ditto.
893         (webkit_dom_node_set_node_value): Ditto.
894         (webkit_dom_node_set_text_content): Ditto.
895         * WebProcess/InjectedBundle/API/mac/WKDOMNode.mm:
896         (-[WKDOMNode insertNode:before:]): Ditto.
897         (-[WKDOMNode appendChild:]): Ditto.
898         (-[WKDOMNode removeChild:]): Ditto.
899
900         * WebProcess/Plugins/PDF/DeprecatedPDFPlugin.mm:
901         (WebKit::PDFPlugin::PDFPlugin): Removed unneeded ASSERT_NO_EXCEPTION.
902         * WebProcess/Plugins/PDF/PDFPluginChoiceAnnotation.mm:
903         (WebKit::PDFPluginChoiceAnnotation::createAnnotationElement): Ditto.
904
905 2016-11-11  Megan Gardner  <megan_gardner@apple.com>
906
907         [Cocoa] Support wide gamut for Drag Image UI
908         https://bugs.webkit.org/show_bug.cgi?id=164490
909
910         Reviewed by Tim Horton.
911
912         Fixed an error in the gating for the new wide gamut support in ShareableBitmap.
913         We should always respect the flags straight out, and not make decisions later, it can lead to mismatched data and data storage.
914         Added support for wide gamut in createCGImage.
915
916         * Shared/cg/ShareableBitmapCG.cpp:
917         (WebKit::bitmapInfo):
918         (WebKit::colorSpace):
919         (WebKit::ShareableBitmap::createGraphicsContext):
920         (WebKit::ShareableBitmap::createCGImage):
921         * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
922         (WebKit::convertImageToBitmap):
923         (WebKit::WebDragClient::startDrag):
924
925 2016-11-11  Beth Dakin  <bdakin@apple.com>
926
927         Get touch bar code building for open source builds
928         https://bugs.webkit.org/show_bug.cgi?id=164610
929
930         Reviewed by Wenson Hsieh.
931
932         * config.h:
933
934 2016-11-10  Brent Fulgham  <bfulgham@apple.com>
935
936         Remove unused FontService from sandbox profile
937         https://bugs.webkit.org/show_bug.cgi?id=164625
938         <rdar://problem/26899976>
939
940         Reviewed by Alex Christensen.
941
942         Part of some general sandbox profile gardening.
943
944         Convert the Plugin process sandbox into 
945
946         * Configurations/WebKit.xcconfig: Add exclude for com.apple.WebKit.plugin-common.sb.in.
947         * DerivedSources.make: Update to generate com.apple.WebKit.plugin-common.sb from .in file
948         * PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in: Copied from Resources/PlugInSandboxProfiles/com.apple.WebKit.plugin-common.sb.
949         * Resources/PlugInSandboxProfiles/com.apple.WebKit.plugin-common.sb: Removed.
950         * WebKit2.xcodeproj/project.pbxproj: Update for new .in file.
951         * WebProcess/com.apple.WebProcess.sb.in: Remove com.apple.FontServer
952         from macOS Sierra and newer.
953
954 2016-11-10  Eric Carlson  <eric.carlson@apple.com>
955
956         [MediaStream] apply constraints passed to getUserMedia()
957         https://bugs.webkit.org/show_bug.cgi?id=164561
958
959         Reviewed by Youenn Fablet.
960         <rdar://problem/29191384>
961
962         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
963         (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame):
964
965 2016-11-10  Alex Christensen  <achristensen@webkit.org>
966
967         Move SecurityOrigin::databaseIdentifier() to SecurityOriginData
968         https://bugs.webkit.org/show_bug.cgi?id=164573
969
970         Reviewed by Brady Eidson.
971
972         * Shared/API/c/WKSecurityOriginRef.cpp:
973         (WKSecurityOriginCopyDatabaseIdentifier):
974         * UIProcess/Storage/LocalStorageDatabaseTracker.cpp:
975         (WebKit::LocalStorageDatabaseTracker::databasePath):
976         (WebKit::LocalStorageDatabaseTracker::didOpenDatabaseWithOrigin):
977         (WebKit::LocalStorageDatabaseTracker::deleteDatabaseWithOrigin):
978         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
979         (WebKit::WebsiteDataStore::removeMediaKeys):
980         * WebProcess/Geolocation/GeolocationPermissionRequestManager.cpp:
981         (WebKit::GeolocationPermissionRequestManager::startRequestForGeolocation):
982         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
983         (WKBundlePageCopyOriginsWithApplicationCache):
984         * WebProcess/MediaCache/WebMediaKeyStorageManager.cpp:
985         (WebKit::WebMediaKeyStorageManager::mediaKeyStorageDirectoryForOrigin):
986         * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
987         (WebKit::UserMediaPermissionRequestManager::startUserMediaRequest):
988         (WebKit::UserMediaPermissionRequestManager::enumerateMediaDevices):
989         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
990         (WebKit::WebChromeClient::exceededDatabaseQuota):
991         (WebKit::WebChromeClient::reachedApplicationCacheOriginQuota):
992
993 2016-11-10  Alex Christensen  <achristensen@webkit.org>
994
995         Remove unused CFURLCACHE code
996         https://bugs.webkit.org/show_bug.cgi?id=164551
997
998         Reviewed by Antti Koivisto.
999
1000         WebKit2 doesn't use CFURLCache, but we still have some unused code that seems to use it.
1001
1002         * NetworkProcess/NetworkProcess.cpp:
1003         (WebKit::fetchDiskCacheEntries):
1004         (WebKit::clearDiskCacheEntries):
1005         * NetworkProcess/NetworkProcess.h:
1006         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
1007         (WebKit::partitionName): Deleted.
1008         (WebKit::NetworkProcess::cfURLCacheOrigins): Deleted.
1009         (WebKit::NetworkProcess::clearCFURLCacheForOrigins): Deleted.
1010
1011 2016-11-10  Carlos Garcia Campos  <cgarcia@igalia.com>
1012
1013         [Linux] Memory process values shown by the WebMemorySampler in linux are wrong
1014         https://bugs.webkit.org/show_bug.cgi?id=164591
1015
1016         Reviewed by Michael Catanzaro.
1017
1018         It's parsing /proc/self/statm, and returning the values as if they were bytes, but they are number of pages, so
1019         to get the bytes we need to take the page size into account. In r208534 I added a method to get /proc/self/statm
1020         values in bytes to Platform layer, so we can simply use that instead.
1021
1022         * Shared/linux/WebMemorySamplerLinux.cpp:
1023         (WebKit::WebMemorySampler::sampleWebKit): Use currentProcessMemoryStatus() and update the descriptions to
1024         clarify that values are in bytes.
1025
1026 2016-10-14  Carlos Garcia Campos  <cgarcia@igalia.com>
1027
1028         MemoryPressureHandler shouldn't know how to release WebCore memory
1029         https://bugs.webkit.org/show_bug.cgi?id=160497
1030
1031         Reviewed by Michael Catanzaro.
1032
1033         Set the low memory handler before installing the memory pressure handler.
1034
1035         * WebProcess/WebProcess.cpp:
1036         (WebKit::WebProcess::initializeWebProcess):
1037         * WebProcess/cocoa/WebProcessCocoa.mm:
1038         (WebKit::WebProcess::platformInitializeWebProcess):
1039
1040 2016-10-27  Sergio Villar Senin  <svillar@igalia.com>
1041
1042         [GTK] New API to notify about dynamically added forms
1043         https://bugs.webkit.org/show_bug.cgi?id=164050
1044
1045         Reviewed by Carlos Garcia Campos.
1046
1047         This new API exports the WebCore event didAssociateFormControls through the web extension
1048         mechanism. This will help clients (mainly web browsers) to implement robust auto filling
1049         mechanisms. It deals nicely with dynamically created forms (and form controls) as many JS
1050         frameworks do nowadays.
1051
1052         * WebProcess/InjectedBundle/API/gtk/WebKitWebPage.cpp: Added a FormClient implementation of
1053         API::InjectedBundle::FormClient.
1054         (webkitWebPageFormControlsAssociated): Emit the new signal.
1055         (webkit_web_page_class_init): Added the new signal "forms-controls-associated".
1056         (webkitWebPageCreate): Set the WebPage as a FormClient.
1057
1058 2016-11-10  Carlos Alberto Lopez Perez  <clopez@igalia.com>
1059
1060         [GTK] Allow to use WebMemorySampler feature.
1061         https://bugs.webkit.org/show_bug.cgi?id=164517
1062
1063         Reviewed by Carlos Garcia Campos.
1064
1065         Enable the WebMemorySampler with the environment variable WEBKIT_SAMPLE_MEMORY.
1066
1067         When enabled, it will dump the stats to /tmp each second.
1068
1069         * UIProcess/API/gtk/WebKitWebContext.cpp:
1070         (webkitWebContextConstructed):
1071
1072 2016-11-10  Philippe Normand  <pnormand@igalia.com>
1073
1074         [WK2][GTK][GStreamer] Build fails when -plugins-base and -core headers are not installed in the same directory
1075         https://bugs.webkit.org/show_bug.cgi?id=148894
1076
1077         Reviewed by Carlos Garcia Campos.
1078
1079         The pbutils (gst-plugins-base-utils) headers are needed in
1080         WebKit2/GTK for the permission request API related with the
1081         GStreamer codec installer. It builds fine in most cases without
1082         explicitely requiring the pbutils include directory path because
1083         usually all the GStreamer headers are installed in the same path,
1084         excepted for some distributions, like NixOS.
1085
1086         * PlatformGTK.cmake: The GStreamer pbutils include directory was
1087         missing in the header search path.
1088
1089 2016-11-09  Chris Dumez  <cdumez@apple.com>
1090
1091         [WK2][!NETWORK_SESSION] Add support for downloading file backed blobs
1092         https://bugs.webkit.org/show_bug.cgi?id=164522
1093
1094         Reviewed by Alex Christensen.
1095
1096         Add support for downloading file backed blobs for the non-NETWORK_SESSION
1097         code path of WebKit2, which is still use on pre-Sierra macOS.
1098
1099         * NetworkProcess/Downloads/Download.cpp:
1100         (WebKit::Download::~Download):
1101         * NetworkProcess/Downloads/Download.h:
1102         (WebKit::Download::setBlobFileReferences):
1103         * NetworkProcess/Downloads/DownloadManager.cpp:
1104         (WebKit::DownloadManager::startDownload):
1105         (WebKit::DownloadManager::convertNetworkLoadToDownload):
1106         * NetworkProcess/Downloads/DownloadManager.h:
1107         * NetworkProcess/NetworkResourceLoader.cpp:
1108         (WebKit::NetworkResourceLoader::convertToDownload):
1109
1110 2016-11-09  Chris Dumez  <cdumez@apple.com>
1111
1112         [WK2][NETWORK_SESSION] Add support for downloading file backed blobs
1113         https://bugs.webkit.org/show_bug.cgi?id=164458
1114         <rdar://problem/28905514>
1115
1116         Reviewed by Darin Adler.
1117
1118         Add support for downloading file backed blobs on WebKit2.
1119         It previously wasn't working because we weren't calling
1120         BlobDataFileReference::prepareForFileAccess() for each blob file before
1121         starting the download, similarly to what is done in NetworkResourceLoader's
1122         consumeSandboxExtensions().
1123
1124         * NetworkProcess/Downloads/DownloadManager.cpp:
1125         (WebKit::DownloadManager::startDownload):
1126         * NetworkProcess/Downloads/DownloadManager.h:
1127         (WebKit::DownloadManager::startDownload):
1128         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1129         (WebKit::NetworkConnectionToWebProcess::startDownload):
1130         (WebKit::NetworkConnectionToWebProcess::convertMainResourceLoadToDownload):
1131         * NetworkProcess/NetworkDataTask.cpp:
1132         (WebKit::NetworkDataTask::create):
1133         * NetworkProcess/NetworkDataTask.h:
1134         * NetworkProcess/NetworkDataTaskBlob.cpp:
1135         (WebKit::NetworkDataTaskBlob::NetworkDataTaskBlob):
1136         (WebKit::NetworkDataTaskBlob::~NetworkDataTaskBlob):
1137         (WebKit::NetworkDataTaskBlob::download):
1138         * NetworkProcess/NetworkDataTaskBlob.h:
1139         * NetworkProcess/NetworkLoad.cpp:
1140         (WebKit::NetworkLoad::NetworkLoad):
1141         * NetworkProcess/NetworkLoadParameters.h:
1142         * NetworkProcess/NetworkProcess.cpp:
1143         (WebKit::NetworkProcess::downloadRequest):
1144         * NetworkProcess/NetworkResourceLoader.cpp:
1145         (WebKit::NetworkResourceLoader::NetworkResourceLoader):
1146         (WebKit::NetworkResourceLoader::startNetworkLoad):
1147         * NetworkProcess/PingLoad.h:
1148
1149 2016-11-09  Carlos Garcia Campos  <cgarcia@igalia.com>
1150
1151         NetworkSession: Network process crash when converting main resource to download
1152         https://bugs.webkit.org/show_bug.cgi?id=164220
1153
1154         Reviewed by Alex Christensen.
1155
1156         Right after the main resource load is converted to a download, the web process deletes the ResourceLoader which
1157         sends the RemoveLoadIdentifier to the network process and the load is aborted. Sometimes it happens that
1158         NetworkResourceLoader::abort() is called while the NetworkLoad is still deciding the destination of the
1159         download. In such case, NetworkResourceLoader::didConvertToDownload() has already been called, but not
1160         NetworkResourceLoader::didBecomeDownload(). In NetworkResourceLoader::abort() we already handle the case of
1161         having a NetworkLoad after NetworkResourceLoader::didConvertToDownload() has been called, to avoid canceling the
1162         load in such case, however cleanup() is always called unconditionally and the NetworkLoad is deleted before
1163         NetworkResourceLoader::didBecomeDownload() is called. When the NetworkLoad is destroyed the NetworkDataTask
1164         client becomes nullptr, leaving it in a state where both the client is nullptr and the download hasn't been
1165         created yet. That's not expected to happen and when the response completion handler is called in the
1166         NetworkDataTask it tries to use either the client or the download and it crashes.
1167         We need to cleanup and destroy the ResourceLoader as soon as it becomes a download, because that's the expected
1168         behavior, but at the same time we need to keep the NetworkLoad alive until the NetworkDataTask finishes to become
1169         a download. This patch creates a PendingDownload to take the ownership of the NetworkLoad, so that
1170         ResourceLoader can be cleaned up and destroyed. The DownloadManager now will handle the PendingDownload as if it
1171         was created by startDownload(), but ensuring it's deleted right before the final Download object is added to the
1172         downloads map. That way NetworkDataTask will always have a valid client until the final Download is created,
1173         first the ResourceLoader and then the PendingDownload. Since the DownloadManager is the owner of the
1174         PendingDownload we no longer need the didBecomeDownload() callback to delete the NetworkLoad, because the
1175         NetworkLoad will always be owned by the PendingDownload now that will be deleted by the DownloadManager.
1176
1177         * NetworkProcess/Downloads/DownloadManager.cpp:
1178         (WebKit::DownloadManager::dataTaskBecameDownloadTask): Change the ASSERT because at this point we should always
1179         have a PendingDownload, and then remove it from the map here before adding the final Download to the map.
1180         (WebKit::DownloadManager::convertNetworkLoadToDownload): This replaces convertHandleToDownload, but it also now
1181         used for the NetworkSession. It creates a PendingDownload for the given NetworkLoad.
1182         (WebKit::DownloadManager::continueDecidePendingDownloadDestination): Do not take the PendingDownload from the
1183         map here, just check it's present, because it will be removed from dataTaskBecameDownloadTask().
1184         (WebKit::DownloadManager::convertHandleToDownload): Deleted.
1185         * NetworkProcess/Downloads/DownloadManager.h:
1186         * NetworkProcess/Downloads/PendingDownload.cpp:
1187         (WebKit::PendingDownload::PendingDownload): Add a constructor that receives a NetworkLoad.
1188         * NetworkProcess/Downloads/PendingDownload.h:
1189         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1190         (WebKit::NetworkConnectionToWebProcess::convertMainResourceLoadToDownload): Just ask the ResourceLoader to be
1191         converted to a download.
1192         * NetworkProcess/NetworkDataTask.h:
1193         * NetworkProcess/NetworkDataTaskBlob.cpp:
1194         (WebKit::NetworkDataTaskBlob::download): Do not call didBecomeDownload() and add an assert to ensure the client
1195         has already been removed right after the final Download object is created.
1196         * NetworkProcess/NetworkLoad.cpp:
1197         (WebKit::NetworkLoad::NetworkLoad): Use a pointer for the client instead of a reference because now we need to
1198         change the client when the load is converted to a download. We don't need to null check the client in any case
1199         because the member is only updated internally and always from a passed reference.
1200         (WebKit::NetworkLoad::sharedDidReceiveResponse):
1201         (WebKit::NetworkLoad::sharedWillSendRedirectedRequest):
1202         (WebKit::NetworkLoad::convertTaskToDownload): This now receives a PendingDownload. It updates the client and no
1203         longer sends DidStart, because the PendingDownload sends it now.
1204         (WebKit::NetworkLoad::didReceiveChallenge):
1205         (WebKit::NetworkLoad::didReceiveData):
1206         (WebKit::NetworkLoad::didCompleteWithError):
1207         (WebKit::NetworkLoad::didSendData):
1208         (WebKit::NetworkLoad::wasBlocked):
1209         (WebKit::NetworkLoad::cannotShowURL):
1210         (WebKit::NetworkLoad::didReceiveBuffer):
1211         (WebKit::NetworkLoad::didFinishLoading):
1212         (WebKit::NetworkLoad::didFail):
1213         (WebKit::NetworkLoad::canAuthenticateAgainstProtectionSpaceAsync):
1214         (WebKit::NetworkLoad::didBecomeDownload): Deleted.
1215         * NetworkProcess/NetworkLoad.h:
1216         * NetworkProcess/NetworkLoadClient.h: Remove didBecomeDownload().
1217         * NetworkProcess/NetworkResourceLoader.cpp:
1218         (WebKit::NetworkResourceLoader::convertToDownload): This replaces didBecomeDownload() and
1219         didConvertToDownload(). It transfers the NetworkLoad to the DownloadManager.
1220         (WebKit::NetworkResourceLoader::abort): We don't need to check if the load was converted to a download here,
1221         because m_networkLoad will always be null here in such case.
1222         (WebKit::NetworkResourceLoader::didBecomeDownload): Deleted
1223         (WebKit::NetworkResourceLoader::didConvertToDownload): Deleted
1224         * NetworkProcess/NetworkResourceLoader.h:
1225         * NetworkProcess/PingLoad.h: Remove didBecomeDownload().
1226         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.h: Ditto.
1227         * NetworkProcess/cocoa/NetworkDataTaskCocoa.h: Ditto.
1228         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm: Ditto.
1229         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
1230         (-[WKNetworkSessionDelegate URLSession:dataTask:didBecomeDownloadTask:]): Do not call didBecomeDownload().
1231         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
1232         (WebKit::NetworkDataTaskSoup::download): Do not call didBecomeDownload() and add an assert to ensure the client
1233         has already been removed right after the final Download object is created.
1234
1235 2016-11-09  Alex Christensen  <achristensen@webkit.org>
1236
1237         Unreviewed, rolling out r208438.
1238
1239         crashes
1240
1241         Reverted changeset:
1242
1243         "[WK2][NETWORK_SESSION] Add support for downloading file
1244         backed blobs"
1245         https://bugs.webkit.org/show_bug.cgi?id=164458
1246         http://trac.webkit.org/changeset/208438
1247
1248 2016-11-04  Brent Fulgham  <bfulgham@apple.com>
1249
1250         Local HTML should be blocked from localStorage access unless "Disable Local File Restrictions" is checked
1251         https://bugs.webkit.org/show_bug.cgi?id=155185
1252         <rdar://problem/11101440>
1253
1254         Reviewed by Brady Eidson.
1255
1256         Provide SPI to access the new quirk for localStorage. The quirk defaults to 'on'. When active, this
1257         quirk says that localStorage access should be granted, without needing to grant universal file access.
1258
1259         If the quirk is turned off, then localStorage is blocked unless the WebKit client explicitly
1260         grants universal file access.
1261         
1262         Tested by existing TestWebKitAPI tests and WebKit2.LocalStorageQuirkTest
1263
1264         * Shared/WebPreferencesDefinitions.h:
1265         * UIProcess/API/C/WKPreferences.cpp:
1266         (WKPreferencesSetNeedsLocalStorageQuirk): Added.
1267         (WKPreferencesGetNeedsLocalStorageQuirk): Added.
1268         * UIProcess/API/C/WKPreferencesRefPrivate.h:
1269         * UIProcess/API/Cocoa/WKWebView.mm:
1270         (-[WKWebView _initializeWithConfiguration:]): Honor the new localStorage quirk.
1271         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
1272         (-[WKWebViewConfiguration init]): Honor the new localStorage quirk flag.
1273         (-[WKWebViewConfiguration copyWithZone:]): Ditto.
1274         (-[WKWebViewConfiguration _needsLocalStorageQuirk]): Added.
1275         (-[WKWebViewConfiguration _setNeedsLocalStorageQuirk:]): Added.
1276         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
1277         * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
1278         (WKBundleSetNeedsLocalStorageQuirk): Added.
1279         * WebProcess/InjectedBundle/API/c/WKBundlePrivate.h:
1280         * WebProcess/InjectedBundle/InjectedBundle.cpp:
1281         (WebKit::InjectedBundle::setNeedsLocalStorageQuirk): Added.
1282         * WebProcess/InjectedBundle/InjectedBundle.h:
1283         * WebProcess/WebPage/WebPage.cpp:
1284         (WebKit::WebPage::updatePreferences): Honor the new localStorage quirk flag.
1285
1286 2016-11-09  Simon Fraser  <simon.fraser@apple.com>
1287
1288         Implement visual-viewport based position:fixed handling for Mac async scrolling
1289         https://bugs.webkit.org/show_bug.cgi?id=164495
1290
1291         Reviewed by Tim Horton.
1292
1293         Educate the scrolling tree about visual and layout viewports. This is runtime-switchable,
1294         so we push the enable flag to via the root state node, then push the layout viewport,
1295         and the min/max scroll position that contstrain it, through frame state nodes.
1296
1297         When a scroll happens, we compute a new layout viewport when the visual viewport hits
1298         an edge, and push that down through setScrollLayerPosition() since it's used to position
1299         fixed and sticky layers.
1300
1301         The iOS code is made to compile, but not work yet.
1302
1303         * Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp:
1304         (ArgumentCoder<ScrollingStateFrameScrollingNode>::encode):
1305         (ArgumentCoder<ScrollingStateFrameScrollingNode>::decode):
1306         * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp:
1307         (WebKit::RemoteScrollingCoordinatorProxy::scrollingTreeNodeDidScroll):
1308         * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h:
1309         * UIProcess/Scrolling/RemoteScrollingTree.cpp:
1310         (WebKit::RemoteScrollingTree::scrollingTreeNodeDidScroll):
1311         * UIProcess/Scrolling/RemoteScrollingTree.h:
1312         * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.h:
1313         * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:
1314         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::setScrollLayerPosition):
1315         * WebProcess/Scrolling/RemoteScrollingCoordinator.mm:
1316         (WebKit::RemoteScrollingCoordinator::scrollPositionChangedForNode):
1317
1318 2016-11-09  Beth Dakin  <bdakin@apple.com>
1319
1320         More attempted build fix.
1321
1322         * UIProcess/Cocoa/WebViewImpl.mm:
1323
1324 2016-11-09  Alex Christensen  <achristensen@webkit.org>
1325
1326         Clean up Storage code
1327         https://bugs.webkit.org/show_bug.cgi?id=164562
1328
1329         Reviewed by Brady Eidson.
1330
1331         Use more Refs!
1332
1333         * NetworkProcess/CustomProtocols/CustomProtocolManager.h:
1334         * Platform/IPC/Connection.cpp:
1335         (IPC::Connection::addWorkQueueMessageReceiver):
1336         * Platform/IPC/Connection.h:
1337         * UIProcess/Storage/LocalStorageDatabase.cpp:
1338         (WebKit::LocalStorageDatabase::create):
1339         (WebKit::LocalStorageDatabase::LocalStorageDatabase):
1340         * UIProcess/Storage/LocalStorageDatabase.h:
1341         * UIProcess/Storage/LocalStorageDatabaseTracker.cpp:
1342         (WebKit::LocalStorageDatabaseTracker::create):
1343         (WebKit::LocalStorageDatabaseTracker::LocalStorageDatabaseTracker):
1344         * UIProcess/Storage/LocalStorageDatabaseTracker.h:
1345         * UIProcess/Storage/StorageManager.cpp:
1346         (WebKit::StorageManager::StorageArea::openDatabaseAndImportItemsIfNeeded):
1347         (WebKit::StorageManager::StorageManager):
1348         * UIProcess/Storage/StorageManager.h:
1349         * UIProcess/WebResourceLoadStatisticsStore.cpp:
1350         (WebKit::WebResourceLoadStatisticsStore::processWillOpenConnection):
1351         * UIProcess/mac/SecItemShimProxy.cpp:
1352         (WebKit::SecItemShimProxy::initializeConnection):
1353         * WebProcess/Plugins/PluginProcessConnectionManager.cpp:
1354         (WebKit::PluginProcessConnectionManager::initializeConnection):
1355         * WebProcess/WebPage/EventDispatcher.cpp:
1356         (WebKit::EventDispatcher::initializeConnection):
1357         * WebProcess/WebPage/ViewUpdateDispatcher.cpp:
1358         (WebKit::ViewUpdateDispatcher::initializeConnection):
1359
1360 2016-11-09  Beth Dakin  <bdakin@apple.com>
1361
1362         Another attempted build fix.
1363
1364         * UIProcess/Cocoa/WebViewImpl.mm:
1365
1366 2016-11-09  Michael Catanzaro  <mcatanzaro@igalia.com>
1367
1368         Experimental features should not be enabled by default
1369         https://bugs.webkit.org/show_bug.cgi?id=164367
1370
1371         Reviewed by Darin Adler.
1372
1373         We have two classes of experimental features:
1374
1375         (1) Features that are unstable and should be off by default, except for the developers
1376             currently working on them. This is straightforward to handle; the default value should
1377             be false.
1378         (2) Features that are still not ready for end users, but are stable enough for testing. We
1379             want these features to be enabled in testing environments like the bots, MiniBrowser,
1380             Safari Tech Preview, and so forth, but not in stable release builds.
1381
1382         Implement this. It is better than having all experimental features on unconditionally, and
1383         expecting them to be disabled manually on release branches, which is not something we are
1384         keen to do. An exception is Cocoa ports, which to my knowledge do not currently have any
1385         concept of development builds. These ports seem happy to continue disabling features
1386         manually in release branches, and should continue to do so at least for now.
1387
1388         We also have features that we wish to enumerate at runtime, yet have enabled by default
1389         unconditionally. We do not currently have any infrastructure to support this and should not
1390         abuse the experimental status for this purpose; it requires future work. All settings can
1391         still be toggled at runtime by clients that know about them using the existing runtime
1392         features API.
1393
1394         Lastly, the custom elements feature is ready to be enabled by default, so it's no longer
1395         experimental and can graduate to the list of normal boolean features.
1396
1397         * Shared/WebPreferencesDefinitions.h:
1398
1399 2016-11-09  Beth Dakin  <bdakin@apple.com>
1400
1401         Build fix.
1402
1403         * UIProcess/Cocoa/WebViewImpl.mm:
1404
1405 2016-11-09  Brady Eidson  <beidson@apple.com>
1406
1407         IndexedDB 2.0: Encapsulate cursor iteration parameters for easy future expansion.
1408         https://bugs.webkit.org/show_bug.cgi?id=164504
1409
1410         Reviewed by Darin Adler.
1411
1412         * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.cpp:
1413         (WebKit::WebIDBConnectionToClient::iterateCursor):
1414         * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.h:
1415         * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.messages.in:
1416
1417         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
1418         (WebKit::WebIDBConnectionToServer::iterateCursor):
1419         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h:
1420
1421 2016-11-09  Darin Adler  <darin@apple.com>
1422
1423         Move Range from ExceptionCode to ExceptionOr
1424         https://bugs.webkit.org/show_bug.cgi?id=164457
1425
1426         Reviewed by Alex Christensen.
1427
1428         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMRange.cpp:
1429         (webkit_dom_range_set_start): Updated exception handling.
1430         (webkit_dom_range_set_end): Ditto.
1431         (webkit_dom_range_set_start_before): Ditto.
1432         (webkit_dom_range_set_start_after): Ditto.
1433         (webkit_dom_range_set_end_before): Ditto.
1434         (webkit_dom_range_set_end_after): Ditto.
1435         (webkit_dom_range_select_node): Ditto.
1436         (webkit_dom_range_select_node_contents): Ditto.
1437         (webkit_dom_range_compare_boundary_points): Ditto.
1438         (webkit_dom_range_delete_contents): Ditto.
1439         (webkit_dom_range_extract_contents): Ditto.
1440         (webkit_dom_range_clone_contents): Ditto.
1441         (webkit_dom_range_insert_node): Ditto.
1442         (webkit_dom_range_surround_contents): Ditto.
1443         (webkit_dom_range_create_contextual_fragment): Ditto.
1444         (webkit_dom_range_compare_node): Ditto.
1445         (webkit_dom_range_intersects_node): Ditto.
1446         (webkit_dom_range_compare_point): Ditto.
1447         (webkit_dom_range_is_point_in_range): Ditto.
1448         (webkit_dom_range_expand): Ditto.
1449         * WebProcess/InjectedBundle/API/mac/WKDOMRange.mm:
1450         (-[WKDOMRange setStart:offset:]): Ditto.
1451         (-[WKDOMRange setEnd:offset:]): Ditto.
1452         (-[WKDOMRange selectNode:]): Ditto.
1453         (-[WKDOMRange selectNodeContents:]): Ditto.
1454         * WebProcess/WebPage/WebFrame.cpp:
1455         (WebKit::WebFrame::contentsAsString): Ditto.
1456         * WebProcess/WebPage/ios/WebPageIOS.mm:
1457         (WebKit::WebPage::rangeForWebSelectionAtPosition): Ditto.
1458         (WebKit::WebPage::rangeForBlockAtPoint): Ditto.
1459         (WebKit::WebPage::selectWithGesture): Ditto.
1460         (WebKit::containsRange): Ditto.
1461         (WebKit::unionDOMRanges): Ditto.
1462         (WebKit::WebPage::switchToBlockSelectionAtPoint): Ditto.
1463         (WebKit::WebPage::getPositionInformation): Ditto.
1464
1465
1466 2016-11-09  Darin Adler  <darin@apple.com>
1467
1468         Move EventTarget from ExceptionCode to ExceptionOr
1469         https://bugs.webkit.org/show_bug.cgi?id=164465
1470
1471         Reviewed by Youenn Fablet.
1472
1473         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMAttr.cpp:
1474         (webkit_dom_attr_dispatch_event): Updated exception handling.
1475         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCDATASection.cpp:
1476         (webkit_dom_cdata_section_dispatch_event): Ditto.
1477         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCharacterData.cpp:
1478         (webkit_dom_character_data_dispatch_event): Ditto.
1479         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMComment.cpp:
1480         (webkit_dom_comment_dispatch_event): Ditto.
1481         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMWindow.cpp:
1482         (webkit_dom_dom_window_dispatch_event): Ditto.
1483         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocument.cpp:
1484         (webkit_dom_document_dispatch_event): Ditto.
1485         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentFragment.cpp:
1486         (webkit_dom_document_fragment_dispatch_event): Ditto.
1487         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentType.cpp:
1488         (webkit_dom_document_type_dispatch_event): Ditto.
1489         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElement.cpp:
1490         (webkit_dom_element_dispatch_event): Ditto.
1491         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAnchorElement.cpp:
1492         (webkit_dom_html_anchor_element_dispatch_event): Ditto.
1493         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAppletElement.cpp:
1494         (webkit_dom_html_applet_element_dispatch_event): Ditto.
1495         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAreaElement.cpp:
1496         (webkit_dom_html_area_element_dispatch_event): Ditto.
1497         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBRElement.cpp:
1498         (webkit_dom_html_br_element_dispatch_event): Ditto.
1499         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBaseElement.cpp:
1500         (webkit_dom_html_base_element_dispatch_event): Ditto.
1501         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBodyElement.cpp:
1502         (webkit_dom_html_body_element_dispatch_event): Ditto.
1503         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLButtonElement.cpp:
1504         (webkit_dom_html_button_element_dispatch_event): Ditto.
1505         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLCanvasElement.cpp:
1506         (webkit_dom_html_canvas_element_dispatch_event): Ditto.
1507         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDListElement.cpp:
1508         (webkit_dom_html_d_list_element_dispatch_event): Ditto.
1509         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDirectoryElement.cpp:
1510         (webkit_dom_html_directory_element_dispatch_event): Ditto.
1511         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDivElement.cpp:
1512         (webkit_dom_html_div_element_dispatch_event): Ditto.
1513         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDocument.cpp:
1514         (webkit_dom_html_document_dispatch_event): Ditto.
1515         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLElement.cpp:
1516         (webkit_dom_html_element_dispatch_event): Ditto.
1517         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLEmbedElement.cpp:
1518         (webkit_dom_html_embed_element_dispatch_event): Ditto.
1519         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFieldSetElement.cpp:
1520         (webkit_dom_html_field_set_element_dispatch_event): Ditto.
1521         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFontElement.cpp:
1522         (webkit_dom_html_font_element_dispatch_event): Ditto.
1523         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFormElement.cpp:
1524         (webkit_dom_html_form_element_dispatch_event): Ditto.
1525         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFrameElement.cpp:
1526         (webkit_dom_html_frame_element_dispatch_event): Ditto.
1527         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFrameSetElement.cpp:
1528         (webkit_dom_html_frame_set_element_dispatch_event): Ditto.
1529         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHRElement.cpp:
1530         (webkit_dom_html_hr_element_dispatch_event): Ditto.
1531         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHeadingElement.cpp:
1532         (webkit_dom_html_heading_element_dispatch_event): Ditto.
1533         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHeadElement.cpp:
1534         (webkit_dom_html_head_element_dispatch_event): Ditto.
1535         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHtmlElement.cpp:
1536         (webkit_dom_html_html_element_dispatch_event): Ditto.
1537         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLIFrameElement.cpp:
1538         (webkit_dom_html_iframe_element_dispatch_event): Ditto.
1539         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLImageElement.cpp:
1540         (webkit_dom_html_image_element_dispatch_event): Ditto.
1541         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLInputElement.cpp:
1542         (webkit_dom_html_input_element_dispatch_event): Ditto.
1543         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLIElement.cpp:
1544         (webkit_dom_html_li_element_dispatch_event): Ditto.
1545         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLabelElement.cpp:
1546         (webkit_dom_html_label_element_dispatch_event): Ditto.
1547         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLegendElement.cpp:
1548         (webkit_dom_html_legend_element_dispatch_event): Ditto.
1549         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLinkElement.cpp:
1550         (webkit_dom_html_link_element_dispatch_event): Ditto.
1551         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMapElement.cpp:
1552         (webkit_dom_html_map_element_dispatch_event): Ditto.
1553         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMarqueeElement.cpp:
1554         (webkit_dom_html_marquee_element_dispatch_event): Ditto.
1555         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMenuElement.cpp:
1556         (webkit_dom_html_menu_element_dispatch_event): Ditto.
1557         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMetaElement.cpp:
1558         (webkit_dom_html_meta_element_dispatch_event): Ditto.
1559         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLModElement.cpp:
1560         (webkit_dom_html_mod_element_dispatch_event): Ditto.
1561         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOListElement.cpp:
1562         (webkit_dom_html_o_list_element_dispatch_event): Ditto.
1563         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLObjectElement.cpp:
1564         (webkit_dom_html_object_element_dispatch_event): Ditto.
1565         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptGroupElement.cpp:
1566         (webkit_dom_html_opt_group_element_dispatch_event): Ditto.
1567         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptionElement.cpp:
1568         (webkit_dom_html_option_element_dispatch_event): Ditto.
1569         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLParagraphElement.cpp:
1570         (webkit_dom_html_paragraph_element_dispatch_event): Ditto.
1571         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLParamElement.cpp:
1572         (webkit_dom_html_param_element_dispatch_event): Ditto.
1573         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLPreElement.cpp:
1574         (webkit_dom_html_pre_element_dispatch_event): Ditto.
1575         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLQuoteElement.cpp:
1576         (webkit_dom_html_quote_element_dispatch_event): Ditto.
1577         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLScriptElement.cpp:
1578         (webkit_dom_html_script_element_dispatch_event): Ditto.
1579         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLSelectElement.cpp:
1580         (webkit_dom_html_select_element_dispatch_event): Ditto.
1581         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLStyleElement.cpp:
1582         (webkit_dom_html_style_element_dispatch_event): Ditto.
1583         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableCaptionElement.cpp:
1584         (webkit_dom_html_table_caption_element_dispatch_event): Ditto.
1585         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableCellElement.cpp:
1586         (webkit_dom_html_table_cell_element_dispatch_event): Ditto.
1587         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableColElement.cpp:
1588         (webkit_dom_html_table_col_element_dispatch_event): Ditto.
1589         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableElement.cpp:
1590         (webkit_dom_html_table_element_dispatch_event): Ditto.
1591         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableRowElement.cpp:
1592         (webkit_dom_html_table_row_element_dispatch_event): Ditto.
1593         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableSectionElement.cpp:
1594         (webkit_dom_html_table_section_element_dispatch_event): Ditto.
1595         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTextAreaElement.cpp:
1596         (webkit_dom_html_text_area_element_dispatch_event): Ditto.
1597         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTitleElement.cpp:
1598         (webkit_dom_html_title_element_dispatch_event): Ditto.
1599         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLUListElement.cpp:
1600         (webkit_dom_html_u_list_element_dispatch_event): Ditto.
1601         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNode.cpp:
1602         (webkit_dom_node_dispatch_event): Ditto.
1603         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMProcessingInstruction.cpp:
1604         (webkit_dom_processing_instruction_dispatch_event): Ditto.
1605         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMText.cpp:
1606         (webkit_dom_text_dispatch_event): Ditto.
1607
1608 2016-11-08  Dean Jackson  <dino@apple.com>
1609
1610         Rendering support for ExtendedColors
1611         https://bugs.webkit.org/show_bug.cgi?id=164443
1612         <rdar://problems/29123243>
1613
1614         Reviewed by Simon Fraser and Darin Adler.
1615
1616         Implement argument coders for Color.
1617
1618         * Shared/WebCoreArgumentCoders.cpp:
1619         (IPC::ArgumentCoder<Color>::encode):
1620         (IPC::ArgumentCoder<Color>::decode):
1621         * Shared/WebCoreArgumentCoders.h:
1622         * UIProcess/API/Cocoa/WKWebView.mm:
1623         (-[WKWebView _updateScrollViewBackground]):
1624
1625 2016-11-09  Beth Dakin  <bdakin@apple.com>
1626
1627         Build fix.
1628
1629         * UIProcess/Cocoa/WebViewImpl.mm:
1630         (WebKit::WebViewImpl::~WebViewImpl):
1631
1632 2016-11-09  Chris Dumez  <cdumez@apple.com>
1633
1634         [Mac] Stop using deprecated AppKit enumeration values
1635         https://bugs.webkit.org/show_bug.cgi?id=164494
1636
1637         Reviewed by Darin Adler.
1638
1639         Stop using deprecated AppKit enumeration values.
1640
1641         * Shared/mac/ChildProcessMac.mm:
1642         (WebKit::ChildProcess::stopNSAppRunLoop):
1643         * Shared/mac/WebEventFactory.mm:
1644         (WebKit::mouseButtonForEvent):
1645         (WebKit::mouseEventTypeForEvent):
1646         (WebKit::clickCountForEvent):
1647         (WebKit::globalPointForEvent):
1648         (WebKit::pointForEvent):
1649         (WebKit::textFromEvent):
1650         (WebKit::unmodifiedTextFromEvent):
1651         (WebKit::isKeypadEvent):
1652         (WebKit::isKeyUpEvent):
1653         (WebKit::WebEventFactory::createWebKeyboardEvent):
1654         * UIProcess/Cocoa/WebViewImpl.mm:
1655         (WebKit::WebViewImpl::becomeFirstResponder):
1656         (WebKit::WebViewImpl::updateContentInsetsIfAutomatic):
1657         (WebKit::WebViewImpl::viewDidMoveToWindow):
1658         (WebKit::WebViewImpl::postFakeMouseMovedEventForFlagsChangedEvent):
1659         (WebKit::WebViewImpl::createFullScreenWindow):
1660         (WebKit::WebViewImpl::sendToolTipMouseExited):
1661         (WebKit::WebViewImpl::sendToolTipMouseEntered):
1662         (WebKit::applicationFlagsForDrag):
1663         (WebKit::WebViewImpl::setLastMouseDownEvent):
1664         (WebKit::WebViewImpl::doneWithKeyEvent):
1665         (WebKit::WebViewImpl::collectKeyboardLayoutCommandsForEvent):
1666         (WebKit::WebViewImpl::performKeyEquivalent):
1667         * UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
1668         (WebKit::PluginProcessProxy::beginModal):
1669         * UIProcess/mac/WebContextMenuProxyMac.mm:
1670         (WebKit::WebContextMenuProxyMac::showContextMenuWithItems):
1671         * UIProcess/mac/WebInspectorProxyMac.mm:
1672         * UIProcess/mac/WebPopupMenuProxyMac.mm:
1673         (WebKit::WebPopupMenuProxyMac::populate):
1674         (WebKit::WebPopupMenuProxyMac::showPopupMenu):
1675         * WebProcess/Plugins/PDF/DeprecatedPDFPlugin.mm:
1676         (WebKit::modifierFlagsFromWebEvent):
1677         (WebKit::getEventTypeFromWebEvent):
1678         * WebProcess/Plugins/PDF/PDFPluginTextAnnotation.mm:
1679         (WebKit::cssAlignmentValueForNSTextAlignment):
1680         * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
1681         (WebKit::convertImageToBitmap):
1682
1683 2016-11-09  Beth Dakin  <bdakin@apple.com>
1684
1685         Support TouchBar in WebKit
1686         https://bugs.webkit.org/show_bug.cgi?id=164437
1687         -and corresponding-
1688         rdar://problem/28876524
1689
1690         Reviewed by Darin Adler.
1691
1692         * UIProcess/API/Cocoa/WKViewPrivate.h:
1693         * UIProcess/API/Cocoa/WKWebView.mm:
1694         (-[WKWebView makeTouchBar]):
1695         (-[WKWebView candidateListTouchBarItem]):
1696         (-[WKWebView _web_didAddMediaControlsManager:]):
1697         (-[WKWebView _web_didRemoveMediaControlsManager]):
1698         (-[WKWebView _interactWithMediaControlsForTesting]):
1699         (-[WKWebView _wantsMediaPlaybackControlsView]):
1700         (-[WKWebView _setWantsMediaPlaybackControlsView:]):
1701         (-[WKWebView _mediaPlaybackControlsView]):
1702         (-[WKWebView _addMediaPlaybackControlsView:]):
1703         (-[WKWebView _removeMediaPlaybackControlsView]):
1704         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1705         * UIProcess/API/mac/WKView.mm:
1706         (-[WKView makeTouchBar]):
1707         (-[WKView candidateListTouchBarItem]):
1708         (-[WKView _web_didAddMediaControlsManager:]):
1709         (-[WKView _web_didRemoveMediaControlsManager]):
1710         (-[WKView _wantsMediaPlaybackControlsView]):
1711         (-[WKView _setWantsMediaPlaybackControlsView:]):
1712         (-[WKView _mediaPlaybackControlsView]):
1713         (-[WKView _addMediaPlaybackControlsView:]):
1714         (-[WKView _removeMediaPlaybackControlsView]):
1715         * UIProcess/Cocoa/WebViewImpl.h:
1716         (WebKit::WebViewImpl::currentTouchBar):
1717         (WebKit::WebViewImpl::clientWantsMediaPlaybackControlsView):
1718         (WebKit::WebViewImpl::setClientWantsMediaPlaybackControlsView):
1719         (WebKit::WebViewImpl::setIsCustomizingTouchBar):
1720         * UIProcess/Cocoa/WebViewImpl.mm:
1721         (-[WKTextListTouchBarViewController initWithWebViewImpl:]):
1722         (-[WKTextListTouchBarViewController didDestroyView]):
1723         (-[WKTextListTouchBarViewController _selectList:]):
1724         (-[WKTextListTouchBarViewController setCurrentListType:]):
1725         (-[WKTextTouchBarItemController initWithWebViewImpl:]):
1726         (-[WKTextTouchBarItemController didDestroyView]):
1727         (-[WKTextTouchBarItemController touchBar:makeItemForIdentifier:]):
1728         (-[WKTextTouchBarItemController itemForIdentifier:]):
1729         (-[WKTextTouchBarItemController candidateListTouchBarItem:endSelectingCandidateAtIndex:]):
1730         (-[WKTextTouchBarItemController candidateListTouchBarItem:changedCandidateListVisibility:]):
1731         (-[WKTextTouchBarItemController textListTouchBarViewController]):
1732         (-[WKTextTouchBarItemController setTextIsBold:]):
1733         (-[WKTextTouchBarItemController setTextIsItalic:]):
1734         (-[WKTextTouchBarItemController setTextIsUnderlined:]):
1735         (-[WKTextTouchBarItemController _wkChangeTextStyle:]):
1736         (-[WKTextTouchBarItemController setCurrentTextAlignment:]):
1737         (-[WKTextTouchBarItemController _wkChangeTextAlignment:]):
1738         (-[WKTextTouchBarItemController textColor]):
1739         (-[WKTextTouchBarItemController setTextColor:]):
1740         (-[WKTextTouchBarItemController _wkChangeColor:]):
1741         (-[WKTextTouchBarItemController textListViewController]):
1742         (WebKit::WebViewImpl::makeTouchBar):
1743         (WebKit::WebViewImpl::candidateListTouchBarItem):
1744         (WebKit::WebViewImpl::mediaPlaybackControlsView):
1745         (WebKit::WebViewImpl::useMediaPlaybackControlsView):
1746         (WebKit::WebViewImpl::dismissTextTouchBarPopoverItemWithIdentifier):
1747         (WebKit::textTouchBarCustomizationAllowedIdentifiers):
1748         (WebKit::plainTextTouchBarCustomizationDefaultItemIdentifiers):
1749         (WebKit::richTextTouchBarCustomizationDefaultItemIdentifiers):
1750         (WebKit::touchBarDidExitCustomization):
1751         (WebKit::touchBarWillEnterCustomization):
1752         (WebKit::didChangeAutomaticTextCompletion):
1753         (WebKit::WebViewImpl::updateTouchBarAndRefreshTextBarIdentifiers):
1754         (WebKit::WebViewImpl::setUpTextTouchBar):
1755         (WebKit::WebViewImpl::isRichlyEditable):
1756         (WebKit::WebViewImpl::textTouchBar):
1757         (WebKit::WebViewImpl::updateTextTouchBar):
1758         (WebKit::WebViewImpl::updateMediaTouchBar):
1759         (WebKit::WebViewImpl::forceRequestCandidatesForTesting):
1760         (WebKit::WebViewImpl::updateTouchBar):
1761         (WebKit::WebViewImpl::shouldRequestCandidates):
1762         (WebKit::WebViewImpl::showCandidates):
1763         (WebKit::WebViewImpl::webViewImplAdditionsWillDestroyView):
1764         (WebKit::WebViewImpl::setEditableElementIsFocused):
1765         (WebKit::WebViewImpl::becomeFirstResponder):
1766         (WebKit::WebViewImpl::selectionDidChange):
1767         (WebKit::WebViewImpl::videoControlsManagerDidChange):
1768         (WebKit::WebViewImpl::updateWebViewImplAdditions): Deleted.
1769
1770 2016-11-09  Chris Dumez  <cdumez@apple.com>
1771
1772         [WK2][NETWORK_SESSION] Add support for downloading file backed blobs
1773         https://bugs.webkit.org/show_bug.cgi?id=164458
1774         <rdar://problem/28905514>
1775
1776         Reviewed by Darin Adler.
1777
1778         Add support for downloading file backed blobs on WebKit2.
1779         It previously wasn't working because we weren't calling
1780         BlobDataFileReference::prepareForFileAccess() for each blob file before
1781         starting the download, similarly to what is done in NetworkResourceLoader's
1782         consumeSandboxExtensions().
1783
1784         * NetworkProcess/Downloads/DownloadManager.cpp:
1785         (WebKit::DownloadManager::startDownload):
1786         * NetworkProcess/Downloads/DownloadManager.h:
1787         (WebKit::DownloadManager::startDownload):
1788         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1789         (WebKit::NetworkConnectionToWebProcess::startDownload):
1790         (WebKit::NetworkConnectionToWebProcess::convertMainResourceLoadToDownload):
1791         * NetworkProcess/NetworkDataTask.cpp:
1792         (WebKit::NetworkDataTask::create):
1793         * NetworkProcess/NetworkDataTask.h:
1794         * NetworkProcess/NetworkDataTaskBlob.cpp:
1795         (WebKit::NetworkDataTaskBlob::NetworkDataTaskBlob):
1796         (WebKit::NetworkDataTaskBlob::~NetworkDataTaskBlob):
1797         (WebKit::NetworkDataTaskBlob::download):
1798         * NetworkProcess/NetworkDataTaskBlob.h:
1799         * NetworkProcess/NetworkLoad.cpp:
1800         (WebKit::NetworkLoad::NetworkLoad):
1801         * NetworkProcess/NetworkLoadParameters.h:
1802         * NetworkProcess/NetworkProcess.cpp:
1803         (WebKit::NetworkProcess::downloadRequest):
1804         * NetworkProcess/NetworkResourceLoader.cpp:
1805         (WebKit::NetworkResourceLoader::NetworkResourceLoader):
1806         (WebKit::NetworkResourceLoader::startNetworkLoad):
1807         * NetworkProcess/PingLoad.h:
1808
1809 2016-11-09  Chris Dumez  <cdumez@apple.com>
1810
1811         [WK2] Network cache speculative revalidation can cause loads to hang
1812         https://bugs.webkit.org/show_bug.cgi?id=164532
1813         <rdar://problem/28519331>
1814
1815         Reviewed by Alex Christensen.
1816
1817         Network cache speculative revalidation could cause loads to hang when HTTP
1818         authentication was involved because NetworkCacheSpeculativeLoad failed to
1819         call NetworkLoad::continueCanAuthenticateAgainstProtectionSpace() in its
1820         canAuthenticateAgainstProtectionSpaceAsync() callback.
1821
1822         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
1823         (WebKit::NetworkCache::SpeculativeLoad::canAuthenticateAgainstProtectionSpaceAsync):
1824         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.h:
1825
1826 2016-11-09  Csaba Osztrogonác  <ossy@webkit.org>
1827
1828         URTBF after r208361.
1829
1830         * PlatformMac.cmake:
1831
1832 2016-11-09  Csaba Osztrogonác  <ossy@webkit.org>
1833
1834         Unreviewed typo fix after r160616 to fix the build on case sensitive file systems.
1835
1836         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
1837
1838 2016-11-05  Carlos Garcia Campos  <cgarcia@igalia.com>
1839
1840         [SOUP] Layout test http/tests/misc/authentication-redirect-3/authentication-sent-to-redirect-same-origin-with-location-credentials.html fails
1841         https://bugs.webkit.org/show_bug.cgi?id=139358
1842
1843         Reviewed by Michael Catanzaro.
1844
1845         Stop putting the credentials in the URL unconditionally and ensure we only do that when provided by the URL
1846         itself. Libsoup has its own cache of SoupAuth, so we don't need to pass user/pass in the URL for every single
1847         request, libsoup will authenticate those automatically.
1848
1849         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
1850         (WebKit::NetworkDataTaskSoup::applyAuthenticationToRequest):
1851
1852 2016-11-04  Filip Pizlo  <fpizlo@apple.com>
1853
1854         WTF::ParkingLot should stop using std::chrono because std::chrono::duration casts are prone to overflows
1855         https://bugs.webkit.org/show_bug.cgi?id=152045
1856
1857         Reviewed by Andy Estes.
1858
1859         * Platform/IPC/Connection.cpp:
1860         (IPC::Connection::SyncMessageState::wait):
1861         (IPC::Connection::sendMessage):
1862         (IPC::Connection::timeoutRespectingIgnoreTimeoutsForTesting):
1863         (IPC::Connection::waitForMessage):
1864         (IPC::Connection::sendSyncMessage):
1865         (IPC::Connection::waitForSyncReply):
1866         * Platform/IPC/Connection.h:
1867         (IPC::Connection::sendSync):
1868         (IPC::Connection::waitForAndDispatchImmediately):
1869         * Platform/IPC/MessageSender.h:
1870         (IPC::MessageSender::sendSync):
1871         * UIProcess/ChildProcessProxy.h:
1872         (WebKit::ChildProcessProxy::sendSync):
1873         * UIProcess/Network/NetworkProcessProxy.cpp:
1874         (WebKit::NetworkProcessProxy::sendProcessWillSuspendImminently):
1875         * UIProcess/Storage/StorageManager.cpp:
1876         (WebKit::StorageManager::applicationWillTerminate):
1877         * UIProcess/WebProcessProxy.cpp:
1878         (WebKit::WebProcessProxy::sendProcessWillSuspendImminently):
1879         * UIProcess/WebResourceLoadStatisticsStore.cpp:
1880         (WebKit::WebResourceLoadStatisticsStore::applicationWillTerminate):
1881         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h:
1882         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
1883         (-[WKOneShotDisplayLinkHandler displayLinkFired:]):
1884         (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
1885         (WebKit::RemoteLayerTreeDrawingAreaProxy::didRefreshDisplay):
1886         (WebKit::RemoteLayerTreeDrawingAreaProxy::waitForDidUpdateActivityState):
1887         * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm:
1888         (WebKit::TiledCoreAnimationDrawingAreaProxy::waitForDidUpdateActivityState):
1889         * UIProcess/mac/WKImmediateActionController.mm:
1890         (-[WKImmediateActionController immediateActionRecognizerWillBeginAnimation:]):
1891         * UIProcess/mac/WebPageProxyMac.mm:
1892         (WebKit::WebPageProxy::stringSelectionForPasteboard):
1893         (WebKit::WebPageProxy::dataSelectionForPasteboard):
1894         (WebKit::WebPageProxy::readSelectionFromPasteboard):
1895         (WebKit::WebPageProxy::shouldDelayWindowOrderingForEvent):
1896         (WebKit::WebPageProxy::acceptsFirstMouse):
1897         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1898         (WebKit::WebChromeClient::runBeforeUnloadConfirmPanel):
1899         (WebKit::WebChromeClient::runJavaScriptAlert):
1900         (WebKit::WebChromeClient::runJavaScriptConfirm):
1901         (WebKit::WebChromeClient::runJavaScriptPrompt):
1902         (WebKit::WebChromeClient::print):
1903         (WebKit::WebChromeClient::exceededDatabaseQuota):
1904         (WebKit::WebChromeClient::reachedApplicationCacheOriginQuota):
1905         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1906         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):
1907         * WebProcess/WebPage/WebPage.cpp:
1908         (WebKit::WebPage::postSynchronousMessageForTesting):
1909
1910 2016-11-04  Wenson Hsieh  <wenson_hsieh@apple.com>
1911
1912         Safari does not emit composition end if blurred for dead key / Japanese IME
1913         https://bugs.webkit.org/show_bug.cgi?id=164369
1914         <rdar://problem/29050439>
1915
1916         Reviewed by Ryosuke Niwa.
1917
1918         Split WebPage::discardedComposition into two steps, where we first discard marked text and then update the
1919         editor state. This allows the codepath where we cancel the composition early (before setting the selection) to
1920         discard marked text without also forcing an editor state update at the same time. The editor state is later
1921         updated in WebPage::didChangeSelection.
1922
1923         * UIProcess/WebPageProxy.cpp:
1924         (WebKit::WebPageProxy::compositionWasCanceled):
1925         * UIProcess/WebPageProxy.h:
1926         * UIProcess/WebPageProxy.messages.in:
1927         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
1928         (WebKit::WebEditorClient::canceledComposition):
1929         * WebProcess/WebCoreSupport/WebEditorClient.h:
1930         * WebProcess/WebPage/WebPage.cpp:
1931         (WebKit::WebPage::didChangeSelection):
1932         (WebKit::WebPage::discardedComposition):
1933         (WebKit::WebPage::canceledComposition):
1934         * WebProcess/WebPage/WebPage.h:
1935
1936 2016-11-04  Alex Christensen  <achristensen@webkit.org>
1937
1938         Unreviewed, rolling out r208293.
1939
1940         asserts in API tests.
1941
1942         Reverted changeset:
1943
1944         "NetworkSession: Network process crash when converting main
1945         resource to download"
1946         https://bugs.webkit.org/show_bug.cgi?id=164220
1947         http://trac.webkit.org/changeset/208293
1948
1949 2016-11-04  Said Abou-Hallawa  <sabouhallawa@apple.com>
1950
1951         Add a setting and preferences to enable/disable async image decoding
1952         https://bugs.webkit.org/show_bug.cgi?id=164417
1953
1954         Reviewed by Simon Fraser.
1955
1956         Hook up the asyncImageDecodingEnabled setting for WebKit2.
1957
1958         * Shared/WebPreferencesDefinitions.h:
1959         * UIProcess/API/Cocoa/WKPreferences.mm:
1960         (-[WKPreferences _asyncImageDecodingEnabled]):
1961         (-[WKPreferences _setAsyncImageDecodingEnabled:]):
1962         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
1963         * WebProcess/InjectedBundle/InjectedBundle.cpp:
1964         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
1965         * WebProcess/WebPage/WebPage.cpp:
1966         (WebKit::WebPage::updatePreferences):
1967
1968 2016-11-04  Simon Fraser  <simon.fraser@apple.com>
1969
1970         Rename some ScrollingTree/Node-related functions to reduce the number of uses of "update"
1971         https://bugs.webkit.org/show_bug.cgi?id=164420
1972
1973         Reviewed by Tim Horton.
1974
1975         Rename:
1976             commitNewTreeState -> commitTreeState ("new" was redundant)
1977             updateBeforeChildren -> commitStateBeforeChildren
1978             updateAfterChildren -> commitStateAfterChildren
1979
1980
1981         * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp:
1982         (WebKit::RemoteScrollingCoordinatorProxy::commitScrollingTreeState):
1983         (WebKit::RemoteScrollingCoordinatorProxy::updateScrollingTree): Deleted.
1984         * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h:
1985         * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.h:
1986         * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:
1987         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::commitStateBeforeChildren):
1988         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::commitStateAfterChildren):
1989         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::updateBeforeChildren): Deleted.
1990         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::updateAfterChildren): Deleted.
1991         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
1992         (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
1993
1994 2016-11-04  Carlos Garcia Campos  <cgarcia@igalia.com>
1995
1996         NetworkSession: Add NetworkDataTask implementation for blobs
1997         https://bugs.webkit.org/show_bug.cgi?id=163939
1998
1999         Reviewed by Alex Christensen.
2000
2001         Add NetworkDataTaskBlob to handle blobs when using NetworkSession instead of using ResourceHandle. This patch
2002         adds more USE(NETWORK_SESSION) ifdefs to not use ResourceHandle in Downloads and NetworkLoad when NetworkSession
2003         is enabled.
2004
2005         * CMakeLists.txt: Add new files to compilation.
2006         * NetworkProcess/Downloads/BlobDownloadClient.cpp:
2007         * NetworkProcess/Downloads/BlobDownloadClient.h:
2008         * NetworkProcess/Downloads/Download.cpp:
2009         (WebKit::Download::Download): Split the constructor again and remove the PlatformDownloadTaskRef
2010         definitions. Now Cocoa specific constructor receives a NSURLSessionDownloadTask and the general constructor
2011         reveices a NetworkDataTask and is used by Soup backend and blobs.
2012         (WebKit::Download::~Download):
2013         (WebKit::Download::start):
2014         (WebKit::Download::startWithHandle):
2015         (WebKit::Download::cancel):
2016         (WebKit::Download::didReceiveAuthenticationChallenge):
2017         (WebKit::Download::didReceiveData):
2018         (WebKit::Download::didFinish):
2019         (WebKit::Download::platformCancelNetworkLoad): Rename cancelNetworkLoad() as platformCancelNetworkLoad() since
2020         this is now used only by Cocoa platform to cancel the NSURLSessionDownloadTask.
2021         * NetworkProcess/Downloads/Download.h:
2022         (WebKit::Download::Download):
2023         (WebKit::Download::suggestedName):
2024         (WebKit::Download::request):
2025         * NetworkProcess/Downloads/DownloadManager.cpp:
2026         (WebKit::DownloadManager::startDownload): Remove blobs specific code when using NetworkSession.
2027         (WebKit::DownloadManager::continueDecidePendingDownloadDestination):
2028         * NetworkProcess/Downloads/DownloadManager.h:
2029         * NetworkProcess/Downloads/cocoa/DownloadCocoa.mm:
2030         (WebKit::Download::platformCancelNetworkLoad):
2031         * NetworkProcess/Downloads/soup/DownloadSoup.cpp: Removed.
2032         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
2033         (WebKit::NetworkConnectionToWebProcess::convertMainResourceLoadToDownload): Remove blobs specific code when
2034         using NetworkSession.
2035         * NetworkProcess/NetworkDataTask.cpp:
2036         (WebKit::NetworkDataTask::create): If request is a blob, create a NetworkDataTaskBlob.
2037         * NetworkProcess/NetworkDataTask.h: Add invalidateAndCancel pure virtual method.
2038         * NetworkProcess/NetworkDataTaskBlob.cpp: Added.
2039         (WebKit::NetworkDataTaskBlob::NetworkDataTaskBlob):
2040         (WebKit::NetworkDataTaskBlob::~NetworkDataTaskBlob):
2041         (WebKit::NetworkDataTaskBlob::clearStream):
2042         (WebKit::NetworkDataTaskBlob::resume):
2043         (WebKit::NetworkDataTaskBlob::suspend):
2044         (WebKit::NetworkDataTaskBlob::cancel):
2045         (WebKit::NetworkDataTaskBlob::invalidateAndCancel):
2046         (WebKit::NetworkDataTaskBlob::getSizeForNext):
2047         (WebKit::NetworkDataTaskBlob::didGetSize):
2048         (WebKit::NetworkDataTaskBlob::seek):
2049         (WebKit::NetworkDataTaskBlob::didReceiveResponse):
2050         (WebKit::NetworkDataTaskBlob::read):
2051         (WebKit::NetworkDataTaskBlob::readData):
2052         (WebKit::NetworkDataTaskBlob::readFile):
2053         (WebKit::NetworkDataTaskBlob::didOpen):
2054         (WebKit::NetworkDataTaskBlob::didRead):
2055         (WebKit::NetworkDataTaskBlob::consumeData):
2056         (WebKit::NetworkDataTaskBlob::setPendingDownloadLocation):
2057         (WebKit::NetworkDataTaskBlob::suggestedFilename):
2058         (WebKit::NetworkDataTaskBlob::download):
2059         (WebKit::NetworkDataTaskBlob::writeDownload):
2060         (WebKit::NetworkDataTaskBlob::cleanDownloadFiles):
2061         (WebKit::NetworkDataTaskBlob::didFailDownload):
2062         (WebKit::NetworkDataTaskBlob::didFinishDownload):
2063         (WebKit::NetworkDataTaskBlob::didFail):
2064         (WebKit::NetworkDataTaskBlob::didFinish):
2065         * NetworkProcess/NetworkDataTaskBlob.h: Added.
2066         * NetworkProcess/NetworkLoad.cpp:
2067         (WebKit::NetworkLoad::NetworkLoad): Remove blobs specific code when using NetworkSession.
2068         (WebKit::NetworkLoad::~NetworkLoad):
2069         (WebKit::NetworkLoad::setDefersLoading):
2070         (WebKit::NetworkLoad::cancel):
2071         (WebKit::NetworkLoad::continueWillSendRequest):
2072         (WebKit::NetworkLoad::continueDidReceiveResponse):
2073         (WebKit::NetworkLoad::continueCanAuthenticateAgainstProtectionSpace):
2074         (WebKit::NetworkLoad::canAuthenticateAgainstProtectionSpaceAsync):
2075         * NetworkProcess/NetworkLoad.h:
2076         * NetworkProcess/NetworkSession.cpp:
2077         (WebKit::NetworkSession::invalidateAndCancel): Moved from NetworkSessionSoup, since this is now used also by blobs.
2078         * NetworkProcess/NetworkSession.h:
2079         (WebKit::NetworkSession::registerNetworkDataTask): Ditto.
2080         (WebKit::NetworkSession::unregisterNetworkDataTask): Ditto.
2081         * NetworkProcess/cocoa/NetworkDataTaskCocoa.h: Add invalidateAndCancel() implementation that does nothing
2082         because in Cocoa all tasks are invalidated and canceled by the network session.
2083         * NetworkProcess/mac/NetworkLoadMac.mm:
2084         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
2085         (WebKit::NetworkDataTaskSoup::NetworkDataTaskSoup):
2086         (WebKit::NetworkDataTaskSoup::~NetworkDataTaskSoup):
2087         (WebKit::NetworkDataTaskSoup::download):
2088         * NetworkProcess/soup/NetworkDataTaskSoup.h:
2089         * NetworkProcess/soup/NetworkSessionSoup.cpp:
2090         * NetworkProcess/soup/NetworkSessionSoup.h:
2091         * PlatformEfl.cmake: Remove DownloadSoup.cpp from compilation.
2092         * PlatformGTK.cmake: Ditto.
2093         * WebKit2.xcodeproj/project.pbxproj: Add new files to compilation.
2094
2095 2016-11-03  Simon Fraser  <simon.fraser@apple.com>
2096
2097         Give all the geometry classes a single-argument scale() function for consistency
2098         https://bugs.webkit.org/show_bug.cgi?id=164400
2099
2100         Reviewed by Zalan Bujtas.
2101         
2102         Use single-argument scale() functions.
2103
2104         * PluginProcess/PluginControllerProxy.cpp:
2105         (WebKit::PluginControllerProxy::paint):
2106         * Shared/mac/RemoteLayerBackingStore.mm:
2107         (WebKit::RemoteLayerBackingStore::drawInContext):
2108         * UIProcess/API/Cocoa/WKWebView.mm:
2109         (-[WKWebView _didCommitLayerTree:]):
2110         (-[WKWebView _takeViewSnapshot]):
2111         (-[WKWebView _scrollToContentScrollPosition:scrollOrigin:]):
2112         (-[WKWebView _scrollByContentOffset:]):
2113         (-[WKWebView _zoomToFocusRect:selectionRect:fontSize:minimumScale:maximumScale:allowScaling:forceScroll:]):
2114         * UIProcess/ios/WKContentView.mm:
2115         (-[WKContentView _didCommitLayerTree:]):
2116         * UIProcess/ios/WKContentViewInteraction.mm:
2117         (-[WKContentView _updateTapHighlight]):
2118         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
2119         (WebKit::RemoteLayerTreeDrawingAreaProxy::indicatorLocation):
2120         (WebKit::RemoteLayerTreeDrawingAreaProxy::updateDebugIndicator):
2121         * UIProcess/mac/ViewGestureControllerMac.mm:
2122         (WebKit::ViewGestureController::scaledMagnificationOrigin):
2123         * WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp:
2124         (WebKit::InjectedBundleRangeHandle::renderedImage):
2125         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
2126         (WebKit::NetscapePlugin::snapshot):
2127         * WebProcess/Plugins/PDF/PDFPlugin.mm:
2128         (WebKit::PDFPlugin::scrollToPoint):
2129         * WebProcess/WebPage/WebFrame.cpp:
2130         (WebKit::WebFrame::createSelectionSnapshot):
2131         * WebProcess/WebPage/WebPage.cpp:
2132         (WebKit::WebPage::scalePageInViewCoordinates):
2133         (WebKit::WebPage::scaleView):
2134         (WebKit::WebPage::snapshotAtSize):
2135         (WebKit::WebPage::snapshotNode):
2136         (WebKit::WebPage::drawRectToImage):
2137         * WebProcess/WebPage/ios/WebPageIOS.mm:
2138         (WebKit::WebPage::restorePageState):
2139
2140 2016-11-03  Chris Dumez  <cdumez@apple.com>
2141
2142         [WK2][Cocoa] Implement user interface for HTML form validation
2143         https://bugs.webkit.org/show_bug.cgi?id=164143
2144         <rdar://problem/28944652>
2145
2146         Reviewed by Simon Fraser.
2147
2148         Implement the ValidationMessageClient in WebKit2 and have it display
2149         a ValidationBubble on Cocoa. ValidationBubble is implemented using
2150         native popovers on both Mac and iOS. As a result, Mac and iOS WK2
2151         now use native popover for HTML form validation instead of the old
2152         Shadow DOM based UI in WebCore.
2153
2154         The native popover shows at the bottom (or top) of the input and it
2155         disapears as soon as the user starts typing or interacts with the
2156         view (e.g. tap / scroll / zoom).
2157
2158         The feature is still disabled at runtime.
2159
2160         * UIProcess/API/Cocoa/WKWebView.mm:
2161         (-[WKWebView _initializeWithConfiguration:]):
2162         (-[WKWebView _keyboardWillShow:]):
2163         (-[WKWebView _keyboardDidShow:]):
2164         (-[WKWebView _contentsOfUserInterfaceItem:]):
2165         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2166         * UIProcess/Cocoa/WebPageProxyCocoa.mm:
2167         * UIProcess/PageClient.h:
2168         * UIProcess/WebPageProxy.cpp:
2169         (WebKit::WebPageProxy::handleWheelEvent):
2170         (WebKit::WebPageProxy::setPageZoomFactor):
2171         (WebKit::WebPageProxy::setPageAndTextZoomFactors):
2172         (WebKit::WebPageProxy::pageDidScroll):
2173         (WebKit::WebPageProxy::resetState):
2174         (WebKit::WebPageProxy::hideValidationMessage):
2175         * UIProcess/WebPageProxy.h:
2176         (WebKit::WebPageProxy::validationBubble):
2177         (WebKit::WebPageProxy::setIsKeyboardAnimatingIn):
2178         * UIProcess/WebPageProxy.messages.in:
2179         * UIProcess/ios/PageClientImplIOS.h:
2180         * UIProcess/ios/PageClientImplIOS.mm:
2181         (WebKit::PageClientImpl::createValidationBubble):
2182         * UIProcess/ios/WKContentViewInteraction.mm:
2183         (-[WKContentView _willStartScrollingOrZooming]):
2184         (-[WKContentView scrollViewWillStartPanOrPinchGesture]):
2185         (-[WKContentView _didEndScrollingOrZooming]):
2186         * UIProcess/ios/WebPageProxyIOS.mm:
2187         (WebKit::WebPageProxy::dynamicViewportSizeUpdate):
2188         (WebKit::WebPageProxy::potentialTapAtPosition):
2189         (WebKit::WebPageProxy::showValidationMessage):
2190         (WebKit::WebPageProxy::setIsScrollingOrZooming):
2191         * UIProcess/mac/PageClientImpl.h:
2192         * UIProcess/mac/PageClientImpl.mm:
2193         (WebKit::PageClientImpl::createValidationBubble):
2194         * UIProcess/mac/WebPageProxyMac.mm:
2195         (WebKit::WebPageProxy::showValidationMessage):
2196         * WebKit2.xcodeproj/project.pbxproj:
2197         * WebProcess/WebCoreSupport/WebValidationMessageClient.cpp: Copied from Tools/DumpRenderTree/mac/UIScriptControllerMac.mm.
2198         (WebKit::WebValidationMessageClient::WebValidationMessageClient):
2199         (WebKit::WebValidationMessageClient::~WebValidationMessageClient):
2200         (WebKit::WebValidationMessageClient::showValidationMessage):
2201         (WebKit::WebValidationMessageClient::hideValidationMessage):
2202         (WebKit::WebValidationMessageClient::isValidationMessageVisible):
2203         * WebProcess/WebCoreSupport/WebValidationMessageClient.h: Copied from Tools/DumpRenderTree/mac/UIScriptControllerMac.mm.
2204         * WebProcess/WebPage/WebPage.cpp:
2205         (WebKit::m_userInterfaceLayoutDirection):
2206
2207 2016-11-03  Tim Horton  <timothy_horton@apple.com>
2208
2209         Printing to PDF should produce internal links when HTML has internal links
2210         https://bugs.webkit.org/show_bug.cgi?id=112081
2211         <rdar://problem/5955705>
2212
2213         Reviewed by Simon Fraser.
2214
2215         * UIProcess/mac/WKPrintingView.h:
2216         * UIProcess/mac/WKPrintingView.mm:
2217         (linkDestinationName):
2218         (-[WKPrintingView _drawPDFDocument:page:atPoint:]):
2219         Propagate link-to-destination annotations (and each page's destinations)
2220         into the printed PDF.
2221         Generate a unique destination name based on the page and position, because
2222         we have lost the fragment name information.
2223
2224         (-[WKPrintingView drawRect:]):
2225         Compute all of the destinations for every page, so that we can add them
2226         to the context as we paint the pages (we need the page CTM in order to add them).
2227
2228 2016-11-03  Alex Christensen  <achristensen@webkit.org>
2229
2230         Unreviewed, rolling out r208298.
2231         https://bugs.webkit.org/show_bug.cgi?id=163939
2232
2233         caused asan crashes
2234
2235         Reverted changeset:
2236
2237         "NetworkSession: Add NetworkDataTask implementation for blobs"
2238         https://bugs.webkit.org/show_bug.cgi?id=163939
2239         http://trac.webkit.org/changeset/208298
2240
2241 2016-11-03  Ryan Haddad  <ryanhaddad@apple.com>
2242
2243         Unreviewed, rolling out r208330.
2244
2245         This change appears to have caused two editing tests to fail
2246         on macOS.
2247
2248         Reverted changeset:
2249
2250         "Reduce PassRefPtr use in WebKit2"
2251         https://bugs.webkit.org/show_bug.cgi?id=164360
2252         http://trac.webkit.org/changeset/208330
2253
2254 2016-11-03  Dan Bernstein  <mitz@apple.com>
2255
2256         WKWebView’s _observedRenderingProgressEvents not restored after web process crash
2257         https://bugs.webkit.org/show_bug.cgi?id=164368
2258         <rdar://problem/29091954>
2259
2260         Reviewed by Anders Carlsson.
2261
2262         Test: TestWebKitAPI/Tests/WebKit2Cocoa/ObservedRenderingProgressEventsAfterCrash.mm.
2263
2264         * Shared/WebPageCreationParameters.cpp:
2265         (WebKit::WebPageCreationParameters::encode): Encode new observedLayoutMilestones member.
2266         (WebKit::WebPageCreationParameters::decode): Decode it.
2267         * Shared/WebPageCreationParameters.h: Declared new observedLayoutMilestones member variable.
2268
2269         * UIProcess/WebPageProxy.cpp:
2270         (WebKit::WebPageProxy::WebPageProxy): Removed initializer for
2271           m_wantsSessionRestorationRenderTreeSizeThresholdEvent.
2272         (WebKit::WebPageProxy::listenForLayoutMilestones): Update new m_observedLayoutMilestones
2273           member variable. Don’t update m_wantsSessionRestorationRenderTreeSizeThresholdEvent.
2274         (WebKit::WebPageProxy::creationParameters): Set the observedLayoutMilestones member in the
2275           creation parameters.
2276
2277         * UIProcess/WebPageProxy.h: Declared new member variable, deleted
2278           m_wantsSessionRestorationRenderTreeSizeThresholdEvent declaration.
2279
2280         * UIProcess/ios/WebPageProxyIOS.mm:
2281         (WebKit::WebPageProxy::didCommitLayerTree): Rather than using
2282           m_wantsSessionRestorationRenderTreeSizeThresholdEvent, use m_observedLayoutMilestones.
2283
2284         * WebProcess/WebPage/WebPage.cpp:
2285         (WebKit::WebPage::WebPage): Add the observed layout milestones from the creation parameters.
2286
2287 2016-11-02  Alex Christensen  <achristensen@webkit.org>
2288
2289         Reduce PassRefPtr use in WebKit2
2290         https://bugs.webkit.org/show_bug.cgi?id=164360
2291
2292         Reviewed by Tim Horton.
2293
2294         * Shared/API/APISecurityOrigin.h:
2295         (API::SecurityOrigin::SecurityOrigin):
2296         * Shared/API/APISerializedScriptValue.h:
2297         (API::SerializedScriptValue::create):
2298         (API::SerializedScriptValue::SerializedScriptValue):
2299         * Shared/API/c/WKSharedAPICast.h:
2300         (WebKit::ProxyingRefPtr::ProxyingRefPtr):
2301         (WebKit::toAPI):
2302         * Shared/APIWebArchive.h:
2303         * Shared/APIWebArchive.mm:
2304         (API::WebArchive::create):
2305         (API::WebArchive::WebArchive):
2306         * UIProcess/API/APIHitTestResult.cpp:
2307         (API::HitTestResult::create):
2308         * UIProcess/API/APIHitTestResult.h:
2309         * UIProcess/API/APIUIClient.h:
2310         (API::UIClient::createNewPage):
2311         * UIProcess/API/C/WKPage.cpp:
2312         (WebKit::RunBeforeUnloadConfirmPanelResultListener::create):
2313         (WebKit::RunBeforeUnloadConfirmPanelResultListener::RunBeforeUnloadConfirmPanelResultListener):
2314         (WebKit::RunJavaScriptAlertResultListener::create):
2315         (WebKit::RunJavaScriptAlertResultListener::RunJavaScriptAlertResultListener):
2316         (WebKit::RunJavaScriptConfirmResultListener::create):
2317         (WebKit::RunJavaScriptConfirmResultListener::RunJavaScriptConfirmResultListener):
2318         (WebKit::RunJavaScriptPromptResultListener::create):
2319         (WebKit::RunJavaScriptPromptResultListener::RunJavaScriptPromptResultListener):
2320         (WKPageSetPageUIClient):
2321         * UIProcess/API/Cocoa/WKWebView.mm:
2322         (-[WKWebView _takeViewSnapshot]):
2323         * UIProcess/API/Cocoa/WKWebViewInternal.h:
2324         * UIProcess/Cocoa/UIDelegate.h:
2325         * UIProcess/Cocoa/UIDelegate.mm:
2326         (WebKit::UIDelegate::UIClient::createNewPage):
2327         * UIProcess/ios/WKGeolocationProviderIOS.mm:
2328         (-[WKWebAllowDenyPolicyListener initWithPermissionRequestProxy:]):
2329         * UIProcess/mac/WKImmediateActionController.mm:
2330         (-[WKImmediateActionController _webHitTestResult]):
2331         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
2332         (contextMenuItems):
2333         (WKBundlePageCopyContextMenuItems):
2334         (WKBundlePageCopyContextMenuAtPointInWindow):
2335         * WebProcess/UserContent/WebUserContentController.cpp:
2336         (WebKit::WebUserMessageHandlerDescriptorProxy::create):
2337         * WebProcess/WebPage/WebUndoStep.cpp:
2338         (WebKit::WebUndoStep::create):
2339         * WebProcess/WebPage/WebUndoStep.h:
2340         (WebKit::WebUndoStep::WebUndoStep):
2341
2342 2016-11-01  Gavin Barraclough  <barraclough@apple.com>
2343
2344         Remove PageThrottler & all related code
2345         https://bugs.webkit.org/show_bug.cgi?id=164302
2346
2347         Reviewed by Ryosuke Niwa.
2348
2349         All relevant information now available from the ActivityState.
2350
2351         * PluginProcess/PluginProcess.cpp:
2352         (WebKit::PluginProcess::PluginProcess):
2353         (WebKit::PluginProcess::createWebProcessConnection):
2354         (WebKit::PluginProcess::audioHardwareDidBecomeActive): Deleted.
2355         (WebKit::PluginProcess::audioHardwareDidBecomeInactive): Deleted.
2356         * PluginProcess/PluginProcess.h:
2357         (): Deleted.
2358         * PluginProcess/WebProcessConnection.cpp:
2359         (WebKit::WebProcessConnection::audioHardwareDidBecomeActive): Deleted.
2360         (WebKit::WebProcessConnection::audioHardwareDidBecomeInactive): Deleted.
2361         * PluginProcess/WebProcessConnection.h:
2362         * WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp:
2363         (WebKit::NPRuntimeObjectMap::evaluate):
2364         * WebProcess/Plugins/Plugin.h:
2365         (WebKit::Plugin::audioHardwareActivity): Deleted.
2366         * WebProcess/Plugins/PluginProcessConnection.cpp:
2367         (WebKit::PluginProcessConnection::PluginProcessConnection):
2368         (WebKit::PluginProcessConnection::didReceiveMessage):
2369         (WebKit::PluginProcessConnection::audioHardwareDidBecomeActive): Deleted.
2370         (WebKit::PluginProcessConnection::audioHardwareDidBecomeInactive): Deleted.
2371         * WebProcess/Plugins/PluginProcessConnection.h:
2372         (WebKit::PluginProcessConnection::supportsAsynchronousPluginInitialization):
2373         (WebKit::PluginProcessConnection::audioHardwareActivity): Deleted.
2374         * WebProcess/Plugins/PluginProcessConnection.messages.in:
2375         * WebProcess/Plugins/PluginProxy.cpp:
2376         (WebKit::PluginProxy::audioHardwareActivity): Deleted.
2377         * WebProcess/Plugins/PluginProxy.h:
2378         * WebProcess/Plugins/PluginView.cpp:
2379         (WebKit::PluginView::audioHardwareActivity): Deleted.
2380         * WebProcess/Plugins/PluginView.h:
2381         * WebProcess/WebPage/WebPage.cpp:
2382
2383 2016-11-03  Dan Bernstein  <mitz@apple.com>
2384
2385         REGRESSION (r206247): Painting milestones can be delayed until the next layer flush
2386         https://bugs.webkit.org/show_bug.cgi?id=164340
2387         <rdar://problem/29074344>
2388
2389         Reviewed by Tim Horton.
2390
2391         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h: Declared new helper function.
2392         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
2393         (WebKit::TiledCoreAnimationDrawingArea::sendPendingNewlyReachedLayoutMilestones): Helper
2394           function that sends the message to the UI process and resets
2395           m_pendingNewlyReachedLayoutMilestones.
2396         (WebKit::TiledCoreAnimationDrawingArea::flushLayers): Wait until after the commit to get the
2397           pending milestones and send them to the UI process. This way we don’t miss milestones that
2398           fire during the commit.
2399
2400 2016-11-02  David Kilzer  <ddkilzer@apple.com>
2401
2402         Bug 164333: Add logging for "WebKit encountered an internal error" messages due to Network process crashes
2403         <https://webkit.org/b/164333>
2404         <rdar://problem/29072727>
2405
2406         Reviewed by Alex Christensen.
2407
2408         * WebProcess/WebProcess.cpp:
2409         (WebKit::WebProcess::logDiagnosticMessageForNetworkProcessCrash):
2410         Add private method to log diagnostic message.
2411         (WebKit::WebProcess::networkProcessConnectionClosed):
2412         Call logDiagnosticMessageForNetworkProcessCrash().
2413         * WebProcess/WebProcess.h:
2414         (WebKit::WebProcess::logDiagnosticMessageForNetworkProcessCrash):
2415         Declare new method.
2416
2417 2016-11-02  Alex Christensen  <achristensen@webkit.org>
2418
2419         Remove Battery Status API from the tree
2420         https://bugs.webkit.org/show_bug.cgi?id=164213
2421
2422         Reviewed by Sam Weinig.
2423
2424         * CMakeLists.txt:
2425         * PlatformEfl.cmake:
2426         * Shared/API/APIObject.h:
2427         * Shared/API/c/WKBase.h:
2428         * Shared/WebBatteryStatus.cpp: Removed.
2429         * Shared/WebBatteryStatus.h: Removed.
2430         * UIProcess/API/C/WKAPICast.h:
2431         * UIProcess/API/C/WKBatteryManager.cpp: Removed.
2432         * UIProcess/API/C/WKBatteryManager.h: Removed.
2433         * UIProcess/API/C/WKBatteryStatus.cpp: Removed.
2434         * UIProcess/API/C/WKBatteryStatus.h: Removed.
2435         * UIProcess/API/C/WKContext.cpp:
2436         (WKContextGetBatteryManager): Deleted.
2437         * UIProcess/API/C/WKContext.h:
2438         * UIProcess/API/efl/ewk_context.cpp:
2439         (EwkContext::EwkContext):
2440         * UIProcess/API/efl/ewk_context_private.h:
2441         * UIProcess/API/efl/ewk_main.cpp:
2442         (WebKit::EwkMain::initialize):
2443         (WebKit::EwkMain::finalize):
2444         (WebKit::EwkMain::shutdownInitializedEFLModules):
2445         * UIProcess/API/gtk/WebKitBatteryProvider.cpp: Removed.
2446         * UIProcess/API/gtk/WebKitBatteryProvider.h: Removed.
2447         * UIProcess/API/gtk/WebKitWebContext.cpp:
2448         (webkitWebContextConstructed):
2449         * UIProcess/WebBatteryManagerProxy.cpp: Removed.
2450         * UIProcess/WebBatteryManagerProxy.h: Removed.
2451         * UIProcess/WebBatteryManagerProxy.messages.in: Removed.
2452         * UIProcess/WebBatteryProvider.cpp: Removed.
2453         * UIProcess/WebBatteryProvider.h: Removed.
2454         * UIProcess/WebProcessPool.cpp:
2455         (WebKit::m_hiddenPageThrottlingTimer):
2456         * UIProcess/efl/BatteryProvider.cpp: Removed.
2457         * UIProcess/efl/BatteryProvider.h: Removed.
2458         * WebProcess/Battery: Removed.
2459         * WebProcess/Battery/WebBatteryManager.cpp: Removed.
2460         * WebProcess/Battery/WebBatteryManager.h: Removed.
2461         * WebProcess/Battery/WebBatteryManager.messages.in: Removed.
2462         * WebProcess/WebCoreSupport/WebBatteryClient.cpp: Removed.
2463         * WebProcess/WebCoreSupport/WebBatteryClient.h: Removed.
2464         * WebProcess/WebPage/WebPage.cpp:
2465         (WebKit::m_userInterfaceLayoutDirection):
2466         * WebProcess/WebProcess.cpp:
2467         (WebKit::m_resourceLoadStatisticsStorage):
2468
2469 2016-11-02  Carlos Garcia Campos  <cgarcia@igalia.com>
2470
2471         NetworkSession: Add NetworkDataTask implementation for blobs
2472         https://bugs.webkit.org/show_bug.cgi?id=163939
2473
2474         Reviewed by Alex Christensen.
2475
2476         Add NetworkDataTaskBlob to handle blobs when using NetworkSession instead of using ResourceHandle. This patch
2477         adds more USE(NETWORK_SESSION) ifdefs to not use ResourceHandle in Downloads and NetworkLoad when NetworkSession
2478         is enabled.
2479
2480         * CMakeLists.txt: Add new files to compilation.
2481         * NetworkProcess/Downloads/BlobDownloadClient.cpp:
2482         * NetworkProcess/Downloads/BlobDownloadClient.h:
2483         * NetworkProcess/Downloads/Download.cpp:
2484         (WebKit::Download::Download): Split the constructor again and remove the PlatformDownloadTaskRef
2485         definitions. Now Cocoa specific constructor receives a NSURLSessionDownloadTask and the general constructor
2486         reveices a NetworkDataTask and is used by Soup backend and blobs.
2487         (WebKit::Download::~Download):
2488         (WebKit::Download::start):
2489         (WebKit::Download::startWithHandle):
2490         (WebKit::Download::cancel):
2491         (WebKit::Download::didReceiveAuthenticationChallenge):
2492         (WebKit::Download::didReceiveData):
2493         (WebKit::Download::didFinish):
2494         (WebKit::Download::platformCancelNetworkLoad): Rename cancelNetworkLoad() as platformCancelNetworkLoad() since
2495         this is now used only by Cocoa platform to cancel the NSURLSessionDownloadTask.
2496         * NetworkProcess/Downloads/Download.h:
2497         (WebKit::Download::Download):
2498         (WebKit::Download::suggestedName):
2499         (WebKit::Download::request):
2500         * NetworkProcess/Downloads/DownloadManager.cpp:
2501         (WebKit::DownloadManager::startDownload): Remove blobs specific code when using NetworkSession.
2502         (WebKit::DownloadManager::continueDecidePendingDownloadDestination):
2503         * NetworkProcess/Downloads/DownloadManager.h:
2504         * NetworkProcess/Downloads/cocoa/DownloadCocoa.mm:
2505         (WebKit::Download::platformCancelNetworkLoad):
2506         * NetworkProcess/Downloads/soup/DownloadSoup.cpp: Removed.
2507         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
2508         (WebKit::NetworkConnectionToWebProcess::convertMainResourceLoadToDownload): Remove blobs specific code when
2509         using NetworkSession.
2510         * NetworkProcess/NetworkDataTask.cpp:
2511         (WebKit::NetworkDataTask::create): If request is a blob, create a NetworkDataTaskBlob.
2512         * NetworkProcess/NetworkDataTask.h: Add invalidateAndCancel pure virtual method.
2513         * NetworkProcess/NetworkDataTaskBlob.cpp: Added.
2514         (WebKit::NetworkDataTaskBlob::NetworkDataTaskBlob):
2515         (WebKit::NetworkDataTaskBlob::~NetworkDataTaskBlob):
2516         (WebKit::NetworkDataTaskBlob::clearStream):
2517         (WebKit::NetworkDataTaskBlob::resume):
2518         (WebKit::NetworkDataTaskBlob::suspend):
2519         (WebKit::NetworkDataTaskBlob::cancel):
2520         (WebKit::NetworkDataTaskBlob::invalidateAndCancel):
2521         (WebKit::NetworkDataTaskBlob::getSizeForNext):
2522         (WebKit::NetworkDataTaskBlob::didGetSize):
2523         (WebKit::NetworkDataTaskBlob::seek):
2524         (WebKit::NetworkDataTaskBlob::didReceiveResponse):
2525         (WebKit::NetworkDataTaskBlob::read):
2526         (WebKit::NetworkDataTaskBlob::readData):
2527         (WebKit::NetworkDataTaskBlob::readFile):
2528         (WebKit::NetworkDataTaskBlob::didOpen):
2529         (WebKit::NetworkDataTaskBlob::didRead):
2530         (WebKit::NetworkDataTaskBlob::consumeData):
2531         (WebKit::NetworkDataTaskBlob::setPendingDownloadLocation):
2532         (WebKit::NetworkDataTaskBlob::suggestedFilename):
2533         (WebKit::NetworkDataTaskBlob::download):
2534         (WebKit::NetworkDataTaskBlob::writeDownload):
2535         (WebKit::NetworkDataTaskBlob::cleanDownloadFiles):
2536         (WebKit::NetworkDataTaskBlob::didFailDownload):
2537         (WebKit::NetworkDataTaskBlob::didFinishDownload):
2538         (WebKit::NetworkDataTaskBlob::didFail):
2539         (WebKit::NetworkDataTaskBlob::didFinish):
2540         * NetworkProcess/NetworkDataTaskBlob.h: Added.
2541         * NetworkProcess/NetworkLoad.cpp:
2542         (WebKit::NetworkLoad::NetworkLoad): Remove blobs specific code when using NetworkSession.
2543         (WebKit::NetworkLoad::~NetworkLoad):
2544         (WebKit::NetworkLoad::setDefersLoading):
2545         (WebKit::NetworkLoad::cancel):
2546         (WebKit::NetworkLoad::continueWillSendRequest):
2547         (WebKit::NetworkLoad::continueDidReceiveResponse):
2548         (WebKit::NetworkLoad::continueCanAuthenticateAgainstProtectionSpace):
2549         (WebKit::NetworkLoad::canAuthenticateAgainstProtectionSpaceAsync):
2550         * NetworkProcess/NetworkLoad.h:
2551         * NetworkProcess/NetworkSession.cpp:
2552         (WebKit::NetworkSession::invalidateAndCancel): Moved from NetworkSessionSoup, since this is now used also by blobs.
2553         * NetworkProcess/NetworkSession.h:
2554         (WebKit::NetworkSession::registerNetworkDataTask): Ditto.
2555         (WebKit::NetworkSession::unregisterNetworkDataTask): Ditto.
2556         * NetworkProcess/cocoa/NetworkDataTaskCocoa.h: Add invalidateAndCancel() implementation that does nothing
2557         because in Cocoa all tasks are invalidated and canceled by the network session.
2558         * NetworkProcess/mac/NetworkLoadMac.mm:
2559         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
2560         (WebKit::NetworkDataTaskSoup::NetworkDataTaskSoup):
2561         (WebKit::NetworkDataTaskSoup::~NetworkDataTaskSoup):
2562         (WebKit::NetworkDataTaskSoup::download):
2563         * NetworkProcess/soup/NetworkDataTaskSoup.h:
2564         * NetworkProcess/soup/NetworkSessionSoup.cpp:
2565         * NetworkProcess/soup/NetworkSessionSoup.h:
2566         * PlatformEfl.cmake: Remove DownloadSoup.cpp from compilation.
2567         * PlatformGTK.cmake: Ditto.
2568         * WebKit2.xcodeproj/project.pbxproj: Add new files to compilation.
2569
2570 2016-11-02  Andy Estes  <aestes@apple.com>
2571
2572         REGRESSION (r199558): File paths selected for upload are stored using the wrong string encoding
2573         https://bugs.webkit.org/show_bug.cgi?id=164311
2574         <rdar://problem/26995374>
2575
2576         Reviewed by Tim Horton.
2577
2578         -[NSURL fileSystemRepresentation] returns a char* in file system representation, which on
2579         iOS is UTF-8, but we were implicitly converting it to a String, which assumes a char* is
2580         Latin-1 encoded.
2581
2582         * UIProcess/ios/forms/WKFileUploadPanel.mm:
2583         (-[WKFileUploadPanel _chooseFiles:displayString:iconImage:]): Changed to use fromUTF8() to
2584         convert fileURL.fileSystemRepresentation to a String.
2585
2586 2016-11-02  Carlos Garcia Campos  <cgarcia@igalia.com>
2587
2588         NetworkSession: Network process crash when converting main resource to download
2589         https://bugs.webkit.org/show_bug.cgi?id=164220
2590
2591         Reviewed by Alex Christensen.
2592
2593         Right after the main resource load is converted to a download, the web process deletes the ResourceLoader which
2594         sends the RemoveLoadIdentifier to the network process and the load is aborted. Sometimes it happens that
2595         NetworkResourceLoader::abort() is called while the NetworkLoad is still deciding the destination of the
2596         download. In such case, NetworkResourceLoader::didConvertToDownload() has already been called, but not
2597         NetworkResourceLoader::didBecomeDownload(). In NetworkResourceLoader::abort() we already handle the case of
2598         having a NetworkLoad after NetworkResourceLoader::didConvertToDownload() has been called, to avoid canceling the
2599         load in such case, however cleanup() is always called unconditionally and the NetworkLoad is deleted before
2600         NetworkResourceLoader::didBecomeDownload() is called. When the NetworkLoad is destroyed the NetworkDataTask
2601         client becomes nullptr, leaving it in a state where both the client is nullptr and the download hasn't been
2602         created yet. That's not expected to happen and when the response completion handler is called in the
2603         NetworkDataTask it tries to use either the client or the download and it crashes.
2604
2605         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
2606         (WebKit::NetworkConnectionToWebProcess::removeLoadIdentifier): Update ASSERT, because abort doesn't cleanup the
2607         resource loader in case it's becoming a download.
2608         * NetworkProcess/NetworkResourceLoader.cpp:
2609         (WebKit::NetworkResourceLoader::didBecomeDownload): Call cleanup() instead of just deleting the network load.
2610         (WebKit::NetworkResourceLoader::isBecomingDownload): Helper method to check if the resource load was converted to a
2611         download, but didBecomeDownload() hasn't been called yet.
2612         (WebKit::NetworkResourceLoader::abort): If the resource load is becoming a download do not call cleanup()
2613         because it will be called by didBecomeDownload() later.
2614         * NetworkProcess/NetworkResourceLoader.h:
2615
2616 2016-11-02  David Kilzer  <ddkilzer@apple.com>
2617
2618         Add logging for "WebKit encountered an internal error" messages
2619         <https://webkit.org/b/164272>
2620         <rdar://problem/28546064>
2621
2622         Reviewed by Alex Christensen.
2623
2624         * NetworkProcess/NetworkResourceLoader.cpp:
2625         (WebKit::NetworkResourceLoader::startNetworkLoad):
2626         * WebProcess/Network/WebLoaderStrategy.cpp:
2627         (WebKit::WebLoaderStrategy::loadResourceSynchronously):
2628         * WebProcess/Network/WebResourceLoader.cpp:
2629         (WebKit::WebResourceLoader::didReceiveResource):
2630         - Add logging for various internalError() events.
2631
2632 2016-11-02  Carlos Garcia Campos  <cgarcia@igalia.com>
2633
2634         [GTK] BadDamage X Window System error in WebKit::AcceleratedBackingStoreX11::update when called from WebPageProxy::exitAcceleratedCompositingMode
2635         https://bugs.webkit.org/show_bug.cgi?id=164303
2636
2637         Reviewed by Michael Catanzaro.
2638
2639         This can happen if the web process exits before the UI process has cleaned up the accelerated surface. Trap
2640         BadDrawable and BadDamage X errors and ignore them, while still crashing for any other X error.
2641
2642         * UIProcess/gtk/AcceleratedBackingStoreX11.cpp:
2643         (WebKit::AcceleratedBackingStoreX11::~AcceleratedBackingStoreX11):
2644         (WebKit::AcceleratedBackingStoreX11::update):
2645
2646 2016-11-02  Carlos Garcia Campos  <cgarcia@igalia.com>
2647
2648         [GTK] Remove FileSystem::filenameToString() and use FileSystem::stringFromFileSystemRepresentation() everywhere instead
2649         https://bugs.webkit.org/show_bug.cgi?id=164315
2650
2651         Reviewed by Michael Catanzaro.
2652
2653         * Shared/gtk/ProcessExecutablePathGtk.cpp:
2654         (WebKit::getExecutablePath):
2655         (WebKit::findWebKitProcess):
2656         * UIProcess/API/gtk/APIWebsiteDataStoreGtk.cpp:
2657         (API::WebsiteDataStore::defaultNetworkCacheDirectory):
2658         (API::WebsiteDataStore::cacheDirectoryFileSystemRepresentation):
2659         (API::WebsiteDataStore::websiteDataDirectoryFileSystemRepresentation):
2660         * UIProcess/API/gtk/WebKitWebContext.cpp:
2661         (webkitWebContextConstructed):
2662         (webkit_web_context_set_favicon_database_directory):
2663         (webkit_web_context_set_additional_plugins_directory):
2664         (webkit_web_context_set_disk_cache_directory):
2665         * UIProcess/API/gtk/WebKitWebsiteDataManager.cpp:
2666         (webkitWebsiteDataManagerGetDataStore):
2667         * UIProcess/Plugins/gtk/PluginInfoCache.cpp:
2668         (WebKit::PluginInfoCache::PluginInfoCache):
2669         * UIProcess/gtk/WebProcessPoolGtk.cpp:
2670         (WebKit::WebProcessPool::platformDefaultIconDatabasePath):
2671         * WebProcess/gtk/WebGtkExtensionManager.cpp:
2672         (WebKit::parseUserData):
2673
2674 2016-11-02  Romain Bellessort  <romain.bellessort@crf.canon.fr>
2675
2676         [Readable Streams API] Enable creation of ReadableByteStreamController
2677         https://bugs.webkit.org/show_bug.cgi?id=164014
2678
2679         Reviewed by Youenn Fablet.
2680
2681         Added flag for the byte stream part of Readable Streams API.
2682
2683         * Configurations/FeatureDefines.xcconfig:
2684
2685 2016-11-02  Carlos Garcia Campos  <cgarcia@igalia.com>
2686
2687         PluginInfoStore::loadPluginsIfNecessary can still load plugins multiple times
2688         https://bugs.webkit.org/show_bug.cgi?id=164103
2689
2690         Reviewed by Michael Catanzaro.
2691
2692         Follow symlinks when scanning plugins to avoid duplicates.
2693
2694         * UIProcess/Plugins/gtk/PluginInfoCache.cpp: Bump the cache version to ensure duplicated plugins are removed
2695         from the cache.
2696         * UIProcess/Plugins/unix/PluginInfoStoreUnix.cpp:
2697         (WebKit::PluginInfoStore::pluginPathsInDirectory): Use realpath() to always return the actual file path.
2698
2699 2016-11-02  Carlos Garcia Campos  <cgarcia@igalia.com>
2700
2701         [GTK] Plugin process crash in WebKit::NetscapePluginX11::visibilityDidChange with evince browser plugin
2702         https://bugs.webkit.org/show_bug.cgi?id=164204
2703
2704         Reviewed by Michael Catanzaro.
2705
2706         Check the platform plugin widget is embedded before trying to get its socket window.
2707
2708         * WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp:
2709         (WebKit::NetscapePluginX11::geometryDidChange):
2710         (WebKit::NetscapePluginX11::visibilityDidChange):
2711
2712 2016-11-01  Wenson Hsieh  <wenson_hsieh@apple.com>
2713
2714         Turn the Input Events runtime flag on by default
2715         https://bugs.webkit.org/show_bug.cgi?id=164297
2716
2717         Reviewed by Ryosuke Niwa.
2718
2719         * Shared/WebPreferencesDefinitions.h:
2720
2721 2016-11-01  Jaehun Lim  <ljaehun.lim@samsung.com>
2722
2723         Unreviewed, EFL build fix after r208225
2724
2725         Rename ViewState to ActivityState
2726
2727         * UIProcess/efl/WebView.cpp:
2728         (WebKit::WebView::setActive):
2729         (WebKit::WebView::setFocused):
2730         (WebKit::WebView::setVisible):
2731
2732 2016-11-01  Alex Christensen  <achristensen@webkit.org>
2733
2734         Fix CMake build.
2735
2736         * PlatformMac.cmake:
2737
2738 2016-11-01  Ryosuke Niwa  <rniwa@webkit.org>
2739
2740         Remove CUSTOM_ELEMENTS build flag
2741         https://bugs.webkit.org/show_bug.cgi?id=164267
2742
2743         Reviewed by Antti Koivisto.
2744
2745         Removed the build flag.
2746
2747         * Configurations/FeatureDefines.xcconfig:
2748         * WebProcess/InjectedBundle/InjectedBundle.cpp:
2749         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
2750         * WebProcess/WebPage/WebPage.cpp:
2751         (WebKit::WebPage::updatePreferences):
2752
2753 2016-11-01  Eric Carlson  <eric.carlson@apple.com>
2754
2755         [MediaStream] restrict media capture secure connections
2756         https://bugs.webkit.org/show_bug.cgi?id=164234
2757         <rdar://problem/28944906>
2758
2759         Reviewed by Alex Christensen.
2760
2761         * Shared/WebPreferencesDefinitions.h:
2762    
2763         * UIProcess/API/C/WKPreferences.cpp:
2764         (WKPreferencesSetMediaCaptureRequiresSecureConnection):
2765         (WKPreferencesGetMediaCaptureRequiresSecureConnection):
2766         * UIProcess/API/C/WKPreferencesRefPrivate.h:
2767    
2768         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
2769         (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame): Drive by
2770          fix: remove some unused parameters in a lambda call.
2771
2772         * WebProcess/WebPage/WebPage.cpp:
2773         (WebKit::WebPage::updatePreferences):
2774
2775 2016-11-01  Gavin Barraclough  <barraclough@apple.com>
2776
2777         Add IsAudible, IsLoading to ActivityState
2778         https://bugs.webkit.org/show_bug.cgi?id=164286
2779
2780         Reviewed by Geoff Garen.
2781
2782         By computing these values in the UIProcess and passing them to WebContent we can
2783         more closely unify iOS & macOS throttling, and remove the PageThrottler class.
2784
2785         * UIProcess/WebPageProxy.cpp:
2786         (WebKit::WebPageProxy::updateActivityState):
2787             - Added update for IsAudible, IsLoading flags.
2788         (WebKit::WebPageProxy::updateThrottleState):
2789             - Read IsAudible, IsLoading flags from ActivityState.
2790         (WebKit::WebPageProxy::setMuted):
2791             - call activityStateDidChange to trigger update.
2792         (WebKit::WebPageProxy::isPlayingMediaDidChange):
2793             - call activityStateDidChange to trigger update.
2794         * UIProcess/WebPageProxy.h:
2795         (WebKit::WebPageProxy::isLoadingChanged):
2796             - call activityStateDidChange to trigger update.
2797
2798 2016-10-31  Gavin Barraclough  <barraclough@apple.com>
2799
2800         Rename ViewState to ActivityState
2801         https://bugs.webkit.org/show_bug.cgi?id=164254
2802
2803         Reviewed by Andreas Kling.
2804
2805         We plan to add a couple more flags to ViewState that aren't directly related to the view
2806         itself - whether there is an ongoing page load, and whether whether there is audio playback.
2807         This will allow viewState (now activityState) to fully drive throttling decisions.
2808
2809         Renaming this bitfield accordingly.
2810
2811         * Shared/WebPageCreationParameters.cpp:
2812         (WebKit::WebPageCreationParameters::encode):
2813         (WebKit::WebPageCreationParameters::decode):
2814         * Shared/WebPageCreationParameters.h:
2815         * UIProcess/API/Cocoa/WKWebView.mm:
2816         (-[WKWebView didMoveToWindow]):
2817         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
2818         (_WebKitWebViewBasePrivate::_WebKitWebViewBasePrivate):
2819         (_WebKitWebViewBasePrivate::updateActivityStateTimerFired):
2820         (webkitWebViewBaseScheduleUpdateActivityState):
2821         (toplevelWindowFocusInEvent):
2822         (toplevelWindowFocusOutEvent):
2823         (toplevelWindowStateEvent):
2824         (webkitWebViewBaseSetToplevelOnScreenWindow):
2825         (webkitWebViewBaseMap):
2826         (webkitWebViewBaseUnmap):
2827         (webkitWebViewBaseSetFocus):
2828         (webkitWebViewBaseIsInWindowActive):
2829         (webkitWebViewBaseIsFocused):
2830         (webkitWebViewBaseIsVisible):
2831         (webkitWebViewBaseIsInWindow):
2832         (_WebKitWebViewBasePrivate::updateViewStateTimerFired): Deleted.
2833         (webkitWebViewBaseScheduleUpdateViewState): Deleted.
2834         * UIProcess/Cocoa/WebViewImpl.mm:
2835         (WebKit::WebViewImpl::becomeFirstResponder):
2836         (WebKit::WebViewImpl::resignFirstResponder):
2837         (WebKit::WebViewImpl::windowDidOrderOffScreen):
2838         (WebKit::WebViewImpl::windowDidOrderOnScreen):
2839         (WebKit::WebViewImpl::windowDidBecomeKey):
2840         (WebKit::WebViewImpl::windowDidResignKey):
2841         (WebKit::WebViewImpl::windowDidMiniaturize):
2842         (WebKit::WebViewImpl::windowDidDeminiaturize):
2843         (WebKit::WebViewImpl::windowDidChangeOcclusionState):
2844         (WebKit::WebViewImpl::viewDidMoveToWindow):
2845         (WebKit::WebViewImpl::viewDidHide):
2846         (WebKit::WebViewImpl::viewDidUnhide):
2847         (WebKit::WebViewImpl::activeSpaceDidChange):
2848         (WebKit::WebViewImpl::endDeferringViewInWindowChanges):
2849         (WebKit::WebViewImpl::endDeferringViewInWindowChangesSync):
2850         (WebKit::WebViewImpl::prepareForMoveToWindow):
2851         * UIProcess/DrawingAreaProxy.h:
2852         (WebKit::DrawingAreaProxy::waitForDidUpdateActivityState):
2853         (WebKit::DrawingAreaProxy::waitForDidUpdateViewState): Deleted.
2854         * UIProcess/WebPageProxy.cpp:
2855         (WebKit::WebPageProxy::WebPageProxy):
2856         (WebKit::WebPageProxy::reattachToWebProcess):
2857         (WebKit::WebPageProxy::setSuppressVisibilityUpdates):
2858         (WebKit::WebPageProxy::updateActivityState):
2859         (WebKit::WebPageProxy::activityStateDidChange):
2860         (WebKit::WebPageProxy::dispatchActivityStateChange):
2861         (WebKit::WebPageProxy::updateThrottleState):
2862         (WebKit::WebPageProxy::waitForDidUpdateActivityState):
2863         (WebKit::WebPageProxy::creationParameters):
2864         (WebKit::WebPageProxy::installActivityStateChangeCompletionHandler):
2865         (WebKit::WebPageProxy::updateViewState): Deleted.
2866         (WebKit::WebPageProxy::viewStateDidChange): Deleted.
2867         (WebKit::WebPageProxy::dispatchViewStateChange): Deleted.
2868         (WebKit::WebPageProxy::waitForDidUpdateViewState): Deleted.
2869         (WebKit::WebPageProxy::installViewStateChangeCompletionHandler): Deleted.
2870         * UIProcess/WebPageProxy.h:
2871         (WebKit::WebPageProxy::isInWindow):
2872         (WebKit::WebPageProxy::didUpdateActivityState):
2873         (WebKit::WebPageProxy::isViewVisible):
2874         (WebKit::WebPageProxy::didUpdateViewState): Deleted.
2875         * UIProcess/WebPageProxy.messages.in:
2876         * UIProcess/WebProcessProxy.cpp:
2877         (WebKit::WebProcessProxy::windowServerConnectionStateChanged):
2878         * UIProcess/efl/WebView.cpp:
2879         * UIProcess/ios/WKContentView.mm:
2880         (-[WKContentView _applicationDidEnterBackground]):
2881         (-[WKContentView _applicationWillEnterForeground]):
2882         * UIProcess/ios/WKPDFView.mm:
2883         (-[WKPDFView _applicationDidEnterBackground]):
2884         (-[WKPDFView _applicationWillEnterForeground]):
2885         * UIProcess/ios/WebPageProxyIOS.mm:
2886         (WebKit::WebPageProxy::synchronizeDynamicViewportUpdate):
2887         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h:
2888         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
2889         (WebKit::RemoteLayerTreeDrawingAreaProxy::didRefreshDisplay):
2890         (WebKit::RemoteLayerTreeDrawingAreaProxy::waitForDidUpdateActivityState):
2891         (WebKit::RemoteLayerTreeDrawingAreaProxy::waitForDidUpdateViewState): Deleted.
2892         * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.h:
2893         * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm:
2894         (WebKit::TiledCoreAnimationDrawingAreaProxy::waitForDidUpdateActivityState):
2895         (WebKit::TiledCoreAnimationDrawingAreaProxy::waitForDidUpdateViewState): Deleted.
2896         * WebProcess/Plugins/PluginView.cpp:
2897         (WebKit::PluginView::activityStateDidChange):
2898         (WebKit::PluginView::viewStateDidChange): Deleted.
2899         * WebProcess/Plugins/PluginView.h:
2900         * WebProcess/WebPage/AcceleratedDrawingArea.cpp:
2901         (WebKit::AcceleratedDrawingArea::activityStateDidChange):
2902         (WebKit::AcceleratedDrawingArea::viewStateDidChange): Deleted.
2903         * WebProcess/WebPage/AcceleratedDrawingArea.h:
2904         * WebProcess/WebPage/DrawingArea.h:
2905         (WebKit::DrawingArea::activityStateDidChange):
2906         (WebKit::DrawingArea::viewStateDidChange): Deleted.
2907         * WebProcess/WebPage/WebPage.cpp:
2908         (WebKit::m_userInterfaceLayoutDirection):
2909         (WebKit::WebPage::reinitializeWebPage):
2910         (WebKit::WebPage::updateIsInWindow):
2911         (WebKit::WebPage::setActivityState):
2912         (WebKit::WebPage::setViewState): Deleted.
2913         * WebProcess/WebPage/WebPage.h:
2914         (WebKit::WebPage::isVisible):
2915         (WebKit::WebPage::isVisibleOrOccluded):
2916         * WebProcess/WebPage/WebPage.messages.in:
2917         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
2918         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
2919         (WebKit::RemoteLayerTreeDrawingArea::activityStateDidChange):
2920         (WebKit::RemoteLayerTreeDrawingArea::viewStateDidChange): Deleted.
2921         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
2922         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
2923         (WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea):
2924         (WebKit::TiledCoreAnimationDrawingArea::activityStateDidChange):
2925         (WebKit::TiledCoreAnimationDrawingArea::didUpdateActivityStateTimerFired):
2926         (WebKit::TiledCoreAnimationDrawingArea::viewStateDidChange): Deleted.
2927         (WebKit::TiledCoreAnimationDrawingArea::didUpdateViewStateTimerFired): Deleted.
2928
2929 2016-10-31  Jaehun Lim  <ljaehun.lim@samsung.com>
2930
2931         Unreviewed, CMake build fix
2932
2933         Adds #include <WebCore/IDBGetAllRecordsData.h>
2934
2935         * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.cpp:
2936
2937 2016-10-31  Simon Fraser  <simon.fraser@apple.com>
2938
2939         Add basic visual/layout viewport support for fixed position layout
2940         https://bugs.webkit.org/show_bug.cgi?id=164261
2941
2942         Reviewed by Dean Jackson.
2943
2944         Don't make visualViewportEnabled an experimental feature, because I don't want it enabled
2945         by default in WebKitTestRunner (and therefore mismatching DumpRenderTree).
2946
2947         * Shared/WebPreferencesDefinitions.h:
2948
2949 2016-10-29  Filip Pizlo  <fpizlo@apple.com>
2950
2951         JSC should support SharedArrayBuffer
2952         https://bugs.webkit.org/show_bug.cgi?id=163986
2953
2954         Reviewed by Keith Miller.
2955         
2956         Adds some small things we need for SharedArrayBuffer.
2957
2958         * UIProcess/API/C/WKPreferencesRefPrivate.h:
2959         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
2960         * WebProcess/InjectedBundle/InjectedBundle.cpp:
2961         (WebKit::InjectedBundle::createWebDataFromUint8Array):
2962
2963 2016-10-31  Brady Eidson  <beidson@apple.com>
2964
2965         IndexedDB 2.0: Support IDBObjectStore getAll/getAllKeys.
2966         <rdar://problem/28806934> and https://bugs.webkit.org/show_bug.cgi?id=164097
2967
2968         Reviewed by Darin Adler.
2969
2970         - Handle moving "Get All" requests to and from the DatabaseProcess.
2971         - Handle the additional task of creating/passing Sandbox Extensions for
2972           referenced files when necessary. 
2973           
2974         * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.cpp:
2975         (WebKit::WebIDBConnectionToClient::handleGetResult):
2976         (WebKit::WebIDBConnectionToClient::didGetAllRecords):
2977         (WebKit::WebIDBConnectionToClient::getAllRecords):
2978         * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.h:
2979         * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.messages.in:
2980         
2981         * Shared/WebCoreArgumentCoders.h:
2982         
2983         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
2984         (WebKit::WebIDBConnectionToServer::getAllRecords):
2985         (WebKit::preregisterSandboxExtensionsIfNecessary):
2986         (WebKit::WebIDBConnectionToServer::didGetAllRecords):
2987         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h:
2988         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.messages.in:
2989
2990 2016-10-31  Wenson Hsieh  <wenson_hsieh@apple.com>
2991
2992         [WK1] Candidate visibility should not update as a result of selection during a dictionary lookup
2993         https://bugs.webkit.org/show_bug.cgi?id=164236
2994         <rdar://problem/28747712>
2995
2996         Reviewed by Beth Dakin.
2997
2998         See WebCore ChangeLog for more detail. Removes m_isGettingDictionaryPopupInfo from the WebPage in favor of
2999         keeping track of the same state in Editor, so that both the WK1 and WK2 cases can share the same codepath.
3000
3001         * WebProcess/WebPage/WebPage.cpp:
3002         (WebKit::WebPage::didChangeSelection):
3003         * WebProcess/WebPage/WebPage.h:
3004         * WebProcess/WebPage/mac/WebPageMac.mm:
3005         (WebKit::WebPage::dictionaryPopupInfoForRange):
3006
3007 2016-10-31  Simon Fraser  <simon.fraser@apple.com>
3008
3009         Implement IntersectionObserver
3010         https://bugs.webkit.org/show_bug.cgi?id=159475
3011
3012         Reviewed by Ryosuke Niwa.
3013
3014         Add ENABLE_INTERSECTION_OBSERVER, enabled by default.
3015
3016         * Configurations/FeatureDefines.xcconfig:
3017
3018 2016-10-31  Ryan Haddad  <ryanhaddad@apple.com>
3019
3020         Unreviewed, rolling out r208154.
3021
3022         This change caused an assertion failure during API tests on
3023         macOS.
3024
3025         Reverted changeset:
3026
3027         "NetworkSession: Network process crash when converting main
3028         resource to download"
3029         https://bugs.webkit.org/show_bug.cgi?id=164220
3030         http://trac.webkit.org/changeset/208154
3031
3032 2016-10-28  Brent Fulgham  <bfulgham@apple.com>
3033
3034         Do a better job of protecting Frame objects in the context of JavaScript calls
3035         https://bugs.webkit.org/show_bug.cgi?id=164163
3036         <rdar://problem/28955249>
3037
3038         Reviewed by Darin Adler.
3039
3040         * WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp:
3041         (WebKit::InjectedBundleRangeHandle::renderedImage): Protected the Frame.
3042         * WebProcess/WebPage/WebPage.cpp:
3043         (WebKit::WebPage::insertTextAsync): Ditto.
3044         (WebKit::WebPage::setComposition): Ditto.
3045         * WebProcess/WebPage/mac/WebPageMac.mm:
3046         (WebKit::WebPage::insertDictatedTextAsync): Ditto.
3047
3048 2016-10-31  Carlos Garcia Campos  <cgarcia@igalia.com>
3049
3050         NetworkSession: Network process crash when converting main resource to download
3051         https://bugs.webkit.org/show_bug.cgi?id=164220
3052
3053         Reviewed by Alex Christensen.
3054
3055         Right after the main resource load is converted to a download, the web process deletes the ResourceLoader which
3056         sends the RemoveLoadIdentifier to the network process and the load is aborted. Sometimes it happens that
3057         NetworkResourceLoader::abort() is called while the NetworkLoad is still deciding the destination of the
3058         download. In such case, NetworkResourceLoader::didConvertToDownload() has already been called, but not
3059         NetworkResourceLoader::didBecomeDownload(). In NetworkResourceLoader::abort() we already handle the case of
3060         having a NetworkLoad after NetworkResourceLoader::didConvertToDownload() has been called, to avoid canceling the
3061         load in such case, however cleanup() is always called unconditionally and the NetworkLoad is deleted before
3062         NetworkResourceLoader::didBecomeDownload() is called. When the NetworkLoad is destroyed the NetworkDataTask
3063         client becomes nullptr, leaving it in a state where both the client is nullptr and the download hasn't been
3064         created yet. That's not expected to happen and when the response completion handler is called in the
3065         NetworkDataTask it tries to use either the client or the download and it crashes.
3066
3067         * NetworkProcess/NetworkResourceLoader.cpp:
3068         (WebKit::NetworkResourceLoader::didBecomeDownload): Call cleanup() instead of just deleting the network load.
3069         (WebKit::NetworkResourceLoader::abort): If we still have a network load that was converted to a download, do not
3070         call cleanup() because it will be called by didBecomeDownload() later.
3071
3072 2016-10-31  Darin Adler  <darin@apple.com>
3073
3074         Move ChildNode and ParentNode from ExceptionCode to Exception, add support for ExceptionOr<T&>
3075         https://bugs.webkit.org/show_bug.cgi?id=164214
3076
3077         Reviewed by Alex Christensen.
3078
3079         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocument.cpp:
3080         (webkit_dom_document_query_selector): Updated exception handling.
3081         (webkit_dom_document_query_selector_all): Ditto.
3082         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentFragment.cpp:
3083         (webkit_dom_document_fragment_query_selector): Ditto.
3084         (webkit_dom_document_fragment_query_selector_all): Ditto.
3085         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElement.cpp:
3086         (webkit_dom_element_query_selector): Ditto.
3087         (webkit_dom_element_query_selector_all): Ditto.
3088
3089 2016-10-31  Darin Adler  <darin@apple.com>
3090
3091         Convert Document from ExceptionCode to Exception
3092         https://bugs.webkit.org/show_bug.cgi?id=164212
3093
3094         Reviewed by Alex Christensen.
3095
3096         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocument.cpp:
3097         (webkit_dom_document_create_element): Updated exception handling.
3098         (webkit_dom_document_create_cdata_section): Ditto.
3099         (webkit_dom_document_create_processing_instruction): Ditto.
3100         (webkit_dom_document_create_attribute): Ditto.
3101         (webkit_dom_document_import_node): Ditto.
3102         (webkit_dom_document_create_element_ns): Ditto.
3103         (webkit_dom_document_create_attribute_ns): Ditto.
3104         (webkit_dom_document_adopt_node): Ditto.
3105         (webkit_dom_document_create_event): Ditto.
3106         (webkit_dom_document_set_xml_version): Ditto.
3107         (webkit_dom_document_get_cookie): Ditto.
3108         (webkit_dom_document_set_cookie): Ditto.
3109         (webkit_dom_document_set_body): Ditto.
3110         * WebProcess/InjectedBundle/API/mac/WKDOMDocument.mm:
3111         (-[WKDOMDocument createElement:]): Ditto.
3112
3113 2016-10-31  Wenson Hsieh  <wenson_hsieh@apple.com>
3114
3115         Holding down a key to choose an accented character should fire "insertReplacementText" input events
3116         https://bugs.webkit.org/show_bug.cgi?id=164209
3117         <rdar://problem/29019305>
3118
3119         Reviewed by Darin Adler.
3120
3121         When replacing text, call Editor::insertText with the correct TextEventInputType so that WebCore will know to
3122         use EditActionInsertReplacement when creating and applying the corresponding TypingCommand. Additional minor
3123         changes in order to support testing replacement text insertion.
3124
3125         * UIProcess/API/Cocoa/WKWebView.mm:
3126         (-[WKWebView _insertText:replacementRange:]):
3127         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
3128         * WebProcess/WebPage/WebPage.cpp:
3129         (WebKit::WebPage::insertTextAsync):
3130
3131 2016-10-30  Darin Adler  <darin@apple.com>
3132
3133         Move Element, NamedNodeMap, and DOMStringMap from ExceptionCode to Exception
3134         https://bugs.webkit.org/show_bug.cgi?id=164206
3135
3136         Reviewed by Chris Dumez.
3137
3138         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNamedNodeMap.cpp:
3139         (webkit_dom_named_node_map_set_named_item): Updated exception handling.
3140         (webkit_dom_named_node_map_remove_named_item): Ditto.
3141         (webkit_dom_named_node_map_set_named_item_ns): Ditto.
3142         (webkit_dom_named_node_map_remove_named_item_ns): Ditto.
3143         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElement.cpp:
3144         (webkit_dom_element_set_attribute): Ditto.
3145         (webkit_dom_element_set_attribute_node): Ditto.
3146         (webkit_dom_element_remove_attribute_node): Ditto.
3147         (webkit_dom_element_set_attribute_ns): Ditto.
3148         (webkit_dom_element_set_attribute_node_ns): Ditto.
3149         (webkit_dom_element_matches): Ditto.
3150         (webkit_dom_element_closest): Ditto.
3151         (webkit_dom_element_webkit_matches_selector): Ditto.
3152         (webkit_dom_element_insert_adjacent_element): Ditto.
3153         (webkit_dom_element_insert_adjacent_html): Ditto.
3154         (webkit_dom_element_insert_adjacent_text): Ditto.
3155         (webkit_dom_element_set_inner_html): Ditto.
3156         (webkit_dom_element_set_outer_html): Ditto.
3157         * WebProcess/InjectedBundle/API/mac/WKDOMElement.mm:
3158         (-[WKDOMElement setAttribute:value:]): Ditto.
3159
3160 2016-10-30  Yusuke Suzuki  <utatane.tea@gmail.com>
3161
3162         [DOM] Introduce WebCore::jsDynamicDowncast
3163         https://bugs.webkit.org/show_bug.cgi?id=164137
3164
3165         Reviewed by Darin Adler.
3166
3167         * WebProcess/Automation/WebAutomationSessionProxy.cpp:
3168         (WebKit::WebAutomationSessionProxy::elementForNodeHandle):
3169
3170 2016-10-29  Darin Adler  <darin@apple.com>
3171
3172         Convert more of DOM from ExceptionCode to Exception
3173         https://bugs.webkit.org/show_bug.cgi?id=164173
3174
3175         Reviewed by Ryosuke Niwa.
3176
3177         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCharacterData.cpp:
3178         (webkit_dom_character_data_substring_data): Updated since this
3179         now uses ExceptionOr.
3180         (webkit_dom_character_data_insert_data): Ditto.
3181         (webkit_dom_character_data_delete_data): Ditto.
3182         (webkit_dom_character_data_replace_data): Ditto.
3183         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDeprecated.cpp:
3184         (webkit_dom_text_replace_whole_text): Ditto.
3185         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMText.cpp:
3186         (webkit_dom_text_split_text): Ditto.
3187
3188 2016-10-28  Darin Adler  <darin@apple.com>
3189
3190         Move all classes in the HTML directory from ExceptionCode to Exception
3191         https://bugs.webkit.org/show_bug.cgi?id=163876
3192
3193         Reviewed by Sam Weinig.
3194
3195         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMTokenList.cpp:
3196         (webkit_dom_dom_token_list_add): Updated exception handling.
3197         (webkit_dom_dom_token_list_remove): Ditto.
3198         (webkit_dom_dom_token_list_toggle): Ditto.
3199         (webkit_dom_dom_token_list_replace): Ditto.
3200         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElement.cpp:
3201         (webkit_dom_element_remove): Ditto.
3202         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLElement.cpp:
3203         (webkit_dom_html_element_set_inner_text): Ditto.
3204         (webkit_dom_html_element_set_outer_text): Ditto.
3205         (webkit_dom_html_element_set_content_editable): Ditto.
3206         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLInputElement.cpp:
3207         (webkit_dom_html_input_element_set_max_length): Ditto.
3208         (webkit_dom_html_input_element_set_size): Ditto.
3209         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLSelectElement.cpp:
3210         (webkit_dom_html_select_element_set_length): Ditto.
3211         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableElement.cpp:
3212         (webkit_dom_html_table_element_insert_row): Ditto.
3213         (webkit_dom_html_table_element_delete_row): Ditto.
3214         (webkit_dom_html_table_element_set_caption): Ditto.
3215         (webkit_dom_html_table_element_set_t_head): Ditto.
3216         (webkit_dom_html_table_element_set_t_foot): Ditto.
3217         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableRowElement.cpp:
3218         (webkit_dom_html_table_row_element_insert_cell): Ditto.
3219         (webkit_dom_html_table_row_element_delete_cell): Ditto.
3220         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableSectionElement.cpp:
3221         (webkit_dom_html_table_section_element_insert_row): Ditto.
3222         (webkit_dom_html_table_section_element_delete_row): Ditto.
3223
3224         * WebProcess/WebPage/WebPage.cpp:
3225         (WebKit::WebPage::editorState): Removed ASSERT_NO_EXCEPTION.
3226
3227         * WebProcess/WebPage/ios/WebPageIOS.mm:
3228         (WebKit::WebPage::setAssistedNodeValueAsNumber): Removed ASSERT_NO_EXCEPTION.
3229
3230         * WebProcess/cocoa/WebPlaybackSessionManager.mm:
3231         (WebKit::WebPlaybackSessionManager::seekableRangesChanged):
3232         Changed the code to use a different interface to TimeRange that does
3233         not involve exceptions.
3234
3235 2016-10-28  Wenson Hsieh  <wenson_hsieh@apple.com>
3236
3237         iOS autocorrection does not trigger an input event of inputType "insertReplacementText"
3238         https://bugs.webkit.org/show_bug.cgi?id=164077
3239         <rdar://problem/28987810>
3240
3241         Reviewed by Simon Fraser.
3242
3243         Small tweak to mark text insertion when autocorrecting as such, as opposed to regular keyboard input.
3244
3245         * WebProcess/WebPage/ios/WebPageIOS.mm:
3246         (WebKit::WebPage::syncApplyAutocorrection):
3247
3248 2016-10-28  Megan Gardner  <megan_gardner@apple.com>
3249
3250         Rename SharedMemoryMac to SharedMemoryCocoa
3251         https://bugs.webkit.org/show_bug.cgi?id=164156
3252
3253         Reviewed by Alex Christensen.
3254
3255         Renamed SharedMemoryMac to SharedMemoryCocoa, as it runs on all cocoa platforms, not exclusively just mac, and
3256         thus should be named to reflect that reality.
3257
3258         * Platform/cocoa: Added.
3259         * Platform/cocoa/SharedMemoryCocoa.cpp: Copied from Source/WebKit2/Platform/mac/SharedMemoryMac.cpp.
3260         * Platform/mac/SharedMemoryMac.cpp: Removed.
3261         * WebKit2.xcodeproj/project.pbxproj:
3262
3263 2016-10-28  Antti Koivisto  <antti@apple.com>
3264
3265         Enable CFNetwork connection cache fast lane for WebKit2
3266         https://bugs.webkit.org/show_bug.cgi?id=164129
3267
3268         Reviewed by Andreas Kling.
3269
3270         The idea of this feature is keep a connection free for higher priority requests so low-priority
3271         image loads can't take all the available connections.
3272
3273         We have this enabled on WK1 but not on WK2. See what enabling it does for performance in bots.
3274
3275         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
3276         (WebKit::initializeNetworkSettings):
3277
3278             Based on code inspection setting kHTTPMinimumFastLanePriority is not sufficient to enable this feature,
3279             kHTTPNumFastLanes needs also be set to a non-zero value. Use the same constants as WK1.
3280             Also enable this on Mac to unify behavior.
3281
3282 2016-10-27  Michael Catanzaro  <mcatanzaro@igalia.com>
3283
3284         [GTK] New stable DOM API headers should be included from webkitdom.h
3285         https://bugs.webkit.org/show_bug.cgi?id=164069
3286
3287         Reviewed by Carlos Garcia Campos.
3288
3289         * WebProcess/InjectedBundle/API/gtk/DOM/webkitdom.h:
3290
3291 2016-10-27  Simon Fraser  <simon.fraser@apple.com>
3292
3293         Fix when building against the MacOSX10.12.sdk where "macos" is not recognized
3294         in the availability macros.
3295
3296         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
3297
3298 2016-10-27  Megan Gardner  <megan_gardner@apple.com>
3299
3300         Add support for wide gamut for ShareableBitmap for image popovers
3301         https://bugs.webkit.org/show_bug.cgi?id=164001
3302
3303         Reviewed by Simon Fraser.
3304
3305         Added suppport for wide gamut in ShareableBitmap. SharableBitmaps now know the size of their pixels,
3306         and that data is passed back and forth between the processes. The callers of SharedBitmap will determine
3307         if their image should support wide gamut, but ShareableBitmap will override a set flag on a device that
3308         is incapbable of supporting a wide gamut image.
3309         This makes it possible to show wide gamut images in image popovers on iOS.
3310         This is currently untestable, so no tests added.
3311
3312         * Platform/IPC/Decoder.cpp:
3313         (IPC::Decoder::decode):
3314         * Platform/IPC/Decoder.h:
3315         * Platform/IPC/Encoder.cpp:
3316         (IPC::Encoder::encode):
3317         * Platform/IPC/Encoder.h:
3318         * Shared/ShareableBitmap.cpp:
3319         (WebKit::bytesPerPixel):
3320         (WebKit::ShareableBitmap::Handle::encode):
3321         (WebKit::ShareableBitmap::Handle::decode):
3322         (WebKit::ShareableBitmap::Handle::clear):
3323         (WebKit::ShareableBitmap::create):
3324         (WebKit::ShareableBitmap::createShareable):
3325         (WebKit::ShareableBitmap::createHandle):
3326         (WebKit::ShareableBitmap::ShareableBitmap):
3327         * Shared/ShareableBitmap.h:
3328         (WebKit::ShareableBitmap::numBytesForSize):
3329         (WebKit::ShareableBitmap::sizeInBytes):
3330         * Shared/cg/ShareableBitmapCG.cpp:
3331         (WebKit::bitmapInfo):
3332         (WebKit::ShareableBitmap::createGraphicsContext):
3333         (WebKit::ShareableBitmap::createCGImage):
3334         * WebProcess/WebPage/ios/WebPageIOS.mm:
3335         (WebKit::WebPage::getPositionInformation):
3336
3337 2016-10-27  Wenson Hsieh  <wenson_hsieh@apple.com>
3338
3339         Support "insertFromDrop" and "deleteByDrag" for the InputEvent spec
3340         https://bugs.webkit.org/show_bug.cgi?id=163948
3341         <rdar://problem/28921433>
3342
3343         Reviewed by Darin Adler.
3344
3345         Add support for new drag and drop-related EditAction enum values.
3346
3347         * UIProcess/WebEditCommandProxy.cpp:
3348         (WebKit::WebEditCommandProxy::nameForEditAction):
3349
3350 2016-10-26  Chris Dumez  <cdumez@apple.com>
3351
3352         Replace IDBKeyPath with a WTF::Variant
3353         https://bugs.webkit.org/show_bug.cgi?id=163909
3354
3355         Reviewed by Darin Adler.
3356
3357         Add coders to encode / decode IDBKeyPath type for IPC.
3358
3359         * Shared/Databases/IndexedDB/WebIDBResult.cpp:
3360         * Shared/WebCoreArgumentCoders.cpp:
3361         (IPC::ArgumentCoder<IDBKeyPath>::encode):
3362         (IPC::ArgumentCoder<IDBKeyPath>::decode):
3363         * Shared/WebCoreArgumentCoders.h:
3364         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
3365
3366 2016-10-26  Brian Burg  <bburg@apple.com>
3367
3368         Web Inspector: remove unused bool return value from FrontendChannel::sendMessageToFrontend
3369         https://bugs.webkit.org/show_bug.cgi?id=164046
3370
3371         Reviewed by Joseph Pecoraro.
3372
3373         * WebProcess/WebPage/WebInspector.cpp:
3374         (WebKit::WebInspector::sendMessageToFrontend):
3375         * WebProcess/WebPage/WebInspector.h:
3376
3377 2016-10-26  Eric Carlson  <eric.carlson@apple.com>
3378
3379         [MediaStream] Add "has capture device" bit to media state flags
3380         https://bugs.webkit.org/show_bug.cgi?id=163952
3381
3382         Unreviewed fix after r207839.
3383
3384         * WebProcess/WebPage/WebPage.cpp:
3385         (WebKit::WebPage::setMuted): Take an MutedStateFlags, not a bool.
3386         * WebProcess/WebPage/WebPage.h:
3387
3388 2016-10-26  Carlos Garcia Campos  <cgarcia@igalia.com>
3389
3390         Unreviewed. Update OptionsGTK.cmake and NEWS for 2.15.1 release.
3391
3392         * gtk/NEWS: Add release notes for 2.15.1.
3393
3394 2016-10-26  Carlos Garcia Campos  <cgarcia@igalia.com>
3395
3396         REGRESSION(r206505) [GTK] Build broken with GTK+ 3.14
3397         https://bugs.webkit.org/show_bug.cgi?id=162776
3398
3399         Reviewed by Xabier Rodriguez-Calvar.
3400
3401         Do not use gtk_widget_get_action_group() when GTK+ < 3.16, use g_object_set instead to attach the action group
3402         to the menu widget.
3403
3404         * UIProcess/gtk/WebContextMenuProxyGtk.cpp:
3405         (WebKit::WebContextMenuProxyGtk::append):
3406         (WebKit::WebContextMenuProxyGtk::WebContextMenuProxyGtk):
3407         (WebKit::WebContextMenuProxyGtk::~WebContextMenuProxyGtk):
3408
3409 2016-10-25  Alex Christensen  <achristensen@webkit.org>
3410
3411         CMake build fix.
3412
3413         * PlatformMac.cmake:
3414         * Shared/WebHitTestResultData.cpp:
3415         (WebKit::WebHitTestResultData::WebHitTestResultData):
3416         Explicitly call AtomicString::string to make the String constructor no longer ambiguous.
3417         It couldn't decide whether to use operator const String& or operator NSString*.
3418
3419 2016-10-25  Carlos Garcia Campos  <cgarcia@igalia.com>
3420
3421         [SOUP] Network process assertion in NetworkDataTask::continueHTTPRedirection
3422         https://bugs.webkit.org/show_bug.cgi?id=163941
3423
3424         Reviewed by Michael Catanzaro.
3425
3426         equalLettersIgnoringASCIICase() expects the second argument to be the letters to compare in lowercase, so use
3427         "get" instead of "GET".
3428
3429         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
3430         (WebKit::NetworkDataTaskSoup::continueHTTPRedirection):
3431
3432 2016-10-25  Eric Carlson  <eric.carlson@apple.com>
3433
3434         [MediaStream] Add "has capture device" bit to media state flags
3435         https://bugs.webkit.org/show_bug.cgi?id=163952
3436
3437         Reviewed by Sam Weinig.
3438
3439         * UIProcess/API/C/WKPage.cpp:
3440         (WKPageGetMediaState): Support MediaProducer::HasMediaCaptureDevice.
3441         * UIProcess/API/C/WKPagePrivate.h: Define kWKMediaHasCaptureDevice.
3442
3443 2016-10-25  Commit Queue  <commit-queue@webkit.org>
3444
3445         Unreviewed, rolling out r207827 and r207828.
3446         https://bugs.webkit.org/show_bug.cgi?id=163965
3447
3448         Caused LayoutTest webaudio/web-audio-is-playing.html to time
3449         out on macOS. (Requested by ryanhaddad on #webkit).
3450
3451         Reverted changesets:
3452
3453         "[MediaStream] Add "has capture device" bit to media state
3454         flags"
3455         https://bugs.webkit.org/show_bug.cgi?id=163952
3456         http://trac.webkit.org/changeset/207827
3457
3458         "[MediaStream] Add "has capture device" bit to media state
3459         flags"
3460         https://bugs.webkit.org/show_bug.cgi?id=163952
3461         http://trac.webkit.org/changeset/207828
3462
3463 2016-10-25  Eric Carlson  <eric.carlson@apple.com>
3464
3465         [MediaStream] Add "has capture device" bit to media state flags
3466         https://bugs.webkit.org/show_bug.cgi?id=163952
3467
3468         Reviewed by Sam Weinig.
3469
3470         * UIProcess/API/C/WKPage.cpp:
3471         (WKPageGetMediaState): Support MediaProducer::HasMediaCaptureDevice.
3472         * UIProcess/API/C/WKPagePrivate.h: Define kWKMediaHasCaptureDevice.
3473
3474 2016-10-25  Chris Dumez  <cdumez@apple.com>
3475
3476         Unreviewed, rolling out r207494.
3477
3478         iOS SDK has been updated on the bots now so rollout the
3479         rollout
3480
3481         Reverted changeset:
3482
3483         "Unreviewed, rolling out r207413."
3484         https://bugs.webkit.org/show_bug.cgi?id=163547
3485         http://trac.webkit.org/changeset/207494
3486
3487 2016-10-25  Jonathan Bedard  <jbedard@apple.com>
3488
3489         Unreviewed build fix.
3490
3491         * UIProcess/API/Cocoa/WKWebView.mm:
3492         (-[WKWebView _fullscreenDelegate]): Removed unneeded parenthesis.
3493
3494 2016-10-19  Jer Noble  <jer.noble@apple.com>
3495
3496         Add WKWebView fullscreen delegate SPI
3497         https://bugs.webkit.org/show_bug.cgi?id=163674
3498
3499         Reviewed by Anders Carlsson.
3500
3501         Add a new SPI property to WKWebView allowing clients to be notified when fullscreen mode enters and exits.
3502
3503         * UIProcess/API/APIFullscreenClient.h: Added.
3504         (API::FullscreenClient::~FullscreenClient):
3505         (API::FullscreenClient::willEnterFullscreen):
3506         (API::FullscreenClient::didEnterFullscreen):
3507         (API::FullscreenClient::willExitFullscreen):
3508         (API::FullscreenClient::didExitFullscreen):
3509         * UIProcess/API/Cocoa/WKWebView.mm:
3510         (-[WKWebView _initializeWithConfiguration:]):
3511         (-[WKWebView _setFullscreenDelegate:]):
3512         (-[WKWebView _fullscreenDelegate]):
3513         (-[WKWebView _isInFullscreen]):
3514         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
3515         * UIProcess/API/Cocoa/_WKFullscreenDelegate.h: Added.
3516         * UIProcess/Cocoa/FullscreenClient.h: Added.
3517         (WebKit::FullscreenClient::~FullscreenClient):
3518         * UIProcess/Cocoa/FullscreenClient.mm: Added.
3519         (WebKit::FullscreenClient::FullscreenClient):
3520         (WebKit::FullscreenClient::delegate):
3521         (WebKit::FullscreenClient::setDelegate):
3522         (WebKit::FullscreenClient::willEnterFullscreen):
3523         (WebKit::FullscreenClient::didEnterFullscreen):
3524         (WebKit::FullscreenClient::willExitFullscreen):
3525         (WebKit::FullscreenClient::didExitFullscreen):
3526         * UIProcess/WebFullScreenManagerProxy.cpp:
3527         (WebKit::WebFullScreenManagerProxy::willEnterFullScreen):
3528         (WebKit::WebFullScreenManagerProxy::didEnterFullScreen):
3529         (WebKit::WebFullScreenManagerProxy::willExitFullScreen):
3530         (WebKit::WebFullScreenManagerProxy::didExitFullScreen):
3531         * UIProcess/WebPageProxy.cpp:
3532         (WebKit::WebPageProxy::WebPageProxy):
3533         (WebKit::WebPageProxy::setFullscreenClient):
3534         (WebKit::WebPageProxy::fullScreenManager): Deleted.
3535         * UIProcess/WebPageProxy.h:
3536         (WebKit::WebPageProxy::fullscreenClient):
3537         * WebKit2.xcodeproj/project.pbxproj:
3538
3539 2016-10-25  Carlos Garcia Campos  <cgarcia@igalia.com>
3540
3541         Unreviewed. Fix timeouts in 12 GTK+ unit tests after r207812.
3542
3543         * NetworkProcess/NetworkProcessCreationParameters.h: Initialize loadThrottleLatency.
3544
3545 2016-10-25  Carlos Garcia Campos  <cgarcia@igalia.com>
3546
3547         Unreviewed. Fix Soup based ports debug build after r207813.
3548
3549         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
3550         (WebKit::NetworkDataTaskSoup::authenticateCallback):
3551         (WebKit::NetworkDataTaskSoup::requestStartedCallback):
3552
3553 2016-10-25  Andreas Kling  <akling@apple.com>
3554
3555         More PassRefPtr purging in WebCore.
3556         <https://webkit.org/b/163895>
3557
3558         Reviewed by Antti Koivisto.
3559
3560         * WebProcess/Plugins/PDF/DeprecatedPDFPlugin.h:
3561         * WebProcess/Plugins/PDF/DeprecatedPDFPlugin.mm:
3562         (WebKit::PDFPlugin::createScrollbar):
3563
3564 2016-10-25  Carlos Garcia Campos  <cgarcia@igalia.com>
3565
3566         NetworkSession: switch to use subclasses for NetworkSession and NetworkDataTask implementations
3567         https://bugs.webkit.org/show_bug.cgi?id=163777
3568
3569         Reviewed by Alex Christensen.
3570
3571         The subclass model allows us to choose the implementation at run time, so we could add other implementations
3572         like a mock network class to measure performance, and even one for blobs and finally get rid of ResourceHandle
3573         in WebKit2.
3574
3575         * CMakeLists.txt: Add new files to compilation.
3576         * NetworkProcess/NetworkDataTask.cpp: Added.
3577         (WebKit::NetworkDataTask::create): Create a NetworkDataTaskCocoa or NetworkDataTaskSoup.
3578         (WebKit::NetworkDataTask::NetworkDataTask): Move common code from NetworkDataTaskCocoa and NetworkDataTaskSoup
3579         here to handle the early failures.
3580         (WebKit::NetworkDataTask::~NetworkDataTask):
3581         (WebKit::NetworkDataTask::scheduleFailure):
3582         (WebKit::NetworkDataTask::failureTimerFired):
3583         * NetworkProcess/NetworkDataTask.h: Remove platform specific members.
3584         (WebKit::NetworkDataTask::setPendingDownloadLocation): Make it virtual and set the m_pendingDownloadLocation.
3585         (WebKit::NetworkDataTask::suggestedFilename): Make it virtual and const with a default implementation.
3586         (WebKit::NetworkDataTask::setSuggestedFilename): Ditto.
3587         (WebKit::NetworkDataTask::allowsSpecificHTTPSCertificateForHost): Ditto.
3588         * NetworkProcess/NetworkLoad.cpp: Include NetworkDataTaskCocoa.h.
3589         * NetworkProcess/NetworkLoad.h: Include NetworkDataTask.h instead of NetworkSession.h.
3590         * NetworkProcess/NetworkProcess.cpp:
3591         (WebKit::NetworkProcess::NetworkProcess): Use NetworkSessionCocoa.
3592         * NetworkProcess/NetworkSession.cpp:
3593         (WebKit::NetworkSession::create): Create a NetworkSessionCocoa or NetworkSessionSoup.
3594         (WebKit::NetworkSession::defaultSession): In case of cocoa use NetworkSessionCocoa::defaultSession() because of
3595         the custom protocol manager, otherwise simply create a default session.
3596         (WebKit::NetworkSession::networkStorageSession): Move common code from NetworkSessionCocoa and
3597         NetworkSessionSoup here.
3598         (WebKit::NetworkSession::NetworkSession):
3599         (WebKit::NetworkSession::~NetworkSession):
3600         * NetworkProcess/NetworkSession.h: Remove platform specific members.
3601         (WebKit::NetworkSession::invalidateAndCancel): Make it virtual.
3602         (WebKit::NetworkSession::clearCredentials): Ditto.
3603         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp: Include NetworkSession.h.
3604         * NetworkProcess/cocoa/NetworkDataTaskCocoa.h: Added.
3605         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
3606         (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa):
3607         (WebKit::NetworkDataTaskCocoa::~NetworkDataTaskCocoa):
3608         (WebKit::NetworkDataTaskCocoa::didSendData):
3609         (WebKit::NetworkDataTaskCocoa::didReceiveChallenge):
3610         (WebKit::NetworkDataTaskCocoa::didCompleteWithError):
3611         (WebKit::NetworkDataTaskCocoa::didReceiveResponse):
3612         (WebKit::NetworkDataTaskCocoa::didReceiveData):
3613         (WebKit::NetworkDataTaskCocoa::didBecomeDownload):
3614         (WebKit::NetworkDataTaskCocoa::willPerformHTTPRedirection):
3615         (WebKit::NetworkDataTaskCocoa::setPendingDownloadLocation):
3616         (WebKit::NetworkDataTaskCocoa::tryPasswordBasedAuthentication):
3617         (WebKit::NetworkDataTaskCocoa::transferSandboxExtensionToDownload):
3618         (WebKit::NetworkDataTaskCocoa::allowsSpecificHTTPSCertificateForHost):
3619         (WebKit::NetworkDataTaskCocoa::suggestedFilename):
3620         (WebKit::NetworkDataTaskCocoa::cancel):
3621         (WebKit::NetworkDataTaskCocoa::resume):
3622         (WebKit::NetworkDataTaskCocoa::suspend):
3623         (WebKit::NetworkDataTaskCocoa::state):
3624         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
3625         (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
3626         * NetworkProcess/cocoa/NetworkSessionCocoa.h: Added.
3627         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
3628         (-[WKNetworkSessionDelegate initWithNetworkSession:withCredentials:]):
3629         (-[WKNetworkSessionDelegate URLSession:dataTask:didBecomeDownloadTask:]):
3630         (WebKit::configurationForSessionID):
3631         (WebKit::NetworkSessionCocoa::setCustomProtocolManager):
3632         (WebKit::NetworkSessionCocoa::setSourceApplicationAuditTokenData):
3633         (WebKit::NetworkSessionCocoa::setSourceApplicationBundleIdentifier):
3634         (WebKit::NetworkSessionCocoa::setSourceApplicationSecondaryIdentifier):
3635         (WebKit::NetworkSessionCocoa::setCTDataConnectionServiceType):
3636         (WebKit::NetworkSessionCocoa::create):
3637         (WebKit::NetworkSessionCocoa::defaultSession):
3638         (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
3639         (WebKit::NetworkSessionCocoa::~NetworkSessionCocoa):
3640         (WebKit::NetworkSessionCocoa::invalidateAndCancel):
3641         (WebKit::NetworkSessionCocoa::clearCredentials):
3642         (WebKit::NetworkSessionCocoa::dataTaskForIdentifier):
3643         (WebKit::NetworkSessionCocoa::addDownloadID):
3644         (WebKit::NetworkSessionCocoa::downloadID):
3645         (WebKit::NetworkSessionCocoa::takeDownloadID):
3646         * NetworkProcess/mac/RemoteNetworkingContext.mm:
3647         (WebKit::RemoteNetworkingContext::ensurePrivateBrowsingSession):
3648         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
3649         (WebKit::NetworkDataTaskSoup::NetworkDataTaskSoup):
3650         (WebKit::NetworkDataTaskSoup::~NetworkDataTaskSoup):
3651         (WebKit::NetworkDataTaskSoup::suggestedFilename):
3652         (WebKit::NetworkDataTaskSoup::setPendingDownloadLocation):
3653         (WebKit::NetworkDataTaskSoup::createRequest):
3654         (WebKit::NetworkDataTaskSoup::clearRequest):
3655         (WebKit::NetworkDataTaskSoup::resume):
3656         (WebKit::NetworkDataTaskSoup::suspend):
3657         (WebKit::NetworkDataTaskSoup::cancel):
3658         (WebKit::NetworkDataTaskSoup::invalidateAndCancel):
3659         (WebKit::NetworkDataTaskSoup::state):
3660         (WebKit::NetworkDataTaskSoup::timeoutFired):
3661         (WebKit::NetworkDataTaskSoup::startTimeout):
3662         (WebKit::NetworkDataTaskSoup::stopTimeout):
3663         (WebKit::NetworkDataTaskSoup::sendRequestCallback):
3664         (WebKit::NetworkDataTaskSoup::didSendRequest):
3665         (WebKit::NetworkDataTaskSoup::didReceiveResponse):
3666         (WebKit::NetworkDataTaskSoup::tlsErrorsChangedCallback):
3667         (WebKit::NetworkDataTaskSoup::tlsErrorsChanged):
3668         (WebKit::NetworkDataTaskSoup::applyAuthenticationToRequest):
3669         (WebKit::NetworkDataTaskSoup::authenticateCallback):
3670         (WebKit::NetworkDataTaskSoup::authenticate):
3671         (WebKit::NetworkDataTaskSoup::continueAuthenticate):
3672         (WebKit::NetworkDataTaskSoup::skipInputStreamForRedirectionCallback):
3673         (WebKit::NetworkDataTaskSoup::skipInputStreamForRedirection):
3674         (WebKit::NetworkDataTaskSoup::didFinishSkipInputStreamForRedirection):
3675         (WebKit::NetworkDataTaskSoup::shouldStartHTTPRedirection):
3676         (WebKit::NetworkDataTaskSoup::continueHTTPRedirection):
3677         (WebKit::NetworkDataTaskSoup::readCallback):
3678         (WebKit::NetworkDataTaskSoup::read):
3679         (WebKit::NetworkDataTaskSoup::didRead):
3680         (WebKit::NetworkDataTaskSoup::didFinishRead):
3681         (WebKit::NetworkDataTaskSoup::requestNextPartCallback):
3682         (WebKit::NetworkDataTaskSoup::requestNextPart):
3683         (WebKit::NetworkDataTaskSoup::didRequestNextPart):
3684         (WebKit::NetworkDataTaskSoup::didFinishRequestNextPart):
3685         (WebKit::NetworkDataTaskSoup::gotHeadersCallback):
3686         (WebKit::NetworkDataTaskSoup::didGetHeaders):
3687         (WebKit::NetworkDataTaskSoup::wroteBodyDataCallback):
3688         (WebKit::NetworkDataTaskSoup::didWriteBodyData):
3689         (WebKit::NetworkDataTaskSoup::download):
3690         (WebKit::NetworkDataTaskSoup::writeDownloadCallback):
3691         (WebKit::NetworkDataTaskSoup::writeDownload):
3692         (WebKit::NetworkDataTaskSoup::didWriteDownload):
3693         (WebKit::NetworkDataTaskSoup::didFinishDownload):
3694         (WebKit::NetworkDataTaskSoup::didFailDownload):
3695         (WebKit::NetworkDataTaskSoup::cleanDownloadFiles):
3696         (WebKit::NetworkDataTaskSoup::didFail):
3697         (WebKit::NetworkDataTaskSoup::networkEventCallback):
3698         (WebKit::NetworkDataTaskSoup::networkEvent):
3699         (WebKit::NetworkDataTaskSoup::startingCallback):
3700         (WebKit::NetworkDataTaskSoup::requestStartedCallback):
3701         (WebKit::NetworkDataTaskSoup::didStartRequest):
3702         (WebKit::NetworkDataTaskSoup::restartedCallback):
3703         (WebKit::NetworkDataTaskSoup::didRestart):
3704         * NetworkProcess/soup/NetworkDataTaskSoup.h: Added.
3705         * NetworkProcess/soup/NetworkSessionSoup.cpp:
3706         (WebKit::NetworkSessionSoup::NetworkSessionSoup):
3707         (WebKit::NetworkSessionSoup::~NetworkSessionSoup):
3708         (WebKit::NetworkSessionSoup::soupSession):
3709         (WebKit::NetworkSessionSoup::invalidateAndCancel):
3710         * NetworkProcess/soup/NetworkSessionSoup.h: Added.
3711         * NetworkProcess/soup/RemoteNetworkingContextSoup.cpp:
3712         (WebKit::RemoteNetworkingContext::ensurePrivateBrowsingSession): Update to new NetworkSession::create() API.
3713         * PlatformEfl.cmake: Add new files to compilation.
3714         * PlatformGTK.cmake: Ditto.
3715         * WebKit2.xcodeproj/project.pbxproj: Ditto.
3716         * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm:
3717         (WebKit::WebFrameNetworkingContext::ensurePrivateBrowsingSession): Update to new NetworkSession::create() API.
3718         * WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.cpp:
3719         (WebKit::WebFrameNetworkingContext::ensurePrivateBrowsingSession): Ditto.
3720
3721 2016-10-25  Antti Koivisto  <antti@apple.com>
3722
3723         Add support for introducing simulated latency in network process
3724         https://bugs.webkit.org/show_bug.cgi?id=163902
3725
3726         Reviewed by Alex Christensen.
3727
3728         For testing purposes it is useful to have a mechanism for simulating high latency.
3729         This patch adds a basic mechanism that introduces a delay to each response in network
3730         process. In Safari it can be used with
3731
3732              defaults write com.apple.Safari WebKitNetworkLoadThrottleLatencyMilliseconds 200
3733
3734         Setting the delay to 0 disables the feature.
3735
3736         * NetworkProcess/NetworkLoad.cpp:
3737         (WebKit::NetworkLoad::Throttle::Throttle):
3738         (WebKit::NetworkLoad::didReceiveResponseNetworkSession):
3739         (WebKit::NetworkLoad::notifyDidReceiveResponse):
3740         (WebKit::NetworkLoad::didReceiveData):
3741         (WebKit::NetworkLoad::didCompleteWithError):
3742         (WebKit::NetworkLoad::throttleDelayCompleted):
3743         * NetworkProcess/NetworkLoad.h:
3744         * NetworkProcess/NetworkProcess.cpp:
3745         (WebKit::NetworkProcess::initializeNetworkProcess):
3746         * NetworkProcess/NetworkProcess.h:
3747         (WebKit::NetworkProcess::loadThrottleLatency):
3748         * NetworkProcess/NetworkProcessCreationParameters.cpp:
3749         (WebKit::NetworkProcessCreationParameters::encode):
3750         (WebKit::NetworkProcessCreationParameters::decode):
3751         * NetworkProcess/NetworkProcessCreationParameters.h:
3752         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
3753         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
3754
3755 2016-10-24  Dan Bernstein  <mitz@apple.com>
3756
3757         REGRESSION (r206410): Sandbox violations beneath WebProcessProxy::platformIsBeingDebugged
3758         https://bugs.webkit.org/show_bug.cgi?id=163879
3759         <rdar://problem/28728735>
3760
3761         Reviewed by Darin Adler.
3762
3763         * UIProcess/Cocoa/WebProcessProxyCocoa.mm:
3764         (WebKit::WebProcessProxy::platformIsBeingDebugged): Check if the current process, which is
3765           the UI process, is sandboxed before trying to find out if the Web process is being
3766           debugged.
3767
3768 2016-10-21  Alex Christensen  <achristensen@webkit.org>
3769
3770         URL::port should return Optional<uint16_t>
3771         https://bugs.webkit.org/show_bug.cgi?id=163806
3772
3773         Reviewed by Darin Adler.
3774
3775         * NetworkProcess/mac/NetworkProcessMac.mm:
3776         (WebKit::overrideSystemProxies):
3777         * Shared/API/APISecurityOrigin.h:
3778         (API::SecurityOrigin::create):
3779         * Shared/API/APIURL.h:
3780         (API::URL::protocol):
3781         * Shared/API/c/WKSecurityOriginRef.cpp:
3782         (WKSecurityOriginGetPort):
3783         * UIProcess/API/Cocoa/WKSecurityOrigin.mm:
3784         (-[WKSecurityOrigin port]):
3785         * WebProcess/WebPage/WebPage.cpp:
3786         (WebKit::WebPage::canHandleRequest):
3787         * WebProcess/cocoa/WebProcessCocoa.mm:
3788         (WebKit::origin):
3789
3790 2016-10-24  Eric Carlson  <eric.carlson@apple.com>
3791
3792         [MediaStream] Separate media capture and audio playback muting
3793         https://bugs.webkit.org/show_bug.cgi?id=163855
3794         <rdar://problem/28827186>
3795
3796         Reviewed by Darin Adler.
3797
3798         * Shared/WebPageCreationParameters.h: Change 'muted' from bool to MutedStateFlags.
3799
3800         * UIProcess/API/C/WKPage.cpp: Change parameter from bool to WKMediaMutedState.
3801         (WKPageSetMuted):
3802         * UIProcess/API/C/WKPagePrivate.h: Define WKMediaMutedState.
3803
3804         * UIProcess/WebPageProxy.cpp:
3805         (WebKit::WebPageProxy::WebPageProxy):
3806         (WebKit::WebPageProxy::setMuted): m_muted -> m_mutedState.
3807         (WebKit::WebPageProxy::creationParameters): Ditto.
3808         * UIProcess/WebPageProxy.h:
3809
3810         * WebProcess/Plugins/PluginView.cpp:
3811         (WebKit::PluginView::isMuted): page.isMuted -> page.mutedState.
3812
3813         * WebProcess/WebPage/WebPage.messages.in: Change SetMuted parameter.
3814
3815 2016-10-24  Youenn Fablet  <youenn@apple.com>
3816
3817         Activate WEB_RTC compilation flags for Mac bots
3818         https://bugs.webkit.org/show_bug.cgi?id=163886
3819
3820         Reviewed by Eric Carlson.
3821
3822         * Configurations/FeatureDefines.xcconfig:
3823
3824 2016-10-24  Brady Eidson  <beidson@apple.com>
3825
3826         IndexedDB 2.0: Support IDBIndex name assignment.
3827         <rdar://problem/28806932> and https://bugs.webkit.org/show_bug.cgi?id=163805
3828
3829         Reviewed by Alex Christensen.
3830
3831         * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.cpp:
3832         (WebKit::WebIDBConnectionToClient::didRenameIndex):
3833         (WebKit::WebIDBConnectionToClient::renameIndex):
3834         * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.h:
3835         * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.messages.in:
3836
3837         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
3838         (WebKit::WebIDBConnectionToServer::renameIndex):
3839         (WebKit::WebIDBConnectionToServer::didRenameIndex):
3840         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h:
3841         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.messages.in:
3842
3843 2016-10-23  Michael Catanzaro  <mcatanzaro@igalia.com>
3844
3845         [GTK] Remove DO NOT MODIFY headers from files that are no longer autogenerated
3846         https://bugs.webkit.org/show_bug.cgi?id=163867
3847
3848         Reviewed by Darin Adler.
3849
3850         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMAttr.cpp:
3851         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMAttr.h:
3852         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMAttrPrivate.h:
3853         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMBlob.cpp:
3854         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMBlob.h:
3855         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMBlobPrivate.h:
3856         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCDATASection.cpp:
3857         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCDATASection.h:
3858         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCDATASectionPrivate.h:
3859         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSRule.h:
3860         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSRuleList.cpp:
3861         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSRuleList.h:
3862         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSRuleListPrivate.h:
3863         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSRulePrivate.h:
3864         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSStyleDeclaration.h:
3865         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSStyleDeclarationPrivate.h:
3866         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSStyleSheet.h:
3867         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSStyleSheetPrivate.h:
3868         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSValue.h:
3869         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSValuePrivate.h:
3870         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCharacterData.cpp:
3871         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCharacterData.h:
3872         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCharacterDataPrivate.h:
3873         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMComment.cpp:
3874         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMComment.h:
3875         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCommentPrivate.h:
3876         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMImplementation.h:
3877         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMImplementationPrivate.h:
3878         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMSelection.cpp:
3879         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMSelection.h:
3880         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMSelectionPrivate.h:
3881         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMTokenList.cpp:
3882         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMTokenList.h:
3883         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMTokenListPrivate.h:
3884         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMWindow.cpp:
3885         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMWindow.h:
3886         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMWindowPrivate.h:
3887         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMWindowUnstable.h:
3888         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocument.h:
3889         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentFragment.cpp:
3890         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentFragment.h:
3891         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentFragmentPrivate.h:
3892         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentFragmentUnstable.h:
3893         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentPrivate.h:
3894         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentType.cpp:
3895         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentType.h:
3896         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentTypePrivate.h:
3897         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentUnstable.h:
3898         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElement.cpp:
3899         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElement.h:
3900         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElementPrivate.h:
3901         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElementUnstable.h:
3902         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMEvent.cpp:
3903         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMEvent.h:
3904         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMEventPrivate.h:
3905         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMFile.cpp:
3906         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMFile.h:
3907         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMFileList.cpp:
3908         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMFileList.h:
3909         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMFileListPrivate.h:
3910         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMFilePrivate.h:
3911         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAnchorElement.cpp:
3912         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAnchorElement.h:
3913         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAnchorElementPrivate.h:
3914         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAppletElement.cpp:
3915         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAppletElement.h:
3916         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAppletElementPrivate.h:
3917         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAreaElement.cpp:
3918         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAreaElement.h:
3919         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAreaElementPrivate.h:
3920         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBRElement.cpp:
3921         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBRElement.h:
3922         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBRElementPrivate.h:
3923         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBaseElement.cpp:
3924         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBaseElement.h:
3925         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBaseElementPrivate.h:
3926         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBodyElement.cpp:
3927         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBodyElement.h:
3928         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBodyElementPrivate.h:
3929         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLButtonElement.cpp:
3930         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLButtonElement.h:
3931         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLButtonElementPrivate.h:
3932         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLCanvasElement.cpp:
3933         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLCanvasElement.h:
3934         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLCanvasElementPrivate.h:
3935         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLCollection.cpp:
3936         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLCollection.h:
3937         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLCollectionPrivate.h:
3938         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDListElement.cpp:
3939         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDListElement.h:
3940         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDListElementPrivate.h:
3941         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDirectoryElement.cpp:
3942         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDirectoryElement.h:
3943         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDirectoryElementPrivate.h:
3944         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDivElement.cpp:
3945         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDivElement.h:
3946         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDivElementPrivate.h:
3947         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDocument.cpp:
3948         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDocument.h:
3949         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDocumentPrivate.h:
3950         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLElement.cpp:
3951         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLElement.h:
3952         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLElementPrivate.h:
3953         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLElementUnstable.h:
3954         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLEmbedElement.cpp:
3955         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLEmbedElement.h:
3956         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLEmbedElementPrivate.h:
3957         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFieldSetElement.cpp:
3958         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFieldSetElement.h:
3959         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFieldSetElementPrivate.