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