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