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