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