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