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