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