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