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