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