714cbccce4b88eb0c352ddade886b11ca2e37218
[WebKit-https.git] / Source / WebKit2 / ChangeLog
1 2016-05-28  Chris Dumez  <cdumez@apple.com>
2
3         Modernize lambda captures in the network disk cache implementation
4         https://bugs.webkit.org/show_bug.cgi?id=158179
5
6         Reviewed by Darin Adler.
7
8         Modernize lambda captures in the network disk cache implementation.
9
10         * NetworkProcess/cache/NetworkCache.cpp:
11         (WebKit::NetworkCache::Cache::retrieve):
12         (WebKit::NetworkCache::Cache::store):
13         (WebKit::NetworkCache::Cache::traverse):
14         * NetworkProcess/cache/NetworkCache.h:
15         * NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp:
16         (WebKit::NetworkCache::inputStreamReadReadyCallback):
17         (WebKit::NetworkCache::outputStreamWriteReadyCallback):
18         * NetworkProcess/cache/NetworkCacheStatistics.cpp:
19         (WebKit::NetworkCache::Statistics::initialize):
20         (WebKit::NetworkCache::Statistics::shrinkIfNeeded):
21         (WebKit::NetworkCache::Statistics::queryWasEverRequested):
22         * NetworkProcess/cache/NetworkCacheStatistics.h:
23         * NetworkProcess/cache/NetworkCacheStorage.cpp:
24         (WebKit::NetworkCache::Storage::updateFileModificationTime):
25         (WebKit::NetworkCache::Storage::clear):
26
27 2016-05-27  Caitlin Potter  <caitp@igalia.com>
28
29         [JSC] implement async functions proposal
30         https://bugs.webkit.org/show_bug.cgi?id=156147
31
32         Reviewed by Yusuke Suzuki.
33
34         * UIProcess/API/C/WKPreferencesRefPrivate.h:
35         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
36
37 2016-05-27  Chris Dumez  <cdumez@apple.com>
38
39         Improve lambda capture in NetworkCache::Storage::synchronize()
40         https://bugs.webkit.org/show_bug.cgi?id=158176
41
42         Reviewed by Brady Eidson.
43
44         Improve lambda capture in NetworkCache::Storage::synchronize(). We can
45         now capture the std::unique_ptr<> variables directly thanks to:
46         1. C++14's support for initializer's in lambda captures
47         2. RunLoop::dispatch() now takes a NoncopyableFunction in instead of
48            a std::function, allowing us to capture non-copyable variables.
49
50         * NetworkProcess/cache/NetworkCacheStorage.cpp:
51         (WebKit::NetworkCache::Storage::synchronize):
52
53 2016-05-27  Jeremy Jones  <jeremyj@apple.com>
54
55         Decrease flicker when changing video presentation mode.
56         https://bugs.webkit.org/show_bug.cgi?id=158148
57         rdar://problem/24476949
58
59         Reviewed by Tim Horton.
60
61         Prevent flicker by using setVideoFullscreenLayer with a completion handler to delay 
62         enter fullscreen and cleanup fullscreen until the video layer has completely been
63         installed or removed.
64
65         * WebProcess/cocoa/WebVideoFullscreenManager.mm:
66         (WebKit::WebVideoFullscreenManager::didSetupFullscreen):
67         (WebKit::WebVideoFullscreenManager::didExitFullscreen):
68
69 2016-05-27  Chris Dumez  <cdumez@apple.com>
70
71         WorkQueue::dispatch() / RunLoop::dispatch() should not copy captured lambda variables
72         https://bugs.webkit.org/show_bug.cgi?id=158111
73
74         Reviewed by Darin Adler.
75
76         WorkQueue::dispatch() / RunLoop::dispatch() should not copy captured lambda variables.
77         These are often used cross-thread and copying the captured lambda variables can be
78         dangerous (e.g. we do not want to copy a String after calling isolatedCopy() upon
79         capture).
80
81         * NetworkProcess/NetworkProcess.cpp:
82         (WebKit::clearDiskCacheEntries):
83         * NetworkProcess/cache/NetworkCache.cpp:
84         (WebKit::NetworkCache::Cache::clear):
85         * NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp:
86         (WebKit::NetworkCache::runTaskInQueue):
87         * Platform/IPC/Connection.cpp:
88         (IPC::Connection::processIncomingMessage):
89         * UIProcess/Storage/StorageManager.cpp:
90         (WebKit::StorageManager::getSessionStorageOrigins):
91         (WebKit::StorageManager::deleteSessionStorageOrigins):
92         (WebKit::StorageManager::deleteSessionStorageEntriesForOrigins):
93         (WebKit::StorageManager::getLocalStorageOrigins):
94         (WebKit::StorageManager::getLocalStorageOriginDetails):
95         (WebKit::StorageManager::deleteLocalStorageOriginsModifiedSince):
96         (WebKit::StorageManager::deleteLocalStorageEntriesForOrigins):
97         * UIProcess/Storage/StorageManager.h:
98
99 2016-05-27  Alex Christensen  <achristensen@webkit.org>
100
101         Expose content extension failure error codes in SPI
102         https://bugs.webkit.org/show_bug.cgi?id=158095
103         rdar://problem/26475651
104
105         Reviewed by Anders Carlsson.
106
107         * UIProcess/API/APIUserContentExtensionStore.cpp:
108         (API::UserContentExtensionStore::synchronousRemoveAllContentExtensions):
109         (API::UserContentExtensionStore::invalidateContentExtensionVersion):
110         Added for testing.
111         (API::userContentExtensionStoreErrorCategory):
112         * UIProcess/API/APIUserContentExtensionStore.h:
113         * UIProcess/API/Cocoa/_WKUserContentExtensionStore.h:
114         Added the new enum, _WKUserContentExtensionStoreErrorCode.
115         * UIProcess/API/Cocoa/_WKUserContentExtensionStore.mm:
116         (-[_WKUserContentExtensionStore compileContentExtensionForIdentifier:encodedContentExtension:completionHandler:]):
117         Sometimes the error code returned by UserContentExtensionStore::compileContentExtension has the error code from compileRuleList.
118         When this happens, we want to get the message from the internal compiler error, but we want the NSError's code to always be CompileFailed.
119         (-[_WKUserContentExtensionStore lookupContentExtensionForIdentifier:completionHandler:]):
120         (-[_WKUserContentExtensionStore removeContentExtensionForIdentifier:completionHandler:]):
121         (-[_WKUserContentExtensionStore _removeAllContentExtensions]):
122         (-[_WKUserContentExtensionStore _invalidateContentExtensionVersionForIdentifier:]):
123         * UIProcess/API/Cocoa/_WKUserContentExtensionStorePrivate.h:
124         Added new invalidator for testing.
125
126 2016-05-27  Zalan Bujtas  <zalan@apple.com>
127
128         Regression(r200972): Webcore::Range::collectSelectionsRects() asserts in startContainer() while selecting text.
129         https://bugs.webkit.org/show_bug.cgi?id=158155
130         <rdar://problem/26502712>
131
132         Reviewed by Chris Dumez.
133
134         This patch ensures that we still have a valid paragraphRange after returning from enclosingTextUnitOfGranularity().
135
136         * WebProcess/WebPage/ios/WebPageIOS.mm:
137         (WebKit::WebPage::selectTextWithGranularityAtPoint):
138
139 2016-05-26  Brady Eidson  <beidson@apple.com>
140
141         Certain NetworkResourceLoader callbacks can deref a null m_networkLoad.
142         https://bugs.webkit.org/show_bug.cgi?id=158134
143
144         Reviewed by Alex Christensen.
145
146         It's legit for m_networkLoad to be null in these callbacks.
147         
148         We need null checks, just like we have in many other callbacks in this class.
149         
150         * NetworkProcess/NetworkResourceLoader.cpp:
151         (WebKit::NetworkResourceLoader::continueWillSendRequest):
152         (WebKit::NetworkResourceLoader::continueCanAuthenticateAgainstProtectionSpace):
153
154 2016-05-26  Darin Adler  <darin@apple.com>
155
156         Media queries and platform screen modernization and streamlining
157         https://bugs.webkit.org/show_bug.cgi?id=158067
158
159         Reviewed by Alex Christensen.
160
161         * Shared/mac/WebEventFactory.mm:
162         (WebKit::screenForWindow): Deleted.
163         (WebKit::flipScreenPoint): Deleted.
164         (WebKit::globalPoint): Deleted.
165         (WebKit::globalPointForEvent): Use globalPoint function from WebCore so we don't need
166         copies of everything in here.
167
168         * UIProcess/Cocoa/WebViewImpl.mm:
169         (WebKit::WebViewImpl::windowDidChangeScreen): Removed unneeded type cast.
170         (WebKit::WebViewImpl::draggedImage): Added type cast since globalPoint now returns an
171         NSPoint rather than an IntPoint.
172
173         * UIProcess/WebPageProxy.h: Use pragma once. Add a WebCore prefix to a use of
174         PlatformDisplayID, since that is now inside the WebCore namespace.
175         * WebProcess/WebCoreSupport/WebChromeClient.h: Ditto.
176         * WebProcess/WebPage/Cocoa/RemoteLayerTreeDisplayRefreshMonitor.h: Ditto.
177         * WebProcess/WebPage/DrawingArea.h: Ditto.
178         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h: Ditto.
179
180 2016-05-26  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
181
182         Purge PassRefPtr in Modules/battery
183         https://bugs.webkit.org/show_bug.cgi?id=157062
184
185         Reviewed by Darin Adler.
186
187         Use RefPtr<>& to reduce uses of PassRefPtr in WebKit.
188
189         * WebProcess/Battery/WebBatteryManager.cpp:
190         (WebKit::WebBatteryManager::didChangeBatteryStatus):
191         (WebKit::WebBatteryManager::updateBatteryStatus):
192         * WebProcess/WebPage/WebPage.cpp:
193         (WebKit::m_shouldDispatchFakeMouseMoveEvents):
194
195 2016-05-26  Myles C. Maxfield  <mmaxfield@apple.com>
196
197         Build fix
198
199         Rubber stamped by Lucas Forschler.
200
201         * Configurations/DebugRelease.xcconfig:
202
203 2016-05-25  Jer Noble  <jer.noble@apple.com>
204
205         Flashiness and jumpiness when entering fullscreen
206         https://bugs.webkit.org/show_bug.cgi?id=158087
207
208         Reviewed by Beth Dakin.
209
210         Multiple independant sources of jumpiness and flashiness are addressed here:
211
212         - Setting the top content inset on the WKView cause a vertical jump during fullscreen
213         transition. Instead of setting the content inset to 0, take the existing inset into account
214         when placing the WKView in the NSWindow.
215
216         - The enter fullscreen transition causes a white flash due to the NSWindow needing
217         display before ordering onscreen. Ensure the window has a backing by calling -displayIfNeeded
218         before entering fullscreen mode.
219
220         - The exit fullscreen transition causes a white background color flash for an unknown
221         reason, but is solved by not making the window's content view layer-backed. Rather than
222         directly animating the contentView's background color, create a specific background view
223         and animate it's background color instead.
224
225         * UIProcess/mac/WKFullScreenWindowController.h:
226         * UIProcess/mac/WKFullScreenWindowController.mm:
227         (-[WKFullScreenWindowController initWithWindow:webView:page:]):
228         (-[WKFullScreenWindowController enterFullScreen:]):
229         (-[WKFullScreenWindowController finishedEnterFullScreenAnimation:]):
230         (-[WKFullScreenWindowController finishedExitFullScreenAnimation:]):
231         (-[WKFullScreenWindowController _startEnterFullScreenAnimationWithDuration:]):
232         (-[WKFullScreenWindowController _startExitFullScreenAnimationWithDuration:]):
233         * WebProcess/FullScreen/WebFullScreenManager.cpp:
234         (WebKit::WebFullScreenManager::saveScrollPosition): Deleted.
235         (WebKit::WebFullScreenManager::restoreScrollPosition): Deleted.
236
237 2016-05-25  Alex Christensen  <achristensen@webkit.org>
238
239         Fix CMake build.
240
241         * PlatformMac.cmake:
242
243 2016-05-25  Chris Dumez  <cdumez@apple.com>
244
245         Simplify a few lambda captures in the network cache code
246         https://bugs.webkit.org/show_bug.cgi?id=158076
247
248         Reviewed by Antti Koivisto.
249
250         Simplify a few lambda captures in the network cache code by WTFMoving
251         upon capture.
252
253         * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
254         (WebKit::NetworkCache::SpeculativeLoadManager::retrieve):
255         (WebKit::NetworkCache::SpeculativeLoadManager::retrieveEntryFromStorage):
256         (WebKit::NetworkCache::SpeculativeLoadManager::retrieveSubresourcesEntry):
257         * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.h:
258         * NetworkProcess/cache/NetworkCacheStatistics.cpp:
259         (WebKit::NetworkCache::Statistics::bootstrapFromNetworkCache):
260         (WebKit::NetworkCache::Statistics::recordNotUsingCacheForRequest):
261         (WebKit::NetworkCache::Statistics::recordRetrievalFailure):
262         (WebKit::NetworkCache::Statistics::writeTimerFired):
263         (WebKit::NetworkCache::Statistics::addHashesToDatabase):
264         (WebKit::NetworkCache::Statistics::addStoreDecisionsToDatabase):
265         * NetworkProcess/cache/NetworkCacheStatistics.h:
266
267 2016-05-25  Fujii Hironori  <Hironori.Fujii@sony.com>
268
269         [Unix] Potential buffer overrun of m_fileDescriptors in readBytesFromSocket of ConnectionUnix.cpp
270         https://bugs.webkit.org/show_bug.cgi?id=158058
271
272         Reviewed by Carlos Garcia Campos.
273
274         Memcpy does not check the boundary of m_fileDescriptors in
275         readBytesFromSocket of ConnectionUnix.cpp.  This is not a problem
276         in normal cases, but in the case when Web process is hijacked and
277         malicious IPC packets were sent.  WTF::Vector already has two
278         members m_capacity and m_size.  There is no need to have a
279         separate member m_fileDescriptorsSize to remember the number of
280         remaining data.
281
282         * Platform/IPC/Connection.h: Remove members m_readBufferSize and
283         m_fileDescriptorsSize.
284         * Platform/IPC/unix/ConnectionUnix.cpp:
285         (IPC::Connection::platformInitialize): Removed initialization of
286         m_readBufferSize and m_fileDescriptorsSize.  Reserve initial
287         capacity for m_readBuffer and m_fileDescriptors.
288         (IPC::Connection::processMessage): Replace m_readBufferSize and
289         m_fileDescriptorsSize with m_readBuffer.size() and
290         m_fileDescriptors.size().  Use Vector::shrink() to reset the
291         number of remaining data in the buffers.
292         (IPC::readBytesFromSocket) : Change argument types to WTF::Vector
293         instead of pointers and sizes.
294         (IPC::Connection::readyReadHandler): Call new readBytesFromSocket
295
296 2016-05-25  Chris Dumez  <cdumez@apple.com>
297
298         Update constructRevalidationRequest() to stop returning a unique_ptr<ResourceRequest>
299         https://bugs.webkit.org/show_bug.cgi?id=158046
300
301         Reviewed by Darin Adler.
302
303         Update constructRevalidationRequest() to stop returning a unique_ptr<ResourceRequest>
304         and to return a ResourceRequest instead. There is no reason for it to return a
305         pointer.
306
307         * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
308         (WebKit::NetworkCache::constructRevalidationRequest):
309         (WebKit::NetworkCache::SpeculativeLoadManager::PreloadedEntry::PreloadedEntry):
310         (WebKit::NetworkCache::SpeculativeLoadManager::PreloadedEntry::revalidationRequest):
311         (WebKit::NetworkCache::SpeculativeLoadManager::addPreloadedEntry):
312         (WebKit::NetworkCache::SpeculativeLoadManager::revalidateEntry):
313         * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.h:
314
315 2016-05-25  Antoine Quint  <graouts@apple.com>
316
317         Elements with backdrop-filter cannot be clipped with clip-path or mask
318         https://bugs.webkit.org/show_bug.cgi?id=142662
319         <rdar://problem/20150192>
320
321         Reviewed by Dean Jackson.
322
323         Ensure layer clones are set up with the same shape path as their original layer.
324
325         * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
326         (WebKit::PlatformCALayerRemote::updateClonedLayerProperties):
327
328 2016-05-24  Chris Dumez  <cdumez@apple.com>
329
330         Simplify a couple of lambda captures in the network cache code
331         https://bugs.webkit.org/show_bug.cgi?id=158053
332
333         Reviewed by Brady Eidson.
334
335         * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
336         (WebKit::NetworkCache::SpeculativeLoadManager::preloadEntry):
337         Just capture subResourceInfo instead of allocating a new copy
338         on the heap. There is no reason we cannot simply capture
339         subResourceInfo here.
340
341         * NetworkProcess/cache/NetworkCacheStorage.cpp:
342         (WebKit::NetworkCache::Storage::clear):
343         Use new C++14 capture with initialization to make the code a
344         bit nicer.
345
346 2016-05-24  Conrad Shultz  <conrad_shultz@apple.com>
347
348         _WKThumbnailView should expose its snapshot size
349         https://bugs.webkit.org/show_bug.cgi?id=158049
350
351         Reviewed by Tim Horton.
352
353         * UIProcess/API/Cocoa/_WKThumbnailView.h:
354         * UIProcess/API/Cocoa/_WKThumbnailView.mm:
355         (-[_WKThumbnailView _didTakeSnapshot:]):
356         Update the new snapshotSize property in a KVO-compliant manner.
357
358 2016-05-24  Ryan Haddad  <ryanhaddad@apple.com>
359
360         Unreviewed, rolling out r201349.
361
362         This change caused compositing tests to assert on iOS
363         simulator
364
365         Reverted changeset:
366
367         "Elements with backdrop-filter cannot be clipped with clip-
368         path or mask"
369         https://bugs.webkit.org/show_bug.cgi?id=142662
370         http://trac.webkit.org/changeset/201349
371
372 2016-05-24  Ryan Haddad  <ryanhaddad@apple.com>
373
374         Unreviewed, rolling out r201341.
375
376         This change may have caused LayoutTests to crash on Mac and
377         iOS
378
379         Reverted changeset:
380
381         "Use lambda capture with initializer instead of StringCapture"
382         https://bugs.webkit.org/show_bug.cgi?id=158010
383         http://trac.webkit.org/changeset/201341
384
385 2016-05-24  Alex Christensen  <achristensen@webkit.org>
386
387         Fix null pointer dereferencing in WebViewImpl::inputContext
388         https://bugs.webkit.org/show_bug.cgi?id=158026
389         rdar://problem/25994093
390
391         Reviewed by Tim Horton.
392
393         * UIProcess/API/Cocoa/WKWebView.mm:
394         (-[WKWebView inputContext]):
395         this was null sometimes in WebViewImpl::inputContext.
396
397 2016-05-24  Antoine Quint  <graouts@apple.com>
398
399         Elements with backdrop-filter cannot be clipped with clip-path or mask
400         https://bugs.webkit.org/show_bug.cgi?id=142662
401         <rdar://problem/20150192>
402
403         Reviewed by Dean Jackson.
404
405         Ensure layer clones are set up with the same shape path as their original layer.
406
407         * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
408         (WebKit::PlatformCALayerRemote::updateClonedLayerProperties):
409
410 2016-05-24  Chelsea Pugh  <cpugh@apple.com>
411
412         [iOS] Allow clients to override the type of an input field
413         https://bugs.webkit.org/show_bug.cgi?id=157995
414
415         Reviewed by Dan Bernstein.
416
417         * UIProcess/API/Cocoa/_WKFormInputSession.h:
418         * UIProcess/ios/WKContentViewInteraction.mm:
419         (-[WKFormInputSession textContentType]): Getter for textContentType.
420         (-[WKFormInputSession setTextContentType:]): Set the textContentType and reload
421         input views.
422         (contentTypeFromFieldName): Factor out switch statement to get text content type
423         from autofill field name into its own function.
424         (-[WKContentView textInputTraits]): If the client has set a text content type,
425         set the traits' content type to that. Otherwise, set the text content type if
426         there is one based on the assisted node information's autofill field name. If
427         neither the form input session nor the assisted node info yields a text content
428         type, set the text content type to nil, its default value.
429
430 2016-05-24  Chris Dumez  <cdumez@apple.com>
431
432         Use lambda capture with initializer instead of StringCapture
433         https://bugs.webkit.org/show_bug.cgi?id=158010
434
435         Reviewed by Antti Koivisto.
436
437         Use lambda capture with initializer instead of StringCapture now that 
438         we support C++14.
439
440         * NetworkProcess/cache/NetworkCache.cpp:
441         (WebKit::NetworkCache::Cache::deleteDumpFile):
442         * NetworkProcess/cache/NetworkCacheStatistics.cpp:
443         (WebKit::NetworkCache::Statistics::initialize):
444         (WebKit::NetworkCache::Statistics::shrinkIfNeeded):
445         * NetworkProcess/cache/NetworkCacheStorage.cpp:
446         (WebKit::NetworkCache::Storage::updateFileModificationTime):
447         (WebKit::NetworkCache::Storage::clear):
448         * UIProcess/API/APIUserContentExtensionStore.cpp:
449         (API::UserContentExtensionStore::lookupContentExtension):
450         (API::UserContentExtensionStore::compileContentExtension):
451         (API::UserContentExtensionStore::removeContentExtension):
452         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
453         (WebKit::WebsiteDataStore::fetchData):
454         (WebKit::WebsiteDataStore::removeData):
455
456 2016-05-24  Chris Dumez  <cdumez@apple.com>
457
458         Use auto for some of our lambda function parameters
459         https://bugs.webkit.org/show_bug.cgi?id=158001
460
461         Reviewed by Darin Adler.
462
463         Use auto for some of our lambda function parameters now that we build with c++14.
464
465         * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.cpp:
466         (WebKit::WebIDBConnectionToClient::didGetRecord):
467         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
468         (WebKit::NetworkConnectionToWebProcess::writeBlobsToTemporaryFiles):
469         * NetworkProcess/NetworkProcess.cpp:
470         (WebKit::fetchDiskCacheEntries):
471         (WebKit::NetworkProcess::fetchWebsiteData):
472         (WebKit::clearDiskCacheEntries):
473         * NetworkProcess/NetworkResourceLoader.cpp:
474         (WebKit::NetworkResourceLoader::retrieveCacheEntry):
475         (WebKit::NetworkResourceLoader::tryStoreAsCacheEntry):
476         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
477         (WebKit::NetworkCache::SpeculativeLoad::didFinishLoading):
478         * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
479         (WebKit::NetworkCache::SpeculativeLoadManager::registerLoad):
480         (WebKit::NetworkCache::SpeculativeLoadManager::retrieveEntryFromStorage):
481         (WebKit::NetworkCache::SpeculativeLoadManager::revalidateEntry):
482         (WebKit::NetworkCache::SpeculativeLoadManager::preloadEntry):
483         (WebKit::NetworkCache::SpeculativeLoadManager::retrieveSubresourcesEntry):
484         * NetworkProcess/cache/NetworkCacheStorage.cpp:
485         (WebKit::NetworkCache::Storage::removeFromPendingWriteOperations):
486         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
487         (-[WKNetworkSessionDelegate URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:]):
488         (-[WKNetworkSessionDelegate URLSession:task:_schemeUpgraded:completionHandler:]):
489         * Shared/API/Cocoa/_WKRemoteObjectInterface.mm:
490         (-[_WKRemoteObjectInterface debugDescription]):
491         * UIProcess/API/C/WKApplicationCacheManager.cpp:
492         (WKApplicationCacheManagerGetApplicationCacheOrigins):
493         * UIProcess/API/C/WKKeyValueStorageManager.cpp:
494         (WKKeyValueStorageManagerGetKeyValueStorageOrigins):
495         (WKKeyValueStorageManagerGetStorageDetailsByOrigin):
496         * UIProcess/API/C/WKResourceCacheManager.cpp:
497         (WKResourceCacheManagerGetCacheOrigins):
498         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
499         (-[WKWebsiteDataStore _fetchDataRecordsOfTypes:withOptions:completionHandler:]):
500         * UIProcess/UserContent/WebUserContentControllerProxy.cpp:
501         (WebKit::WebUserContentControllerProxy::removeAllUserScripts):
502         (WebKit::WebUserContentControllerProxy::removeAllUserStyleSheets):
503         (WebKit::WebUserContentControllerProxy::removeAllUserMessageHandlers):
504         * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
505         (WebKit::PlatformCALayerRemote::removeAnimationForKey):
506
507 2016-05-23  Yusuke Suzuki  <utatane.tea@gmail.com>
508
509         Assertion failure for Reflect.get with Proxy and primitive value as explicit receiver
510         https://bugs.webkit.org/show_bug.cgi?id=157080
511
512         Reviewed by Saam Barati.
513
514         * WebProcess/Plugins/Netscape/JSNPObject.cpp:
515         (WebKit::JSNPObject::propertyGetter):
516         (WebKit::JSNPObject::methodGetter):
517         * WebProcess/Plugins/Netscape/JSNPObject.h:
518
519 2016-05-23  Chris Dumez  <cdumez@apple.com>
520
521         Generate bindings code for EventTarget.addEventListener() / removeEventListener()
522         https://bugs.webkit.org/show_bug.cgi?id=157882
523
524         Reviewed by Darin Adler.
525
526         Generate bindings code for EventTarget.addEventListener() / removeEventListener()
527         instead of hardcoding them in the bindings generator.
528
529         * WebProcess/Plugins/PDF/PDFPluginAnnotation.h:
530         * WebProcess/Plugins/PDF/PDFPluginAnnotation.mm:
531         (WebKit::PDFPluginAnnotation::attach):
532         (WebKit::PDFPluginAnnotation::~PDFPluginAnnotation):
533         * WebProcess/Plugins/PDF/PDFPluginPasswordField.mm:
534         (WebKit::PDFPluginPasswordField::~PDFPluginPasswordField):
535         (WebKit::PDFPluginPasswordField::createAnnotationElement):
536         * WebProcess/Plugins/PDF/PDFPluginTextAnnotation.mm:
537         (WebKit::PDFPluginTextAnnotation::~PDFPluginTextAnnotation):
538         (WebKit::PDFPluginTextAnnotation::createAnnotationElement):
539
540 2016-05-23  Beth Dakin  <bdakin@apple.com>
541
542         Need SPI for clients to require a user action to get an editing controls 
543         manager
544         https://bugs.webkit.org/show_bug.cgi?id=157992
545         -and corresponding-
546         rdar://problem/26379927
547
548         Reviewed by Tim Horton.
549
550         New SPI _setRequiresUserActionForEditingControlsManager. The SPI defaults to 
551         False, which means that by default there is no user action requirement to 
552         have an editing controls manager. The SPI is on WKViewPrivate and 
553         WKWebViewConfigurationPrivate, and it’s implemented in WebViewImpl.
554         * UIProcess/API/Cocoa/WKViewPrivate.h:
555         * UIProcess/API/Cocoa/WKWebView.mm:
556         (-[WKWebView _initializeWithConfiguration:]):
557         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
558         (-[WKWebViewConfiguration init]):
559         (-[WKWebViewConfiguration copyWithZone:]):
560         (-[WKWebViewConfiguration _requiresUserActionForEditingControlsManager]):
561         (-[WKWebViewConfiguration _setRequiresUserActionForEditingControlsManager:]):
562         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
563         * UIProcess/API/mac/WKView.mm:
564         (-[WKView _requiresUserActionForEditingControlsManager]):
565         (-[WKView _setRequiresUserActionForEditingControlsManager:]):
566         * UIProcess/Cocoa/WebViewImpl.h:
567         (WebKit::WebViewImpl::setRequiresUserActionForEditingControlsManager):
568         (WebKit::WebViewImpl::requiresUserActionForEditingControlsManager):
569
570         New message allows the WebProcess to tell the UI process whether the current 
571         web page has had any selection changes based on user interaction.
572         * UIProcess/WebPageProxy.cpp:
573         (WebKit::WebPageProxy::setHasHadSelectionChangesFromUserInteraction):
574         * UIProcess/WebPageProxy.h:
575         (WebKit::WebPageProxy::hasHadSelectionChangesFromUserInteraction):
576         * UIProcess/WebPageProxy.messages.in:
577
578         m_userIsInteracting m_hasFocusedDueToUserInteraction used to be iOS only, but 
579         now we want to track them for Mac as well.
580         * WebProcess/WebPage/WebPage.cpp:
581
582         Handling mouse events and key events will toggle m_userIsInteracting.
583         (WebKit::WebPage::mouseEvent):
584         (WebKit::WebPage::keyEvent):
585
586         m_userIsInteracting is no longer iOS-only.
587         (WebKit::WebPage::setInitialFocus):
588
589         Send a message to the UI process on page transition to re-set 
590         hasHadSelectionChangesFromUserInteraction to false.
591         (WebKit::WebPage::didStartPageTransition):
592
593         Send a message to the UI process if this is the first selection change to 
594         happen as a result of a user action.
595         (WebKit::WebPage::didChangeSelection):
596         * WebProcess/WebPage/WebPage.h:
597
598 2016-05-23  Alex Christensen  <achristensen@webkit.org>
599
600         Add logging for NSURLSession calls
601         https://bugs.webkit.org/show_bug.cgi?id=157996
602
603         Reviewed by Brady Eidson.
604
605         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
606         (WebKit::NetworkDataTask::NetworkDataTask):
607         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
608         (toNSURLSessionResponseDisposition):
609         (-[WKNetworkSessionDelegate URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:]):
610         (-[WKNetworkSessionDelegate URLSession:task:_schemeUpgraded:completionHandler:]):
611         (-[WKNetworkSessionDelegate URLSession:dataTask:willCacheResponse:completionHandler:]):
612         (-[WKNetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:]):
613         (-[WKNetworkSessionDelegate URLSession:task:didCompleteWithError:]):
614         (-[WKNetworkSessionDelegate URLSession:dataTask:didReceiveResponse:completionHandler:]):
615         (-[WKNetworkSessionDelegate URLSession:dataTask:didReceiveData:]):
616         * Platform/Logging.h:
617
618 2016-05-23  Chris Fleizach  <cfleizach@apple.com>
619
620         AX: iOS: when bringing focus to a text field we may zoom the page even if author wanted max scale = 1
621         https://bugs.webkit.org/show_bug.cgi?id=157771
622
623         Reviewed by Tim Horton.
624
625         * Shared/AssistedNodeInformation.cpp:
626         (WebKit::AssistedNodeInformation::encode):
627         (WebKit::AssistedNodeInformation::decode):
628         * Shared/AssistedNodeInformation.h:
629         * UIProcess/ios/WKContentViewInteraction.mm:
630         (-[WKContentView _displayFormNodeInputView]):
631         * WebProcess/WebPage/ios/WebPageIOS.mm:
632         (WebKit::WebPage::getAssistedNodeInformation):
633
634 2016-05-23  Miguel Gomez  <magomez@igalia.com>
635
636         [ThreadedCompositor] Ensure that the BitmapTexture used by CoordinatedBackingStoreTile matches the opacity of the painted surface
637         https://bugs.webkit.org/show_bug.cgi?id=157942
638
639         Reviewed by Žan Doberšek.
640
641         * Shared/CoordinatedGraphics/CoordinatedBackingStore.cpp:
642         (WebKit::CoordinatedBackingStoreTile::swapBuffers):
643         Reset the BitmapTexture if it doesn't match the opacity required by the surface
644         that's being painted.
645
646 2016-05-22  Carlos Garcia Campos  <cgarcia@igalia.com>
647
648         [GTK] Disk cache: enable speculative revalidation
649         https://bugs.webkit.org/show_bug.cgi?id=157125
650
651         Reviewed by Sergio Villar Senin.
652
653         * NetworkProcess/soup/NetworkProcessSoup.cpp:
654         (WebKit::NetworkProcess::platformInitializeNetworkProcess):
655         * UIProcess/API/gtk/WebKitWebContext.cpp:
656         (webkitWebContextConstructed):
657         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
658         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
659         * UIProcess/WebProcessPool.cpp:
660         (WebKit::WebProcessPool::ensureNetworkProcess):
661         * config.h:
662
663 2016-05-22  Brady Eidson  <beidson@apple.com>
664
665         Move to C++14.
666         https://bugs.webkit.org/show_bug.cgi?id=157948
667
668         Reviewed by Michael Catanzaro.
669
670         * Configurations/Base.xcconfig:
671
672         Replace time literal suffixes that have underscores to the forms without
673         (e.g. 0_ms becomes 0ms):
674         * NetworkProcess/NetworkResourceLoadParameters.cpp:
675         (WebKit::NetworkResourceLoadParameters::NetworkResourceLoadParameters):
676
677         * NetworkProcess/NetworkResourceLoader.cpp:
678         (WebKit::NetworkResourceLoader::startNetworkLoad):
679
680         * NetworkProcess/cache/NetworkCache.cpp:
681         (WebKit::NetworkCache::responseHasExpired):
682         (WebKit::NetworkCache::responseNeedsRevalidation):
683         (WebKit::NetworkCache::makeStoreDecision):
684
685         * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
686         (WebKit::NetworkCache::responseNeedsRevalidation):
687
688         * NetworkProcess/cache/NetworkCacheStorage.cpp:
689         (WebKit::NetworkCache::Storage::dispatchReadOperation):
690         (WebKit::NetworkCache::Storage::store):
691         (WebKit::NetworkCache::computeRecordWorth):
692
693         * Shared/mac/RemoteLayerBackingStoreCollection.mm:
694
695         * UIProcess/ViewGestureController.cpp:
696
697         * WebProcess/Network/WebLoaderStrategy.cpp:
698         (WebKit::maximumBufferingTime):
699
700         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
701         (WebKit::RemoteLayerTreeDrawingArea::scheduleCompositingLayerFlushImmediately):
702         (WebKit::RemoteLayerTreeDrawingArea::scheduleCompositingLayerFlush):
703
704 2016-05-21  Andy Estes  <aestes@apple.com>
705
706         REGRESSION (r188642): All pages are blank when printing a webpage in iOS Safari
707         https://bugs.webkit.org/show_bug.cgi?id=157924
708         rdar://problem/22524550
709
710         Reviewed by Sam Weinig.
711
712         When UIPrintInteractionController asks WKWebView to print a webpage, it does so in several phases. First we're
713         asked to compute the page count, followed later by a series of messages asking us to draw each page into a
714         provided CGContext.
715
716         When asked for the page count, we send a message to the Web process instructing it to compute and
717         return the page count synchronously and then immediately start drawing the page for printing. If the drawing has
718         finished by the time we're asked to print the first page, then we can do so without waiting. But if it hasn't
719         then we block by calling Connection::waitForMessage(), passing std::chromo::milliseconds::max() as the relative
720         timeout.
721         
722         Prior to r188642, Connection::waitForMessage() called std::condition_variable::wait_for(), which takes a
723         relative timeout value. r188642 replaced this with WTF::Condition::waitUntil(), which takes an absolute timeout
724         instead. To convert from relative to absolute, this line was added to Connection::waitForMessage():
725
726             Condition::Clock::time_point absoluteTimeout = Condition::Clock::now() + timeout;
727
728         std::chrono will convert both operands to a common duration type before performing the addition. When timeout
729         equals something very large, like milliseconds::max(), this conversion results in signed integer overflow,
730         giving absoluteTimeout a value less than Clock::now() and making waitForMessage time out immediately.
731         
732         To fix this, compute how many milliseconds remain on our clock, and add the smaller of that and the timeout
733         value to Clock::now() to arrive at an absolute timeout.
734
735         * Platform/IPC/Connection.cpp:
736         (IPC::Connection::waitForMessage):
737         * UIProcess/API/Cocoa/WKWebView.mm:
738         (-[WKWebView _printedDocument]): Removed an unnecessary nanoseconds-to-milliseconds conversion.
739
740 2016-05-20  Enrica Casucci  <enrica@apple.com>
741
742         Drag cannot start if no drag data or custom data is available in the Pasteboard.
743         https://bugs.webkit.org/show_bug.cgi?id=157911
744         rdar://problem/24577706
745
746         Reviewed by Tim Horton.
747
748         We need to make sure there is always one item in common between source and target
749         of the drag and drop operation.
750
751         * UIProcess/Cocoa/WebViewImpl.mm:
752         (WebKit::WebViewImpl::dragImageForView):
753
754 2016-05-20  John Wilander  <wilander@apple.com>
755
756         Remove unnecessary PageOverlay client function pageOverlayDestroyed
757         https://bugs.webkit.org/show_bug.cgi?id=157388
758         <rdar://problem/25471523>
759
760         Reviewed by Tim Horton.
761
762         Remove dead PageOverlay code. Almost all of these overrides were empty and
763         never called. In the case of WebPageOverlay it was never called but had a
764         function body, causing confusion. There was a fear of dangling pointers in
765         WebPageOverlay's static hash map between PageOverlays and WebPageOverlays.
766         Only WebPageOverlay's constructor creates its PageOverlay object and adds it
767         to the hash map. Its client object is kept in a unique pointer member which
768         is automatically deleted when the WebPageOverlay object itself is deleted.
769         This explains why PageOverlayClientImpl::pageOverlayDestroyed in
770         WKBundlePageOverlay can safely be removed. Finally, WebPageOverlay's
771         destructor clears the hash map entry for its PageOverlay object. Thus, there
772         is no need to call WebPageOverlay::pageOverlayDestroyed nor a need for
773         WebPageOverlay's destructor to call pageOverlayDestroyed on its client.
774
775         No new tests. I tried to come up with a WebKit API test for this but I
776         wasn't able to test presence/absence of WebPageOverlay's map entries since
777         the map is not exposed.
778
779         * WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.cpp:
780         (WebKit::PageOverlayClientImpl::pageOverlayDestroyed): Deleted.
781         * WebProcess/Plugins/PDF/PDFPlugin.h:
782         * WebProcess/Plugins/PDF/PDFPlugin.mm:
783         (WebKit::PDFPlugin::HUD::pageOverlayDestroyed): Deleted.
784         * WebProcess/WebCoreSupport/WebInspectorClient.cpp:
785         * WebProcess/WebCoreSupport/WebInspectorClient.h:
786         (WebKit::WebInspectorClient::pageOverlayDestroyed): Deleted.
787         * WebProcess/WebPage/FindController.cpp:
788         * WebProcess/WebPage/FindController.h:
789         (WebKit::FindController::pageOverlayDestroyed): Deleted.
790         * WebProcess/WebPage/WebPageOverlay.cpp:
791         * WebProcess/WebPage/WebPageOverlay.h:
792         (WebKit::WebPageOverlay::pageOverlayDestroyed): Deleted.
793         * WebProcess/WebPage/ios/FindIndicatorOverlayClientIOS.h:
794         (WebKit::FindIndicatorOverlayClientIOS::pageOverlayDestroyed): Deleted.
795
796 2016-05-19  Chris Dumez  <cdumez@apple.com>
797
798         Improve compile-time assertions in is<>() / downcast<>()
799         https://bugs.webkit.org/show_bug.cgi?id=157817
800
801         Reviewed by Darin Adler.
802
803         Add missing includes.
804
805         * WebProcess/WebPage/WebFrame.cpp:
806         * WebProcess/WebPage/WebPage.cpp:
807
808 2016-05-19  Tim Horton  <timothy_horton@apple.com>
809
810         Mail crashes under TiledCoreAnimationDrawingAreaProxy::createFenceForGeometryUpdate() when the Web process crashes
811         https://bugs.webkit.org/show_bug.cgi?id=157927
812         <rdar://problem/24793374>
813
814         Reviewed by Dean Jackson.
815
816         * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm:
817         (WebKit::TiledCoreAnimationDrawingAreaProxy::createFence):
818         With just the right combination of layout mechanisms and Web Content process
819         crash timing, it is possible to get a frame change underneath WebPageProxy::processDidCrash,
820         before the DrawingArea has been nulled out but after the Connection has.
821         This can lead to a null dereference. I had a lot of trouble writing a API
822         test for this, though I'm certain it's possible.
823
824 2016-05-16  Enrica Casucci  <enrica@apple.com>
825
826         No candidate punctuation when typing punctuation in WK2 text field.
827         https://bugs.webkit.org/show_bug.cgi?id=157773
828         rdar://problem/23084603
829
830         Reviewed by Sam Weinig.
831
832         We need to adopt the new addInputString:withFlags:withInputManagerHint function
833         for this to work propertly.
834
835         * Platform/spi/ios/UIKitSPI.h:
836         * UIProcess/ios/WKContentViewInteraction.mm:
837         (-[WKContentView _interpretKeyEvent:isCharEvent:]):
838
839 2016-05-19  Brady Eidson  <beidson@apple.com>
840
841         Finishing off: Modern IDB: Website data store management.
842         https://bugs.webkit.org/show_bug.cgi?id=157626
843
844         Reviewed by Alex Christensen.
845
846         * DatabaseProcess/DatabaseProcess.cpp:
847         (WebKit::DatabaseProcess::deleteWebsiteDataForOrigins):
848         (WebKit::removeAllDatabasesForOriginPath): Deleted.
849         (WebKit::DatabaseProcess::deleteIndexedDatabaseEntriesForOrigins): Deleted.
850         (WebKit::DatabaseProcess::deleteIndexedDatabaseEntriesModifiedSince): Deleted.
851         * DatabaseProcess/DatabaseProcess.h:
852
853 2016-05-19  Brent Fulgham  <bfulgham@apple.com>
854
855         [OS X][WK2] Expand sandbox for new mach endpoints
856         https://bugs.webkit.org/show_bug.cgi?id=157919
857         <rdar://problem/25238336>
858
859         Reviewed by Alexey Proskuryakov.
860
861         Grant the WebContent and Networking processes the mach lookup capability for
862         various Security-related mach endpoints..
863
864         * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb:
865         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
866
867 2016-05-19  Brian Burg  <bburg@apple.com>
868
869         Web Inspector: CRASH when closing a page while element selection mode is enabled via Develop menu
870         https://bugs.webkit.org/show_bug.cgi?id=157925
871         <rdar://problem/26259618>
872
873         Reviewed by Joseph Pecoraro.
874
875         * WebProcess/WebCoreSupport/WebInspectorClient.cpp:
876         (WebKit::WebInspectorClient::elementSelectionChanged):
877         Null-check m_page->inspector() since it will return nullptr if the page
878         is closed but not yet destructed. This is triggered by teardown code
879         in InspectorDOMAgent::willDestroyFrontendAndBackend.
880
881 2016-05-19  Enrica Casucci  <enrica@apple.com>
882
883         Drag cannot start if no drag data is available in the Pasteboard.
884         https://bugs.webkit.org/show_bug.cgi?id=157911
885         rdar://problem/24577706
886
887         Reviewed by Tim Horton.
888
889         Setting dummy data to allow drag to start.
890
891         * Shared/mac/PasteboardTypes.h:
892         * Shared/mac/PasteboardTypes.mm:
893         * UIProcess/Cocoa/WebViewImpl.mm:
894         (WebKit::WebViewImpl::registerDraggedTypes):
895         (WebKit::WebViewImpl::dragImageForView):
896
897 2016-05-19  Jer Noble  <jer.noble@apple.com>
898
899         [IOS] Add setting to allow playback to continue inline after exiting fullscreen.
900         https://bugs.webkit.org/show_bug.cgi?id=157912
901
902         Reviewed by Eric Carlson.
903
904         Add a preference and configuration property to control whether media should be allowed to continue
905         playing inline when exiting fullscreen.
906
907         * Shared/WebPreferencesDefinitions.h:
908         * UIProcess/API/Cocoa/WKWebView.mm:
909         (-[WKWebView _initializeWithConfiguration:]):
910         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
911         (-[WKWebViewConfiguration init]):
912         (-[WKWebViewConfiguration encodeWithCoder:]):
913         (-[WKWebViewConfiguration initWithCoder:]):
914         (-[WKWebViewConfiguration copyWithZone:]):
915         (-[WKWebViewConfiguration _allowsInlineMediaPlaybackAfterFullscreen]):
916         (-[WKWebViewConfiguration _setAllowsInlineMediaPlaybackAfterFullscreen:]):
917         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
918         * UIProcess/mac/WKFullScreenWindowController.mm:
919         (disableScreenUpdates):
920         (enableScreenUpdates):
921         (-[WKFullScreenWindowController enterFullScreen:]):
922         (-[WKFullScreenWindowController finishedEnterFullScreenAnimation:]):
923         (-[WKFullScreenWindowController exitFullScreen]):
924         (-[WKFullScreenWindowController beganExitFullScreenWithInitialFrame:finalFrame:]):
925         (-[WKFullScreenWindowController finishedExitFullScreenAnimation:]):
926         (-[WKFullScreenWindowController completeFinishExitFullScreenAnimationAfterRepaint]):
927         (-[WKFullScreenWindowController _startEnterFullScreenAnimationWithDuration:]):
928         (-[WKFullScreenWindowController _startExitFullScreenAnimationWithDuration:]):
929         * WebProcess/WebPage/WebPage.cpp:
930         (WebKit::WebPage::updatePreferences):
931
932 2016-05-19  Brian Burg  <bburg@apple.com>
933
934         Web Inspector: timelines should not update via requestAnimationFrame unless Web Inspector is visible
935         https://bugs.webkit.org/show_bug.cgi?id=157897
936         <rdar://problem/26330802>
937
938         Reviewed by Timothy Hatcher.
939
940         The UIProcess needs to notify the Inspector frontend when it is truly visible.
941         The frontend can't use document.visibilityState because it doesn't seem to work
942         if the inspector frontend's WKWebView is created but not attached to a window.
943
944         * UIProcess/WebInspectorProxy.cpp:
945         (WebKit::WebInspectorProxy::open):
946         (WebKit::WebInspectorProxy::didClose):
947         Send visibility updates to the inspector process when the inspector becomes
948         "visible" or "not visible". It becomes visible if it is attached to the
949         inspected page's window, or gets its own native window.
950
951         * WebProcess/WebPage/WebInspectorUI.cpp:
952         (WebKit::WebInspectorUI::frontendLoaded):
953         (WebKit::WebInspectorUI::setDockingUnavailable):
954         (WebKit::WebInspectorUI::setIsVisible):
955         Call InspectorFrontendAPI.updateVisibilityState to let the frontend know.
956
957         * WebProcess/WebPage/WebInspectorUI.h:
958         * WebProcess/WebPage/WebInspectorUI.messages.in:
959         Add new message.
960
961 2016-05-19  Brian Burg  <bburg@apple.com>
962
963         Web Inspector: use a consistent prefix for injected scripts
964         https://bugs.webkit.org/show_bug.cgi?id=157715
965         <rdar://problem/26287188>
966
967         Reviewed by Timothy Hatcher.
968
969         * CMakeLists.txt:
970         * DerivedSources.make:
971         * WebProcess/Automation/WebAutomationSessionProxy.js:
972
973 2016-05-18  Anders Carlsson  <andersca@apple.com>
974
975         Add WKPreferencesRef getter/setter pair to set RTL mode
976         https://bugs.webkit.org/show_bug.cgi?id=157873
977         rdar://problem/26329970
978
979         Reviewed by Tim Horton.
980
981         * UIProcess/API/C/WKPreferences.cpp:
982         (WKPreferencesSetUserInterfaceDirectionPolicy):
983         (WKPreferencesGetUserInterfaceDirectionPolicy):
984         * UIProcess/API/C/WKPreferencesRef.h:
985
986 2016-05-18  Alex Christensen  <achristensen@webkit.org>
987
988         Clean up CSS code
989         https://bugs.webkit.org/show_bug.cgi?id=157808
990
991         Reviewed by Chris Dumez.
992
993         * UIProcess/Cocoa/WebViewImpl.mm:
994
995 2016-05-18  Jer Noble  <jer.noble@apple.com>
996
997         Disable default user gesture requirement for audio playback on Mac
998         https://bugs.webkit.org/show_bug.cgi?id=157820
999
1000         Reviewed by Sam Weinig.
1001
1002         Disable the WebPreferences and matching WKWebViewConfiguration.mediaTypesRequiringUserActionForPlayback
1003         settings on Mac (and other non-iOS ports).
1004
1005         * Shared/WebPreferencesDefinitions.h:
1006         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
1007         (-[WKWebViewConfiguration init]):
1008
1009 2016-05-18  Alex Christensen  <achristensen@webkit.org>
1010
1011         Build fix when not using CredentialStorage with NetworkSession.
1012
1013         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
1014         (WebKit::NetworkSession::clearCredentials):
1015
1016 2016-05-18  Brady Eidson  <beidson@apple.com>
1017
1018         Fix null-deref crash sporadically seen after http://trac.webkit.org/changeset/201098
1019
1020         No review.
1021
1022         * DatabaseProcess/DatabaseProcess.cpp:
1023         (WebKit::DatabaseProcess::deleteWebsiteData): Don't access m_idbServer directly, as calling
1024           the idbServer() accessor is how you actually get your IDBServer created for you.
1025
1026 2016-05-18  Brian Burg  <bburg@apple.com>
1027
1028         Web Inspector: InspectorFrontendAPI.setTimelineProfilingEnabled should not implicitly show Timelines tab
1029         https://bugs.webkit.org/show_bug.cgi?id=157846
1030
1031         Reviewed by Timothy Hatcher.
1032
1033         Add a separate ShowTimelines message to WebInspector and WebInspectorUI. Have the
1034         start/stop profiling methods in public APIs explicitly call showTimelines() rather than
1035         relying on InspectorFrontendAPI to do it.
1036
1037         * UIProcess/API/C/WKInspector.cpp:
1038         (WKInspectorTogglePageProfiling):
1039         * UIProcess/WebInspectorProxy.cpp:
1040         (WebKit::WebInspectorProxy::showTimelines):
1041         * UIProcess/WebInspectorProxy.h:
1042         * WebProcess/InjectedBundle/API/c/WKBundleInspector.cpp:
1043         (WKBundleInspectorSetPageProfilingEnabled):
1044         * WebProcess/WebPage/WebInspector.cpp:
1045         (WebKit::WebInspector::showTimelines):
1046         * WebProcess/WebPage/WebInspector.h:
1047         * WebProcess/WebPage/WebInspector.messages.in:
1048         * WebProcess/WebPage/WebInspectorUI.cpp:
1049         (WebKit::WebInspectorUI::showTimelines):
1050         * WebProcess/WebPage/WebInspectorUI.h:
1051         * WebProcess/WebPage/WebInspectorUI.messages.in:
1052
1053 2016-05-18  Brady Eidson  <beidson@apple.com>
1054
1055         Modern IDB: Add support for server side closing of open database connections.
1056         https://bugs.webkit.org/show_bug.cgi?id=157843
1057
1058         Reviewed by Alex Christensen.
1059
1060         - Implement the required IDB delegate code.
1061         - Make DatabaseProcess::deleteWebsiteData call the right method in IDB server.
1062
1063         * DatabaseProcess/DatabaseProcess.cpp:
1064         (WebKit::DatabaseProcess::deleteWebsiteData):
1065
1066         * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.cpp:
1067         (WebKit::WebIDBConnectionToClient::didGetRecord):
1068         (WebKit::WebIDBConnectionToClient::didCloseFromServer):
1069         (WebKit::WebIDBConnectionToClient::confirmDidCloseFromServer):
1070         * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.h:
1071         * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.messages.in:
1072
1073         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
1074         (WebKit::WebIDBConnectionToServer::confirmDidCloseFromServer):
1075         (WebKit::WebIDBConnectionToServer::didStartTransaction):
1076         (WebKit::WebIDBConnectionToServer::didCloseFromServer):
1077         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h:
1078         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.messages.in:
1079
1080 2016-05-18  Brady Eidson  <beidson@apple.com>
1081
1082         Modern IDB: Make TestRunner.clearAllDatabases also delete IndexedDB databases (once doing so is supported).
1083         https://bugs.webkit.org/show_bug.cgi?id=157823
1084
1085         Reviewed by Alex Christensen.
1086
1087         * CMakeLists.txt:
1088         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
1089         (WKWebsiteDataStoreRemoveAllIndexedDatabases):
1090         * UIProcess/API/C/WKWebsiteDataStoreRef.h:
1091
1092 2016-05-18  Brian Burg  <bburg@apple.com>
1093
1094         REGRESSION(r200959): "Start Timeline Recording" menu item doesn't start recording
1095         https://bugs.webkit.org/show_bug.cgi?id=157821
1096         <rdar://problem/26335429>
1097
1098         Reviewed by Timothy Hatcher.
1099
1100         In r200959, WebInspectorProxy started sending start/stop profiling
1101         messages directly to the frontend process to avoid the inspected page
1102         process from implicitly showing the frontend. To compensate, the WebKit
1103         API layer was changed to call show() in togglePageProfiling().
1104
1105         Unfortunately, this fix was not quite right, because the ordering of
1106         the Show and StartPageProfiling messages is undefined. The latter has to bounce
1107         from UI to inspected to inspector processes, so the frontend may try
1108         to start profiling before the frontend is shown, causing it to be ignored.
1109
1110         This patch takes a different approach: just remove all implicit show()
1111         calls in the inspected page processes, and bounce both the Show and
1112         StartPageProfiling messages through the inspected page process to ensure
1113         they are handled in order by the frontend process.
1114
1115         * UIProcess/WebInspectorProxy.cpp:
1116         (WebKit::WebInspectorProxy::togglePageProfiling):
1117         Revert to sending to the inspected page process.
1118
1119         * WebProcess/InjectedBundle/API/c/WKBundleInspector.cpp:
1120         (WKBundleInspectorSetPageProfilingEnabled):
1121         Add a call to show() now that the implementation doesn't do it implicitly.
1122
1123         * WebProcess/WebPage/WebInspector.cpp:
1124         (WebKit::WebInspector::startPageProfiling):
1125         (WebKit::WebInspector::stopPageProfiling):
1126         Don't implicitly show the inspector. These methods are only called
1127         through the WKBundleInspector API and via IPC from WebInspectorProxy.
1128
1129 2016-05-17  Beth Dakin  <bdakin@apple.com>
1130
1131         Make handleAcceptedCandidate a public function
1132         https://bugs.webkit.org/show_bug.cgi?id=157763
1133         -and corresponding-
1134         rdar://problem/26206397
1135
1136         Reviewed by Tim Horton.
1137
1138         This patch makes handleAcceptedCandidate a public member of WebViewImpl 
1139         instead of a private member. 
1140         * UIProcess/Cocoa/WebViewImpl.h:
1141         (WebKit::WebViewImpl::createWeakPtr):
1142
1143 2016-05-17  Dean Jackson  <dino@apple.com>
1144
1145         Remove ES6_GENERATORS flag
1146         https://bugs.webkit.org/show_bug.cgi?id=157815
1147         <rdar://problem/26332894>
1148
1149         Reviewed by Geoffrey Garen.
1150
1151         This flag isn't needed. Generators are enabled everywhere and
1152         part of a stable specification.
1153
1154         * Configurations/FeatureDefines.xcconfig:
1155
1156 2016-05-17  Dean Jackson  <dino@apple.com>
1157
1158         Temporarily enable Experimental Features
1159         https://bugs.webkit.org/show_bug.cgi?id=157810
1160         <rdar://problem/26330804>
1161
1162         Reviewed by Anders Carlsson.
1163
1164         We currently don't have good UI for enabling these features,
1165         which would mean Safari Technology Preview users would
1166         never be able to turn them on… unless we enable them by
1167         default temporarily.
1168
1169         * Shared/WebPreferencesDefinitions.h:
1170
1171 2016-05-17  Filip Pizlo  <fpizlo@apple.com>
1172
1173         WTF should know about Language
1174         https://bugs.webkit.org/show_bug.cgi?id=157756
1175
1176         Reviewed by Geoffrey Garen and Alexey Proskuryakov.
1177
1178         Rewires a bunch of includes/imports.
1179
1180         * Shared/mac/RemoteLayerTreePropertyApplier.mm:
1181         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
1182         * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:
1183         * WebProcess/WebPage/mac/PlatformCAAnimationRemote.mm:
1184
1185 2016-05-17  Jer Noble  <jer.noble@apple.com>
1186
1187         Unreviewed GTK+ and EFL bulid fix; make the audio playback user gesture requirement
1188         Cocoa-only.
1189
1190         * Shared/WebPreferencesDefinitions.h:
1191
1192 2016-05-16  Anders Carlsson  <andersca@apple.com>
1193
1194         Add a WKA extension point for WKPreferences SPI
1195         https://bugs.webkit.org/show_bug.cgi?id=157762
1196         rdar://problem/24529203
1197
1198         Reviewed by Sam Weinig.
1199
1200         * UIProcess/API/Cocoa/WKPreferences.mm:
1201
1202 2016-05-16  David Kilzer  <ddkilzer@apple.com>
1203
1204         Action sheets don’t work in presented view controllers
1205         <https://webkit.org/b/157754>
1206         <rdar://problem/26304845>
1207
1208         Reviewed by Anders Carlsson.
1209
1210         * UIProcess/ios/WKActionSheet.mm:
1211         (-[WKActionSheet presentSheetFromRect:]):
1212         (-[WKActionSheet willRotate]):
1213         - Call SPI to get the presenting view controller, since it may
1214           not always be the root view controller.
1215
1216 2016-05-13  Enrica Casucci  <enrica@apple.com>
1217
1218         Text selection is basically impossible on plain text pages.
1219         https://bugs.webkit.org/show_bug.cgi?id=157681
1220         rdar://problem/26065660
1221
1222         Reviewed by Darin Adler.
1223
1224         When dealing with a plain text file, the rules for deciding whether
1225         a position is selectable should be different and we should never
1226         switch to block selection.
1227
1228         * WebProcess/WebPage/ios/WebPageIOS.mm:
1229         (WebKit::WebPage::shouldSwitchToBlockModeForHandle):
1230         (WebKit::rectIsTooBigForSelection): Added helper function.
1231         (WebKit::WebPage::selectTextWithGranularityAtPoint):
1232         (WebKit::WebPage::getPositionInformation):
1233
1234 2016-05-16  Chelsea Pugh  <cpugh@apple.com>
1235
1236         [iOS] Remove dispatch_after in -[WKFormInputSession setSuggestions:]
1237         https://bugs.webkit.org/show_bug.cgi?id=157745
1238
1239         Reviewed by Dan Bernstein.
1240
1241         * UIProcess/ios/WKContentViewInteraction.mm:
1242         (-[WKFormInputSession setSuggestions:]): Remove the dispatch_after since
1243         there is no longer a chance of keyboard suggestions replacing the
1244         suggestions set here.
1245
1246 2016-05-16  Brian Burg  <bburg@apple.com>
1247
1248         Crash simulating keystrokes at WebKit::WebAutomationSession::platformSimulateKeyStroke
1249         https://bugs.webkit.org/show_bug.cgi?id=157737
1250         <rdar://problem/26292946>
1251
1252         Reviewed by Timothy Hatcher.
1253
1254         * UIProcess/Cocoa/WebAutomationSessionCocoa.mm:
1255         (WebKit::WebAutomationSession::platformSimulateKeyStroke):
1256         AppKit expects characters passed to [NSEvent keyEventWithType:...]
1257         to be non-nil even if there are no characters. Initialize characters
1258         to the empty string @"". It will be overwritten if the keystroke should
1259         produce any unicode characters.
1260
1261 2016-05-16  Brian Burg  <bburg@apple.com>
1262
1263         Web Automation: Automation.inspectBrowsingContext should automatically start page profiling
1264         https://bugs.webkit.org/show_bug.cgi?id=157739
1265
1266         Reviewed by Timothy Hatcher.
1267
1268         * UIProcess/API/C/WKInspector.cpp:
1269         (WKInspectorTogglePageProfiling):
1270         Implicitly show the Web Inspector in the C API command to preserve existing behavior.
1271
1272         * UIProcess/Automation/WebAutomationSession.cpp:
1273         (WebKit::WebAutomationSession::inspectorFrontendLoaded):
1274         If the frontend loaded, it was either because the user opened Web Inspector (and
1275         turning on page profiling is harmless), or it was loaded but not shown by the
1276         inspectBrowsingContext command. For the latter, we want to start page profiling
1277         before processing any additional commands so subsequent execution is captured.
1278
1279         * UIProcess/WebInspectorProxy.cpp:
1280         (WebKit::WebInspectorProxy::togglePageProfiling):
1281         Send the start/stop profiling messages directly to the WebInspectorUI process instead of
1282         bouncing through the inspected page's process, which does an implicit show() we don't want.
1283
1284         * UIProcess/WebPageProxy.cpp:
1285         (WebKit::WebPageProxy::inspector): Make it const.
1286         * UIProcess/WebPageProxy.h:
1287
1288 2016-05-16  Conrad Shultz  <conrad_shultz@apple.com>
1289
1290         Fix some deprecation warnings.
1291
1292         * UIProcess/mac/WKPrintingView.mm:
1293         (-[WKPrintingView _drawPDFDocument:page:atPoint:]):
1294         * WebProcess/Plugins/PDF/DeprecatedPDFPlugin.mm:
1295         (WebKit::PDFPlugin::setActiveAnnotation):
1296         (WebKit::PDFPlugin::lookupTextAtLocation):
1297         * WebProcess/Plugins/PDF/PDFPluginChoiceAnnotation.h:
1298         * WebProcess/Plugins/PDF/PDFPluginChoiceAnnotation.mm:
1299         (WebKit::PDFPluginChoiceAnnotation::createAnnotationElement):
1300         * WebProcess/Plugins/PDF/PDFPluginTextAnnotation.h:
1301         * WebProcess/Plugins/PDF/PDFPluginTextAnnotation.mm:
1302         (WebKit::PDFPluginTextAnnotation::createAnnotationElement):
1303         * WebProcess/WebPage/mac/WebPageMac.mm:
1304         (WebKit::drawPDFPage):
1305
1306 2016-04-06  Jer Noble  <jer.noble@apple.com>
1307
1308         [WK2] Add API to WKWebViewConfiguration to control autoplay policy.
1309         https://bugs.webkit.org/show_bug.cgi?id=156312
1310
1311         Reviewed by Dan Bernstein.
1312
1313         Add a new API to WKWebViewConfiguration to allow fine-grained control over when media is allowed
1314         to play without a user gesture, and simultaneously deprecate the existing, all-or-nothing API,
1315         and deprecated the equivalent SPIs.
1316
1317         * UIProcess/API/Cocoa/WKWebView.mm:
1318         (-[WKWebView _initializeWithConfiguration:]):
1319         * UIProcess/API/Cocoa/WKWebViewConfiguration.h:
1320         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
1321         (-[WKWebViewConfiguration init]):
1322         (-[WKWebViewConfiguration encodeWithCoder:]):
1323         (-[WKWebViewConfiguration initWithCoder:]):
1324         (-[WKWebViewConfiguration copyWithZone:]):
1325         (-[WKWebViewConfiguration _requiresUserActionForVideoPlayback]):
1326         (-[WKWebViewConfiguration _setRequiresUserActionForVideoPlayback:]):
1327         (-[WKWebViewConfiguration _requiresUserActionForAudioPlayback]):
1328         (-[WKWebViewConfiguration _setRequiresUserActionForAudioPlayback:]):
1329         (-[WKWebViewConfiguration requiresUserActionForMediaPlayback]):
1330         (-[WKWebViewConfiguration setRequiresUserActionForMediaPlayback:]):
1331         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
1332
1333 2016-05-16  Brian Burg  <bburg@apple.com>
1334
1335         Web Automation: WebAutomationSessionProxy.js gets injected more than once sometimes
1336         https://bugs.webkit.org/show_bug.cgi?id=157716
1337         <rdar://problem/26287306>
1338
1339         Reviewed by Timothy Hatcher.
1340
1341         Whenever a script was injected into a non-normal world by a WebKit client,
1342         the WebProcess's WebAutomationSessionProxy singleton would get a
1343         notification that the window was cleared from the relevant frame.
1344         This notification happens when creating the world's window shell for
1345         the first time.
1346
1347         This code should ignore such notifications that originate from non-main world
1348         contexts. Web Inspector's instrumentation already ignored this, but
1349         the automation session notification comes in via a different WebKit2 layer.
1350
1351         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1352         (WebKit::WebFrameLoaderClient::dispatchDidClearWindowObjectInWorld):
1353
1354 2016-05-13  Dean Jackson  <dino@apple.com>
1355
1356         Fix iOS Build.
1357
1358         * Shared/AssistedNodeInformation.h:
1359         (WebKit::OptionItem::OptionItem):
1360
1361 2016-05-13  Sam Weinig  <sam@webkit.org>
1362
1363         REGRESSION (r200463): Autofill Credit Card expected but got Autofill Contact
1364         <rdar://problem/26251538>
1365         https://bugs.webkit.org/show_bug.cgi?id=157701
1366
1367         Reviewed by Dan Bernstein.
1368
1369         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFrame.mm:
1370         (-[WKWebProcessPlugInFrame _certificateChain]):
1371         We need to do a retain-autorelease here now because the CertificateInfo's that contain the
1372         cached certificate chain, are being destroyed, and therefore destroying the chain, before this
1373         function returns. This used to work when the chain wasn't just a cache, because there was still
1374         a strong reference to it being held by the ResourceResponse's CertificateInfo copy, but now
1375         there is none.
1376
1377 2016-05-13  Dean Jackson  <dino@apple.com>
1378
1379         [iOS] <select> elements popover should render right-aligned when in RTL mode
1380         https://bugs.webkit.org/show_bug.cgi?id=157699
1381         <rdar://problem/26282319>
1382
1383         Reviewed by Simon Fraser.
1384
1385         Some follow-up changes as suggested by Darin in review.
1386
1387         * Shared/AssistedNodeInformation.h: Use initializers so we can
1388         remove the constructors.
1389         (WebKit::OptionItem::OptionItem): Deleted.
1390         (WebKit::AssistedNodeInformation::AssistedNodeInformation): Deleted.
1391         * UIProcess/ios/forms/WKFormSelectPopover.mm: Add a comment to explain
1392         why we are explicitly setting the language.
1393         (-[WKSelectTableViewController initWithView:hasGroups:]):
1394
1395 2016-05-13  Chris Dumez  <cdumez@apple.com>
1396
1397         [NetworkCache] Avoid having to re-parse URLs after deserializing them
1398         https://bugs.webkit.org/show_bug.cgi?id=157660
1399
1400         Reviewed by Darin Adler.
1401
1402         * NetworkProcess/cache/NetworkCacheCoders.cpp:
1403         (WebKit::NetworkCache::Coder<WebCore::CertificateInfo>::encode): Deleted.
1404         (WebKit::NetworkCache::Coder<WebCore::CertificateInfo>::decode): Deleted.
1405         * NetworkProcess/cache/NetworkCacheCoders.h:
1406         Drop template specializations used by our network cache for encoding
1407         / decoding URLs as Strings. This causes us to now rely on
1408         URL::encode() / URL::decode() instead.
1409
1410         * Shared/WebCoreArgumentCoders.cpp:
1411         (IPC::ArgumentCoder<BlobPart>::decode):
1412         Fix bug in BlobPart encoding / decoding. It was encoding the url member
1413         as a URL but decoding it as a String.
1414
1415 2016-05-13  Dan Bernstein  <mitz@apple.com>
1416
1417         Try to fix some non-iOS builds.
1418
1419         * mac/postprocess-framework-headers.sh:
1420
1421 2016-05-13  Ryan Haddad  <ryanhaddad@apple.com>
1422
1423         Attempt to fix the iOS build after r200874
1424
1425         Unreviewed build fix.
1426
1427         * UIProcess/API/Cocoa/WKWebViewConfiguration.h:
1428
1429 2016-05-13  Sam Weinig  <sam@webkit.org>
1430
1431         Rename WKDataDetectorTypeSpotlightSuggestion to WKDataDetectorTypeLookupSuggestion
1432         <rdar://problem/26269611>
1433
1434         Reviewed by Dan Bernstein and Enrica Casucci. 
1435
1436         * Shared/API/Cocoa/WKFoundation.h:
1437         * Shared/API/c/WKDeclarationSpecifiers.h:
1438         * UIProcess/API/Cocoa/WKWebView.mm:
1439         (fromWKDataDetectorTypes):
1440         * UIProcess/API/Cocoa/WKWebViewConfiguration.h:
1441         * mac/postprocess-framework-headers.sh:
1442
1443 2016-05-13  Beth Dakin  <bdakin@apple.com>
1444
1445         Add dyldSPI.h for linked on or after checks, and add one for link preview
1446         https://bugs.webkit.org/show_bug.cgi?id=157401
1447
1448         Reviewed by Darin Adler.
1449
1450         Set _allowsLinkPreview to YES for programs linked on or after 
1451         firstSDKVersionWithLinkPreviewEnabledByDefault.
1452         * UIProcess/API/Cocoa/WKWebView.h:
1453         * UIProcess/API/Cocoa/WKWebView.mm:
1454         (-[WKWebView _initializeWithConfiguration:]):
1455
1456 2016-05-13  Jer Noble  <jer.noble@apple.com>
1457
1458         Fullscreen view attempts to resize when in 2-up mode
1459         https://bugs.webkit.org/show_bug.cgi?id=157558
1460
1461         Reviewed by Darin Adler.
1462
1463         No need to react to NSApplicationDidChangeScreenParametersNotification to resize the
1464         fullscreen window when the screen parameters change; the NSWindow fullscreen machinery
1465         will do that on our behalf.
1466
1467         * UIProcess/mac/WKFullScreenWindowController.mm:
1468         (-[WKFullScreenWindowController windowDidLoad]): Deleted.
1469         (-[WKFullScreenWindowController applicationDidChangeScreenParameters:]): Deleted.
1470
1471 2016-05-13  Antoine Quint  <graouts@apple.com>
1472
1473         [iOS] <select> elements popover should render right-aligned when in RTL mode
1474         https://bugs.webkit.org/show_bug.cgi?id=157672
1475         <rdar://problem/26193442>
1476
1477         Reviewed by Darin Adler.
1478
1479         Add a new isRTL field to the AssistedNodeInformation as specified by the assisted
1480         node's render style and account for it when displaying the table view shown in the
1481         popover attached to the assisted node using the UIView semanticContentAttribute
1482         property.
1483
1484         * Shared/AssistedNodeInformation.cpp:
1485         (WebKit::AssistedNodeInformation::encode):
1486         (WebKit::AssistedNodeInformation::decode):
1487         * Shared/AssistedNodeInformation.h:
1488         (WebKit::AssistedNodeInformation::AssistedNodeInformation):
1489         * UIProcess/ios/forms/WKFormSelectPopover.mm:
1490         (-[WKSelectTableViewController initWithView:hasGroups:]):
1491         (-[WKSelectTableViewController tableView:cellForRowAtIndexPath:]):
1492         * WebProcess/WebPage/ios/WebPageIOS.mm:
1493         (WebKit::WebPage::getAssistedNodeInformation):
1494
1495 2016-05-13  Tina Liu  <iting_liu@apple.com>
1496
1497         Revert r199691.
1498         https://bugs.webkit.org/show_bug.cgi?id=157645
1499         <rdar://problem/26235373>
1500
1501         Reviewed by Darin Adler.
1502
1503         * Shared/WebProcessCreationParameters.cpp:
1504         (WebKit::WebProcessCreationParameters::encode): Deleted.
1505         (WebKit::WebProcessCreationParameters::decode): Deleted.
1506         * Shared/WebProcessCreationParameters.h:
1507         * UIProcess/API/C/mac/WKContextPrivateMac.h:
1508         * UIProcess/API/C/mac/WKContextPrivateMac.mm:
1509         (WKContextSetPrivateBrowsingPluginLoadClientPolicy): Deleted.
1510         * UIProcess/WebProcessPool.cpp:
1511         (WebKit::WebProcessPool::setPluginLoadClientPolicy):
1512         (WebKit::WebProcessPool::createNewWebProcess): Deleted.
1513         (WebKit::WebProcessPool::setPluginLoadClientPolicyForPrivateBrowsing): Deleted.
1514         (WebKit::WebProcessPool::setPrivateBrowsingPluginLoadClientPolicy): Deleted.
1515         (WebKit::WebProcessPool::clearPluginClientPolicies): Deleted.
1516         * UIProcess/WebProcessPool.h:
1517         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
1518         (WebKit::WebPlatformStrategies::setPluginLoadClientPolicy):
1519         (WebKit::WebPlatformStrategies::longestMatchedWildcardHostForHost):
1520         (WebKit::WebPlatformStrategies::replaceHostWithMatchedWildcardHost):
1521         (WebKit::WebPlatformStrategies::pluginLoadClientPolicyForHost):
1522         (WebKit::WebPlatformStrategies::populatePluginCache):
1523         (WebKit::WebPlatformStrategies::setPluginLoadClientPolicyForPrivateBrowsing): Deleted.
1524         (WebKit::WebPlatformStrategies::setPrivateBrowsingPluginLoadClientPolicy): Deleted.
1525         (WebKit::WebPlatformStrategies::clearPluginClientPolicies): Deleted.
1526         (WebKit::WebPlatformStrategies::pluginLoadClientPolicyForHostForPrivateBrowsing): Deleted.
1527         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
1528         * WebProcess/WebProcess.cpp:
1529         (WebKit::WebProcess::initializeWebProcess):
1530         (WebKit::WebProcess::setPluginLoadClientPolicies): Deleted.
1531         (WebKit::WebProcess::setPrivateBrowsingPluginLoadClientPolicy): Deleted.
1532         * WebProcess/WebProcess.h:
1533         * WebProcess/WebProcess.messages.in:
1534
1535 2016-05-12  Daniel Bates  <dabates@apple.com>
1536
1537         Use SecTask SPI to retrieve code signing identifier for user directory suffix
1538         https://bugs.webkit.org/show_bug.cgi?id=157570
1539         <rdar://problem/25706517>
1540
1541         Reviewed by Darin Adler.
1542
1543         It is sufficient to make use of the SecTask SPI to retrieve the code signing
1544         identifier of the embedding client for use in the user directory suffix. This
1545         avoids the need to allow Code Signing Services to have access to the bundle
1546         of the embedding client.
1547
1548         * Shared/mac/ChildProcessMac.mm:
1549         (WebKit::ChildProcess::initializeSandbox): Use the code signing identifier of the
1550         embedding client as part of the user directory suffix if available.
1551         * Shared/mac/CodeSigning.h: Update comment and include header wtf/spi/darwin/XPCSPI.h
1552         for the definition of xpc_connection_t. Renamed codeSigningIdentifier() to codeSigningIdentifierForCurrentProcess()
1553         to convey that it returns the code signing identifier for the current process. Repurposed
1554         the name codeSigningIdentifier for the variant of this function that takes a xpc_connection_t.
1555         * Shared/mac/CodeSigning.mm:
1556         (WebKit::codeSigningIdentifier): Added. Uses the audit token associated with the specified
1557         XPC connection to get the code signing identifier for the embedding client.
1558         (WebKit::codeSigningIdentifierForCurrentProcess): Renamed; formerly named codeSigningIdentifier.
1559         Implemented in terms of the SecTask API.
1560         (WebKit::secCodeForCurrentProcess): Deleted.
1561         (WebKit::secCodeForProcess): Deleted.
1562         (WebKit::secCodeSigningInformation): Deleted.
1563         (WebKit::appleSignedOrMacAppStoreSignedOrAppleDeveloperSignedRequirement): Deleted.
1564         (WebKit::secCodeSigningIdentifier): Deleted.
1565         (WebKit::codeSigningIdentifierForProcess): Deleted.
1566         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
1567         (WebKit::connectToService): Update code due to renaming.
1568
1569 2016-05-12  Konstantin Tokarev  <annulen@yandex.ru>
1570
1571         Use reference instead of pointer in FrameLoaderClient::saveViewStateToItem.
1572         https://bugs.webkit.org/show_bug.cgi?id=157624
1573
1574         Reviewed by Darin Adler.
1575
1576         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1577         (WebKit::WebFrameLoaderClient::saveViewStateToItem):
1578         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
1579
1580 2016-05-12  Csaba Osztrogonác  <ossy@webkit.org>
1581
1582         Remove ENABLE(ES6_ARROWFUNCTION_SYNTAX) guards
1583         https://bugs.webkit.org/show_bug.cgi?id=157564
1584
1585         Reviewed by Darin Adler.
1586
1587         * Configurations/FeatureDefines.xcconfig:
1588
1589 2016-05-11  Anders Carlsson  <andersca@apple.com>
1590
1591         We have two different types of contextual menus in iBooks
1592         https://bugs.webkit.org/show_bug.cgi?id=157587
1593         rdar://problem/25904169
1594
1595         Reviewed by Darin Adler.
1596
1597         Give clients the option to bypass the WebKit context menu machinery.
1598
1599         * UIProcess/mac/WebContextMenuProxyMac.mm:
1600         (WebKit::WebContextMenuProxyMac::showContextMenu):
1601
1602 2016-05-10  Brian Burg  <bburg@apple.com>
1603
1604         Web Automation: add command to asynchronously load the Web Inspector frontend in the background
1605         https://bugs.webkit.org/show_bug.cgi?id=157509
1606
1607         Reviewed by Timothy Hatcher and Joseph Pecoraro.
1608
1609         In order to make it easier to debug code that executes as a result of an automation
1610         command, this patch adds a new Automation command to asynchronously load the debugger
1611         and Inspector frontend. It is designed for use by automation clients to implement an
1612         auto-inspection feature to aid in debugging automation scripts.
1613
1614         * UIProcess/Automation/Automation.json: Add new command.
1615         * UIProcess/Automation/WebAutomationSession.cpp:
1616         (WebKit::WebAutomationSession::inspectBrowsingContext): Added.
1617         (WebKit::WebAutomationSession::inspectorFrontendLoaded): Added.
1618         This message is forwarded by WebInspectorProxy to the inspected page's session.
1619
1620         * UIProcess/Automation/WebAutomationSession.h:
1621         * UIProcess/Cocoa/WebAutomationSessionCocoa.mm:
1622         (WebKit::WebAutomationSession::sendSynthesizedEventsToPage):
1623         Force the active automation window to become key and bring to front prior to
1624         sending each NSEvent. This way, if the Inspector pauses while a command executes,
1625         the automation window will get back focus when the Inspector unpauses just before
1626         the next synthesized mouse or keyboard NSEvent is sent to its NSWindow.
1627
1628         * UIProcess/WebInspectorProxy.cpp:
1629         (WebKit::WebInspectorProxy::frontendLoaded):
1630         Forward to the inspected page's session.
1631
1632         * UIProcess/WebInspectorProxy.h:
1633         * UIProcess/WebInspectorProxy.messages.in: Add notification of the frontend's load.
1634
1635         * WebProcess/WebPage/WebInspectorUI.cpp:
1636         (WebKit::WebInspectorUI::frontendLoaded):
1637         Kick off notifying the automation session in UIProcess that the inspector loaded.
1638
1639         (WebKit::WebInspectorUI::closeWindow):
1640         In some circumstances, the Web Inspector can be loaded without showing
1641         the window. If this hidden page closes, make sure the frontend host gets
1642         a chance to disconnect its InspectorFrontendClient. Normally this happens
1643         when the window closes, but unshown Inspectors do not get window instances.
1644
1645 2016-05-11  Chris Dumez  <cdumez@apple.com>
1646
1647         Update Node::appendChild() / replaceChild() / removeChild() / insertBefore() to take references instead of pointers
1648         https://bugs.webkit.org/show_bug.cgi?id=157556
1649
1650         Reviewed by Darin Adler.
1651
1652         * WebProcess/InjectedBundle/API/mac/WKDOMNode.mm:
1653         (-[WKDOMNode insertNode:before:]):
1654         (-[WKDOMNode appendChild:]):
1655         (-[WKDOMNode removeChild:]):
1656         * WebProcess/Plugins/PDF/DeprecatedPDFPlugin.mm:
1657         (WebKit::PDFPlugin::PDFPlugin):
1658         * WebProcess/Plugins/PDF/PDFPluginChoiceAnnotation.mm:
1659         (WebKit::PDFPluginChoiceAnnotation::createAnnotationElement):
1660
1661 2016-05-11  Brady Eidson  <beidson@apple.com>
1662
1663         Modern IDB: IDBOpenDBRequests that are stop()'ed don't notify the IDBServer of that fact.
1664         https://bugs.webkit.org/show_bug.cgi?id=157448
1665
1666         Reviewed by Alex Christensen.
1667
1668         * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.cpp:
1669         (WebKit::WebIDBConnectionToClient::didFinishHandlingVersionChangeTransaction):
1670         (WebKit::WebIDBConnectionToClient::openDBRequestCancelled):
1671         * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.h:
1672         * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.messages.in:
1673
1674         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
1675         (WebKit::WebIDBConnectionToServer::didFinishHandlingVersionChangeTransaction):
1676         (WebKit::WebIDBConnectionToServer::openDBRequestCancelled):
1677         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h:
1678
1679 2016-05-11  Myles C. Maxfield  <mmaxfield@apple.com>
1680
1681         Fix a typo in r200330
1682
1683         Unreviewed.
1684
1685         * UIProcess/API/Cocoa/WKWebViewConfiguration.h:
1686
1687 2016-05-10  Sam Weinig  <sam@webkit.org>
1688
1689         Only expose WKDataDetectorTypes and -[WKWebViewConfiguration dataDetectorTypes] on iOS
1690         for now, since we don't have it fully implemented on Mac.
1691
1692         Reviewed by Tim Horton.
1693
1694         * UIProcess/API/Cocoa/WKWebView.mm:
1695         (fromWKDataDetectorTypes):
1696         (-[WKWebView _initializeWithConfiguration:]):
1697         * UIProcess/API/Cocoa/WKWebViewConfiguration.h:
1698         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
1699         (-[WKWebViewConfiguration encodeWithCoder:]):
1700         (-[WKWebViewConfiguration initWithCoder:]):
1701         (-[WKWebViewConfiguration copyWithZone:]):
1702
1703 2016-05-10  Sam Weinig  <sam@webkit.org>
1704
1705         Add SPI for Data Detectors to get ranges of text around an existing range.
1706         <rdar://problem/26009749>
1707
1708         Reviewed by Enrica Casucci.
1709
1710         * WebProcess/InjectedBundle/API/mac/WKDOMRange.h:
1711         * WebProcess/InjectedBundle/API/mac/WKDOMRange.mm:
1712         (-[WKDOMRange rangeByExpandingToWordBoundaryByCharacters:inDirection:]):
1713
1714 2016-05-10  Enrica Casucci  <enrica@apple.com>
1715
1716         Numerous block selection issues on iOS.
1717         https://bugs.webkit.org/show_bug.cgi?id=157490
1718         rdar://problem/25717977
1719         rdar://problem/23042215
1720
1721         Reviewed by Tim Horton.
1722
1723         This patch fixes a number of issues with block selection on iOS.
1724         We no longer eagerly choose block selection vs text selection and we
1725         make sure we are capable of switching back to text selection from block
1726         under every circumstance. The patch also fixes the logic used to decide
1727         when to switch to block selection. It now computes the rectangle for the
1728         paragraph containing the initial text selection to decide when we are
1729         actually dragging outside the boundaries of the paragraph block.
1730
1731         * UIProcess/WebPageProxy.h:
1732         * UIProcess/WebPageProxy.messages.in:
1733         * UIProcess/ios/WKContentViewInteraction.mm:
1734         (selectionChangedWithGesture):
1735         (selectionChangedWithTouch):
1736         (-[WKContentView changeSelectionWithTouchAt:withSelectionTouch:baseIsStart:]):
1737         * UIProcess/ios/WebPageProxyIOS.mm:
1738         (WebKit::WebPageProxy::gestureCallback):
1739         (WebKit::WebPageProxy::touchesCallback):
1740         (WebKit::WebPageProxy::autocorrectionDataCallback):
1741         (WebKit::WebPageProxy::selectWithGesture):
1742         (WebKit::WebPageProxy::updateSelectionWithTouches):
1743         * WebProcess/WebPage/WebPage.h:
1744         * WebProcess/WebPage/ios/WebPageIOS.mm:
1745         (WebKit::selectionBoxForRange):
1746         (WebKit::canShrinkToTextSelection):
1747         (WebKit::hasCustomLineHeight):
1748         (WebKit::WebPage::rangeForWebSelectionAtPosition):
1749         (WebKit::WebPage::contractedRangeFromHandle):
1750         (WebKit::WebPage::updateBlockSelectionWithTouch):
1751         (WebKit::WebPage::clearSelection):
1752         (WebKit::WebPage::switchToBlockSelectionAtPoint):
1753         (WebKit::WebPage::shouldSwitchToBlockModeForHandle):
1754         (WebKit::WebPage::updateSelectionWithTouches):
1755         (WebKit::WebPage::selectWithTwoTouches):
1756
1757 2016-05-10  Alex Christensen  <achristensen@webkit.org>
1758
1759         Handle _schemeUpgraded delegate callbacks in NSURLSessionDataDelegate
1760         https://bugs.webkit.org/show_bug.cgi?id=157354
1761         rdar://problem/25842107
1762
1763         Reviewed by Darin Adler.
1764
1765         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
1766         (-[WKNetworkSessionDelegate URLSession:task:_schemeUpgraded:completionHandler:]):
1767         When we make a request to a http url and CFNetwork determines that that url would have redirected to an HSTS site
1768         and it is going to change the request to an https request, this delegate callback is called.  We need to call the
1769         redirection code to have the same behavior as the NSURLConnection-based loader.
1770
1771 2016-05-10  Csaba Osztrogonác  <ossy@webkit.org>
1772
1773         Fix the !ENABLE(VIDEO) build
1774         https://bugs.webkit.org/show_bug.cgi?id=157518
1775
1776         Reviewed by Alex Christensen.
1777
1778         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1779         (WebKit::WebsiteDataStore::fetchData):
1780         (WebKit::WebsiteDataStore::removeData):
1781         * WebProcess/WebProcess.cpp:
1782         (WebKit::WebProcess::initializeWebProcess):
1783
1784 2016-05-10  Anders Carlsson  <andersca@apple.com>
1785
1786         Fix more deprecation warnings.
1787
1788         * NetworkProcess/EntryPoint/mac/XPCService/NetworkServiceEntryPoint.mm:
1789         (NetworkServiceInitializer):
1790         * PluginProcess/EntryPoint/mac/XPCService/PluginServiceEntryPoint.mm:
1791         (PluginServiceInitializer):
1792         * WebProcess/EntryPoint/mac/XPCService/WebContentServiceEntryPoint.mm:
1793         (WebContentServiceInitializer):
1794
1795 2016-05-10  Chris Dumez  <cdumez@apple.com>
1796
1797         [SpeculativeValidation] Do not start a preload if there is already one pending
1798         https://bugs.webkit.org/show_bug.cgi?id=157522
1799         <rdar://problem/26156083>
1800
1801         Reviewed by Alex Christensen.
1802
1803         Do not start a preload if there is already one pending. We failed to check in
1804         SpeculativeLoadManager::preloadEntry() if there was already a pending preload.
1805         As a result, we would sometimes cancel an already pending preload and start
1806         one from scratch which is inefficient. It would also sometimes lead to hitting
1807         an assertion in the SpeculativeLoad destructor because we could destroy the
1808         SpeculativeLoad without finishing or cancelling the load.
1809
1810         * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
1811         (WebKit::NetworkCache::SpeculativeLoadManager::preloadEntry):
1812
1813 2016-05-10  Anders Carlsson  <andersca@apple.com>
1814
1815         Fix a deprecation warning.
1816
1817         * DatabaseProcess/EntryPoint/mac/XPCService/DatabaseServiceEntryPoint.mm:
1818         (DatabaseServiceInitializer):
1819
1820 2016-05-10  Tim Horton  <timothy_horton@apple.com>
1821
1822         Clicks do not work in Safari after pressing the Track package button in Gmail
1823         https://bugs.webkit.org/show_bug.cgi?id=157508
1824         <rdar://problem/22646404>
1825
1826         Reviewed by Anders Carlsson.
1827
1828         * UIProcess/Cocoa/WebViewImpl.mm:
1829         (WebKit::WebViewImpl::viewDidMoveToWindow):
1830         Explicitly cancel the force-click animation when we're removing the gesture
1831         recognizer due to the WK*View being unparented. This works around a bug
1832         where we don't get the cancellation callback in this situation, causing
1833         Safari to be left in an inconsistent and unexpected state.
1834
1835 2016-05-10  Michael Catanzaro  <mcatanzaro@igalia.com>
1836
1837         [Linux] Remove seccomp filters support
1838         https://bugs.webkit.org/show_bug.cgi?id=157380
1839
1840         Reviewed by Darin Adler.
1841
1842         * NetworkProcess/NetworkProcessCreationParameters.cpp:
1843         (WebKit::NetworkProcessCreationParameters::encode): Deleted.
1844         (WebKit::NetworkProcessCreationParameters::decode): Deleted.
1845         * NetworkProcess/NetworkProcessCreationParameters.h:
1846         * PlatformEfl.cmake:
1847         * PlatformGTK.cmake:
1848         * Shared/WebProcessCreationParameters.cpp:
1849         (WebKit::WebProcessCreationParameters::encode): Deleted.
1850         (WebKit::WebProcessCreationParameters::decode): Deleted.
1851         * Shared/WebProcessCreationParameters.h:
1852         * Shared/linux/SeccompFilters/OpenSyscall.cpp: Removed.
1853         * Shared/linux/SeccompFilters/OpenSyscall.h: Removed.
1854         * Shared/linux/SeccompFilters/SeccompBroker.cpp: Removed.
1855         * Shared/linux/SeccompFilters/SeccompBroker.h: Removed.
1856         * Shared/linux/SeccompFilters/SeccompFilters.cpp: Removed.
1857         * Shared/linux/SeccompFilters/SeccompFilters.h: Removed.
1858         * Shared/linux/SeccompFilters/SigactionSyscall.cpp: Removed.
1859         * Shared/linux/SeccompFilters/SigactionSyscall.h: Removed.
1860         * Shared/linux/SeccompFilters/SigprocmaskSyscall.cpp: Removed.
1861         * Shared/linux/SeccompFilters/SigprocmaskSyscall.h: Removed.
1862         * Shared/linux/SeccompFilters/Syscall.cpp: Removed.
1863         * Shared/linux/SeccompFilters/Syscall.h: Removed.
1864         * Shared/linux/SeccompFilters/SyscallPolicy.cpp: Removed.
1865         * Shared/linux/SeccompFilters/SyscallPolicy.h: Removed.
1866         * Shared/linux/SeccompFilters/XDGBaseDirectory.h: Removed.
1867         * Shared/linux/SeccompFilters/XDGBaseDirectoryGLib.cpp: Removed.
1868         * UIProcess/WebProcessPool.cpp:
1869         (WebKit::WebProcessPool::ensureNetworkProcess): Deleted.
1870         (WebKit::WebProcessPool::createNewWebProcess): Deleted.
1871         (WebKit::WebProcessPool::cookieStorageDirectory): Deleted.
1872         * UIProcess/WebProcessPool.h:
1873         * WebProcess/efl/SeccompFiltersWebProcessEfl.cpp: Removed.
1874         * WebProcess/efl/SeccompFiltersWebProcessEfl.h: Removed.
1875         * WebProcess/gtk/SeccompFiltersWebProcessGtk.cpp: Removed.
1876         * WebProcess/gtk/SeccompFiltersWebProcessGtk.h: Removed.
1877         * WebProcess/soup/WebProcessSoup.cpp:
1878         (WebKit::WebProcess::platformInitializeWebProcess): Deleted.
1879
1880 2016-05-09  Tim Horton  <timothy_horton@apple.com>
1881
1882         REGRESSION (r191922): Zoom in/Zoom Out is not working for PDFs
1883         https://bugs.webkit.org/show_bug.cgi?id=157503
1884         <rdar://problem/23736297>
1885
1886         Reviewed by Anders Carlsson.
1887
1888         * WebProcess/Plugins/PDF/DeprecatedPDFPlugin.h:
1889         Restore a requiresUnifiedScaleFactor that was lost in r191922.
1890
1891         * UIProcess/WebPageProxy.cpp:
1892         (WebKit::WebPageProxy::didCommitLoadForFrame):
1893         (WebKit::WebPageProxy::mainFramePluginHandlesPageScaleGestureDidChange):
1894         * UIProcess/WebPageProxy.h:
1895         * UIProcess/WebPageProxy.messages.in:        
1896         * WebProcess/Plugins/PluginView.cpp:
1897         (WebKit::PluginView::didInitializePlugin):
1898         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1899         (WebKit::WebFrameLoaderClient::dispatchDidCommitLoad):
1900         Separate mainFramePluginHandlesPageScaleGesture changes out from didCommitLoadForFrame,
1901         because the PluginView doesn't exist at this point, so it can't answer
1902         the handlesPageScaleGesture question correctly (or at all).
1903         Instead, we'll send the message when the main-frame PluginView is initialized.
1904
1905 2016-05-09  Simon Fraser  <simon.fraser@apple.com>
1906
1907         [iOS] visibility:hidden -webkit-overflow-scrolling: touch divs can interfere with page scrolling
1908         https://bugs.webkit.org/show_bug.cgi?id=157496
1909         rdar://problem/22963278
1910
1911         Reviewed by Tim Horton.
1912
1913         UIScrollViews are constructed in the UI process for visibility:hidden scrollable elements
1914         with -webkit-overflow-scrolling: touch, and these intercept user events when they should not.
1915
1916         Fix by propagating a "contentsHidden" flag from the web process which is used to turn off
1917         user interaction on these views.
1918
1919         * Shared/mac/RemoteLayerTreePropertyApplier.mm:
1920         (WebKit::RemoteLayerTreePropertyApplier::applyProperties):
1921         * Shared/mac/RemoteLayerTreeTransaction.h:
1922         * Shared/mac/RemoteLayerTreeTransaction.mm:
1923         (WebKit::RemoteLayerTreeTransaction::LayerProperties::LayerProperties):
1924         (WebKit::RemoteLayerTreeTransaction::LayerProperties::encode):
1925         (WebKit::RemoteLayerTreeTransaction::LayerProperties::decode):
1926         (WebKit::dumpChangedLayers):
1927         * UIProcess/ios/RemoteLayerTreeHostIOS.mm:
1928         (-[UIView _recursiveFindDescendantScrollViewAtPoint:withEvent:]): Our custom hit
1929         test needs to take view.isUserInteractionEnabled into account.
1930         * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
1931         (WebKit::PlatformCALayerRemote::setHidden):
1932         (WebKit::PlatformCALayerRemote::contentsHidden):
1933         (WebKit::PlatformCALayerRemote::setContentsHidden):
1934         * WebProcess/WebPage/mac/PlatformCALayerRemote.h:
1935
1936 2016-05-09  Ada Chan  <adachan@apple.com>
1937
1938         Introduce WebVideoFullscreenInterfaceMac::isPlayingVideoInEnhancedFullscreen() and use it in WebVideoFullscreenManagerProxy::isPlayingVideoInEnhancedFullscreen()
1939         https://bugs.webkit.org/show_bug.cgi?id=157493
1940
1941         Reviewed by Dan Bernstein.
1942
1943         * UIProcess/Cocoa/WebVideoFullscreenManagerProxy.mm:
1944         (WebKit::WebVideoFullscreenManagerProxy::isPlayingVideoInEnhancedFullscreen):
1945
1946 2016-05-06  Ada Chan  <adachan@apple.com>
1947
1948         Add WKPageRef SPI to tell whether there's a video playing in enhanced fullscreen
1949         https://bugs.webkit.org/show_bug.cgi?id=157434
1950
1951         Reviewed by Darin Adler.
1952
1953         * UIProcess/API/C/mac/WKPagePrivateMac.h:
1954         * UIProcess/API/C/mac/WKPagePrivateMac.mm:
1955         (WKPageIsPlayingVideoInEnhancedFullscreen):
1956         * UIProcess/Cocoa/WebVideoFullscreenManagerProxy.h:
1957         * UIProcess/Cocoa/WebVideoFullscreenManagerProxy.mm:
1958         (WebKit::WebVideoFullscreenManagerProxy::isPlayingVideoInEnhancedFullscreen):
1959         * UIProcess/WebPageProxy.cpp:
1960         (WebKit::WebPageProxy::isPlayingVideoInEnhancedFullscreen):
1961         * UIProcess/WebPageProxy.h:
1962
1963 2016-05-09  Anders Carlsson  <andersca@apple.com>
1964
1965         Add injected bundle SPI for getting favicon and touch icon URLs
1966         https://bugs.webkit.org/show_bug.cgi?id=157435
1967
1968         Reviewed by Darin Adler.
1969
1970         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFrame.h:
1971         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFrame.mm:
1972         (collectIcons):
1973         New helper function that calls into the WebCore LinkCollector.
1974
1975         (-[WKWebProcessPlugInFrame appleTouchIconURLs]):
1976         Call collectIcons.
1977
1978         (-[WKWebProcessPlugInFrame faviconURLs]):
1979         Ditto.
1980
1981 2016-05-06  Simon Fraser  <simon.fraser@apple.com>
1982
1983         [iOS WK2] Font size increases on some pages after navigating then going back
1984         https://bugs.webkit.org/show_bug.cgi?id=157441
1985         rdar://problem/22873240
1986
1987         Reviewed by Darin Adler.
1988
1989         There's an ordering dependency between setting the viewport configuration and doing
1990         layouts when going back to a page from the page cache that is incorrectly handled.
1991
1992         In FrameLoader::commitProvisionalLoad(), CachedPage::restore() triggers a layout under
1993         updateContentsSize(), but this happens before dispatchDidCommitLoad() which updates
1994         the viewport arguments via ViewportConfiguration::setViewportArguments().
1995
1996         This issue is not addressed by the current commit. But a second problem is:
1997         if the inputs to text autosizing change, we need to invalidate the autosizing state.
1998         The relevant input here is the fixed layout width (which is determined from the viewport
1999         configuration).
2000
2001         The current code invalidated text autosizing when m_viewportConfiguration.minimumLayoutSize()
2002         changed, but the correct behavior is to invalidate based on fixed layout size changing.
2003
2004         * WebProcess/WebPage/WebPage.cpp:
2005         (WebKit::WebPage::sendViewportAttributesChanged):
2006         (WebKit::WebPage::setFixedLayoutSize):
2007         * WebProcess/WebPage/WebPage.h:
2008         * WebProcess/WebPage/ios/WebPageIOS.mm:
2009         (WebKit::WebPage::resetTextAutosizing):
2010         (WebKit::WebPage::dynamicViewportSizeUpdate):
2011         (WebKit::WebPage::viewportConfigurationChanged):
2012         (WebKit::WebPage::setViewportConfigurationMinimumLayoutSize): Deleted.
2013         (WebKit::WebPage::resetTextAutosizingBeforeLayoutIfNeeded): Deleted.
2014
2015 2016-05-09  Alex Christensen  <achristensen@webkit.org>
2016
2017         Don't use DiskCache for media resource loads
2018         https://bugs.webkit.org/show_bug.cgi?id=157405
2019
2020         Reviewed by Darin Adler.
2021
2022         * NetworkProcess/cache/NetworkCache.cpp:
2023         (WebKit::NetworkCache::makeRetrieveDecision):
2024         (WebKit::NetworkCache::makeStoreDecision):
2025         * NetworkProcess/cache/NetworkCache.h:
2026         * NetworkProcess/cache/NetworkCacheStatistics.cpp:
2027         (WebKit::NetworkCache::retrieveDecisionToDiagnosticKey):
2028
2029 2016-05-08  Myles C. Maxfield  <mmaxfield@apple.com>
2030
2031         [OS X] Migrate our Font classes entirely off of NSFont
2032         https://bugs.webkit.org/show_bug.cgi?id=157464
2033
2034         Reviewed by Darin Adler.
2035
2036         * WebProcess/WebCoreSupport/mac/WebPopupMenuMac.mm:
2037         (WebKit::WebPopupMenu::setUpPlatformData):
2038         * WebProcess/WebPage/mac/WebPageMac.mm:
2039         (WebKit::WebPage::fontAtSelection):
2040
2041 2016-05-06  Joseph Pecoraro  <pecoraro@apple.com>
2042
2043         Rename HitTestRequest DisallowShadowContent to DisallowUserAgentShadowContent
2044         https://bugs.webkit.org/show_bug.cgi?id=157447
2045
2046         Reviewed by Ryosuke Niwa.
2047
2048         * WebProcess/WebPage/CoordinatedGraphics/WebPageCoordinatedGraphics.cpp:
2049         (WebKit::WebPage::findZoomableAreaForPoint):
2050         * WebProcess/WebPage/WebFrame.cpp:
2051         (WebKit::WebFrame::hitTest):
2052         * WebProcess/WebPage/WebPage.cpp:
2053         (WebKit::WebPage::determinePrimarySnapshottedPlugIn):
2054         * WebProcess/WebPage/ios/WebPageIOS.mm:
2055         (WebKit::WebPage::rangeForWebSelectionAtPosition):
2056         (WebKit::WebPage::rangeForBlockAtPoint):
2057         (WebKit::WebPage::getPositionInformation):
2058
2059 2016-05-06  Simon Fraser  <simon.fraser@apple.com>
2060
2061         Enable IOS_TEXT_AUTOSIZING on Mac and make it testable
2062         https://bugs.webkit.org/show_bug.cgi?id=157432
2063         rdar://problem/16406720
2064
2065         Reviewed by Dean Jackson.
2066
2067         Enable IOS_TEXT_AUTOSIZING on Mac so it can be tested.
2068         
2069         Make the setTextAutosizingEnabled() Setting work, and plumb it through WK1 and WK2
2070         preferences for WTR and DRT. Make textAutosizingWindowSizeOverride() work, for layout tests.
2071         These two settings are shared with TEXT_AUTOSIZING.
2072
2073         Add a TextAutosizing log channel, which is useful for generated -expected.html results.
2074
2075         Move adjustComputedFontSizesOnBlocks() and related code from RenderObject to RenderElement
2076         without changes.
2077
2078         An implication of this set of changes is that the way clients enable text autosizing
2079         has changed. Previously, they set the "MinimumZoomFontSize" preference to 0.
2080         Settings::defaultMinimumZoomFontSize() used to do this in order to enable text autosizing
2081         on iPhone only, not iPad.
2082
2083         Now the preferred technique is to leave minimumZoomFontSize alone, and to use textAutosizingEnabled()
2084         instead. Settings::defaultTextAutosizingEnabled() now does the check for iPhone.
2085
2086         UIWebView calls WebKitGetMinimumZoomFontSize() to setup the default minimum font zoom size,
2087         which will now always return 15, but had no other code that toggled this. So it's safe to just rely
2088         on Settings::defaultTextAutosizingEnabled() doing the right thing for iPhone/iPad.
2089
2090         * Configurations/FeatureDefines.xcconfig:
2091         * Shared/WebPreferencesDefinitions.h:
2092         * UIProcess/API/Cocoa/WKPreferences.mm:
2093         (-[WKPreferences _textAutosizingEnabled]):
2094         (-[WKPreferences _setTextAutosizingEnabled:]):
2095         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
2096         * WebProcess/WebPage/WebPage.cpp:
2097         (WebKit::WebPage::updatePreferences):
2098
2099 2016-05-06  Dean Jackson  <dino@apple.com>
2100
2101         Regions, Shapes and Tracks don't need runtime features
2102         https://bugs.webkit.org/show_bug.cgi?id=157426
2103         <rdar://problem/26146262>
2104
2105         Reviewed by Simon Fraser.
2106
2107         The following RuntimeEnabledFeatures can be removed since
2108         we have no need to disable them (they are stable and have
2109         shipped for a while):
2110         - CSS Regions
2111         - CSS Shapes
2112         - Media tracks
2113
2114         * Shared/WebPreferencesDefinitions.h:
2115         * UIProcess/API/C/WKPreferences.cpp:
2116         (WKPreferencesSetCSSRegionsEnabled): Deleted.
2117         (WKPreferencesGetCSSRegionsEnabled): Deleted.
2118         * UIProcess/API/C/WKPreferencesRefPrivate.h:
2119         * WebProcess/InjectedBundle/InjectedBundle.cpp:
2120         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner): Deleted.
2121         (WebKit::InjectedBundle::setCSSRegionsEnabled): Deleted.
2122         (WebKit::InjectedBundle::setCSSCompositingEnabled): Deleted.
2123         * WebProcess/InjectedBundle/InjectedBundle.h:
2124         * WebProcess/WebPage/WebPage.cpp:
2125         (WebKit::WebPage::updatePreferences): Deleted.
2126
2127 2016-05-05  Ada Chan  <adachan@apple.com>
2128
2129         Create a fence in WebVideoFullscreenManagerProxy::setVideoLayerFrame() to pass to the web process
2130         https://bugs.webkit.org/show_bug.cgi?id=157409
2131
2132         Reviewed by Tim Horton.
2133
2134         * UIProcess/Cocoa/WebVideoFullscreenManagerProxy.mm:
2135         (WebKit::WebVideoFullscreenManagerProxy::setVideoLayerFrame):
2136         Create a fence by calling DrawingAreaProxy::createFence() and pass it when sending the
2137         WebVideoFullscreenManager::SetVideoLayerFrameFenced message.
2138
2139         * UIProcess/DrawingAreaProxy.cpp:
2140         (WebKit::DrawingAreaProxy::createFence):
2141         Stub implementation. Assert not to be reached here since it's only implemented on Mac so far.
2142         * UIProcess/DrawingAreaProxy.h:
2143
2144         * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.h:
2145         * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm:
2146         (WebKit::TiledCoreAnimationDrawingAreaProxy::createFence):
2147         Renamed from createFenceForGeometryUpdate() since we are using it for more than just updating geometry.
2148         (WebKit::TiledCoreAnimationDrawingAreaProxy::sendUpdateGeometry):
2149         Update due to method rename.
2150
2151 2016-05-05  Brady Eidson  <beidson@apple.com>
2152
2153         Modern IDB (Workers): Get everything to the right threads.
2154         https://bugs.webkit.org/show_bug.cgi?id=157398
2155
2156         Reviewed by Alex Christensen.
2157
2158         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
2159         (WebKit::WebIDBConnectionToServer::putOrAdd):
2160         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h:
2161
2162 2016-05-05  Manuel Rego Casasnovas  <rego@igalia.com>
2163
2164         [GTK] Remove "region based columns" runtime feature remainings
2165         https://bugs.webkit.org/show_bug.cgi?id=157393
2166
2167         The runtime feature was removed in r168978,
2168         and the usage in WebKitSettings.cpp in r168988.
2169         However it was still around in ExperimentalFeatures class.
2170
2171         Reviewed by Michael Catanzaro.
2172
2173         * UIProcess/gtk/ExperimentalFeatures.cpp: Remove runtime feature.
2174         * UIProcess/gtk/ExperimentalFeatures.h: Ditto.
2175
2176 2016-05-05  Manuel Rego Casasnovas  <rego@igalia.com>
2177
2178         [GTK] Add CSS Grid Layout as experimental feature
2179         https://bugs.webkit.org/show_bug.cgi?id=157391
2180
2181         Reviewed by Michael Catanzaro.
2182
2183         Now that we've a runtime feature again for CSS Grid Layout (r200215),
2184         we can recover the old patch (r162215) that allows to enable/disable
2185         CSS Grid Layout through the environment variable
2186         WEBKITGTK_EXPERIMENTAL_FEATURES.
2187
2188         Example: WEBKITGTK_EXPERIMENTAL_FEATURES="CSS_GRID_LAYOUT=1"
2189
2190         * UIProcess/API/gtk/WebKitSettings.cpp:
2191         (webKitSettingsConstructed): Use new experimental feature to enable
2192         or disable CSS Grid Layout.
2193         * UIProcess/gtk/ExperimentalFeatures.cpp: Add new experimental feature.
2194         * UIProcess/gtk/ExperimentalFeatures.h: Ditto.
2195
2196 2016-05-05  Jer Noble  <jer.noble@apple.com>
2197
2198         [WK2] Media controls don't update if controller is created after the interface is created
2199         https://bugs.webkit.org/show_bug.cgi?id=157376
2200
2201         Reviewed by Beth Dakin.
2202
2203         Implement the new getter methods on WebPlaybackSessionModelContext by caching the values
2204         passed through WebPlaybackSessionManagerProxy.
2205
2206         * UIProcess/Cocoa/WebPlaybackSessionManagerProxy.h:
2207         * UIProcess/Cocoa/WebPlaybackSessionManagerProxy.mm:
2208         (WebKit::WebPlaybackSessionManagerProxy::setCurrentTime):
2209         (WebKit::WebPlaybackSessionManagerProxy::setBufferedTime):
2210         (WebKit::WebPlaybackSessionManagerProxy::setSeekableRangesVector):
2211         (WebKit::WebPlaybackSessionManagerProxy::setCanPlayFastReverse):
2212         (WebKit::WebPlaybackSessionManagerProxy::setAudioMediaSelectionOptions):
2213         (WebKit::WebPlaybackSessionManagerProxy::setLegibleMediaSelectionOptions):
2214         (WebKit::WebPlaybackSessionManagerProxy::setExternalPlaybackProperties):
2215         (WebKit::WebPlaybackSessionManagerProxy::setWirelessVideoPlaybackDisabled):
2216         (WebKit::WebPlaybackSessionManagerProxy::setDuration):
2217         (WebKit::WebPlaybackSessionManagerProxy::setRate):
2218         * UIProcess/Cocoa/WebVideoFullscreenManagerProxy.h:
2219         * UIProcess/Cocoa/WebVideoFullscreenManagerProxy.mm:
2220         (WebKit::WebVideoFullscreenModelContext::requestFullscreenMode): Deleted.
2221         (WebKit::WebVideoFullscreenModelContext::setVideoLayerFrame): Deleted.
2222         (WebKit::WebVideoFullscreenModelContext::setVideoLayerGravity): Deleted.
2223         (WebKit::WebVideoFullscreenModelContext::fullscreenModeChanged): Deleted.
2224         (WebKit::WebVideoFullscreenModelContext::isVisible): Deleted.
2225         (WebKit::WebVideoFullscreenModelContext::didSetupFullscreen): Deleted.
2226         (WebKit::WebVideoFullscreenModelContext::didEnterFullscreen): Deleted.
2227         (WebKit::WebVideoFullscreenModelContext::didExitFullscreen): Deleted.
2228         (WebKit::WebVideoFullscreenModelContext::didCleanupFullscreen): Deleted.
2229         (WebKit::WebVideoFullscreenManagerProxy::WebVideoFullscreenManagerProxy): Deleted.
2230         (WebKit::WebVideoFullscreenManagerProxy::~WebVideoFullscreenManagerProxy): Deleted.
2231
2232 2016-05-05  Dean Jackson  <dino@apple.com>
2233
2234         Shadow DOM should not be experimental
2235         https://bugs.webkit.org/show_bug.cgi?id=157384
2236         <rdar://problem/26123254>
2237
2238         Reviewed by Anders Carlsson.
2239
2240         Shadow DOM is not an experimental feature. We want
2241         it enabled by default.
2242
2243         This fixes the timeout in:
2244         WebKit2.InjectedBundleMakeAllShadowRootOpenTest
2245
2246         * Shared/WebPreferencesDefinitions.h: Move the Shadow
2247         DOM preference out of Experimental.
2248         * WebProcess/InjectedBundle/InjectedBundle.cpp:
2249         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
2250         * WebProcess/WebPage/WebPage.cpp:
2251         (WebKit::WebPage::updatePreferences):
2252
2253 2016-05-05  Simon Fraser  <simon.fraser@apple.com>
2254
2255         Revert r200390, thus putting r199259 and r200161 and back.
2256
2257         * Shared/VisibleContentRectUpdateInfo.cpp:
2258         (WebKit::VisibleContentRectUpdateInfo::encode):
2259         (WebKit::VisibleContentRectUpdateInfo::decode):
2260         * Shared/VisibleContentRectUpdateInfo.h:
2261         (WebKit::VisibleContentRectUpdateInfo::VisibleContentRectUpdateInfo):
2262         (WebKit::VisibleContentRectUpdateInfo::enclosedInScrollableAncestorView):
2263         (WebKit::operator==):
2264         * UIProcess/API/Cocoa/WKWebView.mm:
2265         (-[WKWebView _didInvokeUIScrollViewDelegateCallback]):
2266         (-[WKWebView _didFinishScrolling]):
2267         (-[WKWebView scrollViewDidScroll:]):
2268         (-[WKWebView scrollViewDidZoom:]):
2269         (-[WKWebView scrollViewDidEndZooming:withView:atScale:]):
2270         (-[WKWebView _scrollViewDidInterruptDecelerating:]):
2271         (-[WKWebView _visibleRectInEnclosingScrollView:]):
2272         (-[WKWebView _visibleContentRect]):
2273         (-[WKWebView _didScroll]):
2274         (-[WKWebView _enclosingScrollerScrollingEnded:]):
2275         (-[WKWebView _frameOrBoundsChanged]):
2276         (-[WKWebView _updateVisibleContentRects]):
2277         (-[WKWebView _updateVisibleContentRectAfterScrollInView:]):
2278         (scrollViewCanScroll):
2279         (-[WKWebView _updateContentRectsWithState:]):
2280         * UIProcess/API/Cocoa/WKWebViewInternal.h:
2281         * UIProcess/WebPageProxy.h:
2282         * UIProcess/ios/WKContentView.h:
2283         * UIProcess/ios/WKContentView.mm:
2284         (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:obscuredInset:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]):
2285         (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:obscuredInset:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:]): Deleted.
2286         * UIProcess/ios/WebPageProxyIOS.mm:
2287         (WebKit::WebPageProxy::updateVisibleContentRects):
2288         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
2289         (WebKit::RemoteLayerTreeDrawingAreaProxy::indicatorLocation):
2290         * WebProcess/WebPage/ios/WebPageIOS.mm:
2291         (WebKit::WebPage::updateVisibleContentRects):
2292
2293 2016-05-02  Sam Weinig  <sam@webkit.org>
2294
2295         On platforms that support it, use a SecTrustRef as the basis of CertificateInfo instead of a chain of SecCertificateRefs.
2296         https://bugs.webkit.org/show_bug.cgi?id=157220
2297
2298         Reviewed by Darin Adler.
2299
2300         * Shared/Authentication/mac/AuthenticationManager.mac.mm:
2301         (WebKit::leafCertificate):
2302         (WebKit::chain):
2303         (WebKit::AuthenticationManager::tryUseCertificateInfoForChallenge):
2304         When supported, get the SecCertificateRef from the SecTrustRef rather than the
2305         stored certificate chain.
2306
2307         * Shared/cf/ArgumentCodersCF.cpp:
2308         (IPC::typeFromCFTypeRef):
2309         (IPC::encode):
2310         (IPC::decode):
2311         * Shared/cf/ArgumentCodersCF.h:
2312         Add support for encoding/decoding SecTrustRef objects.
2313
2314         * Shared/mac/WebCoreArgumentCodersMac.mm:
2315         (IPC::ArgumentCoder<CertificateInfo>::encode):
2316         (IPC::ArgumentCoder<CertificateInfo>::decode):
2317         Add support for encoding/decoding CertificateInfo's that contain SecTrustRef objects.
2318
2319         (IPC::encodeNSError):
2320         (IPC::decodeNSError):
2321         Simplify error encoding/decoding by not using an addition CertificateInfo object for encoding
2322         the peerCertificateChain. Also, add the peerTrust to the userInfo that get's encoded/decoded.
2323
2324         * UIProcess/API/Cocoa/WKWebView.h:
2325         * UIProcess/API/Cocoa/WKWebView.mm:
2326         (-[WKWebView serverTrust]):
2327         (-[WKWebView certificateChain]):
2328         Add new serverTrust API and deprecate certificateChain.
2329
2330         * UIProcess/Cocoa/NavigationState.mm:
2331         (WebKit::NavigationState::willChangeCertificateInfo):
2332         (WebKit::NavigationState::didChangeCertificateInfo):
2333         Add support for KVO of -[WKWebView serverTrust].
2334
2335 2016-05-05  Daniel Bates  <dabates@apple.com>
2336
2337         Remove workaround added in r200391 (rdar://problem/25992976)
2338         https://bugs.webkit.org/show_bug.cgi?id=157378
2339         <rdar://problem/26118503>
2340
2341         Reviewed by Anders Carlsson.
2342
2343         Following the fix for <rdar://problem/26075714> we can remove the workaround added in r200391 (rdar://problem/25992976).
2344
2345         * Shared/mac/CodeSigning.mm:
2346         (WebKit::secCodeSigningIdentifier):
2347
2348 2016-05-04  Dean Jackson  <dino@apple.com>
2349
2350         Experimental Features don't need an "Experimental" prefix
2351         https://bugs.webkit.org/show_bug.cgi?id=157363
2352         <rdar://problem/26100630>
2353
2354         Reviewed by Anders Carlsson.
2355
2356         Since we're not persisting the value of the experimental
2357         features, it's unlikely there will ever be the case
2358         where we move a Preference from experimental to normal
2359         and use a stored value.
2360
2361         * Shared/WebPreferencesDefinitions.h:
2362         * WebProcess/InjectedBundle/InjectedBundle.cpp:
2363         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
2364         * WebProcess/WebPage/WebPage.cpp:
2365         (WebKit::WebPage::updatePreferences):
2366
2367 2016-05-04  Dean Jackson  <dino@apple.com>
2368
2369         Experimental features should toggle runtime flags
2370         https://bugs.webkit.org/show_bug.cgi?id=157353
2371         <rdar://problem/23621603>
2372
2373         Reviewed by Anders Carlsson.
2374
2375         Hook up the experimental WebPreferences to RuntimeEnabledFeatures.
2376         In the process I removed the general preference for WebGL 2 (we
2377         already had an experimental feature for it) and moved Custom
2378         Elements and Shadow DOM to experimental.
2379
2380         I also removed the C versions of the preferences, since experimental
2381         features only need the ObjC API (which is generated automatically).
2382
2383         * Shared/WebPreferencesDefinitions.h: Move/remove some features and
2384         make the experimental section more clear.
2385         * UIProcess/API/C/WKPreferences.cpp:
2386         (WKPreferencesSetWebGL2Enabled): Deleted.
2387         (WKPreferencesGetWebGL2Enabled): Deleted.
2388         (WKPreferencesSetShadowDOMEnabled): Deleted.
2389         (WKPreferencesGetShadowDOMEnabled): Deleted.
2390         (WKPreferencesSetCustomElementsEnabled): Deleted.
2391         (WKPreferencesGetCustomElementsEnabled): Deleted.
2392         * UIProcess/API/C/WKPreferencesRefPrivate.h:
2393         * UIProcess/WebPreferences.cpp:
2394         (WebKit::WebPreferences::updateBoolValueForExperimentalFeatureKey): A
2395         version of updateBoolValueForKey that doesn't call the platform
2396         function (e.g. doesn't save to NSUserDefaults).
2397         * UIProcess/WebPreferences.h:
2398         * UIProcess/mac/WebPreferencesMac.mm:
2399         (WebKit::WebPreferences::platformInitializeStore): Deleted.
2400         * WebProcess/InjectedBundle/InjectedBundle.cpp:
2401         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
2402         * WebProcess/WebPage/WebPage.cpp:
2403         (WebKit::WebPage::updatePreferences):
2404
2405 2016-05-04  Dean Jackson  <dino@apple.com>
2406
2407         TestRunner should always enable all the experimental features
2408         https://bugs.webkit.org/show_bug.cgi?id=157360
2409         <rdar://problem/26099748>
2410
2411         Reviewed by Anders Carlsson.
2412
2413         Experimental features are disabled by default, but it is
2414         a pain to enable them in every test. Instead, have the
2415         test runner turn them all on.
2416
2417         * UIProcess/API/C/WKPreferences.cpp:
2418         (WKPreferencesEnableAllExperimentalFeatures):
2419         * UIProcess/API/C/WKPreferencesRefPrivate.h:
2420         * UIProcess/WebPreferences.cpp:
2421         (WebKit::WebPreferences::enableAllExperimentalFeatures):
2422         * UIProcess/WebPreferences.h:
2423
2424 2016-05-04  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
2425
2426         Add WKPreference for SelectionPaintingWithoutSelectionGaps
2427         https://bugs.webkit.org/show_bug.cgi?id=156900
2428
2429         Reviewed by Michael Catanzaro.
2430
2431         Unlike other browsers WebKit has been drawing selection gaps
2432         between render blocks during the text selection. This often
2433         cause text selection screen looks messy.
2434
2435         This patch adds a setting method to disable the functionality,
2436         and EFL port disables it by default.
2437
2438         * Shared/WebPreferencesDefinitions.h:
2439         * UIProcess/API/C/WKPreferences.cpp:
2440         (WKPreferencesSetSelectionPaintingWithoutSelectionGapsEnabled):
2441         (WKPreferencesGetSelectionPaintingWithoutSelectionGapsEnabled):
2442         * UIProcess/API/C/WKPreferencesRefPrivate.h:
2443         * WebProcess/WebPage/WebPage.cpp:
2444         (WebKit::WebPage::updatePreferences):
2445
2446 2016-05-04  Zan Dobersek  <zdobersek@igalia.com>
2447
2448         [CoordGraphics] CompositingCoordinator should hande root compositing and view overlay layers separately
2449         https://bugs.webkit.org/show_bug.cgi?id=157305
2450
2451         Reviewed by Carlos Garcia Campos.
2452
2453         Update CoordinatedLayerTreeHost and ThreadCoordinatedLayerTreeHost to
2454         correctly use setRootCompositingLayer() and setViewOverlayRootLayer()
2455         methods on the CompositingCoordinator object.
2456
2457         CoordinatedLayerTreeHost doesn't have to keep a pointer to the root
2458         compositing layer anymore. updateRootLayers() can be removed.
2459
2460         ThreadCoordinatedLayerTreeHost doen't have to keep a pointer to both
2461         the root compositing and the view overlay layers anymore. Similarly,
2462         updateRootLayers() can be removed.
2463
2464         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
2465         (WebKit::CoordinatedLayerTreeHost::setViewOverlayRootLayer):
2466         (WebKit::CoordinatedLayerTreeHost::setRootCompositingLayer):
2467         (WebKit::CoordinatedLayerTreeHost::CoordinatedLayerTreeHost): Deleted.
2468         (WebKit::CoordinatedLayerTreeHost::updateRootLayers): Deleted.
2469         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h:
2470         * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp:
2471         (WebKit::ThreadedCoordinatedLayerTreeHost::setRootCompositingLayer):
2472         (WebKit::ThreadedCoordinatedLayerTreeHost::setViewOverlayRootLayer):
2473         (WebKit::ThreadedCoordinatedLayerTreeHost::ThreadedCoordinatedLayerTreeHost): Deleted.
2474         (WebKit::ThreadedCoordinatedLayerTreeHost::updateRootLayers): Deleted.
2475         * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h:
2476
2477 2016-05-03  Beth Dakin  <bdakin@apple.com>
2478
2479         Add VideoControlsManager tests
2480         https://bugs.webkit.org/show_bug.cgi?id=157332
2481         -and corresponding-
2482         rdar://problem/24358431
2483
2484         Reviewed by Sam Weinig.
2485
2486         Expose _hasActiveVideoForControlsManager on WKWebViewPrivate for the sake of 
2487         testing. 
2488         * UIProcess/API/Cocoa/WKWebView.mm:
2489         (-[WKWebView _hasActiveVideoForControlsManager]):
2490         (-[WKWebView _doAfterNextPresentationUpdate:]):
2491         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2492
2493 2016-05-03  Jer Noble  <jer.noble@apple.com>
2494
2495         [iOS][WK2] Allow WKWebView to play local filesystem media when created with -loadFileURL:allowingReadAccessToURL:
2496         https://bugs.webkit.org/show_bug.cgi?id=156875
2497         <rdar://problem/24281444>
2498
2499         Reviewed by Alexey Proskuryakov.
2500
2501         Grant AVFoundation the right to issue file read sandbox extensions from the WebContent process to the mediaserverd
2502         process, so that it can play back local media files.
2503
2504         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
2505
2506 2016-05-03  Jiewen Tan  <jiewen_tan@apple.com>
2507
2508         File Upload: Photo upload name is always generic (image.jpg)
2509         https://bugs.webkit.org/show_bug.cgi?id=157291
2510         <rdar://problem/12353008>
2511
2512         Reviewed by Darin Adler.
2513
2514         Use the original filename as the name of an uploaded image instead of
2515         a generic name, i.e. image.jpg.
2516
2517         * Platform/spi/ios/PhotosSPI.h: Added.
2518         * UIProcess/ios/forms/WKFileUploadPanel.mm:
2519         (-[WKFileUploadPanel _uploadItemForImage:withAssetURL:successBlock:failureBlock:]):
2520         * WebKit2.xcodeproj/project.pbxproj:
2521
2522 2016-05-03  Chris Dumez  <cdumez@apple.com>
2523
2524         [WK2][DiskCache] Store common HTTP header names as strings
2525         https://bugs.webkit.org/show_bug.cgi?id=157326
2526         <rdar://problem/26073498>
2527
2528         Reviewed by Antti Koivisto.
2529
2530         Store common HTTP header names as strings in the disk cache instead of
2531         using their value in the HTTPHeaderName enumeration. Having the disk
2532         cache rely in the HTTPHeaderName enumeration is risky becomes it means
2533         the cached data would become invalid every time someone updates
2534         HTTPHeaderNames.in in WebCore. If someone were to update
2535         HTTPHeaderNames.in without bumping the disk cache version, we would end
2536         up with wrongly recognized HTTP header names after loading responses
2537         from the cache.
2538
2539         * NetworkProcess/cache/NetworkCacheCoders.cpp:
2540         (WebKit::NetworkCache::Coder<WebCore::HTTPHeaderMap>::encode):
2541         (WebKit::NetworkCache::Coder<WebCore::HTTPHeaderMap>::decode):
2542         * NetworkProcess/cache/NetworkCacheCoders.h:
2543         * NetworkProcess/cache/NetworkCacheStorage.h:
2544
2545 2016-05-03  Daniel Bates  <dabates@apple.com>
2546
2547         Temporary workaround for Apple Internal builds
2548         <rdar://problem/25992976>
2549
2550         For Apple Internal builds treat error code errSecCSGuestInvalid as if it were error code errSecCSUnsigned.
2551         We will look to remove this workaround in the fix for <rdar://problem/26075714>.
2552
2553         * Shared/mac/CodeSigning.mm:
2554         (WebKit::secCodeSigningIdentifier):
2555
2556 2016-05-03  Chris Dumez  <cdumez@apple.com>
2557
2558         Unreviewed, rolling out r199259 and r200161.
2559
2560         Seems to have caused a ~1.2% PLT regression on iOS
2561
2562         Reverted changesets:
2563
2564         "[iOS WK2] WKWebViews should consult ancestor UIScrollViews to
2565         determine tiling area"
2566         https://bugs.webkit.org/show_bug.cgi?id=156429
2567         http://trac.webkit.org/changeset/199259
2568
2569         "[iOS WK2] When determining tile size, check whether ancestor
2570         UIScrollViews are actually scrollable"
2571         https://bugs.webkit.org/show_bug.cgi?id=157107
2572         http://trac.webkit.org/changeset/200161
2573
2574 2016-05-03  Dean Jackson  <dino@apple.com>
2575
2576         CSS Grid should be an experimental feature flag
2577         https://bugs.webkit.org/show_bug.cgi?id=157327
2578         <rdar://problem/26075147>
2579
2580         Reviewed by Anders Carlsson.
2581
2582         The CSS Grid Layout runtime flag was exposed by
2583         a WebKit preference. It was in the experimental
2584         section but was missing the "Experimental" prefix.
2585
2586         It was also missing the human readable description.
2587
2588         Lastly, there is no need for the C API for experimental
2589         features.
2590
2591         * Shared/WebPreferencesDefinitions.h:
2592         * UIProcess/API/C/WKPreferences.cpp:
2593         (WKPreferencesSetCSSGridLayoutEnabled): Deleted.
2594         (WKPreferencesGetCSSGridLayoutEnabled): Deleted.
2595         * UIProcess/API/C/WKPreferencesRefPrivate.h:
2596         * WebProcess/InjectedBundle/InjectedBundle.cpp:
2597         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
2598         * WebProcess/WebPage/WebPage.cpp:
2599         (WebKit::WebPage::updatePreferences):
2600
2601 2016-05-03  Alex Christensen  <achristensen@webkit.org>
2602
2603         Remove firing assertion when redirecting
2604         https://bugs.webkit.org/show_bug.cgi?id=155800
2605         rdar://25299194
2606
2607         Reviewed by Sam Weinig.
2608
2609         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
2610         (-[WKNetworkSessionDelegate URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:]):
2611         (-[WKNetworkSessionDelegate URLSession:dataTask:willCacheResponse:completionHandler:]):
2612         (-[WKNetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:]):
2613         (-[WKNetworkSessionDelegate URLSession:task:didCompleteWithError:]):
2614         With NSURLConnection, we stopped getting delegate callbacks once the delegate is destroyed, and everything was cancelled.
2615         With NSURLSession we continue getting delegate callbacks because the session's delegate is not destroyed after each load.
2616         As documented in NSURLSession.h: "In some cases, the task may signal other work before it acknowledges the cancelation."
2617         In the cases where we cancel a load, delete the NetworkLoad and corresponding NetworkDataTask, we want to call all
2618         completion handlers indicating that we really want to cancel instead of asserting.
2619
2620 2016-05-02  Darin Adler  <darin@apple.com>
2621
2622         Change IDL enumerations to be nested in their C++ class instead of at WebCore namespace level
2623         https://bugs.webkit.org/show_bug.cgi?id=157257
2624
2625         Reviewed by Chris Dumez.
2626
2627         * WebProcess/Network/WebLoaderStrategy.cpp:
2628         (WebKit::WebLoaderStrategy::loadResource): Updated since we changed
2629         ReferrerHeaderPolicy back to ReferrerPolicy.
2630         (WebKit::WebLoaderStrategy::schedulePluginStreamLoad): Ditto.
2631
2632 2016-05-02  Brady Eidson  <beidson@apple.com>
2633
2634         Const-ify some IDB code.
2635         https://bugs.webkit.org/show_bug.cgi?id=157287
2636
2637         Reviewed by Alex Christensen.
2638
2639         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
2640         (WebKit::WebIDBConnectionToServer::deleteDatabase):
2641         (WebKit::WebIDBConnectionToServer::openDatabase):
2642         (WebKit::WebIDBConnectionToServer::abortTransaction):
2643         (WebKit::WebIDBConnectionToServer::commitTransaction):
2644         (WebKit::WebIDBConnectionToServer::didFinishHandlingVersionChangeTransaction):
2645         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h:
2646
2647 2016-05-02  Simon Fraser  <simon.fraser@apple.com>
2648
2649         Sort the project file.
2650
2651         * WebKit2.xcodeproj/project.pbxproj:
2652
2653 2016-05-02  Simon Fraser  <simon.fraser@apple.com>
2654
2655         Fix shouldUpdateScrollLayerPositionSynchronously() for non-main frames. Remove updatesScrollLayerPositionOnMainThread()
2656         https://bugs.webkit.org/show_bug.cgi?id=157277
2657
2658         Reviewed by Dean Jackson, Tim Horton.
2659
2660         Remove updatesScrollLayerPositionOnMainThread() which is unused by all ports.
2661
2662         * WebProcess/Plugins/PDF/DeprecatedPDFPlugin.h:
2663
2664 2016-05-02  Alex Christensen  <achristensen@webkit.org>
2665
2666         Crash if a certificate chain has null certificates
2667         https://bugs.webkit.org/show_bug.cgi?id=157206
2668
2669         Reviewed by Alexey Proskuryakov.
2670
2671         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
2672         (WebKit::certificatesMatch):
2673         SecTrustGetCertificateAtIndex can return null.
2674         If this ever happens, something has gone horribly wrong in the security code and we should crash.
2675         See rdar://problem/21723172
2676
2677 2016-05-02  Myles C. Maxfield  <mmaxfield@apple.com>
2678
2679         Addressing post-review comments after r200116
2680         https://bugs.webkit.org/show_bug.cgi?id=157228
2681
2682         Reviewed by Anders Carlsson.
2683
2684         * Shared/WebPreferencesDefinitions.h:
2685         * UIProcess/API/Cocoa/WKWebView.mm:
2686         (-[WKWebView _initializeWithConfiguration:]):
2687         * UIProcess/API/Cocoa/WKWebViewConfiguration.h:
2688         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
2689         (-[WKWebViewConfiguration encodeWithCoder:]):
2690         (-[WKWebViewConfiguration initWithCoder:]):
2691         (-[WKWebViewConfiguration copyWithZone:]):
2692         * UIProcess/WebPageProxy.cpp:
2693         * WebProcess/WebPage/WebPage.cpp:
2694         (WebKit::WebPage::updatePreferences):
2695
2696 2016-05-02  Daniel Bates  <dabates@apple.com>
2697
2698         DatabaseTracker::closeAllDatabases calls Database::close from the wrong thread
2699         https://bugs.webkit.org/show_bug.cgi?id=147672
2700         <rdar://problem/22357464>
2701
2702         Reviewed by Brady Eidson.
2703
2704         Call DatabaseTracker::closeAllDatabases() with CurrentQueryBehavior::Interrupt so that we abort
2705         a long running query and close the database immediately to avoid holding a locked file when the
2706         process is suspended.
2707
2708         * WebProcess/WebProcess.cpp:
2709         (WebKit::WebProcess::processWillSuspendImminently):
2710
2711 2016-05-01  Darin Adler  <darin@apple.com>
2712
2713         Update Fetch to use enum class instead of string for enumerations
2714         https://bugs.webkit.org/show_bug.cgi?id=157241
2715
2716         Reviewed by Chris Dumez.
2717
2718         * WebProcess/Network/WebLoaderStrategy.cpp:
2719         (WebKit::WebLoaderStrategy::loadResource): Updated for the change where I
2720         renamed ReferrerPolicy to ReferrerHeaderPolicy, at least for now.
2721         (WebKit::WebLoaderStrategy::schedulePluginStreamLoad): Ditto.
2722
2723 2016-05-01  Konstantin Tokarev  <annulen@yandex.ru>
2724
2725         Fixed build with !ENABLED(DATABASE_PROCESS).
2726
2727         Unreviewed build fix.
2728
2729         * UIProcess/Network/NetworkProcessProxy.cpp:
2730         (WebKit::NetworkProcessProxy::grantSandboxExtensionsToDatabaseProcessForBlobs):
2731
2732 2016-04-29  Chris Dumez  <cdumez@apple.com>
2733
2734         Drop useless check in SpeculativeLoadManager::registerLoad()
2735         https://bugs.webkit.org/show_bug.cgi?id=157204
2736
2737         Reviewed by Antti Koivisto.
2738
2739         Drop useless check in SpeculativeLoadManager::registerLoad(). There is
2740         no way to end up this code path with a non-HTTP family request.
2741
2742         * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
2743         (WebKit::NetworkCache::SpeculativeLoadManager::registerLoad):
2744
2745 2016-04-29  Brian Burg  <bburg@apple.com>
2746
2747         Web Automation: add SPI to mark an existing NSEvent as synthesized for automation
2748         https://bugs.webkit.org/show_bug.cgi?id=157221
2749         <rdar://problem/26019356>
2750
2751         Reviewed by Timothy Hatcher.
2752
2753         In cases where an NSEvent is duplicated, clients need to re-mark an NSEvent
2754         as synthesized for automation if the original NSEvent was marked as such.
2755
2756         * UIProcess/API/Cocoa/_WKAutomationSession.h:
2757         * UIProcess/API/Cocoa/_WKAutomationSession.mm:
2758         (-[_WKAutomationSession markEventAsSynthesizedForAutomation:]):
2759         * UIProcess/Automation/WebAutomationSession.h:
2760         * UIProcess/Cocoa/WebAutomationSessionCocoa.mm:
2761         (WebKit::WebAutomationSession::sendSynthesizedEventsToPage):
2762         (WebKit::WebAutomationSession::markEventAsSynthesizedForAutomation):
2763
2764 2016-04-29  Brian Burg  <bburg@apple.com>
2765
2766         Web Automation: use a magic eventNumber as a fallback for detecting NSEvents synthesized for automation
2767         https://bugs.webkit.org/show_bug.cgi?id=157222
2768
2769         Reviewed by Timothy Hatcher.
2770
2771         Sometimes events are copied and redelivered in a way that can't be reliably intercepted,
2772         so use eventNumber as an alternate means of detecting synthesized mouse NSEvents.
2773
2774         * UIProcess/Cocoa/WebAutomationSessionCocoa.mm:
2775         (WebKit::WebAutomationSession::wasEventSynthesizedForAutomation):
2776         If it's a mouse-related event, check the eventNumber if the associated object was missing.
2777
2778         (WebKit::WebAutomationSession::platformSimulateMouseInteraction):
2779         Most real events from input devices fill in eventNumber with a non-zero value.
2780         In my testing, using zero did not seem to adversely affect event delivery.
2781
2782 2016-04-29  Joseph Pecoraro  <pecoraro@apple.com>
2783
2784         Web Inspector: Issues inspecting the inspector, pausing on breakpoints causes content to not load
2785         https://bugs.webkit.org/show_bug.cgi?id=157198
2786         <rdar://problem/26011049>
2787
2788         Reviewed by Timothy Hatcher.
2789
2790         * WebProcess/WebPage/WebInspectorFrontendAPIDispatcher.h:
2791         * WebProcess/WebPage/WebInspectorFrontendAPIDispatcher.cpp:
2792         (WebKit::WebInspectorFrontendAPIDispatcher::reset):
2793         (WebKit::WebInspectorFrontendAPIDispatcher::frontendLoaded):
2794         (WebKit::WebInspectorFrontendAPIDispatcher::suspend):
2795         (WebKit::WebInspectorFrontendAPIDispatcher::unsuspend):
2796         (WebKit::WebInspectorFrontendAPIDispatcher::dispatchCommand):
2797         (WebKit::WebInspectorFrontendAPIDispatcher::dispatchMessageAsync):
2798         (WebKit::WebInspectorFrontendAPIDispatcher::evaluateOrQueueExpression):
2799         (WebKit::WebInspectorFrontendAPIDispatcher::evaluateQueuedExpressions):
2800         Avoid evaluating expressions when the page is paused. Generalize the
2801         message queueing and dispatching for pause/suspend that we already
2802         had for waiting for the frontend page to be loaded.
2803
2804         * WebProcess/WebPage/WebInspectorUI.h:
2805         * WebProcess/WebPage/WebInspectorUI.cpp:
2806         (WebKit::WebInspectorUI::pagePaused):
2807         (WebKit::WebInspectorUI::pageUnpaused):
2808         When the frontend page pauses/unpauses, suspend/resume the dispatcher.
2809
2810 2016-04-29  Chris Dumez  <cdumez@apple.com>
2811
2812         Remove unnecessary isolated String copying from one of NetworkCache::Key's constructor
2813         https://bugs.webkit.org/show_bug.cgi?id=157207
2814
2815         Reviewed by Antti Koivisto.
2816
2817         Remove unnecessary isolated String copying from one of NetworkCache::Key's
2818         constructor. We are anyway going to create isolated copies if the Key ends
2819         up getting copied.
2820
2821         * NetworkProcess/cache/NetworkCacheKey.cpp:
2822         (WebKit::NetworkCache::Key::Key):
2823
2824 2016-04-29  Brian Burg  <bburg@apple.com>
2825
2826         Web Automation: performMouseInteraction command computes mouse event coordinates incorrectly
2827         https://bugs.webkit.org/show_bug.cgi?id=157218
2828         <rdar://problem/26018230>
2829
2830         Reviewed by Timothy Hatcher.
2831
2832         This patch fixes two issues: the min/max clamp was in the wrong order,
2833         and the y-value did not account for the window's top content inset.
2834
2835         * UIProcess/Automation/WebAutomationSession.cpp:
2836         (WebKit::WebAutomationSession::performMouseInteraction):
2837
2838 2016-04-29  Dean Jackson  <dino@apple.com>
2839
2840         RTL <select> popup menu is in the wrong location
2841         https://bugs.webkit.org/show_bug.cgi?id=157159
2842         <rdar://problem/25894451>
2843
2844         Reapply http://trac.webkit.org/changeset/200217
2845         but with changes that will allow it to build on Yosemite.
2846
2847         * UIProcess/mac/WebPopupMenuProxyMac.mm:
2848         (WebKit::WebPopupMenuProxyMac::showPopupMenu):
2849
2850 2016-04-28  Ada Chan  <adachan@apple.com>
2851
2852         Indicate we are processing user gesture when handling messages from WebPlaybackSessionManagerProxy to WebPlaybackSessionManager
2853         https://bugs.webkit.org/show_bug.cgi?id=157151
2854
2855         Reviewed by Jer Noble.
2856
2857         Messages from WebPlaybackSessionManagerProxy to WebPlaybackSessionManager are triggered by
2858         user actions, so add a UserGestureIndicator in the methods that handle those messages.
2859
2860         * WebProcess/cocoa/WebPlaybackSessionManager.mm:
2861         (WebKit::WebPlaybackSessionManager::play):
2862         (WebKit::WebPlaybackSessionManager::pause):
2863         (WebKit::WebPlaybackSessionManager::togglePlayState):
2864         (WebKit::WebPlaybackSessionManager::beginScrubbing):
2865         (WebKit::WebPlaybackSessionManager::endScrubbing):
2866         (WebKit::WebPlaybackSessionManager::seekToTime):
2867         (WebKit::WebPlaybackSessionManager::fastSeek):
2868         (WebKit::WebPlaybackSessionManager::beginScanningForward):
2869         (WebKit::WebPlaybackSessionManager::beginScanningBackward):
2870         (WebKit::WebPlaybackSessionManager::endScanning):
2871         (WebKit::WebPlaybackSessionManager::selectAudioMediaOption):
2872         (WebKit::WebPlaybackSessionManager::selectLegibleMediaOption):
2873
2874 2016-04-29  Brady Eidson  <beidson@apple.com>
2875
2876         Add a default ".isolatedCopy()" specialization to CrossThreadCopier, and other small cleanup.
2877         https://bugs.webkit.org/show_bug.cgi?id=157185
2878
2879         Reviewed by Anders Carlsson.
2880
2881         * Shared/WebCrossThreadCopier.cpp:
2882         (WebCore::Vector<char>>::copy): reserveInitialCapacity() before creating the copy.
2883         (WebCore::Vector<int64_t>>::copy): Ditto.
2884         (WebCore::Vector<uint8_t>>::copy): Ditto.
2885         (WebCore::Vector<Vector<IDBKeyData>>>::copy): Deleted dead code.
2886         * Shared/WebCrossThreadCopier.h:
2887
2888 2016-04-29  Commit Queue  <commit-queue@webkit.org>
2889
2890         Unreviewed, rolling out r200217.
2891         https://bugs.webkit.org/show_bug.cgi?id=157183
2892
2893         This change broke the Yosemite build. (Requested by ryanhaddad
2894         on #webkit).
2895
2896         Reverted changeset:
2897
2898         "RTL <select> popup menu is in the wrong location"
2899         https://bugs.webkit.org/show_bug.cgi?id=157159
2900         http://trac.webkit.org/changeset/200217
2901
2902 2016-04-29  Claudio Saavedra  <csaavedra@igalia.com>
2903
2904         [GTK] Move WK2 shareable code out from gtk directories
2905         https://bugs.webkit.org/show_bug.cgi?id=157135
2906
2907         Reviewed by Darin Adler.
2908
2909         Both NetworkProcessMain and InjectedBundle can go out from their respective gtk directories.
2910
2911         * NetworkProcess/gtk/NetworkProcessMainGtk.cpp:
2912         (WebKit::NetworkProcessMainUnix): Deleted.
2913         * NetworkProcess/soup/NetworkProcessMainSoup.cpp: Renamed from Source/WebKit2/NetworkProcess/gtk/NetworkProcessMainGtk.cpp.
2914         (WebKit::NetworkProcessMainUnix):
2915         * PlatformGTK.cmake: Update.
2916         * WebProcess/InjectedBundle/glib/InjectedBundleGlib.cpp: Renamed from Source/WebKit2/WebProcess/InjectedBundle/gtk/InjectedBundleGtk.cpp.
2917         (WebKit::InjectedBundle::initialize):
2918         (WebKit::InjectedBundle::setBundleParameter):
2919         (WebKit::InjectedBundle::setBundleParameters):
2920         * WebProcess/InjectedBundle/gtk/InjectedBundleGtk.cpp:
2921         (WebKit::InjectedBundle::initialize): Deleted.
2922         (WebKit::InjectedBundle::setBundleParameter): Deleted.
2923         (WebKit::InjectedBundle::setBundleParameters): Deleted.
2924
2925 2016-04-28  Dean Jackson  <dino@apple.com>
2926
2927         RTL <select> popup menu is in the wrong location
2928         https://bugs.webkit.org/show_bug.cgi?id=157159
2929         <rdar://problem/25894451>
2930
2931         Reviewed by Simon Fraser.
2932
2933         Make sure the NSPopupMenu takes the text direction
2934         into account, and offset the position
2935         of the menu slightly if we're in RTL mode.
2936
2937         Unfortunately our test infrastructure is unable to exercise
2938         this because it runs without a window, and the popup menu
2939         is not captured in the screenshot.
2940
2941         * UIProcess/mac/WebPopupMenuProxyMac.mm:
2942         (WebKit::WebPopupMenuProxyMac::showPopupMenu):
2943
2944 2016-04-28  Manuel Rego Casasnovas  <rego@igalia.com>
2945
2946         [css-grid] Add CSS Grid Layout runtime flag
2947         https://bugs.webkit.org/show_bug.cgi?id=157134
2948
2949         Reviewed by Simon Fraser.
2950
2951         Add CSS Grid Layout runtime flag based on preferences,
2952         enabled by default.
2953
2954         * Shared/WebPreferencesDefinitions.h:
2955         * UIProcess/API/C/WKPreferences.cpp:
2956         (WKPreferencesSetCSSGridLayoutEnabled):
2957         (WKPreferencesGetCSSGridLayoutEnabled):
2958         * UIProcess/API/C/WKPreferencesRefPrivate.h:
2959         * WebProcess/InjectedBundle/InjectedBundle.cpp:
2960         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
2961         * WebProcess/WebPage/WebPage.cpp:
2962         (WebKit::WebPage::updatePreferences):
2963
2964 2016-04-28  Daniel Bates  <dabates@apple.com>
2965
2966         Fix the Apple Internal OS X build
2967
2968         * UIProcess/mac/WKPrintingView.mm:
2969         (-[WKPrintingView _drawPDFDocument:page:atPoint:]): Ignore deprecation warning for -[PDFPage drawWithBox:].
2970         * WebProcess/WebPage/mac/WebPageMac.mm:
2971         (WebKit::drawPDFPage): Ditto.
2972
2973 2016-04-28  Manuel Rego Casasnovas  <rego@igalia.com>
2974
2975         Fix mistake in custom elements runtime flag
2976         https://bugs.webkit.org/show_bug.cgi?id=157130
2977
2978         Reviewed by Chris Dumez.
2979
2980         The methods for the custom elements runtime flag were using
2981         the Shadow DOM flag instead.
2982         These methods were introduced in r197921,
2983         it seems it was just a copy&paste mistake.
2984
2985         * UIProcess/API/C/WKPreferences.cpp:
2986         (WKPreferencesSetCustomElementsEnabled):
2987         (WKPreferencesGetCustomElementsEnabled):
2988
2989 2016-04-28  Carlos Garcia Campos  <cgarcia@igalia.com>
2990
2991         Unreviewed. Add missing files to the compilation of GTK+ inspector.
2992
2993         * PlatformGTK.cmake:
2994
2995 2016-04-27  Dan Bernstein  <mitz@apple.com>
2996
2997         <rdar://problem/25915253> REGRESSION (r199628): Netflix playback fails in Safari Technology Preview with error code S7363-1260-FFFF58D8
2998
2999         Rubber-stamped by Tim Horton.
3000
3001         Reverted r199628.
3002
3003         * Configurations/WebContentService.xcconfig:
3004
3005 2016-04-27  Brady Eidson  <beidson@apple.com>
3006
3007         Modern IDB: Implement native IDBFactory.getAllDatabaseNames for WebInspector.
3008         https://bugs.webkit.org/show_bug.cgi?id=157072
3009
3010         Reviewed by Alex Christensen.
3011
3012         Handle the process hop for the new getAllDatabaseNames call.
3013         
3014         * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.cpp:
3015         (WebKit::WebIDBConnectionToClient::didGetAllDatabaseNames):
3016         (WebKit::WebIDBConnectionToClient::getAllDatabaseNames):
3017         * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.h:
3018         * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.messages.in:
3019
3020         * Shared/WebCrossThreadCopier.cpp:
3021         (WebCore::SecurityOriginData>::copy): Deleted, as its in WebCore now.
3022         * Shared/WebCrossThreadCopier.h:
3023
3024         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
3025         (WebKit::WebIDBConnectionToServer::getAllDatabaseNames):
3026         (WebKit::WebIDBConnectionToServer::didGetAllDatabaseNames):
3027         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h:
3028         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.messages.in:
3029
3030 2016-04-27  Simon Fraser  <simon.fraser@apple.com>
3031
3032         [iOS WK2] When determining tile size, check whether ancestor UIScrollViews are actually scrollable
3033         https://bugs.webkit.org/show_bug.cgi?id=157107
3034         rdar://problem/25943577
3035
3036         Reviewed by Tim Horton.
3037         
3038         We should only fall back to 512x512 tiles if the WKWebView has a UIScrollView ancestor,
3039         and that UIScrollView actually scrolls. This avoids falling back to small tiles in
3040         MobileSafari.
3041
3042         Rename "enclosedInScrollView" to "enclosedInScrollableAncestorView" everywhere.
3043
3044         * Shared/VisibleContentRectUpdateInfo.cpp:
3045         (WebKit::VisibleContentRectUpdateInfo::encode):
3046         (WebKit::VisibleContentRectUpdateInfo::decode):
3047         * Shared/VisibleContentRectUpdateInfo.h:
3048         (WebKit::VisibleContentRectUpdateInfo::VisibleContentRectUpdateInfo):
3049         (WebKit::VisibleContentRectUpdateInfo::enclosedInScrollableAncestorView):
3050         (WebKit::operator==):
3051         (WebKit::VisibleContentRectUpdateInfo::enclosedInScrollView): Deleted.
3052         * UIProcess/API/Cocoa/WKWebView.mm:
3053         (scrollViewCanScroll):
3054         (-[WKWebView _updateContentRectsWithState:]):
3055         * UIProcess/ios/WKContentView.h:
3056         * UIProcess/ios/WKContentView.mm:
3057         (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:obscuredInset:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]):
3058         (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:obscuredInset:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollView:]): Deleted.
3059         * WebProcess/WebPage/ios/WebPageIOS.mm:
3060         (WebKit::WebPage::updateVisibleContentRects):
3061
3062 2016-04-26  Ada Chan  <adachan@apple.com>
3063
3064         Set WebVideoFullscreenInterfaceMac up as a client of WebPlaybackSessionInterfaceMac to listen for playback state changes
3065         https://bugs.webkit.org/show_bug.cgi?id=157008
3066
3067         Reviewed by Jer Noble.
3068
3069         Since WebVideoFullscreenInterfaceMac holds onto WebPlaybackSessionInterfaceMac, we can't let
3070         WebPlaybackSessionManagerProxy unregister the context for that media element while
3071         WebVideoFullscreenInterfaceMac is still using it. WebVideoFullscreenInterfaceMac should add
3072         to the client count for that WebPlaybackSession context.
3073
3074         * UIProcess/Cocoa/WebVideoFullscreenManagerProxy.mm:
3075         (WebKit::WebVideoFullscreenManagerProxy::createModelAndInterface):
3076         When the context for the media element is created with the WebVideoFullscreenManagerProxy, it should
3077         add one to the client count for the media element context in WebPlaybackSessionManagerProxy.
3078         (WebKit::WebVideoFullscreenManagerProxy::removeClientForContext):
3079         When WebVideoFullscreenManagerProxy unregisters the context for this media element, it should
3080         subtract one from the client count for the media element context in WebPlaybackSessionManagerProxy.
3081
3082         * WebProcess/cocoa/WebPlaybackSessionManager.mm:
3083         (WebKit::WebPlaybackSessionManager::clearPlaybackControlsManager):
3084         Bail early if m_controlsManagerContextId is zero. Otherwise, we'd end up sending a
3085         ClearPlaybackControlsManager message to the UI process inadvertently.
3086         (WebKit::WebPlaybackSessionManager::contextIdForMediaElement):
3087         Make sure the model element for the context ID is set to the media element.
3088
3089         * WebProcess/cocoa/WebVideoFullscreenManager.mm:
3090         (WebKit::WebVideoFullscreenManager::createModelAndInterface):
3091         When the context for the media element is created with the WebVideoFullscreenManager, it should
3092         add one to the client count for the media element context in WebPlaybackSessionManager.
3093         (WebKit::WebVideoFullscreenManager::removeContext):
3094         When WebVideoFullscreenManager unregisters the context for this media element, it should
3095         subtract one from the client count for the media element context in WebPlaybackSessionManager.
3096
3097 2016-04-27  Alex Christensen  <achristensen@webkit.org>
3098
3099         Remove download message receiver when NetworkProcess crashes
3100         https://bugs.webkit.org/show_bug.cgi?id=157102
3101         <rdar://problem/25550106>
3102
3103         Reviewed by Anders Carlsson.
3104
3105         * UIProcess/Downloads/DownloadProxyMap.cpp:
3106         (WebKit::DownloadProxyMap::processDidClose):
3107         When the NetworkProcess crashes during a download, we want to remove the message receiver from the map
3108         so we don't get an assertion in ~MessageReceiver in the UIProcess so we do not have a freed
3109         message receiver in the map.
3110
3111 2016-04-27  Alex Christensen  <achristensen@webkit.org>
3112
3113         Fix client certificate authentication with NSURLSession on iOS
3114         https://bugs.webkit.org/show_bug.cgi?id=157094
3115         <rdar://problem/25946859>
3116
3117         Reviewed by Darin Adler.
3118
3119         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
3120         (-[WKNetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:]):
3121         We only want to create a non-persistent credential with the given user and password 
3122         and store the user and password in the CredentialStorage if there is a user and password.
3123         We previously only skipped this if we were doing server trust evaluation, in which case 
3124         we will have a credential from serverTrustCredential which has no user or password.
3125         When doing client certificate authentication on iOS, this completion handler is called with
3126         a credential with session persistence and also no user or password, so we need to do the same thing.
3127         The reason this was never hit on Mac was because the credential came from tryUseCertificateInfoForChallenge,
3128         which always had persistence none.
3129
3130 2016-04-27  Claudio Saavedra  <csaavedra@igalia.com>
3131
3132         [GTK][EFL] Move WK2 platform code to a common place
3133         https://bugs.webkit.org/show_bug.cgi?id=157069
3134
3135         Reviewed by Carlos Garcia Campos.
3136
3137         Logging implementation can be shared between EFL and GTK, so move it to unix.
3138         The GTK Module implementation doesn't depend on GTK anyhow so move it to glib.
3139
3140         * Platform/efl/LoggingEfl.cpp: Removed.
3141         (WebKit::logLevelString): Deleted.
3142         * Platform/glib/ModuleGlib.cpp: Renamed from Source/WebKit2/Platform/gtk/ModuleGtk.cpp.
3143         (WebKit::Module::load):
3144         (WebKit::Module::unload):
3145         (WebKit::Module::platformFunctionPointer):
3146         * Platform/gtk/LoggingGtk.cpp:
3147         (WebKit::logLevelString): Deleted.
3148         * Platform/gtk/ModuleGtk.cpp:
3149         (WebKit::Module::load): Deleted.
3150         (WebKit::Module::unload): Deleted.
3151         (WebKit::Module::platformFunctionPointer): Deleted.
3152         * Platform/unix/LoggingUnix.cpp: Renamed from Source/WebKit2/Platform/gtk/LoggingGtk.cpp.
3153         (WebKit::logLevelString):
3154         * PlatformEfl.cmake: Update.
3155         * PlatformGTK.cmake: Update
3156
3157 2016-04-27  Alex Christensen  <achristensen@webkit.org>
3158
3159         Fix assertion when downloading with NSURLSession after r198955
3160         https://bugs.webkit.org/show_bug.cgi?id=157051
3161
3162         Reviewed by Brady Eidson.
3163
3164         * NetworkProcess/NetworkProcess.cpp:
3165         (WebKit::NetworkProcess::continueDecidePendingDownloadDestination):
3166
3167 2016-04-27  Carlos Garcia Campos  <cgarcia@igalia.com>
3168
3169         REGRESSION(r200094): [FreeType] Vertical text is broken after r200094
3170         https://bugs.webkit.org/show_bug.cgi?id=157066
3171
3172         Reviewed by Martin Robinson.
3173
3174         Add Source/WebCore/platform/graphics/freetype to the list of include dirs, because now FontPlatformData.h
3175         includes FcUniquePtr.h.
3176
3177         * PlatformEfl.cmake:
3178         * PlatformGTK.cmake:
3179
3180 2016-04-26  Joseph Pecoraro  <pecoraro@apple.com>
3181
3182         Uncaught Exception: SecurityError: DOM Exception 18: An attempt was made to break through the security policy of the user agent.
3183         https://bugs.webkit.org/show_bug.cgi?id=156991
3184         <rdar://problem/25913475>
3185
3186         Reviewed by Timothy Hatcher.
3187
3188         * UIProcess/mac/WebInspectorProxyMac.mm:
3189         (WebKit::WebInspectorProxy::platformCreateInspectorPage):
3190         Explicitly always allow access to storage for Web Inspector content just
3191         in case, as we already allow universal file access.
3192
3193 2016-04-26  Myles C. Maxfield  <mmaxfield@apple.com>
3194
3195         [WK2] [OS X] Create API for switching RTL scrollbar policy
3196         https://bugs.webkit.org/show_bug.cgi?id=156948
3197         <rdar://problem/25707757>
3198
3199         Reviewed by Darin Adler.
3200
3201         Add the new API.
3202
3203         * Shared/WebPreferencesDefinitions.h:
3204         * UIProcess/API/Cocoa/WKWebView.mm:
3205         (-[WKWebView _initializeWithConfiguration:]):
3206         * UIProcess/API/Cocoa/WKWebViewConfiguration.h:
3207         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
3208         (-[WKWebViewConfiguration init]):
3209         (-[WKWebViewConfiguration encodeWithCoder:]):
3210         (-[WKWebViewConfiguration initWithCoder:]):
3211         (-[WKWebViewConfiguration copyWithZone:]):
3212         * UIProcess/WebPageProxy.cpp:
3213         * WebProcess/Plugins/PDF/DeprecatedPDFPlugin.h:
3214         * WebProcess/WebPage/WebPage.cpp:
3215         (WebKit::WebPage::updatePreferences):
3216
3217 2016-04-26  Beth Dakin  <bdakin@apple.com>
3218
3219         Check to make sure shouldRequestCandidates() before requesting candidates
3220         https://bugs.webkit.org/show_bug.cgi?id=157038
3221         -and corresponding-
3222         rdar://problem/25910418
3223
3224         Reviewed by Tim Horton.
3225
3226         This patch limits requesting and showing candidates to cases where 
3227         shouldRequestCandidates() is true. This patch also caches the sequence number 
3228         returned by [NSSpellChecker requestCandidatesForSelectedRange:] to make sure 
3229         it is equal to the sequence number sent to the callback handler so that we do 
3230         not show candidates for old requests.
3231
3232         * UIProcess/Cocoa/WebViewImpl.h:
3233         * UIProcess/Cocoa/WebViewImpl.mm:
3234         (WebKit::WebViewImpl::updateWebViewImplAdditions):
3235         (WebKit::WebViewImpl::shouldRequestCandidates):
3236         (WebKit::WebViewImpl::showCandidates):
3237         (WebKit::WebViewImpl::requestCandidatesForSelectionIfNeeded):
3238         (WebKit::WebViewImpl::handleRequestedCandidates):
3239
3240 2016-04-26  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
3241
3242         [EFL] Update expectation result in ewk_context_preferred_languages API test
3243         https://bugs.webkit.org/show_bug.cgi?id=157027
3244
3245         Reviewed by Carlos Garcia Campos.
3246
3247         platformLanguage() has been returning lower case value since r199815. Thus existing expected result
3248         needs to be updated together.
3249
3250         * UIProcess/API/efl/tests/test_ewk2_context.cpp: Change en-US with en-us.
3251         (TEST_F):
3252
3253 2016-04-26  Zan Dobersek  <zdobersek@igalia.com>
3254
3255         Mark two methods in the CoordinatedGraphicsScene and the
3256         ThreadedCoordinatedLayerTreeHost classes as overrides, fixing
3257         the compiler warnings.
3258
3259         Rubber-stamped by Carlos Garcia Campos.
3260
3261         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h:
3262         * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h:
3263
3264 2016-04-25  Ryosuke Niwa  <rniwa@webkit.org>
3265
3266         Remove the build flag for template elements
3267         https://bugs.webkit.org/show_bug.cgi?id=157022
3268
3269         Reviewed by Daniel Bates.
3270
3271         * Configurations/FeatureDefines.xcconfig:
3272
3273 2016-04-25  Chris Dumez  <cdumez@apple.com>
3274
3275         Crash under -[WKWebView _mayAutomaticallyShowVideoPictureInPicture] + 32 (WKWebView.mm:309)
3276         https://bugs.webkit.org/show_bug.cgi?id=156990
3277         <rdar://problem/25904376>
3278
3279         Reviewed by Jer Noble.
3280
3281         In case of WebProcess crash, WebPageProxy::processDidCrash() will call resetState() which
3282         will nullify WebPageProxy::m_videoFullscreenManager. In WebPageProxy::reattachToWebProcess(),
3283         we then call updateViewState() before re-initializing m_videoFullscreenManager, and
3284         updateViewState() ends up calling [WKWebView _mayAutomaticallyShowVideoPictureInPicture]
3285         which dereferences WebPageProxy::m_videoFullscreenManager without null check. This patch
3286         adds a null check for m_videoFullscreenManager in _mayAutomaticallyShowVideoPictureInPicture.
3287
3288         * UIProcess/API/Cocoa/WKWebView.mm:
3289         (-[WKWebView _mayAutomaticallyShowVideoPictureInPicture]):
3290
3291 2016-04-25  Dan Bernstein  <mitz@apple.com>
3292
3293         Fix a couple of mistakes from r199700.
3294
3295         Rubber-stamped by Anders Carlsson.
3296
3297         * UIProcess/API/Cocoa/WKPreferencesPrivate.h: Added availability attributes to new properties.
3298         * WebKit2.xcodeproj/project.pbxproj: Demoted _WKExperimentalFeatureInternal.h from Private to Project.
3299
3300 2016-04-24  Hunseop Jeong  <hs85.jeong@samsung.com>
3301
3302         [EFL] Update the ewk_settings_offline_web_application_cache_enabled_get() expected value after r199854.
3303         https://bugs.webkit.org/show_bug.cgi?id=156968
3304
3305         Reviewed by Gyuyoung Kim.
3306
3307         * UIProcess/API/C/WKPreferencesRef.h: Update the comment.
3308         * UIProcess/API/efl/tests/test_ewk2_settings.cpp: 
3309         (TEST_F):
3310
3311 2016-04-23  Andy Estes  <aestes@apple.com>
3312
3313         Fix issues found by the clang static analyzer
3314         https://bugs.webkit.org/show_bug.cgi?id=156956
3315
3316         Reviewed by Alexey Proskuryakov.
3317
3318         * UIProcess/API/Cocoa/WKPreviewActionItem.mm:
3319         (-[WKPreviewAction dealloc]): Added to release _identifier.
3320         * UIProcess/_WKWebViewPrintFormatter.mm:
3321         (-[_WKWebViewPrintFormatter dealloc]): Released _frameToPrint.
3322         * UIProcess/ios/WKContentViewInteraction.mm:
3323         (-[WKContentView inputView]): -createPeripheralWithView: returned a retained object, but the method name did not
3324         match Cocoa conventions. Called -initWithView: instead.
3325         (-[WKContentView _showAttachmentSheet]): Stored the _WKActivatedElementInfo in a RetainPtr.
3326         (-[WKContentView _dataForPreviewItemController:atPosition:type:]): Ditto.
3327         (+[WKAutocorrectionContext autocorrectionContextWithData:markedText:selectedText:afterText:selectedRangeInMarkedText:]):
3328         The properties contextBeforeSelection, selectedText, markedText, and contextAfterSelection have the 'copy'
3329         annotation in UIWKAutocorrectionContext, so the additional copy made here would be leaked. Removed the extra copy.
3330         (-[WKAutocorrectionContext dealloc]): Deleted.
3331         * UIProcess/ios/forms/WKFormInputControl.h: Removed -createPeripheralWithView: and declared -initWithView:.
3332         * UIProcess/ios/forms/WKFormInputControl.mm:
3333         (-[WKFormInputControl initWithView:]): Changed to return instancetype.
3334         (+[WKFormInputControl createPeripheralWithView:]): Deleted.
3335         * UIProcess/ios/forms/WKFormSelectControl.h: Removed -createPeripheralWithView: and declared -initWithView:.
3336         * UIProcess/ios/forms/WKFormSelectControl.mm:
3337         (+[WKFormSelectControl createPeripheralWithView:]): Deleted.
3338         * UIProcess/mac/LegacySessionStateCoding.cpp:
3339         (WebKit::decodeLegacySessionState): If dynamic_cf_cast returned nullptr, the result of
3340         CFPropertyListCreateWithData would leak. Stored the CFPropertyListRef in a RetainPtr before calling dynamic_cf_cast.
3341         * UIProcess/mac/ServicesController.mm:
3342         (WebKit::ServicesController::refreshExistingServices): Used a RetainPtr for attachment and cell.
3343         * UIProcess/mac/WebContextMenuProxyMac.mm:
3344         (WebKit::WebContextMenuProxyMac::setupServicesMenu): Used a RetainPtr for groupEntry.
3345
3346 2016-04-23  Chris Dumez  <cdumez@apple.com>
3347
3348         Tie the DiagnosticLoggingClient's lifetime to the Page
3349         https://bugs.webkit.org/show_bug.cgi?id=156938
3350         <rdar://problem/25851499>
3351
3352         Reviewed by Antti Koivisto.
3353
3354         * WebProcess/WebCoreSupport/WebDiagnosticLoggingClient.cpp:
3355         (WebKit::WebDiagnosticLoggingClient::pageDestroyed):
3356         (WebKit::WebDiagnosticLoggingClient::mainFrameDestroyed): Deleted.
3357         * WebProcess/WebCoreSupport/WebDiagnosticLoggingClient.h:
3358         * WebProcess/WebPage/ios/WebPageIOS.mm:
3359         (WebKit::WebPage::willStartUserTriggeredZooming):
3360
3361 2016-04-23  Dan Bernstein  <mitz@apple.com>
3362
3363         <rdar://problem/25893246> WebKit2 has failed to build: error: use of undeclared identifier 'm_playbackSessionManager'
3364
3365         Fixed the non-AVKit build.
3366
3367         * UIProcess/API/Cocoa/WKWebView.mm:
3368         (-[WKWebView _isShowingVideoPictureInPicture]):
3369         (-[WKWebView _mayAutomaticallyShowVideoPictureInPicture]):
3370         * UIProcess/WebPageProxy.cpp:
3371         (WebKit::WebPageProxy::fullScreenManager):
3372         (WebKit::WebPageProxy::playbackSessionManager):
3373         * UIProcess/WebPageProxy.h:
3374         * UIProcess/ios/WebPageProxyIOS.mm:
3375         (WebKit::WebPageProxy::applicationDidBecomeActive):
3376         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
3377         (WebKit::WebChromeClient::createScrollingCoordinator):
3378         (WebKit::WebChromeClient::supportsVideoFullscreen):
3379         * WebProcess/WebCoreSupport/WebChromeClient.h:
3380         * WebProcess/WebPage/WebPage.cpp:
3381         (WebKit::WebPage::inspectorUI):
3382         (WebKit::WebPage::playbackSessionManager):
3383         * WebProcess/WebPage/WebPage.h:
3384         * WebProcess/cocoa/WebVideoFullscreenManager.h:
3385         * WebProcess/cocoa/WebVideoFullscreenManager.mm:
3386
3387 2016-04-22  Ryan Haddad  <ryanhaddad@apple.com>
3388
3389         Fixing a typo in my last commit.
3390
3391         Unreviewed build fix.
3392
3393         * UIProcess/Cocoa/WebVideoFullscreenManagerProxy.messages.in:
3394         * WebProcess/cocoa/WebVideoFullscreenManager.messages.in:
3395
3396 2016-04-22  Ryan Haddad  <ryanhaddad@apple.com>
3397
3398         Missed some macros to fix builds that do not support AVKit.
3399
3400         Unreviewed build fix.
3401
3402         * UIProcess/Cocoa/WebVideoFullscreenManagerProxy.messages.in:
3403         * WebProcess/cocoa/WebVideoFullscreenManager.messages.in:
3404
3405 2016-04-22  Ryan Haddad  <ryanhaddad@apple.com>
3406
3407         Fix builds that do not support AVKit
3408
3409         Unreviewed build fix.
3410
3411         * UIProcess/WebPageProxy.h:
3412
3413 2016-04-22  Ryan Haddad  <ryanhaddad@apple.com>
3414
3415         Take 2 for fixing builds that do not support AVKit
3416
3417         Unreviewed build fix.
3418
3419         * UIProcess/Cocoa/WebVideoFullscreenManagerProxy.h:
3420         * UIProcess/WebPageProxy.cpp:
3421         (WebKit::WebPageProxy::resetState):
3422
3423 2016-04-22  Anders Carlsson  <andersca@apple.com>
3424
3425         WKWebView WebSQL is not enabled
3426         https://bugs.webkit.org/show_bug.cgi?id=156928
3427         rdar://problem/19029603
3428
3429         Reviewed by Beth Dakin.
3430
3431         Give databases a default quota of 50 MB, matching what we have in UIWebView.
3432
3433         * UIProcess/Cocoa/UIDelegate.mm:
3434         (WebKit::UIDelegate::UIClient::exceededDatabaseQuota):
3435
3436 2016-04-22  Ryan Haddad  <ryanhaddad@apple.com>
3437
3438         Fix builds that do not support AVKit
3439
3440         Unreviewed build fix.
3441
3442         * UIProcess/Cocoa/WebVideoFullscreenManagerProxy.h:
3443         * UIProcess/Cocoa/WebVideoFullscreenManagerProxy.mm:
3444         * UIProcess/WebPageProxy.cpp:
3445         (WebKit::WebPageProxy::WebPageProxy):
3446         (WebKit::WebPageProxy::reattachToWebProcess):
3447         (WebKit::WebPageProxy::viewDidLeaveWindow):
3448         * UIProcess/ios/WebPageProxyIOS.mm:
3449
3450 2016-04-22  Brady Eidson  <beidson@apple.com>
3451
3452         Modern IDB: Rework the ownership/RefCounting model of IDBConnectionToServer and IDBConnectionProxy.
3453         https://bugs.webkit.org/show_bug.cgi?id=156916
3454
3455         Reviewed by Tim Horton.
3456
3457         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
3458         (WebKit::WebIDBConnectionToServer::WebIDBConnectionToServer):
3459
3460 2016-04-22  Zan Dobersek  <zdobersek@igalia.com>
3461
3462         NetworkCacheIOChannelSoup: detach the newly-created IOChannel::readSync thread
3463         https://bugs.webkit.org/show_bug.cgi?id=156907
3464
3465         Reviewed by Carlos Garcia Campos.
3466
3467         * NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp:
3468         (WebKit::NetworkCache::IOChannel::readSyncInThread): Detach the new thread,
3469         ensuring the resources are released after the thread exits. Next step is
3470         to set up a thread pool and use that, avoiding thread re-creation.
3471
3472 2016-04-21  Dean Jackson  <dino@apple.com>
3473
3474         Backdrop Filter should not be visible if element has visibility:hidden
3475         https://bugs.webkit.org/show_bug.cgi?id=149318
3476         <rdar://problem/22749780>
3477
3478         Reviewed by Simon Fraser.
3479
3480         Add the isHidden method to PlatformCALayerRemote.
3481
3482         * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
3483         (WebKit::PlatformCALayerRemote::isHidden):
3484         * WebProcess/WebPage/mac/PlatformCALayerRemote.h:
3485
3486 2016-04-21  Anders Carlsson  <andersca@apple.com>
3487
3488         WKWebView HTML5 AppCache not working
3489         https://bugs.webkit.org/show_bug.cgi?id=156887
3490         rdar://problem/17944162
3491
3492         Reviewed by Tim Horton.
3493
3494         * Shared/WebPreferencesDefinitions.h:
3495         Set the offlineWebApplicationCacheEnabled property to true by default.
3496
3497         * UIProcess/API/Cocoa/APIWebsiteDataStoreCocoa.mm:
3498         (API::WebsiteDataStore::defaultDataStoreConfiguration):
3499         Set the default applicationCacheFlatFileSubdirectoryName to "Files".
3500
3501 2016-04-21  Anders Carlsson  <andersca@apple.com>
3502
3503         Get rid of the last uses of ApplicationCacheStorage::singleton() from WebKit2
3504         https://bugs.webkit.org/show_bug.cgi?id=156876
3505
3506         Reviewed by Tim Horton.
3507
3508         * Shared/WebProcessCreationParameters.cpp:
3509         (WebKit::WebProcessCreationParameters::encode):
3510         (WebKit::WebProcessCreationParameters::decode):
3511         * Shared/WebProcessCreationParameters.h:
3512         Add and encode and decode a applicationCacheFlatFileSubdirectoryName.
3513
3514         * UIProcess/API/APIProcessPoolConfiguration.cpp:
3515         (API::ProcessPoolConfiguration::createWithLegacyOptions):
3516         Set m_applicationCacheFlatFileSubdirectoryName to "ApplicationCache".
3517
3518         (API::ProcessPoolConfiguration::ProcessPoolConfiguration):
3519         Set m_applicationCacheFlatFileSubdirectoryName to "Files".
3520
3521         (API::ProcessPoolConfiguration::copy):
3522         Copy m_applicationCacheFlatFileSubdirectoryName.
3523
3524         * UIProcess/API/APIProcessPoolConfiguration.h:
3525         Add getter for applicationCacheFlatFileSubdirectoryName.
3526
3527         * UIProcess/WebProcessPool.cpp:
3528         (WebKit::legacyWebsiteDataStoreConfiguration):
3529         Initialize applicationCacheFlatFileSubdirectoryName from the process pool configuration.
3530
3531         (WebKit::WebProcessPool::createNewWebProcess):
3532         Initialize parameters.applicationCacheFlatFileSubdirectoryName. Remove a call to 
3533         ApplicationCacheStorage::singleton().setDefaultOriginQuota since it had no effect (it was called in the UI process).
3534
3535         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
3536         (WebKit::WebsiteDataStore::WebsiteDataStore):
3537         Initialize m_applicationCacheFlatFileSubdirectoryName.
3538
3539         (WebKit::WebsiteDataStore::fetchData):
3540         (WebKit::WebsiteDataStore::removeData):
3541         Pass m_applicationCacheFlatFileSubdirectoryName when creating the application cache storage.
3542
3543         * UIProcess/WebsiteData/WebsiteDataStore.h:
3544         Add new members.
3545
3546         * WebProcess/WebPage/WebPage.cpp:
3547         (WebKit::WebPage::WebPage):
3548         Set the application cache storage.
3549
3550         * WebProcess/WebProcess.cpp:
3551         (WebKit::WebProcess::initializeWebProcess):
3552         Initialize the application cache storage.
3553
3554         * WebProcess/WebProcess.h:
3555         (WebKit::WebProcess::applicationCacheStorage):
3556         Add new getter.
3557
3558 2016-04-21  Anders Carlsson  <andersca@apple.com>
3559
3560         Remove two uses of ApplicationCacheStorage::singleton() from WebKit2
3561         https://bugs.webkit.org/show_bug.cgi?id=156873
3562
3563         Reviewed by Beth Dakin.
3564
3565         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
3566         (WebKit::WebChromeClient::reachedApplicationCacheOriginQuota):
3567         * WebProcess/WebProcess.cpp:
3568         (WebKit::WebProcess::clearApplicationCache): Deleted.
3569         * WebProcess/WebProcess.h:
3570
3571 2016-04-21  Beth Dakin  <bdakin@apple.com>
3572
3573         showCandidates() should take a range and the string should be the whole 
3574         paragraph
3575         https://bugs.webkit.org/show_bug.cgi?id=156813
3576         -and corresponding-
3577         rdar://problem/25760533
3578
3579         Reviewed by Tim Horton.
3580
3581         * UIProcess/Cocoa/WebViewImpl.h:
3582         * UIProcess/Cocoa/WebViewImpl.mm:
3583         (WebKit::WebViewImpl::updateWebViewImplAdditions):
3584         (WebKit::WebViewImpl::showCandidates):
3585         (WebKit::WebViewImpl::requestCandidatesForSelectionIfNeeded):
3586         (WebKit::WebViewImpl::handleRequestedCandidates):
3587
3588 2016-04-21  Chelsea Pugh  <cpugh@apple.com>
3589
3590         [iOS] Allow clients to hide the accessory view on a form input session
3591         https://bugs.webkit.org/show_bug.cgi?id=155574
3592
3593         Reviewed by Dan Bernstein.
3594
3595         * UIProcess/API/Cocoa/_WKFormInputSession.h:
3596         * UIProcess/ios/WKContentViewInteraction.mm:
3597         (-[WKFormInputSession accessoryViewShouldNotShow]): Getter for accessoryViewShouldNotShow.
3598         (-[WKFormInputSession setAccessoryViewShouldNotShow:]): Set accessoryViewShouldNotShow and reload input views.
3599         (-[WKContentView requiresAccessoryView]): If the accessory view should be not be shown, do not require
3600         the accessory view.
3601
3602 2016-04-21  Chris Dumez  <cdumez@apple.com>
3603
3604         Drop [UsePointersEvenForNonNullableObjectArguments] from Range
3605         https://bugs.webkit.org/show_bug.cgi?id=156805
3606
3607         Reviewed by Youenn Fablet.
3608
3609         * WebProcess/InjectedBundle/API/mac/WKDOMRange.mm:
3610         (-[WKDOMRange setStart:offset:]):
3611         (-[WKDOMRange setEnd:offset:]):
3612         (-[WKDOMRange selectNode:]):
3613         (-[WKDOMRange selectNodeContents:]):
3614         * WebProcess/WebPage/WebFrame.cpp:
3615         (WebKit::WebFrame::contentsAsString):
3616
3617 2016-04-21  Carlos Garcia Campos  <cgarcia@igalia.com>
3618
3619         [GTK] WebKitWebView should claim the contents size as its natural size
3620         https://bugs.webkit.org/show_bug.cgi?id=156835
3621
3622         Reviewed by Žan Doberšek.
3623
3624         And keep claiming 0 as its minimum size since it's scrollable.
3625
3626         * UIProcess/API/gtk/PageClientImpl.cpp:
3627         (WebKit::PageClientImpl::didChangeContentSize): Call webkitWebViewBaseSetContentsSize().
3628         * UIProcess/API/gtk/PageClientImpl.h:
3629         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
3630         (webkitWebViewBaseGetPreferredWidth): Return the contents width as natural width.
3631         (webkitWebViewBaseGetPreferredHeight): Return the contents height as natural height.
3632         (webkit_web_view_base_class_init): Add implementations of get_preferred_width/height.
3633         (webkitWebViewBaseSetContentsSize): Save the contents size.
3634         * UIProcess/API/gtk/WebKitWebViewBasePrivate.h:
3635
3636 2016-04-21  Carlos Garcia Campos  <cgarcia@igalia.com>
3637
3638         [GTK] WebKitWebView should propagate wheel events not handled by the web process
3639         https://bugs.webkit.org/show_bug.cgi?id=156834
3640
3641         Reviewed by Žan Doberšek.
3642
3643         We are currently swallowing all wheel events unconditionally, not allowing applications to handle wheel events
3644         when not handled by us. Since the GTK+ event propagation system is synchronous, and our events are handled
3645         asynchronously, we need to do something similar to what we do for key events, not propagate the event the first
3646         time and if not handled by the web process, re-inject it in the event loop and then just propagate it.
3647
3648         * Shared/NativeWebWheelEvent.h:
3649         (WebKit::NativeWebWheelEvent::nativeEvent): Remove useless const.
3650         * UIProcess/API/gtk/PageClientImpl.cpp:
3651         (WebKit::PageClientImpl::wheelEventWasNotHandledByWebCore): Tell the web view to propagate the next wheel event,
3652         and re-inject the event not handled by the web process in the event loop.
3653         * UIProcess/API/gtk/PageClientImpl.h:
3654         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
3655         (webkitWebViewBaseScrollEvent): Propagate the event if shouldForwardNextWheelEvent is true.
3656         (webkitWebViewBaseForwardNextWheelEvent): Set shouldForwardNextWheelEvent to true.
3657         * UIProcess/API/gtk/WebKitWebViewBasePrivate.h:
3658         * UIProcess/PageClient.h:
3659         * UIProcess/WebPageProxy.cpp:
3660         (WebKit::WebPageProxy::didReceiveEvent): Remove ifdef.
3661         * UIProcess/efl/WebView.h:
3662
3663 2016-04-20  Dustin Falgout  <dustin@falgout.us>
3664
3665         [GTK] Expose AllowUniversalAccessFromFileURLs preference now that calling localStorage.getItem() results in SecurityError: DOM Exception 18
3666         
3667         Reviewed by Michael Catanzaro.
3668                 
3669         As of r197858 JavaScript loaded in the context of a file scheme url cannot access local storage. That is a major 
3670         breaking change as many applications that serve files locally rely on having access to local storage. The point  
3671         of that security fix is to avoid cases of downloaded HTML content (such as e-mail attachments or JS injected
3672         into local contexts) from having access to your local file system and arbitrary local storage. If you are serving 
3673         local files in your applications, you can use the WebKitAllowUniversalAccessFromFileURLs preference key to tell 
3674         Webkit that you are approve of these kinds of interactions.
3675                                               
3676         https://bugs.webkit.org/show_bug.cgi?id=156651
3677
3678         * UIProcess/API/gtk/WebKitSettings.cpp:
3679         (webKitSettingsSetProperty):
3680         (webKitSettingsGetProperty):
3681         (webkit_settings_class_init):
3682         (webkit_settings_get_allow_universal_access_from_file_urls):
3683         (webkit_settings_set_allow_universal_access_from_file_urls):
3684         * UIProcess/API/gtk/WebKitSettings.h:
3685         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
3686
3687 2016-04-20  Brady Eidson  <beidson@apple.com>
3688
3689         Modern IDB (Workers): Enable INDEXED_DATABASE_IN_WORKERS compile time flag, but disabled in RuntimeEnabledFeatures.
3690         https://bugs.webkit.org/show_bug.cgi?id=156782
3691
3692         Reviewed by Alex Christensen.
3693
3694         * Configurations/FeatureDefines.xcconfig:
3695
3696 2016-04-20  Brent Fulgham  <bfulgham@apple.com>
3697
3698         [WK2][Mac][iOS] WebContent crash when using special file:// URI scheme @ WebKit::resolveSymlinksInPath(WTF::CString const&) + 159
3699         https://bugs.webkit.org/show_bug.cgi?id=156747
3700         <rdar://problem/24648176>
3701
3702         Reviewed by Alexey Proskuryakov.
3703
3704         FileSystemCF::fileSystemRepresentation return a null string when presented with a file URL that contains embedded nulls. When
3705         this happens, SandboxExtension::createHandle attempts to pass a null string to 'resolveSymlinksInPath', which attemps to call
3706         'strrchr' on the null pointer, causing a crash.
3707
3708         Test: fast/url/file-uri-with-embedded-null-no-crash.html
3709
3710         * Shared/mac/SandboxExtensionMac.mm:
3711         (WebKit::SandboxExtension::createHandle): If 'fileSystemRepresentation' is null, return early with an error.
3712
3713 2016-04-19  Alex Christensen  <achristensen@webkit.org>
3714
3715         Fix CMake build.
3716
3717         * CMakeLists.txt:
3718         Don't compile a file that doesn't exist.
3719         * PlatformMac.cmake:
3720         Put the XPCServices in the right place.
3721
3722 2016-04-19  Chris Dumez  <cdumez@apple.com>
3723
3724         Crash under WebKit::PluginView::pluginSnapshotTimerFired
3725         https://bugs.webkit.org/show_bug.cgi?id=156754
3726         <rdar://problem/22566764>
3727
3728         Reviewed by Beth Dakin.
3729
3730         Add null check for frame() before trying to access the frame settings,
3731         similarly to what is done earlier in this function. This fixes a top
3732         crasher.
3733
3734         * WebProcess/Plugins/PluginView.cpp:
3735         (WebKit::PluginView::pluginSnapshotTimerFired):
3736
3737 2016-04-19  Dean Jackson  <dino@apple.com>
3738
3739         New SPI to export a dictionary of runtime features
3740         https://bugs.webkit.org/show_bug.cgi?id=156645
3741         <rdar://problem/23621666>
3742
3743         Reviewed by Anders Carlsson.
3744
3745         Mark the new SPI as WK_MAC_TBA, WK_IOS_TBA.
3746
3747         * UIProcess/API/Cocoa/_WKExperimentalFeature.h:
3748
3749 2016-04-19  Dean Jackson  <dino@apple.com>
3750
3751         New SPI to export a dictionary of runtime features
3752         https://bugs.webkit.org/show_bug.cgi?id=156645
3753         <rdar://problem/23621666>
3754
3755         Post commit follow-up. Darin gave review comments that
3756         I didn't address in my original commit - I was waiting
3757         on some advice.
3758
3759         * UIProcess/WebPreferences.cpp:
3760         (WebKit::WebPreferences::isEnabledForFeature): Change the macro
3761         to generate a static list of function pointers, rather than
3762         a lot of conditional statements.
3763         (WebKit::WebPreferences::setEnabledForFeature): Ditto.
3764
3765 2016-04-19  Chris Dumez  <cdumez@apple.com>
3766
3767         Mark more classes as WTF_MAKE_FAST_ALLOCATED
3768         https://bugs.webkit.org/show_bug.cgi?id=156732
3769
3770         Reviewed by Darin Adler.
3771
3772         * NetworkProcess/Downloads/Download.h:
3773         * NetworkProcess/Downloads/PendingDownload.h:
3774         * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.h:
3775         * Shared/API/Cocoa/RemoteObjectInvocation.h:
3776
3777 2016-04-19  Alex Christensen  <achristensen@webkit.org>
3778
3779         Build fix.
3780
3781         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
3782         (WebKit::NetworkConnectionToWebProcess::preregisterSandboxExtensionsForOptionallyFileBackedBlob):
3783         result is unused.
3784
3785 2016-04-19  Brady Eidson  <beidson@apple.com>
3786
3787         Modern IDB: ObjectStore Blob Support.
3788         https://bugs.webkit.org/show_bug.cgi?id=143193
3789
3790         Reviewed by Alex Christensen.
3791
3792         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
3793         (WebKit::NetworkConnectionToWebProcess::preregisterSandboxExtensionsForOptionallyFileBackedBlob): Don't ASSERT that
3794           this is the first we've heard of this path - The Connection now remembers all extensions.
3795         (WebKit::NetworkConnectionToWebProcess::getBlobDataFileReferenceForPath): Don't take - Just get.
3796
3797 2016-04-19  Antti Koivisto  <antti@apple.com>
3798
3799         Try to fix iOS build.
3800
3801         * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.h:
3802
3803 2016-04-19  Commit Queue  <commit-queue@webkit.org>
3804
3805         Unreviewed, rolling out r199658.
3806         https://bugs.webkit.org/show_bug.cgi?id=156736
3807
3808         It broke all EFL layout tests (Requested by KaL on #webkit).
3809
3810         Reverted changeset:
3811
3812         "[UNIX] Initialize WebKit before the platform initializations"
3813         https://bugs.webkit.org/show_bug.cgi?id=156622
3814         http://trac.webkit.org/changeset/199658
3815
3816 2016-04-18  Alex Christensen  <achristensen@webkit.org>
3817
3818         Build fix after r199700
3819
3820         * PlatformMac.cmake:
3821
3822 2016-04-18  Brady Eidson  <beidson@apple.com>
3823
3824         Modern IDB (Blob support): When reading Blobs from the database, grant the Networking process sandbox access to the files.
3825         https://bugs.webkit.org/show_bug.cgi?id=156640
3826
3827         Reviewed by Alex Christensen.
3828
3829         * DatabaseProcess/DatabaseProcess.cpp:
3830         (WebKit::DatabaseProcess::getSandboxExtensionsForBlobFiles): Utility function to ask the UI process for
3831           SandboxExtensions for a list of files.
3832         (WebKit::DatabaseProcess::didGetSandboxExtensionsForBlobFiles): Take the SandboxExtensions from the UI process
3833           and pass them along to the completion handler.
3834         * DatabaseProcess/DatabaseProcess.h:
3835         * DatabaseProcess/DatabaseProcess.messages.in:
3836
3837         * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.cpp:
3838         (WebKit::WebIDBConnectionToClient::didGetRecord): If the value returned from the database doesn't have Blob files,
3839           pass the result directly on to WebCore. If it does, ask the UI process for SandboxExtensions first.
3840
3841         * NetworkProcess/FileAPI/NetworkBlobRegistry.cpp:
3842         (WebKit::NetworkBlobRegistry::registerBlobURLOptionallyFileBacked): Grab the BlobDataFileReference from the 
3843           NetworkConnectionToWebProcess to pass along to the BlobRegistry.
3844
3845         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
3846         (WebKit::NetworkConnectionToWebProcess::preregisterSandboxExtensionsForOptionallyFileBackedBlob): Add this message
3847           so the WebProcess can preflight the creation of some blob URLs by passing along the SandboxExtensions for their files.
3848         (WebKit::NetworkConnectionToWebProcess::takeBlobDataFileReferenceForPath):
3849         * NetworkProcess/NetworkConnectionToWebProcess.h:
3850         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
3851
3852         * UIProcess/Databases/DatabaseProcessProxy.cpp:
3853         (WebKit::DatabaseProcessProxy::getSandboxExtensionsForBlobFiles): Create SandboxExtensions for the passed in files and
3854           return them to the DatabaseProcess.
3855         * UIProcess/Databases/DatabaseProcessProxy.h:
3856         * UIProcess/Databases/DatabaseProcessProxy.messages.in:
3857
3858         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
3859         (WebKit::WebIDBConnectionToServer::didGetRecordWithSandboxExtensions): New form of "didGetRecord" that handles passing
3860           the SandboxExtensions to the Networking process before they are needed.
3861         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h:
3862         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.messages.in:
3863
3864         * WebProcess/FileAPI/BlobRegistryProxy.cpp:
3865         (WebKit::BlobRegistryProxy::registerBlobURLOptionallyFileBacked):
3866         * WebProcess/FileAPI/BlobRegistryProxy.h:
3867
3868 2016-04-18  Dean Jackson  <dino@apple.com>
3869
3870         New SPI to export a dictionary of runtime features
3871         https://bugs.webkit.org/show_bug.cgi?id=156645
3872         <rdar://problem/23621666>
3873
3874         Trying to fix GTK and EFL builds. I forgot to add files
3875         to CMake.
3876
3877         * CMakeLists.txt:
3878         * PlatformMac.cmake:
3879
3880 2016-04-18  Dean Jackson  <dino@apple.com>
3881
3882         New SPI to export a dictionary of runtime features
3883         https://bugs.webkit.org/show_bug.cgi?id=156645
3884         <rdar://problem/23621666>
3885
3886         Reviewed by Darin Adler.
3887
3888         Add a new type of Preference for experimental features so that we
3889         can dynamically toggle them from a WebKit2 host. These are special
3890         keys that are tied to runtime flags. The host process can ask WebKit
3891         for the list of keys, each with a small description, in order to
3892         display UI.
3893
3894         - Add HumanReadableName and HumanReadableDescription parameters to our
3895           macros, which are used when building a ExperimentalFeature.
3896           These are both empty strings for the existing preferences. At some
3897           point we should probably move all this to code generation rather
3898           than macros, so that we don't have to carry around unused parameters.
3899
3900         - I've included two sample experimental features: WebGL2 and ShadowDOM.
3901           They are not actually hooked up to the runtime settings yet, but its
3902           pretty clear how that will happen. Note that these are new preferences
3903           that have an "Experimental" prefix. This is so toggling an experimental
3904           feature to off won't cause the feature to not work once it becomes
3905           stable enough to enable by default. In other words, when it moves
3906           out of the experimental stage, the experimental feature flag will be
3907           removed, and you'll no longer check for values with that key.
3908
3909         - The ExperimentalFeature object is what the host process
3910           will read in order to show some UI. It contains the human readable info,
3911           as well as the actual key that can be used to query and toggle the
3912           experimental feature.
3913
3914         * Shared/API/APIObject.h: Add the ExperimentalFeature.
3915
3916         * Shared/Cocoa/APIObject.mm:
3917         (API::Object::newObject): Exposes a wrapper around a _WKExperimentalFeature ObjC type.
3918
3919         * Shared/WebPreferencesDefinitions.h: Change all the existing macros to take the new
3920         parameters, and add the initial experimental keys.
3921
3922         * Shared/WebPreferencesKeys.cpp: Add new parameters to existing macros.
3923         * Shared/WebPreferencesKeys.h: Ditto.
3924         * Shared/WebPreferencesStore.cpp: Ditto.
3925         (WebKit::defaults):
3926
3927         * UIProcess/API/APIExperimentalFeature.cpp: The API side of the ExperimentalFeature.
3928         (API::ExperimentalFeature::create):
3929         (API::ExperimentalFeature::ExperimentalFeature):
3930         (API::ExperimentalFeature::~ExperimentalFeature):
3931         * UIProcess/API/APIExperimentalFeature.h:
3932
3933         * UIProcess/API/Cocoa/WKPreferences.mm: The actual implementation of the SPI.
3934         (+[WKPreferences _experimentalFeatures]): Create and return a list of feature descriptors.
3935         (-[WKPreferences _isEnabledForFeature:]): Get the value.
3936         (-[WKPreferences _setEnabled:forFeature:]): Set the value.
3937         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
3938
3939         * UIProcess/API/Cocoa/_WKExperimentalFeature.h: The ObjC version.
3940         * UIProcess/API/Cocoa/_WKExperimentalFeature.mm:
3941         (-[_WKExperimentalFeature dealloc]):
3942         (-[_WKExperimentalFeature description]):
3943         (-[_WKExperimentalFeature name]):
3944         (-[_WKExperimentalFeature key]):
3945         (-[_WKExperimentalFeature details]):
3946         (-[_WKExperimentalFeature _apiObject]):
3947         * UIProcess/API/Cocoa/_WKExperimentalFeatureInternal.h: Implementation of the wrapper.
3948         (WebKit::wrapper):
3949
3950         * UIProcess/WebPreferences.cpp: The C++ implementation that provides the data for the ObjC API.
3951         (WebKit::globalExperimentalFeatures):
3952         (WebKit::WebPreferences::ExperimentalFeatures):
3953         (WebKit::WebPreferences::isEnabledForFeature):
3954         (WebKit::WebPreferences::setEnabledForFeature):
3955         * UIProcess/WebPreferences.h:
3956
3957         * UIProcess/mac/WebPreferencesMac.mm: Update some macros.
3958         (WebKit::WebPreferences::platformInitializeStore):
3959         * WebProcess/WebPage/WebPage.cpp: Ditto
3960         (WebKit::WebPage::updatePreferences):
3961
3962         * WebKit2.xcodeproj/project.pbxproj: Add the new files.
3963
3964 2016-04-18  Tim Horton  <timothy_horton@apple.com>
3965
3966         Swipe view gesture should be reversed in right-to-left contexts
3967         https://bugs.webkit.org/show_bug.cgi?id=156714
3968
3969         Reviewed by Anders Carlsson.
3970
3971         * UIProcess/API/gtk/PageClientImpl.h:
3972         * UIProcess/PageClient.h:
3973         * UIProcess/UserInterfaceLayoutDirection.h: Added.
3974         * UIProcess/WebPageProxy.cpp:
3975         (WebKit::WebPageProxy::userInterfaceLayoutDirection):
3976         * UIProcess/WebPageProxy.h:
3977         * UIProcess/ios/PageClientImplIOS.h:
3978         * UIProcess/ios/PageClientImplIOS.mm:
3979         (WebKit::PageClientImpl::userInterfaceLayoutDirection):
3980         * UIProcess/mac/PageClientImpl.h:
3981         * UIProcess/mac/PageClientImpl.mm:
3982         (WebKit::PageClientImpl::userInterfaceLayoutDirection):
3983         Plumb RTL-ness through to WebPageProxy.
3984         We look at the WK(Web)View's UI layout direction.
3985         For other platforms, we just assume LTR.
3986
3987         * UIProcess/mac/ViewGestureController.h:
3988         * UIProcess/mac/ViewGestureControllerMac.mm:
3989         (WebKit::ViewGestureController::PendingSwipeTracker::scrollEventCanBecomeSwipe):
3990         Decide which way to swipe (and which way to look for back-forward items)
3991         based on the WebPageProxy's reported RTLness.
3992
3993         (WebKit::ViewGestureController::isPhysicallySwipingLeft):
3994         "Back" means "swiping left" in LTR and "swiping right" in RTL.
3995
3996         (WebKit::ViewGestureController::trackSwipeGesture):
3997         (WebKit::ViewGestureController::determineLayerAdjacentToSnapshotForParent):
3998         (WebKit::ViewGestureController::beginSwipeGesture):
3999         (WebKit::ViewGestureController::handleSwipeGesture):
4000         Make things that were equating "back" with "left" instead check isPhysicallySwipingLeft.
4001
4002 2016-04-18  Anders Carlsson  <andersca@apple.com>
4003
4004         Fix build with newer versions of clang.
4005         rdar://problem/25749769
4006
4007         * UIProcess/Cocoa/WebViewImpl.mm:
4008         * UIProcess/mac/WebPageProxyMac.mm:
4009         Forward declare some AppKit IPI.
4010
4011 2016-04-18  Tina Liu  <iting_liu@apple.com>
4012
4013         Implement functions to set plug-in load policies for private browsing mode
4014         https://bugs.webkit.org/show_bug.cgi?id=156540
4015
4016         Reviewed by Anders Carlsson.
4017
4018         This patch implements API and wrappers for clients to set policies to use when using
4019         private browsing. WebPlatformStrategies would return which policies to use depending
4020         on whether the page is in private browsing mode.
4021
4022         * Shared/WebProcessCreationParameters.h:
4023         Add a hash map for plug-in load policies for private browsing.
4024         * Shared/WebProcessCreationParameters.cpp:
4025         (WebKit::WebProcessCreationParameters::encode):
4026         (WebKit::WebProcessCreationParameters::decode):
4027
4028         * UIProcess/API/C/mac/WKContextPrivateMac.h:
4029         * UIProcess/API/C/mac/WKContextPrivateMac.mm:
4030         (WKContextSetPrivateBrowsingPluginLoadClientPolicy):
4031         Add a wrapper.
4032
4033         * UIProcess/WebProcessPool.h:
4034         * UIProcess/WebProcessPool.cpp:
4035         (WebKit::WebProcessPool::createNewWebProcess):
4036         Set the WebProcessCreationParameters's pluginLoadClientPoliciesForPrivateBrowsing.
4037         (WebKit::WebProcessPool::setPluginLoadClientPolicyForBrowsingMode):
4038         A helper function that sets plug-in policies to the corresponding instance variable:
4039         m_pluginLoadClientPolicies for general browsing and m_pluginLoadClientPoliciesForPrivateBrowsing
4040         for private browsing. The logic is extracted from the original setPluginLoadClientPolicy.
4041         While we are here, get rid of the .contains() lookup as .get() will just return a
4042         constructed object if the key is not found.
4043         (WebKit::WebProcessPool::setPluginLoadClientPolicy):
4044         Switch to use the helper function to set policies.
4045         (WebKit::WebProcessPool::setPrivateBrowsingPluginLoadClientPolicy):
4046         Ditto. Also send a message to the WebProcess for setting policies for private browsing.
4047         (WebKit::WebProcessPool::clearPluginClientPolicies):
4048         Clear plug-ins' private browsing policies.
4049
4050         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
4051         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
4052         (WebKit::WebPlatformStrategies::setPluginLoadClientPolicyForBrowsingMode):
4053         Ditto as WebProcessPool::setPluginLoadClientPolicyForBrowsingMode.
4054         (WebKit::WebPlatformStrategies::setPluginLoadClientPolicy):
4055         Switch to use setPluginLoadClientPolicyForBrowsingMode to set policies.
4056         (WebKit::WebPlatformStrategies::setPrivateBrowsingPluginLoadClientPolicy):
4057         Use setPluginLoadClientPolicyForBrowsingMode to set policies for private browsing.
4058         (WebKit::WebPlatformStrategies::clearPluginClientPolicies):
4059         Clear plug-ins' private browsing policies.
4060         (WebKit::WebPlatformStrategies::longestMatchedWildcardHostForHost):
4061         Add an argument for private browsing. Read from the corresponding ivar.
4062         (WebKit::WebPlatformStrategies::replaceHostWithMatchedWildcardHost):
4063         Ditto.
4064         (WebKit::WebPlatformStrategies::pluginLoadClientPolicyForHost): Deleted.
4065         Renamed this function as pluginLoadClientPolicyForHostForBrowsingMode.
4066         (WebKit::WebPlatformStrategies::pluginLoadClientPolicyForHostForBrowsingMode):
4067         Ditto.