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