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