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