[iOS] Play button on video is too dark
[WebKit-https.git] / Source / WebKit2 / ChangeLog
1 2016-04-07  Dean Jackson  <dino@apple.com>
2
3         [iOS] Play button on video is too dark
4         https://bugs.webkit.org/show_bug.cgi?id=156383
5         <rdar://problem/23540816>
6
7         Reviewed by Simon Fraser.
8
9         Elements that are backed by a layer with either LightBackdropAppearance
10         or DarkBackdropAppearance are actually a combination of a
11         few layers (inside a special view). If we apply a mask to one
12         of those layers, it needs to be attached to the correct
13         child layer.
14
15         * Shared/mac/RemoteLayerTreePropertyApplier.mm:
16         (WebKit::RemoteLayerTreePropertyApplier::applyProperties): If we have
17         one of the special appearance flags, apply the mask layer to
18         a particular child, rather than the layer itself.
19
20 2016-04-07  Jeremy Jones  <jeremyj@apple.com>
21
22         Clearing the application cache doesn't work.
23         https://bugs.webkit.org/show_bug.cgi?id=156354
24         rdar://problem/22369239
25
26         Reviewed by Brady Eidson.
27
28         Use the correct "ApplicationCache" directory.
29         Delete the caches, not just the entries.
30
31         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
32         (WebKit::WebsiteDataStore::fetchData):
33         (WebKit::WebsiteDataStore::removeData):
34
35 2016-04-07  Brian Burg  <bburg@apple.com>
36
37         Web Automation: implement Automation.addSingleCookie
38         https://bugs.webkit.org/show_bug.cgi?id=156319
39         <rdar://problem/25589605>
40
41         Reviewed by Timothy Hatcher.
42
43         Implement this command by converting the protocol cookie to
44         WebCore::Cookie, then sending the cookie to NetworkProcess to
45         be added to the storage session using CookieJar::addCookie.
46
47         * UIProcess/Automation/Automation.json:
48         Clarify the units used in the 'expires' field and how the default value
49         for the domain field should be computed.
50
51         * UIProcess/Automation/WebAutomationSession.cpp:
52         (WebKit::WebAutomationSession::addSingleCookie):
53         Parse the cookie and send it out via WebCookieManagerProxy.
54
55         * UIProcess/WebCookieManagerProxy.cpp:
56         (WebKit::WebCookieManagerProxy::addCookie): Added.
57         * UIProcess/WebCookieManagerProxy.h:
58         * WebProcess/Cookies/WebCookieManager.cpp:
59         (WebKit::WebCookieManager::addCookie):
60         * WebProcess/Cookies/WebCookieManager.h:
61         * WebProcess/Cookies/WebCookieManager.messages.in:
62         Forward the message to WebCore::addCookie.
63
64 2016-04-06  Ada Chan  <adachan@apple.com>
65
66         Add WebKitAdditions extension points around preferences
67         https://bugs.webkit.org/show_bug.cgi?id=156303
68
69         Reviewed by Beth Dakin.
70
71         * Shared/WebPreferencesStore.cpp:
72         (WebKit::defaults):
73         * UIProcess/API/C/WKPreferences.cpp:
74
75 2016-04-07  Brian Burg  <bburg@apple.com>
76
77         CookieJar should support adding synthetic cookies for developer tools
78         https://bugs.webkit.org/show_bug.cgi?id=156091
79         <rdar://problem/25581340>
80
81         Reviewed by Timothy Hatcher.
82
83         Plumb the new method through the strategy and out to the network process.
84
85         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
86         (WebKit::NetworkConnectionToWebProcess::addCookie):
87         * NetworkProcess/NetworkConnectionToWebProcess.h:
88         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
89         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
90         (WebKit::WebPlatformStrategies::addCookie):
91         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
92
93 2016-04-06  Alex Christensen  <achristensen@webkit.org>
94
95         Compile WebKitTestRunner with CMake on Mac
96         https://bugs.webkit.org/show_bug.cgi?id=156310
97
98         Reviewed by Daniel Bates.
99
100         * PlatformMac.cmake:
101
102 2016-04-05  Simon Fraser  <simon.fraser@apple.com>
103
104         Rename exposedRect to viewExposedRect and propagate it as Optional<> through WK2
105         https://bugs.webkit.org/show_bug.cgi?id=156274
106
107         Reviewed by Tim Horton.
108
109         DrawingArea and FrameView have an "exposedRect" property that is used by applications
110         on Mac, like Mail, that embed web views inside scroll views. However, this name is very
111         similar to the "exposedContentRect" that is used on iOS to denote the part of the view
112         whose pixels are visible, including through blurring overlaid UI.
113         
114         To disambiguate these two, rename the Mac "exposedRect" to "viewExposedRect" to
115         emphasize that it's a rect that takes into account clipping in the native view
116         hierarchy.
117         
118         Also make this rect Optional<> through the DrawingArea, removing comparisons against
119         FloatRect::infiniteRect().
120         
121         Do some other minor renaming in VisibleContentRectUpdateInfo.
122
123         * Shared/VisibleContentRectUpdateInfo.cpp: Rename "exposedRect" and "unobscuredRect" to
124         have "Content" in the names.
125         (WebKit::VisibleContentRectUpdateInfo::encode):
126         (WebKit::VisibleContentRectUpdateInfo::decode):
127         * Shared/VisibleContentRectUpdateInfo.h:
128         (WebKit::VisibleContentRectUpdateInfo::VisibleContentRectUpdateInfo):
129         (WebKit::VisibleContentRectUpdateInfo::exposedContentRect):
130         (WebKit::VisibleContentRectUpdateInfo::unobscuredContentRect):
131         (WebKit::operator==):
132         (WebKit::VisibleContentRectUpdateInfo::exposedRect): Deleted.
133         (WebKit::VisibleContentRectUpdateInfo::unobscuredRect): Deleted.
134         * UIProcess/Cocoa/WebViewImpl.mm:
135         (WebKit::WebViewImpl::updateViewExposedRect):
136         * UIProcess/DrawingAreaProxy.cpp:
137         (WebKit::DrawingAreaProxy::DrawingAreaProxy):
138         (WebKit::DrawingAreaProxy::setViewExposedRect):
139         (WebKit::DrawingAreaProxy::viewExposedRectChangedTimerFired):
140         (WebKit::DrawingAreaProxy::setExposedRect): Deleted.
141         (WebKit::DrawingAreaProxy::exposedRectChangedTimerFired): Deleted.
142         * UIProcess/DrawingAreaProxy.h:
143         (WebKit::DrawingAreaProxy::viewExposedRect):
144         (WebKit::DrawingAreaProxy::exposedRect): Deleted.
145         * UIProcess/WebPageProxy.h:
146         (WebKit::WebPageProxy::exposedContentRect):
147         (WebKit::WebPageProxy::unobscuredContentRect):
148         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h:
149         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
150         (WebKit::RemoteLayerTreeDrawingAreaProxy::setViewExposedRect):
151         (WebKit::RemoteLayerTreeDrawingAreaProxy::indicatorLocation):
152         (WebKit::RemoteLayerTreeDrawingAreaProxy::updateDebugIndicator):
153         (WebKit::RemoteLayerTreeDrawingAreaProxy::scaledExposedRect): Deleted.
154         (WebKit::RemoteLayerTreeDrawingAreaProxy::setExposedRect): Deleted. This was only used
155         to position the indicator, and confusingly used either exposedContentRect() or viewExposedRect()
156         depending on platform.
157         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
158         (WebKit::WebFrameLoaderClient::transitionToCommittedForNewPage):
159         * WebProcess/WebPage/DrawingArea.h:
160         * WebProcess/WebPage/DrawingArea.messages.in:
161         * WebProcess/WebPage/ios/WebPageIOS.mm:
162         (WebKit::WebPage::updateVisibleContentRects):
163         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
164         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
165         (WebKit::RemoteLayerTreeDrawingArea::setViewExposedRect):
166         (WebKit::RemoteLayerTreeDrawingArea::updateScrolledExposedRect):
167         (WebKit::RemoteLayerTreeDrawingArea::flushLayers):
168         (WebKit::RemoteLayerTreeDrawingArea::RemoteLayerTreeDrawingArea): Deleted.
169         (WebKit::RemoteLayerTreeDrawingArea::setExposedRect): Deleted.
170         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
171         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
172         (WebKit::TiledCoreAnimationDrawingArea::flushLayers):
173         (WebKit::TiledCoreAnimationDrawingArea::setViewExposedRect):
174         (WebKit::TiledCoreAnimationDrawingArea::updateScrolledExposedRect):
175         (WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea): Deleted.
176         (WebKit::TiledCoreAnimationDrawingArea::setExposedRect): Deleted.
177
178 2016-04-05  Alex Christensen  <achristensen@webkit.org>
179
180         Make CMake-generated binaries on Mac able to run
181         https://bugs.webkit.org/show_bug.cgi?id=156268
182
183         Reviewed by Daniel Bates.
184
185         * CMakeLists.txt:
186         * PlatformMac.cmake:
187
188 2016-04-05  Brian Burg  <bburg@apple.com>
189
190         Web Automation: add support for getting, deleting, and adding cookies
191         https://bugs.webkit.org/show_bug.cgi?id=156090
192         <rdar://problem/25477678>
193
194         Reviewed by Timothy Hatcher.
195
196         Add protocol commands for manipulating cookies with respect to a given page.
197         Implement all but the addSingleCookie command, which needs a new WebCore API.
198
199         * UIProcess/Automation/Automation.json:
200         Copy the Page domain Cookie object. Add new commands.
201
202         * UIProcess/Automation/WebAutomationSession.cpp:
203         (WebKit::WebAutomationSession::getAllCookies):
204         (WebKit::buildObjectForCookie): Copied from InspectorPageAgent.
205         (WebKit::buildArrayForCookies): Copied from InspectorPageAgent.
206         (WebKit::WebAutomationSession::didGetCookiesForFrame):
207         (WebKit::WebAutomationSession::deleteSingleCookie):
208         (WebKit::WebAutomationSession::didDeleteCookie):
209         (WebKit::WebAutomationSession::addSingleCookie): Added a stub for now.
210         (WebKit::WebAutomationSession::deleteAllCookies):
211         This command can use the WebCookieManager supplement directly instead of
212         proxying through AutomationSession. It doesn't block until the delete is
213         performed like the other methods do, but this shouldn't be a problem.
214
215         * UIProcess/Automation/WebAutomationSession.h:
216         * UIProcess/Automation/WebAutomationSession.messages.in:
217         * WebProcess/Automation/WebAutomationSessionProxy.cpp:
218         (WebKit::WebAutomationSessionProxy::getCookiesForFrame):
219         (WebKit::WebAutomationSessionProxy::deleteCookie):
220         * WebProcess/Automation/WebAutomationSessionProxy.h:
221         * WebProcess/Automation/WebAutomationSessionProxy.messages.in:
222
223 2016-04-05  Alex Christensen  <achristensen@webkit.org>
224
225         Fix Range requests when not using the NetworkCache with NetworkSession
226         https://bugs.webkit.org/show_bug.cgi?id=156036
227         rdar://problem/25334939
228  
229         Reviewed by Sam Weinig.
230
231         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
232         (-[WKNetworkSessionDelegate URLSession:dataTask:willCacheResponse:completionHandler:]):
233         Don't cache any responses with Content-Range headers to work around rdar://problem/20001985.
234         This is similar to the workaround in shouldCacheResponse in WebCoreNSURLSession.mm
235         (WebKit::NetworkSession::NetworkSession):
236         If we are using the NetworkCache, then don't use CFNetwork's cache.
237
238 2016-04-05  Brent Fulgham  <bfulgham@apple.com>
239
240         Correct applicationWillTerminate logic for ResourceLoadStatistics
241         https://bugs.webkit.org/show_bug.cgi?id=156249
242         <rdar://problem/25179611>
243
244         Reviewed by Andy Estes.
245
246         The applicationWillTerminate handling for ResourceLoadStatistics incorrectly
247         assumes that a ResourceLoadStatistics object will always be present.
248         1. The termination handling for 'dataStoresWithStorageManagers' should be
249            calling 'applicationWillTerminate' on any ResourceLoadStatistics
250            objects attached to the dataStore.
251         2. platformInitialize should null-check before attempting to dispatch.
252         3. platformDestroy should null check before attempting to dispatch.
253
254         * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
255         (WebKit::WebsiteDataStore::platformInitialize): 
256         (WebKit::WebsiteDataStore::platformDestroy): Invoke 'applicationWillTerminate' on
257         m_resourceLoadStatistics if present.
258
259 2016-04-05  Youenn Fablet  <youenn.fablet@crf.canon.fr>
260
261         [Fetch API] Add a runtime flag to fetch API and related constructs
262         https://bugs.webkit.org/show_bug.cgi?id=156113
263  
264         Reviewed by Alex Christensen.
265
266         Add a fetch API runtime flag based on preferences.
267         Disable fetch API by default.
268  
269         * Shared/WebPreferencesDefinitions.h:
270         * UIProcess/API/C/WKPreferences.cpp:
271         (WKPreferencesGetCustomElementsEnabled):
272         (WKPreferencesSetFetchAPIEnabled):
273         (WKPreferencesGetFetchAPIEnabled):
274         * UIProcess/API/C/WKPreferencesRefPrivate.h:
275         * WebProcess/InjectedBundle/InjectedBundle.cpp:
276         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
277         * WebProcess/WebPage/WebPage.cpp:
278         (WebKit::WebPage::updatePreferences):
279
280 2016-04-05  Brady Eidson  <beidson@apple.com>
281
282         Modern IDB: Replace use of SerializedScriptValue with IDBValue.
283         https://bugs.webkit.org/show_bug.cgi?id=156242
284
285         Reviewed by Alex Christensen.
286
287         * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.cpp:
288         (WebKit::WebIDBConnectionToClient::putOrAdd):
289         * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.h:
290         * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.messages.in:
291
292         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
293         (WebKit::WebIDBConnectionToServer::putOrAdd):
294         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h:
295
296 2016-04-05  Antoine Quint  <graouts@apple.com>
297
298         [WebGL2] Turn the ENABLE_WEBGL2 flag on
299         https://bugs.webkit.org/show_bug.cgi?id=156061
300         <rdar://problem/25463193>
301
302         Reviewed by Alex Christensen.
303
304         * Configurations/FeatureDefines.xcconfig:
305
306 2016-04-05  Chris Dumez  <cdumez@apple.com>
307
308         We sometimes fail to remove outdated entry from the disk cache after revalidation and when the resource is no longer cacheable
309         https://bugs.webkit.org/show_bug.cgi?id=156048
310         <rdar://problem/25514480>
311
312         Reviewed by Antti Koivisto.
313
314         We would sometimes fail to remove outdated entry from the disk cache
315         after revalidation and when the resource is no longer cacheable. This
316         was due to Storage::removeFromPendingWriteOperations() only removing
317         the first pending write operation with a given key instead of actually
318         removing all of the operations with this key.
319
320         * NetworkProcess/cache/NetworkCacheStorage.cpp:
321         (WebKit::NetworkCache::Storage::removeFromPendingWriteOperations):
322         * NetworkProcess/cache/NetworkCacheStorage.h:
323
324 2016-04-05  Antoine Quint  <graouts@apple.com>
325
326         [WebGL2] Allow enabling WebGL2 with a runtime flag
327         https://bugs.webkit.org/show_bug.cgi?id=156166
328         <rdar://problem/25526929>
329
330         Set the WebGL2 runtime flag based on preferences, disabled by default.
331
332         Reviewed by Dean Jackson.
333
334         * Shared/WebPreferencesDefinitions.h:
335         * UIProcess/API/C/WKPreferences.cpp:
336         (WKPreferencesSetWebGL2Enabled):
337         (WKPreferencesGetWebGL2Enabled):
338         * UIProcess/API/C/WKPreferencesRefPrivate.h:
339         * WebProcess/InjectedBundle/InjectedBundle.cpp:
340         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
341         * WebProcess/WebPage/WebPage.cpp:
342         (WebKit::WebPage::updatePreferences):
343
344 2016-04-04  Zan Dobersek  <zdobersek@igalia.com>
345
346         [ThreadedCompositor] Move CompositingRunLoop class into a separate file
347         https://bugs.webkit.org/show_bug.cgi?id=156170
348
349         Reviewed by Michael Catanzaro.
350
351         Move the CompositingRunLoop class from the ThreadedCompositor.cpp file
352         into its own implementation file, with the class declaration placed
353         into the accompanying header file. This follows the general rule of
354         keeping different class implementations in separate files.
355
356         No change in behavior, just refactoring.
357
358         * PlatformGTK.cmake:
359         * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.cpp: Added.
360         (WebKit::CompositingRunLoop::CompositingRunLoop):
361         (WebKit::CompositingRunLoop::callOnCompositingRunLoop):
362         (WebKit::CompositingRunLoop::setUpdateTimer):
363         (WebKit::CompositingRunLoop::stopUpdateTimer):
364         (WebKit::CompositingRunLoop::updateTimerFired):
365         * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.h: Added.
366         (WebKit::CompositingRunLoop::runLoop):
367         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
368         (WebKit::CompositingRunLoop::CompositingRunLoop): Deleted.
369         (WebKit::CompositingRunLoop::callOnCompositingRunLoop): Deleted.
370         (WebKit::CompositingRunLoop::setUpdateTimer): Deleted.
371         (WebKit::CompositingRunLoop::stopUpdateTimer): Deleted.
372         (WebKit::CompositingRunLoop::runLoop): Deleted.
373         (WebKit::CompositingRunLoop::updateTimerFired): Deleted.
374         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:
375
376 2016-04-04  Brady Eidson  <beidson@apple.com>
377
378         Modern IDB: Dump blobs to disk before storing them in an object store.
379         https://bugs.webkit.org/show_bug.cgi?id=156068
380
381         Reviewed by Alex Christensen.
382
383         * NetworkProcess/FileAPI/NetworkBlobRegistry.cpp:
384         (WebKit::NetworkBlobRegistry::writeBlobsToTemporaryFiles):
385         * NetworkProcess/FileAPI/NetworkBlobRegistry.h:
386
387         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
388         (WebKit::NetworkConnectionToWebProcess::writeBlobsToTemporaryFiles):
389         * NetworkProcess/NetworkConnectionToWebProcess.h:
390         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
391
392         * WebProcess/FileAPI/BlobRegistryProxy.cpp:
393         (WebKit::BlobRegistryProxy::writeBlobsToTemporaryFiles):
394         * WebProcess/FileAPI/BlobRegistryProxy.h:
395
396         * WebProcess/Network/NetworkProcessConnection.cpp:
397         (WebKit::NetworkProcessConnection::didClose):
398         (WebKit::NetworkProcessConnection::writeBlobsToTemporaryFiles):
399         (WebKit::NetworkProcessConnection::didWriteBlobsToTemporaryFiles):
400         * WebProcess/Network/NetworkProcessConnection.h:
401         * WebProcess/Network/NetworkProcessConnection.messages.in:
402
403 2016-04-04  Chelsea Pugh  <cpugh@apple.com>
404
405         [iOS] Allow clients in the bundle to know whether a field was focused by user interaction        
406         https://bugs.webkit.org/show_bug.cgi?id=156118
407
408         Reviewed by Dan Bernstein.
409
410         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFormDelegatePrivate.h: Add delegate method that takes userIsInteracting bool so that bundle clients get this information.
411         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm: Call API with userIsInteracting property if delegate implements it, otherwise call existing API if
412         userIsInteracting is true, as we previously did in WebKit::WebPage::elementDidFocus. Move FIXME from WebKit::WebPage::elementDidFocus to here, since we are checking userIsInteracting.
413         * WebProcess/InjectedBundle/APIInjectedBundleFormClient.h:
414         (API::InjectedBundle::FormClient::willBeginInputSession): Add userIsInteracting bool to arguments so we can use it for call to the new API as well as preserving behavior of the old API.
415         * WebProcess/WebPage/ios/WebPageIOS.mm:
416         (WebKit::WebPage::elementDidFocus): Remove check if user is interacting and call willBeginInputSession unconditionally. Move FIXME to where we check
417         userIsInteracting. Pass m_userIsInteracting to willBeginInputSession so we can use it there.
418
419 2016-04-04  Michael Catanzaro  <mcatanzaro@igalia.com>
420
421         Unreviewed GTK build fix after r199020
422
423         * UIProcess/API/gtk/WebKitUserContentManager.cpp:
424         (webkit_user_content_manager_register_script_message_handler):
425         (webkit_user_content_manager_unregister_script_message_handler):
426
427 2016-04-04  Alex Christensen  <achristensen@webkit.org>
428
429         CMake build fix.
430
431         * PlatformMac.cmake:
432
433 2016-04-04  Jiewen Tan  <jiewen_tan@apple.com>
434
435         Tapping on tabs in webpages caused WK crash at WebKit: WebKit::WebFrame::didReceivePolicyDecision
436         https://bugs.webkit.org/show_bug.cgi?id=156119
437         <rdar://problem/20732167>
438
439         Reviewed by Andy Estes.
440
441         Protect the m_frame so that it is present for completion handlers.
442
443         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
444         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):
445         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
446
447 2016-04-04  Beth Dakin  <bdakin@apple.com>
448
449         Add some logic to decide when a video can control the videoControlsManager
450         https://bugs.webkit.org/show_bug.cgi?id=156089
451         -and corresponding-
452         rdar://problem/23833752
453
454         Reviewed by Eric Carlson and Tim Horton.
455
456         The biggest change in WebKit2 is to push all of the logic for the 
457         videoControlsManager into WebCore. With this change, WebCore will invoke 
458         setUpVideoControlsManager() when there is a video to control the manager, and 
459         it will call clearVideoControlsManager() when there is not.
460
461         Add clearVideoControlsManager().
462         * UIProcess/Cocoa/WebVideoFullscreenManagerProxy.h:
463         * UIProcess/Cocoa/WebVideoFullscreenManagerProxy.messages.in:
464         * UIProcess/Cocoa/WebVideoFullscreenManagerProxy.mm:
465         (WebKit::WebVideoFullscreenManagerProxy::clearVideoControlsManager):
466
467         Re-name isPlayingMediaDidChange() to videoControlsManagerDidChange(). This 
468         ties the logic to the lifetime of the videoControlsManager instead of 
469         figuring it out in the UIProcess based on the media state.
470         * UIProcess/Cocoa/WebViewImpl.h:
471         * UIProcess/Cocoa/WebViewImpl.mm:
472         (WebKit::WebViewImpl::videoControlsManagerDidChange):
473         (WebKit::WebViewImpl::isPlayingMediaDidChange): Deleted.
474         * UIProcess/PageClient.h:
475
476         Also change isPlayingVideoWithAudio() into hasActiveVideoForControlsManager() 
477         Again, this ties the logic to the lifetime of the videoControlsManager 
478         instead of figuring it out in the UIProcess based on the media state.
479         * UIProcess/WebPageProxy.cpp:
480         (WebKit::WebPageProxy::isPlayingMediaDidChange):
481         (WebKit::WebPageProxy::videoControlsManagerDidChange):
482         (WebKit::WebPageProxy::hasActiveVideoForControlsManager):
483         (WebKit::WebPageProxy::isPlayingVideoWithAudio): Deleted.
484         * UIProcess/WebPageProxy.h:
485         * UIProcess/mac/PageClientImpl.h:
486         * UIProcess/mac/PageClientImpl.mm:
487         (WebKit::PageClientImpl::videoControlsManagerDidChange):
488         (WebKit::PageClientImpl::isPlayingMediaDidChange): Deleted.
489
490         New WebChromeClient function clearVideoControlsManager().
491         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
492         (WebKit::WebChromeClient::clearVideoControlsManager):
493         * WebProcess/WebCoreSupport/WebChromeClient.h:
494
495         Do the work to clear the videoControlsManager.
496         * WebProcess/cocoa/WebVideoFullscreenManager.h:
497         * WebProcess/cocoa/WebVideoFullscreenManager.mm:
498         (WebKit::WebVideoFullscreenManager::clearVideoControlsManager):
499         (WebKit::WebVideoFullscreenManager::exitVideoFullscreenToModeWithoutAnimation):
500
501 2016-04-04  Brent Fulgham  <bfulgham@apple.com>
502
503         REGRESSION(r198955): com.apple.WebKit.Networking.Development crashed in WebKit::NetworkLoad::setPendingDownloadID + 11
504         https://bugs.webkit.org/show_bug.cgi?id=156177
505         <rdar://problem/25508037>
506
507         Reviewed by Alex Christensen.
508
509         We do not currently create a NetworkDataTask when we encounter a BLOB URL when building with
510         NETWORK_SESSION enabled. This causes us to crash when the download system attempts to work
511         with a BLOB URL.
512
513         * NetworkProcess/NetworkLoad.cpp:
514         (WebKit::NetworkLoad::setPendingDownloadID): Add null check for m_task.
515         (WebKit::NetworkLoad::setPendingDownload): Ditto.
516
517 2016-04-03  Sam Weinig  <sam@webkit.org>
518
519         Add SPI to allow install script message handlers in isolated worlds
520         https://bugs.webkit.org/show_bug.cgi?id=156153
521
522         Reviewed by Anders Carlsson.
523
524         * Scripts/webkit/messages.py:
525         (headers_for_type):
526         * Shared/WebUserContentControllerDataTypes.cpp:
527         (WebKit::WebScriptMessageHandlerData::encode):
528         (WebKit::WebScriptMessageHandlerData::decode):
529         * Shared/WebUserContentControllerDataTypes.h:
530         Add WebKit::WebScriptMessageHandlerData, matching WebKit::WebUserScriptData and
531         WebKit::WebUserStyleSheetData.
532
533         * UIProcess/API/Cocoa/WKUserContentController.mm:
534         (-[WKUserContentController addScriptMessageHandler:name:]):
535         (-[WKUserContentController removeScriptMessageHandlerForName:]):
536         (-[WKUserContentController _removeAllUserStyleSheetsAssociatedWithUserContentWorld:]):
537         (-[WKUserContentController _addScriptMessageHandler:name:userContentWorld:]):
538         (-[WKUserContentController _removeScriptMessageHandlerForName:userContentWorld:]):
539         (-[WKUserContentController _removeAllScriptMessageHandlersAssociatedWithUserContentWorld:]):
540         * UIProcess/API/Cocoa/WKUserContentControllerPrivate.h:
541         Add SPI for adding and removing ScriptMessageHandlers associated with a world.
542
543         * UIProcess/UserContent/WebScriptMessageHandler.cpp:
544         (WebKit::WebScriptMessageHandler::create):
545         (WebKit::WebScriptMessageHandler::WebScriptMessageHandler):
546         (WebKit::WebScriptMessageHandlerHandle::encode): Deleted.
547         (WebKit::WebScriptMessageHandlerHandle::decode): Deleted.
548         * UIProcess/UserContent/WebScriptMessageHandler.h:
549         (WebKit::WebScriptMessageHandler::identifier):
550         (WebKit::WebScriptMessageHandler::name):
551         (WebKit::WebScriptMessageHandler::userContentWorld):
552         (WebKit::WebScriptMessageHandler::client):
553         (WebKit::WebScriptMessageHandler::handle): Deleted.
554         Add the world and move the data object to WebUserContentControllerDataTypes.h
555
556         * UIProcess/UserContent/WebUserContentControllerProxy.cpp:
557         (WebKit::WebUserContentControllerProxy::addProcess):
558         (WebKit::WebUserContentControllerProxy::addUserScriptMessageHandler):
559         (WebKit::WebUserContentControllerProxy::removeUserMessageHandlerForName):
560         (WebKit::WebUserContentControllerProxy::removeAllUserMessageHandlers):
561         * UIProcess/UserContent/WebUserContentControllerProxy.h:
562         Update for worlds, matching UserScript/UserStyleSheet model.
563
564         * WebProcess/UserContent/WebUserContentController.h:
565         * WebProcess/UserContent/WebUserContentController.cpp:
566         (WebKit::WebUserMessageHandlerDescriptorProxy::WebUserMessageHandlerDescriptorProxy):
567         Change to inherit directly from WebCore::UserMessageHandlerDescriptor.
568
569         (WebKit::WebUserContentController::addUserScriptMessageHandlers):
570         (WebKit::WebUserContentController::removeUserScriptMessageHandler):
571         (WebKit::WebUserContentController::removeAllUserScriptMessageHandlers):
572         (WebKit::WebUserContentController::addUserScriptMessageHandlerInternal):
573         (WebKit::WebUserContentController::removeUserScriptMessageHandlerInternal):
574         Add support for worlds, matching UserScript/UserStyleSheet model.
575
576         (WebKit::WebUserContentController::addUserStyleSheets):
577         Add missing call to invalidateInjectedStyleSheetCacheInAllFramesInAllPages()
578
579         (WebKit::WebUserContentController::removeAllUserStyleSheets):
580         Switch to only calling invalidateInjectedStyleSheetCacheInAllFramesInAllPages() once
581         after the loop and only if any stylesheets were removed.
582         
583         (WebKit::WebUserContentController::addUserStyleSheetInternal):
584         Remove call to invalidateInjectedStyleSheetCacheInAllFramesInAllPages(), make
585         callers call it. This allows us to avoid calling it repeatedly in removeAllUserStyleSheets().
586
587         (WebKit::WebUserContentController::addUserStyleSheet):
588         Call invalidateInjectedStyleSheetCacheInAllFramesInAllPages() explicitly since it
589         is no longer called in addUserStyleSheetInternal().
590
591         (WebKit::WebUserContentController::forEachUserMessageHandler):
592         Implement by iterating the m_userMessageHandlers map.
593
594         * WebProcess/UserContent/WebUserContentController.messages.in:
595         Update for worlds, matching UserScript/UserStyleSheet model.
596
597 2016-04-04  Joonghun Park  <jh718.park@samsung.com>
598
599         [EFL] Fix build break since r198800
600         https://bugs.webkit.org/show_bug.cgi?id=156011
601
602         Reviewed by Alex Christensen.
603
604         * CMakeLists.txt: Currently circular dependency state exists between WebCoreDerivedSources and WebCore targets.
605         By adding -Wl,--start-group -Wl,--end-group linker option, we can resolve this problem.
606         In case there is no such circular dependency, this linker option does nothing.
607
608 2016-04-04  Konstantin Tokarev  <annulen@yandex.ru>
609
610         [GTK] Added missing inspector files under UserInterface/Proxies.
611         https://bugs.webkit.org/show_bug.cgi?id=156165
612
613         Reviewed by Michael Catanzaro.
614
615         * PlatformGTK.cmake:
616
617 2016-04-04  Carlos Garcia Campos  <cgarcia@igalia.com>
618
619         REGRESSION(r198792): [GTK] Inspector crashes in Inspector::Protocol::getEnumConstantValue since r198792
620         https://bugs.webkit.org/show_bug.cgi?id=155745
621         <rdar://problem/25289456>
622
623         Reviewed by Brian Burg.
624
625         Use Inspector::Protocol::AutomationEnums namespace for getEnumConstantValue().
626
627         * UIProcess/Automation/WebAutomationSession.cpp:
628         * WebProcess/Automation/WebAutomationSessionProxy.cpp:
629         (WebKit::WebAutomationSessionProxy::didClearWindowObjectForFrame):
630         (WebKit::WebAutomationSessionProxy::evaluateJavaScriptFunction):
631         (WebKit::WebAutomationSessionProxy::resolveChildFrameWithOrdinal):
632         (WebKit::WebAutomationSessionProxy::resolveChildFrameWithNodeHandle):
633         (WebKit::WebAutomationSessionProxy::resolveChildFrameWithName):
634         (WebKit::WebAutomationSessionProxy::resolveParentFrame):
635         (WebKit::WebAutomationSessionProxy::computeElementLayout):
636
637 2016-04-04  Emanuele Aina  <emanuele.aina@collabora.com>
638
639         Fix WEB_PROCESS_CMD_PREFIX and NETWORK_PROCESS_CMD_PREFIX after r196500
640         https://bugs.webkit.org/show_bug.cgi?id=156060
641
642         Reviewed by Darin Adler.
643
644         Commit r196500 was a bit too eager in removing the
645         platformGetLaunchOptions() callsites as non-mac platform still use
646         that in debug builds to attach debugging tools to spawned
647         subprocesses (eg. gdbserver).
648
649         Instead of reinstating them and relying on each subprocess type to
650         implement its own platformGetLaunchOptions() version (all alike),
651         avoid duplication and check the *_PROCESS_CMD_PREFIX environment
652         variables in a single place, ChildProcessProxy::getLaunchOptions().
653
654         Doing so also improves consistency in *_PROCESS_CMD_PREFIX support:
655         only WEB_PROCESS_CMD_PREFIX and NETWORK_PROCESS_CMD_PREFIX worked with
656         both the GTK and EFL ports while PLUGIN_PROCESS_CMD_PREFIX only
657         worked for EFL and there was no corresponding
658         DATABASE_PROCESS_CMD_PREFIX implementation.
659
660         * UIProcess/ChildProcessProxy.cpp:
661         (WebKit::ChildProcessProxy::getLaunchOptions): Check the
662         appropriate *_PROCESS_CMD_PREFIX environment variable.
663         * UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp:
664         (WebKit::PluginProcessProxy::platformGetLaunchOptions): Drop
665         check for PLUGIN_PROCESS_COMMAND_PREFIX, now handled by
666         ChildProcessProxy::getLaunchOptions().
667         * UIProcess/Databases/DatabaseProcessProxy.h:
668         * UIProcess/Network/NetworkProcessProxy.h:
669         * UIProcess/WebProcessProxy.h: Drop platformGetLaunchOptions()
670         prototypes.
671         * UIProcess/Network/soup/NetworkProcessProxySoup.cpp:
672         * UIProcess/Databases/efl/DatabaseProcessProxyEfl.cpp:
673         * UIProcess/Databases/gtk/DatabaseProcessProxyGtk.cpp:
674         * UIProcess/efl/WebProcessProxyEfl.cpp:
675         * UIProcess/gtk/WebProcessProxyGtk.cpp: Removed, they only contained
676         platformGetLaunchOptions() implementations.
677         * PlatformEfl.cmake:
678         * PlatformGTK.cmake: Drop removed files.
679
680 2016-04-02  Daniel Bates  <dabates@apple.com>
681
682         REGRESSION (r198933): Web Inspector and inspected page hang in local builds
683         https://bugs.webkit.org/show_bug.cgi?id=156138
684         <rdar://problem/25507724>
685
686         Reviewed by Alexey Proskuryakov.
687
688         Similar to the sandbox policy for WebProcess and NetworkProcess, grant a Database process
689         read-only filesystem access and mach lookup capability to various Security framework files
690         and SecurityServer, respectively.
691
692         * DatabaseProcess/mac/com.apple.WebKit.Databases.sb.in:
693
694 2016-04-02  Daniel Bates  <dabates@apple.com>
695
696         Another attempt to fix the Apple Internal Yosemite and El Capitan builds following
697         <http://trac.webkit.org/changeset/198933> (https://bugs.webkit.org/show_bug.cgi?id=155455)
698
699         Similar to the sandbox policy for WebProcess and NetworkProcess, grant a Database process
700         access to the passed user's cache directory and passed user's temporary directory so that
701         the Security framework can verify the code signature of the app that launched it when the
702         Database process is itself code signed.
703
704         * DatabaseProcess/mac/com.apple.WebKit.Databases.sb.in:
705
706 2016-04-01  Daniel Bates  <dabates@apple.com>
707
708         Attempt to fix the Apple Internal Yosemite and El Capitan builds following
709         <http://trac.webkit.org/changeset/198933> (https://bugs.webkit.org/show_bug.cgi?id=155455)
710         <rdar://problem/25502181>
711
712         Only check the code signature of the client app if the "user-directory-suffix" sandbox
713         initialization parameter will not be used. This parameter is only used/passed as an
714         initialization parameter if the client app is not sandboxed, which seems sufficient
715         criterion to determine whether it is safe to honor it.
716
717         * Shared/mac/ChildProcessMac.mm:
718         (WebKit::ChildProcess::initializeSandbox):
719
720 2016-04-01  Jiewen Tan  <jiewen_tan@apple.com>
721
722         WebKit should dispatchDidFailProvisionalLoad while loading invalid URLs
723         https://bugs.webkit.org/show_bug.cgi?id=155995
724         <rdar://problem/14967004>
725
726         Reviewed by Andy Estes.
727
728         Ensure that alternative HTML string will not be loaded back to back for
729         failing provisional loads.
730
731         * UIProcess/WebPageProxy.cpp:
732         (WebKit::WebPageProxy::loadAlternateHTMLString):
733         (WebKit::WebPageProxy::didFinishLoadForFrame):
734         * UIProcess/WebPageProxy.h:
735
736 2016-04-01  Brent Fulgham  <bfulgham@apple.com>
737
738         Confirm <a download> satisfies specification criteria
739         https://bugs.webkit.org/show_bug.cgi?id=156057
740
741         Reviewed by Andy Estes.
742
743         * WebProcess/InjectedBundle/API/c/WKBundleNavigationAction.cpp:
744         (WKBundleNavigationActionGetHasDownloadAttribute): Added.
745         * WebProcess/InjectedBundle/API/c/WKBundleNavigationActionPrivate.h:
746         * WebProcess/InjectedBundle/InjectedBundleNavigationAction.cpp:
747         (WebKit::InjectedBundleNavigationAction::InjectedBundleNavigationAction):
748         * WebProcess/InjectedBundle/InjectedBundleNavigationAction.h:
749         (WebKit::InjectedBundleNavigationAction::hasDownloadAttribute): Added.
750
751 2016-04-01  Alex Christensen  <achristensen@webkit.org>
752
753         CMake build fix.
754
755         * PlatformMac.cmake:
756
757 2016-04-01  Alex Christensen  <achristensen@webkit.org>
758
759         Compile DumpRenderTree with CMake on Mac
760         https://bugs.webkit.org/show_bug.cgi?id=156088
761
762         Reviewed by Brent Fulgham.
763
764         * CMakeLists.txt:
765         * PlatformMac.cmake:
766         * UIProcess/API/Cocoa/WebKitLegacy.h: Added.
767
768 2016-03-31  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
769
770         Unreviewed EFL build fix caused by r198929.
771
772         * WebProcess/WebPage/WebPage.cpp:
773         (WebKit::WebPage::layerVolatilityTimerFired): Need to use type casting in WEBPAGE_LOG_ALWAYS_ERROR() log.
774
775 2016-03-31  Daniel Bates  <dabates@apple.com>
776
777         REGRESSION (r194660): Navigating to HTTPS sites may fail with error
778         https://bugs.webkit.org/show_bug.cgi?id=155455
779         <rdar://problem/24308793>
780
781         Reviewed by Alexey Proskuryakov.
782
783         Fixes an issue where navigating to an HTTPS site may fail because the Security Framework uses
784         a cache directory that it does not have permission to use.
785
786         * Shared/mac/ChildProcessMac.mm:
787         (WebKit::codeSigningIdentifierForProcess): Queries the Security Framework for the code signed
788         bundle identifier/code signing identifier.
789         (WebKit::ChildProcess::initializeSandbox): Use the client identifier as part of the user directory
790         suffix. Verify that the client identifier matches the code signed bundled identifier/code
791         signing identifier for the code signed app/tool. Fix minor code style issue; use a C++-style cast
792         instead of a C-style cast when casting an OSStatus to a long.
793         (WebKit::findSecCodeForProcess): Deleted; incorporated logic into WebKit::codeSigningIdentifierForProcess().
794
795 2016-03-31  Saam barati  <sbarati@apple.com>
796
797         Revert rewrite const as var workaround
798         https://bugs.webkit.org/show_bug.cgi?id=155393
799
800         Reviewed by Mark Lam.
801
802         * Shared/WebProcessCreationParameters.cpp:
803         (WebKit::WebProcessCreationParameters::encode):
804         (WebKit::WebProcessCreationParameters::decode):
805         * Shared/WebProcessCreationParameters.h:
806         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
807         (WebKit::WebProcessPool::platformInitializeWebProcess):
808         * WebProcess/WebProcess.cpp:
809         (WebKit::WebProcess::initializeWebProcess):
810
811 2016-03-31  Chris Dumez  <cdumez@apple.com>
812
813         [iOS] Both WebPage's volatility timer and WebProcess's processSuspensionCleanupTimer are trying to make surfaces volatile with very short interval
814         https://bugs.webkit.org/show_bug.cgi?id=156065
815         <rdar://problem/25452004>
816
817         Reviewed by Simon Fraser.
818
819         Upon process suspension, both the WebPage's volatility timer and
820         WebProcess' processSuspensionCleanupTimer are trying to make surfaces
821         volatile with a very short interval. This is overly aggressive given
822         that this operation normally succeeds very quickly or does not (due
823         to underlying bugs).
824
825         This patch does the following:
826         - Drop the WebProcess' processSuspensionCleanupTimer and have the
827           WebProcess drive the WebPages' volatility timer instead.
828         - Update the WebPages' volatility timer to do exponential back off.
829
830         * WebProcess/WebPage/WebPage.cpp:
831         (WebKit::WebPage::layerVolatilityTimerFired):
832         (WebKit::WebPage::markLayersVolatileImmediatelyIfPossible):
833         (WebKit::WebPage::markLayersVolatile):
834         (WebKit::WebPage::cancelMarkLayersVolatile):
835         (WebKit::WebPage::isAlwaysOnLoggingAllowed):
836         (WebKit::WebPage::setLayerTreeStateIsFrozen): Deleted.
837         * WebProcess/WebPage/WebPage.h:
838         (WebKit::WebPage::markLayersVolatile):
839         * WebProcess/WebPage/ios/WebPageIOS.mm:
840         (WebKit::WebPage::applicationDidEnterBackground):
841         (WebKit::WebPage::applicationWillEnterForeground):
842         (WebKit::WebPage::applicationDidBecomeActive): Deleted.
843         (WebKit::adjustVelocityDataForBoundedScale): Deleted.
844         * WebProcess/WebProcess.cpp:
845         (WebKit::WebProcess::actualPrepareToSuspend):
846         (WebKit::WebProcess::processWillSuspendImminently):
847         (WebKit::WebProcess::prepareToSuspend):
848         (WebKit::WebProcess::cancelPrepareToSuspend):
849         (WebKit::WebProcess::markAllLayersVolatile):
850         (WebKit::WebProcess::cancelMarkAllLayersVolatile):
851         (WebKit::WebProcess::setAllLayerTreeStatesFrozen):
852         (WebKit::WebProcess::processDidResume):
853         (WebKit::WebProcess::WebProcess): Deleted.
854         * WebProcess/WebProcess.h:
855
856 2016-03-31  Brian Burg  <bburg@apple.com>
857
858         Web Automation: the interaction queue in WebAutomationSession::performKeyInteractions doesn't work
859         https://bugs.webkit.org/show_bug.cgi?id=156083
860
861         Reviewed by Timothy Hatcher.
862
863         * UIProcess/Automation/WebAutomationSession.cpp:
864         (WebKit::WebAutomationSession::performKeyboardInteractions):
865         Use Vector::reserveCapacity instead of the size constructor since we use append.
866         Empty the interaction queue outside of loops so all interactions are performed once.
867
868 2016-03-31  Timothy Hatcher  <timothy@apple.com>
869
870         Web Automation: Add support for script timeouts to the evaluateJavaScriptFunction command
871
872         https://bugs.webkit.org/show_bug.cgi?id=156052
873         rdar://problem/25457151
874
875         Address additional review comments.
876
877         * WebProcess/Automation/WebAutomationSessionProxy.js:
878         (AutomationSessionProxy.prototype.evaluateJavaScriptFunction): Add semicolons and remove
879         and clearTimeout that wasn't needed.
880
881 2016-03-31  Timothy Hatcher  <timothy@apple.com>
882
883         Web Automation: Navigation commands should not return until page loads or fails
884
885         https://bugs.webkit.org/show_bug.cgi?id=156063
886         rdar://problem/25464373
887
888         Reviewed by Brian Burg.
889
890         * UIProcess/Automation/Automation.json: Make navigation commands async.
891         * UIProcess/Automation/WebAutomationSession.cpp:
892         (WebKit::WebAutomationSession::navigateBrowsingContext): Save callback and timeout previous.
893         (WebKit::WebAutomationSession::goBackInBrowsingContext): Ditto.
894         (WebKit::WebAutomationSession::goForwardInBrowsingContext): Ditto.
895         (WebKit::WebAutomationSession::reloadBrowsingContext): Ditto.
896         (WebKit::WebAutomationSession::navigationOccuredForPage): Added. Fire callback for page.
897         * UIProcess/Automation/WebAutomationSession.h:
898
899         * UIProcess/WebPageProxy.cpp:
900         (WebKit::WebPageProxy::didFinishLoadForFrame): Call WebAutomationSession::navigationOccuredForPage.
901         (WebKit::WebPageProxy::didFailLoadForFrame): Ditto.
902         (WebKit::WebPageProxy::didSameDocumentNavigationForFrame): Ditto.
903
904         * UIProcess/WebProcessPool.h: Added automationSession() getter.
905
906 2016-03-30  Timothy Hatcher  <timothy@apple.com>
907
908         Web Automation: Add support for script timeouts to the evaluateJavaScriptFunction command
909
910         https://bugs.webkit.org/show_bug.cgi?id=156052
911         rdar://problem/25457151
912
913         Reviewed by Brian Burg.
914
915         * UIProcess/Automation/Automation.json: Added callbackTimeout to evaluateJavaScriptFunction.
916         Also made expectsImplicitCallbackArgument optional, since it is not required. Added JavaScriptTimeout error.
917         * UIProcess/Automation/WebAutomationSession.cpp:
918         (WebKit::WebAutomationSession::evaluateJavaScriptFunction): Added callbackTimeout.
919         * UIProcess/Automation/WebAutomationSession.h:
920         * WebProcess/Automation/WebAutomationSessionProxy.cpp:
921         (WebKit::evaluateJavaScriptCallback): Send JavaScriptTimeout error if the timeout fired.
922         (WebKit::WebAutomationSessionProxy::evaluateJavaScriptFunction): Added callbackTimeout.
923         * WebProcess/Automation/WebAutomationSessionProxy.h:
924         * WebProcess/Automation/WebAutomationSessionProxy.js:
925         (AutomationSessionProxy.prototype.evaluateJavaScriptFunction): Set a timeout to fire if the
926         callback is not called, then return an error.
927         * WebProcess/Automation/WebAutomationSessionProxy.messages.in:
928         (EvaluateJavaScriptFunction): Added callbackTimeout parameter.
929
930 2016-03-31  Jiewen Tan  <jiewen_tan@apple.com>
931
932         WebKit should set Original URL of a download request correctly
933         https://bugs.webkit.org/show_bug.cgi?id=155914
934         <rdar://problem/10473811>
935
936         Reviewed by Anders Carlsson.
937
938         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
939         (WebKit::NetworkConnectionToWebProcess::convertMainResourceLoadToDownload):
940         * NetworkProcess/NetworkLoad.cpp:
941         (WebKit::NetworkLoad::convertTaskToDownload):
942         (WebKit::NetworkLoad::didReceiveResponseNetworkSession):
943         * NetworkProcess/NetworkLoad.h:
944         * NetworkProcess/NetworkProcess.cpp:
945         (WebKit::NetworkProcess::findPendingDownloadLocation):
946         * NetworkProcess/NetworkProcess.h:
947         Add logic to set the original URL of a download request when a main resource load
948         is converted to a download.
949         * UIProcess/WebProcessPool.cpp:
950         (WebKit::WebProcessPool::download):
951         * UIProcess/WebProcessPool.h:
952         Add logic to set the original URL of a download request during a context menu:
953         Download Linked File action.
954
955 2016-03-31  Joseph Pecoraro  <pecoraro@apple.com>
956
957         Web Automation: Add Automation.screenshot
958         https://bugs.webkit.org/show_bug.cgi?id=156073
959         <rdar://problem/25468646>
960
961         Reviewed by Timothy Hatcher and Brian Burg.
962
963         * UIProcess/Automation/Automation.json:
964         Add Automation.screenshot which returns base64 encoded PNG data.
965
966         * WebProcess/Automation/WebAutomationSessionProxy.h:
967         * WebProcess/Automation/WebAutomationSessionProxy.messages.in:
968         * UIProcess/Automation/WebAutomationSession.cpp:
969         (WebKit::WebAutomationSession::screenshot):
970         (WebKit::WebAutomationSession::didTakeScreenshot):
971         (WebKit::WebAutomationSession::platformGetBase64EncodedPNGData):
972         Send a message to the WebPage to get an Image of the page
973         and handle the response.
974
975         * UIProcess/Cocoa/WebAutomationSessionCocoa.mm:
976         (WebKit::WebAutomationSession::platformGetBase64EncodedPNGData):
977         Convert the bitmap data to a base64 encoded PNG.
978
979         * UIProcess/Automation/WebAutomationSession.h:
980         * UIProcess/Automation/WebAutomationSession.messages.in:
981         * WebProcess/Automation/WebAutomationSessionProxy.cpp:
982         (WebKit::evaluateJavaScriptCallback):
983         (WebKit::WebAutomationSessionProxy::didClearWindowObjectForFrame):
984         (WebKit::WebAutomationSessionProxy::resolveChildFrameWithOrdinal):
985         (WebKit::WebAutomationSessionProxy::resolveChildFrameWithNodeHandle):
986         (WebKit::WebAutomationSessionProxy::resolveChildFrameWithName):
987         (WebKit::WebAutomationSessionProxy::resolveParentFrame):
988         (WebKit::WebAutomationSessionProxy::computeElementLayout):
989         Use null string where possible for efficiency.
990
991         (WebKit::WebAutomationSessionProxy::takeScreenshot):
992         Take an image of the entire page and pass back to the UIProcess.
993
994 2016-03-31  Timothy Hatcher  <timothy@apple.com>
995
996         Web Automation: Handle undefined when calling a function that has no result
997
998         https://bugs.webkit.org/show_bug.cgi?id=156075
999         rdar://problem/25468907
1000
1001         Reviewed by Brian Burg.
1002
1003         * WebProcess/Automation/WebAutomationSessionProxy.js:
1004         (let.AutomationSessionProxy.prototype._jsonParse): Return undefined for empty string.
1005         (let.AutomationSessionProxy.prototype._jsonStringify): Always return a string.
1006
1007 2016-03-31  Jeremy Jones  <jeremyj@apple.com>
1008
1009         mediaShouldUsePersistentCache() is redundant. Use Page::usesEphemeralSession() instead.
1010         https://bugs.webkit.org/show_bug.cgi?id=155924
1011
1012         Reviewed by Simon Fraser.
1013
1014         Remove machinery for mediaShouldUsePersistentCache as it is redundant.
1015
1016         * Shared/WebPageCreationParameters.cpp:
1017         (WebKit::WebPageCreationParameters::encode): Deleted.
1018         (WebKit::WebPageCreationParameters::decode): Deleted.
1019         * Shared/WebPageCreationParameters.h:
1020         * UIProcess/WebPageProxy.cpp:
1021         (WebKit::WebPageProxy::creationParameters): Deleted.
1022         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1023         (WebKit::WebChromeClient::mediaShouldUsePersistentCache): Deleted.
1024         * WebProcess/WebCoreSupport/WebChromeClient.h:
1025         * WebProcess/WebPage/WebPage.cpp:
1026         (WebKit::m_mediaShouldUsePersistentCache): Deleted.
1027         * WebProcess/WebPage/WebPage.h:
1028         (WebKit::WebPage::mediaShouldUsePersistentCache): Deleted.
1029
1030 2016-03-30  Ada Chan  <adachan@apple.com>
1031
1032         Add the new "toggle enhanced fullscreen" context menu item to the video context menu on supporting platforms.
1033         https://bugs.webkit.org/show_bug.cgi?id=156031
1034
1035         Reviewed by Eric Carlson.
1036
1037         * Shared/API/c/WKContextMenuItemTypes.h:
1038         * Shared/API/c/WKSharedAPICast.h:
1039         (WebKit::toAPI):
1040         (WebKit::toImpl):
1041
1042 2016-03-31  Brent Fulgham  <bfulgham@apple.com>
1043
1044         Unreviewed build fix after r198893.
1045
1046         * NetworkProcess/NetworkProcess.cpp:
1047         (WebKit::NetworkProcess::findPendingDownloadLocation): Pass
1048         new argument to download method.
1049
1050 2016-03-31  Brent Fulgham  <bfulgham@apple.com>
1051
1052         [WK2] Support download attribute feature
1053         https://bugs.webkit.org/show_bug.cgi?id=102914
1054         <rdar://problem/13177492>
1055
1056         Reviewed by Darin Adler.
1057
1058         A first draft implementation of this feature.
1059
1060         * NetworkProcess/Downloads/Download.cpp:
1061         (WebKit::Download::Download): Update to accept default filename.
1062         (WebKit::Download::didStart): Send default filename in message.
1063         * NetworkProcess/Downloads/Download.h:
1064         * NetworkProcess/Downloads/DownloadManager.cpp:
1065         (WebKit::DownloadManager::startDownload): Expect a default filename argument.
1066         * NetworkProcess/Downloads/DownloadManager.h:
1067         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1068         (WebKit::NetworkConnectionToWebProcess::startDownload): Expect a default
1069         filename argument.
1070         * NetworkProcess/NetworkConnectionToWebProcess.h:
1071         * NetworkProcess/NetworkConnectionToWebProcess.messages.in: Update messages to
1072         expect a default filename argument.
1073         * Shared/NavigationActionData.cpp:
1074         (WebKit::NavigationActionData::encode): Handle the download attribute flag and
1075         the default filename.
1076         (WebKit::NavigationActionData::decode): Ditto.
1077         * Shared/NavigationActionData.h:
1078         * UIProcess/API/APINavigationAction.h:
1079         * UIProcess/Downloads/DownloadProxy.cpp:
1080         (WebKit::DownloadProxy::didStart): Expect a default filename argument.
1081         (WebKit::DownloadProxy::decideDestinationWithSuggestedFilename): Use the suggested
1082         filename if the client delegate does not override it.
1083         * UIProcess/Downloads/DownloadProxy.h:
1084         * UIProcess/Downloads/DownloadProxy.messages.in: Include a default filename value.
1085         * UIProcess/WebPageProxy.cpp:
1086         (WebKit::WebPageProxy::receivedPolicyDecision): If the feature is enabled, and
1087         the load was started with a download attribute, convert a "PolicyUse" decision
1088         to "PolicyDownload".
1089         (WebKit::WebPageProxy::decidePolicyForNavigationAction): Remember if the load
1090         is happening due to a 'download' attribute link.
1091         * UIProcess/WebPageProxy.h:
1092         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1093         (WebKit::WebChromeClient::createWindow): Populate the navigationActionData object
1094         with any download attribute and suggested filename.
1095         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1096         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNewWindowAction): Populate the
1097         navigationActionData object with any download attribute and suggested filename.
1098         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction): Ditto.
1099         (WebKit::WebFrameLoaderClient::startDownload): Expect a suggested filename argument.
1100         * WebProcess/WebPage/WebFrame.cpp:
1101         (WebKit::WebFrame::startDownload): Expect a suggested filename argument.
1102         * WebProcess/WebPage/WebFrame.h:
1103
1104 2016-03-30  Alex Christensen  <achristensen@webkit.org>
1105
1106         CMake build fix.
1107
1108         * PlatformMac.cmake:
1109
1110 2016-03-30  Alex Christensen  <achristensen@webkit.org>
1111
1112         Speculative Yosemite fix after r198872.
1113
1114         * UIProcess/Cocoa/WebAutomationSessionCocoa.mm:
1115         (WebKit::WebAutomationSession::platformSimulateKeySequence):
1116         Yosemite didn't like _Nullable.
1117
1118 2016-03-30  Yongjun Zhang  <yongjun_zhang@apple.com>
1119
1120         Need to expose makeAllShadowRootsOpen in WKWebProcessPlugInScriptWorld.
1121         https://bugs.webkit.org/show_bug.cgi?id=156046
1122
1123         Add an SPI makeAllShadowRootsOpen method in WKWebProcessPlugInScriptWorld.
1124
1125         Reviewed by Dan Bernstein.
1126
1127         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInScriptWorld.h:
1128         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInScriptWorld.mm:
1129         (-[WKWebProcessPlugInScriptWorld makeAllShadowRootsOpen]):
1130
1131 2016-03-30  Brian Burg  <bburg@apple.com>
1132
1133         Web Automation: Add Automation.performKeyboardInteractions
1134         https://bugs.webkit.org/show_bug.cgi?id=155990
1135         <rdar://problem/25426408>
1136
1137         Reviewed by Timothy Hatcher.
1138
1139         Add a command that allows automation to simulate single
1140         key strokes or insertion of an entire string, character
1141         by character.
1142
1143         * UIProcess/Automation/Automation.json: Add new command.
1144         Add a large enumeration of all virtual keys that exist
1145         on a US 109-key keyboard layout. Add an interaction object.
1146
1147         * UIProcess/Automation/WebAutomationSession.cpp:
1148         (WebKit::WebAutomationSession::performKeyboardInteractions):
1149         Added. This method validates the incoming key interactions
1150         from the protocol and makes a list of simulated interactions
1151         to perform. If everything validates, then delegate the key
1152         interaction simulations to platform-specific methods.
1153
1154         (WebKit::WebAutomationSession::platformSimulateKeyStroke):
1155         (WebKit::WebAutomationSession::platformSimulateKeySequence):
1156         Add stubs for other platforms.
1157
1158         * UIProcess/Automation/WebAutomationSession.h: Add new
1159         protocol command handler and platform simulation methods.
1160
1161         * UIProcess/Cocoa/WebAutomationSessionCocoa.mm:
1162         (WebKit::WebAutomationSession::platformSimulateKeyStroke):
1163         (WebKit::WebAutomationSession::platformSimulateKeySequence):
1164         These methods implement keyboard simulation for AppKit, used
1165         by the Mac port. In the keystroke case, figure out the AppKit
1166         keyCode for the key as well as any key modifiers that should
1167         be included with the key event. Keep track of sticky modifiers
1168         and update the session state appropriately. In the key sequence
1169         case, split the string into combining character sequences and
1170         send a 'key up/down'. This is a weird way to send non-ASCII
1171         text, so a better alternative should be explored in the future.
1172
1173 2016-03-30  Brady Eidson  <beidson@apple.com>
1174
1175         Make BlobData use ThreadSafeSharedBuffer instead of RawData.
1176         https://bugs.webkit.org/show_bug.cgi?id=156041
1177
1178         Reviewed by Alex Christensen.
1179
1180         * NetworkProcess/FileAPI/NetworkBlobRegistry.cpp:
1181         (WebKit::NetworkBlobRegistry::filesInBlob):
1182         * Shared/WebCoreArgumentCoders.cpp:
1183         (IPC::ArgumentCoder<BlobPart>::decode):
1184
1185 2016-03-30  Daniel Bates  <dabates@apple.com>
1186
1187         Unreviewed, rolling out r198856.
1188
1189         Broke the tests on the Apple El Capitan Release WK2 (Tests)
1190         bot. Further investigation needed.
1191
1192         Reverted changeset:
1193
1194         "REGRESSION (r194660): Navigating to HTTPS sites may fail with
1195         error"
1196         https://bugs.webkit.org/show_bug.cgi?id=155455
1197         http://trac.webkit.org/changeset/198856
1198
1199 2016-03-30  Daniel Bates  <dabates@apple.com>
1200
1201         REGRESSION (r194660): Navigating to HTTPS sites may fail with error
1202         https://bugs.webkit.org/show_bug.cgi?id=155455
1203         <rdar://problem/24308793>
1204
1205         Reviewed by Alexey Proskuryakov.
1206
1207         Fixes an issue where navigating to an HTTPS site may fail because the Security Framework uses
1208         a cache directory that it does not have permission to use.
1209
1210         * Shared/mac/ChildProcessMac.mm:
1211         (WebKit::codeSigningIdentifierForProcess): Queries the Security Framework for the code signed
1212         bundle identifier/code signing identifier.
1213         (WebKit::ChildProcess::initializeSandbox): Use the client identifier as part of the user directory
1214         suffix. Verify that the client identifier matches the code signed bundled identifier/code
1215         signing identifier for the code signed app/tool. Fix minor code style issue; use a C++-style cast
1216         instead of a C-style cast when casting an OSStatus to a long.
1217         (WebKit::findSecCodeForProcess): Deleted; incorporated logic into WebKit::codeSigningIdentifierForProcess().
1218
1219 2016-03-30  Myles C. Maxfield  <mmaxfield@apple.com>
1220
1221         Use references instead of pointers in scrollbar-related code
1222         https://bugs.webkit.org/show_bug.cgi?id=155998
1223
1224         Reviewed by Dean Jackson.
1225
1226         * WebProcess/Plugins/PDF/DeprecatedPDFPlugin.h:
1227         * WebProcess/Plugins/PDF/DeprecatedPDFPlugin.mm:
1228         (WebKit::PDFPlugin::convertFromScrollbarToContainingView):
1229         (WebKit::PDFPlugin::convertFromContainingViewToScrollbar):
1230         (WebKit::PDFPlugin::invalidateScrollbarRect):
1231
1232 2016-03-29  David Kilzer  <ddkilzer@apple.com>
1233
1234         REGRESSION: Yosemite-only: com.apple.WebKit.Plugin.32.Development crashed in PluginProcessShim.dylib: WebKit::shimMachVMMap + 26
1235         <http://webkit.org/b/156000>
1236         <rdar://problem/25272133>
1237
1238         Reviewed by Joseph Pecoraro.
1239
1240         * PluginProcess/mac/PluginProcessShim.mm:
1241         (WebKit::shimMachVMMap): Add SUPPRESS_ASAN attribute on
1242         Yosemite.
1243
1244 2016-03-28  Enrica Casucci  <enrica@apple.com>
1245
1246         When moving focus from one select element to another (iPhone) the value is committed to the newly focused element.
1247         https://bugs.webkit.org/show_bug.cgi?id=155958
1248         rdar://problem/22738524
1249
1250         Reviewed by Tim Horton.
1251
1252         We should not delay the call to endEditing until we receive
1253         stopAssistingNode, because by then the assisted node might have already
1254         changed. We need to call endEditing to commit potential changes every
1255         time we tap. This way we can make sure the editing session on the select
1256         element has been completed. This affects only single select elements on
1257         iPhone, where the change to the actual DOM element is delayed until we
1258         stop interacting with the element. On iPad or for multi-select elements,
1259         the change to the DOM happens immediately.
1260
1261         * UIProcess/ios/WKContentViewInteraction.mm:
1262         (-[WKContentView _singleTapCommited:]):
1263         (-[WKContentView _attemptClickAtLocation:]):
1264         (-[WKContentView _stopAssistingNode]):
1265
1266 2016-03-29  Brian Burg  <bburg@apple.com>
1267
1268         Unreviewed build fix after r198793.
1269
1270         * UIProcess/API/Cocoa/_WKAutomationSession.h:
1271         * UIProcess/API/Cocoa/_WKAutomationSession.mm:
1272         The wasEventSynthesizedForAutomation method should only be available on Mac.
1273
1274 2016-03-29  Brian Burg  <bburg@apple.com>
1275
1276         Unreviewed build fix after r198792.
1277
1278         * UIProcess/Cocoa/WebAutomationSessionCocoa.mm:
1279         (WebKit::WebAutomationSession::platformSimulateMouseInteraction):
1280         We (still) can't use lightweight generics in Objective-C code.
1281         Also, use RetainPtr instead of new, since this is not ARC code.
1282
1283 2016-03-29  Alex Christensen  <achristensen@webkit.org>
1284
1285         Fix CMake build after r198792.
1286
1287         * PlatformMac.cmake:
1288
1289 2016-03-29  Brian Burg  <bburg@apple.com>
1290
1291         Web Automation: Add SPI to tell whether an NSEvent was synthesized for automation
1292         https://bugs.webkit.org/show_bug.cgi?id=155963
1293         <rdar://problem/25405747>
1294
1295         Reviewed by Timothy Hatcher.
1296
1297         Tag all NSEvents that were synthesized with an associated object before sending.
1298         Do all associated object work below the API layer so we don't get into trouble
1299         using things that may be guarded by WK_API_ENABLED.
1300
1301         * UIProcess/API/Cocoa/_WKAutomationSession.h:
1302         * UIProcess/API/Cocoa/_WKAutomationSession.mm:
1303         (-[_WKAutomationSession wasEventSynthesizedForAutomation:]):
1304         Forward to the wrapped session object.
1305
1306         * UIProcess/Automation/WebAutomationSession.h:
1307         * UIProcess/Cocoa/WebAutomationSessionCocoa.mm:
1308         (WebKit::WebAutomationSession::sendSynthesizedEventsToPage):
1309         Tag outgoing NSEvents with the session identifier as an associated object.
1310
1311         (WebKit::WebAutomationSession::wasEventSynthesizedForAutomation):
1312         Check an incoming NSEvent to see if its associated object is the session identifier.
1313
1314 2016-03-28  Brian Burg  <bburg@apple.com>
1315
1316         Web Automation: implement Automation.performMouseInteraction
1317         https://bugs.webkit.org/show_bug.cgi?id=155606
1318         <rdar://problem/25227576>
1319
1320         Reviewed by Timothy Hatcher.
1321
1322         This method implements common mouse interactions by synthesizing native events.
1323         The creation and dispatching of simulated events is implemented separately per
1324         application/window/event framework. This patch adds an implementation for ports
1325         that use AppKit.
1326
1327         The event is created synthetically in a platform-specific way and delivered to
1328         the platform's window in the UIProcess. The event goes through all the
1329         layers of processing that a real mouse event could go through once it reaches
1330         WebKit itself.
1331
1332         * UIProcess/Automation/Automation.json: Add new enums and command.
1333
1334         * UIProcess/Automation/WebAutomationSession.cpp:
1335         (WebKit::protocolModifierToWebEventModifier):
1336         (WebKit::WebAutomationSession::performMouseInteraction): Added.
1337         Clip the requested cursor position so that it stays within the selected window's
1338         frame and doesn't wander off into other windows or applications. Fire it using
1339         the platform-specific simulation method.
1340
1341         (WebKit::WebAutomationSession::platformSimulateMouseInteraction): Added.
1342
1343         * UIProcess/Automation/WebAutomationSession.h:
1344         * UIProcess/Cocoa/WebAutomationSessionCocoa.mm:
1345         (WebKit::WebAutomationSession::platformSimulateMouseInteraction): Added.
1346         Convert Automation protocol values to AppKit values. Simulate and dispatch
1347         one or more events depending on the desired interaction.
1348         * WebKit2Prefix.h: Include AppKitCompatibilityDeclarations.h so newer
1349         NSEventTypes can be used.
1350
1351 2016-03-29  Carlos Garcia Campos  <cgarcia@igalia.com>
1352
1353         Unreviewed. Follow up to r198580.
1354
1355         Simplify the code even more as suggested by Darin.
1356
1357         * UIProcess/API/gtk/PageClientImpl.cpp:
1358         (WebKit::PageClientImpl::setViewNeedsDisplay):
1359
1360 2016-03-28  Alex Christensen  <achristensen@webkit.org>
1361
1362         Fix Mac Ninja build after r198766.
1363
1364         * CMakeLists.txt:
1365
1366 2016-03-28  Brady Eidson  <beidson@apple.com>
1367
1368         Modern IDB: Remove abstract base classes for all IDB DOM classes.
1369         https://bugs.webkit.org/show_bug.cgi?id=155951
1370
1371         Reviewed by Alex Christensen.
1372
1373         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
1374
1375 2016-03-28  Brian Burg  <bburg@apple.com>
1376
1377         Web Automation: add commands to move and resize a browsing context's window
1378         https://bugs.webkit.org/show_bug.cgi?id=155349
1379         <rdar://problem/25104911>
1380
1381         Reviewed by Timothy Hatcher.
1382
1383         Parse the new origin or size and request the window to change to the
1384         new frame. This calls through to PageUIClient::setWindowFrame().
1385
1386         * UIProcess/Automation/Automation.json:
1387         Add new enum values for protocol parsing error cases.
1388         Add new commands.
1389
1390         * UIProcess/Automation/WebAutomationSession.cpp:
1391         (WebKit::WebAutomationSession::resizeWindowOfBrowsingContext):
1392         (WebKit::WebAutomationSession::moveWindowOfBrowsingContext):
1393         Added. Parse the incoming payload and bail if nothing would happen
1394         or the values are not usable or out of range. Complain if a change
1395         did not happen when the requested and actual size are different.
1396
1397         * UIProcess/Automation/WebAutomationSession.h:
1398         * UIProcess/WebPageProxy.h: Move setWindowFrame to be public.
1399
1400 2016-03-28  Brian Burg  <bburg@apple.com>
1401
1402         Web Automation: split protocol object BrowsingContext.windowFrame into two separate members
1403         https://bugs.webkit.org/show_bug.cgi?id=155952
1404         <rdar://problem/25393597>
1405
1406         Reviewed by Timothy Hatcher.
1407
1408         Using the name 'windowFrame' causes conflicts with some Objective-C code.
1409
1410         * UIProcess/Automation/Automation.json:
1411         * UIProcess/Automation/WebAutomationSession.cpp:
1412         (WebKit::WebAutomationSession::buildBrowsingContextForPage):
1413
1414 2016-03-28  Carlos Alberto Lopez Perez  <clopez@igalia.com>
1415
1416         [CMake] Unreviewed build fix after r198736.
1417         https://bugs.webkit.org/show_bug.cgi?id=155221
1418
1419         Unreviewed.
1420
1421         * CMakeLists.txt: Fix typo, add WebAutomationSession.cpp and declare JavaScriptCore_SCRIPTS_DIR.
1422         * WebProcess/Automation/WebAutomationSessionProxy.h: Add missing include.
1423
1424 2016-03-28  Alex Christensen  <achristensen@webkit.org>
1425
1426         Use std::exchange for std::functions instead of WTFMove
1427         https://bugs.webkit.org/show_bug.cgi?id=155950
1428         rdar://problem/25348817
1429
1430         Reviewed by Anders Carlsson.
1431
1432         * NetworkProcess/NetworkLoad.cpp:
1433         (WebKit::NetworkLoad::convertTaskToDownload):
1434         (WebKit::NetworkLoad::setPendingDownloadID):
1435         (WebKit::NetworkLoad::continueCanAuthenticateAgainstProtectionSpace):
1436         This makes the member variable nullptr when the value is moved so we don't use it again.
1437
1438 2016-03-28  Brian Burg  <bburg@apple.com>
1439
1440         Web Automation: report the browsing context's window frame (size and origin)
1441         https://bugs.webkit.org/show_bug.cgi?id=155323
1442         <rdar://problem/25094089>
1443
1444         Reviewed by Timothy Hatcher.
1445
1446         To prepare for implementing resize and move commands, add a
1447         windowFrame member to the browsing context protocol type.
1448
1449         * UIProcess/Automation/Automation.json:
1450         Add a frame Rect to BrowsingContext.
1451
1452         * UIProcess/Automation/WebAutomationSession.cpp:
1453         (WebKit::WebAutomationSession::handleForWebPageProxy):
1454         (WebKit::WebAutomationSession::buildBrowsingContextForPage):
1455         Extract the code to build a BrowsingContext object. Add
1456         code to calculate and insert the page's window frame size.
1457
1458         (WebKit::WebAutomationSession::getBrowsingContexts):
1459         (WebKit::WebAutomationSession::getBrowsingContext):
1460         (WebKit::WebAutomationSession::createBrowsingContext):
1461         (WebKit::WebAutomationSession::switchToBrowsingContext):
1462         Refactoring as above.
1463
1464         * UIProcess/Automation/WebAutomationSession.h:
1465         Adjust signatures.
1466
1467         * UIProcess/WebPageProxy.h: Make getWindowFrame public.
1468
1469 2016-03-28  Brian Burg  <bburg@apple.com>
1470
1471         Unreviewed, fix the build.
1472
1473         * WebProcess/Automation/WebAutomationSessionProxy.cpp:
1474         InspectorProtocolObjects.h was renamed to AutomationProtocolObjects.h.
1475
1476 2016-03-28  Chris Dumez  <cdumez@apple.com>
1477
1478         Disk cache speculative validation requests do not have the 'Referer' HTTP header set
1479         https://bugs.webkit.org/show_bug.cgi?id=155890
1480         <rdar://problem/25279962>
1481
1482         Reviewed by Antti Koivisto.
1483
1484         Disk cache speculative validation requests did not have the 'Referer'
1485         HTTP header set. This was breaking some streaming sites (such as
1486         twitch.tv).
1487
1488         We now store all the original request's HTTP headers in the disk cache
1489         so we can re-use them for the speculative validation requests. When the
1490         actual request comes later on, we also make sure that the HTTP headers
1491         used in the speculative validation request match the ones from the
1492         effective request. If they don't we don't use the speculatively
1493         validated resource as the server may return a different resource in
1494         such case.
1495
1496         * NetworkProcess/cache/NetworkCache.cpp:
1497         (WebKit::NetworkCache::Cache::retrieve):
1498         Pass the effective ResourceRequest to the NetworkCacheSpeculativeLoadManager
1499         so it can check that the speculative validation request's HTTP headers
1500         match the effective request's headers.
1501
1502         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.h:
1503         * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
1504         (WebKit::NetworkCache::constructRevalidationRequest):
1505         (WebKit::NetworkCache::SpeculativeLoadManager::PreloadedEntry::PreloadedEntry):
1506         (WebKit::NetworkCache::SpeculativeLoadManager::PreloadedEntry::revalidationRequest):
1507         (WebKit::NetworkCache::SpeculativeLoadManager::PreloadedEntry::wasRevalidated):
1508         We now have a member in PreloadedEntry to keep the request used for validation, if
1509         speculative validation was done. This is so that we can compare its HTTP headers
1510         with the ones of the effective request later on.
1511
1512         (WebKit::NetworkCache::dumpHTTPHeadersDiff):
1513         Debug function that prints which HTTP headers did not match in the speculative
1514         validation request and in the effective request.
1515
1516         (WebKit::NetworkCache::requestsHeadersMatch):
1517         New utility function to check that the speculative validation request's HTTP
1518         headers match the ones of the effective requests. Note that we allow for
1519         headers related to validation to differ.
1520
1521         (WebKit::NetworkCache::SpeculativeLoadManager::canUsePreloadedEntry):
1522         (WebKit::NetworkCache::SpeculativeLoadManager::canUsePendingPreload):
1523         (WebKit::NetworkCache::SpeculativeLoadManager::retrieve):
1524         Check that the speculative validation request's HTTP headers match the
1525         ones of the effective request. If they don't then do not use the
1526         speculatively validated resource.
1527
1528         (WebKit::NetworkCache::SpeculativeLoadManager::addPreloadedEntry):
1529         (WebKit::NetworkCache::SpeculativeLoadManager::revalidateEntry):
1530         (WebKit::NetworkCache::SpeculativeLoadManager::preloadEntry):
1531         (WebKit::NetworkCache::SpeculativeLoadManager::startSpeculativeRevalidation):
1532         * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.h:
1533
1534         * NetworkProcess/cache/NetworkCacheSubresourcesEntry.cpp:
1535         (WebKit::NetworkCache::SubresourceInfo::encode):
1536         (WebKit::NetworkCache::SubresourceInfo::decode):
1537         (WebKit::NetworkCache::SubresourcesEntry::encodeAsStorageRecord):
1538         (WebKit::NetworkCache::SubresourcesEntry::decodeStorageRecord):
1539         * NetworkProcess/cache/NetworkCacheSubresourcesEntry.h:
1540         (WebKit::NetworkCache::SubresourceInfo::SubresourceInfo):
1541         - Keep all the request's headers in SubresourceInfo instead of just the
1542           'User-Agent' one.
1543         - Drop the custom copy constructor / assignment operator for
1544           SubresourceInfo that were making isolated copies on the members.
1545           We technically don't need to use SubresourceInfo objects in other
1546           threads than the main one. In SpeculativeLoadManager::preloadEntry(),
1547           we now make capture a SubresourceInfo* in the lambda to avoid calling
1548           the copy constructor. We also make sure that the object gets destroyed
1549           in the lambda function, which is executed in the main thread.
1550
1551 2016-03-25  Timothy Hatcher  <timothy@apple.com>
1552
1553         Web Automation: Add Automation protocol commands to handle JavaScript dialogs
1554
1555         https://bugs.webkit.org/show_bug.cgi?id=155888
1556         rdar://problem/25360218
1557
1558         Reviewed by Brian Burg.
1559
1560         * UIProcess/API/APIAutomationSessionClient.h:
1561         (API::AutomationSessionClient::isShowingJavaScriptDialogOnPage): Added.
1562         (API::AutomationSessionClient::dismissCurrentJavaScriptDialogOnPage): Added.
1563         (API::AutomationSessionClient::acceptCurrentJavaScriptDialogOnPage): Added.
1564         (API::AutomationSessionClient::messageOfCurrentJavaScriptDialogOnPage): Added.
1565         (API::AutomationSessionClient::setUserInputForCurrentJavaScriptPromptOnPage): Added.
1566
1567         * UIProcess/API/Cocoa/_WKAutomationSessionDelegate.h:
1568
1569         * UIProcess/Automation/Automation.json: Added new commands.
1570
1571         * UIProcess/Automation/WebAutomationSession.cpp:
1572         (WebKit::WebAutomationSession::isShowingJavaScriptDialog): Added.
1573         (WebKit::WebAutomationSession::dismissCurrentJavaScriptDialog): Added.
1574         (WebKit::WebAutomationSession::acceptCurrentJavaScriptDialog): Added.
1575         (WebKit::WebAutomationSession::messageOfCurrentJavaScriptDialog): Added.
1576         (WebKit::WebAutomationSession::setUserInputForCurrentJavaScriptPrompt): Added.
1577         * UIProcess/Automation/WebAutomationSession.h:
1578
1579         * UIProcess/Cocoa/AutomationSessionClient.h:
1580         * UIProcess/Cocoa/AutomationSessionClient.mm:
1581         (WebKit::AutomationSessionClient::AutomationSessionClient): Added.
1582         (WebKit::AutomationSessionClient::isShowingJavaScriptDialogOnPage): Added.
1583         (WebKit::AutomationSessionClient::dismissCurrentJavaScriptDialogOnPage): Added.
1584         (WebKit::AutomationSessionClient::acceptCurrentJavaScriptDialogOnPage): Added.
1585         (WebKit::AutomationSessionClient::messageOfCurrentJavaScriptDialogOnPage): Added.
1586         (WebKit::AutomationSessionClient::setUserInputForCurrentJavaScriptPromptOnPage): Added.
1587
1588 2016-03-24  Timothy Hatcher  <timothy@apple.com>
1589
1590         Web Automation: Add commands to compute layout of an element
1591
1592         https://bugs.webkit.org/show_bug.cgi?id=155841
1593         rdar://problem/25340075
1594
1595         Reviewed by Brian Burg.
1596
1597         * UIProcess/Automation/Automation.json: Added computeElementLayout.
1598
1599         * UIProcess/Automation/WebAutomationSession.cpp:
1600         (WebKit::WebAutomationSession::computeElementLayout): Added.
1601         (WebKit::WebAutomationSession::didComputeElementLayout): Added.
1602         * UIProcess/Automation/WebAutomationSession.h:
1603         * UIProcess/Automation/WebAutomationSession.messages.in:
1604         (DidComputeElementLayout): Added.
1605
1606         * WebProcess/Automation/WebAutomationSessionProxy.cpp:
1607         (WebKit::WebAutomationSessionProxy::computeElementLayout): Added.
1608         * WebProcess/Automation/WebAutomationSessionProxy.h:
1609         * WebProcess/Automation/WebAutomationSessionProxy.messages.in:
1610         (ComputeElementLayout): Added.
1611
1612 2016-03-18  Timothy Hatcher  <timothy@apple.com>
1613
1614         Web Automation: Add Automation protocol commands to resolve frames as handles
1615
1616         https://bugs.webkit.org/show_bug.cgi?id=155650
1617         rdar://problem/25242422
1618
1619         Reviewed by Brian Burg.
1620
1621         * UIProcess/Automation/Automation.json:
1622         Added resolveFrameHandle and resolveParentFrameHandle.
1623
1624         * UIProcess/Automation/WebAutomationSession.cpp:
1625         (WebKit::WebAutomationSession::webFrameProxyForHandle): Added.
1626         (WebKit::WebAutomationSession::handleForWebFrameID): Added.
1627         (WebKit::WebAutomationSession::handleForWebFrameProxy): Added.
1628         (WebKit::WebAutomationSession::evaluateJavaScriptFunction): Use frame handles now.
1629         (WebKit::WebAutomationSession::resolveChildFrameHandle): Added.
1630         (WebKit::WebAutomationSession::didChildResolveFrame): Added.
1631         (WebKit::WebAutomationSession::resolveParentFrameHandle): Added.
1632         (WebKit::WebAutomationSession::didResolveParentFrame): Added.
1633         * UIProcess/Automation/WebAutomationSession.h:
1634         * UIProcess/Automation/WebAutomationSession.messages.in:
1635         (DidResolveChildFrame): Added.
1636         (DidResolveParentFrame): Added.
1637
1638         * WebProcess/Automation/WebAutomationSessionProxy.cpp:
1639         (WebKit::WebAutomationSessionProxy::elementForNodeHandle): Added.
1640         (WebKit::WebAutomationSessionProxy::resolveChildFrameWithOrdinal): Added.
1641         (WebKit::WebAutomationSessionProxy::resolveChildFrameWithNodeHandle): Added.
1642         (WebKit::WebAutomationSessionProxy::resolveChildFrameWithName): Added.
1643         (WebKit::WebAutomationSessionProxy::resolveParentFrame): Added.
1644         (WebKit::WebAutomationSessionProxy::focusFrame): Added.
1645         * WebProcess/Automation/WebAutomationSessionProxy.h:
1646         * WebProcess/Automation/WebAutomationSessionProxy.messages.in:
1647         (ResolveChildFrameWithOrdinal): Added.
1648         (ResolveChildFrameWithNodeHandle): Added.
1649         (ResolveChildFrameWithName): Added.
1650         (ResolveParentFrame): Added.
1651         (FocusFrame): Added.
1652
1653         * WebProcess/Automation/WebAutomationSessionProxy.js:
1654         (AutomationSessionProxy.prototype.nodeForIdentifier): Added.
1655         Public method that eats the exception thrown by the private method.
1656
1657 2016-03-17  Timothy Hatcher  <timothy@apple.com>
1658
1659         Web Automation: Add Automation.evaluateJavaScriptFunction
1660
1661         https://bugs.webkit.org/show_bug.cgi?id=155524
1662         rdar://problem/25181888
1663
1664         Reviewed by Joseph Pecoraro.
1665
1666         * UIProcess/Automation/Automation.json: Added evaluateJavaScriptFunction command.
1667
1668         * UIProcess/Automation/WebAutomationSession.cpp:
1669         (WebKit::WebAutomationSession::evaluateJavaScriptFunction): Added.
1670         (WebKit::WebAutomationSession::didEvaluateJavaScriptFunction): Added.
1671         * UIProcess/Automation/WebAutomationSession.h:
1672         * UIProcess/Automation/WebAutomationSession.messages.in: Added didEvaluateJavaScriptFunction.
1673
1674         * WebProcess/Automation/WebAutomationSessionProxy.cpp:
1675         (WebKit::toJSArray): Added.
1676         (WebKit::callPropertyFunction): Added.
1677         (WebKit::evaluateJavaScriptCallback): Added.
1678         (WebKit::WebAutomationSessionProxy::didClearWindowObjectForFrame): Dispatch pending callbacks as errors.
1679         (WebKit::WebAutomationSessionProxy::evaluateJavaScriptFunction): Added.
1680         (WebKit::WebAutomationSessionProxy::didEvaluateJavaScriptFunction): Added.
1681         * WebProcess/Automation/WebAutomationSessionProxy.h:
1682
1683         * WebProcess/Automation/WebAutomationSessionProxy.js:
1684         (AutomationSessionProxy): Added maps for node handles.
1685         (AutomationSessionProxy.prototype.evaluateJavaScriptFunction): Added.
1686         (AutomationSessionProxy.prototype._jsonParse): Added.
1687         (AutomationSessionProxy.prototype._jsonStringify): Added.
1688         (AutomationSessionProxy.prototype._reviveJSONValue): Added.
1689         (AutomationSessionProxy.prototype._replaceJSONValue): Added.
1690         (AutomationSessionProxy.prototype._createNodeHandle): Added.
1691         (AutomationSessionProxy.prototype._nodeForIdentifier): Added.
1692         (AutomationSessionProxy.prototype._identifierForNode): Added.
1693
1694         * WebProcess/Automation/WebAutomationSessionProxy.messages.in: Added evaluateJavaScriptFunction.
1695
1696 2016-03-14  Timothy Hatcher  <timothy@apple.com>
1697
1698         Add WebAutomationSessionProxy for WebProcess side automation tasks
1699
1700         https://bugs.webkit.org/show_bug.cgi?id=155221
1701         rdar://problem/25054868
1702
1703         Reviewed by Joseph Pecoraro.
1704
1705         * CMakeLists.txt: Add build step to build-in WebAutomationSessionProxy.js.
1706         * DerivedSources.make: Ditto.
1707
1708         * UIProcess/Automation/WebAutomationSession.cpp:
1709         (WebKit::WebAutomationSession::~WebAutomationSession):
1710         (WebKit::WebAutomationSession::setProcessPool): Add / remove message receiver.
1711         * UIProcess/Automation/WebAutomationSession.h:
1712
1713         * UIProcess/Automation/WebAutomationSession.messages.in: Added.
1714         Test message to get things to build.
1715
1716         * UIProcess/WebProcessPool.cpp:
1717         (WebKit::WebProcessPool::removeMessageReceiver):
1718         (WebKit::WebProcessPool::setAutomationSession):
1719         * UIProcess/WebProcessPool.h:
1720
1721         * WebKit2.xcodeproj/project.pbxproj: Added new files.
1722
1723         * WebProcess/Automation/WebAutomationSessionProxy.cpp: Added.
1724         (WebKit::toJSString):
1725         (WebKit::toJSValue):
1726         (WebKit::WebAutomationSessionProxy::WebAutomationSessionProxy):
1727         (WebKit::WebAutomationSessionProxy::~WebAutomationSessionProxy):
1728         (WebKit::evaluate):
1729         (WebKit::createUUID):
1730         (WebKit::WebAutomationSessionProxy::scriptObjectForFrame):
1731         (WebKit::WebAutomationSessionProxy::didClearWindowObjectForFrame):
1732         Create a script object per frame that is evaluated from WebAutomationSessionProxy.js.
1733         Clear the script object when the window object is cleared.
1734
1735         * WebProcess/Automation/WebAutomationSessionProxy.h: Added.
1736         (WebKit::WebAutomationSessionProxy::test):
1737         Added test message to let the messages files build.
1738
1739         * WebProcess/Automation/WebAutomationSessionProxy.js: Added.
1740
1741         * WebProcess/Automation/WebAutomationSessionProxy.messages.in: Added.
1742
1743         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1744         (WebKit::WebFrameLoaderClient::dispatchDidClearWindowObjectInWorld):
1745         Call WebAutomationSessionProxy::didClearWindowObjectForFrame to clear the script object.
1746
1747         * WebProcess/WebProcess.cpp:
1748         (WebKit::WebProcess::ensureAutomationSessionProxy):
1749         (WebKit::WebProcess::destroyAutomationSessionProxy):
1750         Creates and destroys the WebAutomationSessionProxy when the UIProcess WebAutomationSession
1751         is set or removed on the WebProcessPool.
1752
1753         * WebProcess/WebProcess.h:
1754         (WebKit::WebProcess::automationSessionProxy): Added.
1755
1756         * WebProcess/WebProcess.messages.in: Added. Test message to get things to build.
1757
1758 2016-03-28  Dan Bernstein  <mitz@apple.com>
1759
1760         Tried to fix the build after r198728.
1761
1762         * WebProcess/WebPage/WebPage.cpp:
1763         (WebKit::WebPage::gestureEvent):
1764
1765 2016-03-28  Zan Dobersek  <zdobersek@igalia.com>
1766
1767         Unreviewed GTK build fix for the threaded compositor feature after r198655.
1768         Adjust the first parameter of ThreadSafeCoordinatedSurface::copyToTexture().
1769
1770         * Shared/CoordinatedGraphics/threadedcompositor/ThreadSafeCoordinatedSurface.cpp:
1771         (WebKit::ThreadSafeCoordinatedSurface::copyToTexture):
1772         * Shared/CoordinatedGraphics/threadedcompositor/ThreadSafeCoordinatedSurface.h:
1773
1774 2016-03-27  Hunseop Jeong  <hs85.jeong@samsung.com>
1775
1776         [EFL] REGRESSION(r188793): It made 200 layout tests and Bindings/event-target-wrapper.html performance test fail
1777         https://bugs.webkit.org/show_bug.cgi?id=148470
1778
1779         Reviewed by Darin Adler.
1780
1781         UI events are suppressed in webPage after r188793.
1782         I revert the r136133 for passing the events to WebPage
1783
1784         * WebProcess/WebPage/WebPage.cpp: Removed the codes which was uploaded at r136133.
1785         (WebKit::WebPage::mouseEvent):
1786         (WebKit::WebPage::wheelEvent):
1787         (WebKit::WebPage::keyEvent):
1788         (WebKit::WebPage::touchEvent):
1789         (WebKit::WebPage::canHandleUserEvents): Deleted.
1790         * WebProcess/WebPage/WebPage.h:
1791
1792 2016-03-26  Dan Bernstein  <mitz@apple.com>
1793
1794         Tried to fix the build.
1795
1796         * UIProcess/API/Cocoa/WKWebView.mm:
1797         (-[WKWebView _takeViewSnapshot]):
1798
1799 2016-03-26  Dan Bernstein  <mitz@apple.com>
1800
1801         Tried to fix the build.
1802
1803         * UIProcess/API/Cocoa/WKWebView.mm:
1804         (-[WKWebView _takeViewSnapshot]):
1805
1806 2016-03-26  Dean Jackson  <dino@apple.com>
1807
1808         Fix build after my most recent commit.
1809
1810         * UIProcess/API/Cocoa/WKWebView.mm:
1811         (WebKit::bufferFormat): Delete the WebKitAdditions include.
1812
1813 2016-03-25  Dean Jackson  <dino@apple.com>
1814
1815         Move extended color detection into Open Source
1816         https://bugs.webkit.org/show_bug.cgi?id=155909
1817         <rdar://problem/25369754>
1818
1819         Reviewed by Anders Carlsson.
1820
1821         The code for detecting extended color displays
1822         was hidden while the iPad Pro 9.7" was in development.
1823         Now it is public, move the detection to Open Source.
1824
1825         While doing this, add a new method to PlatformScreen
1826         so that we have a more obvious way to detect such
1827         displays.
1828
1829         * Shared/mac/RemoteLayerBackingStore.mm:
1830         (WebKit::bufferFormat): No need to use WebKitAdditions any
1831         more.
1832
1833 2016-03-26  Dan Bernstein  <mitz@apple.com>
1834
1835         Treat SHA-1-signed certificates as insecure by default.
1836
1837         Reviewed by Sam Weinig.
1838
1839         * UIProcess/API/APIPageConfiguration.h: Initialize m_treatsSHA1SignedCertificatesAsInsecure
1840           to true.
1841         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
1842         (-[WKWebViewConfiguration init]): Initialize _treatsSHA1SignedCertificatesAsInsecure to YES.
1843
1844 2016-03-25  Dean Jackson  <dino@apple.com>
1845
1846         Remove use of extern "C" to include QuartzCore files
1847         https://bugs.webkit.org/show_bug.cgi?id=155905
1848
1849         Reviewed by Anders Carlson.
1850
1851         We can avoid having to wrap constants in extern "C", since they
1852         are mangled the same in both C and C++.
1853
1854         * UIProcess/mac/RemoteLayerTreeHost.mm: Remove the
1855         mention of CABackdropLayer.
1856
1857 2016-03-25  Brian Burg  <bburg@apple.com>
1858
1859         Web Inspector: protocol generator should prefix C++ filenames with the protocol group
1860         https://bugs.webkit.org/show_bug.cgi?id=155859
1861         <rdar://problem/25349859>
1862
1863         Reviewed by Alex Christensen and Joseph Pecoraro.
1864
1865         Adjust header include and build system paths.
1866
1867         * CMakeLists.txt:
1868         Revert the workaround introduced in r198659 since this change fixes the
1869         underlying issue.
1870
1871         * DerivedSources.make:
1872         * UIProcess/Automation/WebAutomationSession.cpp:
1873         * UIProcess/Automation/WebAutomationSession.h:
1874         * WebKit2.xcodeproj/project.pbxproj:
1875
1876 2016-03-25  Alex Christensen  <achristensen@webkit.org>
1877
1878         Remove unused lambda capture after r196984.
1879
1880         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
1881         (-[WKNetworkSessionDelegate URLSession:dataTask:didReceiveResponse:completionHandler:]):
1882         resourceResponse is not used in the lambda.
1883
1884 2016-03-25  Alex Christensen  <achristensen@webkit.org>
1885
1886         Fix Mac CMake build.
1887
1888         * PlatformMac.cmake:
1889
1890 2016-03-24  Alex Christensen  <achristensen@webkit.org>
1891
1892         Fix Mac CMake build.
1893
1894         * CMakeLists.txt:
1895         Temporarily add DERIVED_SOURCES_JAVASCRIPTCORE_DIR after DERIVED_SOURCES_WEBCORE_DIR,
1896         because both contain a unique header named InspectorBackendDispatchers.h and this include
1897         order includes the correct one for WebKit2 first.
1898         * PlatformMac.cmake:
1899         Add new files.  Optionally link to AVFAudio.
1900
1901 2016-03-24  Said Abou-Hallawa  <sabouhallawa@apple,com>
1902
1903         Change NativeImagePtr for CG to be RetainPtr<CGImageRef>
1904         https://bugs.webkit.org/show_bug.cgi?id=155412
1905
1906         Reviewed by Darin Adler.
1907
1908         * Shared/CoordinatedGraphics/WebCoordinatedSurface.cpp:
1909         (WebKit::WebCoordinatedSurface::createWithSurface):
1910         (WebKit::WebCoordinatedSurface::create):
1911         (WebKit::WebCoordinatedSurface::WebCoordinatedSurface):
1912         (WebKit::WebCoordinatedSurface::copyToTexture):
1913         * Shared/CoordinatedGraphics/WebCoordinatedSurface.h:
1914         * Shared/ShareableBitmap.cpp:
1915         (WebKit::ShareableBitmap::create):
1916         (WebKit::ShareableBitmap::createShareable):
1917         (WebKit::ShareableBitmap::ShareableBitmap):
1918         * Shared/ShareableBitmap.h:
1919         Replace PassRefPtr with RefPtr and use WTFMove() instead of RefPtr::release()
1920         when passing the RefPtr.
1921         
1922         * Shared/cairo/ShareableBitmapCairo.cpp:
1923         (WebKit::createSurfaceFromData):
1924         (WebKit::ShareableBitmap::createCairoSurface):
1925         Replace PassRefPtr with RefPtr.
1926         
1927         (WebKit::ShareableBitmap::createImage):
1928         * Shared/cg/ShareableBitmapCG.cpp:
1929         (WebKit::ShareableBitmap::createImage):
1930         Replace PassRefPtr with RefPtr and use the move semantics when calling
1931         BitmapImage::create().
1932
1933         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
1934         (WebKit::CoordinatedLayerTreeHost::createCoordinatedSurface):
1935         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h:
1936         * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp:
1937         (WebKit::ThreadedCoordinatedLayerTreeHost::createCoordinatedSurface):
1938         * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h:
1939         Replace PassRefPtr with RefPtr
1940
1941 2016-03-24  Enrica Casucci  <enrica@apple.com>
1942
1943         Adopt new SPI from DataDetectorsCore to decide link behavior.
1944         https://bugs.webkit.org/show_bug.cgi?id=155780
1945         rdar://problem/25303631
1946
1947         Reviewed by Sam Weinig.
1948
1949         Changed use of data detection functions to take
1950         a reference to Element instead of a pointer.
1951
1952         * WebProcess/WebPage/ios/WebPageIOS.mm:
1953         (WebKit::WebPage::handleTap):
1954         (WebKit::WebPage::commitPotentialTap):
1955         (WebKit::WebPage::getPositionInformation):
1956
1957 2016-03-24  Chris Dumez  <cdumez@apple.com>
1958
1959         [WK2] Disable network cache speculative validation by default
1960         https://bugs.webkit.org/show_bug.cgi?id=155857
1961         <rdar://problem/25233210>
1962
1963         Reviewed by Alex Christensen.
1964
1965         Disable network cache speculative validation by default. Clients such
1966         as Safari now use the API added in r198544 to enable if they want.
1967
1968         * UIProcess/API/APIProcessPoolConfiguration.h:
1969
1970 2016-03-24  Alex Christensen  <achristensen@webkit.org>
1971
1972         Fix null dereferencing in NetworkLoad::continueCanAuthenticateAgainstProtectionSpace
1973         https://bugs.webkit.org/show_bug.cgi?id=155799
1974         rdar://25289012
1975
1976         Reviewed by Tim Horton.
1977
1978         * NetworkProcess/NetworkLoad.cpp:
1979         (WebKit::NetworkLoad::continueCanAuthenticateAgainstProtectionSpace):
1980         Null-check all the things!
1981
1982 2016-03-23  Tim Horton  <timothy_horton@apple.com>
1983
1984         MiniBrowser doesn't use accelerated drawing in WebKit2 windows if a WebKit1 window was opened first
1985         https://bugs.webkit.org/show_bug.cgi?id=141576
1986         <rdar://problem/25304548>
1987
1988         Reviewed by Simon Fraser.
1989
1990         * UIProcess/API/Cocoa/WKPreferences.mm:
1991         (-[WKPreferences init]):
1992         Make the NSUserDefaults key prefix for debug preferences (the only ones read
1993         from NSUserDefaults) "WebKitDebug" instead of just "WebKit" so that they
1994         don't conflict with the names that WebKit1 registers default values for.
1995
1996 2016-03-23  Carlos Garcia Campos  <cgarcia@igalia.com>
1997
1998         Use Region instead of IntRect in PageClient and WebPageProxy setViewNeedsDisplay method
1999         https://bugs.webkit.org/show_bug.cgi?id=155747
2000
2001         Reviewed by Darin Adler.
2002
2003         This way instead of calling setViewNeedsDisplay() for every
2004         rectangle in the damage area, we can build a region and call
2005         setViewNeedsDisplay() once. GTK+ has API to queue a redraw for a
2006         given region, so we also avoid scheduling multiple redraws in GTK+
2007         port.
2008
2009         * UIProcess/API/gtk/PageClientImpl.cpp:
2010         (WebKit::PageClientImpl::setViewNeedsDisplay): Convert the Region
2011         into a cairo_region_t and use gtk_widget_queue_draw_region()
2012         instyead of gtk_widget_queue_draw_area().
2013         * UIProcess/API/gtk/PageClientImpl.h:
2014         * UIProcess/DrawingAreaProxyImpl.cpp:
2015         (WebKit::DrawingAreaProxyImpl::incorporateUpdate): Build a Region
2016         with the damage rectangles and call
2017         WebPageProxy::setViewNeedsDisplay() once.
2018         * UIProcess/PageClient.h:
2019         * UIProcess/WebPageProxy.cpp:
2020         (WebKit::WebPageProxy::setViewNeedsDisplay):
2021         * UIProcess/WebPageProxy.h:
2022         * UIProcess/efl/WebView.cpp:
2023         (WebKit::WebView::setViewNeedsDisplay):
2024         * UIProcess/efl/WebView.h:
2025         * UIProcess/ios/PageClientImplIOS.h:
2026         * UIProcess/ios/PageClientImplIOS.mm:
2027         (WebKit::PageClientImpl::setViewNeedsDisplay):
2028         * UIProcess/mac/PageClientImpl.h:
2029         * UIProcess/mac/PageClientImpl.mm:
2030         (WebKit::PageClientImpl::setViewNeedsDisplay):
2031
2032 2016-03-22  Tim Horton  <timothy_horton@apple.com>
2033
2034         Invoking a link preview on a complex link (e.g. an image) results in an empty TextIndicator
2035         https://bugs.webkit.org/show_bug.cgi?id=155779
2036         <rdar://problem/22408793>
2037
2038         Reviewed by Simon Fraser.
2039
2040         * WebProcess/WebPage/mac/WebPageMac.mm:
2041         (WebKit::WebPage::dictionaryPopupInfoForRange):
2042         (WebKit::WebPage::performImmediateActionHitTestAtLocation):
2043         Use the TextIndicator mode where we give up on selection-only snapshotting
2044         and just paint all content on Mac, similar to what we do for 3D Touch indicators.
2045
2046 2016-03-22  Alex Christensen  <achristensen@webkit.org>
2047
2048         Fix HTTPS on Mac using NSURLSession after r198457
2049         https://bugs.webkit.org/show_bug.cgi?id=155774
2050         <rdar://problem/25301027>
2051
2052         Reviewed by Anders Carlsson.
2053
2054         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
2055         (WebKit::NetworkSession::NetworkSession):
2056         r198457 was intended to fix an issue on iOS and have no change in behavior on Mac.
2057         It did have a subtle change in behavior, setting the source application bundle identifier
2058         on iOS and was causing problems with HTTPS connections using NSURLSession, so this patch
2059         reverts that change.
2060
2061 2016-03-22  Beth Dakin  <bdakin@apple.com>
2062
2063         Advanced spell checking should be guarded behind 
2064         HAVE(ADVANCED_SPELL_CHECKING)
2065         https://bugs.webkit.org/show_bug.cgi?id=155738
2066
2067         Reviewed by Geoff Garen.
2068
2069         * UIProcess/Cocoa/WebViewImpl.mm:
2070         (WebKit::WebViewImpl::requestCandidatesForSelectionIfNeeded):
2071         (WebKit::WebViewImpl::handleRequestedCandidates):
2072         (WebKit::WebViewImpl::insertText):
2073         * UIProcess/mac/TextCheckerMac.mm:
2074         (WebKit::TextChecker::checkTextOfParagraph):
2075         (WebKit::TextChecker::getGuessesForWord):
2076         * config.h:
2077
2078 2016-03-22  Chris Dumez  <cdumez@apple.com>
2079
2080         Add a setting to let the client toggle support for network cache speculative validation
2081         https://bugs.webkit.org/show_bug.cgi?id=155622
2082         <rdar://problem/25233209>
2083
2084         Reviewed by Antti Koivisto.
2085
2086         Copy new m_diskCacheSpeculativeValidationEnabled member introduced
2087         in r198470 in ProcessPoolConfiguration::copy().
2088
2089         * UIProcess/API/APIProcessPoolConfiguration.cpp:
2090         (API::ProcessPoolConfiguration::copy):
2091
2092 2016-03-22  Carlos Garcia Campos  <cgarcia@igalia.com>
2093
2094         [GTK] WebInspector broken after r197620
2095         https://bugs.webkit.org/show_bug.cgi?id=155497
2096         <rdar://problem/25171910>
2097
2098         Reviewed by Philippe Normand.
2099
2100         Stop registering resource:// URLs as local, because they are not
2101         like a local file at all. Compare also the URL protocols when
2102         checking whether requested URL is main or test inspector page
2103         instead of checking that the protocol is registered as local.
2104
2105         * UIProcess/WebInspectorProxy.cpp:
2106         (WebKit::isMainOrTestInspectorPage): Compare also the URL protocols.
2107         * UIProcess/WebInspectorProxy.h:
2108         * UIProcess/gtk/WebInspectorProxyGtk.cpp:
2109         (WebKit::WebInspectorProxy::platformCreateInspectorPage): Do not
2110         set setAllowFileAccessFromFileURLs setting to true.
2111         * UIProcess/gtk/WebProcessPoolGtk.cpp:
2112         (WebKit::WebProcessPool::platformInitializeWebProcess): Do not
2113         register resource:// URLS as local.
2114
2115 2016-03-22  Alberto Garcia  <berto@igalia.com>
2116
2117         Unreviewed typo fixes.
2118
2119         * Shared/linux/WebMemorySamplerLinux.cpp:
2120         (WebKit::WebMemorySampler::sampleWebKit): "Commited" => "Committed"
2121         * UIProcess/API/gtk/WebKitFileChooserRequest.cpp:
2122         (webkit_file_chooser_request_select_files): "choosen" => "chosen"
2123         * UIProcess/API/gtk/WebKitUserMediaPermissionRequest.cpp:
2124         (webkit_user_media_permission_request_class_init): "Wether" => "Whether"
2125
2126 2016-03-22  Carlos Garcia Campos  <cgarcia@igalia.com>
2127
2128         Remove unused display and scroll view methods from PageClient and WebPageProxy
2129         https://bugs.webkit.org/show_bug.cgi?id=155744
2130
2131         Reviewed by Andreas Kling.
2132
2133         We have displayView(), canScrollView() and scrollView() that are
2134         used by DrawingAreaProxyImpl which is only used by GTK+ port that
2135         doesn't implement those methods.
2136
2137         * UIProcess/API/gtk/PageClientImpl.cpp:
2138         (WebKit::PageClientImpl::displayView): Deleted.
2139         (WebKit::PageClientImpl::scrollView): Deleted.
2140         * UIProcess/API/gtk/PageClientImpl.h:
2141         * UIProcess/DrawingAreaProxyImpl.cpp:
2142         (WebKit::DrawingAreaProxyImpl::incorporateUpdate): Update the
2143         whole view when scrolling, or the damage area otherwise.
2144         * UIProcess/PageClient.h:
2145         * UIProcess/WebPageProxy.cpp:
2146         (WebKit::WebPageProxy::displayView): Deleted.
2147         (WebKit::WebPageProxy::canScrollView): Deleted.
2148         (WebKit::WebPageProxy::scrollView): Deleted.
2149         * UIProcess/WebPageProxy.h:
2150         * UIProcess/efl/WebView.cpp:
2151         (WebKit::WebView::displayView): Deleted.
2152         (WebKit::WebView::scrollView): Deleted.
2153         * UIProcess/efl/WebView.h:
2154         * UIProcess/ios/PageClientImplIOS.h:
2155         * UIProcess/ios/PageClientImplIOS.mm:
2156         (WebKit::PageClientImpl::displayView): Deleted.
2157         (WebKit::PageClientImpl::canScrollView): Deleted.
2158         (WebKit::PageClientImpl::scrollView): Deleted.
2159         * UIProcess/mac/PageClientImpl.h:
2160         * UIProcess/mac/PageClientImpl.mm:
2161         (WebKit::PageClientImpl::displayView): Deleted.
2162         (WebKit::PageClientImpl::canScrollView): Deleted.
2163         (WebKit::PageClientImpl::scrollView): Deleted.
2164
2165 2016-03-22  Zan Dobersek  <zdobersek@igalia.com>
2166
2167         [CoordinatedGraphics] Polish std::function<> usage in ThreadedCompositor, CoordinatedGraphicsScene
2168         https://bugs.webkit.org/show_bug.cgi?id=155726
2169
2170         Reviewed by Darin Adler.
2171
2172         Adjust the methods in ThreadedCompositor and CoordinatedGraphicsScene
2173         classes to accept std::function<> arguments via rvalue references. This
2174         should prevent both unnecessary copies and moves.
2175
2176         Fix lambda expressions that are most commonly used to construct the
2177         std::function<> objects so that they don't capture-by-value by default,
2178         but instead list the captured values verbosely. This part alone exposed
2179         an issue in ThreadedCompositor::didChangeVisibleRect() where we were
2180         capturing the `this' value by default, instead of a protector RefPtr.
2181
2182         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
2183         (WebKit::CoordinatedGraphicsScene::dispatchOnMainThread):
2184         (WebKit::CoordinatedGraphicsScene::dispatchOnClientRunLoop):
2185         (WebKit::CoordinatedGraphicsScene::paintToCurrentGLContext):
2186         (WebKit::CoordinatedGraphicsScene::onNewBufferAvailable):
2187         (WebKit::CoordinatedGraphicsScene::commitSceneState):
2188         (WebKit::CoordinatedGraphicsScene::purgeGLResources):
2189         (WebKit::CoordinatedGraphicsScene::commitScrollOffset):
2190         (WebKit::CoordinatedGraphicsScene::appendUpdate):
2191         (WebKit::CoordinatedGraphicsScene::setActive):
2192         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h:
2193         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
2194         (WebKit::CompositingRunLoop::CompositingRunLoop):
2195         (WebKit::CompositingRunLoop::callOnCompositingRunLoop):
2196         (WebKit::ThreadedCompositor::setNeedsDisplay):
2197         (WebKit::ThreadedCompositor::setNativeSurfaceHandleForCompositing):
2198         (WebKit::ThreadedCompositor::setDeviceScaleFactor):
2199         (WebKit::ThreadedCompositor::didChangeViewportSize):
2200         (WebKit::ThreadedCompositor::didChangeViewportAttribute):
2201         (WebKit::ThreadedCompositor::didChangeContentsSize):
2202         (WebKit::ThreadedCompositor::scrollTo):
2203         (WebKit::ThreadedCompositor::scrollBy):
2204         (WebKit::ThreadedCompositor::didChangeVisibleRect):
2205         (WebKit::ThreadedCompositor::callOnCompositingThread):
2206         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:
2207
2208 2016-03-22  Zan Dobersek  <zdobersek@igalia.com>
2209
2210         [CoordinatedGraphics] Prefer RunLoop::main().dispatch() over callOnMainThread()
2211         https://bugs.webkit.org/show_bug.cgi?id=155725
2212
2213         Reviewed by Darin Adler.
2214
2215         Unify the CoordinatedGraphics code in the WebKit2 layer to use RunLoop
2216         for dispatching tasks on either the main thread or the composition thread
2217         in case of using the threaded compositor. The latter is already the default,
2218         so this patch just replaces calls to callOnMainThread() with calls to
2219         RunLoop::main().dispatch().
2220
2221         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
2222         (WebKit::CoordinatedGraphicsScene::dispatchOnMainThread):
2223         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
2224         (WebKit::ThreadedCompositor::didChangeVisibleRect):
2225
2226 2016-03-18  Enrica Casucci  <enrica@apple.com>
2227
2228         Enable preview of images as attachments.
2229         https://bugs.webkit.org/show_bug.cgi?id=155674
2230         rdar://problem/25242656
2231
2232         Reviewed by Darin Adler.
2233
2234         If the client cannot handle image preview, but can handle attachments,
2235         let them handle images as attachments.
2236
2237         * UIProcess/ios/WKContentViewInteraction.mm:
2238         (-[WKContentView _dataForPreviewItemController:atPosition:type:]):
2239
2240 2016-03-20  Dan Bernstein  <mitz@apple.com>
2241
2242         [Mac] Determine TARGET_MAC_OS_X_VERSION_MAJOR from MACOSX_DEPLOYMENT_TARGET rather than from MAC_OS_X_VERSION_MAJOR
2243         https://bugs.webkit.org/show_bug.cgi?id=155707
2244         <rdar://problem/24980691>
2245
2246         Reviewed by Darin Adler.
2247
2248         * Configurations/Base.xcconfig: Set TARGET_MAC_OS_X_VERSION_MAJOR based on the last
2249           component of MACOSX_DEPLOYMENT_TARGET.
2250         * Configurations/DebugRelease.xcconfig: For engineering builds, preserve the behavior of
2251           TARGET_MAC_OS_X_VERSION_MAJOR being the host’s OS version.
2252
2253 2016-03-20  Darin Adler  <darin@apple.com>
2254
2255         Disable Caches in Safari's Develop menu does not disable caches.
2256         https://bugs.webkit.org/show_bug.cgi?id=64483
2257
2258         Reviewed by Antti Koivisto.
2259
2260         Moved functions from WKPreferences to WKPage.
2261
2262         * Shared/WebPreferencesDefinitions.h: Removed ResourceCachingDisabled.
2263
2264         * UIProcess/API/C/WKPage.cpp:
2265         (WKPageGetResourceCachingDisabled): Added.
2266         (WKPageSetResourceCachingDisabled): Added.
2267         * UIProcess/API/C/WKPagePrivate.h: Added above functions.
2268         * UIProcess/API/C/WKPreferences.cpp:
2269         (WKPreferencesSetResourceCachingDisabled): Deleted.
2270         (WKPreferencesGetResourceCachingDisabled): Deleted.
2271         * UIProcess/API/C/WKPreferencesRefPrivate.h: Deleted above functions.
2272
2273         * UIProcess/WebPageProxy.cpp:
2274         (WebKit::WebPageProxy::setResourceCachingDisabled): Added.
2275         * UIProcess/WebPageProxy.h:
2276         (WebKit::WebPageProxy::isResourceCachingDisabled): Added.
2277
2278         * WebProcess/WebPage/WebPage.cpp:
2279         (WebKit::WebPage::updatePreferences): Removed code to set the setting
2280         for resourceCachingDisabled..
2281         (WebKit::WebPage::setResourceCachingDisabled): Added.
2282         * WebProcess/WebPage/WebPage.h: Declared setResourceCachingDisabled.
2283         * WebProcess/WebPage/WebPage.messages.in: Added SetResourceCachingDisabled.
2284
2285 2016-03-20  Dan Bernstein  <mitz@apple.com>
2286
2287         Update build settings
2288
2289         Rubber-stamped by Andy Estes.
2290
2291         * Configurations/DebugRelease.xcconfig:
2292         * Configurations/FeatureDefines.xcconfig:
2293         * Configurations/Version.xcconfig:
2294
2295 2016-03-19  Chris Dumez  <cdumez@apple.com>
2296
2297         Add a setting to let the client toggle support for network cache speculative validation
2298         https://bugs.webkit.org/show_bug.cgi?id=155622
2299         <rdar://problem/25233209>
2300
2301         Reviewed by Darin Adler.
2302
2303         Add SPI to toggle support for network cache speculative validation.
2304         Enable network cache speculative validation by default for now, until
2305         I have a chance to update the clients to use the new SPI.
2306
2307         * UIProcess/API/APIProcessPoolConfiguration.h:
2308         * UIProcess/API/C/WKContext.cpp:
2309         (WKContextSetDiskCacheSpeculativeValidationEnabled):
2310         * UIProcess/API/C/WKContextPrivate.h:
2311         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
2312         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
2313         (-[_WKProcessPoolConfiguration diskCacheSpeculativeValidationEnabled]):
2314         (-[_WKProcessPoolConfiguration setDiskCacheSpeculativeValidationEnabled:]):
2315         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
2316         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
2317
2318 2016-03-19  Yongjun Zhang  <yongjun_zhang@apple.com>
2319
2320         https://bugs.webkit.org/show_bug.cgi?id=155664
2321         Consider to cap the size of session history data.
2322
2323         In iOS, if the total history entries data exceeds a threshold (2MB at the moment), don't
2324         accumulate more data into the session state blob.
2325
2326         Reviewed by Darin Adler.
2327
2328         * UIProcess/mac/LegacySessionStateCoding.cpp:
2329         (WebKit::encodeSessionHistory): Stop encoding further history entries data into session state
2330             if the total size exceed 2MB in iOS.
2331
2332 2016-03-18  Alex Christensen  <achristensen@webkit.org>
2333
2334         Give NSURLSessionConfiguration information about parent process
2335         https://bugs.webkit.org/show_bug.cgi?id=155661
2336         rdar://problem/25225850
2337
2338         Reviewed by Anders Carlsson.
2339
2340         * NetworkProcess/NetworkProcess.cpp:
2341         (WebKit::NetworkProcess::initializeNetworkProcess):
2342         * NetworkProcess/NetworkProcess.h:
2343         * NetworkProcess/NetworkSession.h:
2344         (WebKit::NetworkSession::sessionID):
2345         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
2346         (WebKit::partitionName):
2347         (WebKit::NetworkProcess::sourceApplicationAuditData):
2348         (WebKit::NetworkProcess::cfURLCacheOrigins):
2349         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
2350         (WebKit::globalCustomProtocolManager):
2351         (WebKit::globalSourceApplicationAuditTokenData):
2352         (WebKit::NetworkSession::setCustomProtocolManager):
2353         (WebKit::NetworkSession::setSourceApplicationAuditTokenData):
2354         (WebKit::NetworkSession::defaultSession):
2355         (WebKit::NetworkSession::NetworkSession):
2356         Tell the NSURLSessionConfiguration what the source application bundle identifier
2357         and audit token data are so we can correctly keep track of which application is using data.
2358         This also gives CFNetwork enough information to determine if the application is allowed to
2359         use cell data in Settings, so it seems like we do not need to explicitly set allowsCellularAccess.
2360         * NetworkProcess/mac/RemoteNetworkingContext.mm:
2361         (WebKit::RemoteNetworkingContext::sourceApplicationAuditData):
2362         (WebKit::RemoteNetworkingContext::sourceApplicationIdentifier):
2363         * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm:
2364         (WebKit::WebFrameNetworkingContext::sourceApplicationAuditData):
2365         (WebKit::WebFrameNetworkingContext::sourceApplicationIdentifier):
2366         * WebProcess/WebProcess.cpp:
2367         (WebKit::WebProcess::initializeWebProcess):
2368         * WebProcess/WebProcess.h:
2369         * WebProcess/cocoa/WebProcessCocoa.mm:
2370         (WebKit::WebProcess::platformTerminate):
2371         (WebKit::WebProcess::sourceApplicationAuditData):
2372         (WebKit::WebProcess::initializeSandbox):
2373         I moved the calls to getAuditToken from RemoteNetworkingContext.mm and WebFrameNetworkingContext.mm 
2374         to NetworkProcessCocoa.mm and WebProcessCocoa.mm, respectively, to share with NetworkSession code, 
2375         which does not use NetworkingContexts.
2376
2377 2016-03-18  Simon Fraser  <simon.fraser@apple.com>
2378
2379         Build fix after r198455.
2380
2381         * UIProcess/WebPageProxy.cpp:
2382         (WebKit::WebPageProxy::layerTreeCommitComplete):
2383
2384 2016-03-18  Simon Fraser  <simon.fraser@apple.com>
2385
2386         Sideways-scrollable RTL document has wrong initial and reload offset in WKWebView
2387         https://bugs.webkit.org/show_bug.cgi?id=155660
2388
2389         Reviewed by Tim Horton.
2390
2391         There were two problems with the scroll position of RTL documents on initial and reload
2392         in WKWebView.
2393
2394         First, in the delegatesScrolling() code path, ScrollView::updateScrollbars() needs to
2395         tell someone that the scroll origin changed, to trigger a scroll to the page origin.
2396
2397         Secondly, WKWebView had scrollPosition/scrollOffset confusion in various places. In
2398         the restorePageState() code path, WebCore passes an exposedRect; this patch makes
2399         it explicit that it's an exposedContentRect, and passes scrollOrigin so that it can
2400         be mapped into scrollOffset-relative coordinates that the UIScrollView wants.
2401
2402         When reloading an RTL page, there was an additional issue; restorePageState()
2403         restored the exposedRect, but then we'd see the origin change as a programmatic scroll
2404         to 0,0, clobbering the exposedRect. Fix by using a "_commitDidRestoreExposedRect" flag
2405         on the WKWebView that is used to ignore the programmatic scroll in that case.
2406
2407         Ideally these changes would fix fast/scrolling/scroll-position-on-reload-rtl.html, but the
2408         test still fails because of timing differences between OS X and iOS.
2409
2410         * UIProcess/API/Cocoa/WKWebView.mm:
2411         (-[WKWebView _didCommitLayerTree:]):
2412         (-[WKWebView _layerTreeCommitComplete]):
2413         (-[WKWebView _restorePageStateToExposedRect:scrollOrigin:scale:]):
2414         (-[WKWebView _scrollToContentScrollPosition:scrollOrigin:]):
2415         (-[WKWebView _restorePageStateToExposedRect:scale:]): Deleted.
2416         (-[WKWebView _scrollToContentOffset:scrollOrigin:]): Deleted.
2417         * UIProcess/API/Cocoa/WKWebViewInternal.h:
2418         * UIProcess/PageClient.h:
2419         * UIProcess/WebPageProxy.h:
2420         * UIProcess/WebPageProxy.messages.in:
2421         * UIProcess/ios/PageClientImplIOS.h:
2422         * UIProcess/ios/PageClientImplIOS.mm:
2423         (WebKit::PageClientImpl::requestScroll):
2424         (WebKit::PageClientImpl::layerTreeCommitComplete):
2425         (WebKit::PageClientImpl::restorePageState):
2426         * UIProcess/ios/WKContentView.h:
2427         * UIProcess/ios/WKContentView.mm:
2428         (-[WKContentView _layerTreeCommitComplete]):
2429         * UIProcess/ios/WebPageProxyIOS.mm:
2430         (WebKit::WebPageProxy::layerTreeCommitComplete):
2431         (WebKit::WebPageProxy::restorePageState):
2432         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
2433         (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
2434         * WebProcess/WebPage/ios/WebPageIOS.mm:
2435         (WebKit::WebPage::restorePageState):
2436
2437 2016-03-18  Brady Eidson  <beidson@apple.com>
2438
2439         NSURLSession: Set download resume data when a download fails due to an error.
2440         https://bugs.webkit.org/show_bug.cgi?id=155665
2441
2442         Reviewed by Alex Christensen.
2443
2444         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
2445         (-[WKNetworkSessionDelegate URLSession:task:didCompleteWithError:]): Save the resume data from the
2446           NSError userInfo if it exists.
2447
2448 2016-03-18  Chris Dumez  <cdumez@apple.com>
2449
2450         Speculative revalidation requests do not have their HTTP user-agent set
2451         https://bugs.webkit.org/show_bug.cgi?id=155620
2452         <rdar://problem/24657567>
2453
2454         Reviewed by Brady Eidson.
2455
2456         Speculative revalidation requests do not have their HTTP user-agent set
2457         which could lead to different content getting returned by the server.
2458
2459         To address the problem, we save the original request's 'user-agent' in
2460         the disk cache and re-use it later on for speculative validation
2461         requests.
2462
2463         * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
2464         (WebKit::NetworkCache::constructRevalidationRequest):
2465         (WebKit::NetworkCache::SpeculativeLoadManager::revalidateEntry):
2466         (WebKit::NetworkCache::SpeculativeLoadManager::preloadEntry):
2467         * NetworkProcess/cache/NetworkCacheSubresourcesEntry.cpp:
2468         (WebKit::NetworkCache::SubresourceInfo::encode):
2469         (WebKit::NetworkCache::SubresourceInfo::decode):
2470         (WebKit::NetworkCache::SubresourceInfo::SubresourceInfo):
2471         (WebKit::NetworkCache::SubresourceInfo::operator=):
2472         (WebKit::NetworkCache::SubresourcesEntry::SubresourcesEntry):
2473         (WebKit::NetworkCache::SubresourcesEntry::updateSubresourceLoads):
2474         (WebKit::NetworkCache::SubresourcesEntry::decodeStorageRecord): Deleted.
2475         * NetworkProcess/cache/NetworkCacheSubresourcesEntry.h:
2476         (WebKit::NetworkCache::SubresourceInfo::SubresourceInfo):
2477
2478 2016-03-18  Enrica Casucci  <enrica@apple.com>
2479
2480         Add id attribute to _WKActivatedElementInfo.
2481         https://bugs.webkit.org/show_bug.cgi?id=155666
2482         rdar://problem/25181956
2483
2484         Reviewed by Beth Dakin.
2485
2486         * Shared/ios/InteractionInformationAtPosition.h:
2487         * Shared/ios/InteractionInformationAtPosition.mm:
2488         (WebKit::InteractionInformationAtPosition::encode):
2489         (WebKit::InteractionInformationAtPosition::decode):
2490         * UIProcess/API/Cocoa/_WKActivatedElementInfo.h:
2491         * UIProcess/API/Cocoa/_WKActivatedElementInfo.mm:
2492         (-[_WKActivatedElementInfo _initWithType:URL:location:title:ID:rect:image:]):
2493         (-[_WKActivatedElementInfo ID]):
2494         (-[_WKActivatedElementInfo _initWithType:URL:location:title:rect:image:]): Deleted.
2495         * UIProcess/API/Cocoa/_WKActivatedElementInfoInternal.h:
2496         * UIProcess/ios/WKActionSheetAssistant.mm:
2497         (-[WKActionSheetAssistant showImageSheet]):
2498         (-[WKActionSheetAssistant showLinkSheet]):
2499         * UIProcess/ios/WKContentViewInteraction.mm:
2500         (-[WKContentView _showAttachmentSheet]):
2501         (-[WKContentView _showLinkSheet]):
2502         (-[WKContentView _dataForPreviewItemController:atPosition:type:]):
2503         (-[WKContentView _presentedViewControllerForPreviewItemController:]):
2504         * WebProcess/WebPage/ios/WebPageIOS.mm:
2505         (WebKit::WebPage::getPositionInformation):
2506
2507 2016-03-18  Antti Koivisto  <antti@apple.com>
2508
2509         Protect against excessive cache traversal
2510         https://bugs.webkit.org/show_bug.cgi?id=155635
2511         rdar://problem/24241008
2512
2513         Reviewed by Darin Adler.
2514
2515         We can't handle unlimited number of parallel cache traversal requests from the client.
2516         We'll run out of dispatch queues and other system resources. CPU will spin.
2517
2518         * NetworkProcess/cache/NetworkCache.cpp:
2519         (WebKit::NetworkCache::Cache::traverse):
2520
2521             Add limit of maximum 3 traversals. When exceeded return nothing and log an error.
2522
2523         * NetworkProcess/cache/NetworkCache.h:
2524
2525 2016-03-18  Darin Adler  <darin@apple.com>
2526
2527         Disable Caches in Safari's Develop menu does not disable caches.
2528         https://bugs.webkit.org/show_bug.cgi?id=64483
2529
2530         Reviewed by Antti Koivisto.
2531
2532         * Shared/WebPreferencesDefinitions.h: Added ResourceCachingDisabled.
2533         * UIProcess/API/C/WKPreferences.cpp:
2534         (WKPreferencesSetResourceCachingDisabled): Added.
2535         (WKPreferencesGetResourceCachingDisabled): Added.
2536         * UIProcess/API/C/WKPreferencesRefPrivate.h: Ditto.
2537         * WebProcess/WebPage/WebPage.cpp:
2538         (WebKit::WebPage::updatePreferences): Push ResourceCachingDisabled setting
2539         into WebCore.
2540
2541 2016-03-18  Carlos Garcia Campos  <cgarcia@igalia.com>
2542
2543         Unreviewed. Try to fix GTK+ debug build after r198364.
2544
2545         * WebProcess/gtk/WebProcessMainGtk.cpp: Use WTF::sleep().
2546
2547 2016-03-17  Alex Christensen  <achristensen@webkit.org>
2548
2549         SpeculativeLoad needs to continue NetworkLoad when it receives a redirect response
2550         https://bugs.webkit.org/show_bug.cgi?id=155612
2551
2552         Reviewed by Andy Estes.
2553
2554         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
2555         (WebKit::NetworkCache::SpeculativeLoad::willSendRedirectedRequest):
2556         Call continueWillSendRequest.  Otherwise, we will hang a thread in the NetworkProcess
2557         if we are using ResourceHandle or we will not call the willPerformHTTPRedirection 
2558         completion handler if we are using NetworkSession.  This will cause us to stop loading
2559         from the server after the maximum number of connections is reached.
2560
2561 2016-03-17  Tim Horton  <timothy_horton@apple.com>
2562
2563         Find-in-page indicator in Mail viewer is the wrong scale and cut off
2564         https://bugs.webkit.org/show_bug.cgi?id=155605
2565         <rdar://problem/23948165>
2566
2567         Reviewed by Simon Fraser.
2568
2569         * UIProcess/mac/WKTextFinderClient.mm:
2570         (-[WKTextFinderClient didGetImageForMatchResult:]):
2571         Initialize the NSImage with the correct size, instead of inferring the
2572         size from the bitmap, so that we don't lose information about device pixel ratio.
2573
2574 2016-03-17  Anders Carlsson  <andersca@apple.com>
2575
2576         Remove use of dyld_register_image_state_change_handler() in PluginProcessMac.mm
2577         https://bugs.webkit.org/show_bug.cgi?id=155596
2578
2579         Reviewed by Dan Bernstein.
2580
2581         Use _dyld_register_func_for_add_image instead which is API. Use dladdr to find the image path given its header.
2582
2583         * Platform/spi/Cocoa/DyldSPI.h: Removed.
2584         * PluginProcess/mac/PluginProcessMac.mm:
2585         (WebKit::PluginProcess::platformInitializeProcess):
2586         * WebKit2.xcodeproj/project.pbxproj:
2587
2588 2016-03-17  Chris Dumez  <cdumez@apple.com>
2589
2590         Set the WebContent process's main thread QoS to USER-INTERACTIVE
2591         https://bugs.webkit.org/show_bug.cgi?id=155595
2592         <rdar://problem/22534965>
2593
2594         Reviewed by Antti Koivisto.
2595
2596         Increase the WebContent process main thread's QoS to USER-INTERACTIVE
2597         instead of USER-INITIATED as it is drawing UI. However, use a relative
2598         priority of -1 so that its priority is lower than the one of the
2599         scrolling thread.
2600
2601         * WebProcess/WebProcess.cpp:
2602         (WebKit::WebProcess::initializeWebProcess):
2603
2604 2016-03-17  Alex Christensen  <achristensen@webkit.org>
2605
2606         Support manually accepting invalid SSL certificates with NetworkSession
2607         https://bugs.webkit.org/show_bug.cgi?id=155442
2608         <rdar://problem/24847398>
2609
2610         Reviewed by Darin Adler.
2611
2612         When we click continue after getting a warning about an invalid SSL certificate, we call
2613         NSURLRequest setAllowsSpecificHTTPSCertificate in NetworkProcess::allowSpecificHTTPSCertificateForHost,
2614         which stores information in CFNetwork about the specific invalid SSL certificate we want to accept.
2615         If we see such a certificate during a server trust evaluation, we want to tell CFNetwork to accept it.
2616         This fixes a loop when going to https://badssl.com, clicking on expired, and clicking continue.
2617
2618         * NetworkProcess/NetworkDataTask.h:
2619         * NetworkProcess/NetworkLoad.cpp:
2620         (WebKit::NetworkLoad::didReceiveChallenge):
2621         (WebKit::NetworkLoad::continueCanAuthenticateAgainstProtectionSpace):
2622         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
2623         (WebKit::NetworkDataTask::transferSandboxExtensionToDownload):
2624         (WebKit::certificatesMatch):
2625         (WebKit::NetworkDataTask::allowsSpecificHTTPSCertificateForHost):
2626         (WebKit::NetworkDataTask::suggestedFilename):
2627
2628 2016-03-17  Csaba Osztrogonác  <ossy@webkit.org>
2629
2630         [Mac][cmake] Unreviewed buildfix after r198070. Just for fun.
2631
2632         * PlatformMac.cmake:
2633
2634 2016-03-17  Andy Estes  <aestes@apple.com>
2635
2636         [Mac] Enable Content-Disposition: attachment sandbox
2637         https://bugs.webkit.org/show_bug.cgi?id=155578
2638         <rdar://problem/21886326>
2639
2640         Reviewed by Dan Bernstein.
2641
2642         Covered by the existing set of attachment sandbox tests, which have always been run on Mac.
2643
2644         * WebProcess/WebPage/WebPage.cpp:
2645         (WebKit::WebPage::WebPage):
2646
2647 2016-03-16  Beth Dakin  <bdakin@apple.com>
2648
2649         Provide NSSpellChecker spellChecking methods with the current insertion point
2650         https://bugs.webkit.org/show_bug.cgi?id=155532
2651         -and corresponding-
2652         rdar://problem/24066952
2653
2654         Reviewed by Simon Fraser.
2655
2656         Pass the insertionPoint to the UIProcess
2657         * UIProcess/TextChecker.h:
2658         * UIProcess/WebPageProxy.cpp:
2659         (WebKit::WebPageProxy::checkTextOfParagraph):
2660         (WebKit::WebPageProxy::getGuessesForWord):
2661         (WebKit::WebPageProxy::requestCheckingOfString):
2662         * UIProcess/WebPageProxy.h:
2663         * UIProcess/WebPageProxy.messages.in:
2664         * UIProcess/efl/TextCheckerEfl.cpp:
2665         (WebKit::TextChecker::checkTextOfParagraph):
2666         (WebKit::TextChecker::getGuessesForWord):
2667         (WebKit::TextChecker::requestCheckingOfString):
2668         * UIProcess/gtk/TextCheckerGtk.cpp:
2669         (WebKit::TextChecker::getGuessesForWord):
2670         (WebKit::TextChecker::requestCheckingOfString):
2671         (WebKit::TextChecker::checkTextOfParagraph):
2672         * UIProcess/ios/TextCheckerIOS.mm:
2673         (WebKit::TextChecker::checkTextOfParagraph):
2674         (WebKit::TextChecker::getGuessesForWord):
2675         (WebKit::TextChecker::requestCheckingOfString):
2676         * UIProcess/mac/TextCheckerMac.mm:
2677         (WebKit::TextChecker::checkTextOfParagraph):
2678         (WebKit::TextChecker::getGuessesForWord):
2679         (WebKit::TextChecker::ignoreWord):
2680         (WebKit::TextChecker::requestCheckingOfString):
2681
2682         Extract the insertion point from the VisibleSelection that WebCore has 
2683         passed. 
2684         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
2685         (WebKit::insertionPointFromCurrentSelection):
2686         (WebKit::WebEditorClient::checkTextOfParagraph):
2687         (WebKit::WebEditorClient::getGuessesForWord):
2688         (WebKit::WebEditorClient::requestCheckingOfString):
2689         * WebProcess/WebCoreSupport/WebEditorClient.h:
2690
2691 2016-03-16  Tim Horton  <timothy_horton@apple.com>
2692
2693         REGRESSION (r192184): CleanMyDrive 2's tutorial window is blank
2694         https://bugs.webkit.org/show_bug.cgi?id=155550
2695         <rdar://problem/24250689>
2696
2697         Reviewed by Dan Bernstein.
2698
2699         * UIProcess/API/Cocoa/WKWebView.mm:
2700         (-[WKWebView _setDrawsTransparentBackground:]):
2701         The app is using this SPI via key-value coding, so just keeping the implementation
2702         is sufficient to make AppKit stop throwing an undefined key exception.
2703         Log once that this is deprecated (... it's also SPI) and then forward to setDrawsBackground.
2704
2705 2016-03-16  Daniel Bates  <dabates@apple.com>
2706
2707         <video> and <audio> elements do not obey Content Security Policy on redirect
2708         https://bugs.webkit.org/show_bug.cgi?id=155509
2709         <rdar://problem/10234844>
2710
2711         Reviewed by Alex Christensen.
2712
2713         Use 0ms as the maximum buffering time for media resource just as we do currently.
2714
2715         * WebProcess/Network/WebLoaderStrategy.cpp:
2716         (WebKit::maximumBufferingTime):
2717
2718 2016-03-16  Chris Dumez  <cdumez@apple.com>
2719
2720         Unreviewed, rolling out r198235, r198240, r198241, and
2721         r198252.
2722
2723         Causing crashes on ARM
2724
2725         Reverted changesets:
2726
2727         "Remove compile time define for SEPARATED_HEAP"
2728         https://bugs.webkit.org/show_bug.cgi?id=155508
2729         http://trac.webkit.org/changeset/198235
2730
2731         "Gardening: build fix after r198235."
2732         http://trac.webkit.org/changeset/198240
2733
2734         "Build fix."
2735         http://trac.webkit.org/changeset/198241
2736
2737         "Rename performJITMemcpy to something more inline with our
2738         normal webkit function names"
2739         https://bugs.webkit.org/show_bug.cgi?id=155525
2740         http://trac.webkit.org/changeset/198252
2741
2742 2016-03-16  Commit Queue  <commit-queue@webkit.org>
2743
2744         Unreviewed, rolling out r196803.
2745         https://bugs.webkit.org/show_bug.cgi?id=155534
2746
2747         Introduced several rendering issues in popular websites
2748         (Requested by KaL on #webkit).
2749
2750         Reverted changeset:
2751
2752         "[GTK] Limit the number of tiles according to the visible
2753         area"
2754         https://bugs.webkit.org/show_bug.cgi?id=126122
2755         http://trac.webkit.org/changeset/196803
2756
2757 2016-03-15  Enrica Casucci  <enrica@apple.com>
2758
2759         Follow up to r195769.
2760         https://bugs.webkit.org/show_bug.cgi?id=155519
2761         rdar://problem/25146483
2762
2763         Reviewed by Tim Horton.
2764
2765         There are two code paths that lead to calling handleSyntheticClick()
2766         where we need to check if the default action can be performed on the
2767         data detector link.
2768         Only one was covered in r195769 and this patch addresses the missing one.
2769         I've also discovered that the point reported in DidNotHandleTapAsClick was
2770         incorrectly always (0, 0) and I've fixed it.
2771
2772         * WebProcess/WebPage/ios/WebPageIOS.mm:
2773         (WebKit::WebPage::handleTap):
2774
2775 2016-03-15  Ryan Haddad  <ryanhaddad@apple.com>
2776
2777         Unreviewed, rolling out r198230.
2778
2779         This change caused LayoutTests to fail on Mac
2780
2781         Reverted changeset:
2782
2783         "REGRESSION (r194660): Navigating to HTTPS sites may fail with
2784         error"
2785         https://bugs.webkit.org/show_bug.cgi?id=155455
2786         http://trac.webkit.org/changeset/198230
2787
2788 2016-03-15  Oliver Hunt  <oliver@apple.com>
2789
2790         Remove compile time define for SEPARATED_HEAP
2791         https://bugs.webkit.org/show_bug.cgi?id=155508
2792
2793         Reviewed by Mark Lam.
2794
2795         Remove the feature define.
2796
2797         * Configurations/FeatureDefines.xcconfig:
2798
2799 2016-03-15  Daniel Bates  <dabates@apple.com>
2800
2801         REGRESSION (r194660): Navigating to HTTPS sites may fail with error
2802         https://bugs.webkit.org/show_bug.cgi?id=155455
2803         <rdar://problem/24308793>
2804
2805         Reviewed by Alexey Proskuryakov.
2806
2807         Fixes an issue where navigating to an HTTPS site may fail because the Security Framework uses
2808         a cache directory that it does not have permission to use.
2809
2810         * Shared/mac/ChildProcessMac.mm:
2811         (WebKit::codeSigningIdentifierForProcess): Queries the Security Framework for the code signed
2812         bundle identifier/code signing identifier.
2813         (WebKit::ChildProcess::initializeSandbox): Use the client identifier as part of the user directory
2814         suffix. Verify that the client identifier matches the code signed bundled identifier/code
2815         signing identifier for the code signed app/tool. Fix minor code style issue; use a C++-style cast
2816         instead of a C-style cast when casting an OSStatus to a long.
2817         (WebKit::findSecCodeForProcess): Deleted; incorporated logic into WebKit::codeSigningIdentifierForProcess().
2818
2819 2016-03-15  Antti Koivisto  <antti@apple.com>
2820
2821         Add Antti to WebKit2 Owners file
2822         https://bugs.webkit.org/show_bug.cgi?id=155504
2823
2824         Reviewed by Anders Carlsson and Sam Weinig.
2825
2826         * Owners:
2827
2828 2016-03-15  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
2829
2830         EFL build has been broken since r198180
2831         https://bugs.webkit.org/show_bug.cgi?id=155488
2832
2833         Unreviewed build fix.
2834
2835         * WebProcess/UserContent/WebUserContentController.h: Use ENABLE(USER_MESSAGE_HANDLERS) guard. 
2836
2837 2016-03-15  Chris Dumez  <cdumez@apple.com>
2838
2839         Regression(r197939): ASSERTION FAILED: url.containsOnlyASCII() in URL.cpp
2840         https://bugs.webkit.org/show_bug.cgi?id=155449
2841         <rdar://problem/25134826>
2842
2843         Reviewed by Carlos Garcia Campos.
2844
2845         Bump WK2 Network Disk Cache version after r197939 as the new cache format
2846         is not compatible with the old one and leads to assertions being hit when
2847         browsing in Debug builds.
2848
2849         SubresourceInfo used to only contain a boolean and would therefore be
2850         serialized as "0" / "1". However, after r197939, a URL field was added
2851         and when trying to decode old cache entries with the new format, we
2852         would try to construct a URL from the String "0" or "1". This would
2853         assert because these are not valid URLs.
2854
2855         * NetworkProcess/cache/NetworkCacheStorage.h:
2856
2857 2016-03-14  Chris Dumez  <cdumez@apple.com>
2858
2859         Unreviewed, rolling out r197981.
2860
2861         Caused a massive PLT regression on Mac.
2862
2863         Reverted changeset:
2864
2865         "Font antialiasing (smoothing) changes when elements are
2866         rendered into compositing layers"
2867         https://bugs.webkit.org/show_bug.cgi?id=23364
2868         http://trac.webkit.org/changeset/197981
2869
2870 2016-03-14  Sam Weinig  <sam@webkit.org>
2871
2872         Add a baseURL parameter to _WKUserStyleSheet
2873         https://bugs.webkit.org/show_bug.cgi?id=155219
2874
2875         Reviewed by Tim Horton.
2876
2877         - Moves to a model for user content where instead of using a WebCore::UserContentController
2878           object, we implement the new WebCore::UserContentProvider interface (on the existing 
2879           WebUserContentController object).
2880         - Uses this to maintain maps of UserStylesSheets and UserScripts along with their identifiers,
2881           freeing up the URL, which had been acting as the identifier, to be used as the baseURL which
2882           was what it was intended for.
2883         - Adds a baseURL property to _WKUserStyleSheet.
2884
2885         * WebKit2.xcodeproj/project.pbxproj:
2886         Add new files.
2887
2888         * Scripts/webkit/messages.py:
2889         (headers_for_type):
2890         Add support for sending WebUserContentControllerDataTypes.
2891
2892         * Shared/WebUserContentControllerDataTypes.cpp: Added.
2893         (WebKit::WebUserScriptData::encode):
2894         (WebKit::WebUserScriptData::decode):
2895         (WebKit::WebUserStyleSheetData::encode):
2896         (WebKit::WebUserStyleSheetData::decode):
2897         * Shared/WebUserContentControllerDataTypes.h: Added.
2898         Add helper types for sending user content over IPC.
2899
2900         * UIProcess/API/APIUserScript.cpp:
2901         (API::UserScript::generateUniqueURL):
2902         (API::UserScript::UserScript):
2903         * UIProcess/API/APIUserScript.h:
2904         * UIProcess/API/APIUserStyleSheet.cpp:
2905         (API::UserStyleSheet::generateUniqueURL):
2906         (API::UserStyleSheet::UserStyleSheet):
2907         * UIProcess/API/APIUserStyleSheet.h:
2908         Add identifiers for tracking across processes.
2909
2910         * UIProcess/API/Cocoa/_WKUserStyleSheet.h:
2911         * UIProcess/API/Cocoa/_WKUserStyleSheet.mm:
2912         (-[_WKUserStyleSheet initWithSource:forMainFrameOnly:legacyWhitelist:legacyBlacklist:baseURL:userContentWorld:]):
2913         (-[_WKUserStyleSheet baseURL]):
2914         Add new initializer which takes a baseURL as well as an accessor for the baseURL.
2915
2916         * UIProcess/UserContent/WebUserContentControllerProxy.cpp:
2917         (WebKit::WebUserContentControllerProxy::addProcess):
2918         (WebKit::WebUserContentControllerProxy::addUserScript):
2919         (WebKit::WebUserContentControllerProxy::removeUserScript):
2920         (WebKit::WebUserContentControllerProxy::addUserStyleSheet):
2921         (WebKit::WebUserContentControllerProxy::removeUserStyleSheet):
2922         Pass identifiers as well as user content.
2923
2924         * WebProcess/InjectedBundle/InjectedBundle.cpp:
2925         (WebKit::InjectedBundle::addUserScript):
2926         (WebKit::InjectedBundle::addUserStyleSheet):
2927         Move user content in via move semantics rather than using a unique_ptr.
2928
2929         (WebKit::InjectedBundle::removeUserScript):
2930         (WebKit::InjectedBundle::removeUserStyleSheet):
2931         (WebKit::InjectedBundle::removeUserScripts):
2932         (WebKit::InjectedBundle::removeUserStyleSheets):
2933         (WebKit::InjectedBundle::removeAllUserContent):
2934         Update for new function signatures.
2935
2936         * WebProcess/UserContent/WebUserContentController.cpp:
2937         (WebKit::WebUserContentController::WebUserContentController):
2938         (WebKit::WebUserContentController::~WebUserContentController):
2939         (WebKit::WebUserContentController::addUserContentWorlds):
2940         (WebKit::WebUserContentController::removeUserContentWorlds):
2941         (WebKit::WebUserContentController::addUserScripts):
2942         (WebKit::WebUserContentController::removeUserScript):
2943         (WebKit::WebUserContentController::removeAllUserScripts):
2944         (WebKit::WebUserContentController::addUserStyleSheets):
2945         (WebKit::WebUserContentController::removeUserStyleSheet):
2946         (WebKit::WebUserContentController::removeAllUserStyleSheets):
2947         (WebKit::WebUserContentController::addUserScriptMessageHandlers):
2948         (WebKit::WebUserContentController::removeUserScriptMessageHandler):
2949         (WebKit::WebUserContentController::addUserContentExtensions):
2950         (WebKit::WebUserContentController::removeUserContentExtension):
2951         (WebKit::WebUserContentController::removeAllUserContentExtensions):
2952         (WebKit::WebUserContentController::addUserScriptInternal):
2953         (WebKit::WebUserContentController::addUserScript):
2954         (WebKit::WebUserContentController::removeUserScriptWithURL):
2955         (WebKit::WebUserContentController::removeUserScriptInternal):
2956         (WebKit::WebUserContentController::removeUserScripts):
2957         (WebKit::WebUserContentController::addUserStyleSheetInternal):
2958         (WebKit::WebUserContentController::addUserStyleSheet):
2959         (WebKit::WebUserContentController::removeUserStyleSheetWithURL):
2960         (WebKit::WebUserContentController::removeUserStyleSheetInternal):
2961         (WebKit::WebUserContentController::removeUserStyleSheets):
2962         (WebKit::WebUserContentController::removeAllUserContent):
2963         (WebKit::WebUserContentController::forEachUserScript):
2964         (WebKit::WebUserContentController::forEachUserStyleSheet):
2965         * WebProcess/UserContent/WebUserContentController.h:
2966         * WebProcess/UserContent/WebUserContentController.messages.in:
2967         Convert to inheriting from UserContentProvider, rather than containing a UserContentController.
2968         This means adding the storage for the user content, which has been simplified to avoid using
2969         unique_ptrs.
2970
2971         * WebProcess/WebPage/WebPage.cpp:
2972         (WebKit::WebPage::addUserScript):
2973         (WebKit::WebPage::addUserStyleSheet):
2974         (WebKit::WebPage::removeAllUserContent):
2975         Update to call the WebUserContentController, rather than going to the UserContentController, which
2976         no longer exists.
2977
2978         * WebProcess/WebPage/WebPageGroupProxy.cpp:
2979         (WebKit::WebPageGroupProxy::userContentController):
2980         * WebProcess/WebPage/WebPageGroupProxy.h:
2981         Return the WebUserContentController rather than old UserContentController.
2982
2983 2016-03-14  Joonghun Park  <jh718.park@samsung.com>
2984
2985         Purge PassRefPtr from ArrayBuffer, ArchiveResource, Pasteboard, LegacyWebArchive and DataObjectGtk
2986         https://bugs.webkit.org/show_bug.cgi?id=150497
2987
2988         Reviewed by Darin Adler.
2989
2990         * Shared/APIWebArchive.mm:
2991         (API::WebArchive::WebArchive):
2992         * Shared/APIWebArchiveResource.mm:
2993         (API::WebArchiveResource::data):
2994         * WebProcess/Plugins/PDF/DeprecatedPDFPlugin.mm:
2995         (WebKit::PDFPlugin::addArchiveResource):
2996         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
2997         (WebKit::WebPlatformStrategies::bufferForType):
2998         (WebKit::WebPlatformStrategies::readBufferFromPasteboard):
2999         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
3000         * WebProcess/WebCoreSupport/ios/WebEditorClientIOS.mm:
3001         (WebKit::WebEditorClient::documentFragmentFromAttributedString):
3002         * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
3003         (WebKit::WebDragClient::declareAndWriteDragImage):
3004         * WebProcess/WebPage/WebFrame.cpp:
3005         (WebKit::WebFrame::webArchiveData):
3006         * WebProcess/WebPage/WebPage.cpp:
3007         (WebKit::resourceDataForFrame):
3008
3009 2016-03-14  Oliver Hunt  <oliver@apple.com>
3010
3011         Temporarily disable the separated heap.
3012         https://bugs.webkit.org/show_bug.cgi?id=155472
3013
3014         Reviewed by Geoffrey Garen.
3015
3016         Temporarily disable this.
3017
3018         * Configurations/FeatureDefines.xcconfig:
3019
3020 2016-03-14  Beth Dakin  <bdakin@apple.com>
3021
3022         [iOS] WKPreviewAction conforms to NSCopying but doesn’t override -
3023         copyWithZone:
3024         https://bugs.webkit.org/show_bug.cgi?id=155395
3025
3026         Reviewed by Sam Weinig.
3027
3028         * UIProcess/API/Cocoa/WKPreviewActionItem.mm:
3029         (-[WKPreviewAction copyWithZone:]):
3030
3031 2016-03-14  Anders Carlsson  <andersca@apple.com>
3032
3033         Remove usage of -[UIGestureRecognizer requireOtherGestureToFail:]
3034         https://bugs.webkit.org/show_bug.cgi?id=155461
3035         rdar://problem/25143282
3036
3037         Reviewed by Beth Dakin.
3038
3039         Use -[UIGestureRecognizer requireGestureRecognizerToFail:] instead, which has been API ever since UIGestureRecognizer was added.
3040
3041         * Platform/spi/ios/UIKitSPI.h:
3042         * UIProcess/ios/WKContentViewInteraction.mm:
3043         (-[WKContentView _createAndConfigureDoubleTapGestureRecognizer]):
3044
3045 2016-03-14  Anders Carlsson  <andersca@apple.com>
3046
3047         REGRESSION (r191691): Can't Share Selected Text
3048         https://bugs.webkit.org/show_bug.cgi?id=155459
3049         rdar://problem/24893625
3050
3051         Reviewed by Tim Horton.
3052
3053         Add the selected text as well. Somehow this got lost in the refactoring.
3054
3055         * UIProcess/mac/WebContextMenuProxyMac.mm:
3056         (WebKit::WebContextMenuProxyMac::createShareMenuItem):
3057
3058 2016-03-14  Tim Horton  <timothy_horton@apple.com>
3059
3060         Revert r194125 and r194186: We're going to fix this a different way.
3061
3062         * Shared/NativeWebGestureEvent.h:
3063         * Shared/mac/NativeWebGestureEventMac.mm:
3064         (WebKit::pointForEvent):
3065         (WebKit::NativeWebGestureEvent::NativeWebGestureEvent):
3066         (WebKit::distanceForTouches): Deleted.
3067         * UIProcess/API/Cocoa/WKWebView.mm:
3068         (-[WKWebView selectFindMatch:completionHandler:]):
3069         (-[WKWebView _web_superInputContext]):
3070         (-[WKWebView touchesBeganWithEvent:]): Deleted.
3071         (-[WKWebView touchesMovedWithEvent:]): Deleted.
3072         (-[WKWebView touchesEndedWithEvent:]): Deleted.
3073         (-[WKWebView touchesCancelledWithEvent:]): Deleted.
3074         * UIProcess/API/mac/WKView.mm:
3075         (-[WKView namesOfPromisedFilesDroppedAtDestination:]):
3076         (-[WKView initWithFrame:processPool:configuration:webView:]):
3077         (-[WKView touchesBeganWithEvent:]): Deleted.
3078         (-[WKView touchesMovedWithEvent:]): Deleted.
3079         (-[WKView touchesEndedWithEvent:]): Deleted.
3080         (-[WKView touchesCancelledWithEvent:]): Deleted.
3081         * UIProcess/Cocoa/WebViewImpl.h:
3082         * UIProcess/Cocoa/WebViewImpl.mm:
3083         (WebKit::WebViewImpl::WebViewImpl):
3084         (WebKit::WebViewImpl::magnifyWithEvent):
3085         (WebKit::WebViewImpl::smartMagnifyWithEvent):
3086         (WebKit::WebViewImpl::rotateWithEvent):
3087         (WebKit::WebViewImpl::touchesOrderedByAge): Deleted.
3088         (WebKit::WebViewImpl::touchesBeganWithEvent): Deleted.
3089         (WebKit::WebViewImpl::touchesMovedWithEvent): Deleted.
3090         (WebKit::WebViewImpl::touchesEndedWithEvent): Deleted.
3091         (WebKit::WebViewImpl::touchesCancelledWithEvent): Deleted.
3092
3093 2016-03-14  Anders Carlsson  <andersca@apple.com>
3094
3095         Fix build.
3096
3097         Create an empty PDF selection.
3098
3099         * Shared/mac/PDFKitImports.h:
3100         * Shared/mac/PDFKitImports.mm:
3101         (WebKit::pdfSelectionClass):
3102         * WebProcess/Plugins/PDF/DeprecatedPDFPlugin.mm:
3103         (WebKit::PDFPlugin::nextMatchForString):
3104
3105 2016-03-14  Beth Dakin  <bdakin@apple.com>
3106
3107         Unable to commit previews in Mobile Safari
3108         https://bugs.webkit.org/show_bug.cgi?id=155450
3109         -and corresponding-
3110         rdar://problem/25135529
3111
3112         Reviewed by Tim Horton.
3113
3114         _uiDelegateProvidedPreviewingViewController was being consulted before 
3115         invoking the old SPI, which was always wrong. It should have been consulted 
3116         before calling the new API! But also, it doesn’t seem to be necessary at all 
3117         since [WKContentView _previewItemController:commitPreview:] is only invoked 
3118         when a custom view controller has been provided.
3119
3120         * UIProcess/ios/WKContentViewInteraction.h:
3121         * UIProcess/ios/WKContentViewInteraction.mm:
3122         (-[WKContentView _registerPreview]):
3123         (-[WKContentView _unregisterPreview]):
3124         (-[WKContentView _interactionShouldBeginFromPreviewItemController:forPosition:]):
3125         (-[WKContentView _presentedViewControllerForPreviewItemController:]):
3126         (-[WKContentView _previewItemController:commitPreview:]):
3127
3128 2016-03-14  Brent Fulgham  <bfulgham@apple.com>
3129
3130         PingHandle delete's itself but pointer is still used by handleDataURL
3131         https://bugs.webkit.org/show_bug.cgi?id=154752
3132         <rdar://problem/24872347>
3133
3134         Reviewed by Alex Christensen.
3135
3136         When a PingLoad is destroyed, we should tell its client so that the client can clear the pointer it
3137         holds to the element to avoid accidentally attempting to use deallocated memory.
3138
3139         * NetworkProcess/PingLoad.h:
3140         (WebKit::PingLoad::~PingLoad): Notify the client we are being destroyed.
3141
3142 2016-03-14  Carlos Garcia Campos  <cgarcia@igalia.com>
3143
3144         Unreviewed. Fix the GTK+ build after r198124.
3145
3146         WebsiteDataTypes is now an OptionSet.
3147
3148         * UIProcess/API/gtk/WebKitWebContext.cpp:
3149         (webkit_web_context_clear_cache):
3150
3151 2016-03-14  Carlos Garcia Campos  <cgarcia@igalia.com>
3152
3153         [GTK] Reimplement webkit_web_context_clear_cache functionality.
3154         https://bugs.webkit.org/show_bug.cgi?id=146041
3155
3156         Reviewed by Michael Catanzaro.
3157
3158         * UIProcess/API/gtk/WebKitWebContext.cpp:
3159         (webkit_web_context_clear_cache):
3160
3161 2016-03-14  Jeremy Huddleston Sequoia  <jeremyhu@apple.com>
3162
3163         Install WebKit2 WebProcess NetworkProcess on OSX when not building the Mac PORT
3164         https://bugs.webkit.org/show_bug.cgi?id=152651
3165
3166         Reviewed by Philippe Normand.
3167
3168         * CMakeLists.txt:
3169
3170 2016-03-13  Joseph Pecoraro  <pecoraro@apple.com>
3171
3172         Remove ENABLE(ES6_TEMPLATE_LITERAL_SYNTAX) guards
3173         https://bugs.webkit.org/show_bug.cgi?id=155417
3174
3175         Reviewed by Yusuke Suzuki.
3176
3177         * Configurations/FeatureDefines.xcconfig:
3178
3179 2016-03-13  Dan Bernstein  <mitz@apple.com>
3180
3181         [Mac] Injected bundle in relocatable WebContent service can’t use XPC services from other relocatable frameworks
3182         https://bugs.webkit.org/show_bug.cgi?id=155414
3183         <rdar://problem/24428418>
3184
3185         Reviewed by Sam Weinig.
3186
3187         * Configurations/DebugRelease.xcconfig:
3188           Set WK_WEBCONTENT_SERVICE_NEEDS_XPC_DOMAIN_EXTENSION_ENTITLEMENT to NO, because
3189           engineering builds are ad-hoc signed and therefore can’t have a private entitlement.
3190
3191         * Configurations/WebContent-OSX.entitlements: Added. Includes the XPC domain extension
3192           entitlement.
3193
3194         * Configurations/WebContentService.xcconfig:
3195           Set WK_WEBCONTENT_SERVICE_NEEDS_XPC_DOMAIN_EXTENSION_ENTITLEMENT to YES if not already set
3196           and the framework is relocatable. Set CODE_SIGN_ENTITLEMENTS to the new entitlements file
3197           if the domain extension entitlement is needed.
3198
3199         * WebKit2.xcodeproj/project.pbxproj: Added reference to new file.
3200
3201 2016-03-13  Dean Jackson  <dino@apple.com>
3202
3203         <attachment> should be a runtime-enabled feature
3204         https://bugs.webkit.org/show_bug.cgi?id=155413
3205         <rdar://problem/25120753>
3206
3207         Reviewed by Sam Weinig and Anders Carlsson.
3208
3209         Add an internal setting on WKWebViewConfiguration
3210         to enable the <attachment> element support.
3211
3212         * Shared/WebPreferencesDefinitions.h:
3213         * UIProcess/API/Cocoa/WKWebView.mm:
3214         (-[WKWebView _initializeWithConfiguration:]):
3215         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
3216         (-[WKWebViewConfiguration init]):
3217         (-[WKWebViewConfiguration copyWithZone:]):
3218         (-[WKWebViewConfiguration _attachmentElementEnabled]):
3219         (-[WKWebViewConfiguration _setAttachmentElementEnabled:]):
3220         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
3221         * WebProcess/WebPage/WebPage.cpp:
3222         (WebKit::WebPage::updatePreferences):
3223
3224 2016-03-12  Sam Weinig  <sam@webkit.org>
3225
3226         WebKit can easily crash below NetworkSession::dataTaskForIdentifier() with NSURLSession enabled
3227         <rdar://problem/25129946>
3228         https://bugs.webkit.org/show_bug.cgi?id=155401
3229
3230         Reviewed by Alex Christensen.
3231
3232         The issue was that NSURLSessionDataTasks can continue to invoke their NSURLSession's delegate methods
3233         after -[NSURLSession invalidateAndCancel] is called. So, when the NetworkSession was destroyed, and
3234         still had outstanding data tasks, the session delegate would get called, try to use the session, and
3235         crash. To fix this I:
3236         
3237         - Made NetworkSession RefCounted.
3238         - Gave NetworkSession two delegates, one for each NSURLSession.
3239         - Made each delegate have a strong reference to the NetworkSession that gets cleared out in the
3240           newly implemented URLSession:didBecomeInvalidWithError: method.
3241         - Changed from simply destroying the NetworkSession in SessionTracker::destroySession(), to derefing
3242           it and explicitly calling invalidateAndCancel on the two associated NSURLSessions (which in turn 
3243           eventually cause the URLSession:didBecomeInvalidWithError: to fire).
3244         - To ensure the correct lifetime of the WebCore::NetworkStorageSession, I made it a member of the
3245           NetworkSession. This also allowed some simplification inside SessionTracker.
3246
3247         * NetworkProcess/NetworkDataTask.h:
3248         (WebKit::NetworkDataTask::setPendingDownload):
3249         (WebKit::NetworkDataTask::pendingDownloadLocation):
3250         * NetworkProcess/NetworkLoad.cpp:
3251         (WebKit::NetworkLoad::NetworkLoad):
3252         * NetworkProcess/NetworkSession.h:
3253         (WebKit::NetworkSession::sessionID):
3254         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
3255         (WebKit::NetworkDataTask::NetworkDataTask):
3256         (WebKit::NetworkDataTask::~NetworkDataTask):
3257         (WebKit::NetworkDataTask::willPerformHTTPRedirection):
3258         (WebKit::NetworkDataTask::tryPasswordBasedAuthentication):
3259         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
3260         (-[WKNetworkSessionDelegate initWithNetworkSession:]):
3261         (-[WKNetworkSessionDelegate URLSession:didBecomeInvalidWithError:]):
3262         (WebKit::NetworkSession::setCustomProtocolManager):
3263         (WebKit::NetworkSession::create):
3264         (WebKit::NetworkSession::defaultSession):
3265         (WebKit::NetworkSession::NetworkSession):
3266         (WebKit::NetworkSession::~NetworkSession):
3267         (WebKit::NetworkSession::invalidateAndCancel):
3268         (WebKit::NetworkSession::networkStorageSession):
3269         (WebKit::NetworkSession::clearCredentials):
3270         * NetworkProcess/mac/RemoteNetworkingContext.mm:
3271         (WebKit::RemoteNetworkingContext::ensurePrivateBrowsingSession):
3272         * Shared/SessionTracker.cpp:
3273         (WebKit::identifierBase):
3274         (WebKit::SessionTracker::getIdentifierBase):
3275         (WebKit::SessionTracker::setIdentifierBase):
3276         (WebKit::staticSessionMap):
3277         (WebKit::SessionTracker::networkSession):
3278         (WebKit::SessionTracker::storageSession):
3279         (WebKit::staticStorageSessionMap):
3280         (WebKit::SessionTracker::sessionID):
3281         (WebKit::SessionTracker::setSession):
3282         (WebKit::SessionTracker::destroySession):
3283         (WebKit::SessionTracker::forEachNetworkStorageSession):
3284         (WebKit::storageSessionToID): Deleted.
3285         (WebKit::SessionTracker::storageSessionMap): Deleted.
3286         * Shared/SessionTracker.h:
3287         * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm:
3288         (WebKit::WebFrameNetworkingContext::ensurePrivateBrowsingSession):
3289         (WebKit::WebFrameNetworkingContext::setCookieAcceptPolicyForAllContexts):
3290         (WebKit::WebFrameNetworkingContext::localFileContentSniffingEnabled):
3291         (WebKit::WebFrameNetworkingContext::scheduledRunLoopPairs):
3292         * WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.cpp:
3293         (WebKit::WebFrameNetworkingContext::ensurePrivateBrowsingSession):
3294         (WebKit::WebFrameNetworkingContext::setCookieAcceptPolicyForAllContexts):
3295         (WebKit::WebFrameNetworkingContext::WebFrameNetworkingContext):
3296
3297 2016-03-12  Myles C. Maxfield  <mmaxfield@apple.com>
3298
3299         Delete dead SVG Font code
3300         https://bugs.webkit.org/show_bug.cgi?id=154718
3301
3302         Reviewed by Antti Koivisto.
3303
3304         * Configurations/FeatureDefines.xcconfig:
3305
3306 2016-03-12  Beth Dakin  <bdakin@apple.com>
3307
3308         Make preview inline navigation work API
3309         https://bugs.webkit.org/show_bug.cgi?id=155383
3310         -and corresponding-
3311         rdar://problem/25117985
3312
3313         Reviewed by Dan Bernstein.
3314
3315         With this patch:
3316         _WKElementInfo is now WKElementInfo in file and class names. Header is now 
3317         public.
3318
3319         _WKPreviewElementInfo is now WKPreviewElementInfo in file and class names. 
3320         Header is now public.
3321
3322         _WKPreviewAction is now WKPreviewActionItem in filenames (header is now 
3323         public), the protocol _WKPreviewActionItem is now WKPreviewActionItem, and 
3324         the _WKPreviewAction class is now WKPreviewAction. (The internal header is 
3325         still project, of course.)
3326         and
3327         WKPreviewActionIdentifiersPrivate.h/mm is now
3328         WKPreviewActionItemIdentifiers.h/mm and all the the identifiers have been 
3329         updated. Header is now public.
3330
3331         * Shared/API/Cocoa/WebKit.h:
3332         * UIProcess/API/Cocoa/WKElementInfo.h: Copied from UIProcess/API/Cocoa/_WKElementInfo.h.
3333         * UIProcess/API/Cocoa/WKElementInfo.mm: Copied from UIProcess/API/Cocoa/_WKElementInfo.mm.
3334         (-[WKElementInfo copyWithZone:]):
3335         (-[_WKElementInfo copyWithZone:]): Deleted.
3336         * UIProcess/API/Cocoa/WKElementInfoInternal.h: Copied from UIProcess/API/Cocoa/_WKElementInfoInternal.h.
3337         * UIProcess/API/Cocoa/WKPreviewActionIdentifiersPrivate.h: Removed.
3338         * UIProcess/API/Cocoa/WKPreviewActionIdentifiersPrivate.mm: Removed.
3339         * UIProcess/API/Cocoa/WKPreviewActionItem.h: Copied from UIProcess/API/Cocoa/_WKPreviewAction.h.
3340         * UIProcess/API/Cocoa/WKPreviewActionItem.mm: Copied from UIProcess/API/Cocoa/_WKPreviewAction.mm.
3341         * UIProcess/API/Cocoa/WKPreviewActionItemIdentifiers.h: Copied from UIProcess/API/Cocoa/WKPreviewActionIdentifiersPrivate.h.
3342         * UIProcess/API/Cocoa/WKPreviewActionItemIdentifiers.mm: Copied from UIProcess/API/Cocoa/WKPreviewActionIdentifiersPrivate.mm.
3343         * UIProcess/API/Cocoa/WKPreviewActionItemInternal.h: Copied from UIProcess/API/Cocoa/_WKPreviewActionInternal.h.
3344         * UIProcess/API/Cocoa/WKPreviewElementInfo.h: Copied from UIProcess/API/Cocoa/_WKPreviewElementInfo.h.
3345         * UIProcess/API/Cocoa/WKPreviewElementInfo.mm: Copied from UIProcess/API/Cocoa/_WKPreviewElementInfo.mm.
3346         (-[WKPreviewElementInfo _initWithLinkURL:]):
3347         (-[_WKPreviewElementInfo _initWithLinkURL:]): Deleted.
3348         * UIProcess/API/Cocoa/WKPreviewElementInfoInternal.h: Copied from UIProcess/API/Cocoa/_WKPreviewElementInfoInternal.h.
3349         * UIProcess/API/Cocoa/WKUIDelegate.h:
3350         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
3351         * UIProcess/API/Cocoa/_WKContextMenuElementInfo.h:
3352         * UIProcess/API/Cocoa/_WKElementInfo.h: Removed.
3353         * UIProcess/API/Cocoa/_WKElementInfo.mm: Removed.
3354         * UIProcess/API/Cocoa/_WKElementInfoInternal.h: Removed.
3355         * UIProcess/API/Cocoa/_WKPreviewAction.h: Removed.
3356         * UIProcess/API/Cocoa/_WKPreviewAction.mm: Removed.
3357         * UIProcess/API/Cocoa/_WKPreviewActionInternal.h: Removed.
3358         * UIProcess/API/Cocoa/_WKPreviewElementInfo.h: Removed.
3359         * UIProcess/API/Cocoa/_WKPreviewElementInfo.mm: Removed.
3360         * UIProcess/API/Cocoa/_WKPreviewElementInfoInternal.h: Removed.
3361         * UIProcess/ios/WKContentViewInteraction.mm:
3362         (-[WKContentView _interactionShouldBeginFromPreviewItemController:forPosition:]):
3363         (previewIdentifierForElementAction):
3364         (-[WKContentView _presentedViewControllerForPreviewItemController:]):
3365         (-[WKContentView _previewItemController:commitPreview:]):
3366         * WebKit2.xcodeproj/project.pbxproj:
3367
3368 2016-03-12  Jeremy Huddleston Sequoia  <jeremyhu@apple.com>
3369
3370         [GTK][Mac] Use DYLD_LIBRARY_PATH on OSX rather then LD_LIBRARY_PATH
3371         https://bugs.webkit.org/show_bug.cgi?id=152650
3372
3373         Reviewed by Carlos Garcia Campos.
3374
3375         * PlatformGTK.cmake:
3376
3377 2016-03-11  John Wilander  <wilander@apple.com>
3378
3379         Move prevalent resource classifier from WebCore to WebKit.
3380         https://bugs.webkit.org/show_bug.cgi?id=155242
3381         <rdar://problem/24913272>
3382
3383         Reviewed by Andy Estes.
3384
3385         * UIProcess/WebResourceLoadStatisticsStore.cpp:
3386         (WebKit::WebResourceLoadStatisticsStore::create):
3387         (WebKit::WebResourceLoadStatisticsStore::~WebResourceLoadStatisticsStore):
3388         (WebKit::hasPrevalentResourceCharacteristics):
3389         (WebKit::classifyPrevalentResources):
3390             - Moved these two functions from WebCore.
3391         (WebKit::WebResourceLoadStatisticsStore::resourceLoadStatisticsUpdated):
3392             - Calls processStatistics with a lamda function to classify prevalent resources.
3393         * WebKit2.xcodeproj/project.pbxproj:
3394             - Fixed the ordering of source files.
3395
3396 2016-03-11  Sam Weinig  <sam@webkit.org>
3397
3398         WebKit needs a new sandbox profile addition for DataDetectors
3399         <rdar://problem/25091102>
3400
3401         Reviewed by Brent Fulgham.
3402
3403         * WebProcess/com.apple.WebProcess.sb.in:
3404
3405 2016-03-11  Chris Dumez  <cdumez@apple.com>
3406
3407         Regression(r198040): WebKit2.DocumentStartUserScriptAlertCrashTest API test is crashing in debug
3408         https://bugs.webkit.org/show_bug.cgi?id=155382
3409
3410         Reviewed by Alexey Proskuryakov.
3411
3412         r198040 introduced an assertion to make sure we never call
3413         applicationBundleIsEqualTo() before setApplicationBundleIdentifier()
3414         is called. This new assertion found a bug as it turns out we were
3415         calling setApplicationBundleIdentifier() too late during the
3416         WebProcess initialization and some runtime applications checks were
3417         already done by then.
3418
3419         To address the problem, this patch moves the
3420         setApplicationBundleIdentifier() call as early as possible during
3421         the WebProcess and the NetworkProcess initialization. It also moves
3422         it to the Cocoa specific files for clarity.
3423
3424         * NetworkProcess/NetworkProcess.cpp:
3425         (WebKit::NetworkProcess::initializeNetworkProcess):
3426         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
3427         (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
3428         * WebProcess/WebProcess.cpp:
3429         (WebKit::WebProcess::initializeWebProcess):
3430         * WebProcess/cocoa/WebProcessCocoa.mm:
3431         (WebKit::WebProcess::platformInitializeWebProcess):
3432
3433 2016-03-11  Enrica Casucci  <enrica@apple.com>
3434
3435         Use only selected text for Look up.
3436         https://bugs.webkit.org/show_bug.cgi?id=155380
3437
3438         Reviewed by Tim Horton.
3439
3440         The corresponding piece that uses the extended context for Look up
3441         is not ready yet. For the moment default to retrieving the selected text.
3442
3443         * UIProcess/ios/WKContentViewInteraction.mm:
3444         (-[WKContentView _lookup:]):
3445
3446 2016-03-11  Chelsea Pugh  <cpugh@apple.com>
3447
3448         [iOS] Allow clients to specify text suggestions to be used for a form input session
3449         https://bugs.webkit.org/show_bug.cgi?id=155343
3450
3451         Reviewed by Dan Bernstein.
3452
3453         * UIProcess/API/Cocoa/_WKFormInputSession.h:
3454         * UIProcess/API/Cocoa/_WKInputDelegate.h:
3455         * UIProcess/ios/WKContentViewInteraction.mm:
3456         (-[WKFormInputSession suggestions]): Add a getter for suggestions.
3457         (-[WKFormInputSession setSuggestions:]): Add a setter, which calls setSuggestions with our suggestions on the input delegate.
3458         (-[WKContentView insertTextSuggestion:]): Call _webView:insertTextSuggestion:inInputSession: on our input delegate so clients know 
3459         a text suggestion was tapped.
3460
3461 2016-03-11  Anders Carlsson  <andersca@apple.com>
3462
3463         Creating and releasing a WKBackForwardListItem crashes
3464         https://bugs.webkit.org/show_bug.cgi?id=155376
3465         rdar://problem/17377712