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