Add WKPageRef SPI to tell whether there's a video playing in enhanced fullscreen
[WebKit-https.git] / Source / WebKit2 / ChangeLog
1 2016-05-06  Ada Chan  <adachan@apple.com>
2
3         Add WKPageRef SPI to tell whether there's a video playing in enhanced fullscreen
4         https://bugs.webkit.org/show_bug.cgi?id=157434
5
6         Reviewed by Darin Adler.
7
8         * UIProcess/API/C/mac/WKPagePrivateMac.h:
9         * UIProcess/API/C/mac/WKPagePrivateMac.mm:
10         (WKPageIsPlayingVideoInEnhancedFullscreen):
11         * UIProcess/Cocoa/WebVideoFullscreenManagerProxy.h:
12         * UIProcess/Cocoa/WebVideoFullscreenManagerProxy.mm:
13         (WebKit::WebVideoFullscreenManagerProxy::isPlayingVideoInEnhancedFullscreen):
14         * UIProcess/WebPageProxy.cpp:
15         (WebKit::WebPageProxy::isPlayingVideoInEnhancedFullscreen):
16         * UIProcess/WebPageProxy.h:
17
18 2016-05-09  Anders Carlsson  <andersca@apple.com>
19
20         Add injected bundle SPI for getting favicon and touch icon URLs
21         https://bugs.webkit.org/show_bug.cgi?id=157435
22
23         Reviewed by Darin Adler.
24
25         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFrame.h:
26         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFrame.mm:
27         (collectIcons):
28         New helper function that calls into the WebCore LinkCollector.
29
30         (-[WKWebProcessPlugInFrame appleTouchIconURLs]):
31         Call collectIcons.
32
33         (-[WKWebProcessPlugInFrame faviconURLs]):
34         Ditto.
35
36 2016-05-06  Simon Fraser  <simon.fraser@apple.com>
37
38         [iOS WK2] Font size increases on some pages after navigating then going back
39         https://bugs.webkit.org/show_bug.cgi?id=157441
40         rdar://problem/22873240
41
42         Reviewed by Darin Adler.
43
44         There's an ordering dependency between setting the viewport configuration and doing
45         layouts when going back to a page from the page cache that is incorrectly handled.
46
47         In FrameLoader::commitProvisionalLoad(), CachedPage::restore() triggers a layout under
48         updateContentsSize(), but this happens before dispatchDidCommitLoad() which updates
49         the viewport arguments via ViewportConfiguration::setViewportArguments().
50
51         This issue is not addressed by the current commit. But a second problem is:
52         if the inputs to text autosizing change, we need to invalidate the autosizing state.
53         The relevant input here is the fixed layout width (which is determined from the viewport
54         configuration).
55
56         The current code invalidated text autosizing when m_viewportConfiguration.minimumLayoutSize()
57         changed, but the correct behavior is to invalidate based on fixed layout size changing.
58
59         * WebProcess/WebPage/WebPage.cpp:
60         (WebKit::WebPage::sendViewportAttributesChanged):
61         (WebKit::WebPage::setFixedLayoutSize):
62         * WebProcess/WebPage/WebPage.h:
63         * WebProcess/WebPage/ios/WebPageIOS.mm:
64         (WebKit::WebPage::resetTextAutosizing):
65         (WebKit::WebPage::dynamicViewportSizeUpdate):
66         (WebKit::WebPage::viewportConfigurationChanged):
67         (WebKit::WebPage::setViewportConfigurationMinimumLayoutSize): Deleted.
68         (WebKit::WebPage::resetTextAutosizingBeforeLayoutIfNeeded): Deleted.
69
70 2016-05-09  Alex Christensen  <achristensen@webkit.org>
71
72         Don't use DiskCache for media resource loads
73         https://bugs.webkit.org/show_bug.cgi?id=157405
74
75         Reviewed by Darin Adler.
76
77         * NetworkProcess/cache/NetworkCache.cpp:
78         (WebKit::NetworkCache::makeRetrieveDecision):
79         (WebKit::NetworkCache::makeStoreDecision):
80         * NetworkProcess/cache/NetworkCache.h:
81         * NetworkProcess/cache/NetworkCacheStatistics.cpp:
82         (WebKit::NetworkCache::retrieveDecisionToDiagnosticKey):
83
84 2016-05-08  Myles C. Maxfield  <mmaxfield@apple.com>
85
86         [OS X] Migrate our Font classes entirely off of NSFont
87         https://bugs.webkit.org/show_bug.cgi?id=157464
88
89         Reviewed by Darin Adler.
90
91         * WebProcess/WebCoreSupport/mac/WebPopupMenuMac.mm:
92         (WebKit::WebPopupMenu::setUpPlatformData):
93         * WebProcess/WebPage/mac/WebPageMac.mm:
94         (WebKit::WebPage::fontAtSelection):
95
96 2016-05-06  Joseph Pecoraro  <pecoraro@apple.com>
97
98         Rename HitTestRequest DisallowShadowContent to DisallowUserAgentShadowContent
99         https://bugs.webkit.org/show_bug.cgi?id=157447
100
101         Reviewed by Ryosuke Niwa.
102
103         * WebProcess/WebPage/CoordinatedGraphics/WebPageCoordinatedGraphics.cpp:
104         (WebKit::WebPage::findZoomableAreaForPoint):
105         * WebProcess/WebPage/WebFrame.cpp:
106         (WebKit::WebFrame::hitTest):
107         * WebProcess/WebPage/WebPage.cpp:
108         (WebKit::WebPage::determinePrimarySnapshottedPlugIn):
109         * WebProcess/WebPage/ios/WebPageIOS.mm:
110         (WebKit::WebPage::rangeForWebSelectionAtPosition):
111         (WebKit::WebPage::rangeForBlockAtPoint):
112         (WebKit::WebPage::getPositionInformation):
113
114 2016-05-06  Simon Fraser  <simon.fraser@apple.com>
115
116         Enable IOS_TEXT_AUTOSIZING on Mac and make it testable
117         https://bugs.webkit.org/show_bug.cgi?id=157432
118         rdar://problem/16406720
119
120         Reviewed by Dean Jackson.
121
122         Enable IOS_TEXT_AUTOSIZING on Mac so it can be tested.
123         
124         Make the setTextAutosizingEnabled() Setting work, and plumb it through WK1 and WK2
125         preferences for WTR and DRT. Make textAutosizingWindowSizeOverride() work, for layout tests.
126         These two settings are shared with TEXT_AUTOSIZING.
127
128         Add a TextAutosizing log channel, which is useful for generated -expected.html results.
129
130         Move adjustComputedFontSizesOnBlocks() and related code from RenderObject to RenderElement
131         without changes.
132
133         An implication of this set of changes is that the way clients enable text autosizing
134         has changed. Previously, they set the "MinimumZoomFontSize" preference to 0.
135         Settings::defaultMinimumZoomFontSize() used to do this in order to enable text autosizing
136         on iPhone only, not iPad.
137
138         Now the preferred technique is to leave minimumZoomFontSize alone, and to use textAutosizingEnabled()
139         instead. Settings::defaultTextAutosizingEnabled() now does the check for iPhone.
140
141         UIWebView calls WebKitGetMinimumZoomFontSize() to setup the default minimum font zoom size,
142         which will now always return 15, but had no other code that toggled this. So it's safe to just rely
143         on Settings::defaultTextAutosizingEnabled() doing the right thing for iPhone/iPad.
144
145         * Configurations/FeatureDefines.xcconfig:
146         * Shared/WebPreferencesDefinitions.h:
147         * UIProcess/API/Cocoa/WKPreferences.mm:
148         (-[WKPreferences _textAutosizingEnabled]):
149         (-[WKPreferences _setTextAutosizingEnabled:]):
150         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
151         * WebProcess/WebPage/WebPage.cpp:
152         (WebKit::WebPage::updatePreferences):
153
154 2016-05-06  Dean Jackson  <dino@apple.com>
155
156         Regions, Shapes and Tracks don't need runtime features
157         https://bugs.webkit.org/show_bug.cgi?id=157426
158         <rdar://problem/26146262>
159
160         Reviewed by Simon Fraser.
161
162         The following RuntimeEnabledFeatures can be removed since
163         we have no need to disable them (they are stable and have
164         shipped for a while):
165         - CSS Regions
166         - CSS Shapes
167         - Media tracks
168
169         * Shared/WebPreferencesDefinitions.h:
170         * UIProcess/API/C/WKPreferences.cpp:
171         (WKPreferencesSetCSSRegionsEnabled): Deleted.
172         (WKPreferencesGetCSSRegionsEnabled): Deleted.
173         * UIProcess/API/C/WKPreferencesRefPrivate.h:
174         * WebProcess/InjectedBundle/InjectedBundle.cpp:
175         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner): Deleted.
176         (WebKit::InjectedBundle::setCSSRegionsEnabled): Deleted.
177         (WebKit::InjectedBundle::setCSSCompositingEnabled): Deleted.
178         * WebProcess/InjectedBundle/InjectedBundle.h:
179         * WebProcess/WebPage/WebPage.cpp:
180         (WebKit::WebPage::updatePreferences): Deleted.
181
182 2016-05-05  Ada Chan  <adachan@apple.com>
183
184         Create a fence in WebVideoFullscreenManagerProxy::setVideoLayerFrame() to pass to the web process
185         https://bugs.webkit.org/show_bug.cgi?id=157409
186
187         Reviewed by Tim Horton.
188
189         * UIProcess/Cocoa/WebVideoFullscreenManagerProxy.mm:
190         (WebKit::WebVideoFullscreenManagerProxy::setVideoLayerFrame):
191         Create a fence by calling DrawingAreaProxy::createFence() and pass it when sending the
192         WebVideoFullscreenManager::SetVideoLayerFrameFenced message.
193
194         * UIProcess/DrawingAreaProxy.cpp:
195         (WebKit::DrawingAreaProxy::createFence):
196         Stub implementation. Assert not to be reached here since it's only implemented on Mac so far.
197         * UIProcess/DrawingAreaProxy.h:
198
199         * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.h:
200         * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm:
201         (WebKit::TiledCoreAnimationDrawingAreaProxy::createFence):
202         Renamed from createFenceForGeometryUpdate() since we are using it for more than just updating geometry.
203         (WebKit::TiledCoreAnimationDrawingAreaProxy::sendUpdateGeometry):
204         Update due to method rename.
205
206 2016-05-05  Brady Eidson  <beidson@apple.com>
207
208         Modern IDB (Workers): Get everything to the right threads.
209         https://bugs.webkit.org/show_bug.cgi?id=157398
210
211         Reviewed by Alex Christensen.
212
213         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
214         (WebKit::WebIDBConnectionToServer::putOrAdd):
215         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h:
216
217 2016-05-05  Manuel Rego Casasnovas  <rego@igalia.com>
218
219         [GTK] Remove "region based columns" runtime feature remainings
220         https://bugs.webkit.org/show_bug.cgi?id=157393
221
222         The runtime feature was removed in r168978,
223         and the usage in WebKitSettings.cpp in r168988.
224         However it was still around in ExperimentalFeatures class.
225
226         Reviewed by Michael Catanzaro.
227
228         * UIProcess/gtk/ExperimentalFeatures.cpp: Remove runtime feature.
229         * UIProcess/gtk/ExperimentalFeatures.h: Ditto.
230
231 2016-05-05  Manuel Rego Casasnovas  <rego@igalia.com>
232
233         [GTK] Add CSS Grid Layout as experimental feature
234         https://bugs.webkit.org/show_bug.cgi?id=157391
235
236         Reviewed by Michael Catanzaro.
237
238         Now that we've a runtime feature again for CSS Grid Layout (r200215),
239         we can recover the old patch (r162215) that allows to enable/disable
240         CSS Grid Layout through the environment variable
241         WEBKITGTK_EXPERIMENTAL_FEATURES.
242
243         Example: WEBKITGTK_EXPERIMENTAL_FEATURES="CSS_GRID_LAYOUT=1"
244
245         * UIProcess/API/gtk/WebKitSettings.cpp:
246         (webKitSettingsConstructed): Use new experimental feature to enable
247         or disable CSS Grid Layout.
248         * UIProcess/gtk/ExperimentalFeatures.cpp: Add new experimental feature.
249         * UIProcess/gtk/ExperimentalFeatures.h: Ditto.
250
251 2016-05-05  Jer Noble  <jer.noble@apple.com>
252
253         [WK2] Media controls don't update if controller is created after the interface is created
254         https://bugs.webkit.org/show_bug.cgi?id=157376
255
256         Reviewed by Beth Dakin.
257
258         Implement the new getter methods on WebPlaybackSessionModelContext by caching the values
259         passed through WebPlaybackSessionManagerProxy.
260
261         * UIProcess/Cocoa/WebPlaybackSessionManagerProxy.h:
262         * UIProcess/Cocoa/WebPlaybackSessionManagerProxy.mm:
263         (WebKit::WebPlaybackSessionManagerProxy::setCurrentTime):
264         (WebKit::WebPlaybackSessionManagerProxy::setBufferedTime):
265         (WebKit::WebPlaybackSessionManagerProxy::setSeekableRangesVector):
266         (WebKit::WebPlaybackSessionManagerProxy::setCanPlayFastReverse):
267         (WebKit::WebPlaybackSessionManagerProxy::setAudioMediaSelectionOptions):
268         (WebKit::WebPlaybackSessionManagerProxy::setLegibleMediaSelectionOptions):
269         (WebKit::WebPlaybackSessionManagerProxy::setExternalPlaybackProperties):
270         (WebKit::WebPlaybackSessionManagerProxy::setWirelessVideoPlaybackDisabled):
271         (WebKit::WebPlaybackSessionManagerProxy::setDuration):
272         (WebKit::WebPlaybackSessionManagerProxy::setRate):
273         * UIProcess/Cocoa/WebVideoFullscreenManagerProxy.h:
274         * UIProcess/Cocoa/WebVideoFullscreenManagerProxy.mm:
275         (WebKit::WebVideoFullscreenModelContext::requestFullscreenMode): Deleted.
276         (WebKit::WebVideoFullscreenModelContext::setVideoLayerFrame): Deleted.
277         (WebKit::WebVideoFullscreenModelContext::setVideoLayerGravity): Deleted.
278         (WebKit::WebVideoFullscreenModelContext::fullscreenModeChanged): Deleted.
279         (WebKit::WebVideoFullscreenModelContext::isVisible): Deleted.
280         (WebKit::WebVideoFullscreenModelContext::didSetupFullscreen): Deleted.
281         (WebKit::WebVideoFullscreenModelContext::didEnterFullscreen): Deleted.
282         (WebKit::WebVideoFullscreenModelContext::didExitFullscreen): Deleted.
283         (WebKit::WebVideoFullscreenModelContext::didCleanupFullscreen): Deleted.
284         (WebKit::WebVideoFullscreenManagerProxy::WebVideoFullscreenManagerProxy): Deleted.
285         (WebKit::WebVideoFullscreenManagerProxy::~WebVideoFullscreenManagerProxy): Deleted.
286
287 2016-05-05  Dean Jackson  <dino@apple.com>
288
289         Shadow DOM should not be experimental
290         https://bugs.webkit.org/show_bug.cgi?id=157384
291         <rdar://problem/26123254>
292
293         Reviewed by Anders Carlsson.
294
295         Shadow DOM is not an experimental feature. We want
296         it enabled by default.
297
298         This fixes the timeout in:
299         WebKit2.InjectedBundleMakeAllShadowRootOpenTest
300
301         * Shared/WebPreferencesDefinitions.h: Move the Shadow
302         DOM preference out of Experimental.
303         * WebProcess/InjectedBundle/InjectedBundle.cpp:
304         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
305         * WebProcess/WebPage/WebPage.cpp:
306         (WebKit::WebPage::updatePreferences):
307
308 2016-05-05  Simon Fraser  <simon.fraser@apple.com>
309
310         Revert r200390, thus putting r199259 and r200161 and back.
311
312         * Shared/VisibleContentRectUpdateInfo.cpp:
313         (WebKit::VisibleContentRectUpdateInfo::encode):
314         (WebKit::VisibleContentRectUpdateInfo::decode):
315         * Shared/VisibleContentRectUpdateInfo.h:
316         (WebKit::VisibleContentRectUpdateInfo::VisibleContentRectUpdateInfo):
317         (WebKit::VisibleContentRectUpdateInfo::enclosedInScrollableAncestorView):
318         (WebKit::operator==):
319         * UIProcess/API/Cocoa/WKWebView.mm:
320         (-[WKWebView _didInvokeUIScrollViewDelegateCallback]):
321         (-[WKWebView _didFinishScrolling]):
322         (-[WKWebView scrollViewDidScroll:]):
323         (-[WKWebView scrollViewDidZoom:]):
324         (-[WKWebView scrollViewDidEndZooming:withView:atScale:]):
325         (-[WKWebView _scrollViewDidInterruptDecelerating:]):
326         (-[WKWebView _visibleRectInEnclosingScrollView:]):
327         (-[WKWebView _visibleContentRect]):
328         (-[WKWebView _didScroll]):
329         (-[WKWebView _enclosingScrollerScrollingEnded:]):
330         (-[WKWebView _frameOrBoundsChanged]):
331         (-[WKWebView _updateVisibleContentRects]):
332         (-[WKWebView _updateVisibleContentRectAfterScrollInView:]):
333         (scrollViewCanScroll):
334         (-[WKWebView _updateContentRectsWithState:]):
335         * UIProcess/API/Cocoa/WKWebViewInternal.h:
336         * UIProcess/WebPageProxy.h:
337         * UIProcess/ios/WKContentView.h:
338         * UIProcess/ios/WKContentView.mm:
339         (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:obscuredInset:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]):
340         (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:obscuredInset:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:]): Deleted.
341         * UIProcess/ios/WebPageProxyIOS.mm:
342         (WebKit::WebPageProxy::updateVisibleContentRects):
343         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
344         (WebKit::RemoteLayerTreeDrawingAreaProxy::indicatorLocation):
345         * WebProcess/WebPage/ios/WebPageIOS.mm:
346         (WebKit::WebPage::updateVisibleContentRects):
347
348 2016-05-02  Sam Weinig  <sam@webkit.org>
349
350         On platforms that support it, use a SecTrustRef as the basis of CertificateInfo instead of a chain of SecCertificateRefs.
351         https://bugs.webkit.org/show_bug.cgi?id=157220
352
353         Reviewed by Darin Adler.
354
355         * Shared/Authentication/mac/AuthenticationManager.mac.mm:
356         (WebKit::leafCertificate):
357         (WebKit::chain):
358         (WebKit::AuthenticationManager::tryUseCertificateInfoForChallenge):
359         When supported, get the SecCertificateRef from the SecTrustRef rather than the
360         stored certificate chain.
361
362         * Shared/cf/ArgumentCodersCF.cpp:
363         (IPC::typeFromCFTypeRef):
364         (IPC::encode):
365         (IPC::decode):
366         * Shared/cf/ArgumentCodersCF.h:
367         Add support for encoding/decoding SecTrustRef objects.
368
369         * Shared/mac/WebCoreArgumentCodersMac.mm:
370         (IPC::ArgumentCoder<CertificateInfo>::encode):
371         (IPC::ArgumentCoder<CertificateInfo>::decode):
372         Add support for encoding/decoding CertificateInfo's that contain SecTrustRef objects.
373
374         (IPC::encodeNSError):
375         (IPC::decodeNSError):
376         Simplify error encoding/decoding by not using an addition CertificateInfo object for encoding
377         the peerCertificateChain. Also, add the peerTrust to the userInfo that get's encoded/decoded.
378
379         * UIProcess/API/Cocoa/WKWebView.h:
380         * UIProcess/API/Cocoa/WKWebView.mm:
381         (-[WKWebView serverTrust]):
382         (-[WKWebView certificateChain]):
383         Add new serverTrust API and deprecate certificateChain.
384
385         * UIProcess/Cocoa/NavigationState.mm:
386         (WebKit::NavigationState::willChangeCertificateInfo):
387         (WebKit::NavigationState::didChangeCertificateInfo):
388         Add support for KVO of -[WKWebView serverTrust].
389
390 2016-05-05  Daniel Bates  <dabates@apple.com>
391
392         Remove workaround added in r200391 (rdar://problem/25992976)
393         https://bugs.webkit.org/show_bug.cgi?id=157378
394         <rdar://problem/26118503>
395
396         Reviewed by Anders Carlsson.
397
398         Following the fix for <rdar://problem/26075714> we can remove the workaround added in r200391 (rdar://problem/25992976).
399
400         * Shared/mac/CodeSigning.mm:
401         (WebKit::secCodeSigningIdentifier):
402
403 2016-05-04  Dean Jackson  <dino@apple.com>
404
405         Experimental Features don't need an "Experimental" prefix
406         https://bugs.webkit.org/show_bug.cgi?id=157363
407         <rdar://problem/26100630>
408
409         Reviewed by Anders Carlsson.
410
411         Since we're not persisting the value of the experimental
412         features, it's unlikely there will ever be the case
413         where we move a Preference from experimental to normal
414         and use a stored value.
415
416         * Shared/WebPreferencesDefinitions.h:
417         * WebProcess/InjectedBundle/InjectedBundle.cpp:
418         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
419         * WebProcess/WebPage/WebPage.cpp:
420         (WebKit::WebPage::updatePreferences):
421
422 2016-05-04  Dean Jackson  <dino@apple.com>
423
424         Experimental features should toggle runtime flags
425         https://bugs.webkit.org/show_bug.cgi?id=157353
426         <rdar://problem/23621603>
427
428         Reviewed by Anders Carlsson.
429
430         Hook up the experimental WebPreferences to RuntimeEnabledFeatures.
431         In the process I removed the general preference for WebGL 2 (we
432         already had an experimental feature for it) and moved Custom
433         Elements and Shadow DOM to experimental.
434
435         I also removed the C versions of the preferences, since experimental
436         features only need the ObjC API (which is generated automatically).
437
438         * Shared/WebPreferencesDefinitions.h: Move/remove some features and
439         make the experimental section more clear.
440         * UIProcess/API/C/WKPreferences.cpp:
441         (WKPreferencesSetWebGL2Enabled): Deleted.
442         (WKPreferencesGetWebGL2Enabled): Deleted.
443         (WKPreferencesSetShadowDOMEnabled): Deleted.
444         (WKPreferencesGetShadowDOMEnabled): Deleted.
445         (WKPreferencesSetCustomElementsEnabled): Deleted.
446         (WKPreferencesGetCustomElementsEnabled): Deleted.
447         * UIProcess/API/C/WKPreferencesRefPrivate.h:
448         * UIProcess/WebPreferences.cpp:
449         (WebKit::WebPreferences::updateBoolValueForExperimentalFeatureKey): A
450         version of updateBoolValueForKey that doesn't call the platform
451         function (e.g. doesn't save to NSUserDefaults).
452         * UIProcess/WebPreferences.h:
453         * UIProcess/mac/WebPreferencesMac.mm:
454         (WebKit::WebPreferences::platformInitializeStore): Deleted.
455         * WebProcess/InjectedBundle/InjectedBundle.cpp:
456         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
457         * WebProcess/WebPage/WebPage.cpp:
458         (WebKit::WebPage::updatePreferences):
459
460 2016-05-04  Dean Jackson  <dino@apple.com>
461
462         TestRunner should always enable all the experimental features
463         https://bugs.webkit.org/show_bug.cgi?id=157360
464         <rdar://problem/26099748>
465
466         Reviewed by Anders Carlsson.
467
468         Experimental features are disabled by default, but it is
469         a pain to enable them in every test. Instead, have the
470         test runner turn them all on.
471
472         * UIProcess/API/C/WKPreferences.cpp:
473         (WKPreferencesEnableAllExperimentalFeatures):
474         * UIProcess/API/C/WKPreferencesRefPrivate.h:
475         * UIProcess/WebPreferences.cpp:
476         (WebKit::WebPreferences::enableAllExperimentalFeatures):
477         * UIProcess/WebPreferences.h:
478
479 2016-05-04  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
480
481         Add WKPreference for SelectionPaintingWithoutSelectionGaps
482         https://bugs.webkit.org/show_bug.cgi?id=156900
483
484         Reviewed by Michael Catanzaro.
485
486         Unlike other browsers WebKit has been drawing selection gaps
487         between render blocks during the text selection. This often
488         cause text selection screen looks messy.
489
490         This patch adds a setting method to disable the functionality,
491         and EFL port disables it by default.
492
493         * Shared/WebPreferencesDefinitions.h:
494         * UIProcess/API/C/WKPreferences.cpp:
495         (WKPreferencesSetSelectionPaintingWithoutSelectionGapsEnabled):
496         (WKPreferencesGetSelectionPaintingWithoutSelectionGapsEnabled):
497         * UIProcess/API/C/WKPreferencesRefPrivate.h:
498         * WebProcess/WebPage/WebPage.cpp:
499         (WebKit::WebPage::updatePreferences):
500
501 2016-05-04  Zan Dobersek  <zdobersek@igalia.com>
502
503         [CoordGraphics] CompositingCoordinator should hande root compositing and view overlay layers separately
504         https://bugs.webkit.org/show_bug.cgi?id=157305
505
506         Reviewed by Carlos Garcia Campos.
507
508         Update CoordinatedLayerTreeHost and ThreadCoordinatedLayerTreeHost to
509         correctly use setRootCompositingLayer() and setViewOverlayRootLayer()
510         methods on the CompositingCoordinator object.
511
512         CoordinatedLayerTreeHost doesn't have to keep a pointer to the root
513         compositing layer anymore. updateRootLayers() can be removed.
514
515         ThreadCoordinatedLayerTreeHost doen't have to keep a pointer to both
516         the root compositing and the view overlay layers anymore. Similarly,
517         updateRootLayers() can be removed.
518
519         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
520         (WebKit::CoordinatedLayerTreeHost::setViewOverlayRootLayer):
521         (WebKit::CoordinatedLayerTreeHost::setRootCompositingLayer):
522         (WebKit::CoordinatedLayerTreeHost::CoordinatedLayerTreeHost): Deleted.
523         (WebKit::CoordinatedLayerTreeHost::updateRootLayers): Deleted.
524         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h:
525         * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp:
526         (WebKit::ThreadedCoordinatedLayerTreeHost::setRootCompositingLayer):
527         (WebKit::ThreadedCoordinatedLayerTreeHost::setViewOverlayRootLayer):
528         (WebKit::ThreadedCoordinatedLayerTreeHost::ThreadedCoordinatedLayerTreeHost): Deleted.
529         (WebKit::ThreadedCoordinatedLayerTreeHost::updateRootLayers): Deleted.
530         * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h:
531
532 2016-05-03  Beth Dakin  <bdakin@apple.com>
533
534         Add VideoControlsManager tests
535         https://bugs.webkit.org/show_bug.cgi?id=157332
536         -and corresponding-
537         rdar://problem/24358431
538
539         Reviewed by Sam Weinig.
540
541         Expose _hasActiveVideoForControlsManager on WKWebViewPrivate for the sake of 
542         testing. 
543         * UIProcess/API/Cocoa/WKWebView.mm:
544         (-[WKWebView _hasActiveVideoForControlsManager]):
545         (-[WKWebView _doAfterNextPresentationUpdate:]):
546         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
547
548 2016-05-03  Jer Noble  <jer.noble@apple.com>
549
550         [iOS][WK2] Allow WKWebView to play local filesystem media when created with -loadFileURL:allowingReadAccessToURL:
551         https://bugs.webkit.org/show_bug.cgi?id=156875
552         <rdar://problem/24281444>
553
554         Reviewed by Alexey Proskuryakov.
555
556         Grant AVFoundation the right to issue file read sandbox extensions from the WebContent process to the mediaserverd
557         process, so that it can play back local media files.
558
559         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
560
561 2016-05-03  Jiewen Tan  <jiewen_tan@apple.com>
562
563         File Upload: Photo upload name is always generic (image.jpg)
564         https://bugs.webkit.org/show_bug.cgi?id=157291
565         <rdar://problem/12353008>
566
567         Reviewed by Darin Adler.
568
569         Use the original filename as the name of an uploaded image instead of
570         a generic name, i.e. image.jpg.
571
572         * Platform/spi/ios/PhotosSPI.h: Added.
573         * UIProcess/ios/forms/WKFileUploadPanel.mm:
574         (-[WKFileUploadPanel _uploadItemForImage:withAssetURL:successBlock:failureBlock:]):
575         * WebKit2.xcodeproj/project.pbxproj:
576
577 2016-05-03  Chris Dumez  <cdumez@apple.com>
578
579         [WK2][DiskCache] Store common HTTP header names as strings
580         https://bugs.webkit.org/show_bug.cgi?id=157326
581         <rdar://problem/26073498>
582
583         Reviewed by Antti Koivisto.
584
585         Store common HTTP header names as strings in the disk cache instead of
586         using their value in the HTTPHeaderName enumeration. Having the disk
587         cache rely in the HTTPHeaderName enumeration is risky becomes it means
588         the cached data would become invalid every time someone updates
589         HTTPHeaderNames.in in WebCore. If someone were to update
590         HTTPHeaderNames.in without bumping the disk cache version, we would end
591         up with wrongly recognized HTTP header names after loading responses
592         from the cache.
593
594         * NetworkProcess/cache/NetworkCacheCoders.cpp:
595         (WebKit::NetworkCache::Coder<WebCore::HTTPHeaderMap>::encode):
596         (WebKit::NetworkCache::Coder<WebCore::HTTPHeaderMap>::decode):
597         * NetworkProcess/cache/NetworkCacheCoders.h:
598         * NetworkProcess/cache/NetworkCacheStorage.h:
599
600 2016-05-03  Daniel Bates  <dabates@apple.com>
601
602         Temporary workaround for Apple Internal builds
603         <rdar://problem/25992976>
604
605         For Apple Internal builds treat error code errSecCSGuestInvalid as if it were error code errSecCSUnsigned.
606         We will look to remove this workaround in the fix for <rdar://problem/26075714>.
607
608         * Shared/mac/CodeSigning.mm:
609         (WebKit::secCodeSigningIdentifier):
610
611 2016-05-03  Chris Dumez  <cdumez@apple.com>
612
613         Unreviewed, rolling out r199259 and r200161.
614
615         Seems to have caused a ~1.2% PLT regression on iOS
616
617         Reverted changesets:
618
619         "[iOS WK2] WKWebViews should consult ancestor UIScrollViews to
620         determine tiling area"
621         https://bugs.webkit.org/show_bug.cgi?id=156429
622         http://trac.webkit.org/changeset/199259
623
624         "[iOS WK2] When determining tile size, check whether ancestor
625         UIScrollViews are actually scrollable"
626         https://bugs.webkit.org/show_bug.cgi?id=157107
627         http://trac.webkit.org/changeset/200161
628
629 2016-05-03  Dean Jackson  <dino@apple.com>
630
631         CSS Grid should be an experimental feature flag
632         https://bugs.webkit.org/show_bug.cgi?id=157327
633         <rdar://problem/26075147>
634
635         Reviewed by Anders Carlsson.
636
637         The CSS Grid Layout runtime flag was exposed by
638         a WebKit preference. It was in the experimental
639         section but was missing the "Experimental" prefix.
640
641         It was also missing the human readable description.
642
643         Lastly, there is no need for the C API for experimental
644         features.
645
646         * Shared/WebPreferencesDefinitions.h:
647         * UIProcess/API/C/WKPreferences.cpp:
648         (WKPreferencesSetCSSGridLayoutEnabled): Deleted.
649         (WKPreferencesGetCSSGridLayoutEnabled): Deleted.
650         * UIProcess/API/C/WKPreferencesRefPrivate.h:
651         * WebProcess/InjectedBundle/InjectedBundle.cpp:
652         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
653         * WebProcess/WebPage/WebPage.cpp:
654         (WebKit::WebPage::updatePreferences):
655
656 2016-05-03  Alex Christensen  <achristensen@webkit.org>
657
658         Remove firing assertion when redirecting
659         https://bugs.webkit.org/show_bug.cgi?id=155800
660         rdar://25299194
661
662         Reviewed by Sam Weinig.
663
664         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
665         (-[WKNetworkSessionDelegate URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:]):
666         (-[WKNetworkSessionDelegate URLSession:dataTask:willCacheResponse:completionHandler:]):
667         (-[WKNetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:]):
668         (-[WKNetworkSessionDelegate URLSession:task:didCompleteWithError:]):
669         With NSURLConnection, we stopped getting delegate callbacks once the delegate is destroyed, and everything was cancelled.
670         With NSURLSession we continue getting delegate callbacks because the session's delegate is not destroyed after each load.
671         As documented in NSURLSession.h: "In some cases, the task may signal other work before it acknowledges the cancelation."
672         In the cases where we cancel a load, delete the NetworkLoad and corresponding NetworkDataTask, we want to call all
673         completion handlers indicating that we really want to cancel instead of asserting.
674
675 2016-05-02  Darin Adler  <darin@apple.com>
676
677         Change IDL enumerations to be nested in their C++ class instead of at WebCore namespace level
678         https://bugs.webkit.org/show_bug.cgi?id=157257
679
680         Reviewed by Chris Dumez.
681
682         * WebProcess/Network/WebLoaderStrategy.cpp:
683         (WebKit::WebLoaderStrategy::loadResource): Updated since we changed
684         ReferrerHeaderPolicy back to ReferrerPolicy.
685         (WebKit::WebLoaderStrategy::schedulePluginStreamLoad): Ditto.
686
687 2016-05-02  Brady Eidson  <beidson@apple.com>
688
689         Const-ify some IDB code.
690         https://bugs.webkit.org/show_bug.cgi?id=157287
691
692         Reviewed by Alex Christensen.
693
694         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
695         (WebKit::WebIDBConnectionToServer::deleteDatabase):
696         (WebKit::WebIDBConnectionToServer::openDatabase):
697         (WebKit::WebIDBConnectionToServer::abortTransaction):
698         (WebKit::WebIDBConnectionToServer::commitTransaction):
699         (WebKit::WebIDBConnectionToServer::didFinishHandlingVersionChangeTransaction):
700         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h:
701
702 2016-05-02  Simon Fraser  <simon.fraser@apple.com>
703
704         Sort the project file.
705
706         * WebKit2.xcodeproj/project.pbxproj:
707
708 2016-05-02  Simon Fraser  <simon.fraser@apple.com>
709
710         Fix shouldUpdateScrollLayerPositionSynchronously() for non-main frames. Remove updatesScrollLayerPositionOnMainThread()
711         https://bugs.webkit.org/show_bug.cgi?id=157277
712
713         Reviewed by Dean Jackson, Tim Horton.
714
715         Remove updatesScrollLayerPositionOnMainThread() which is unused by all ports.
716
717         * WebProcess/Plugins/PDF/DeprecatedPDFPlugin.h:
718
719 2016-05-02  Alex Christensen  <achristensen@webkit.org>
720
721         Crash if a certificate chain has null certificates
722         https://bugs.webkit.org/show_bug.cgi?id=157206
723
724         Reviewed by Alexey Proskuryakov.
725
726         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
727         (WebKit::certificatesMatch):
728         SecTrustGetCertificateAtIndex can return null.
729         If this ever happens, something has gone horribly wrong in the security code and we should crash.
730         See rdar://problem/21723172
731
732 2016-05-02  Myles C. Maxfield  <mmaxfield@apple.com>
733
734         Addressing post-review comments after r200116
735         https://bugs.webkit.org/show_bug.cgi?id=157228
736
737         Reviewed by Anders Carlsson.
738
739         * Shared/WebPreferencesDefinitions.h:
740         * UIProcess/API/Cocoa/WKWebView.mm:
741         (-[WKWebView _initializeWithConfiguration:]):
742         * UIProcess/API/Cocoa/WKWebViewConfiguration.h:
743         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
744         (-[WKWebViewConfiguration encodeWithCoder:]):
745         (-[WKWebViewConfiguration initWithCoder:]):
746         (-[WKWebViewConfiguration copyWithZone:]):
747         * UIProcess/WebPageProxy.cpp:
748         * WebProcess/WebPage/WebPage.cpp:
749         (WebKit::WebPage::updatePreferences):
750
751 2016-05-02  Daniel Bates  <dabates@apple.com>
752
753         DatabaseTracker::closeAllDatabases calls Database::close from the wrong thread
754         https://bugs.webkit.org/show_bug.cgi?id=147672
755         <rdar://problem/22357464>
756
757         Reviewed by Brady Eidson.
758
759         Call DatabaseTracker::closeAllDatabases() with CurrentQueryBehavior::Interrupt so that we abort
760         a long running query and close the database immediately to avoid holding a locked file when the
761         process is suspended.
762
763         * WebProcess/WebProcess.cpp:
764         (WebKit::WebProcess::processWillSuspendImminently):
765
766 2016-05-01  Darin Adler  <darin@apple.com>
767
768         Update Fetch to use enum class instead of string for enumerations
769         https://bugs.webkit.org/show_bug.cgi?id=157241
770
771         Reviewed by Chris Dumez.
772
773         * WebProcess/Network/WebLoaderStrategy.cpp:
774         (WebKit::WebLoaderStrategy::loadResource): Updated for the change where I
775         renamed ReferrerPolicy to ReferrerHeaderPolicy, at least for now.
776         (WebKit::WebLoaderStrategy::schedulePluginStreamLoad): Ditto.
777
778 2016-05-01  Konstantin Tokarev  <annulen@yandex.ru>
779
780         Fixed build with !ENABLED(DATABASE_PROCESS).
781
782         Unreviewed build fix.
783
784         * UIProcess/Network/NetworkProcessProxy.cpp:
785         (WebKit::NetworkProcessProxy::grantSandboxExtensionsToDatabaseProcessForBlobs):
786
787 2016-04-29  Chris Dumez  <cdumez@apple.com>
788
789         Drop useless check in SpeculativeLoadManager::registerLoad()
790         https://bugs.webkit.org/show_bug.cgi?id=157204
791
792         Reviewed by Antti Koivisto.
793
794         Drop useless check in SpeculativeLoadManager::registerLoad(). There is
795         no way to end up this code path with a non-HTTP family request.
796
797         * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
798         (WebKit::NetworkCache::SpeculativeLoadManager::registerLoad):
799
800 2016-04-29  Brian Burg  <bburg@apple.com>
801
802         Web Automation: add SPI to mark an existing NSEvent as synthesized for automation
803         https://bugs.webkit.org/show_bug.cgi?id=157221
804         <rdar://problem/26019356>
805
806         Reviewed by Timothy Hatcher.
807
808         In cases where an NSEvent is duplicated, clients need to re-mark an NSEvent
809         as synthesized for automation if the original NSEvent was marked as such.
810
811         * UIProcess/API/Cocoa/_WKAutomationSession.h:
812         * UIProcess/API/Cocoa/_WKAutomationSession.mm:
813         (-[_WKAutomationSession markEventAsSynthesizedForAutomation:]):
814         * UIProcess/Automation/WebAutomationSession.h:
815         * UIProcess/Cocoa/WebAutomationSessionCocoa.mm:
816         (WebKit::WebAutomationSession::sendSynthesizedEventsToPage):
817         (WebKit::WebAutomationSession::markEventAsSynthesizedForAutomation):
818
819 2016-04-29  Brian Burg  <bburg@apple.com>
820
821         Web Automation: use a magic eventNumber as a fallback for detecting NSEvents synthesized for automation
822         https://bugs.webkit.org/show_bug.cgi?id=157222
823
824         Reviewed by Timothy Hatcher.
825
826         Sometimes events are copied and redelivered in a way that can't be reliably intercepted,
827         so use eventNumber as an alternate means of detecting synthesized mouse NSEvents.
828
829         * UIProcess/Cocoa/WebAutomationSessionCocoa.mm:
830         (WebKit::WebAutomationSession::wasEventSynthesizedForAutomation):
831         If it's a mouse-related event, check the eventNumber if the associated object was missing.
832
833         (WebKit::WebAutomationSession::platformSimulateMouseInteraction):
834         Most real events from input devices fill in eventNumber with a non-zero value.
835         In my testing, using zero did not seem to adversely affect event delivery.
836
837 2016-04-29  Joseph Pecoraro  <pecoraro@apple.com>
838
839         Web Inspector: Issues inspecting the inspector, pausing on breakpoints causes content to not load
840         https://bugs.webkit.org/show_bug.cgi?id=157198
841         <rdar://problem/26011049>
842
843         Reviewed by Timothy Hatcher.
844
845         * WebProcess/WebPage/WebInspectorFrontendAPIDispatcher.h:
846         * WebProcess/WebPage/WebInspectorFrontendAPIDispatcher.cpp:
847         (WebKit::WebInspectorFrontendAPIDispatcher::reset):
848         (WebKit::WebInspectorFrontendAPIDispatcher::frontendLoaded):
849         (WebKit::WebInspectorFrontendAPIDispatcher::suspend):
850         (WebKit::WebInspectorFrontendAPIDispatcher::unsuspend):
851         (WebKit::WebInspectorFrontendAPIDispatcher::dispatchCommand):
852         (WebKit::WebInspectorFrontendAPIDispatcher::dispatchMessageAsync):
853         (WebKit::WebInspectorFrontendAPIDispatcher::evaluateOrQueueExpression):
854         (WebKit::WebInspectorFrontendAPIDispatcher::evaluateQueuedExpressions):
855         Avoid evaluating expressions when the page is paused. Generalize the
856         message queueing and dispatching for pause/suspend that we already
857         had for waiting for the frontend page to be loaded.
858
859         * WebProcess/WebPage/WebInspectorUI.h:
860         * WebProcess/WebPage/WebInspectorUI.cpp:
861         (WebKit::WebInspectorUI::pagePaused):
862         (WebKit::WebInspectorUI::pageUnpaused):
863         When the frontend page pauses/unpauses, suspend/resume the dispatcher.
864
865 2016-04-29  Chris Dumez  <cdumez@apple.com>
866
867         Remove unnecessary isolated String copying from one of NetworkCache::Key's constructor
868         https://bugs.webkit.org/show_bug.cgi?id=157207
869
870         Reviewed by Antti Koivisto.
871
872         Remove unnecessary isolated String copying from one of NetworkCache::Key's
873         constructor. We are anyway going to create isolated copies if the Key ends
874         up getting copied.
875
876         * NetworkProcess/cache/NetworkCacheKey.cpp:
877         (WebKit::NetworkCache::Key::Key):
878
879 2016-04-29  Brian Burg  <bburg@apple.com>
880
881         Web Automation: performMouseInteraction command computes mouse event coordinates incorrectly
882         https://bugs.webkit.org/show_bug.cgi?id=157218
883         <rdar://problem/26018230>
884
885         Reviewed by Timothy Hatcher.
886
887         This patch fixes two issues: the min/max clamp was in the wrong order,
888         and the y-value did not account for the window's top content inset.
889
890         * UIProcess/Automation/WebAutomationSession.cpp:
891         (WebKit::WebAutomationSession::performMouseInteraction):
892
893 2016-04-29  Dean Jackson  <dino@apple.com>
894
895         RTL <select> popup menu is in the wrong location
896         https://bugs.webkit.org/show_bug.cgi?id=157159
897         <rdar://problem/25894451>
898
899         Reapply http://trac.webkit.org/changeset/200217
900         but with changes that will allow it to build on Yosemite.
901
902         * UIProcess/mac/WebPopupMenuProxyMac.mm:
903         (WebKit::WebPopupMenuProxyMac::showPopupMenu):
904
905 2016-04-28  Ada Chan  <adachan@apple.com>
906
907         Indicate we are processing user gesture when handling messages from WebPlaybackSessionManagerProxy to WebPlaybackSessionManager
908         https://bugs.webkit.org/show_bug.cgi?id=157151
909
910         Reviewed by Jer Noble.
911
912         Messages from WebPlaybackSessionManagerProxy to WebPlaybackSessionManager are triggered by
913         user actions, so add a UserGestureIndicator in the methods that handle those messages.
914
915         * WebProcess/cocoa/WebPlaybackSessionManager.mm:
916         (WebKit::WebPlaybackSessionManager::play):
917         (WebKit::WebPlaybackSessionManager::pause):
918         (WebKit::WebPlaybackSessionManager::togglePlayState):
919         (WebKit::WebPlaybackSessionManager::beginScrubbing):
920         (WebKit::WebPlaybackSessionManager::endScrubbing):
921         (WebKit::WebPlaybackSessionManager::seekToTime):
922         (WebKit::WebPlaybackSessionManager::fastSeek):
923         (WebKit::WebPlaybackSessionManager::beginScanningForward):
924         (WebKit::WebPlaybackSessionManager::beginScanningBackward):
925         (WebKit::WebPlaybackSessionManager::endScanning):
926         (WebKit::WebPlaybackSessionManager::selectAudioMediaOption):
927         (WebKit::WebPlaybackSessionManager::selectLegibleMediaOption):
928
929 2016-04-29  Brady Eidson  <beidson@apple.com>
930
931         Add a default ".isolatedCopy()" specialization to CrossThreadCopier, and other small cleanup.
932         https://bugs.webkit.org/show_bug.cgi?id=157185
933
934         Reviewed by Anders Carlsson.
935
936         * Shared/WebCrossThreadCopier.cpp:
937         (WebCore::Vector<char>>::copy): reserveInitialCapacity() before creating the copy.
938         (WebCore::Vector<int64_t>>::copy): Ditto.
939         (WebCore::Vector<uint8_t>>::copy): Ditto.
940         (WebCore::Vector<Vector<IDBKeyData>>>::copy): Deleted dead code.
941         * Shared/WebCrossThreadCopier.h:
942
943 2016-04-29  Commit Queue  <commit-queue@webkit.org>
944
945         Unreviewed, rolling out r200217.
946         https://bugs.webkit.org/show_bug.cgi?id=157183
947
948         This change broke the Yosemite build. (Requested by ryanhaddad
949         on #webkit).
950
951         Reverted changeset:
952
953         "RTL <select> popup menu is in the wrong location"
954         https://bugs.webkit.org/show_bug.cgi?id=157159
955         http://trac.webkit.org/changeset/200217
956
957 2016-04-29  Claudio Saavedra  <csaavedra@igalia.com>
958
959         [GTK] Move WK2 shareable code out from gtk directories
960         https://bugs.webkit.org/show_bug.cgi?id=157135
961
962         Reviewed by Darin Adler.
963
964         Both NetworkProcessMain and InjectedBundle can go out from their respective gtk directories.
965
966         * NetworkProcess/gtk/NetworkProcessMainGtk.cpp:
967         (WebKit::NetworkProcessMainUnix): Deleted.
968         * NetworkProcess/soup/NetworkProcessMainSoup.cpp: Renamed from Source/WebKit2/NetworkProcess/gtk/NetworkProcessMainGtk.cpp.
969         (WebKit::NetworkProcessMainUnix):
970         * PlatformGTK.cmake: Update.
971         * WebProcess/InjectedBundle/glib/InjectedBundleGlib.cpp: Renamed from Source/WebKit2/WebProcess/InjectedBundle/gtk/InjectedBundleGtk.cpp.
972         (WebKit::InjectedBundle::initialize):
973         (WebKit::InjectedBundle::setBundleParameter):
974         (WebKit::InjectedBundle::setBundleParameters):
975         * WebProcess/InjectedBundle/gtk/InjectedBundleGtk.cpp:
976         (WebKit::InjectedBundle::initialize): Deleted.
977         (WebKit::InjectedBundle::setBundleParameter): Deleted.
978         (WebKit::InjectedBundle::setBundleParameters): Deleted.
979
980 2016-04-28  Dean Jackson  <dino@apple.com>
981
982         RTL <select> popup menu is in the wrong location
983         https://bugs.webkit.org/show_bug.cgi?id=157159
984         <rdar://problem/25894451>
985
986         Reviewed by Simon Fraser.
987
988         Make sure the NSPopupMenu takes the text direction
989         into account, and offset the position
990         of the menu slightly if we're in RTL mode.
991
992         Unfortunately our test infrastructure is unable to exercise
993         this because it runs without a window, and the popup menu
994         is not captured in the screenshot.
995
996         * UIProcess/mac/WebPopupMenuProxyMac.mm:
997         (WebKit::WebPopupMenuProxyMac::showPopupMenu):
998
999 2016-04-28  Manuel Rego Casasnovas  <rego@igalia.com>
1000
1001         [css-grid] Add CSS Grid Layout runtime flag
1002         https://bugs.webkit.org/show_bug.cgi?id=157134
1003
1004         Reviewed by Simon Fraser.
1005
1006         Add CSS Grid Layout runtime flag based on preferences,
1007         enabled by default.
1008
1009         * Shared/WebPreferencesDefinitions.h:
1010         * UIProcess/API/C/WKPreferences.cpp:
1011         (WKPreferencesSetCSSGridLayoutEnabled):
1012         (WKPreferencesGetCSSGridLayoutEnabled):
1013         * UIProcess/API/C/WKPreferencesRefPrivate.h:
1014         * WebProcess/InjectedBundle/InjectedBundle.cpp:
1015         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
1016         * WebProcess/WebPage/WebPage.cpp:
1017         (WebKit::WebPage::updatePreferences):
1018
1019 2016-04-28  Daniel Bates  <dabates@apple.com>
1020
1021         Fix the Apple Internal OS X build
1022
1023         * UIProcess/mac/WKPrintingView.mm:
1024         (-[WKPrintingView _drawPDFDocument:page:atPoint:]): Ignore deprecation warning for -[PDFPage drawWithBox:].
1025         * WebProcess/WebPage/mac/WebPageMac.mm:
1026         (WebKit::drawPDFPage): Ditto.
1027
1028 2016-04-28  Manuel Rego Casasnovas  <rego@igalia.com>
1029
1030         Fix mistake in custom elements runtime flag
1031         https://bugs.webkit.org/show_bug.cgi?id=157130
1032
1033         Reviewed by Chris Dumez.
1034
1035         The methods for the custom elements runtime flag were using
1036         the Shadow DOM flag instead.
1037         These methods were introduced in r197921,
1038         it seems it was just a copy&paste mistake.
1039
1040         * UIProcess/API/C/WKPreferences.cpp:
1041         (WKPreferencesSetCustomElementsEnabled):
1042         (WKPreferencesGetCustomElementsEnabled):
1043
1044 2016-04-28  Carlos Garcia Campos  <cgarcia@igalia.com>
1045
1046         Unreviewed. Add missing files to the compilation of GTK+ inspector.
1047
1048         * PlatformGTK.cmake:
1049
1050 2016-04-27  Dan Bernstein  <mitz@apple.com>
1051
1052         <rdar://problem/25915253> REGRESSION (r199628): Netflix playback fails in Safari Technology Preview with error code S7363-1260-FFFF58D8
1053
1054         Rubber-stamped by Tim Horton.
1055
1056         Reverted r199628.
1057
1058         * Configurations/WebContentService.xcconfig:
1059
1060 2016-04-27  Brady Eidson  <beidson@apple.com>
1061
1062         Modern IDB: Implement native IDBFactory.getAllDatabaseNames for WebInspector.
1063         https://bugs.webkit.org/show_bug.cgi?id=157072
1064
1065         Reviewed by Alex Christensen.
1066
1067         Handle the process hop for the new getAllDatabaseNames call.
1068         
1069         * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.cpp:
1070         (WebKit::WebIDBConnectionToClient::didGetAllDatabaseNames):
1071         (WebKit::WebIDBConnectionToClient::getAllDatabaseNames):
1072         * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.h:
1073         * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.messages.in:
1074
1075         * Shared/WebCrossThreadCopier.cpp:
1076         (WebCore::SecurityOriginData>::copy): Deleted, as its in WebCore now.
1077         * Shared/WebCrossThreadCopier.h:
1078
1079         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
1080         (WebKit::WebIDBConnectionToServer::getAllDatabaseNames):
1081         (WebKit::WebIDBConnectionToServer::didGetAllDatabaseNames):
1082         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h:
1083         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.messages.in:
1084
1085 2016-04-27  Simon Fraser  <simon.fraser@apple.com>
1086
1087         [iOS WK2] When determining tile size, check whether ancestor UIScrollViews are actually scrollable
1088         https://bugs.webkit.org/show_bug.cgi?id=157107
1089         rdar://problem/25943577
1090
1091         Reviewed by Tim Horton.
1092         
1093         We should only fall back to 512x512 tiles if the WKWebView has a UIScrollView ancestor,
1094         and that UIScrollView actually scrolls. This avoids falling back to small tiles in
1095         MobileSafari.
1096
1097         Rename "enclosedInScrollView" to "enclosedInScrollableAncestorView" everywhere.
1098
1099         * Shared/VisibleContentRectUpdateInfo.cpp:
1100         (WebKit::VisibleContentRectUpdateInfo::encode):
1101         (WebKit::VisibleContentRectUpdateInfo::decode):
1102         * Shared/VisibleContentRectUpdateInfo.h:
1103         (WebKit::VisibleContentRectUpdateInfo::VisibleContentRectUpdateInfo):
1104         (WebKit::VisibleContentRectUpdateInfo::enclosedInScrollableAncestorView):
1105         (WebKit::operator==):
1106         (WebKit::VisibleContentRectUpdateInfo::enclosedInScrollView): Deleted.
1107         * UIProcess/API/Cocoa/WKWebView.mm:
1108         (scrollViewCanScroll):
1109         (-[WKWebView _updateContentRectsWithState:]):
1110         * UIProcess/ios/WKContentView.h:
1111         * UIProcess/ios/WKContentView.mm:
1112         (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:obscuredInset:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]):
1113         (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:obscuredInset:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollView:]): Deleted.
1114         * WebProcess/WebPage/ios/WebPageIOS.mm:
1115         (WebKit::WebPage::updateVisibleContentRects):
1116
1117 2016-04-26  Ada Chan  <adachan@apple.com>
1118
1119         Set WebVideoFullscreenInterfaceMac up as a client of WebPlaybackSessionInterfaceMac to listen for playback state changes
1120         https://bugs.webkit.org/show_bug.cgi?id=157008
1121
1122         Reviewed by Jer Noble.
1123
1124         Since WebVideoFullscreenInterfaceMac holds onto WebPlaybackSessionInterfaceMac, we can't let
1125         WebPlaybackSessionManagerProxy unregister the context for that media element while
1126         WebVideoFullscreenInterfaceMac is still using it. WebVideoFullscreenInterfaceMac should add
1127         to the client count for that WebPlaybackSession context.
1128
1129         * UIProcess/Cocoa/WebVideoFullscreenManagerProxy.mm:
1130         (WebKit::WebVideoFullscreenManagerProxy::createModelAndInterface):
1131         When the context for the media element is created with the WebVideoFullscreenManagerProxy, it should
1132         add one to the client count for the media element context in WebPlaybackSessionManagerProxy.
1133         (WebKit::WebVideoFullscreenManagerProxy::removeClientForContext):
1134         When WebVideoFullscreenManagerProxy unregisters the context for this media element, it should
1135         subtract one from the client count for the media element context in WebPlaybackSessionManagerProxy.
1136
1137         * WebProcess/cocoa/WebPlaybackSessionManager.mm:
1138         (WebKit::WebPlaybackSessionManager::clearPlaybackControlsManager):
1139         Bail early if m_controlsManagerContextId is zero. Otherwise, we'd end up sending a
1140         ClearPlaybackControlsManager message to the UI process inadvertently.
1141         (WebKit::WebPlaybackSessionManager::contextIdForMediaElement):
1142         Make sure the model element for the context ID is set to the media element.
1143
1144         * WebProcess/cocoa/WebVideoFullscreenManager.mm:
1145         (WebKit::WebVideoFullscreenManager::createModelAndInterface):
1146         When the context for the media element is created with the WebVideoFullscreenManager, it should
1147         add one to the client count for the media element context in WebPlaybackSessionManager.
1148         (WebKit::WebVideoFullscreenManager::removeContext):
1149         When WebVideoFullscreenManager unregisters the context for this media element, it should
1150         subtract one from the client count for the media element context in WebPlaybackSessionManager.
1151
1152 2016-04-27  Alex Christensen  <achristensen@webkit.org>
1153
1154         Remove download message receiver when NetworkProcess crashes
1155         https://bugs.webkit.org/show_bug.cgi?id=157102
1156         <rdar://problem/25550106>
1157
1158         Reviewed by Anders Carlsson.
1159
1160         * UIProcess/Downloads/DownloadProxyMap.cpp:
1161         (WebKit::DownloadProxyMap::processDidClose):
1162         When the NetworkProcess crashes during a download, we want to remove the message receiver from the map
1163         so we don't get an assertion in ~MessageReceiver in the UIProcess so we do not have a freed
1164         message receiver in the map.
1165
1166 2016-04-27  Alex Christensen  <achristensen@webkit.org>
1167
1168         Fix client certificate authentication with NSURLSession on iOS
1169         https://bugs.webkit.org/show_bug.cgi?id=157094
1170         <rdar://problem/25946859>
1171
1172         Reviewed by Darin Adler.
1173
1174         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
1175         (-[WKNetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:]):
1176         We only want to create a non-persistent credential with the given user and password 
1177         and store the user and password in the CredentialStorage if there is a user and password.
1178         We previously only skipped this if we were doing server trust evaluation, in which case 
1179         we will have a credential from serverTrustCredential which has no user or password.
1180         When doing client certificate authentication on iOS, this completion handler is called with
1181         a credential with session persistence and also no user or password, so we need to do the same thing.
1182         The reason this was never hit on Mac was because the credential came from tryUseCertificateInfoForChallenge,
1183         which always had persistence none.
1184
1185 2016-04-27  Claudio Saavedra  <csaavedra@igalia.com>
1186
1187         [GTK][EFL] Move WK2 platform code to a common place
1188         https://bugs.webkit.org/show_bug.cgi?id=157069
1189
1190         Reviewed by Carlos Garcia Campos.
1191
1192         Logging implementation can be shared between EFL and GTK, so move it to unix.
1193         The GTK Module implementation doesn't depend on GTK anyhow so move it to glib.
1194
1195         * Platform/efl/LoggingEfl.cpp: Removed.
1196         (WebKit::logLevelString): Deleted.
1197         * Platform/glib/ModuleGlib.cpp: Renamed from Source/WebKit2/Platform/gtk/ModuleGtk.cpp.
1198         (WebKit::Module::load):
1199         (WebKit::Module::unload):
1200         (WebKit::Module::platformFunctionPointer):
1201         * Platform/gtk/LoggingGtk.cpp:
1202         (WebKit::logLevelString): Deleted.
1203         * Platform/gtk/ModuleGtk.cpp:
1204         (WebKit::Module::load): Deleted.
1205         (WebKit::Module::unload): Deleted.
1206         (WebKit::Module::platformFunctionPointer): Deleted.
1207         * Platform/unix/LoggingUnix.cpp: Renamed from Source/WebKit2/Platform/gtk/LoggingGtk.cpp.
1208         (WebKit::logLevelString):
1209         * PlatformEfl.cmake: Update.
1210         * PlatformGTK.cmake: Update
1211
1212 2016-04-27  Alex Christensen  <achristensen@webkit.org>
1213
1214         Fix assertion when downloading with NSURLSession after r198955
1215         https://bugs.webkit.org/show_bug.cgi?id=157051
1216
1217         Reviewed by Brady Eidson.
1218
1219         * NetworkProcess/NetworkProcess.cpp:
1220         (WebKit::NetworkProcess::continueDecidePendingDownloadDestination):
1221
1222 2016-04-27  Carlos Garcia Campos  <cgarcia@igalia.com>
1223
1224         REGRESSION(r200094): [FreeType] Vertical text is broken after r200094
1225         https://bugs.webkit.org/show_bug.cgi?id=157066
1226
1227         Reviewed by Martin Robinson.
1228
1229         Add Source/WebCore/platform/graphics/freetype to the list of include dirs, because now FontPlatformData.h
1230         includes FcUniquePtr.h.
1231
1232         * PlatformEfl.cmake:
1233         * PlatformGTK.cmake:
1234
1235 2016-04-26  Joseph Pecoraro  <pecoraro@apple.com>
1236
1237         Uncaught Exception: SecurityError: DOM Exception 18: An attempt was made to break through the security policy of the user agent.
1238         https://bugs.webkit.org/show_bug.cgi?id=156991
1239         <rdar://problem/25913475>
1240
1241         Reviewed by Timothy Hatcher.
1242
1243         * UIProcess/mac/WebInspectorProxyMac.mm:
1244         (WebKit::WebInspectorProxy::platformCreateInspectorPage):
1245         Explicitly always allow access to storage for Web Inspector content just
1246         in case, as we already allow universal file access.
1247
1248 2016-04-26  Myles C. Maxfield  <mmaxfield@apple.com>
1249
1250         [WK2] [OS X] Create API for switching RTL scrollbar policy
1251         https://bugs.webkit.org/show_bug.cgi?id=156948
1252         <rdar://problem/25707757>
1253
1254         Reviewed by Darin Adler.
1255
1256         Add the new API.
1257
1258         * Shared/WebPreferencesDefinitions.h:
1259         * UIProcess/API/Cocoa/WKWebView.mm:
1260         (-[WKWebView _initializeWithConfiguration:]):
1261         * UIProcess/API/Cocoa/WKWebViewConfiguration.h:
1262         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
1263         (-[WKWebViewConfiguration init]):
1264         (-[WKWebViewConfiguration encodeWithCoder:]):
1265         (-[WKWebViewConfiguration initWithCoder:]):
1266         (-[WKWebViewConfiguration copyWithZone:]):
1267         * UIProcess/WebPageProxy.cpp:
1268         * WebProcess/Plugins/PDF/DeprecatedPDFPlugin.h:
1269         * WebProcess/WebPage/WebPage.cpp:
1270         (WebKit::WebPage::updatePreferences):
1271
1272 2016-04-26  Beth Dakin  <bdakin@apple.com>
1273
1274         Check to make sure shouldRequestCandidates() before requesting candidates
1275         https://bugs.webkit.org/show_bug.cgi?id=157038
1276         -and corresponding-
1277         rdar://problem/25910418
1278
1279         Reviewed by Tim Horton.
1280
1281         This patch limits requesting and showing candidates to cases where 
1282         shouldRequestCandidates() is true. This patch also caches the sequence number 
1283         returned by [NSSpellChecker requestCandidatesForSelectedRange:] to make sure 
1284         it is equal to the sequence number sent to the callback handler so that we do 
1285         not show candidates for old requests.
1286
1287         * UIProcess/Cocoa/WebViewImpl.h:
1288         * UIProcess/Cocoa/WebViewImpl.mm:
1289         (WebKit::WebViewImpl::updateWebViewImplAdditions):
1290         (WebKit::WebViewImpl::shouldRequestCandidates):
1291         (WebKit::WebViewImpl::showCandidates):
1292         (WebKit::WebViewImpl::requestCandidatesForSelectionIfNeeded):
1293         (WebKit::WebViewImpl::handleRequestedCandidates):
1294
1295 2016-04-26  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
1296
1297         [EFL] Update expectation result in ewk_context_preferred_languages API test
1298         https://bugs.webkit.org/show_bug.cgi?id=157027
1299
1300         Reviewed by Carlos Garcia Campos.
1301
1302         platformLanguage() has been returning lower case value since r199815. Thus existing expected result
1303         needs to be updated together.
1304
1305         * UIProcess/API/efl/tests/test_ewk2_context.cpp: Change en-US with en-us.
1306         (TEST_F):
1307
1308 2016-04-26  Zan Dobersek  <zdobersek@igalia.com>
1309
1310         Mark two methods in the CoordinatedGraphicsScene and the
1311         ThreadedCoordinatedLayerTreeHost classes as overrides, fixing
1312         the compiler warnings.
1313
1314         Rubber-stamped by Carlos Garcia Campos.
1315
1316         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h:
1317         * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h:
1318
1319 2016-04-25  Ryosuke Niwa  <rniwa@webkit.org>
1320
1321         Remove the build flag for template elements
1322         https://bugs.webkit.org/show_bug.cgi?id=157022
1323
1324         Reviewed by Daniel Bates.
1325
1326         * Configurations/FeatureDefines.xcconfig:
1327
1328 2016-04-25  Chris Dumez  <cdumez@apple.com>
1329
1330         Crash under -[WKWebView _mayAutomaticallyShowVideoPictureInPicture] + 32 (WKWebView.mm:309)
1331         https://bugs.webkit.org/show_bug.cgi?id=156990
1332         <rdar://problem/25904376>
1333
1334         Reviewed by Jer Noble.
1335
1336         In case of WebProcess crash, WebPageProxy::processDidCrash() will call resetState() which
1337         will nullify WebPageProxy::m_videoFullscreenManager. In WebPageProxy::reattachToWebProcess(),
1338         we then call updateViewState() before re-initializing m_videoFullscreenManager, and
1339         updateViewState() ends up calling [WKWebView _mayAutomaticallyShowVideoPictureInPicture]
1340         which dereferences WebPageProxy::m_videoFullscreenManager without null check. This patch
1341         adds a null check for m_videoFullscreenManager in _mayAutomaticallyShowVideoPictureInPicture.
1342
1343         * UIProcess/API/Cocoa/WKWebView.mm:
1344         (-[WKWebView _mayAutomaticallyShowVideoPictureInPicture]):
1345
1346 2016-04-25  Dan Bernstein  <mitz@apple.com>
1347
1348         Fix a couple of mistakes from r199700.
1349
1350         Rubber-stamped by Anders Carlsson.
1351
1352         * UIProcess/API/Cocoa/WKPreferencesPrivate.h: Added availability attributes to new properties.
1353         * WebKit2.xcodeproj/project.pbxproj: Demoted _WKExperimentalFeatureInternal.h from Private to Project.
1354
1355 2016-04-24  Hunseop Jeong  <hs85.jeong@samsung.com>
1356
1357         [EFL] Update the ewk_settings_offline_web_application_cache_enabled_get() expected value after r199854.
1358         https://bugs.webkit.org/show_bug.cgi?id=156968
1359
1360         Reviewed by Gyuyoung Kim.
1361
1362         * UIProcess/API/C/WKPreferencesRef.h: Update the comment.
1363         * UIProcess/API/efl/tests/test_ewk2_settings.cpp: 
1364         (TEST_F):
1365
1366 2016-04-23  Andy Estes  <aestes@apple.com>
1367
1368         Fix issues found by the clang static analyzer
1369         https://bugs.webkit.org/show_bug.cgi?id=156956
1370
1371         Reviewed by Alexey Proskuryakov.
1372
1373         * UIProcess/API/Cocoa/WKPreviewActionItem.mm:
1374         (-[WKPreviewAction dealloc]): Added to release _identifier.
1375         * UIProcess/_WKWebViewPrintFormatter.mm:
1376         (-[_WKWebViewPrintFormatter dealloc]): Released _frameToPrint.
1377         * UIProcess/ios/WKContentViewInteraction.mm:
1378         (-[WKContentView inputView]): -createPeripheralWithView: returned a retained object, but the method name did not
1379         match Cocoa conventions. Called -initWithView: instead.
1380         (-[WKContentView _showAttachmentSheet]): Stored the _WKActivatedElementInfo in a RetainPtr.
1381         (-[WKContentView _dataForPreviewItemController:atPosition:type:]): Ditto.
1382         (+[WKAutocorrectionContext autocorrectionContextWithData:markedText:selectedText:afterText:selectedRangeInMarkedText:]):
1383         The properties contextBeforeSelection, selectedText, markedText, and contextAfterSelection have the 'copy'
1384         annotation in UIWKAutocorrectionContext, so the additional copy made here would be leaked. Removed the extra copy.
1385         (-[WKAutocorrectionContext dealloc]): Deleted.
1386         * UIProcess/ios/forms/WKFormInputControl.h: Removed -createPeripheralWithView: and declared -initWithView:.
1387         * UIProcess/ios/forms/WKFormInputControl.mm:
1388         (-[WKFormInputControl initWithView:]): Changed to return instancetype.
1389         (+[WKFormInputControl createPeripheralWithView:]): Deleted.
1390         * UIProcess/ios/forms/WKFormSelectControl.h: Removed -createPeripheralWithView: and declared -initWithView:.
1391         * UIProcess/ios/forms/WKFormSelectControl.mm:
1392         (+[WKFormSelectControl createPeripheralWithView:]): Deleted.
1393         * UIProcess/mac/LegacySessionStateCoding.cpp:
1394         (WebKit::decodeLegacySessionState): If dynamic_cf_cast returned nullptr, the result of
1395         CFPropertyListCreateWithData would leak. Stored the CFPropertyListRef in a RetainPtr before calling dynamic_cf_cast.
1396         * UIProcess/mac/ServicesController.mm:
1397         (WebKit::ServicesController::refreshExistingServices): Used a RetainPtr for attachment and cell.
1398         * UIProcess/mac/WebContextMenuProxyMac.mm:
1399         (WebKit::WebContextMenuProxyMac::setupServicesMenu): Used a RetainPtr for groupEntry.
1400
1401 2016-04-23  Chris Dumez  <cdumez@apple.com>
1402
1403         Tie the DiagnosticLoggingClient's lifetime to the Page
1404         https://bugs.webkit.org/show_bug.cgi?id=156938
1405         <rdar://problem/25851499>
1406
1407         Reviewed by Antti Koivisto.
1408
1409         * WebProcess/WebCoreSupport/WebDiagnosticLoggingClient.cpp:
1410         (WebKit::WebDiagnosticLoggingClient::pageDestroyed):
1411         (WebKit::WebDiagnosticLoggingClient::mainFrameDestroyed): Deleted.
1412         * WebProcess/WebCoreSupport/WebDiagnosticLoggingClient.h:
1413         * WebProcess/WebPage/ios/WebPageIOS.mm:
1414         (WebKit::WebPage::willStartUserTriggeredZooming):
1415
1416 2016-04-23  Dan Bernstein  <mitz@apple.com>
1417
1418         <rdar://problem/25893246> WebKit2 has failed to build: error: use of undeclared identifier 'm_playbackSessionManager'
1419
1420         Fixed the non-AVKit build.
1421
1422         * UIProcess/API/Cocoa/WKWebView.mm:
1423         (-[WKWebView _isShowingVideoPictureInPicture]):
1424         (-[WKWebView _mayAutomaticallyShowVideoPictureInPicture]):
1425         * UIProcess/WebPageProxy.cpp:
1426         (WebKit::WebPageProxy::fullScreenManager):
1427         (WebKit::WebPageProxy::playbackSessionManager):
1428         * UIProcess/WebPageProxy.h:
1429         * UIProcess/ios/WebPageProxyIOS.mm:
1430         (WebKit::WebPageProxy::applicationDidBecomeActive):
1431         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1432         (WebKit::WebChromeClient::createScrollingCoordinator):
1433         (WebKit::WebChromeClient::supportsVideoFullscreen):
1434         * WebProcess/WebCoreSupport/WebChromeClient.h:
1435         * WebProcess/WebPage/WebPage.cpp:
1436         (WebKit::WebPage::inspectorUI):
1437         (WebKit::WebPage::playbackSessionManager):
1438         * WebProcess/WebPage/WebPage.h:
1439         * WebProcess/cocoa/WebVideoFullscreenManager.h:
1440         * WebProcess/cocoa/WebVideoFullscreenManager.mm:
1441
1442 2016-04-22  Ryan Haddad  <ryanhaddad@apple.com>
1443
1444         Fixing a typo in my last commit.
1445
1446         Unreviewed build fix.
1447
1448         * UIProcess/Cocoa/WebVideoFullscreenManagerProxy.messages.in:
1449         * WebProcess/cocoa/WebVideoFullscreenManager.messages.in:
1450
1451 2016-04-22  Ryan Haddad  <ryanhaddad@apple.com>
1452
1453         Missed some macros to fix builds that do not support AVKit.
1454
1455         Unreviewed build fix.
1456
1457         * UIProcess/Cocoa/WebVideoFullscreenManagerProxy.messages.in:
1458         * WebProcess/cocoa/WebVideoFullscreenManager.messages.in:
1459
1460 2016-04-22  Ryan Haddad  <ryanhaddad@apple.com>
1461
1462         Fix builds that do not support AVKit
1463
1464         Unreviewed build fix.
1465
1466         * UIProcess/WebPageProxy.h:
1467
1468 2016-04-22  Ryan Haddad  <ryanhaddad@apple.com>
1469
1470         Take 2 for fixing builds that do not support AVKit
1471
1472         Unreviewed build fix.
1473
1474         * UIProcess/Cocoa/WebVideoFullscreenManagerProxy.h:
1475         * UIProcess/WebPageProxy.cpp:
1476         (WebKit::WebPageProxy::resetState):
1477
1478 2016-04-22  Anders Carlsson  <andersca@apple.com>
1479
1480         WKWebView WebSQL is not enabled
1481         https://bugs.webkit.org/show_bug.cgi?id=156928
1482         rdar://problem/19029603
1483
1484         Reviewed by Beth Dakin.
1485
1486         Give databases a default quota of 50 MB, matching what we have in UIWebView.
1487
1488         * UIProcess/Cocoa/UIDelegate.mm:
1489         (WebKit::UIDelegate::UIClient::exceededDatabaseQuota):
1490
1491 2016-04-22  Ryan Haddad  <ryanhaddad@apple.com>
1492
1493         Fix builds that do not support AVKit
1494
1495         Unreviewed build fix.
1496
1497         * UIProcess/Cocoa/WebVideoFullscreenManagerProxy.h:
1498         * UIProcess/Cocoa/WebVideoFullscreenManagerProxy.mm:
1499         * UIProcess/WebPageProxy.cpp:
1500         (WebKit::WebPageProxy::WebPageProxy):
1501         (WebKit::WebPageProxy::reattachToWebProcess):
1502         (WebKit::WebPageProxy::viewDidLeaveWindow):
1503         * UIProcess/ios/WebPageProxyIOS.mm:
1504
1505 2016-04-22  Brady Eidson  <beidson@apple.com>
1506
1507         Modern IDB: Rework the ownership/RefCounting model of IDBConnectionToServer and IDBConnectionProxy.
1508         https://bugs.webkit.org/show_bug.cgi?id=156916
1509
1510         Reviewed by Tim Horton.
1511
1512         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
1513         (WebKit::WebIDBConnectionToServer::WebIDBConnectionToServer):
1514
1515 2016-04-22  Zan Dobersek  <zdobersek@igalia.com>
1516
1517         NetworkCacheIOChannelSoup: detach the newly-created IOChannel::readSync thread
1518         https://bugs.webkit.org/show_bug.cgi?id=156907
1519
1520         Reviewed by Carlos Garcia Campos.
1521
1522         * NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp:
1523         (WebKit::NetworkCache::IOChannel::readSyncInThread): Detach the new thread,
1524         ensuring the resources are released after the thread exits. Next step is
1525         to set up a thread pool and use that, avoiding thread re-creation.
1526
1527 2016-04-21  Dean Jackson  <dino@apple.com>
1528
1529         Backdrop Filter should not be visible if element has visibility:hidden
1530         https://bugs.webkit.org/show_bug.cgi?id=149318
1531         <rdar://problem/22749780>
1532
1533         Reviewed by Simon Fraser.
1534
1535         Add the isHidden method to PlatformCALayerRemote.
1536
1537         * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
1538         (WebKit::PlatformCALayerRemote::isHidden):
1539         * WebProcess/WebPage/mac/PlatformCALayerRemote.h:
1540
1541 2016-04-21  Anders Carlsson  <andersca@apple.com>
1542
1543         WKWebView HTML5 AppCache not working
1544         https://bugs.webkit.org/show_bug.cgi?id=156887
1545         rdar://problem/17944162
1546
1547         Reviewed by Tim Horton.
1548
1549         * Shared/WebPreferencesDefinitions.h:
1550         Set the offlineWebApplicationCacheEnabled property to true by default.
1551
1552         * UIProcess/API/Cocoa/APIWebsiteDataStoreCocoa.mm:
1553         (API::WebsiteDataStore::defaultDataStoreConfiguration):
1554         Set the default applicationCacheFlatFileSubdirectoryName to "Files".
1555
1556 2016-04-21  Anders Carlsson  <andersca@apple.com>
1557
1558         Get rid of the last uses of ApplicationCacheStorage::singleton() from WebKit2
1559         https://bugs.webkit.org/show_bug.cgi?id=156876
1560
1561         Reviewed by Tim Horton.
1562
1563         * Shared/WebProcessCreationParameters.cpp:
1564         (WebKit::WebProcessCreationParameters::encode):
1565         (WebKit::WebProcessCreationParameters::decode):
1566         * Shared/WebProcessCreationParameters.h:
1567         Add and encode and decode a applicationCacheFlatFileSubdirectoryName.
1568
1569         * UIProcess/API/APIProcessPoolConfiguration.cpp:
1570         (API::ProcessPoolConfiguration::createWithLegacyOptions):
1571         Set m_applicationCacheFlatFileSubdirectoryName to "ApplicationCache".
1572
1573         (API::ProcessPoolConfiguration::ProcessPoolConfiguration):
1574         Set m_applicationCacheFlatFileSubdirectoryName to "Files".
1575
1576         (API::ProcessPoolConfiguration::copy):
1577         Copy m_applicationCacheFlatFileSubdirectoryName.
1578
1579         * UIProcess/API/APIProcessPoolConfiguration.h:
1580         Add getter for applicationCacheFlatFileSubdirectoryName.
1581
1582         * UIProcess/WebProcessPool.cpp:
1583         (WebKit::legacyWebsiteDataStoreConfiguration):
1584         Initialize applicationCacheFlatFileSubdirectoryName from the process pool configuration.
1585
1586         (WebKit::WebProcessPool::createNewWebProcess):
1587         Initialize parameters.applicationCacheFlatFileSubdirectoryName. Remove a call to 
1588         ApplicationCacheStorage::singleton().setDefaultOriginQuota since it had no effect (it was called in the UI process).
1589
1590         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1591         (WebKit::WebsiteDataStore::WebsiteDataStore):
1592         Initialize m_applicationCacheFlatFileSubdirectoryName.
1593
1594         (WebKit::WebsiteDataStore::fetchData):
1595         (WebKit::WebsiteDataStore::removeData):
1596         Pass m_applicationCacheFlatFileSubdirectoryName when creating the application cache storage.
1597
1598         * UIProcess/WebsiteData/WebsiteDataStore.h:
1599         Add new members.
1600
1601         * WebProcess/WebPage/WebPage.cpp:
1602         (WebKit::WebPage::WebPage):
1603         Set the application cache storage.
1604
1605         * WebProcess/WebProcess.cpp:
1606         (WebKit::WebProcess::initializeWebProcess):
1607         Initialize the application cache storage.
1608
1609         * WebProcess/WebProcess.h:
1610         (WebKit::WebProcess::applicationCacheStorage):
1611         Add new getter.
1612
1613 2016-04-21  Anders Carlsson  <andersca@apple.com>
1614
1615         Remove two uses of ApplicationCacheStorage::singleton() from WebKit2
1616         https://bugs.webkit.org/show_bug.cgi?id=156873
1617
1618         Reviewed by Beth Dakin.
1619
1620         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1621         (WebKit::WebChromeClient::reachedApplicationCacheOriginQuota):
1622         * WebProcess/WebProcess.cpp:
1623         (WebKit::WebProcess::clearApplicationCache): Deleted.
1624         * WebProcess/WebProcess.h:
1625
1626 2016-04-21  Beth Dakin  <bdakin@apple.com>
1627
1628         showCandidates() should take a range and the string should be the whole 
1629         paragraph
1630         https://bugs.webkit.org/show_bug.cgi?id=156813
1631         -and corresponding-
1632         rdar://problem/25760533
1633
1634         Reviewed by Tim Horton.
1635
1636         * UIProcess/Cocoa/WebViewImpl.h:
1637         * UIProcess/Cocoa/WebViewImpl.mm:
1638         (WebKit::WebViewImpl::updateWebViewImplAdditions):
1639         (WebKit::WebViewImpl::showCandidates):
1640         (WebKit::WebViewImpl::requestCandidatesForSelectionIfNeeded):
1641         (WebKit::WebViewImpl::handleRequestedCandidates):
1642
1643 2016-04-21  Chelsea Pugh  <cpugh@apple.com>
1644
1645         [iOS] Allow clients to hide the accessory view on a form input session
1646         https://bugs.webkit.org/show_bug.cgi?id=155574
1647
1648         Reviewed by Dan Bernstein.
1649
1650         * UIProcess/API/Cocoa/_WKFormInputSession.h:
1651         * UIProcess/ios/WKContentViewInteraction.mm:
1652         (-[WKFormInputSession accessoryViewShouldNotShow]): Getter for accessoryViewShouldNotShow.
1653         (-[WKFormInputSession setAccessoryViewShouldNotShow:]): Set accessoryViewShouldNotShow and reload input views.
1654         (-[WKContentView requiresAccessoryView]): If the accessory view should be not be shown, do not require
1655         the accessory view.
1656
1657 2016-04-21  Chris Dumez  <cdumez@apple.com>
1658
1659         Drop [UsePointersEvenForNonNullableObjectArguments] from Range
1660         https://bugs.webkit.org/show_bug.cgi?id=156805
1661
1662         Reviewed by Youenn Fablet.
1663
1664         * WebProcess/InjectedBundle/API/mac/WKDOMRange.mm:
1665         (-[WKDOMRange setStart:offset:]):
1666         (-[WKDOMRange setEnd:offset:]):
1667         (-[WKDOMRange selectNode:]):
1668         (-[WKDOMRange selectNodeContents:]):
1669         * WebProcess/WebPage/WebFrame.cpp:
1670         (WebKit::WebFrame::contentsAsString):
1671
1672 2016-04-21  Carlos Garcia Campos  <cgarcia@igalia.com>
1673
1674         [GTK] WebKitWebView should claim the contents size as its natural size
1675         https://bugs.webkit.org/show_bug.cgi?id=156835
1676
1677         Reviewed by Žan Doberšek.
1678
1679         And keep claiming 0 as its minimum size since it's scrollable.
1680
1681         * UIProcess/API/gtk/PageClientImpl.cpp:
1682         (WebKit::PageClientImpl::didChangeContentSize): Call webkitWebViewBaseSetContentsSize().
1683         * UIProcess/API/gtk/PageClientImpl.h:
1684         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
1685         (webkitWebViewBaseGetPreferredWidth): Return the contents width as natural width.
1686         (webkitWebViewBaseGetPreferredHeight): Return the contents height as natural height.
1687         (webkit_web_view_base_class_init): Add implementations of get_preferred_width/height.
1688         (webkitWebViewBaseSetContentsSize): Save the contents size.
1689         * UIProcess/API/gtk/WebKitWebViewBasePrivate.h:
1690
1691 2016-04-21  Carlos Garcia Campos  <cgarcia@igalia.com>
1692
1693         [GTK] WebKitWebView should propagate wheel events not handled by the web process
1694         https://bugs.webkit.org/show_bug.cgi?id=156834
1695
1696         Reviewed by Žan Doberšek.
1697
1698         We are currently swallowing all wheel events unconditionally, not allowing applications to handle wheel events
1699         when not handled by us. Since the GTK+ event propagation system is synchronous, and our events are handled
1700         asynchronously, we need to do something similar to what we do for key events, not propagate the event the first
1701         time and if not handled by the web process, re-inject it in the event loop and then just propagate it.
1702
1703         * Shared/NativeWebWheelEvent.h:
1704         (WebKit::NativeWebWheelEvent::nativeEvent): Remove useless const.
1705         * UIProcess/API/gtk/PageClientImpl.cpp:
1706         (WebKit::PageClientImpl::wheelEventWasNotHandledByWebCore): Tell the web view to propagate the next wheel event,
1707         and re-inject the event not handled by the web process in the event loop.
1708         * UIProcess/API/gtk/PageClientImpl.h:
1709         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
1710         (webkitWebViewBaseScrollEvent): Propagate the event if shouldForwardNextWheelEvent is true.
1711         (webkitWebViewBaseForwardNextWheelEvent): Set shouldForwardNextWheelEvent to true.
1712         * UIProcess/API/gtk/WebKitWebViewBasePrivate.h:
1713         * UIProcess/PageClient.h:
1714         * UIProcess/WebPageProxy.cpp:
1715         (WebKit::WebPageProxy::didReceiveEvent): Remove ifdef.
1716         * UIProcess/efl/WebView.h:
1717
1718 2016-04-20  Dustin Falgout  <dustin@falgout.us>
1719
1720         [GTK] Expose AllowUniversalAccessFromFileURLs preference now that calling localStorage.getItem() results in SecurityError: DOM Exception 18
1721         
1722         Reviewed by Michael Catanzaro.
1723                 
1724         As of r197858 JavaScript loaded in the context of a file scheme url cannot access local storage. That is a major 
1725         breaking change as many applications that serve files locally rely on having access to local storage. The point  
1726         of that security fix is to avoid cases of downloaded HTML content (such as e-mail attachments or JS injected
1727         into local contexts) from having access to your local file system and arbitrary local storage. If you are serving 
1728         local files in your applications, you can use the WebKitAllowUniversalAccessFromFileURLs preference key to tell 
1729         Webkit that you are approve of these kinds of interactions.
1730                                               
1731         https://bugs.webkit.org/show_bug.cgi?id=156651
1732
1733         * UIProcess/API/gtk/WebKitSettings.cpp:
1734         (webKitSettingsSetProperty):
1735         (webKitSettingsGetProperty):
1736         (webkit_settings_class_init):
1737         (webkit_settings_get_allow_universal_access_from_file_urls):
1738         (webkit_settings_set_allow_universal_access_from_file_urls):
1739         * UIProcess/API/gtk/WebKitSettings.h:
1740         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
1741
1742 2016-04-20  Brady Eidson  <beidson@apple.com>
1743
1744         Modern IDB (Workers): Enable INDEXED_DATABASE_IN_WORKERS compile time flag, but disabled in RuntimeEnabledFeatures.
1745         https://bugs.webkit.org/show_bug.cgi?id=156782
1746
1747         Reviewed by Alex Christensen.
1748
1749         * Configurations/FeatureDefines.xcconfig:
1750
1751 2016-04-20  Brent Fulgham  <bfulgham@apple.com>
1752
1753         [WK2][Mac][iOS] WebContent crash when using special file:// URI scheme @ WebKit::resolveSymlinksInPath(WTF::CString const&) + 159
1754         https://bugs.webkit.org/show_bug.cgi?id=156747
1755         <rdar://problem/24648176>
1756
1757         Reviewed by Alexey Proskuryakov.
1758
1759         FileSystemCF::fileSystemRepresentation return a null string when presented with a file URL that contains embedded nulls. When
1760         this happens, SandboxExtension::createHandle attempts to pass a null string to 'resolveSymlinksInPath', which attemps to call
1761         'strrchr' on the null pointer, causing a crash.
1762
1763         Test: fast/url/file-uri-with-embedded-null-no-crash.html
1764
1765         * Shared/mac/SandboxExtensionMac.mm:
1766         (WebKit::SandboxExtension::createHandle): If 'fileSystemRepresentation' is null, return early with an error.
1767
1768 2016-04-19  Alex Christensen  <achristensen@webkit.org>
1769
1770         Fix CMake build.
1771
1772         * CMakeLists.txt:
1773         Don't compile a file that doesn't exist.
1774         * PlatformMac.cmake:
1775         Put the XPCServices in the right place.
1776
1777 2016-04-19  Chris Dumez  <cdumez@apple.com>
1778
1779         Crash under WebKit::PluginView::pluginSnapshotTimerFired
1780         https://bugs.webkit.org/show_bug.cgi?id=156754
1781         <rdar://problem/22566764>
1782
1783         Reviewed by Beth Dakin.
1784
1785         Add null check for frame() before trying to access the frame settings,
1786         similarly to what is done earlier in this function. This fixes a top
1787         crasher.
1788
1789         * WebProcess/Plugins/PluginView.cpp:
1790         (WebKit::PluginView::pluginSnapshotTimerFired):
1791
1792 2016-04-19  Dean Jackson  <dino@apple.com>
1793
1794         New SPI to export a dictionary of runtime features
1795         https://bugs.webkit.org/show_bug.cgi?id=156645
1796         <rdar://problem/23621666>
1797
1798         Reviewed by Anders Carlsson.
1799
1800         Mark the new SPI as WK_MAC_TBA, WK_IOS_TBA.
1801
1802         * UIProcess/API/Cocoa/_WKExperimentalFeature.h:
1803
1804 2016-04-19  Dean Jackson  <dino@apple.com>
1805
1806         New SPI to export a dictionary of runtime features
1807         https://bugs.webkit.org/show_bug.cgi?id=156645
1808         <rdar://problem/23621666>
1809
1810         Post commit follow-up. Darin gave review comments that
1811         I didn't address in my original commit - I was waiting
1812         on some advice.
1813
1814         * UIProcess/WebPreferences.cpp:
1815         (WebKit::WebPreferences::isEnabledForFeature): Change the macro
1816         to generate a static list of function pointers, rather than
1817         a lot of conditional statements.
1818         (WebKit::WebPreferences::setEnabledForFeature): Ditto.
1819
1820 2016-04-19  Chris Dumez  <cdumez@apple.com>
1821
1822         Mark more classes as WTF_MAKE_FAST_ALLOCATED
1823         https://bugs.webkit.org/show_bug.cgi?id=156732
1824
1825         Reviewed by Darin Adler.
1826
1827         * NetworkProcess/Downloads/Download.h:
1828         * NetworkProcess/Downloads/PendingDownload.h:
1829         * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.h:
1830         * Shared/API/Cocoa/RemoteObjectInvocation.h:
1831
1832 2016-04-19  Alex Christensen  <achristensen@webkit.org>
1833
1834         Build fix.
1835
1836         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1837         (WebKit::NetworkConnectionToWebProcess::preregisterSandboxExtensionsForOptionallyFileBackedBlob):
1838         result is unused.
1839
1840 2016-04-19  Brady Eidson  <beidson@apple.com>
1841
1842         Modern IDB: ObjectStore Blob Support.
1843         https://bugs.webkit.org/show_bug.cgi?id=143193
1844
1845         Reviewed by Alex Christensen.
1846
1847         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1848         (WebKit::NetworkConnectionToWebProcess::preregisterSandboxExtensionsForOptionallyFileBackedBlob): Don't ASSERT that
1849           this is the first we've heard of this path - The Connection now remembers all extensions.
1850         (WebKit::NetworkConnectionToWebProcess::getBlobDataFileReferenceForPath): Don't take - Just get.
1851
1852 2016-04-19  Antti Koivisto  <antti@apple.com>
1853
1854         Try to fix iOS build.
1855
1856         * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.h:
1857
1858 2016-04-19  Commit Queue  <commit-queue@webkit.org>
1859
1860         Unreviewed, rolling out r199658.
1861         https://bugs.webkit.org/show_bug.cgi?id=156736
1862
1863         It broke all EFL layout tests (Requested by KaL on #webkit).
1864
1865         Reverted changeset:
1866
1867         "[UNIX] Initialize WebKit before the platform initializations"
1868         https://bugs.webkit.org/show_bug.cgi?id=156622
1869         http://trac.webkit.org/changeset/199658
1870
1871 2016-04-18  Alex Christensen  <achristensen@webkit.org>
1872
1873         Build fix after r199700
1874
1875         * PlatformMac.cmake:
1876
1877 2016-04-18  Brady Eidson  <beidson@apple.com>
1878
1879         Modern IDB (Blob support): When reading Blobs from the database, grant the Networking process sandbox access to the files.
1880         https://bugs.webkit.org/show_bug.cgi?id=156640
1881
1882         Reviewed by Alex Christensen.
1883
1884         * DatabaseProcess/DatabaseProcess.cpp:
1885         (WebKit::DatabaseProcess::getSandboxExtensionsForBlobFiles): Utility function to ask the UI process for
1886           SandboxExtensions for a list of files.
1887         (WebKit::DatabaseProcess::didGetSandboxExtensionsForBlobFiles): Take the SandboxExtensions from the UI process
1888           and pass them along to the completion handler.
1889         * DatabaseProcess/DatabaseProcess.h:
1890         * DatabaseProcess/DatabaseProcess.messages.in:
1891
1892         * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.cpp:
1893         (WebKit::WebIDBConnectionToClient::didGetRecord): If the value returned from the database doesn't have Blob files,
1894           pass the result directly on to WebCore. If it does, ask the UI process for SandboxExtensions first.
1895
1896         * NetworkProcess/FileAPI/NetworkBlobRegistry.cpp:
1897         (WebKit::NetworkBlobRegistry::registerBlobURLOptionallyFileBacked): Grab the BlobDataFileReference from the 
1898           NetworkConnectionToWebProcess to pass along to the BlobRegistry.
1899
1900         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1901         (WebKit::NetworkConnectionToWebProcess::preregisterSandboxExtensionsForOptionallyFileBackedBlob): Add this message
1902           so the WebProcess can preflight the creation of some blob URLs by passing along the SandboxExtensions for their files.
1903         (WebKit::NetworkConnectionToWebProcess::takeBlobDataFileReferenceForPath):
1904         * NetworkProcess/NetworkConnectionToWebProcess.h:
1905         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
1906
1907         * UIProcess/Databases/DatabaseProcessProxy.cpp:
1908         (WebKit::DatabaseProcessProxy::getSandboxExtensionsForBlobFiles): Create SandboxExtensions for the passed in files and
1909           return them to the DatabaseProcess.
1910         * UIProcess/Databases/DatabaseProcessProxy.h:
1911         * UIProcess/Databases/DatabaseProcessProxy.messages.in:
1912
1913         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
1914         (WebKit::WebIDBConnectionToServer::didGetRecordWithSandboxExtensions): New form of "didGetRecord" that handles passing
1915           the SandboxExtensions to the Networking process before they are needed.
1916         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h:
1917         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.messages.in:
1918
1919         * WebProcess/FileAPI/BlobRegistryProxy.cpp:
1920         (WebKit::BlobRegistryProxy::registerBlobURLOptionallyFileBacked):
1921         * WebProcess/FileAPI/BlobRegistryProxy.h:
1922
1923 2016-04-18  Dean Jackson  <dino@apple.com>
1924
1925         New SPI to export a dictionary of runtime features
1926         https://bugs.webkit.org/show_bug.cgi?id=156645
1927         <rdar://problem/23621666>
1928
1929         Trying to fix GTK and EFL builds. I forgot to add files
1930         to CMake.
1931
1932         * CMakeLists.txt:
1933         * PlatformMac.cmake:
1934
1935 2016-04-18  Dean Jackson  <dino@apple.com>
1936
1937         New SPI to export a dictionary of runtime features
1938         https://bugs.webkit.org/show_bug.cgi?id=156645
1939         <rdar://problem/23621666>
1940
1941         Reviewed by Darin Adler.
1942
1943         Add a new type of Preference for experimental features so that we
1944         can dynamically toggle them from a WebKit2 host. These are special
1945         keys that are tied to runtime flags. The host process can ask WebKit
1946         for the list of keys, each with a small description, in order to
1947         display UI.
1948
1949         - Add HumanReadableName and HumanReadableDescription parameters to our
1950           macros, which are used when building a ExperimentalFeature.
1951           These are both empty strings for the existing preferences. At some
1952           point we should probably move all this to code generation rather
1953           than macros, so that we don't have to carry around unused parameters.
1954
1955         - I've included two sample experimental features: WebGL2 and ShadowDOM.
1956           They are not actually hooked up to the runtime settings yet, but its
1957           pretty clear how that will happen. Note that these are new preferences
1958           that have an "Experimental" prefix. This is so toggling an experimental
1959           feature to off won't cause the feature to not work once it becomes
1960           stable enough to enable by default. In other words, when it moves
1961           out of the experimental stage, the experimental feature flag will be
1962           removed, and you'll no longer check for values with that key.
1963
1964         - The ExperimentalFeature object is what the host process
1965           will read in order to show some UI. It contains the human readable info,
1966           as well as the actual key that can be used to query and toggle the
1967           experimental feature.
1968
1969         * Shared/API/APIObject.h: Add the ExperimentalFeature.
1970
1971         * Shared/Cocoa/APIObject.mm:
1972         (API::Object::newObject): Exposes a wrapper around a _WKExperimentalFeature ObjC type.
1973
1974         * Shared/WebPreferencesDefinitions.h: Change all the existing macros to take the new
1975         parameters, and add the initial experimental keys.
1976
1977         * Shared/WebPreferencesKeys.cpp: Add new parameters to existing macros.
1978         * Shared/WebPreferencesKeys.h: Ditto.
1979         * Shared/WebPreferencesStore.cpp: Ditto.
1980         (WebKit::defaults):
1981
1982         * UIProcess/API/APIExperimentalFeature.cpp: The API side of the ExperimentalFeature.
1983         (API::ExperimentalFeature::create):
1984         (API::ExperimentalFeature::ExperimentalFeature):
1985         (API::ExperimentalFeature::~ExperimentalFeature):
1986         * UIProcess/API/APIExperimentalFeature.h:
1987
1988         * UIProcess/API/Cocoa/WKPreferences.mm: The actual implementation of the SPI.
1989         (+[WKPreferences _experimentalFeatures]): Create and return a list of feature descriptors.
1990         (-[WKPreferences _isEnabledForFeature:]): Get the value.
1991         (-[WKPreferences _setEnabled:forFeature:]): Set the value.
1992         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
1993
1994         * UIProcess/API/Cocoa/_WKExperimentalFeature.h: The ObjC version.
1995         * UIProcess/API/Cocoa/_WKExperimentalFeature.mm:
1996         (-[_WKExperimentalFeature dealloc]):
1997         (-[_WKExperimentalFeature description]):
1998         (-[_WKExperimentalFeature name]):
1999         (-[_WKExperimentalFeature key]):
2000         (-[_WKExperimentalFeature details]):
2001         (-[_WKExperimentalFeature _apiObject]):
2002         * UIProcess/API/Cocoa/_WKExperimentalFeatureInternal.h: Implementation of the wrapper.
2003         (WebKit::wrapper):
2004
2005         * UIProcess/WebPreferences.cpp: The C++ implementation that provides the data for the ObjC API.
2006         (WebKit::globalExperimentalFeatures):
2007         (WebKit::WebPreferences::ExperimentalFeatures):
2008         (WebKit::WebPreferences::isEnabledForFeature):
2009         (WebKit::WebPreferences::setEnabledForFeature):
2010         * UIProcess/WebPreferences.h:
2011
2012         * UIProcess/mac/WebPreferencesMac.mm: Update some macros.
2013         (WebKit::WebPreferences::platformInitializeStore):
2014         * WebProcess/WebPage/WebPage.cpp: Ditto
2015         (WebKit::WebPage::updatePreferences):
2016
2017         * WebKit2.xcodeproj/project.pbxproj: Add the new files.
2018
2019 2016-04-18  Tim Horton  <timothy_horton@apple.com>
2020
2021         Swipe view gesture should be reversed in right-to-left contexts
2022         https://bugs.webkit.org/show_bug.cgi?id=156714
2023
2024         Reviewed by Anders Carlsson.
2025
2026         * UIProcess/API/gtk/PageClientImpl.h:
2027         * UIProcess/PageClient.h:
2028         * UIProcess/UserInterfaceLayoutDirection.h: Added.
2029         * UIProcess/WebPageProxy.cpp:
2030         (WebKit::WebPageProxy::userInterfaceLayoutDirection):
2031         * UIProcess/WebPageProxy.h:
2032         * UIProcess/ios/PageClientImplIOS.h:
2033         * UIProcess/ios/PageClientImplIOS.mm:
2034         (WebKit::PageClientImpl::userInterfaceLayoutDirection):
2035         * UIProcess/mac/PageClientImpl.h:
2036         * UIProcess/mac/PageClientImpl.mm:
2037         (WebKit::PageClientImpl::userInterfaceLayoutDirection):
2038         Plumb RTL-ness through to WebPageProxy.
2039         We look at the WK(Web)View's UI layout direction.
2040         For other platforms, we just assume LTR.
2041
2042         * UIProcess/mac/ViewGestureController.h:
2043         * UIProcess/mac/ViewGestureControllerMac.mm:
2044         (WebKit::ViewGestureController::PendingSwipeTracker::scrollEventCanBecomeSwipe):
2045         Decide which way to swipe (and which way to look for back-forward items)
2046         based on the WebPageProxy's reported RTLness.
2047
2048         (WebKit::ViewGestureController::isPhysicallySwipingLeft):
2049         "Back" means "swiping left" in LTR and "swiping right" in RTL.
2050
2051         (WebKit::ViewGestureController::trackSwipeGesture):
2052         (WebKit::ViewGestureController::determineLayerAdjacentToSnapshotForParent):
2053         (WebKit::ViewGestureController::beginSwipeGesture):
2054         (WebKit::ViewGestureController::handleSwipeGesture):
2055         Make things that were equating "back" with "left" instead check isPhysicallySwipingLeft.
2056
2057 2016-04-18  Anders Carlsson  <andersca@apple.com>
2058
2059         Fix build with newer versions of clang.
2060         rdar://problem/25749769
2061
2062         * UIProcess/Cocoa/WebViewImpl.mm:
2063         * UIProcess/mac/WebPageProxyMac.mm:
2064         Forward declare some AppKit IPI.
2065
2066 2016-04-18  Tina Liu  <iting_liu@apple.com>
2067
2068         Implement functions to set plug-in load policies for private browsing mode
2069         https://bugs.webkit.org/show_bug.cgi?id=156540
2070
2071         Reviewed by Anders Carlsson.
2072
2073         This patch implements API and wrappers for clients to set policies to use when using
2074         private browsing. WebPlatformStrategies would return which policies to use depending
2075         on whether the page is in private browsing mode.
2076
2077         * Shared/WebProcessCreationParameters.h:
2078         Add a hash map for plug-in load policies for private browsing.
2079         * Shared/WebProcessCreationParameters.cpp:
2080         (WebKit::WebProcessCreationParameters::encode):
2081         (WebKit::WebProcessCreationParameters::decode):
2082
2083         * UIProcess/API/C/mac/WKContextPrivateMac.h:
2084         * UIProcess/API/C/mac/WKContextPrivateMac.mm:
2085         (WKContextSetPrivateBrowsingPluginLoadClientPolicy):
2086         Add a wrapper.
2087
2088         * UIProcess/WebProcessPool.h:
2089         * UIProcess/WebProcessPool.cpp:
2090         (WebKit::WebProcessPool::createNewWebProcess):
2091         Set the WebProcessCreationParameters's pluginLoadClientPoliciesForPrivateBrowsing.
2092         (WebKit::WebProcessPool::setPluginLoadClientPolicyForBrowsingMode):
2093         A helper function that sets plug-in policies to the corresponding instance variable:
2094         m_pluginLoadClientPolicies for general browsing and m_pluginLoadClientPoliciesForPrivateBrowsing
2095         for private browsing. The logic is extracted from the original setPluginLoadClientPolicy.
2096         While we are here, get rid of the .contains() lookup as .get() will just return a
2097         constructed object if the key is not found.
2098         (WebKit::WebProcessPool::setPluginLoadClientPolicy):
2099         Switch to use the helper function to set policies.
2100         (WebKit::WebProcessPool::setPrivateBrowsingPluginLoadClientPolicy):
2101         Ditto. Also send a message to the WebProcess for setting policies for private browsing.
2102         (WebKit::WebProcessPool::clearPluginClientPolicies):
2103         Clear plug-ins' private browsing policies.
2104
2105         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
2106         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
2107         (WebKit::WebPlatformStrategies::setPluginLoadClientPolicyForBrowsingMode):
2108         Ditto as WebProcessPool::setPluginLoadClientPolicyForBrowsingMode.
2109         (WebKit::WebPlatformStrategies::setPluginLoadClientPolicy):
2110         Switch to use setPluginLoadClientPolicyForBrowsingMode to set policies.
2111         (WebKit::WebPlatformStrategies::setPrivateBrowsingPluginLoadClientPolicy):
2112         Use setPluginLoadClientPolicyForBrowsingMode to set policies for private browsing.
2113         (WebKit::WebPlatformStrategies::clearPluginClientPolicies):
2114         Clear plug-ins' private browsing policies.
2115         (WebKit::WebPlatformStrategies::longestMatchedWildcardHostForHost):
2116         Add an argument for private browsing. Read from the corresponding ivar.
2117         (WebKit::WebPlatformStrategies::replaceHostWithMatchedWildcardHost):
2118         Ditto.
2119         (WebKit::WebPlatformStrategies::pluginLoadClientPolicyForHost): Deleted.
2120         Renamed this function as pluginLoadClientPolicyForHostForBrowsingMode.
2121         (WebKit::WebPlatformStrategies::pluginLoadClientPolicyForHostForBrowsingMode):
2122         Ditto.
2123         (WebKit::WebPlatformStrategies::populatePluginCache):
2124         Get the plug-in load policies for a specific host based on the page's session status. If the page
2125         is using ephemeral session, use the private browsing policies.
2126
2127         * WebProcess/WebProcess.h:
2128         * WebProcess/WebProcess.cpp:
2129         (WebKit::WebProcess::initializeWebProcess):
2130         Switch to call the helper function setPluginLoadClientPolicyFromCreationParameters.
2131         (WebKit::WebProcess::setPluginLoadClientPolicies):
2132         Logic moved from initializeWebProcess. Call PluginStrategy::setPluginLoadClientPolicy or
2133         PluginStrategy::setPrivateBrowsingPluginLoadClientPolicy depending on the input argument.
2134         (WebKit::WebProcess::setPrivateBrowsingPluginLoadClientPolicy):
2135         Add a wrapper to call PluginStrategy::setPrivateBrowsingPluginLoadClientPolicy.
2136
2137         * WebProcess/WebProcess.messages.in:
2138         Declare an entry for setPrivateBrowsingPluginLoadClientPolicy.
2139
2140 2016-04-18  Chris Dumez  <cdumez@apple.com>
2141
2142         [WK2][iOS] Only adjust network responses' MIME type for QuickLook in the context of a main resource load
2143         https://bugs.webkit.org/show_bug.cgi?id=156639
2144         <rdar://problem/25765848>
2145
2146         Reviewed by Alex Christensen.
2147
2148         * NetworkProcess/NetworkDataTask.h:
2149         (WebKit::NetworkDataTask::firstRequest):
2150         Add getter to return the first request.
2151
2152         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
2153         (-[WKNetworkSessionDelegate URLSession:dataTask:didReceiveResponse:completionHandler:]):
2154         Pass flag to adjustMIMETypeIfNecessary() indicated if this is a main resource load.
2155
2156 2016-04-18  Brian Burg  <bburg@apple.com>
2157
2158         Web Automation: provide detailed error messages when an automation command fails
2159         https://bugs.webkit.org/show_bug.cgi?id=156635
2160         <rdar://problem/25754051>
2161
2162         Reviewed by Darin Adler and Timothy Hatcher.
2163
2164         Fill in lots of missing error message details now that the remote end knows
2165         how to parse error strings with predefined error names and details.
2166
2167         * UIProcess/Automation/WebAutomationSession.cpp:
2168         Rearrange the error message macros. Make it possible to pass a ErrorMessage
2169         variable or just the enum value name and get out an encoded error message
2170         that optionally includes a free-form details string. The predefined error
2171         name and the details string are joined together with a semicolon.
2172
2173         (WebKit::WebAutomationSession::getBrowsingContext):
2174         (WebKit::WebAutomationSession::createBrowsingContext):
2175         (WebKit::WebAutomationSession::closeBrowsingContext):
2176         (WebKit::WebAutomationSession::switchToBrowsingContext):
2177         (WebKit::WebAutomationSession::resizeWindowOfBrowsingContext):
2178         (WebKit::WebAutomationSession::moveWindowOfBrowsingContext):
2179         (WebKit::WebAutomationSession::navigateBrowsingContext):
2180         (WebKit::WebAutomationSession::goBackInBrowsingContext):
2181         (WebKit::WebAutomationSession::goForwardInBrowsingContext):
2182         (WebKit::WebAutomationSession::reloadBrowsingContext):
2183         (WebKit::WebAutomationSession::evaluateJavaScriptFunction):
2184         (WebKit::WebAutomationSession::didEvaluateJavaScriptFunction):
2185         (WebKit::WebAutomationSession::resolveChildFrameHandle):
2186         (WebKit::WebAutomationSession::didResolveChildFrame):
2187         (WebKit::WebAutomationSession::resolveParentFrameHandle):
2188         (WebKit::WebAutomationSession::didResolveParentFrame):
2189         (WebKit::WebAutomationSession::computeElementLayout):
2190         (WebKit::WebAutomationSession::didComputeElementLayout):
2191         (WebKit::WebAutomationSession::isShowingJavaScriptDialog):
2192         (WebKit::WebAutomationSession::dismissCurrentJavaScriptDialog):
2193         (WebKit::WebAutomationSession::acceptCurrentJavaScriptDialog):
2194         (WebKit::WebAutomationSession::messageOfCurrentJavaScriptDialog):
2195         (WebKit::WebAutomationSession::setUserInputForCurrentJavaScriptPrompt):
2196         (WebKit::WebAutomationSession::getAllCookies):
2197         (WebKit::WebAutomationSession::didGetCookiesForFrame):
2198         (WebKit::WebAutomationSession::deleteSingleCookie):
2199         (WebKit::WebAutomationSession::didDeleteCookie):
2200         (WebKit::WebAutomationSession::addSingleCookie):
2201         (WebKit::WebAutomationSession::deleteAllCookies):
2202         (WebKit::WebAutomationSession::performMouseInteraction):
2203         (WebKit::WebAutomationSession::performKeyboardInteractions):
2204         (WebKit::WebAutomationSession::takeScreenshot):
2205         (WebKit::WebAutomationSession::didTakeScreenshot):
2206         Audit almost all early exits and provide a relevant error details message
2207         if the error itself is ambiguous. Make sure to format asynchronous errors.
2208
2209 2016-04-18  Brent Fulgham  <bfulgham@apple.com>
2210
2211         CSP: Remove stubs for dynamically-added favicons (via link rel="icon")
2212         https://bugs.webkit.org/show_bug.cgi?id=153151
2213         <rdar://problem/24383176>
2214
2215         Reviewed by Darin Adler.
2216
2217         Remove the unused dynamic favicon code and tests.
2218
2219         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2220         (WebKit::WebFrameLoaderClient::dispatchDidChangeIcons): Deleted.
2221         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
2222
2223 2016-04-18  Jer Noble  <jer.noble@apple.com>
2224
2225         REGRESSION( r199603): Pandora crashes WebKit in WebPlaybackSessionManager::removeClientForContext
2226         https://bugs.webkit.org/show_bug.cgi?id=156648
2227
2228         Reviewed by Darin Adler.
2229
2230         Follow up patch to r199615; avoid a double hash lookup by using a .find() pattern instead of
2231         .contains() & .get().
2232
2233         * WebProcess/cocoa/WebPlaybackSessionManager.mm:
2234         (WebKit::WebPlaybackSessionManager::setUpPlaybackControlsManager):
2235         (WebKit::WebPlaybackSessionManager::clearPlaybackControlsManager):
2236
2237 2016-04-18  Chris Dumez  <cdumez@apple.com>
2238
2239         Unreviewed, rolling out r199644.
2240
2241         Seems to have caused a 1-2% regression on warm PLT
2242
2243         Reverted changeset:
2244
2245         "[WK2][iOS] Do not dlopen() QuickLook in the NetworkProcess"
2246         https://bugs.webkit.org/show_bug.cgi?id=156639
2247         http://trac.webkit.org/changeset/199644
2248
2249 2016-04-18  Carlos Garcia Campos  <cgarcia@igalia.com>
2250
2251         Pending API Request URL is wrong after reloading
2252         https://bugs.webkit.org/show_bug.cgi?id=139342
2253
2254         Reviewed by Darin Adler.
2255
2256         It happens when reloading a web view loaded with anything but a
2257         URL, because the bf list is not updated for those cases and
2258         WebPageProxy::reload() is setting the current bf list item URL as
2259         pending API request URL. This also causes that progress is
2260         reported wrongly, because
2261         WebPageProxy::decidePolicyForNavigationAction() resets the pending
2262         API request URL when it's different than the requested URL. The
2263         page load transaction causes the progress to be changed, reporting
2264         1.0 (the previous one), but later something < 1.0 is reported
2265         again by the progress tracker.
2266
2267         * UIProcess/WebPageProxy.cpp:
2268         (WebKit::WebPageProxy::reload): Use the current active URL as
2269         pending API request URL, falling back to the current bf list item
2270         URL when empty.
2271
2272 2016-04-18  Carlos Garcia Campos  <cgarcia@igalia.com>
2273
2274         Pending API request URL no set when loading Data, Alternate HTML or plain text
2275         https://bugs.webkit.org/show_bug.cgi?id=136916
2276
2277         Reviewed by Darin Adler.
2278
2279         Set pending API request URL for all load methods in
2280         WebPageProxy. This ensures that right after calling those methods,
2281         the active URL is the requested one and that
2282         PageLoadState::isLoading() returns true.
2283
2284         * UIProcess/WebPageProxy.cpp:
2285         (WebKit::WebPageProxy::loadAlternateHTMLString):
2286         (WebKit::WebPageProxy::loadPlainTextString):
2287         (WebKit::WebPageProxy::loadWebArchiveData):
2288
2289 2016-04-18  Commit Queue  <commit-queue@webkit.org>
2290
2291         Unreviewed, rolling out r199660.
2292         https://bugs.webkit.org/show_bug.cgi?id=156691
2293
2294         It broke the iOS build (Requested by KaL on #webkit).
2295
2296         Reverted changeset:
2297
2298         "Pending API request URL no set when loading Data, Alternate
2299         HTML or plain text"
2300         https://bugs.webkit.org/show_bug.cgi?id=136916
2301         http://trac.webkit.org/changeset/199660
2302
2303 2016-04-18  Carlos Garcia Campos  <cgarcia@igalia.com>
2304
2305         Pending API request URL no set when loading Data, Alternate HTML or plain text
2306         https://bugs.webkit.org/show_bug.cgi?id=136916
2307
2308         Reviewed by Darin Adler.
2309
2310         Set pending API request URL for all load methods in
2311         WebPageProxy. This ensures that right after calling those methods,
2312         the active URL is the requested one and that
2313         PageLoadState::isLoading() returns true.
2314
2315         * UIProcess/WebPageProxy.cpp:
2316         (WebKit::WebPageProxy::loadAlternateHTMLString):
2317         (WebKit::WebPageProxy::loadPlainTextString):
2318         (WebKit::WebPageProxy::loadWebArchiveData):
2319
2320 2016-04-18  Carlos Garcia Campos  <cgarcia@igalia.com>
2321
2322         [UNIX] Initialize WebKit before the platform initializations
2323         https://bugs.webkit.org/show_bug.cgi?id=156622
2324
2325         Reviewed by Michael Catanzaro.
2326
2327         The platform specific initialization might use something that would require WebKit2 to be initialized. For
2328         example, in debug mode, the GTK+ port uses WTF::sleep that requires the threading to be initialized.
2329
2330         * Shared/unix/ChildProcessMain.h:
2331         (WebKit::ChildProcessMain): Move InitializeWebKit2() before platformInitialize().
2332
2333 2016-04-18  Jeremy Huddleston Sequoia  <jeremyhu@apple.com>
2334
2335         Fix incorrect assumption that APPLE implies Mac.
2336         https://bugs.webkit.org/show_bug.cgi?id=156679
2337
2338         Addresses build failure introduced in r198947
2339
2340         Reviewed by Alex Christensen.
2341
2342         * CMakeLists.txt:
2343
2344 2016-04-17  Yoav Weiss  <yoav@yoav.ws>
2345
2346         Initial Link preload support
2347         https://bugs.webkit.org/show_bug.cgi?id=156334
2348
2349         Reviewed by Darin Adler.
2350
2351         * WebProcess/Network/WebLoaderStrategy.cpp:
2352         (WebKit::maximumBufferingTime): Added LinkPreload as a possible CachedResource::type.
2353
2354 2016-04-17  Chris Dumez  <cdumez@apple.com>
2355
2356         [WK2][iOS] Do not dlopen() QuickLook in the NetworkProcess
2357         https://bugs.webkit.org/show_bug.cgi?id=156639
2358
2359         Reviewed by Darin Adler.
2360
2361         * WebProcess/Network/WebResourceLoader.cpp:
2362         (WebKit::WebResourceLoader::didReceiveResponse):
2363         Move checks for main resource load and for MIME type inside of
2364         QuickLookHandle::createIfNecessary(), for consistency with the
2365         other QuickLookHandle factory functions.
2366
2367 2016-04-16  Dan Bernstein  <mitz@apple.com>
2368
2369         [Mac] Web Content service with a restricted entitlement may load arbitrary dylibs
2370         https://bugs.webkit.org/show_bug.cgi?id=156668
2371         <rdar://problem/25429784>
2372
2373         Reviewed by Anders Carlsson.
2374
2375         * Configurations/WebContentService.xcconfig: Enable library validation when the Web Content
2376           service is given the XPC domain extension entitlement.
2377
2378 2016-04-15  Dan Bernstein  <mitz@apple.com>
2379
2380         [Mac] WebContent, Networking and Databases services have i386 slices that are never used
2381         https://bugs.webkit.org/show_bug.cgi?id=156654
2382
2383         Reviewed by Alexey Proskuryakov.
2384
2385         * Configurations/BaseXPCService.xcconfig: Set VALID_ARCHS to ARCHS_STANDARD when not building only
2386           for the active architecture.
2387         * Configurations/PluginService.32.xcconfig: Removed now-redundant definitions.
2388         * Configurations/PluginService.64.xcconfig: Ditto.
2389
2390 2016-04-15  Sam Weinig  <sam@webkit.org>
2391
2392         Need a way to specify a script name to show in the inspector for scripts injected via WKUserScript
2393         <rdar://problem/25626662>
2394         https://bugs.webkit.org/show_bug.cgi?id=156653
2395
2396         Reviewed by Tim Horton.
2397
2398         * UIProcess/API/Cocoa/WKUserScript.mm:
2399         (-[WKUserScript _initWithSource:injectionTime:forMainFrameOnly:legacyWhitelist:legacyBlacklist:associatedURL:userContentWorld:]):
2400         * UIProcess/API/Cocoa/WKUserScriptPrivate.h:
2401         Add a new initializer that takes an associate URL that is used to represent the user script.
2402
2403 2016-04-15  Darin Adler  <darin@apple.com>
2404
2405         Reduce use of Deprecated::ScriptXXX classes
2406         https://bugs.webkit.org/show_bug.cgi?id=156632
2407
2408         Reviewed by Alex Christensen.
2409
2410         * WebProcess/Plugins/PluginView.cpp:
2411         (WebKit::PluginView::performJavaScriptURLRequest): Use JSValue.
2412         * WebProcess/WebPage/WebInspectorUI.cpp:
2413         (WebKit::WebInspectorUI::windowObjectCleared): Use references.
2414         * WebProcess/WebPage/WebPage.cpp:
2415         (WebKit::WebPage::runJavaScriptInMainFrame): Use JSValue.
2416
2417 2016-04-15  Jer Noble  <jer.noble@apple.com>
2418
2419         REGRESSION( r199603): Pandora crashes WebKit in WebPlaybackSessionManager::removeClientForContext
2420         https://bugs.webkit.org/show_bug.cgi?id=156648
2421         <rdar://problem/25758117>
2422
2423         Reviewed by Beth Dakin.
2424
2425         Mistakenly checked in a reversed condition check, which causes a subsequent assert and crash.
2426
2427         * WebProcess/cocoa/WebPlaybackSessionManager.mm:
2428         (WebKit::WebPlaybackSessionManager::clearPlaybackControlsManager):
2429
2430 2016-04-15  Chris Dumez  <cdumez@apple.com>
2431
2432         Mark NetworkLoad as FastAllocated
2433         https://bugs.webkit.org/show_bug.cgi?id=156628
2434
2435         Reviewed by Alex Christensen.
2436
2437         Mark NetworkLoad as FastAllocated for performance.
2438
2439         * NetworkProcess/NetworkLoad.h:
2440
2441 2016-04-14  Jer Noble  <jer.noble@apple.com>
2442
2443         Allow WebVideoFullscreenManager and Proxy to be used by audio elements.
2444         https://bugs.webkit.org/show_bug.cgi?id=156564
2445
2446         Reviewed by Beth Dakin.
2447
2448         Tease apart WebVideoFullscreenManager and …Proxy into WebPlaybackSessionManager and …Proxy
2449         classes dealing exclusively with playback state and commands, leaving fullscreen state and
2450         commands in the WebVideoFullscreenManager… classes.
2451
2452         WebVideoFullscreenManager and …Proxy will now require an associated
2453         WebPlaybackSessionManager and …Proxy class. The WebPlaybackSessionManager classes can be
2454         used separately and without the WebVideoFullscreenManager classes.
2455
2456         * DerivedSources.make:
2457         * UIProcess/API/Cocoa/WKWebView.mm:
2458         (-[WKWebView _mayAutomaticallyShowVideoPictureInPicture]):
2459         * UIProcess/Cocoa/WebPlaybackSessionManagerProxy.h: Copied from Source/WebKit2/UIProcess/Cocoa/WebVideoFullscreenManagerProxy.h.
2460         * UIProcess/Cocoa/WebPlaybackSessionManagerProxy.messages.in: Copied from Source/WebKit2/UIProcess/Cocoa/WebVideoFullscreenManagerProxy.messages.in.
2461         * UIProcess/Cocoa/WebPlaybackSessionManagerProxy.mm: Added.
2462         (WebKit::WebPlaybackSessionModelContext::play):
2463         (WebKit::WebPlaybackSessionModelContext::pause):
2464         (WebKit::WebPlaybackSessionModelContext::togglePlayState):
2465         (WebKit::WebPlaybackSessionModelContext::beginScrubbing):
2466         (WebKit::WebPlaybackSessionModelContext::endScrubbing):
2467         (WebKit::WebPlaybackSessionModelContext::seekToTime):
2468         (WebKit::WebPlaybackSessionModelContext::fastSeek):
2469         (WebKit::WebPlaybackSessionModelContext::beginScanningForward):
2470         (WebKit::WebPlaybackSessionModelContext::beginScanningBackward):
2471         (WebKit::WebPlaybackSessionModelContext::endScanning):
2472         (WebKit::WebPlaybackSessionModelContext::selectAudioMediaOption):
2473         (WebKit::WebPlaybackSessionModelContext::selectLegibleMediaOption):
2474         (WebKit::WebPlaybackSessionManagerProxy::create):
2475         (WebKit::WebPlaybackSessionManagerProxy::WebPlaybackSessionManagerProxy):
2476         (WebKit::WebPlaybackSessionManagerProxy::~WebPlaybackSessionManagerProxy):
2477         (WebKit::WebPlaybackSessionManagerProxy::invalidate):
2478         (WebKit::WebPlaybackSessionManagerProxy::createModelAndInterface):
2479         (WebKit::WebPlaybackSessionManagerProxy::ensureModelAndInterface):
2480         (WebKit::WebPlaybackSessionManagerProxy::ensureModel):
2481         (WebKit::WebPlaybackSessionManagerProxy::ensureInterface):
2482         (WebKit::WebPlaybackSessionManagerProxy::addClientForContext):
2483         (WebKit::WebPlaybackSessionManagerProxy::removeClientForContext):
2484         (WebKit::WebPlaybackSessionManagerProxy::setUpPlaybackControlsManagerWithID):
2485         (WebKit::WebPlaybackSessionManagerProxy::clearPlaybackControlsManager):
2486         (WebKit::WebPlaybackSessionManagerProxy::resetMediaState):
2487         (WebKit::WebPlaybackSessionManagerProxy::setCurrentTime):
2488         (WebKit::WebPlaybackSessionManagerProxy::setBufferedTime):
2489         (WebKit::WebPlaybackSessionManagerProxy::setSeekableRangesVector):
2490         (WebKit::WebPlaybackSessionManagerProxy::setCanPlayFastReverse):
2491         (WebKit::WebPlaybackSessionManagerProxy::setAudioMediaSelectionOptions):
2492         (WebKit::WebPlaybackSessionManagerProxy::setLegibleMediaSelectionOptions):
2493         (WebKit::WebPlaybackSessionManagerProxy::setExternalPlaybackProperties):
2494         (WebKit::WebPlaybackSessionManagerProxy::setWirelessVideoPlaybackDisabled):
2495         (WebKit::WebPlaybackSessionManagerProxy::setDuration):
2496         (WebKit::WebPlaybackSessionManagerProxy::setRate):
2497         (WebKit::WebPlaybackSessionManagerProxy::play):
2498         (WebKit::WebPlaybackSessionManagerProxy::pause):
2499         (WebKit::WebPlaybackSessionManagerProxy::togglePlayState):
2500         (WebKit::WebPlaybackSessionManagerProxy::beginScrubbing):
2501         (WebKit::WebPlaybackSessionManagerProxy::endScrubbing):
2502         (WebKit::WebPlaybackSessionManagerProxy::seekToTime):
2503         (WebKit::WebPlaybackSessionManagerProxy::fastSeek):
2504         (WebKit::WebPlaybackSessionManagerProxy::beginScanningForward):
2505         (WebKit::WebPlaybackSessionManagerProxy::beginScanningBackward):
2506         (WebKit::WebPlaybackSessionManagerProxy::endScanning):
2507         (WebKit::WebPlaybackSessionManagerProxy::selectAudioMediaOption):
2508         (WebKit::WebPlaybackSessionManagerProxy::selectLegibleMediaOption):
2509         (WebKit::WebPlaybackSessionManagerProxy::controlsManagerInterface):
2510         * UIProcess/Cocoa/WebVideoFullscreenManagerProxy.h:
2511         * UIProcess/Cocoa/WebVideoFullscreenManagerProxy.messages.in:
2512         * UIProcess/Cocoa/WebVideoFullscreenManagerProxy.mm:
2513         (WebKit::WebVideoFullscreenModelContext::WebVideoFullscreenModelContext):
2514         (WebKit::WebVideoFullscreenModelContext::~WebVideoFullscreenModelContext):
2515         (WebKit::WebVideoFullscreenModelContext::play):
2516         (WebKit::WebVideoFullscreenModelContext::pause):
2517         (WebKit::WebVideoFullscreenModelContext::togglePlayState):
2518         (WebKit::WebVideoFullscreenModelContext::beginScrubbing):
2519         (WebKit::WebVideoFullscreenModelContext::endScrubbing):
2520         (WebKit::WebVideoFullscreenModelContext::seekToTime):
2521         (WebKit::WebVideoFullscreenModelContext::fastSeek):
2522         (WebKit::WebVideoFullscreenModelContext::beginScanningForward):
2523         (WebKit::WebVideoFullscreenModelContext::beginScanningBackward):
2524         (WebKit::WebVideoFullscreenModelContext::endScanning):
2525         (WebKit::WebVideoFullscreenModelContext::selectAudioMediaOption):
2526         (WebKit::WebVideoFullscreenModelContext::selectLegibleMediaOption):
2527         (WebKit::WebVideoFullscreenManagerProxy::create):
2528         (WebKit::WebVideoFullscreenManagerProxy::WebVideoFullscreenManagerProxy):
2529         (WebKit::WebVideoFullscreenManagerProxy::createModelAndInterface):
2530         (WebKit::WebVideoFullscreenManagerProxy::setupFullscreenWithID): Deleted.
2531         (WebKit::WebVideoFullscreenManagerProxy::setVideoDimensions): Deleted.
2532         (WebKit::WebVideoFullscreenManagerProxy::enterFullscreen): Deleted.
2533         (WebKit::WebVideoFullscreenManagerProxy::exitFullscreen): Deleted.
2534         (WebKit::WebVideoFullscreenManagerProxy::exitFullscreenWithoutAnimationToMode): Deleted.
2535         (WebKit::WebVideoFullscreenManagerProxy::cleanupFullscreen): Deleted.
2536         (WebKit::WebVideoFullscreenManagerProxy::preparedToReturnToInline): Deleted.
2537         (WebKit::WebVideoFullscreenManagerProxy::requestFullscreenMode): Deleted.
2538         (WebKit::WebVideoFullscreenManagerProxy::didSetupFullscreen): Deleted.
2539         (WebKit::WebVideoFullscreenManagerProxy::didExitFullscreen): Deleted.
2540         (WebKit::WebVideoFullscreenManagerProxy::didEnterFullscreen): Deleted.
2541         (WebKit::WebVideoFullscreenManagerProxy::didCleanupFullscreen): Deleted.
2542         (WebKit::WebVideoFullscreenManagerProxy::setVideoLayerFrame): Deleted.
2543         * UIProcess/WebPageProxy.cpp:
2544         (WebKit::WebPageProxy::WebPageProxy):
2545         (WebKit::WebPageProxy::reattachToWebProcess):
2546         (WebKit::WebPageProxy::playbackSessionManager):
2547         (WebKit::WebPageProxy::videoFullscreenManager):
2548         (WebKit::WebPageProxy::resetState):
2549         (WebKit::WebPageProxy::hasActiveVideoForControlsManager):
2550         (WebKit::WebPageProxy::isPlayingMediaDidChange): Deleted.
2551         * UIProcess/WebPageProxy.h:
2552         * WebKit2.xcodeproj/project.pbxproj:
2553         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2554         (WebKit::WebChromeClient::supportsVideoFullscreen):
2555         (WebKit::WebChromeClient::setUpPlaybackControlsManager):
2556         (WebKit::WebChromeClient::clearPlaybackControlsManager):
2557         (WebKit::WebChromeClient::enterVideoFullscreenForVideoElement):
2558         (WebKit::WebChromeClient::exitVideoFullscreenForVideoElement):
2559         (WebKit::WebChromeClient::exitVideoFullscreenToModeWithoutAnimation):
2560         * WebProcess/WebCoreSupport/WebChromeClient.h:
2561         * WebProcess/WebPage/WebPage.cpp:
2562         (WebKit::WebPage::playbackSessionManager):
2563         (WebKit::WebPage::videoFullscreenManager):
2564         * WebProcess/WebPage/WebPage.h:
2565         * WebProcess/cocoa/WebPlaybackSessionManager.h: Copied from Source/WebKit2/WebProcess/cocoa/WebVideoFullscreenManager.h.
2566         (WebKit::WebPlaybackSessionInterfaceContext::create):
2567         (WebKit::WebPlaybackSessionInterfaceContext::invalidate):
2568         * WebProcess/cocoa/WebPlaybackSessionManager.messages.in: Added.
2569         * WebProcess/cocoa/WebPlaybackSessionManager.mm: Added.
2570         (WebKit::nextContextId):
2571         (WebKit::WebPlaybackSessionInterfaceContext::WebPlaybackSessionInterfaceContext):
2572         (WebKit::WebPlaybackSessionInterfaceContext::~WebPlaybackSessionInterfaceContext):
2573         (WebKit::WebPlaybackSessionInterfaceContext::resetMediaState):
2574         (WebKit::WebPlaybackSessionInterfaceContext::setDuration):
2575         (WebKit::WebPlaybackSessionInterfaceContext::setCurrentTime):
2576         (WebKit::WebPlaybackSessionInterfaceContext::setBufferedTime):
2577         (WebKit::WebPlaybackSessionInterfaceContext::setRate):
2578         (WebKit::WebPlaybackSessionInterfaceContext::setSeekableRanges):
2579         (WebKit::WebPlaybackSessionInterfaceContext::setCanPlayFastReverse):
2580         (WebKit::WebPlaybackSessionInterfaceContext::setAudioMediaSelectionOptions):
2581         (WebKit::WebPlaybackSessionInterfaceContext::setLegibleMediaSelectionOptions):
2582         (WebKit::WebPlaybackSessionInterfaceContext::setExternalPlayback):
2583         (WebKit::WebPlaybackSessionInterfaceContext::setWirelessVideoPlaybackDisabled):
2584         (WebKit::WebPlaybackSessionManager::create):
2585         (WebKit::WebPlaybackSessionManager::WebPlaybackSessionManager):
2586         (WebKit::WebPlaybackSessionManager::~WebPlaybackSessionManager):
2587         (WebKit::WebPlaybackSessionManager::createModelAndInterface):
2588         (WebKit::WebPlaybackSessionManager::ensureModelAndInterface):
2589         (WebKit::WebPlaybackSessionManager::ensureModel):
2590         (WebKit::WebPlaybackSessionManager::ensureInterface):
2591         (WebKit::WebPlaybackSessionManager::removeContext):
2592         (WebKit::WebPlaybackSessionManager::addClientForContext):
2593         (WebKit::WebPlaybackSessionManager::removeClientForContext):
2594         (WebKit::WebPlaybackSessionManager::setUpPlaybackControlsManager):
2595         (WebKit::WebPlaybackSessionManager::clearPlaybackControlsManager):
2596         (WebKit::WebPlaybackSessionManager::contextIdForMediaElement):
2597         (WebKit::WebPlaybackSessionManager::resetMediaState):
2598         (WebKit::WebPlaybackSessionManager::setDuration):
2599         (WebKit::WebPlaybackSessionManager::setCurrentTime):
2600         (WebKit::WebPlaybackSessionManager::setBufferedTime):
2601         (WebKit::WebPlaybackSessionManager::setRate):
2602         (WebKit::WebPlaybackSessionManager::setSeekableRanges):
2603         (WebKit::WebPlaybackSessionManager::setCanPlayFastReverse):
2604         (WebKit::WebPlaybackSessionManager::setAudioMediaSelectionOptions):
2605         (WebKit::WebPlaybackSessionManager::setLegibleMediaSelectionOptions):
2606         (WebKit::WebPlaybackSessionManager::setExternalPlayback):
2607         (WebKit::WebPlaybackSessionManager::setWirelessVideoPlaybackDisabled):
2608         (WebKit::WebPlaybackSessionManager::play):
2609         (WebKit::WebPlaybackSessionManager::pause):
2610         (WebKit::WebPlaybackSessionManager::togglePlayState):
2611         (WebKit::WebPlaybackSessionManager::beginScrubbing):
2612         (WebKit::WebPlaybackSessionManager::endScrubbing):
2613         (WebKit::WebPlaybackSessionManager::seekToTime):
2614         (WebKit::WebPlaybackSessionManager::fastSeek):
2615         (WebKit::WebPlaybackSessionManager::beginScanningForward):
2616         (WebKit::WebPlaybackSessionManager::beginScanningBackward):
2617         (WebKit::WebPlaybackSessionManager::endScanning):
2618         (WebKit::WebPlaybackSessionManager::selectAudioMediaOption):
2619         (WebKit::WebPlaybackSessionManager::selectLegibleMediaOption):
2620         * WebProcess/cocoa/WebVideoFullscreenManager.h:
2621         (WebKit::WebVideoFullscreenInterfaceContext::create):
2622         * WebProcess/cocoa/WebVideoFullscreenManager.messages.in:
2623         * WebProcess/cocoa/WebVideoFullscreenManager.mm:
2624         (WebKit::WebVideoFullscreenInterfaceContext::WebVideoFullscreenInterfaceContext):
2625         (WebKit::WebVideoFullscreenInterfaceContext::resetMediaState):
2626         (WebKit::WebVideoFullscreenInterfaceContext::setDuration):
2627         (WebKit::WebVideoFullscreenInterfaceContext::setCurrentTime):
2628         (WebKit::WebVideoFullscreenInterfaceContext::setBufferedTime):
2629         (WebKit::WebVideoFullscreenInterfaceContext::setRate):
2630         (WebKit::WebVideoFullscreenInterfaceContext::setSeekableRanges):
2631         (WebKit::WebVideoFullscreenInterfaceContext::setCanPlayFastReverse):
2632         (WebKit::WebVideoFullscreenInterfaceContext::setAudioMediaSelectionOptions):
2633         (WebKit::WebVideoFullscreenInterfaceContext::setLegibleMediaSelectionOptions):
2634         (WebKit::WebVideoFullscreenInterfaceContext::setExternalPlayback):
2635         (WebKit::WebVideoFullscreenInterfaceContext::setWirelessVideoPlaybackDisabled):
2636         (WebKit::WebVideoFullscreenManager::create):
2637         (WebKit::WebVideoFullscreenManager::WebVideoFullscreenManager):
2638         (WebKit::WebVideoFullscreenManager::createModelAndInterface):
2639         (WebKit::WebVideoFullscreenManager::enterVideoFullscreenForVideoElement):
2640         (WebKit::WebVideoFullscreenInterfaceContext::setVideoDimensions): Deleted.
2641         (WebKit::WebVideoFullscreenManager::~WebVideoFullscreenManager): Deleted.
2642         (WebKit::WebVideoFullscreenManager::ensureModelAndInterface): Deleted.
2643         (WebKit::WebVideoFullscreenManager::exitVideoFullscreenToModeWithoutAnimation): Deleted.
2644         (WebKit::WebVideoFullscreenManager::setVideoDimensions): Deleted.
2645         (WebKit::WebVideoFullscreenManager::requestFullscreenMode): Deleted.
2646         (WebKit::WebVideoFullscreenManager::fullscreenModeChanged): Deleted.
2647         (WebKit::WebVideoFullscreenManager::didSetupFullscreen): Deleted.
2648         (WebKit::WebVideoFullscreenManager::didEnterFullscreen): Deleted.
2649         (WebKit::WebVideoFullscreenManager::didExitFullscreen): Deleted.
2650         (WebKit::WebVideoFullscreenManager::didCleanupFullscreen): Deleted.
2651         (WebKit::WebVideoFullscreenManager::setVideoLayerGravityEnum): Deleted.
2652         (WebKit::WebVideoFullscreenManager::fullscreenMayReturnToInline): Deleted.
2653         (WebKit::WebVideoFullscreenManager::setVideoLayerFrameFenced): Deleted.
2654
2655 2016-04-15  John Wilander  <wilander@apple.com>
2656
2657         Refactor WebSockets handshake to use StringView instead of String for header validation.
2658         https://bugs.webkit.org/show_bug.cgi?id=155602
2659
2660         Reviewed by Darin Adler.
2661
2662         * UIProcess/InspectorServer/HTTPRequest.cpp:
2663         (WebKit::HTTPRequest::parseHeaders):
2664             Now declares the HTTP header name as a StringView to match the change in WebCore::parseHTTPHeader.
2665
2666 2016-04-15  Alex Christensen  <achristensen@webkit.org>
2667
2668         Don't copy entire NSURLSessionConfiguration just to test for credentials
2669         https://bugs.webkit.org/show_bug.cgi?id=156598
2670
2671         Reviewed by Brady Eidson.
2672
2673         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
2674         (-[WKNetworkSessionDelegate initWithNetworkSession:withCredentials:]):
2675         (-[WKNetworkSessionDelegate URLSession:task:didSendBodyData:totalBytesSent:totalBytesExpectedToSend:]):
2676         (-[WKNetworkSessionDelegate URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:]):
2677         (-[WKNetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:]):
2678         (-[WKNetworkSessionDelegate URLSession:task:didCompleteWithError:]):
2679         (-[WKNetworkSessionDelegate URLSession:dataTask:didReceiveResponse:completionHandler:]):
2680         (-[WKNetworkSessionDelegate URLSession:dataTask:didReceiveData:]):
2681         (-[WKNetworkSessionDelegate URLSession:downloadTask:didWriteData:totalBytesWritten:totalBytesExpectedToWrite:]):
2682         (-[WKNetworkSessionDelegate URLSession:dataTask:didBecomeDownloadTask:]):
2683         (WebKit::NetworkSession::NetworkSession):
2684         (-[WKNetworkSessionDelegate initWithNetworkSession:]): Deleted.
2685
2686 2016-04-14  Carlos Garcia Campos  <cgarcia@igalia.com>
2687
2688         Unreviewed. Fix GTK+ build after r199558.
2689
2690         * UIProcess/API/gtk/WebKitFileChooserRequest.cpp:
2691         (webkitFileChooserRequestCreate):
2692         (webkit_file_chooser_request_select_files):
2693         * UIProcess/API/gtk/WebKitFileChooserRequestPrivate.h:
2694         * UIProcess/API/gtk/WebKitUIClient.cpp:
2695
2696 2016-04-14  Brent Fulgham  <bfulgham@apple.com>
2697
2698         Make <a download> a runtime enabled option
2699         https://bugs.webkit.org/show_bug.cgi?id=156583
2700         <rdar://problem/25733449>
2701
2702         Reviewed by Alex Christensen.
2703
2704         Add a download attribute runtime flag based on preferences.
2705         Disable the download attribute by default.
2706
2707         * Shared/WebPreferencesDefinitions.h:
2708         * UIProcess/API/C/WKPreferences.cpp:
2709         (WKPreferencesGetFetchAPIEnabled):
2710         (WKPreferencesSetDownloadAttributeEnabled):
2711         (WKPreferencesGetDownloadAttributeEnabled):
2712         * UIProcess/API/C/WKPreferencesRefPrivate.h:
2713         * WebProcess/InjectedBundle/InjectedBundle.cpp:
2714         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
2715         * WebProcess/WebPage/WebPage.cpp:
2716         (WebKit::WebPage::updatePreferences):
2717
2718 2016-04-14  Alex Christensen  <achristensen@webkit.org>
2719
2720         Build fix after r199554.
2721
2722         * CMakeLists.txt:
2723         * PlatformMac.cmake:
2724
2725 2016-04-14  Brian Burg  <bburg@apple.com>
2726
2727         Web Automation: suppress automatic text correction in pages controlled by automation
2728         https://bugs.webkit.org/show_bug.cgi?id=156599
2729         <rdar://problem/25712646>
2730
2731         Reviewed by Timothy Hatcher.
2732
2733         If the page is controlled by automation, then automatic text corrections will
2734         cause unexpected behaviors by nondeterministically modifying text inserted by
2735         a test. Just pretend these behaviors are disabled if controlled by automation.
2736
2737         * WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm:
2738         (WebKit::WebEditorClient::isAutomaticQuoteSubstitutionEnabled):
2739         (WebKit::WebEditorClient::isAutomaticDashSubstitutionEnabled):
2740         (WebKit::WebEditorClient::isAutomaticTextReplacementEnabled):
2741         (WebKit::WebEditorClient::isAutomaticSpellingCorrectionEnabled):
2742
2743 2016-04-14  Anders Carlsson  <andersca@apple.com>
2744
2745         Try to fix the Yosemite build.
2746
2747         * UIProcess/Cocoa/UIDelegate.mm:
2748         (WebKit::UIDelegate::UIClient::runOpenPanel):
2749
2750 2016-04-14  Anders Carlsson  <andersca@apple.com>
2751
2752         [Mac] Add API for open panel handling to WKWebView
2753         https://bugs.webkit.org/show_bug.cgi?id=137759
2754         rdar://problem/23278623
2755
2756         Reviewed by Tim Horton.
2757
2758         Based on a patch by Brian Michel.
2759
2760         * Shared/API/Cocoa/WebKit.h:
2761         Import WKOpenPanelParameters.h.
2762
2763         * Shared/Cocoa/APIObject.mm:
2764         (API::Object::newObject):
2765         Create a WKOpenPanelParameters for Type::OpenPanelParameters.
2766
2767         * UIProcess/API/APIOpenPanelParameters.cpp: Renamed from Source/WebKit2/Shared/WebOpenPanelParameters.cpp.
2768         * UIProcess/API/APIOpenPanelParameters.h: Renamed from Source/WebKit2/Shared/WebOpenPanelParameters.h.
2769         Rename WebKit::WebOpenPanelParameters to API::OpenPanelParameters.
2770
2771         * UIProcess/API/APIUIClient.h:
2772         (API::UIClient::runOpenPanel):
2773         Change this to take a SecurityOriginData.
2774
2775         * UIProcess/API/C/WKAPICast.h:
2776         * UIProcess/API/C/WKOpenPanelParametersRef.cpp:
2777         (WKOpenPanelParametersGetTypeID):
2778         Rename WebKit::WebOpenPanelParameters to API::OpenPanelParameters.
2779
2780         * UIProcess/API/C/WKOpenPanelResultListener.cpp:
2781         (filePathsFromFileURLs):
2782         (WKOpenPanelResultListenerChooseFiles):
2783         * UIProcess/API/C/WKPage.cpp:
2784         (WKPageSetPageUIClient):
2785         Change chooseFiles to take a Vector<String> instead of an API::Array of URLs.
2786
2787         * UIProcess/API/Cocoa/WKOpenPanelParameters.h: Added.
2788         * UIProcess/API/Cocoa/WKOpenPanelParameters.mm: Added.
2789         (-[WKOpenPanelParameters allowsMultipleSelection]):
2790         (-[WKOpenPanelParameters _apiObject]):
2791         * UIProcess/API/Cocoa/WKOpenPanelParametersInternal.h:
2792         Add a WKOpenPanelParameters class which contains information about a file upload control.
2793
2794         * UIProcess/API/Cocoa/WKUIDelegate.h:
2795         Add new delegate method.
2796
2797         * UIProcess/Cocoa/UIDelegate.h:
2798         * UIProcess/Cocoa/UIDelegate.mm:
2799         (WebKit::UIDelegate::setDelegate):
2800         Record whether the UI delegate implements the new delegate method.
2801
2802         (WebKit::UIDelegate::UIClient::runOpenPanel):
2803         Invoke the new delegate method.
2804
2805         * UIProcess/PageClient.h:
2806         (WebKit::PageClient::handleRunOpenPanel):
2807         Rename WebKit::WebOpenPanelParameters to API::OpenPanelParameters.
2808
2809         * UIProcess/WebOpenPanelResultListenerProxy.cpp:
2810         (WebKit::WebOpenPanelResultListenerProxy::chooseFiles):
2811         * UIProcess/WebOpenPanelResultListenerProxy.h:
2812         Change chooseFiles to take a Vector<String> instead of an API::Array of URLs.
2813
2814         * UIProcess/WebPageProxy.cpp:
2815         (WebKit::WebPageProxy::runOpenPanel):
2816         * UIProcess/WebPageProxy.h:
2817         Change this to take a SecurityOriginData.
2818
2819         * UIProcess/WebPageProxy.messages.in:
2820         Change RunOpenPanel to take a SecurityOriginData.
2821
2822         * UIProcess/ios/PageClientImplIOS.h:
2823         * UIProcess/ios/PageClientImplIOS.mm:
2824         (WebKit::PageClientImpl::handleRunOpenPanel):
2825         Rename WebKit::WebOpenPanelParameters to API::OpenPanelParameters.
2826
2827         * UIProcess/ios/WKContentViewInteraction.h:
2828         * UIProcess/ios/WKContentViewInteraction.mm:
2829         (-[WKContentView _showRunOpenPanel:resultListener:]):
2830         Change chooseFiles to take a Vector<String> instead of an API::Array of URLs.
2831
2832         * UIProcess/ios/forms/WKFileUploadPanel.h:
2833         * UIProcess/ios/forms/WKFileUploadPanel.mm:
2834         (-[WKFileUploadPanel _chooseFiles:displayString:iconImage:]):
2835         Change chooseFiles to take a Vector<String> instead of an API::Array of URLs.
2836
2837         (-[WKFileUploadPanel presentWithParameters:resultListener:]):
2838         Rename WebKit::WebOpenPanelParameters to API::OpenPanelParameters.
2839
2840         * WebKit2.xcodeproj/project.pbxproj:
2841         Add new file.
2842
2843         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2844         (WebKit::WebChromeClient::runOpenPanel):
2845         Pass the security origin of the frame along.
2846
2847 2016-04-14  Jiewen Tan  <jiewen_tan@apple.com>
2848
2849         Unreviewed, rolling out r199554.
2850
2851         The change breaks Yosemite Release/Debug build
2852
2853         Reverted changeset:
2854
2855         "[Mac] Add API for open panel handling to WKWebView"
2856         https://bugs.webkit.org/show_bug.cgi?id=137759
2857         http://trac.webkit.org/changeset/199554
2858
2859 2016-04-14  Anders Carlsson  <andersca@apple.com>
2860
2861         [Mac] Add API for open panel handling to WKWebView
2862         https://bugs.webkit.org/show_bug.cgi?id=137759
2863         rdar://problem/23278623
2864
2865         Reviewed by Tim Horton.
2866
2867         Based on a patch by Brian Michel.
2868
2869         * Shared/API/Cocoa/WebKit.h:
2870         Import WKOpenPanelParameters.h.
2871
2872         * Shared/Cocoa/APIObject.mm:
2873         (API::Object::newObject):
2874         Create a WKOpenPanelParameters for Type::OpenPanelParameters.
2875
2876         * UIProcess/API/APIOpenPanelParameters.cpp: Renamed from Source/WebKit2/Shared/WebOpenPanelParameters.cpp.
2877         * UIProcess/API/APIOpenPanelParameters.h: Renamed from Source/WebKit2/Shared/WebOpenPanelParameters.h.
2878         Rename WebKit::WebOpenPanelParameters to API::OpenPanelParameters.
2879
2880         * UIProcess/API/APIUIClient.h:
2881         (API::UIClient::runOpenPanel):
2882         Change this to take a SecurityOriginData.
2883
2884         * UIProcess/API/C/WKAPICast.h:
2885         * UIProcess/API/C/WKOpenPanelParametersRef.cpp:
2886         (WKOpenPanelParametersGetTypeID):
2887         Rename WebKit::WebOpenPanelParameters to API::OpenPanelParameters.
2888
2889         * UIProcess/API/C/WKOpenPanelResultListener.cpp:
2890         (filePathsFromFileURLs):
2891         (WKOpenPanelResultListenerChooseFiles):
2892         * UIProcess/API/C/WKPage.cpp:
2893         (WKPageSetPageUIClient):
2894         Change chooseFiles to take a Vector<String> instead of an API::Array of URLs.
2895
2896         * UIProcess/API/Cocoa/WKOpenPanelParameters.h: Added.
2897         * UIProcess/API/Cocoa/WKOpenPanelParameters.mm: Added.
2898         (-[WKOpenPanelParameters allowsMultipleSelection]):
2899         (-[WKOpenPanelParameters _apiObject]):
2900         * UIProcess/API/Cocoa/WKOpenPanelParametersInternal.h:
2901         Add a WKOpenPanelParameters class which contains information about a file upload control.
2902
2903         * UIProcess/API/Cocoa/WKUIDelegate.h:
2904         Add new delegate method.
2905
2906         * UIProcess/Cocoa/UIDelegate.h:
2907         * UIProcess/Cocoa/UIDelegate.mm:
2908         (WebKit::UIDelegate::setDelegate):
2909         Record whether the UI delegate implements the new delegate method.
2910
2911         (WebKit::UIDelegate::UIClient::runOpenPanel):
2912         Invoke the new delegate method.
2913
2914         * UIProcess/PageClient.h:
2915         (WebKit::PageClient::handleRunOpenPanel):
2916         Rename WebKit::WebOpenPanelParameters to API::OpenPanelParameters.
2917
2918         * UIProcess/WebOpenPanelResultListenerProxy.cpp:
2919         (WebKit::WebOpenPanelResultListenerProxy::chooseFiles):
2920         * UIProcess/WebOpenPanelResultListenerProxy.h:
2921         Change chooseFiles to take a Vector<String> instead of an API::Array of URLs.
2922
2923         * UIProcess/WebPageProxy.cpp:
2924         (WebKit::WebPageProxy::runOpenPanel):
2925         * UIProcess/WebPageProxy.h:
2926         Change this to take a SecurityOriginData.
2927
2928         * UIProcess/WebPageProxy.messages.in:
2929         Change RunOpenPanel to take a SecurityOriginData.
2930
2931         * UIProcess/ios/PageClientImplIOS.h:
2932         * UIProcess/ios/PageClientImplIOS.mm:
2933         (WebKit::PageClientImpl::handleRunOpenPanel):
2934         Rename WebKit::WebOpenPanelParameters to API::OpenPanelParameters.
2935
2936         * UIProcess/ios/WKContentViewInteraction.h:
2937         * UIProcess/ios/WKContentViewInteraction.mm:
2938         (-[WKContentView _showRunOpenPanel:resultListener:]):
2939         Change chooseFiles to take a Vector<String> instead of an API::Array of URLs.
2940
2941         * UIProcess/ios/forms/WKFileUploadPanel.h:
2942         * UIProcess/ios/forms/WKFileUploadPanel.mm:
2943         (-[WKFileUploadPanel _chooseFiles:displayString:iconImage:]):
2944         Change chooseFiles to take a Vector<String> instead of an API::Array of URLs.
2945
2946         (-[WKFileUploadPanel presentWithParameters:resultListener:]):
2947         Rename WebKit::WebOpenPanelParameters to API::OpenPanelParameters.
2948
2949         * WebKit2.xcodeproj/project.pbxproj:
2950         Add new file.
2951
2952         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2953         (WebKit::WebChromeClient::runOpenPanel):
2954         Pass the security origin of the frame along.
2955
2956 2016-04-14  Alex Christensen  <achristensen@webkit.org>
2957
2958         Fix build without IndexedDB.
2959
2960         * DatabaseProcess/DatabaseProcess.cpp:
2961         (WebKit::DatabaseProcess::deleteWebsiteDataForOrigins):
2962         (WebKit::DatabaseProcess::grantSandboxExtensionsForBlobs):
2963         (WebKit::DatabaseProcess::prepareForAccessToTemporaryFile):
2964         * DatabaseProcess/DatabaseProcess.h:
2965         * DatabaseProcess/DatabaseProcess.messages.in:
2966
2967 2016-04-13  Daniel Bates  <dabates@apple.com>
2968
2969         REGRESSION (r199401): Internal builds of Safari hang on launch
2970         https://bugs.webkit.org/show_bug.cgi?id=156545
2971         <rdar://problem/25697779>
2972
2973         As pointed out by Darin Adler, remove RELEASE_ASSERT() that I inadvertently left in
2974         WebCore::secCodeForProcess() as part of r199504. For now, we handle
2975         SecCodeCopyGuestWithAttributes() returning an error. In a subsequent commit we will
2976         look to re-introduce the use of a RELEASE_ASSERT() to enforce the invariant that
2977         SecCodeCopyGuestWithAttributes() returns a success status.
2978
2979         * Shared/mac/CodeSigning.mm:
2980         (WebKit::secCodeForProcess):
2981
2982 2016-04-13  Brady Eidson  <beidson@apple.com>
2983
2984         Modern IDB (Blob support): Support retrieving Blobs from IDB.
2985         https://bugs.webkit.org/show_bug.cgi?id=156367
2986
2987         Reviewed by Alex Christensen.
2988
2989         * NetworkProcess/FileAPI/NetworkBlobRegistry.cpp:
2990         (WebKit::NetworkBlobRegistry::registerBlobURLOptionallyFileBacked):
2991         * NetworkProcess/FileAPI/NetworkBlobRegistry.h:
2992         
2993         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
2994         (WebKit::NetworkConnectionToWebProcess::registerBlobURLOptionallyFileBacked):
2995         * NetworkProcess/NetworkConnectionToWebProcess.h:
2996         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
2997         
2998         * WebProcess/FileAPI/BlobRegistryProxy.cpp:
2999         (WebKit::BlobRegistryProxy::registerBlobURLOptionallyFileBacked):
3000         * WebProcess/FileAPI/BlobRegistryProxy.h:
3001
3002 2016-04-13  Chris Dumez  <cdumez@apple.com>
3003
3004         We should not speculatively revalidate cached redirects
3005         https://bugs.webkit.org/show_bug.cgi?id=156548
3006         <rdar://problem/25583886>
3007
3008         Reviewed by Darin Adler.
3009
3010         Stop speculatively revalidating cached redirects. This matches matches
3011         the behavior in NetworkCache's makeUseDecision() which reuses cached
3012         redirects only if they do not need revalidation.
3013
3014         This was breaking fonts.css loading on stripe.com because the
3015         SpeculativeLoadManager would wrongly speculatively revalidate the
3016         redirect and then serve a 302 response the NetworkResourceLoader
3017         when the actual request came in. This would cause us to not follow
3018         the redirect.
3019
3020         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
3021         (WebKit::NetworkCache::SpeculativeLoad::willSendRedirectedRequest):
3022         Abort the speculative load if it hits a redirect. This is the safe thing
3023         to do in this case, as we are supposed to do a hand-shake with WebCore
3024         in such case.
3025
3026         (WebKit::NetworkCache::SpeculativeLoad::didReceiveResponse):
3027         Let successful validations fall through instead of calling didComplete()
3028         early. This matches what is not in NetworkResourceLoader. This way,
3029         didFinishLoading() ends up getting called for both successful and
3030         unsuccessful (i.e. did not return a 302 status code) network validation.
3031
3032         (WebKit::NetworkCache::SpeculativeLoad::didFinishLoading):
3033         - Stop dealing with redirects as we abort the load as soon as we hit a
3034           redirect now.
3035         - Stop asserting that m_cacheEntryForValidation is null now that this
3036           is called for successful validations as well.
3037
3038         (WebKit::NetworkCache::SpeculativeLoad::abort):
3039         New method that aborts the network loads, calls the completion handler
3040         and clean up. It is called in the case we hit a redirect while
3041         revalidating.
3042
3043         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.h:
3044         Drop m_redirectChainCacheStatus member as we no longer deal with
3045         redirects.
3046
3047         * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
3048         (WebKit::NetworkCache::SpeculativeLoadManager::retrieveEntryFromStorage):
3049         If the resource needs revalidation AND is a cached redirect, then do not
3050         use it. This matches what is done in NetworkCache's makeUseDecision().
3051
3052 2016-04-13  Brady Eidson  <beidson@apple.com>
3053
3054         Modern IDB: NetworkProcessConnection::didClose needs to have a self ref.
3055         <rdar://problem/25700864> and https://bugs.webkit.org/show_bug.cgi?id=156559
3056
3057         Reviewed by Alex Christensen.
3058
3059         * WebProcess/Network/NetworkProcessConnection.cpp:
3060         (WebKit::NetworkProcessConnection::didClose): Self ref to protect this.
3061
3062 2016-04-13  Daniel Bates  <dabates@apple.com>
3063
3064         REGRESSION (r199401): Internal builds of Safari hang on launch
3065         https://bugs.webkit.org/show_bug.cgi?id=156545
3066         <rdar://problem/25697779>
3067
3068         Reviewed by Anders Carlsson.
3069
3070         For some reason SecCodeCopyGuestWithAttributes() is failing with an error in Apple Internal
3071         Safari builds. For now, temporarily allow the failure while I investigate the cause in
3072         <rdar://problem/25706517>.
3073
3074         * Shared/mac/CodeSigning.mm:
3075         (WebKit::secCodeForProcess): Log the failure with OSStatus code and return nullptr;
3076         (WebKit::codeSigningIdentifierForProcess): Return a null string if secCodeForProcess() returns a nullptr.
3077         This will cause us to treat affected Apple Internal Safari builds the same as we would treat
3078         an unsigned or third-party signed app.
3079
3080 2016-04-13  Alex Christensen  <achristensen@webkit.org>
3081
3082         Fix client certificate authentication with NetworkSession
3083         https://bugs.webkit.org/show_bug.cgi?id=156527
3084         <rdar://problem/25489156>
3085
3086         Reviewed by Darin Adler.
3087
3088         * NetworkProcess/NetworkLoad.cpp:
3089         (WebKit::NetworkLoad::continueCanAuthenticateAgainstProtectionSpace):
3090         We only want to use serverTrustCredential for ServerTrustEvaluation authentication challenges, not 
3091         * Shared/Authentication/AuthenticationManager.cpp:
3092         (WebKit::AuthenticationManager::tryUseCertificateInfoForChallenge):
3093         (WebKit::AuthenticationManager::useCredentialForSingleChallenge):
3094         * Shared/Authentication/AuthenticationManager.h:
3095         * Shared/Authentication/mac/AuthenticationManager.mac.mm:
3096         (WebKit::AuthenticationManager::tryUseCertificateInfoForChallenge):
3097         Don't use challenge.sender with NSURLSession, which requires callbacks instead.
3098
3099 2016-04-12  Daniel Bates  <dabates@apple.com>
3100
3101         REGRESSION (r198933): Unable to login to Google account from Internet Accounts preference pane
3102         https://bugs.webkit.org/show_bug.cgi?id=156447
3103         <rdar://problem/25628133>
3104
3105         Reviewed by Darin Adler.
3106
3107         Reverts the workaround landed in r199301 and teaches ProcessLauncherMac to use the code
3108         signing identifier of the UI process as the client-identifier if it is signed. Otherwise,
3109         we fall back to using the main bundle identifier or _NSGetProgname() depending on whether
3110         the UI process has an associated app bundle.
3111
3112         * PlatformMac.cmake: Add file Shared/mac/CodeSigning.mm.
3113         * Shared/mac/ChildProcessMac.mm:
3114         (WebKit::ChildProcess::initializeSandbox):
3115         (WebKit::codeSigningIdentifierForProcess): Deleted; moved from here to file Shared/mac/CodeSigning.mm.
3116         * Shared/mac/CodeSigning.h: Added.
3117         * Shared/mac/CodeSigning.mm: Added.
3118         (WebKit::secCodeForCurrentProcess): Added.
3119         (WebKit::secCodeForProcess): Added.
3120         (WebKit::secCodeSigningInformation): Added.
3121         (WebKit::appleSignedOrMacAppStoreSignedOrAppleDeveloperSignedRequirement): Added.
3122         (WebKit::secCodeSigningIdentifier): Added.
3123         (WebKit::codeSigningIdentifier): Returns the code signing identifier for the current process.
3124         (WebKit::codeSigningIdentifierForProcess): Moved from file Shared/mac/ChildProcessMac.mm. Extracted logic
3125         into various helper functions (above) so that it can be shared with WebKit::codeSigningIdentifier() as
3126         well as to improve the readability of the code. Removed the OSStatus out argument that was used by callers
3127         for logging purposes and moved such logging responsibility into WebKit::secCodeSigningIdentifier() as
3128         a release assertion message since we always want to log this error when code signing validation fails. We
3129         use a release assertion to cause a noticeable crash because we such failures should not occur and if they
3130         do then we want to see crash reports so that we can handle such failures. Using a release assertion for
3131         validation failures also simplifies the possible return values of this function as such failures represented
3132         the only case where this function would return an empty string. We now return either a null string or a non-
3133         empty string. We return a null string when the specified process is either unsigned or signed by a third-party;
3134         otherwise, we return a non-empty string that represents the code signing identifier.
3135         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
3136         (WebKit::connectToService): Use the code signing identifier for the client-identifier if we have one (e.g.
3137         we are signed app). If we do not have a code signing identifier then take client-identifier to be the
3138         bundle identifier of our main bundle. Failing that we take client-identifier to be _NSGetProgname().
3139         * WebKit2.xcodeproj/project.pbxproj: Add files Shared/mac/CodeSigning.{h, mm}.
3140
3141 2016-04-12  Enrica Casucci  <enrica@apple.com>
3142
3143         Should retrieve text surrounding the selection when performing lookup.
3144         https://bugs.webkit.org/show_bug.cgi?id=156525
3145         rdar://problem/25043678
3146
3147         Reviewed by Tim Horton.
3148
3149         The lookup functionality requires the surrounding text to improve
3150         the quality of the results. This patch changes the implementation of
3151         _lookup to retrieve the text before and the text after the selection.
3152         It also renames DictationContextCallback to SelectionContextCallback so
3153         that it can be used for both dictation and lookup, since they both need
3154         the surrounding text.
3155
3156         * UIProcess/AutoCorrectionCallback.h:
3157         * UIProcess/WebPageProxy.h:
3158         * UIProcess/WebPageProxy.messages.in:
3159         * UIProcess/ios/WKContentViewInteraction.mm:
3160         (-[WKContentView _lookup:]):
3161         * UIProcess/ios/WebPageProxyIOS.mm:
3162         (WebKit::WebPageProxy::autocorrectionDataCallback):
3163         (WebKit::WebPageProxy::selectionContextCallback):
3164         (WebKit::WebPageProxy::getAutocorrectionContext):
3165         (WebKit::WebPageProxy::getSelectionContext):
3166         (WebKit::WebPageProxy::handleTwoFingerTapAtPoint):
3167         (WebKit::WebPageProxy::dictationContextCallback): Deleted.
3168         (WebKit::WebPageProxy::getLookupContextAtPoint): Deleted.
3169         * WebProcess/WebPage/WebPage.h:
3170         * WebProcess/WebPage/WebPage.messages.in:
3171         * WebProcess/WebPage/ios/WebPageIOS.mm:
3172         (WebKit::WebPage::performDefaultBehaviorForKeyEvent):
3173         (WebKit::WebPage::getSelectionContext):
3174         (WebKit::WebPage::accessibilityObjectForMainFramePlugin):
3175         (WebKit::WebPage::requestDictationContext):
3176         (WebKit::WebPage::replaceSelectedText):
3177         (WebKit::WebPage::getLookupContextAtPoint): Deleted.
3178
3179 2016-04-12  Joseph Pecoraro  <pecoraro@apple.com>
3180
3181         Web Inspector: Dock controls are not available in toolbar if Web Inspector window leaves fullscreen
3182         https://bugs.webkit.org/show_bug.cgi?id=156520
3183         <rdar://problem/22101106>
3184
3185         Reviewed by Timothy Hatcher.
3186
3187         * UIProcess/mac/WebInspectorProxyMac.mm:
3188         (WebKit::WebInspectorProxy::platformCanAttach):
3189         Be more explicit about the attachment view check. Its intent
3190         was to prevent allowing a 2nd level inspector from attaching
3191         to a 1st level inspector. We can use a stronger check. Also,
3192         remove deprecated pragmas by switching to new value.
3193
3194 2016-04-12  Joseph Pecoraro  <pecoraro@apple.com>
3195
3196         Web Inspector: Keyboard shortcut for "Inspect Element" only works when Web Inspector is open.
3197         https://bugs.webkit.org/show_bug.cgi?id=111193
3198         <rdar://problem/13325889>
3199
3200         Reviewed by Timothy Hatcher.
3201
3202         * UIProcess/API/C/WKInspector.cpp:
3203         (WKInspectorIsElementSelectionActive):
3204         (WKInspectorToggleElementSelection):
3205         * UIProcess/API/C/WKInspector.h:
3206         API for WebKit clients to toggle element selection.
3207
3208         * UIProcess/WebInspectorProxy.cpp:
3209         (WebKit::WebInspectorProxy::toggleElementSelection):
3210         (WebKit::WebInspectorProxy::elementSelectionChanged):
3211         * UIProcess/WebInspectorProxy.h:
3212         (WebKit::WebInspectorProxy::isElementSelectionActive):
3213         * UIProcess/WebInspectorProxy.messages.in:
3214         UIProcess update according to the state of the page
3215         and action to tell the page to toggle.
3216         When starting, pre-connect the inspector. When the
3217         state changes, if we were stopping and nothing was
3218         selected, then disconnect. Otherwise, we will bring
3219         the inspector to the front.
3220
3221         * WebProcess/WebCoreSupport/WebInspectorClient.cpp:
3222         (WebKit::WebInspectorClient::elementSelectionChanged):
3223         * WebProcess/WebCoreSupport/WebInspectorClient.h:
3224         Let the UIProcess update its cached state of whether or
3225         not element selection is enabled or disabled.
3226
3227         * WebProcess/WebPage/WebInspector.cpp:
3228         (WebKit::WebInspector::startElementSelection):
3229         (WebKit::WebInspector::stopElementSelection):
3230         (WebKit::WebInspector::elementSelectionChanged):
3231         * WebProcess/WebPage/WebInspector.h:
3232         * WebProcess/WebPage/WebInspector.messages.in:
3233         Messages in both directions.
3234         UIProcess -> InspectorProcess enable/disable.
3235         WebProcess -> UIProcess updated element selection state.
3236
3237         * WebProcess/WebPage/WebInspectorUI.cpp:
3238         (WebKit::WebInspectorUI::startElementSelection):
3239         (WebKit::WebInspectorUI::stopElementSelection):
3240         * WebProcess/WebPage/WebInspectorUI.h:
3241         * WebProcess/WebPage/WebInspectorUI.messages.in:
3242         Open the inspector and enable element selection.
3243
3244 2016-04-11  Alex Christensen  <achristensen@webkit.org>
3245
3246         Build MiniBrowser with CMake on Mac
3247         https://bugs.webkit.org/show_bug.cgi?id=156471
3248
3249         Reviewed by Daniel Bates.
3250
3251         * DatabaseProcess/DatabaseProcess.messages.in:
3252
3253 2016-04-11  Ryuan Choi  <ryuan.choi@navercorp.com>
3254
3255         [EFL] Do not pass context to EwkViewCreate
3256         https://bugs.webkit.org/show_bug.cgi?id=156461
3257
3258         Reviewed by Darin Adler.
3259
3260         EWKViewCreate already has pageConfiguration which contains context.
3261         So, this patch removes context argument from EWKViewCreate.
3262
3263         * UIProcess/API/C/CoordinatedGraphics/WKView.cpp:
3264         (WKViewCreate):
3265         * UIProcess/API/C/CoordinatedGraphics/WKView.h:
3266         * UIProcess/API/efl/ewk_view.cpp:
3267         (EWKViewCreate): Call WebView::Create instead of WKViewCreate not to use WK API.
3268         (ewk_view_smart_add):
3269         (ewk_view_add_with_configuration):
3270         (ewk_view_add_with_context):
3271         * UIProcess/API/efl/ewk_view_private.h:
3272         * UIProcess/efl/WebInspectorProxyEfl.cpp:
3273         (WebKit::WebInspectorProxy::platformCreateInspectorPage):
3274         * UIProcess/efl/WebView.cpp:
3275         (WebKit::WebView::create):
3276         (WebKit::WebView::WebView):
3277         * UIProcess/efl/WebView.h:
3278
3279 2016-04-11  Darin Adler  <darin@apple.com>
3280
3281         Remove UsePointersEvenForNonNullableObjectArguments from HTMLSelectElement
3282         https://bugs.webkit.org/show_bug.cgi?id=156458
3283
3284         Reviewed by Chris Dumez.
3285
3286         * WebProcess/Plugins/PDF/PDFPluginAnnotation.mm: Updated includes.
3287
3288 2016-04-11  Jeremy Jones  <jeremyj@apple.com>
3289
3290         When clearing cache, also clear AVFoundation cache.
3291         https://bugs.webkit.org/show_bug.cgi?id=155783
3292         rdar://problem/25252541
3293
3294         Reviewed by Darin Adler.
3295
3296         Include the HTMLMediaElement media cache when doing disk cache operations.
3297         Add a sandbox extension for media cache directory. This allows the UI process and the web process
3298         to access the same cache.
3299
3300         * Shared/WebProcessCreationParameters.cpp:
3301         (WebKit::WebProcessCreationParameters::encode): Add media cache directory.
3302         (WebKit::WebProcessCreationParameters::decode): Add media cache directory.
3303         * Shared/WebProcessCreationParameters.h:
3304         * UIProcess/API/APIProcessPoolConfiguration.cpp:
3305         (API::ProcessPoolConfiguration::createWithLegacyOptions):
3306         (API::ProcessPoolConfiguration::ProcessPoolConfiguration): Add media cache directory.
3307         (API::ProcessPoolConfiguration::copy): Add media cache directory.
3308         * UIProcess/API/APIProcessPoolConfiguration.h:
3309         * UIProcess/API/APIWebsiteDataStore.cpp:
3310         (API::WebsiteDataStore::defaultMediaCacheDirectory): Default implementation.
3311         * UIProcess/API/APIWebsiteDataStore.h:
3312         * UIProcess/API/Cocoa/APIWebsiteDataStoreCocoa.mm:
3313         (API::WebsiteDataStore::defaultMediaCacheDirectory): Media cache is in temporary directory.
3314         (API::WebsiteDataStore::tempDirectoryFileSystemRepresentation): For resources in temporary directory.
3315         (API::WebsiteDataStore::defaultDataStoreConfiguration): Init media cache directory.
3316         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
3317         (WebKit::WebProcessPool::legacyPlatformDefaultMediaCacheDirectory):
3318         * UIProcess/WebProcessPool.cpp:
3319         (WebKit::legacyWebsiteDataStoreConfiguration): Add mediaCacheDirectory.
3320         (WebKit::WebProcessPool::createNewWebProcess): Add mediaCacheDirectory.
3321         * UIProcess/WebProcessPool.h:
3322         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
3323         (WebKit::WebsiteDataStore::WebsiteDataStore):
3324         (WebKit::WebsiteDataStore::fetchData): Implement for mediaCacheDirectory.
3325         (WebKit::WebsiteDataStore::removeData): Implement for mediaCacheDirectory.
3326         * UIProcess/WebsiteData/WebsiteDataStore.h:
3327         * UIProcess/efl/WebProcessPoolEfl.cpp:
3328         (WebKit::WebProcessPool::legacyPlatformDefaultMediaCacheDirectory): Added.
3329         * UIProcess/gtk/WebProcessPoolGtk.cpp:
3330         (WebKit::WebProcessPool::legacyPlatformDefaultMediaCacheDirectory): Added.
3331         * WebProcess/WebProcess.cpp:
3332         (WebKit::WebProcess::initializeWebProcess): Initialize media cache directory.
3333         * WebProcess/cocoa/WebProcessCocoa.mm:
3334         (WebKit::WebProcess::platformInitializeWebProcess): Consume sandbox extension.
3335
3336 2016-04-11  Commit Queue  <commit-queue@webkit.org>
3337
3338         Unreviewed, rolling out r199315.
3339         https://bugs.webkit.org/show_bug.cgi?id=156482
3340
3341         This change broke the OS X Yosemite build. (Requested by jwtan
3342         on #webkit).
3343
3344         Reverted changeset:
3345
3346         "When clearing cache, also clear AVFoundation cache."
3347         https://bugs.webkit.org/show_bug.cgi?id=155783
3348         http://trac.webkit.org/changeset/199315
3349
3350 2016-04-11  Jeremy Jones  <jeremyj@apple.com>
3351
3352         When clearing cache, also clear AVFoundation cache.
3353         https://bugs.webkit.org/show_bug.cgi?id=155783
3354         rdar://problem/25252541
3355
3356         Reviewed by Darin Adler.
3357
3358         Include the HTMLMediaElement media cache when doing disk cache operations.
3359         Add a sandbox extension for media cache directory. This allows the UI process and the web process
3360         to access the same cache.
3361
3362         * Shared/WebProcessCreationParameters.cpp:
3363         (WebKit::WebProcessCreationParameters::encode): Add media cache directory.
3364         (WebKit::WebProcessCreationParameters::decode): Add media cache directory.
3365         * Shared/WebProcessCreationParameters.h:
3366         * UIProcess/API/APIProcessPoolConfiguration.cpp:
3367         (API::ProcessPoolConfiguration::createWithLegacyOptions):
3368         (API::ProcessPoolConfiguration::ProcessPoolConfiguration): Add media cache directory.
3369         (API::ProcessPoolConfiguration::copy): Add media cache directory.
3370         * UIProcess/API/APIProcessPoolConfiguration.h:
3371         * UIProcess/API/APIWebsiteDataStore.cpp:
3372         (API::WebsiteDataStore::defaultMediaCacheDirectory): Default implementation.
3373         * UIProcess/API/APIWebsiteDataStore.h:
3374         * UIProcess/API/Cocoa/APIWebsiteDataStoreCocoa.mm:
3375         (API::WebsiteDataStore::defaultMediaCacheDirectory): Media cache is in temporary directory.
3376         (API::WebsiteDataStore::tempDirectoryFileSystemRepresentation): For resources in temporary directory.
3377         (API::WebsiteDataStore::defaultDataStoreConfiguration): Init media cache directory.
3378         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
3379         (WebKit::WebProcessPool::legacyPlatformDefaultMediaCacheDirectory):
3380         * UIProcess/WebProcessPool.cpp:
3381         (WebKit::legacyWebsiteDataStoreConfiguration): Add mediaCacheDirectory.
3382         (WebKit::WebProcessPool::createNewWebProcess): Add mediaCacheDirectory.
3383         * UIProcess/WebProcessPool.h:
3384         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
3385         (WebKit::WebsiteDataStore::WebsiteDataStore):
3386         (WebKit::WebsiteDataStore::fetchData): Implement for mediaCacheDirectory.
3387         (WebKit::WebsiteDataStore::removeData): Implement for mediaCacheDirectory.
3388         * UIProcess/WebsiteData/WebsiteDataStore.h:
3389         * UIProcess/efl/WebProcessPoolEfl.cpp:
3390         (WebKit::WebProcessPool::legacyPlatformDefaultMediaCacheDirectory): Added.
3391         * UIProcess/gtk/WebProcessPoolGtk.cpp:
3392         (WebKit::WebProcessPool::legacyPlatformDefaultMediaCacheDirectory): Added.
3393         * WebProcess/WebProcess.cpp:
3394         (WebKit::WebProcess::initializeWebProcess): Initialize media cache directory.
3395         * WebProcess/cocoa/WebProcessCocoa.mm:
3396         (WebKit::WebProcess::platformInitializeWebProcess): Consume sandbox extension.
3397
3398 2016-04-11  Said Abou-Hallawa  <sabouhallawa@apple,com>
3399
3400         Merge CG ImageSource and non CG ImageSource implementation in one file
3401         https://bugs.webkit.org/show_bug.cgi?id=155456
3402
3403         Reviewed by Darin Adler.
3404
3405         * UIProcess/API/efl/EwkView.cpp:
3406         (EwkView::setCursor):
3407         Replace the call to Image::getHotSpot() by Image::hotSpot().
3408
3409 2016-04-11  Anders Carlsson  <andersca@apple.com>
3410
3411         Rename WKOpenPanelParameters files to WKOpenPanelParametersRef
3412         https://bugs.webkit.org/show_bug.cgi?id=156473
3413
3414         Reviewed by Alex Christensen.
3415
3416         * UIProcess/API/C/WKOpenPanelParameters.cpp:
3417         (WKOpenPanelParametersGetTypeID): Deleted.
3418         (WKOpenPanelParametersGetAllowsMultipleFiles): Deleted.
3419         (WKOpenPanelParametersCopyAcceptedMIMETypes): Deleted.
3420         (WKOpenPanelParametersCopyCapture): Deleted.
3421         (WKOpenPanelParametersGetCaptureEnabled): Deleted.
3422         (WKOpenPanelParametersCopySelectedFileNames): Deleted.
3423         * UIProcess/API/C/WKOpenPanelParametersRef.cpp: Renamed from Source/WebKit2/UIProcess/API/C/WKOpenPanelParameters.cpp.
3424         (WKOpenPanelParametersGetTypeID):
3425         (WKOpenPanelParametersGetAllowsMultipleFiles):
3426         (WKOpenPanelParametersCopyAcceptedMIMETypes):
3427         (WKOpenPanelParametersCopyCapture):
3428         (WKOpenPanelParametersGetCaptureEnabled):
3429         (WKOpenPanelParametersCopySelectedFileNames):
3430         * UIProcess/API/C/WKOpenPanelParametersRef.h: Renamed from Source/WebKit2/UIProcess/API/C/WKOpenPanelParameters.h.
3431         * UIProcess/API/C/WebKit2_C.h:
3432         * UIProcess/API/efl/ewk_file_chooser_request.cpp:
3433         * UIProcess/mac/WebInspectorProxyMac.mm:
3434         * WebKit2.xcodeproj/project.pbxproj:
3435
3436 2016-04-09  Gavin Barraclough  <barraclough@apple.com>
3437
3438         WebKit should adopt journal_mode=wal for all SQLite databases.
3439         https://bugs.webkit.org/show_bug.cgi?id=133496
3440
3441         Reviewed by Darin Adler.
3442
3443         * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
3444         (WKBundleClearAllDatabases):
3445             - renamed deleteAllDatabases -> deleteAllDatabasesImmediately.
3446
3447 2016-04-11  Daniel Bates  <dabates@apple.com>