Cannot invoke action menus anymore
[WebKit-https.git] / Source / WebKit2 / ChangeLog
1 2015-03-18  Tim Horton  <timothy_horton@apple.com>
2
3         Cannot invoke action menus anymore
4         https://bugs.webkit.org/show_bug.cgi?id=142797
5         <rdar://problem/20032670>
6
7         * UIProcess/API/mac/WKView.mm:
8         Need one more respondsToSelector check.
9
10 2015-03-18  Chris Dumez  <cdumez@apple.com>
11
12         [WK2] Log the number of network cache requests that we have never seen before
13         https://bugs.webkit.org/show_bug.cgi?id=142828
14         <rdar://problem/19632130>
15
16         Reviewed by Antti Koivisto.
17
18         Log the number of network cache requests that we have never seen before
19         using diagnostic logging.
20
21         * NetworkProcess/cache/NetworkCacheStatisticsCocoa.mm:
22         (WebKit::NetworkCache::Statistics::recordNotUsingCacheForRequest):
23         (WebKit::NetworkCache::Statistics::recordRetrievalFailure):
24
25 2015-03-17  Antti Koivisto  <antti@apple.com>
26
27         Prune least valuable cache entries first
28         https://bugs.webkit.org/show_bug.cgi?id=142810
29         rdar://problem/19632130
30
31         Reviewed by Darin Adler.
32
33         When pruning the cache estimate relative value of each entry using formula
34
35         age = current time - creation time
36         accessAge = last access time - creation time
37         value = accessAge / age
38
39         That is, we value entries that have been accessed recently and survived in the cache longest.
40
41         The most valuable entries don't get deleted at all while the deletion probablity ramps up for
42         lower value entries.
43
44         * NetworkProcess/cache/NetworkCacheFileSystemPosix.h:
45         (WebKit::NetworkCache::fileTimes):
46
47             Get the creation time and access time for a file.
48
49         (WebKit::NetworkCache::updateFileAccessTimeIfNeeded):
50
51             Update access time manually if the file system doesn't do it automatically.
52
53         * NetworkProcess/cache/NetworkCacheIOChannel.h:
54         (WebKit::NetworkCache::IOChannel::path):
55         (WebKit::NetworkCache::IOChannel::type):
56         * NetworkProcess/cache/NetworkCacheIOChannelCocoa.mm:
57         (WebKit::NetworkCache::IOChannel::IOChannel):
58         (WebKit::NetworkCache::IOChannel::open):
59
60             Remember the file path and move most of the work to constructor.
61
62         * NetworkProcess/cache/NetworkCacheStorage.cpp:
63         (WebKit::NetworkCache::Storage::Storage):
64         (WebKit::NetworkCache::Storage::remove):
65         (WebKit::NetworkCache::Storage::updateFileAccessTime):
66         (WebKit::NetworkCache::Storage::dispatchReadOperation):
67         (WebKit::NetworkCache::deletionProbability):
68
69             Compute the probability based on entry age and access time.
70
71         (WebKit::NetworkCache::Storage::shrinkIfNeeded):
72         * NetworkProcess/cache/NetworkCacheStorage.h:
73         (WebKit::NetworkCache::Storage::serialBackgroundIOQueue):
74         (WebKit::NetworkCache::Storage::deleteQueue): Deleted.
75
76             More generic name.
77
78 2015-03-18  Chris Dumez  <cdumez@apple.com>
79
80         [WK2] Log total number of network cache queries using diagnostic logging
81         https://bugs.webkit.org/show_bug.cgi?id=142803
82         <rdar://problem/19632130>
83
84         Reviewed by Antti Koivisto.
85
86         Log total number of network cache queries using diagnostic logging.
87
88         * NetworkProcess/cache/NetworkCache.cpp:
89         (WebKit::NetworkCache::Cache::retrieve):
90         * NetworkProcess/cache/NetworkCacheStatistics.h:
91         * NetworkProcess/cache/NetworkCacheStatisticsCocoa.mm:
92         (WebKit::NetworkCache::Statistics::recordCacheRetrievalRequest):
93
94 2015-03-18  Chris Dumez  <cdumez@apple.com>
95
96         [WK2] We should not even try the network cache for non-HTTP protocol requests
97         https://bugs.webkit.org/show_bug.cgi?id=142802
98         <rdar://problem/19632130>
99
100         Reviewed by Antti Koivisto.
101
102         We should not even try the network cache for non-HTTP protocol requests
103         and the network cache cannot handle those.
104
105         * NetworkProcess/NetworkResourceLoader.cpp:
106         (WebKit::NetworkResourceLoader::start):
107         * NetworkProcess/cache/NetworkCache.cpp:
108         (WebKit::NetworkCache::canRetrieve):
109         (WebKit::NetworkCache::Cache::retrieve):
110         * NetworkProcess/cache/NetworkCache.h:
111         * NetworkProcess/cache/NetworkCacheStatisticsCocoa.mm:
112         (WebKit::NetworkCache::retrieveDecisionToDiagnosticKey):
113
114 2015-03-17  Conrad Shultz  <conrad_shultz@apple.com>
115
116         Ignore some deprecation warnings
117         https://bugs.webkit.org/show_bug.cgi?id=142813
118
119         Reviewed by Mark Rowe.
120
121         Fixing the deprecations is tracked by: <rdar://problem/20201450>
122
123         * UIProcess/mac/WebPopupMenuProxyMac.mm:
124         (WebKit::WebPopupMenuProxyMac::populate):
125
126 2015-03-17  Ryuan Choi  <ryuan.choi@navercorp.com>
127
128         [EFL] Expose JavaScript binding interface through ewk_extension
129         https://bugs.webkit.org/show_bug.cgi?id=142033
130
131         Reviewed by Gyuyoung Kim.
132
133         * PlatformEfl.cmake:
134         * UIProcess/API/efl/tests/extensions/extension_sample.cpp: Registered test object for new test case.
135         * UIProcess/API/efl/tests/test_ewk2_javascript_binding.cpp: Added simple binding API test case.
136         (EWK2ContextTestWithExtension::messageReceivedCallback):
137         (EWK2ContextTestWithExtension::EWK2ContextTestWithExtension):
138         (TEST_F):
139         * WebProcess/InjectedBundle/API/efl/EWebKit_Extension.h:
140         * WebProcess/InjectedBundle/API/efl/ewk_extension.cpp:
141         (EwkExtension::didCreatePage):
142         (EwkExtension::willDestroyPage):
143         * WebProcess/InjectedBundle/API/efl/ewk_extension.h:
144         * WebProcess/InjectedBundle/API/efl/ewk_extension_private.h:
145         * WebProcess/InjectedBundle/API/efl/ewk_page.cpp: Added.
146         (toEwkPage):
147         (EwkPage::EwkPage):
148         (EwkPage::append):
149         (EwkPage::remove):
150         (EwkPage::didFinishDocumentLoadForFrame):
151         (ewk_page_js_global_context_get):
152         (ewk_page_client_register):
153         (ewk_page_client_unregister):
154         * WebProcess/InjectedBundle/API/efl/ewk_page.h: Added.
155         * WebProcess/InjectedBundle/API/efl/ewk_page_private.h: Added.
156         (EwkPage::page):
157         * efl/ewebkit2-extension.pc.in:
158
159 2015-03-17  Tim Horton  <timothy_horton@apple.com>
160
161         Cannot invoke action menus anymore
162         https://bugs.webkit.org/show_bug.cgi?id=142797
163         <rdar://problem/20032670>
164
165         * UIProcess/API/mac/WKView.mm:
166         Need a respondsToSelector check.
167
168 2015-03-17  Tim Horton  <timothy_horton@apple.com>
169
170         Cannot invoke action menus anymore
171         https://bugs.webkit.org/show_bug.cgi?id=142797
172         <rdar://problem/20032670>
173
174         Reviewed by Beth Dakin.
175
176         * UIProcess/API/mac/WKView.mm:
177         Don't process mouse events that would make an action menu; call super
178         and let AppKit take care of it. We have to duplicate the macro so that
179         we can avoid calling super for the internal-only methods.
180         Also, otherMouseMoved is simply not a thing, so remove it.
181
182 2015-03-17  Beth Dakin  <bdakin@apple.com>
183
184         DOM mouse events have weird timing for force clickable elements in Safari 8.0.3 on 
185         10.10.2
186         https://bugs.webkit.org/show_bug.cgi?id=142700
187         -and corresponding-
188         rdar://problem/20165168
189
190         Reviewed by Tim Horton.
191
192         No need to tell the WKImmediateActionController about mouse down any more since we 
193         are expecting it at the beginning of an immediate action interaction.
194         * UIProcess/API/mac/WKView.mm:
195         (-[WKView mouseDown:]):
196
197         Set the delaysPrimaryMouseButtonEvents to NO for the 
198         _immediateActionGestureRecognizer. This will cause AppKit to send up the mouse 
199         events at the expected time.
200         (-[WKView initWithFrame:processPool:configuration:webView:]):
201
202         WebCore::EventHandler now needs to know if an immediate action cancelled or 
203         completed. This plumbs that information down.
204         * UIProcess/WebPageProxy.cpp:
205         (WebKit::WebPageProxy::immediateActionDidCancel):
206         (WebKit::WebPageProxy::immediateActionDidComplete):
207         * UIProcess/WebPageProxy.h:
208         * UIProcess/mac/WKImmediateActionController.h:
209         * UIProcess/mac/WKImmediateActionController.mm:
210         (-[WKImmediateActionController immediateActionRecognizerDidCancelAnimation:]):
211         (-[WKImmediateActionController immediateActionRecognizerDidCompleteAnimation:]):
212         (-[WKImmediateActionController wkView:willHandleMouseDown:]): Deleted.
213         * WebProcess/WebPage/WebPage.h:
214         * WebProcess/WebPage/WebPage.messages.in:
215
216         Call EventHandler::setImmediateActionStage() with the appropriate stage.
217         * WebProcess/WebPage/mac/WebPageMac.mm:
218         (WebKit::WebPage::performActionMenuHitTestAtLocation):
219         (WebKit::WebPage::immediateActionDidCancel):
220         (WebKit::WebPage::immediateActionDidComplete):
221
222 2015-03-17  Timothy Horton  <timothy_horton@apple.com>
223
224         Reproducible null deref under ScriptedAnimationController::createDisplayRefreshMonitor
225         https://bugs.webkit.org/show_bug.cgi?id=142776
226         <rdar://problem/18921338>
227
228         Reviewed by Alexey Proskuryakov.
229
230         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
231         (WebKit::WebChromeClient::createDisplayRefreshMonitor):
232         * WebProcess/WebCoreSupport/WebChromeClient.h:
233         Adjust to the new signature.
234
235 2015-03-17  Antti Koivisto  <antti@apple.com>
236
237         Disk cache should support Vary: Cookie
238         https://bugs.webkit.org/show_bug.cgi?id=142770
239         rdar://problem/19764945
240
241         Reviewed by Anders Carlsson.
242
243         Cookies are not part of the original request but are added by the networking layer when submitting the request.
244         Fetch them explicitly when resolving Vary: Cookie.
245
246         The implementation is not perfect as it fetches the cookie for the cache entry when saving a Vary:Cookie response,
247         not when making the request. In principle the cookie may have changed in-between. This should be enough to handle
248         reasonable cases though. Fetching cookies for every request might be too expensive for this rarely used feature.
249
250         * NetworkProcess/cache/NetworkCache.cpp:
251         (WebKit::NetworkCache::headerValueForVary):
252         (WebKit::NetworkCache::encodeStorageEntry):
253         (WebKit::NetworkCache::verifyVaryingRequestHeaders):
254
255 2015-03-17  Zan Dobersek  <zdobersek@igalia.com>
256
257         [WK2] Use C++ lambdas in IPC::Connection
258         https://bugs.webkit.org/show_bug.cgi?id=138018
259
260         Reviewed by Anders Carlsson.
261
262         Replace uses of WTF::bind() in the IPC::Connection class with C++ lambdas.
263
264         * Platform/IPC/Connection.cpp:
265         (IPC::Connection::dispatchWorkQueueMessageReceiverMessage):
266         (IPC::Connection::invalidate):
267         (IPC::Connection::sendMessage):
268         (IPC::Connection::processIncomingMessage): Simplify the error messages so we
269         don't have to format strings on-the-fly, removing the issues of cross-thread
270         string copying altogether.
271         (IPC::Connection::dispatchDidReceiveInvalidMessage): The parameters are now
272         of the StringReference type.
273         (IPC::Connection::enqueueIncomingMessage):
274         * Platform/IPC/Connection.h:
275         * Platform/IPC/mac/ConnectionMac.mm:
276         (IPC::Connection::receiveSourceEventHandler):
277         * Platform/IPC/unix/ConnectionUnix.cpp:
278         (IPC::Connection::open):
279
280 2015-03-17  Zan Dobersek  <zdobersek@igalia.com>
281
282         [CMake] Use a forwarding header for ANGLE's ShaderLang.h to avoid picking up ANGLE's EGL headers
283         https://bugs.webkit.org/show_bug.cgi?id=142530
284
285         Reviewed by Darin Adler.
286
287         * CMakeLists.txt: Replace the Source/ThirdParty/ANGLE/include/GLSLANG entry
288         in the list of inclusion directories for WebKit2 with Source/ThirdParty/ANGLE,
289         possible due to the new forwarding header for ANGLE's ShaderLang.h.
290
291 2015-03-17  Gwang Yoon Hwang  <yoon@igalia.com>
292
293         REGRESSION(r180924): Unable to build WebKitGTK+ with threaded compositor
294
295         Unreviewed build fix.
296
297         * WebProcess/WebPage/LayerTreeHost.h:
298         Remove duplicated declaration of setNativeSurfaceHandleForCompositing.
299
300 2015-03-16  Ryosuke Niwa  <rniwa@webkit.org>
301
302         Enable ES6 classes by default
303         https://bugs.webkit.org/show_bug.cgi?id=142774
304
305         Reviewed by Gavin Barraclough.
306
307         * Configurations/FeatureDefines.xcconfig:
308
309 2015-03-16  Conrad Shultz  <conrad_shultz@apple.com>
310
311         Don't pass nil as a fireDate for NSTimer
312         https://bugs.webkit.org/show_bug.cgi?id=142765
313
314         Reviewed by Dan Bernstein.
315
316         While we're here, switch to a selector that conforms to documented NSTimer API.
317
318         * UIProcess/mac/WKFullScreenWindowController.mm:
319         (-[WKFullScreenWindowController cancelOperation:]):
320         Set the timer's fireDate as the future date matching the former interval; update the selector.
321         (-[WKFullScreenWindowController _watchdogTimerFired:]):
322         Timer callback; wrap -exitFullScreen.
323
324 2015-03-16  Alex Christensen  <achristensen@webkit.org>
325
326         Progress towards CMake on Mac
327         https://bugs.webkit.org/show_bug.cgi?id=142747
328
329         Reviewed by Chris Dumez.
330
331         * PlatformMac.cmake:
332         Started adding Mac-specific directories and headers.
333
334 2015-03-16  Alexey Proskuryakov  <ap@apple.com>
335
336         ASSERT(m_plugin) on plugins/snapshotting/snapshot-plugin-not-quite-blocked-by-image.html
337         https://bugs.webkit.org/show_bug.cgi?id=142637
338
339         Reviewed by Dean Jackson.
340
341         * WebProcess/Plugins/PluginView.cpp: (WebKit::PluginView::pluginSnapshotTimerFired):
342         m_plugin can be legitimately null.
343
344 2015-03-16  Csaba Osztrogonác  <ossy@webkit.org>
345
346         One more URTBF after r181578.
347
348         * WebProcess/WebPage/WebPage.cpp:
349         (WebKit::WebPage::updatePreferences):
350
351 2015-03-16  Csaba Osztrogonác  <ossy@webkit.org>
352
353         URTBF after r181578.
354
355         * WebProcess/InjectedBundle/InjectedBundle.cpp:
356         (WebKit::InjectedBundle::setCSSAnimationTriggersEnabled): Copy/paste error fixed.
357
358 2015-03-16  Dean Jackson  <dino@apple.com>
359
360         Expose WK2 preference for Animation Triggers runtime flag
361         https://bugs.webkit.org/show_bug.cgi?id=142744
362
363         Reviewed by Anders Carlsson.
364
365         Expose CSSAnimationTriggersEnabled, linking it to the runtime enabled
366         feature flag.
367
368         * Shared/WebPreferencesDefinitions.h:
369         * UIProcess/API/C/WKPreferences.cpp:
370         (WKPreferencesSetCSSAnimationTriggersEnabled):
371         (WKPreferencesGetCSSAnimationTriggersEnabled):
372         * UIProcess/API/C/WKPreferencesRefPrivate.h:
373         * WebProcess/InjectedBundle/InjectedBundle.cpp:
374         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
375         (WebKit::InjectedBundle::setCSSAnimationTriggersEnabled):
376         * WebProcess/InjectedBundle/InjectedBundle.h:
377         * WebProcess/WebPage/WebPage.cpp:
378         (WebKit::WebPage::updatePreferences):
379
380 2015-03-16  Conrad Shultz  <conrad_shultz@apple.com>
381
382         Allow clients to selectively disable plug-ins
383         https://bugs.webkit.org/show_bug.cgi?id=142506
384
385         Reviewed by Anders Carlsson.
386
387         Add new functionality allow clients to declaratively disable individual plug-ins (in a manner that conceals them
388         from the page). As part of this:
389
390         1) Introduce the concept of web-visible plug-ins and related concepts, as distinct from the real underlying
391            set of plug-ins.
392
393         2) Where applicable, plumb additional information about plug-ins (specifically, bundle identification) deeper
394            down the stack.
395
396         3) Add generic functionality to PluginStrategy to support filtering plug-ins for visibility and introduce
397            a concrete implementation thereof in WebPlatformStrategies in WebKit2.
398
399         4) Add messaging infrastructure to allow clients to set and clear plug-in policies.
400
401         While currently only used in a very limited manner, the new declarative plug-in policies are written generically
402         so that they could be easily used in the future to reduce synchronous messaging to the client when loading plug-ins.
403
404         * Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm:
405         (WebKit::NetscapePluginModule::getPluginInfo):
406         Set new PluginInfo members.
407
408         * Shared/WebCoreArgumentCoders.cpp:
409         (IPC::ArgumentCoder<PluginInfo>::encode):
410         Handle new PluginInfo members.
411         (IPC::ArgumentCoder<PluginInfo>::decode):
412         Ditto.
413
414         * Shared/WebProcessCreationParameters.h:
415         Declare a member to store client plug-in policies.
416
417         * Shared/WebProcessCreationParameters.cpp:
418         (WebKit::WebProcessCreationParameters::encode):
419         Encode the policies.
420         (WebKit::WebProcessCreationParameters::decode):
421         Decode the policies.
422
423         * UIProcess/API/C/WKAPICast.h:
424         (WebKit::toWKPluginLoadClientPolicy):
425         Teach how to cast between WebCore and WebKit2 policy definitions.
426         (WebKit::toPluginLoadClientPolicy):
427         Ditto.
428
429         * UIProcess/API/C/WKPluginLoadPolicy.h:
430         Declare WKPluginLoadClientPolicy, matching PluginLoadClientPolicy in WebCore.
431
432         * UIProcess/API/C/mac/WKContextPrivateMac.h:
433         * UIProcess/API/C/mac/WKContextPrivateMac.mm:
434         (WKContextSetPluginLoadClientPolicy):
435         New function; wrap WebProcessPool::setPluginLoadClientPolicy().
436         (WKContextClearPluginClientPolicies):
437         New function; wrap WebProcessPool::clearPluginClientPolicies().
438
439         * UIProcess/WebProcessPool.h:
440         * UIProcess/WebProcessPool.cpp:
441         (WebKit::WebProcessPool::createNewWebProcess):
442         Copy any client plug-in policies to the new process' creation parameters.
443         (WebKit::WebProcessPool::setPluginLoadClientPolicy):
444         Send SetPluginLoadClientPolicy to all processes and stash the passed-in policy info.
445         (WebKit::WebProcessPool::clearPluginClientPolicies):
446         Send ClearPluginClientPolicies to all processes and clear any stashed policy info.
447
448         * WebProcess/Plugins/PDF/PDFPlugin.mm:
449         (WebKit::PDFPlugin::pluginInfo):
450         Set new PluginInfo member.
451
452         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
453         (WebKit::pluginSupportsExtension):
454         Adopt getWebVisibleMimesAndPluginIndices().
455         (WebKit::WebFrameLoaderClient::objectContentType):
456         Update to reflect reflect function rename.
457
458         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
459         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
460         (WebKit::WebPlatformStrategies::getPluginInfo):
461         Pass the Page to populatePluginCache().
462         (WebKit::WebPlatformStrategies::getWebVisiblePluginInfo):
463         New member function; wrap getPluginInfo(); if appropriate, filter out plug-ins the client has asked
464         to block on the current page.
465         (WebKit::WebPlatformStrategies::setPluginLoadClientPolicy):
466         New member function; map empty inputs to a wildcard character and insert the new policy into the nested map.
467         (WebKit::WebPlatformStrategies::clearPluginClientPolicies):
468         New member function; empty m_hostsToPluginIdentifierData.
469         (WebKit::WebPlatformStrategies::pluginLoadClientPolicyForHost):
470         New member function; look up the most specific policy for the given plug-in and host.
471         (WebKit::WebPlatformStrategies::populatePluginCache):
472         If appropriate, set the client load policy on the plug-ins; do this irrespective of whether the cache has
473         been populated since the Page, and therefore host, may change.
474
475         * WebProcess/WebPage/WebPage.cpp:
476         (WebKit::WebPage::canShowMIMEType):
477         Update to reflect function rename.
478
479         * WebProcess/WebProcess.h:
480         * WebProcess/WebProcess.cpp:
481         (WebKit::WebProcess::initializeWebProcess):
482         Enumerate and process the client plug-in policies in the creation parameters.
483         (WebKit::WebProcess::setPluginLoadClientPolicy):
484         New member function; wrap PluginStrategy::setPluginLoadClientPolicy.
485         (WebKit::WebProcess::clearPluginClientPolicies):
486         New member function; wrap PluginStrategy::clearPluginClientPolicies().
487
488         * WebProcess/WebProcess.messages.in:
489         Add messages for setting and clearing policies.
490
491 2015-03-16  Carlos Garcia Campos  <cgarcia@igalia.com>
492
493         Unreviewed. Add new Notification classes to GTK+ API documentation.
494
495         Add WebKitNotification and WebKitNotificationPermissionRequest to
496         the documentation and fix some other typos causing warnings when
497         generating HTML documentation.
498
499         * UIProcess/API/gtk/WebKitUserContent.cpp:
500         * UIProcess/API/gtk/WebKitWebView.cpp:
501         (webkit_web_view_class_init):
502         * UIProcess/API/gtk/docs/webkit2gtk-docs.sgml:
503
504 2015-03-16  Przemyslaw Piorkowski  <p.piorkowski@samsung.com>
505
506         [EFL][WK2] REGRESSION(r178526): test_ewk2_storage_manager has been failed for a long time
507         https://bugs.webkit.org/show_bug.cgi?id=141249
508
509         Reviewed by Gyuyoung Kim.
510
511         * PlatformEfl.cmake: Enable test_ewk2_storage_manager for EFL port - it is passing now.
512
513 2015-03-16  David Kilzer  <ddkilzer@apple.com>
514
515         [iOS] REGRESSION (r181511): Most layout tests crash with a NULL deref
516
517         Follow-up fix for:
518         [iOS] Presenting a modal sheet on top of a WKWebView causes it to lose focused, active state
519         <http://webkit.org/b/142702>
520
521         * UIProcess/ios/PageClientImplIOS.mm:
522         (WebKit::PageClientImpl::isViewWindowActive): Add NULL check for m_webView.
523         (WebKit::PageClientImpl::isViewFocused): Ditto.
524
525 2015-03-15  Simon Fraser  <simon.fraser@apple.com>
526
527         Clean up related to wheelEvent names
528         https://bugs.webkit.org/show_bug.cgi?id=142713
529
530         Reviewed by Anders Carlsson.
531
532         Add EventNames::isWheelEventType() and use it in places that test for the
533         two wheel event names.
534
535         * WebProcess/Plugins/PluginView.cpp:
536         (WebKit::PluginView::handleEvent):
537
538 2015-03-15  Dan Bernstein  <mitz@apple.com>
539
540         [iOS] Presenting a modal sheet on top of a WKWebView causes it to lose focused, active state
541         https://bugs.webkit.org/show_bug.cgi?id=142702
542
543         Reviewed by Anders Carlsson.
544
545         * UIProcess/API/Cocoa/WKWebView.mm:
546         (-[WKWebView becomeFirstResponder]): Override to delegate first responder status to the
547         WKContentView if possible.
548         (-[WKWebView _retainActiveFocusedState]): New SPI that prevents view hierarchy changes from
549         affecting the active and focused state of the view. Increments a counter ivar and returns a
550         completion block (which callers must call when they’re done) that decrements it back.
551         * UIProcess/API/Cocoa/WKWebViewInternal.h: Declared new _activeFocusedStateRetainCount ivar
552         with @package access.
553         * UIProcess/API/Cocoa/WKWebViewPrivate.h: Declared new method.
554
555         * UIProcess/ios/PageClientImplIOS.mm:
556         (WebKit::PageClientImpl::isViewWindowActive): Return true if active/focused state is to be
557         maintained despite not being visible.
558         (WebKit::PageClientImpl::isViewFocused): Return true if active/focused state is to be
559         maintained despite not being active.
560
561         * UIProcess/ios/WKContentViewInteraction.mm:
562         (-[WKContentView resignFirstResponder]): Don’t blur the assisted node if active/focused
563         state is to be maintained.
564
565 2015-03-14  Simon Fraser  <simon.fraser@apple.com>
566
567         Clean up use of flags in localToContainer-type functions
568         https://bugs.webkit.org/show_bug.cgi?id=142704
569
570         Reviewed by Alexey Proskuryakov.
571         
572         Pass UseTransforms explicitly to localToContainerPoint()
573
574         * WebProcess/WebPage/ios/WebPageIOS.mm:
575         (WebKit::WebPage::getAssistedNodeInformation):
576
577 2015-03-14  Brent Fulgham  <bfulgham@apple.com>
578
579         [iOS] scroll snap points are animating to the wrong positions.
580         https://bugs.webkit.org/show_bug.cgi?id=142705
581         <rdar://problem/20136946>
582
583         Reviewed by Simon Fraser.
584
585         Scroll snapping was landing in the wrong place on iOS because of two problems:
586         (1) It was searching for the closest snap offset point using unscaled 'screen' pixels,
587         which caused it to always choose one of the earliest snap point options.
588         (2) It was then selecting a scaled snap point coordinate and passing it back to UIKit
589         to animate the snap. This caused it to select a target point beyond the 'screen' pixel
590         we want to hit.
591         
592         The solution to both problems are to scale the scroll destination UIKit suggests so that
593         we search among the scaled points with a valid value. Then, we need to scale the returned
594         value back to screen units before handing it back to UIKit to process.
595
596         * UIProcess/API/Cocoa/WKWebView.mm:
597         (-[WKWebView scrollViewWillBeginDragging:]): Drive-by fix. Get rid of extra ';' at
598         the end of the line.
599         * UIProcess/ios/RemoteScrollingCoordinatorProxyIOS.mm:
600         (WebKit::RemoteScrollingCoordinatorProxy::closestSnapOffsetForMainFrameScrolling):
601
602 2015-03-14  Dean Jackson  <dino@apple.com>
603
604         Feature flag for Animations Level 2
605         https://bugs.webkit.org/show_bug.cgi?id=142699
606         <rdar://problem/20165097>
607
608         Reviewed by Brent Fulgham.
609
610         Add ENABLE_CSS_ANIMATIONS_LEVEL_2 and a runtime flag animationTriggersEnabled.
611
612         * Configurations/FeatureDefines.xcconfig:
613
614 2015-03-14  Víctor Manuel Jáquez Leal  <vjaquez@igalia.com>
615
616         [GStreamer] share GL context in pipeline
617         https://bugs.webkit.org/show_bug.cgi?id=142693
618
619         Reviewed by Philippe Normand.
620
621         * WebProcess/gtk/WebProcessMainGtk.cpp: Enable XInitThreads() if
622         GSTREAMER_GL is used, since GstGL elements use another thread for
623         queuing GL operations.
624
625 2015-03-13  Alex Christensen  <achristensen@webkit.org>
626
627         Progress towards CMake on Mac.
628         https://bugs.webkit.org/show_bug.cgi?id=142680
629
630         Reviewed by Gyuyoung Kim.
631
632         * PlatformMac.cmake: Added.
633
634 2015-03-13  Commit Queue  <commit-queue@webkit.org>
635
636         Unreviewed, rolling out r181483.
637         https://bugs.webkit.org/show_bug.cgi?id=142688
638
639         Caused use-after-free on many tests (Requested by ap on
640         #webkit).
641
642         Reverted changeset:
643
644         "Allow clients to selectively disable plug-ins"
645         https://bugs.webkit.org/show_bug.cgi?id=142506
646         http://trac.webkit.org/changeset/181483
647
648 2015-03-13  Eric Carlson  <eric.carlson@apple.com>
649
650         [Mac] Enable WIRELESS_PLAYBACK_TARGET
651         https://bugs.webkit.org/show_bug.cgi?id=142635
652
653         Reviewed by Darin Adler.
654
655         * Configurations/FeatureDefines.xcconfig:
656
657 2015-03-13  Timothy Horton  <timothy_horton@apple.com>
658
659         Sites that use a device-width viewport but don't have enough height to fill the view are scaled up
660         https://bugs.webkit.org/show_bug.cgi?id=142664
661         <rdar://problem/18859470>
662
663         Reviewed by Benjamin Poulain.
664
665         * UIProcess/ios/WKScrollView.mm:
666         (-[WKScrollView _rubberBandOffsetForOffset:maxOffset:minOffset:range:outside:]):
667         Now that the WKContentView can (without pinching) be smaller than the unobscured
668         region of the WKWebView, we need to take that into account when deciding where
669         to retarget scrolling.
670
671 2015-03-13  Mark Lam  <mark.lam@apple.com>
672
673         Replace TCSpinLock with a new WTF::SpinLock based on WTF::Atomic.
674         <https://webkit.org/b/142674>
675
676         Reviewed by Filip Pizlo.
677
678         * WebProcess/WebPage/EventDispatcher.cpp:
679         (WebKit::EventDispatcher::EventDispatcher):
680         * WebProcess/WebPage/EventDispatcher.h:
681         * WebProcess/WebPage/ViewUpdateDispatcher.cpp:
682         (WebKit::ViewUpdateDispatcher::ViewUpdateDispatcher):
683         * WebProcess/WebPage/ViewUpdateDispatcher.h:
684
685 2015-03-10  Conrad Shultz  <conrad_shultz@apple.com>
686
687         Allow clients to selectively disable plug-ins
688         https://bugs.webkit.org/show_bug.cgi?id=142506
689
690         Reviewed by Anders Carlsson.
691
692         Add new functionality allow clients to declaratively disable individual plug-ins (in a manner that conceals them
693         from the page). As part of this:
694
695         1) Introduce the concept of web-visible plug-ins and related concepts, as distinct from the real underlying
696            set of plug-ins.
697
698         2) Where applicable, plumb additional information about plug-ins (specifically, bundle identification) deeper
699            down the stack.
700
701         3) Add generic functionality to PluginStrategy to support filtering plug-ins for visibility and introduce
702            a concrete implementation thereof in WebPlatformStrategies in WebKit2.
703
704         4) Add messaging infrastructure to allow clients to set and clear plug-in policies.
705
706         While currently only used in a very limited manner, the new declarative plug-in policies are written generically
707         so that they could be easily used in the future to reduce synchronous messaging to the client when loading plug-ins.
708
709         * Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm:
710         (WebKit::NetscapePluginModule::getPluginInfo):
711         Set new PluginInfo members.
712
713         * Shared/WebCoreArgumentCoders.cpp:
714         (IPC::ArgumentCoder<PluginInfo>::encode):
715         Handle new PluginInfo members.
716         (IPC::ArgumentCoder<PluginInfo>::decode):
717         Ditto.
718
719         * Shared/WebProcessCreationParameters.h:
720         Declare a member to store client plug-in policies.
721
722         * Shared/WebProcessCreationParameters.cpp:
723         (WebKit::WebProcessCreationParameters::encode):
724         Encode the policies.
725         (WebKit::WebProcessCreationParameters::decode):
726         Decode the policies.
727
728         * UIProcess/API/C/WKAPICast.h:
729         (WebKit::toWKPluginLoadClientPolicy):
730         Teach how to cast between WebCore and WebKit2 policy definitions.
731         (WebKit::toPluginLoadClientPolicy):
732         Ditto.
733
734         * UIProcess/API/C/WKPluginLoadPolicy.h:
735         Declare WKPluginLoadClientPolicy, matching PluginLoadClientPolicy in WebCore.
736
737         * UIProcess/API/C/mac/WKContextPrivateMac.h:
738         * UIProcess/API/C/mac/WKContextPrivateMac.mm:
739         (WKContextSetPluginLoadClientPolicy):
740         New function; wrap WebProcessPool::setPluginLoadClientPolicy().
741         (WKContextClearPluginClientPolicies):
742         New function; wrap WebProcessPool::clearPluginClientPolicies().
743
744         * UIProcess/WebProcessPool.h:
745         * UIProcess/WebProcessPool.cpp:
746         (WebKit::WebProcessPool::createNewWebProcess):
747         Copy any client plug-in policies to the new process' creation parameters.
748         (WebKit::WebProcessPool::setPluginLoadClientPolicy):
749         Send SetPluginLoadClientPolicy to all processes and stash the passed-in policy info.
750         (WebKit::WebProcessPool::clearPluginClientPolicies):
751         Send ClearPluginClientPolicies to all processes and clear any stashed policy info.
752
753         * WebProcess/Plugins/PDF/PDFPlugin.mm:
754         (WebKit::PDFPlugin::pluginInfo):
755         Set new PluginInfo member.
756
757         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
758         (WebKit::pluginSupportsExtension):
759         Adopt getWebVisibleMimesAndPluginIndices().
760         (WebKit::WebFrameLoaderClient::objectContentType):
761         Update to reflect reflect function rename.
762
763         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
764         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
765         (WebKit::WebPlatformStrategies::getPluginInfo):
766         Pass the Page to populatePluginCache().
767         (WebKit::WebPlatformStrategies::getWebVisiblePluginInfo):
768         New member function; wrap getPluginInfo(); if appropriate, filter out plug-ins the client has asked
769         to block on the current page.
770         (WebKit::WebPlatformStrategies::setPluginLoadClientPolicy):
771         New member function; map empty inputs to a wildcard character and insert the new policy into the nested map.
772         (WebKit::WebPlatformStrategies::clearPluginClientPolicies):
773         New member function; empty m_hostsToPluginIdentifierData.
774         (WebKit::WebPlatformStrategies::pluginLoadClientPolicyForHost):
775         New member function; look up the most specific policy for the given plug-in and host.
776         (WebKit::WebPlatformStrategies::populatePluginCache):
777         If appropriate, set the client load policy on the plug-ins; do this irrespective of whether the cache has
778         been populated since the Page, and therefore host, may change.
779
780         * WebProcess/WebPage/WebPage.cpp:
781         (WebKit::WebPage::canShowMIMEType):
782         Update to reflect function rename.
783
784         * WebProcess/WebProcess.h:
785         * WebProcess/WebProcess.cpp:
786         (WebKit::WebProcess::initializeWebProcess):
787         Enumerate and process the client plug-in policies in the creation parameters.
788         (WebKit::WebProcess::setPluginLoadClientPolicy):
789         New member function; wrap PluginStrategy::setPluginLoadClientPolicy.
790         (WebKit::WebProcess::clearPluginClientPolicies):
791         New member function; wrap PluginStrategy::clearPluginClientPolicies().
792
793         * WebProcess/WebProcess.messages.in:
794         Add messages for setting and clearing policies.
795
796 2015-03-12  Jon Honeycutt  <jhoneycutt@apple.com>
797
798         Use UIDocumentMenuViewController to allow selection of files from
799         iCloud Drive in WKFileUploadPanel
800
801         Part of <https://bugs.webkit.org/show_bug.cgi?id=142596> WebKit on
802         iOS should support file upload from iCloud Drive
803         <rdar://problem/12178991>
804
805         Reviewed by Andy Estes.
806
807         * Platform/spi/ios/UIKitSPI.h:
808         Include UIDocumentMenuViewController_Private.h if it exists. If not,
809         declare this new SPI.
810
811         * UIProcess/ios/forms/WKFileUploadPanel.mm:
812         (fallbackIconForFile):
813         Create a UIDocumentInteractionController for the file, and return a
814         thumbnail image from its smallest icon.
815
816         (iconForImageFile):
817         If we can get a UIImage from the file, create a thumbnail from it.
818         Otherwise, call fallbackIconForFile().
819
820         (iconForVideoFile):
821         Code moved from -[_WKVideoFileUploadItem displayImage].
822
823         (iconForFile):
824         Get the file's extension, and get the extension's preferred UTI. If the
825         UTI is an image type, call iconForImageFile(). If it's a video type,
826         call iconForVideoFile(). Otherwise, return the fallback icon.
827
828         (-[_WKFileUploadItem initWithFileURL:]):
829         Added an initializer that takes a file URL.
830
831         (-[_WKFileUploadItem fileURL]):
832         (-[_WKImageFileUploadItem initWithFileURL:originalImage:]):
833         (-[_WKVideoFileUploadItem displayImage]):
834         (WKFileUploadPanel):
835         Inherit from UIDocumentPickerDelegate and UIDocumentMenuDelegate. Add
836         an ivar for the document menu controller.
837
838         (-[WKFileUploadPanel dealloc]):
839         (-[WKFileUploadPanel presentWithParameters:resultListener:]):
840         If instances of UIDocumentMenuViewController respond to
841         -_setIgnoreApplicationEntitlementForImport:, meaning we can disable the
842         assertion that the current app has the iCloud Documents entitlement,
843         then show the document picker menu. Otherwise, show the current source
844         selection UI. The runtime check will be removed when a newer UIKit is
845         available.
846
847         (UTIsForMIMETypes):
848         Return the UTIs for the <input> element's "accept" attribute's MIME
849         type list.
850
851         (-[WKFileUploadPanel _mediaTypesForPickerSourceType:]):
852         Call UTIsForMIMETypes(). Fall back to available source types for this
853         picker type.
854
855         (-[WKFileUploadPanel _documentPickerMenuMediaTypes]):
856         Call UTIsForMIMETypes(). Fall back to the all-encompassing
857         "public.item" UTI.
858
859         (-[WKFileUploadPanel _photoLibraryButtonLabel]):
860         (-[WKFileUploadPanel _cameraButtonLabel]):
861         Factored out of -_showMediaSourceSelectionSheet. Return the
862         appropriate label for the camera button, based on whether it can take a
863         photo or video, or return nil if the camera is not available.
864
865         (-[WKFileUploadPanel _showMediaSourceSelectionSheet]):
866         Changed to use -_cameraButtonLabel and
867         -_presentForCurrentInterfaceIdiom:.
868
869         (-[WKFileUploadPanel _showDocumentPickerMenu]):
870         Create a UIDocumentMenuViewController, and populate it with options to
871         open the photo library or take a picture or video. If iCloud Drive or
872         other document sources are available, they will be added automatically.
873
874         (-[WKFileUploadPanel _presentForCurrentInterfaceIdiom:]):
875         (-[WKFileUploadPanel documentMenu:didPickDocumentPicker:]):
876         (-[WKFileUploadPanel documentMenuWasCancelled:]):
877         (-[WKFileUploadPanel documentPicker:didPickDocumentAtURL:]):
878         (-[WKFileUploadPanel documentPickerWasCancelled:]):
879         (-[WKFileUploadPanel _uploadItemFromMediaInfo:successBlock:failureBlock:]):
880
881         (-[_WKImageFileUploadItem initWithFilePath:originalImage:]): Deleted.
882         (-[_WKImageFileUploadItem fileURL]): Deleted.
883         (-[_WKVideoFileUploadItem initWithFilePath:mediaURL:]): Deleted.
884         (-[_WKVideoFileUploadItem fileURL]): Deleted.
885
886 2015-03-11  Enrica Casucci  <enrica@apple.com>
887
888         Adopt new API for keyboard event handling.
889         https://bugs.webkit.org/show_bug.cgi?id=142602
890         rdar://problem/19966087
891
892         Reviewed by Sam Weinig.
893
894         Adopts the new API.
895
896         * UIProcess/ios/WKContentViewInteraction.mm:
897         (-[WKContentView _didHandleKeyEvent:]):
898
899 2015-03-12  Alexey Proskuryakov  <ap@apple.com>
900
901         testRunner.setAlwaysAcceptCookies does not work with NetworkProcess
902         https://bugs.webkit.org/show_bug.cgi?id=138687
903
904         Reviewed by Carlos Garcia Campos.
905
906         * UIProcess/WebCookieManagerProxy.cpp:
907         (WebKit::WebCookieManagerProxy::setHTTPCookieAcceptPolicy): Don't change system-wide
908         cookie accept policy when in testing mode. Also, update the policy in WebProcesses too,
909         as we still do some networking there.
910
911         * UIProcess/WebProcessPool.h:
912         * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
913         (WKBundleSetAlwaysAcceptCookies): Deleted.
914         * WebProcess/InjectedBundle/API/c/WKBundlePrivate.h:
915         * WebProcess/InjectedBundle/InjectedBundle.cpp:
916         (WebKit::InjectedBundle::setAlwaysAcceptCookies): Deleted.
917         * WebProcess/InjectedBundle/InjectedBundle.h:
918         Remove WKBundleSetAlwaysAcceptCookies SPI, as WKTR now uses an API in UI process.
919
920 2015-03-12  Anders Carlsson  <andersca@apple.com>
921
922         WKErrorDomain should be declared nonnull
923         https://bugs.webkit.org/show_bug.cgi?id=142628
924
925         Reviewed by Antti Koivisto.
926
927         Add WK_ASSUME_NONNULL_BEGIN and WK_ASSUME_NONNULL_END so everything will be implicitly nonnull.
928
929         * UIProcess/API/Cocoa/WKError.h:
930
931 2015-03-12  Ian Henderson  <ian@ianhenderson.org>
932
933         PDFs don't snapshot properly in iOS Safari
934         https://bugs.webkit.org/show_bug.cgi?id=142623
935
936         Reviewed by Tim Horton.
937
938         * UIProcess/API/Cocoa/WKWebView.mm:
939         (-[WKWebView _snapshotRect:intoImageOfWidth:completionHandler:]):
940         If we have a _customContentView, use UIView snapshotting instead of
941         trying to snapshot the web page.
942
943 2015-03-12  Eric Carlson  <eric.carlson@apple.com>
944
945         [Mac] Update AirPlay handling
946         https://bugs.webkit.org/show_bug.cgi?id=142541
947
948         Unreviewed, respond to post-review comments and add previously reviewed changes
949         missed by a bungled merge.
950
951         * Shared/mac/WebCoreArgumentCodersMac.mm:
952         * UIProcess/WebMediaPlaybackTargetPickerProxy.cpp:
953         (WebKit::WebMediaPlaybackTargetPickerProxy::~WebMediaPlaybackTargetPickerProxy):
954         * UIProcess/mac/PageClientImpl.h:
955         * UIProcess/mac/PageClientImpl.mm:
956         (WebKit::PageClientImpl::createPlaybackTargetPicker):
957         * UIProcess/mac/WebMediaPlaybackTargetPickerProxyMac.h: Added.
958         * UIProcess/mac/WebMediaPlaybackTargetPickerProxyMac.mm: Added.
959         * WebKit2.xcodeproj/project.pbxproj:
960         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
961         * WebProcess/WebCoreSupport/WebChromeClient.h:
962         * WebProcess/WebPage/WebPage.h:
963         * WebProcess/WebPage/WebPage.messages.in:
964         * WebProcess/WebPage/mac/WebPageMac.mm:
965         * WebProcess/com.apple.WebProcess.sb.in:
966
967 2015-03-11  Antti Koivisto  <antti@apple.com>
968
969         Cache traversal missing large entries
970         https://bugs.webkit.org/show_bug.cgi?id=142601
971
972         Reviewed by Andreas Kling.
973
974         When traversing cache entries we only read the header data from disk. This didn't work
975         correctly for entries larger than the read size.
976
977         * NetworkProcess/cache/NetworkCacheIOChannelCocoa.mm:
978         (WebKit::NetworkCache::IOChannel::read):
979
980             Partial reads only receive one callback with 'done' set to true.
981             Ensure we actually return data in this case.
982
983         * NetworkProcess/cache/NetworkCacheStorage.cpp:
984         (WebKit::NetworkCache::decodeEntryHeader):
985
986             Add some logging.
987
988 2015-03-11  Eric Carlson  <eric.carlson@apple.com>
989
990         [Mac] Update AirPlay handling
991         https://bugs.webkit.org/show_bug.cgi?id=142541
992
993         Reviewed by Sam Weinig.
994
995         * Shared/WebCoreArgumentCoders.h:
996         * Shared/mac/WebCoreArgumentCodersMac.mm:
997         (IPC::ArgumentCoder<AVPlaybackTarget>::encode):
998         (IPC::ArgumentCoder<AVPlaybackTarget>::decode):
999         * UIProcess/PageClient.h:
1000         * UIProcess/WebAVPlaybackTargetPickerProxy.cpp: Added.
1001         (WebKit::WebAVPlaybackTargetPickerProxy::WebAVPlaybackTargetPickerProxy):
1002         (WebKit::WebAVPlaybackTargetPickerProxy::~WebAVPlaybackTargetPickerProxy):
1003         (WebKit::WebAVPlaybackTargetPickerProxy::showPlaybackTargetPicker):
1004         (WebKit::WebAVPlaybackTargetPickerProxy::startingMonitoringPlaybackTargets):
1005         (WebKit::WebAVPlaybackTargetPickerProxy::stopMonitoringPlaybackTargets):
1006         * UIProcess/WebAVPlaybackTargetPickerProxy.h: Added.
1007         (WebKit::WebAVPlaybackTargetPickerProxy::Client::~Client):
1008         * UIProcess/WebPageProxy.cpp:
1009         (WebKit::WebPageProxy::devicePickerProxy):
1010         (WebKit::WebPageProxy::showPlaybackTargetPicker):
1011         (WebKit::WebPageProxy::startingMonitoringPlaybackTargets):
1012         (WebKit::WebPageProxy::stopMonitoringPlaybackTargets):
1013         (WebKit::WebPageProxy::didChoosePlaybackTarget):
1014         (WebKit::WebPageProxy::externalOutputDeviceAvailableDidChange):
1015         * UIProcess/WebPageProxy.h:
1016         * UIProcess/WebPageProxy.messages.in:
1017         * UIProcess/mac/PageClientImpl.h:
1018         * UIProcess/mac/PageClientImpl.mm:
1019         (WebKit::PageClientImpl::createPlaybackTargetPicker):
1020         * UIProcess/mac/WebAVPlaybackTargetPickerProxyMac.h: Added.
1021         * UIProcess/mac/WebAVPlaybackTargetPickerProxyMac.mm: Added.
1022         (WebKit::WebAVPlaybackTargetPickerProxyMac::create):
1023         (WebKit::WebAVPlaybackTargetPickerProxyMac::WebAVPlaybackTargetPickerProxyMac):
1024         (WebKit::WebAVPlaybackTargetPickerProxyMac::~WebAVPlaybackTargetPickerProxyMac):
1025         (WebKit::WebAVPlaybackTargetPickerProxyMac::outputeDeviceAvailabilityChangedTimerFired):
1026         (WebKit::WebAVPlaybackTargetPickerProxyMac::availableDevicesDidChange):
1027         (WebKit::WebAVPlaybackTargetPickerProxyMac::devicePicker):
1028         (WebKit::WebAVPlaybackTargetPickerProxyMac::showPlaybackTargetPicker):
1029         (WebKit::WebAVPlaybackTargetPickerProxyMac::currentDeviceDidChange):
1030         (WebKit::WebAVPlaybackTargetPickerProxyMac::startingMonitoringPlaybackTargets):
1031         (WebKit::WebAVPlaybackTargetPickerProxyMac::stopMonitoringPlaybackTargets):
1032         (-[WebAVOutputDevicePickerMenuControllerHelper initWithCallback:]):
1033         (-[WebAVOutputDevicePickerMenuControllerHelper clearCallback]):
1034         (-[WebAVOutputDevicePickerMenuControllerHelper observeValueForKeyPath:ofObject:change:context:]):
1035         * WebKit2.xcodeproj/project.pbxproj:
1036         * WebProcess/WebCoreSupport/WebAVPlaybackTargetPicker.cpp: Added.
1037         (WebKit::WebAVPlaybackTargetPicker::WebAVPlaybackTargetPicker):
1038         (WebKit::WebAVPlaybackTargetPicker::showPlaybackDevicePicker):
1039         (WebKit::WebAVPlaybackTargetPicker::configureWireLessTargetMonitoring):
1040         (WebKit::WebAVPlaybackTargetPicker::addClient):
1041         (WebKit::WebAVPlaybackTargetPicker::removeClient):
1042         (WebKit::WebAVPlaybackTargetPicker::didChoosePlaybackTarget):
1043         (WebKit::WebAVPlaybackTargetPicker::playbackTargetAvailabilityDidChange):
1044         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1045         (WebKit::WebChromeClient::showPlaybackTargetPicker):
1046         (WebKit::WebChromeClient::startingMonitoringPlaybackTargets):
1047         (WebKit::WebChromeClient::stopMonitoringPlaybackTargets):
1048         * WebProcess/WebCoreSupport/WebChromeClient.h:
1049         * WebProcess/WebPage/WebPage.h:
1050         * WebProcess/WebPage/WebPage.messages.in:
1051         * WebProcess/WebPage/mac/WebPageMac.mm:
1052         (WebKit::WebPage::playbackTargetSelected):
1053         (WebKit::WebPage::playbackTargetAvailabilityDidChange):
1054         * WebProcess/com.apple.WebProcess.sb.in:
1055
1056 2015-03-11  Myles C. Maxfield  <mmaxfield@apple.com>
1057
1058         Fix the build
1059
1060         Unreviewed.
1061
1062         * Shared/Downloads/mac/DownloadMac.mm:
1063         (WebKit::Download::start):
1064         (WebKit::Download::resume):
1065
1066 2015-03-10  Sam Weinig  <sam@webkit.org>
1067
1068         Allow adding a button in input elements for auto fill related functionality
1069         <rdar://problem/19782066>
1070         https://bugs.webkit.org/show_bug.cgi?id=142564
1071
1072         Reviewed by Anders Carlsson.
1073
1074         - Adds new SPI to respond to clicks on the AutoFill button (both bundle and UIProcess).
1075         - Adds new SPI to enable/disable the display of the AutoFill button on an element.
1076         - Adds new SPI to get the bounds of the AutoFill button.
1077         - Updates spelling of AutoFill to be consistent.
1078
1079         * UIProcess/API/APIUIClient.h:
1080         (API::UIClient::didClickAutoFillButton):
1081         * UIProcess/API/C/WKPage.cpp:
1082         (WKPageSetPageUIClient):
1083         * UIProcess/API/C/WKPageUIClient.h:
1084         * UIProcess/WebPageProxy.cpp:
1085         (WebKit::WebPageProxy::handleAutoFillButtonClick):
1086         * UIProcess/WebPageProxy.h:
1087         * UIProcess/WebPageProxy.messages.in:
1088         * WebProcess/InjectedBundle/API/APIInjectedBundlePageUIClient.h:
1089         (API::InjectedBundle::PageUIClient::didClickAutoFillButton):
1090         * WebProcess/InjectedBundle/InjectedBundlePageUIClient.cpp:
1091         (WebKit::InjectedBundlePageUIClient::didClickAutoFillButton):
1092         * WebProcess/InjectedBundle/InjectedBundlePageUIClient.h:
1093         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1094         (WebKit::WebChromeClient::handleAutoFillButtonClick):
1095         * WebProcess/WebCoreSupport/WebChromeClient.h:
1096         * WebProcess/InjectedBundle/API/c/WKBundlePageUIClient.h:
1097         Pipe the didClickAutoFillButton to the SPI layer.
1098
1099         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.mm:
1100         (-[WKWebProcessPlugInNodeHandle HTMLInputElementIsAutoFilled]):
1101         (-[WKWebProcessPlugInNodeHandle setHTMLInputElementIsAutoFilled:]):
1102         Update for new spelling of AutoFill.
1103
1104         * WebProcess/InjectedBundle/API/c/WKBundleNodeHandlePrivate.h:
1105         * WebProcess/InjectedBundle/API/c/WKBundleNodeHandle.cpp:
1106         (WKBundleNodeHandleGetHTMLInputElementAutoFilled):
1107         (WKBundleNodeHandleSetHTMLInputElementAutoFilled):
1108         Added. Replaces WKBundleNodeHandleGetHTMLInputElementAutofilled/WKBundleNodeHandleSetHTMLInputElementAutofilled
1109         which are now deprecated due to inconsistent spelling of AutoFill.
1110
1111         (WKBundleNodeHandleGetHTMLInputElementAutoFillButtonEnabled):
1112         (WKBundleNodeHandleSetHTMLInputElementAutoFillButtonEnabled):
1113         (WKBundleNodeHandleGetHTMLInputElementAutoFillButtonBounds):
1114         Added.
1115
1116         (WKBundleNodeHandleGetHTMLInputElementAutofilled):
1117         (WKBundleNodeHandleSetHTMLInputElementAutofilled):
1118         Deprecated.
1119
1120         * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp:
1121         (WebKit::InjectedBundleNodeHandle::getOrCreate):
1122         (WebKit::InjectedBundleNodeHandle::create):
1123         (WebKit::InjectedBundleNodeHandle::InjectedBundleNodeHandle):
1124         (WebKit::InjectedBundleNodeHandle::~InjectedBundleNodeHandle):
1125         (WebKit::InjectedBundleNodeHandle::coreNode):
1126         (WebKit::InjectedBundleNodeHandle::document):
1127         (WebKit::InjectedBundleNodeHandle::elementBounds):
1128         (WebKit::InjectedBundleNodeHandle::renderRect):
1129         (WebKit::InjectedBundleNodeHandle::renderedImage):
1130         (WebKit::InjectedBundleNodeHandle::visibleRange):
1131         (WebKit::InjectedBundleNodeHandle::setHTMLInputElementValueForUser):
1132         (WebKit::InjectedBundleNodeHandle::isHTMLInputElementAutoFilled):
1133         (WebKit::InjectedBundleNodeHandle::setHTMLInputElementAutoFilled):
1134         (WebKit::InjectedBundleNodeHandle::isHTMLInputElementAutoFillButtonEnabled):
1135         (WebKit::InjectedBundleNodeHandle::setHTMLInputElementAutoFillButtonEnabled):
1136         (WebKit::InjectedBundleNodeHandle::htmlInputElementAutoFillButtonBounds):
1137         (WebKit::InjectedBundleNodeHandle::htmlInputElementLastChangeWasUserEdit):
1138         (WebKit::InjectedBundleNodeHandle::htmlTextAreaElementLastChangeWasUserEdit):
1139         (WebKit::InjectedBundleNodeHandle::isTextField):
1140         (WebKit::InjectedBundleNodeHandle::htmlTableCellElementCellAbove):
1141         (WebKit::InjectedBundleNodeHandle::documentFrame):
1142         (WebKit::InjectedBundleNodeHandle::htmlFrameElementContentFrame):
1143         (WebKit::InjectedBundleNodeHandle::htmlIFrameElementContentFrame):
1144         (WebKit::InjectedBundleNodeHandle::isHTMLInputElementAutofilled): Deleted.
1145         (WebKit::InjectedBundleNodeHandle::setHTMLInputElementAutofilled): Deleted.
1146         * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.h:
1147         Fix-up InjectedBundleNodeHandle to store its underlying Node in a Ref, rather than a RefPtr.
1148         Add helpers to implement the new SPI for WKBundleNodeHandleRef.
1149
1150 2015-03-11  Timothy Horton  <timothy_horton@apple.com>
1151
1152         Make it possible to zoom on pages that claim to lay out to device size and then fail to do so
1153         https://bugs.webkit.org/show_bug.cgi?id=142549
1154
1155         Reviewed by Simon Fraser.
1156
1157         * Shared/WebPreferencesDefinitions.h:
1158         * WebProcess/WebPage/WebPage.cpp:
1159         (WebKit::WebPage::updatePreferences):
1160         Flip the pref on by default.
1161
1162 2015-03-11  Carlos Garcia Campos  <cgarcia@igalia.com>
1163
1164         [GTK] Do not look for child processes in the UI process binary path
1165         https://bugs.webkit.org/show_bug.cgi?id=135752
1166
1167         Reviewed by Gustavo Noronha Silva.
1168
1169         It's only useful for internal tools and tests, but never when
1170         installed, since we don't install the processes in the bin dir but
1171         in the libexec dir.
1172
1173         * Shared/gtk/ProcessExecutablePathGtk.cpp:
1174         (WebKit::findWebKitProcess): Only look or the executables in the
1175         UI process binary path or WEBKIT_EXEC_PATH for development builds.
1176         * UIProcess/API/gtk/WebKitWebContext.cpp:
1177         (injectedBundleDirectory): Only check
1178         WEBKIT_INJECTED_BUNDLE_PATH env var for development builds.
1179
1180 2015-03-10  Antti Koivisto  <antti@apple.com>
1181
1182         Add interface to delete disk cache entries
1183         https://bugs.webkit.org/show_bug.cgi?id=142546
1184
1185         Reviewed by Anders Carlsson.
1186
1187         * NetworkProcess/cache/NetworkCache.cpp:
1188         (WebKit::NetworkCache::Cache::remove):
1189         * NetworkProcess/cache/NetworkCache.h:
1190         * NetworkProcess/cache/NetworkCacheStorage.cpp:
1191         (WebKit::NetworkCache::Storage::Storage):
1192         (WebKit::NetworkCache::Storage::remove):
1193
1194             Move deletion to a serial queue so we can't create large number of threads.
1195
1196         (WebKit::NetworkCache::Storage::dispatchReadOperation):
1197         (WebKit::NetworkCache::Storage::dispatchHeaderWriteOperation):
1198         (WebKit::NetworkCache::Storage::removeEntry): Deleted.
1199         * NetworkProcess/cache/NetworkCacheStorage.h:
1200         (WebKit::NetworkCache::Storage::deleteQueue):
1201
1202 2015-03-10  Chris Dumez  <cdumez@apple.com>
1203
1204         5 tests fail on Apple Mac WK2 performance bots
1205         https://bugs.webkit.org/show_bug.cgi?id=142485
1206
1207         Reviewed by Andreas Kling.
1208
1209         Only log errors in debug builds if SandboxExtension::createHandle() fails
1210         so that performance tests don't fail because of it. Such error is not
1211         fatal and is expected under certain circumstances. In particular,
1212         SandboxExtension::createHandle() is sometimes called for non-existing
1213         files (e.g. from NetworkResourceLoadParameters::encode()).
1214
1215         * Shared/mac/SandboxExtensionMac.mm:
1216         (WebKit::SandboxExtension::createHandle):
1217
1218 2015-03-10  Timothy Horton  <timothy_horton@apple.com>
1219
1220         Fix the build
1221
1222         * Shared/Downloads/ios/DownloadIOS.mm:
1223         (WebKit::Download::startWithHandle):
1224         * UIProcess/Network/CustomProtocols/mac/CustomProtocolManagerProxyMac.mm:
1225         (-[WKCustomProtocolLoader initWithCustomProtocolManagerProxy:customProtocolID:request:connection:]):
1226
1227 2015-03-10  Carlos Garcia Campos  <cgarcia@igalia.com>
1228
1229         [GTK] Contents not shown when entering AC mode unless the window is resized
1230         https://bugs.webkit.org/show_bug.cgi?id=142347
1231
1232         Reviewed by Žan Doberšek.
1233
1234         The problem is once again that we are now creating the redirected
1235         X window in realize method. When entering AC mode we resize the
1236         redirected window to the drawing area size. Since the size hasn't
1237         changed from the drawing area point of view, the web process is
1238         not notified. The WebProcess always uses the window size, instead
1239         of the root layer size, to make sure it's in sync, see the comment
1240         in LayerTreeHostGtk::compositeLayersToContext(). So, we need to
1241         enforce a resize when we change the size of the redirected window
1242         when entering AC mode.
1243
1244         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
1245         (webkitWebViewBaseEnterAcceleratedCompositingMode):
1246         * UIProcess/DrawingAreaProxyImpl.h:
1247         (WebKit::DrawingAreaProxyImpl::forceResize):
1248
1249 2015-03-10  Csaba Osztrogonác  <ossy@webkit.org>
1250
1251         [cmake] Handle unused parameter warnings as build errors except in WebKit2
1252         https://bugs.webkit.org/show_bug.cgi?id=142338
1253
1254         Reviewed by Gyuyoung Kim.
1255
1256         * CMakeLists.txt:
1257
1258 2015-03-10  Dan Bernstein  <mitz@apple.com>
1259
1260         WebKit2 part of <rdar://problem/20086546> [Cocoa] Add an option to treat certificate chains with SHA1-signed certificates as insecure
1261         https://bugs.webkit.org/show_bug.cgi?id=142461
1262
1263         Reviewed by Sam Weinig.
1264
1265         * UIProcess/API/Cocoa/WKWebView.mm:
1266         (-[WKWebView initWithFrame:configuration:]): Initialize
1267         webPageConfiguration.treatsSHA1SignedCertificatesAsInsecure from the WKWebViewConfiguration.
1268
1269         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
1270         Added _treatsSHA1SignedCertificatesAsInsecure ivar.
1271         (-[WKWebViewConfiguration copyWithZone:]): Copy _treatsSHA1SignedCertificatesAsInsecure.
1272         (-[WKWebViewConfiguration _treatsSHA1SignedCertificatesAsInsecure]): Added this getter.
1273         (-[WKWebViewConfiguration _setTreatsSHA1SignedCertificatesAsInsecure:]): Added this setter.
1274
1275         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h: Declared new
1276         _treatsSHA1SignedCertificatesAsInsecure property.
1277
1278         * UIProcess/PageLoadState.cpp:
1279         (WebKit::PageLoadState::didCommitLoad): Use new hasInsecureContent parameter to initialize
1280         hasInsecureContent parameter in the uncommitted state.
1281         * UIProcess/PageLoadState.h:
1282
1283         * UIProcess/WebPageProxy.cpp:
1284         (WebKit::WebPageProxy::WebPageProxy): Initialize new m_treatsSHA1CertificatesAsInsecure
1285         member variable from the WebPageConfiguration.
1286         (WebKit::WebPageProxy::didCommitLoadForFrame): Pass true for the new hasInsecureContent to
1287         PageLoadState::didCommitLoad if we are treating SHA1-signed certificates as insecure and
1288         the certificate info contains a non-root SHA1-signed certificate.
1289         * UIProcess/WebPageProxy.h: Added m_treatsSHA1CertificatesAsInsecure member variable.
1290
1291 2015-03-09  Geoffrey Garen  <ggaren@apple.com>
1292
1293         bmalloc: tryFastMalloc shouldn't crash
1294         https://bugs.webkit.org/show_bug.cgi?id=142443
1295
1296         Reviewed by Anders Carlsson.
1297
1298         Part 1: Stop using tryFastRealloc.
1299
1300         * Shared/ShareableBitmap.cpp:
1301         (WebKit::ShareableBitmap::resize): Deleted.
1302         * Shared/ShareableBitmap.h: Removed the resize function because it has
1303         no clients.
1304
1305         * WebProcess/Plugins/PluginProxy.cpp:
1306         (WebKit::PluginProxy::updateBackingStore): Changed to allocate a new
1307         backing store instead of resizing the old one. This has three advantages:
1308
1309         (1) Might be more memory-efficient, since you don't have to keep the old
1310         one around while allocating the new one.
1311
1312         (2) Avoids the overhead of realloc() copying the contents of the old
1313         backing store even though we only want uninitialized memory.
1314
1315         (3) Makes resize failure consistent with initial allocation failure.
1316         Previously, while initial allocation failure would set the backing store
1317         to null, resize failure would keep the old wrong backing store and then
1318         tell it not to paint. Now, resize failure also sets the backing store to
1319         null.
1320
1321 2015-03-09  Martin Robinson  <mrobinson@igalia.com>
1322
1323         [EFL] Move DispatchQueue to WTF
1324         https://bugs.webkit.org/show_bug.cgi?id=142493
1325
1326         Reviewed by Csaba Osztrogonác.
1327
1328         * PlatformEfl.cmake: Remove DispatchQueue from the source list.
1329
1330 2015-03-08  Dean Jackson  <dino@apple.com>
1331
1332         [iOS Media] Video buffer progress missing on iPhones
1333         https://bugs.webkit.org/show_bug.cgi?id=142462
1334
1335         Reviewed by Eric Carlson.
1336
1337         Coordinate the SetBufferedTime message between the Web and UI
1338         processes.
1339
1340         * UIProcess/ios/WebVideoFullscreenManagerProxy.messages.in: New message SetBufferedTime.
1341         * WebProcess/ios/WebVideoFullscreenManager.h:
1342         * WebProcess/ios/WebVideoFullscreenManager.mm:
1343         (WebKit::WebVideoFullscreenManager::setBufferedTime):
1344
1345 2015-03-08  Sam Weinig  <sam@webkit.org>
1346
1347         [Content Extensions] Add scaffolding for the WKUserContentExtensionStore
1348         https://bugs.webkit.org/show_bug.cgi?id=142464
1349
1350         Reviewed by Dan Bernstein.
1351
1352         * Shared/API/APIObject.h:
1353         Add a UserContentExtensionStore type and move the UserContentExtension type into the correct section (UIProcess).
1354
1355         * Shared/API/c/WKBase.h:
1356         Add the WKUserContentExtensionStoreRef C-SPI type.
1357
1358         * Shared/Cocoa/APIObject.mm:
1359         (API::Object::newObject):
1360         Add allocation support for UserContentExtensionStore (and UserContentExtension while we are there, it will be
1361         needed shortly).
1362
1363         * UIProcess/API/APIUserContentExtensionStore.cpp: Added.
1364         (API::UserContentExtensionStore::UserContentExtensionStore):
1365         (API::UserContentExtensionStore::~UserContentExtensionStore):
1366         * UIProcess/API/APIUserContentExtensionStore.h: Added.
1367         Stub out the UserContentExtensionStore.
1368
1369         * UIProcess/API/C/WKAPICast.h:
1370         Add casting for the UserContentExtensionStore.
1371
1372         * UIProcess/API/C/WKUserContentExtensionStoreRef.cpp: Added.
1373         (WKUserContentExtensionStoreGetTypeID):
1374         * UIProcess/API/C/WKUserContentExtensionStoreRef.h: Added.
1375         * UIProcess/API/Cocoa/_WKUserContentExtensionStore.h: Added.
1376         * UIProcess/API/Cocoa/_WKUserContentExtensionStore.mm: Added.
1377         (-[_WKUserContentExtensionStore init]):
1378         (-[_WKUserContentExtensionStore dealloc]):
1379         (-[_WKUserContentExtensionStore _apiObject]):
1380         * UIProcess/API/Cocoa/_WKUserContentExtensionStoreInternal.h: Added.
1381         (WebKit::wrapper):
1382         Stub out SPI for the UserContentExtensionStore.
1383
1384         * WebKit2.xcodeproj/project.pbxproj:
1385         * CMakeLists.txt:
1386         Add new files.
1387
1388 2015-03-08  Sam Weinig  <sam@webkit.org>
1389
1390         AX: Expose a frame's accessible name through WK2 C SPI
1391         <rdar://problem/19653068>
1392         https://bugs.webkit.org/show_bug.cgi?id=142468
1393
1394         Reviewed by Dan Bernstein.
1395
1396         * WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp:
1397         (WKBundleFrameSetAccessibleName):
1398         * WebProcess/InjectedBundle/API/c/WKBundleFrame.h:
1399         * WebProcess/WebPage/WebFrame.cpp:
1400         (WebKit::WebFrame::setAccessibleName):
1401         * WebProcess/WebPage/WebFrame.h:
1402         Add SPI to set a frame's accessible name. This matches the Legacy WebKit SPI -[WebFrame setAccessibleName:]. 
1403
1404 2015-03-08  Sam Weinig  <sam@webkit.org>
1405
1406         [Content Extensions] Pass compiled content extensions as read-only shared memory rather than copying them
1407         https://bugs.webkit.org/show_bug.cgi?id=142458
1408
1409         Reviewed by Dan Bernstein.
1410
1411         * Shared/WebCompiledContentExtensionData.cpp:
1412         (WebKit::WebCompiledContentExtensionData::encode):
1413         (WebKit::WebCompiledContentExtensionData::decode):
1414         * Shared/WebCompiledContentExtensionData.h:
1415         (WebKit::WebCompiledContentExtensionData::WebCompiledContentExtensionData):
1416         Store the compiled data as a SharedMemory block with offset/size pairs for the
1417         bytecode and actions. While the bytecode offset is currently always 0, this won't
1418         be the case when we map these in from files due to metadata that will be placed
1419         at the top of the files.
1420
1421         * Shared/WebCompiledContentExtension.h:
1422         * Shared/WebCompiledContentExtension.cpp:
1423         (WebKit::WebCompiledContentExtension::createFromCompiledContentExtensionData):
1424         Temporary creation helper. In subsequent patches, this will be removed and replaced
1425         by always passing in shared/mapped data.
1426
1427         (WebKit::WebCompiledContentExtension::create):
1428         (WebKit::WebCompiledContentExtension::WebCompiledContentExtension):
1429         (WebKit::WebCompiledContentExtension::bytecode):
1430         (WebKit::WebCompiledContentExtension::bytecodeLength):
1431         (WebKit::WebCompiledContentExtension::actions):
1432         (WebKit::WebCompiledContentExtension::actionsLength):
1433         Convert to work with the new WebCompiledContentExtension format.
1434         
1435         * UIProcess/API/C/WKUserContentFilterRef.cpp:
1436         (WKUserContentFilterCreate):
1437         * UIProcess/API/Cocoa/_WKUserContentFilter.mm:
1438         (-[_WKUserContentFilter initWithName:serializedRules:]):
1439         Switch to using WebCompiledContentExtension::createFromCompiledContentExtensionData().
1440
1441         * WebProcess/UserContent/WebUserContentController.cpp:
1442         (WebKit::WebUserContentController::addUserContentExtensions):
1443         * WebProcess/WebPage/WebPageGroupProxy.cpp:
1444         (WebKit::WebPageGroupProxy::addUserContentExtension):
1445         Update to pass the WebCompiledContentExtensionData directly to the WebCompiledContentExtension.
1446
1447 2015-03-08  Carlos Garcia Campos  <cgarcia@igalia.com>
1448
1449         Remove willDestroyFrame in WKBundlePageLoaderClient
1450         https://bugs.webkit.org/show_bug.cgi?id=142389
1451
1452         Reviewed by Anders Carlsson.
1453
1454         I added willDestroyFrame in r154540 but I realized recently that
1455         it has never actually worked. Adding the callback to
1456         WKBundlePageLoaderClient was the first mistake, since frames are
1457         handled by WebProcess and DidDestroyFrame message is indeed a
1458         WebProcessProxy not a WebPageProxy one. Second mistake was calling
1459         the callback from WebFrameLoaderClient::frameLoaderDestroyed(),
1460         since at that point the frame has already been detached from the
1461         page and so WebFrame::page() always returns nullptr. So, this in
1462         fact dead code and since r180211 nobody is using it.
1463
1464         * WebProcess/InjectedBundle/API/c/WKBundlePageLoaderClient.h:
1465         * WebProcess/InjectedBundle/API/gtk/WebKitWebPage.cpp:
1466         (webkitWebPageCreate): Use verion 6 instead of version 7 of loader client.
1467         * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp:
1468         (WebKit::InjectedBundlePageLoaderClient::willDestroyFrame): Deleted.
1469         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1470         (WebKit::WebFrameLoaderClient::frameLoaderDestroyed):
1471
1472 2015-03-06  Sam Weinig  <sam@webkit.org>
1473
1474         [Content Extensions] Move compiling of content extensions to the UIProcess
1475         https://bugs.webkit.org/show_bug.cgi?id=142402
1476
1477         Reviewed by Benjamin Poulain.
1478
1479         * Shared/API/APIObject.h:
1480         Rename UserContentFilter type to UserContentExtension to match new unified naming.
1481
1482         * Shared/WebCompiledContentExtension.cpp: Added.
1483         (WebKit::WebCompiledContentExtension::create):
1484         (WebKit::WebCompiledContentExtension::WebCompiledContentExtension):
1485         (WebKit::WebCompiledContentExtension::~WebCompiledContentExtension):
1486         (WebKit::WebCompiledContentExtension::bytecode):
1487         (WebKit::WebCompiledContentExtension::bytecodeLength):
1488         (WebKit::WebCompiledContentExtension::actions):
1489         (WebKit::WebCompiledContentExtension::actionsLength):
1490         * Shared/WebCompiledContentExtension.h: Added.
1491         Add new WebKit2 implementation of CompiledContentExtension. Right now it is the same as the old
1492         WebCore based CompiledContentExtension, but in subsequent patches, it will use shared/file backed
1493         memory.
1494
1495         * Shared/WebCompiledContentExtensionData.cpp: Added.
1496         (WebKit::WebCompiledContentExtensionData::encode):
1497         (WebKit::WebCompiledContentExtensionData::decode):
1498         * Shared/WebCompiledContentExtensionData.h: Added.
1499         Add encodable/decodable holder for the compiled content extension data for use in IPC. Right
1500         now it is doing the naive thing and always copying the data, but in subsequent patches, it will
1501         use shared/file backed memory.
1502
1503         * Shared/WebPageGroupData.cpp:
1504         (WebKit::WebPageGroupData::encode):
1505         (WebKit::WebPageGroupData::decode):
1506         * Shared/WebPageGroupData.h:
1507         Rename member to match new unification on the name userContentExtension. Change the value from
1508         the serialized JSON (as a String) to WebCompiledContentExtensionData.
1509
1510         * UIProcess/API/APIUserContentExtension.cpp: Copied from Source/WebKit2/UIProcess/API/APIUserContentFilter.cpp.
1511         (API::UserContentExtension::UserContentExtension):
1512         (API::UserContentExtension::~UserContentExtension):
1513         (API::UserContentFilter::UserContentFilter): Deleted.
1514         (API::UserContentFilter::~UserContentFilter): Deleted.
1515         * UIProcess/API/APIUserContentExtension.h: Copied from Source/WebKit2/UIProcess/API/APIUserContentFilter.h.
1516         * UIProcess/API/APIUserContentFilter.cpp: Removed.
1517         * UIProcess/API/APIUserContentFilter.h: Removed.
1518         Renamed UserContentFilter to APIUserContentExtension. Updated to store the compiled extension (as a WebCompiledContentExtension)
1519         rather than the serialized JSON.
1520
1521         * UIProcess/API/C/WKAPICast.h:
1522         * UIProcess/API/C/WKPageGroup.cpp:
1523         (WKPageGroupAddUserContentFilter):
1524         (WKPageGroupRemoveUserContentFilter):
1525         (WKPageGroupRemoveAllUserContentFilters):
1526         * UIProcess/API/C/WKUserContentControllerRef.cpp:
1527         (WKUserContentControllerAddUserContentFilter):
1528         (WKUserContentControllerRemoveAllUserContentFilters):
1529         * UIProcess/API/Cocoa/WKUserContentController.mm:
1530         (-[WKUserContentController _addUserContentFilter:]):
1531         (-[WKUserContentController _removeUserContentFilter:]):
1532         (-[WKUserContentController _removeAllUserContentFilters]):
1533         Update for rename of APIUserContentFilter -> UserContentExtension.
1534
1535         * UIProcess/API/C/WKUserContentFilterRef.cpp:
1536         (WKUserContentFilterGetTypeID):
1537         (WKUserContentFilterCreate):
1538         Update for rename of APIUserContentFilter -> UserContentExtension. Also make WKUserContentFilterCreate eagerly
1539         compile rule list to a WebCompiledContentExtensionData.
1540
1541         * UIProcess/API/Cocoa/_WKUserContentFilter.mm:
1542         (-[_WKUserContentFilter initWithName:serializedRules:]):
1543         (-[_WKUserContentFilter dealloc]):
1544         (-[_WKUserContentFilter _apiObject]):
1545         Update for rename of APIUserContentFilter -> UserContentExtension. Also make initWithName:serializedRules: eagerly
1546         compile rule list to a WebCompiledContentExtensionData.
1547
1548         * UIProcess/API/Cocoa/_WKUserContentFilterInternal.h:
1549         (WebKit::wrapper):
1550         Update for rename of APIUserContentFilter -> UserContentExtension.
1551
1552         * UIProcess/UserContent/WebUserContentControllerProxy.cpp:
1553         (WebKit::WebUserContentControllerProxy::addProcess):
1554         (WebKit::WebUserContentControllerProxy::addUserContentExtension):
1555         (WebKit::WebUserContentControllerProxy::removeUserContentExtension):
1556         (WebKit::WebUserContentControllerProxy::removeAllUserContentExtensions):
1557         (WebKit::WebUserContentControllerProxy::addUserContentFilter): Deleted.
1558         (WebKit::WebUserContentControllerProxy::removeUserContentFilter): Deleted.
1559         (WebKit::WebUserContentControllerProxy::removeAllUserContentFilters): Deleted.
1560         * UIProcess/UserContent/WebUserContentControllerProxy.h:
1561         * UIProcess/WebPageGroup.cpp:
1562         (WebKit::WebPageGroup::addUserContentExtension):
1563         (WebKit::WebPageGroup::removeUserContentExtension):
1564         (WebKit::WebPageGroup::removeAllUserContentExtensions):
1565         (WebKit::WebPageGroup::addUserContentFilter): Deleted.
1566         (WebKit::WebPageGroup::removeUserContentFilter): Deleted.
1567         (WebKit::WebPageGroup::removeAllUserContentFilters): Deleted.
1568         * UIProcess/WebPageGroup.h:
1569         * WebKit2.xcodeproj/project.pbxproj:
1570         * WebProcess/UserContent/WebUserContentController.cpp:
1571         (WebKit::WebUserContentController::addUserContentExtensions):
1572         (WebKit::WebUserContentController::removeUserContentExtension):
1573         (WebKit::WebUserContentController::removeAllUserContentExtensions):
1574         (WebKit::WebUserContentController::addUserContentFilters): Deleted.
1575         (WebKit::WebUserContentController::removeUserContentFilter): Deleted.
1576         (WebKit::WebUserContentController::removeAllUserContentFilters): Deleted.
1577         * WebProcess/UserContent/WebUserContentController.h:
1578         * WebProcess/UserContent/WebUserContentController.messages.in:
1579         * WebProcess/WebPage/WebPageGroupProxy.cpp:
1580         (WebKit::WebPageGroupProxy::WebPageGroupProxy):
1581         (WebKit::WebPageGroupProxy::addUserContentExtension):
1582         (WebKit::WebPageGroupProxy::removeUserContentExtension):
1583         (WebKit::WebPageGroupProxy::removeAllUserContentExtensions):
1584         (WebKit::WebPageGroupProxy::addUserContentFilter): Deleted.
1585         (WebKit::WebPageGroupProxy::removeUserContentFilter): Deleted.
1586         (WebKit::WebPageGroupProxy::removeAllUserContentFilters): Deleted.
1587         * WebProcess/WebPage/WebPageGroupProxy.h:
1588         * WebProcess/WebPage/WebPageGroupProxy.messages.in:
1589         Pipe the compiled extension from the UIProcess to the WebProcess.
1590
1591 2015-03-06  Dean Jackson  <dino@apple.com>
1592
1593         Support "plus-lighter" in mix-blend mode
1594         https://bugs.webkit.org/show_bug.cgi?id=142416
1595         <rdar://problem/19993979>
1596
1597         Reviewed by Darin Adler and Sam Weinig.
1598
1599         Output the appropriate blending type when logging.
1600
1601         * Shared/mac/RemoteLayerTreeTransaction.mm:
1602         (WebKit::RemoteLayerTreeTextStream::operator<<):
1603
1604 2015-03-06  Beth Dakin  <bdakin@apple.com>
1605
1606         REGRESSION (r180782): Data Detector popovers are not dismissed on scroll or zoom
1607         https://bugs.webkit.org/show_bug.cgi?id=142371
1608         -and corresponding-
1609         rdar://problem/20059224
1610
1611         Reviewed by Tim Horton.
1612
1613         This patch has the WKImmediateActionController keep track of whether or not it has 
1614         an active immediate action. Then we only call into Lookup and DD if the window is 
1615         key OR if the WKView’s immediateActionController has an active action.
1616         * UIProcess/API/mac/WKView.mm:
1617         (-[WKView _dismissContentRelativeChildWindows]):
1618         * UIProcess/mac/WKImmediateActionController.h:
1619         * UIProcess/mac/WKImmediateActionController.mm:
1620         (-[WKImmediateActionController initWithPage:view:recognizer:]):
1621         (-[WKImmediateActionController willDestroyView:]):
1622         (-[WKImmediateActionController _clearImmediateActionState]):
1623         (-[WKImmediateActionController hasActiveImmediateAction]):
1624         (-[WKImmediateActionController immediateActionRecognizerWillBeginAnimation:]):
1625
1626 2015-03-06  Jeremy Jones  <jeremyj@apple.com>
1627
1628         Scroll to make the video element visible when exiting fullscreen.
1629         https://bugs.webkit.org/show_bug.cgi?id=141439
1630
1631         Reviewed by Simon Fraser.
1632
1633         This patch will restore interface state when exiting fullscreen.
1634         Adds preparedToReturnToInline to continue exiting once the interface is updated.
1635
1636         * UIProcess/ios/WebVideoFullscreenManagerProxy.h:
1637         * UIProcess/ios/WebVideoFullscreenManagerProxy.messages.in:
1638         * UIProcess/ios/WebVideoFullscreenManagerProxy.mm:
1639         (WebKit::WebVideoFullscreenManagerProxy::setupFullscreenWithID):
1640         (WebKit::WebVideoFullscreenManagerProxy::fullscreenMayReturnToInline):
1641         (WebKit::WebVideoFullscreenManagerProxy::preparedToReturnToInline): added.
1642         * WebProcess/ios/WebVideoFullscreenManager.h:
1643         * WebProcess/ios/WebVideoFullscreenManager.messages.in:
1644         * WebProcess/ios/WebVideoFullscreenManager.mm:
1645         (WebKit::WebVideoFullscreenManager::fullscreenMayReturnToInline):
1646
1647 2015-03-06  Antti Koivisto  <antti@apple.com>
1648
1649         Rename NetworkCacheStorageCocoa.mm to NetworkCacheStorage.cpp
1650         https://bugs.webkit.org/show_bug.cgi?id=142401
1651
1652         Rubber-stamped by Anders Carlsson.
1653
1654         It is now fully cross-platform.
1655
1656         * NetworkProcess/cache/NetworkCacheStorage.cpp: Copied from Source/WebKit2/NetworkProcess/cache/NetworkCacheStorageCocoa.mm.
1657         (WebKit::NetworkCache::Storage::shrinkIfNeeded):
1658         * NetworkProcess/cache/NetworkCacheStorageCocoa.mm: Removed.
1659         * WebKit2.xcodeproj/project.pbxproj:
1660
1661 2015-03-06  Antti Koivisto  <antti@apple.com>
1662
1663         Don't use dispatch_semaphore in NetworkCacheStorage
1664         https://bugs.webkit.org/show_bug.cgi?id=142395
1665
1666         Reviewed by Anders Carlsson.
1667
1668         * NetworkProcess/cache/NetworkCacheIOChannel.h:
1669         * NetworkProcess/cache/NetworkCacheIOChannelCocoa.mm:
1670         (WebKit::NetworkCache::IOChannel::read):
1671         (WebKit::NetworkCache::IOChannel::readSync):
1672
1673             Add readSync to encapsulate the semaphore.
1674
1675         * NetworkProcess/cache/NetworkCacheStorageCocoa.mm:
1676         (WebKit::NetworkCache::Storage::traverse):
1677
1678 2015-03-06  Antti Koivisto  <antti@apple.com>
1679
1680         Move dispatch_data use behind NetworkCache::Data abstraction
1681         https://bugs.webkit.org/show_bug.cgi?id=142392
1682
1683         Reviewed by Anders Carlsson.
1684
1685         * NetworkProcess/cache/NetworkCacheData.h:
1686         (WebKit::NetworkCache::DispatchPtr::DispatchPtr):
1687         * NetworkProcess/cache/NetworkCacheDataCocoa.mm:
1688         (WebKit::NetworkCache::Data::Data):
1689         (WebKit::NetworkCache::Data::apply):
1690         (WebKit::NetworkCache::Data::subrange):
1691         (WebKit::NetworkCache::concatenate):
1692         (WebKit::NetworkCache::mapFile):
1693         * NetworkProcess/cache/NetworkCacheIOChannelCocoa.mm:
1694         (WebKit::NetworkCache::IOChannel::read):
1695         * NetworkProcess/cache/NetworkCacheStorageCocoa.mm:
1696         (WebKit::NetworkCache::hashData):
1697         (WebKit::NetworkCache::decodeEntryMetaData):
1698         (WebKit::NetworkCache::decodeEntryHeader):
1699         (WebKit::NetworkCache::decodeEntry):
1700         (WebKit::NetworkCache::encodeEntryMetaData):
1701         (WebKit::NetworkCache::encodeEntryHeader):
1702         (WebKit::NetworkCache::Storage::dispatchFullWriteOperation):
1703         (WebKit::NetworkCache::mapFile): Deleted.
1704
1705 2015-03-06  Antti Koivisto  <antti@apple.com>
1706
1707         Use WTF abstraction for page size in NetworkCacheStorage
1708         https://bugs.webkit.org/show_bug.cgi?id=142396
1709
1710         Reviewed by Darin Adler.
1711
1712         * NetworkProcess/cache/NetworkCacheStorageCocoa.mm:
1713         (WebKit::NetworkCache::decodeEntryMetaData):
1714         (WebKit::NetworkCache::Storage::dispatchFullWriteOperation):
1715
1716 2015-03-06  Myles C. Maxfield  <mmaxfield@apple.com>
1717
1718         [iOS] SVG fonts are garbled
1719         https://bugs.webkit.org/show_bug.cgi?id=142377
1720
1721         Reviewed by Simon Fraser.
1722
1723         * Configurations/FeatureDefines.xcconfig:
1724
1725 2015-03-06  Zan Dobersek  <zdobersek@igalia.com>
1726
1727         Unguarded GTK-specific member and method usage in DrawingAreaImpl
1728         https://bugs.webkit.org/show_bug.cgi?id=142391
1729
1730         Reviewed by Carlos Garcia Campos.
1731
1732         r180924 introduced unguarded use of m_nativeSurfaceHandleForCompositing
1733         and LayerTreeHost::setNativeSurfaceHandleForCompositing() in DrawingAreaImpl.
1734         Definitions for both of these are guarded with USE(TEXTURE_MAPPER_GL) and PLATFORM(GTK),
1735         so their use should be as well.
1736
1737         * WebProcess/WebPage/DrawingAreaImpl.cpp:
1738         (WebKit::DrawingAreaImpl::enterAcceleratedCompositingMode):
1739
1740 2015-03-06  David Kilzer  <ddkilzer@apple.com>
1741
1742         REGRESSION (r181140): WebKit2 fails to build on Mavericks buildbot
1743
1744         Work around Xcode dependency tracking issues by making changes
1745         to source files that need to be recompiled.
1746
1747         * NetworkProcess/NetworkProcess.cpp: Update copyright.  Include
1748         NetworkCache.h since it didn't appear to be included by
1749         NetworkCacheCoders.h.
1750         * NetworkProcess/cocoa/NetworkProcessCocoa.mm: Update copyright.
1751
1752 2015-03-05  Antti Koivisto  <antti@apple.com>
1753
1754         Move disk cache classes to namespace
1755         https://bugs.webkit.org/show_bug.cgi?id=142339
1756
1757         Reviewed by Anders Carlsson.
1758
1759         Move everything to NetworkCache namespace. 
1760
1761 2015-03-05  Carlos Garcia Campos  <cgarcia@igalia.com>
1762
1763         REGRESSION(r180924): ASSERTION FAILED: !from.isEmpty() in WebCore::TransformationMatrix::rectToRect
1764         https://bugs.webkit.org/show_bug.cgi?id=142345
1765
1766         Reviewed by Martin Robinson.
1767
1768         This was caused by r180924 that postpones the creation of the
1769         TextureMapper, which could cause that a layer has not yet a size
1770         when TextureMapper::paint() is called. This patch moves the
1771         creation of the TextureMapper to
1772         LayerTreeHostGtk::setNativeSurfaceHandleForCompositing(), so that
1773         it's created as soon as it's possible to create. This method is
1774         called by the drawing area right after creating the
1775         LayerTreeHostGtk if it already have a handler, or when the handle
1776         is received from the UI process.
1777
1778         * WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp:
1779         (WebKit::LayerTreeHostGtk::initialize): Remove the
1780         nsureTextureMapper call because at this point the layer context ID
1781         is always 0, so it's impossible to create the TextureMapper.
1782         (WebKit::LayerTreeHostGtk::compositeLayersToContext): Remove the
1783         ensureTextureMapper call from here too, since at this point, if we
1784         have a context, we should also have a TextureMapper. Add an ASSERT
1785         right before using the TextureMapper.
1786         (WebKit::LayerTreeHostGtk::setNativeSurfaceHandleForCompositing):
1787         Create the TextureMapper here.
1788         (WebKit::LayerTreeHostGtk::ensureTextureMapper): Deleted.
1789         * WebProcess/WebPage/gtk/LayerTreeHostGtk.h:
1790
1791 2015-03-05  Anders Carlsson  <andersca@apple.com>
1792
1793         WKWebView Encoder for remote object communication does not implement encodeInt32:forKey:
1794         https://bugs.webkit.org/show_bug.cgi?id=142356
1795         rdar://problem/20058952
1796
1797         Reviewed by Tim Horton.
1798
1799         * Shared/API/Cocoa/WKRemoteObjectCoder.mm:
1800         (-[WKRemoteObjectEncoder encodeInt32:forKey:]):
1801         (-[WKRemoteObjectDecoder decodeInt32ForKey:]):
1802
1803 2015-03-05  Chris Dumez  <cdumez@apple.com>
1804
1805         NetworkCache efficacy logging is using too much CPU
1806         https://bugs.webkit.org/show_bug.cgi?id=142186
1807         <rdar://problem/19632080>
1808
1809         Reviewed by Antti Koivisto.
1810
1811         NetworkCache efficacy logging was using too much CPU mostly due to
1812         database writes. Logging was using ~11.3% of the NetworkProcess'
1813         CPU usage (~9.2% for writes / ~1.3% for reads).
1814
1815         This patch buffers writes requests in memory and only writes them
1816         to disk every 10 seconds. We are thus writing to this less frequently
1817         and writing more at once, in a single SQL transaction. After this
1818         change, efficacy logging only accounts for ~3.5% of the NetworkProcess'
1819         CPU activity (1.5% for writes / 1.2% for reads).
1820
1821         Now that CPU usage is more acceptable, this patch re-enables the
1822         network cache efficicy logging.
1823
1824         * NetworkProcess/cache/NetworkCacheStatistics.h:
1825
1826         * NetworkProcess/cache/NetworkCacheStatisticsCocoa.mm:
1827         (WebKit::executeSQLCommand):
1828         (WebKit::executeSQLStatement):
1829         Call step() instead of executeCommand() because:
1830         - The input statement is already prepared.
1831         - step() does not finalize() the statement and thus we caller can
1832           reuse it after calling reset().
1833
1834         (WebKit::NetworkCacheStatistics::NetworkCacheStatistics):
1835         (WebKit::NetworkCacheStatistics::initialize):
1836         (WebKit::NetworkCacheStatistics::bootstrapFromNetworkCache):
1837         (WebKit::NetworkCacheStatistics::recordNotCachingResponse):
1838         (WebKit::NetworkCacheStatistics::recordNotUsingCacheForRequest):
1839         (WebKit::NetworkCacheStatistics::recordRetrievalFailure):
1840         (WebKit::NetworkCacheStatistics::markAsRequested):
1841         (WebKit::NetworkCacheStatistics::writeTimerFired):
1842         (WebKit::NetworkCacheStatistics::queryWasEverRequested):
1843         (WebKit::NetworkCacheStatistics::addHashesToDatabase):
1844         (WebKit::NetworkCacheStatistics::addStoreDecisionsToDatabase):
1845         (WebKit::NetworkCacheStatistics::addHashToDatabase): Deleted.
1846
1847         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
1848         (WebKit::registerUserDefaultsIfNeeded):
1849         Re-enable the network cache efficacy logging.
1850
1851 2015-03-05  Antti Koivisto  <antti@apple.com>
1852
1853         Switch NetworkCacheStorage to WorkQueue abstraction
1854         https://bugs.webkit.org/show_bug.cgi?id=142337
1855
1856         Reviewed by Anders Carlsson.
1857
1858         Don't use dispatch_async directly.
1859
1860         * NetworkProcess/cache/NetworkCacheStorage.h:
1861         (WebKit::NetworkCacheStorage::ioQueue):
1862         (WebKit::NetworkCacheStorage::backgroundIOQueue):
1863         * NetworkProcess/cache/NetworkCacheStorageCocoa.mm:
1864         (WebKit::NetworkCacheStorage::NetworkCacheStorage):
1865         (WebKit::NetworkCacheStorage::initialize):
1866         (WebKit::NetworkCacheStorage::removeEntry):
1867         (WebKit::NetworkCacheStorage::dispatchReadOperation):
1868         (WebKit::retrieveFromMemory):
1869         (WebKit::NetworkCacheStorage::traverse):
1870         (WebKit::NetworkCacheStorage::dispatchFullWriteOperation):
1871         (WebKit::NetworkCacheStorage::dispatchHeaderWriteOperation):
1872         (WebKit::NetworkCacheStorage::clear):
1873         (WebKit::NetworkCacheStorage::shrinkIfNeeded):
1874         (WebKit::NetworkCacheStorage::deleteOldVersions):
1875
1876 2015-03-05  Lukasz Bialek  <l.bialek@samsung.com>
1877
1878         [EFL][WK2] Crash when "Download Linked File" from MiniBrowser context menu is clicked
1879         https://bugs.webkit.org/show_bug.cgi?id=131162
1880
1881         Reviewed by Gyuyoung Kim.
1882
1883         "Download Linked File" crashes because of null-pointer exception of Download Job.
1884         Due to architectural difficulties, easy fix is not possible (EwkView is needed in
1885         DownloadManager to create DownloadJobs and it is only used to notify the client 
1886         about download (finished, error, cancel) via smart callback using EwkView (Evas_Object).
1887
1888         Propose a new callbacks which are view independent and detach EFL's DownloadManager
1889         from EwkView. It makes DownloadManagerEFL consistent with WKContextDownload.
1890         Fix the crash and restore download functionality.
1891
1892         * PlatformEfl.cmake:
1893         Enable newly reimplemented tests
1894         * UIProcess/API/efl/EwkViewCallbacks.h:
1895         Remove old callback mechanism
1896         * UIProcess/API/efl/ewk_context.cpp:
1897         (ewk_context_download_callbacks_set):
1898         * UIProcess/API/efl/ewk_context.h:
1899         Declare new callback functions and registration functions
1900         * UIProcess/API/efl/ewk_download_job.cpp:
1901         (EwkDownloadJob::EwkDownloadJob):
1902         (EwkDownloadJob::view): Deleted.
1903         * UIProcess/API/efl/ewk_download_job.h:
1904         * UIProcess/API/efl/ewk_download_job_private.h:
1905         (EwkDownloadJob::create):
1906         Remove EwkView dependency
1907         * UIProcess/API/efl/ewk_view.h:
1908         * UIProcess/API/efl/tests/test_ewk2_download_job.cpp:
1909         Alter tests to new callback mechanism
1910         * UIProcess/efl/DownloadManagerEfl.cpp:
1911         (WebKit::DownloadManagerEfl::decideDestinationWithSuggestedFilename):
1912         (WebKit::DownloadManagerEfl::didStart):
1913         (WebKit::DownloadManagerEfl::didFail):
1914         (WebKit::DownloadManagerEfl::didCancel):
1915         (WebKit::DownloadManagerEfl::didFinish):
1916         (WebKit::DownloadManagerEfl::DownloadManagerEfl):
1917         (WebKit::DownloadManagerEfl::registerDownloadJob):
1918         (WebKit::DownloadManagerEfl::setCallbacks):
1919         * UIProcess/efl/DownloadManagerEfl.h:
1920         * UIProcess/efl/WebViewEfl.cpp:
1921         (WebKit::WebViewEfl::handleDownloadRequest):
1922         Add support of new callback mechanism
1923
1924 2015-03-05  Michael Catanzaro  <mcatanzaro@igalia.com>
1925
1926         [SOUP] Disable RC4
1927         https://bugs.webkit.org/show_bug.cgi?id=140014
1928
1929         Reviewed by Carlos Garcia Campos.
1930
1931         Disallow RC4-based ciphersuites when performing TLS negotiation,
1932         because it is no longer considered secure.
1933
1934         * NetworkProcess/EntryPoint/unix/NetworkProcessMain.cpp:
1935         (main):
1936         * WebProcess/EntryPoint/unix/WebProcessMain.cpp:
1937         (main):
1938
1939 2015-03-04  Yusuke Suzuki  <utatane.tea@gmail.com>
1940
1941         Hide Promise with runtime flags under Cocoa JSContext API
1942         https://bugs.webkit.org/show_bug.cgi?id=141965
1943
1944         Reviewed by Filip Pizlo.
1945
1946         Add new JSC runtime flag, PromiseDisabled.
1947
1948         * UIProcess/API/C/WKPreferencesRefPrivate.h:
1949         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
1950
1951 2015-03-04  Beth Dakin  <bdakin@apple.com>
1952
1953         Attempted build fix.
1954
1955         * UIProcess/API/Cocoa/WKViewPrivate.h:
1956
1957 2015-03-04  Beth Dakin  <bdakin@apple.com>
1958
1959         Message UI process when contentSize changes
1960         https://bugs.webkit.org/show_bug.cgi?id=142294
1961         -and corresponding-
1962         rdar://problem/19963165
1963
1964         Reviewed by Andreas Kling.
1965
1966         This patch un-ifdefs the didChangeContentSize message so that we can use it on Mac 
1967         as well. 
1968
1969         New private method that subclasses can override when they need to do something 
1970         with contentSize changes.
1971         * UIProcess/API/Cocoa/WKViewPrivate.h:
1972         * UIProcess/API/mac/WKView.mm:
1973         (-[WKView _didChangeContentSize:]):
1974         * UIProcess/PageClient.h:
1975
1976         Un-ifdef.
1977         * UIProcess/WebPageProxy.cpp:
1978         (WebKit::WebPageProxy::didChangeContentSize):
1979         * UIProcess/WebPageProxy.h:
1980         * UIProcess/WebPageProxy.messages.in:
1981         * UIProcess/mac/PageClientImpl.h:
1982         * UIProcess/mac/PageClientImpl.mm:
1983         (WebKit::PageClientImpl::didChangeContentSize):
1984         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1985         (WebKit::WebChromeClient::contentsSizeChanged):
1986
1987         Stubs for other platforms now that the pure-virtual is un-masked.
1988         * UIProcess/ios/PageClientImplIOS.h:
1989         * UIProcess/ios/PageClientImplIOS.mm:
1990         (WebKit::PageClientImpl::didChangeContentSize):
1991         * UIProcess/API/gtk/PageClientImpl.h:
1992
1993 2015-03-04  Antti Koivisto  <antti@apple.com>
1994
1995         Factor platform I/O out from NetworkCacheStorage
1996         https://bugs.webkit.org/show_bug.cgi?id=142279
1997
1998         Reviewed by Chris Dumez.
1999
2000         * NetworkProcess/cache/NetworkCacheData.h: Added.
2001         * NetworkProcess/cache/NetworkCacheDataCocoa.mm: Added.
2002
2003             NetworkCacheStorage::Data -> NetworkCacheData
2004             Move to files of its own.
2005
2006         * NetworkProcess/cache/NetworkCacheIOChannel.h: Added.
2007         * NetworkProcess/cache/NetworkCacheIOChannelCocoa.mm: Added.
2008
2009             Add abstraction for dispatch IO channels.
2010
2011 2015-03-04  Joseph Pecoraro  <pecoraro@apple.com>
2012
2013         Remove WK_AVAILABLE and related macros when we cannot determine iOS/Mac version
2014         https://bugs.webkit.org/show_bug.cgi?id=142252
2015         rdar://problem/19983833
2016
2017         Reviewed by David Kilzer.
2018
2019         When mac / ios version was unable to be determined strip the WK_AVAILABLE
2020         and WK_DEPRECATED macros to avoid outputing a broken macro.
2021
2022         * mac/postprocess-framework-headers.sh:
2023
2024 2015-03-04  Debarshi Ray  <debarshir@gnome.org>
2025
2026         [GTK] WebView should hold a reference on WebContext because non-default contexts are a reality
2027         https://bugs.webkit.org/show_bug.cgi?id=142225
2028
2029         Reviewed by Carlos Garcia Campos.
2030
2031         * UIProcess/API/gtk/WebKitWebView.cpp:
2032         (webkitWebViewRequestFavicon):
2033         (webkitWebViewWatchForChangesInFavicon):
2034         (webkitWebViewDisconnectFaviconDatabaseSignalHandlers):
2035         (webkitWebViewConstructed):
2036         (webkitWebViewGetProperty):
2037         (webkitWebViewDispose):
2038         (webkitWebViewLoadChanged):
2039         (webkitWebViewLoadFailedWithTLSErrors):
2040         (webkit_web_view_get_context):
2041         (webkit_web_view_download_uri):
2042
2043 2015-03-03  Shivakumar JM  <shiva.jm@samsung.com>
2044
2045         Fix build warning in WebKit2/Shared module.
2046         https://bugs.webkit.org/show_bug.cgi?id=142213
2047
2048         Reviewed by Simon Fraser.
2049
2050         Fix build warning by removing argument name from function.
2051
2052         * Shared/WebCoreArgumentCoders.cpp:
2053         (IPC::pathPointCountApplierFunction):
2054
2055 2015-03-03  Andy Estes  <aestes@apple.com>
2056
2057         [Content Filtering] Separate unblock handling into its own class
2058         https://bugs.webkit.org/show_bug.cgi?id=142251
2059
2060         Reviewed by Andreas Kling.
2061
2062         Adopted ContentFilterUnblockHandler.
2063
2064         * Shared/WebCoreArgumentCoders.h:
2065         * Shared/mac/WebCoreArgumentCodersMac.mm:
2066         (IPC::ArgumentCoder<ContentFilterUnblockHandler>::encode):
2067         (IPC::ArgumentCoder<ContentFilterUnblockHandler>::decode):
2068         (IPC::ArgumentCoder<ContentFilter>::encode): Deleted.
2069         (IPC::ArgumentCoder<ContentFilter>::decode): Deleted.
2070         * UIProcess/Cocoa/WebPageProxyCocoa.mm:
2071         (WebKit::WebPageProxy::contentFilterDidBlockLoadForFrame):
2072         * UIProcess/WebFrameProxy.cpp:
2073         (WebKit::WebFrameProxy::didStartProvisionalLoad):
2074         (WebKit::WebFrameProxy::contentFilterDidHandleNavigationAction):
2075         * UIProcess/WebFrameProxy.h:
2076         (WebKit::WebFrameProxy::setContentFilterUnblockHandler):
2077         (WebKit::WebFrameProxy::setContentFilterForBlockedLoad): Deleted.
2078         * UIProcess/WebPageProxy.h:
2079         * UIProcess/WebPageProxy.messages.in:
2080         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2081         (WebKit::WebFrameLoaderClient::contentFilterDidBlockLoad):
2082         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
2083
2084 2015-03-03  Chris Dumez  <cdumez@apple.com>
2085
2086         [WK2] Fix memory leak in _getCookieHeadersForTask
2087         https://bugs.webkit.org/show_bug.cgi?id=142245
2088
2089         Reviewed by Alexey Proskuryakov.
2090
2091         Fix memory leak in _getCookieHeadersForTask. We are leaking the CFDictionary
2092         returned by webKitCookieStorageCopyRequestHeaderFieldsForURL().
2093
2094         This patch addresses the issue by storing the return CFDictionary in a
2095         RetainPtr<CFDictionaryRef>.
2096
2097         * Shared/mac/CookieStorageShim.mm:
2098         (-[WKNSURLSessionLocal _getCookieHeadersForTask:completionHandler:]):
2099
2100 2015-03-03  Enrica Casucci  <enrica@apple.com>
2101
2102         Incomplete dictation results in text fields in a web page.
2103         https://bugs.webkit.org/show_bug.cgi?id=142240
2104         rdar://problem/19953432
2105
2106         Reviewed by Tim Horton.
2107
2108         The empty stub for insertDictationResult:withCorrectionIdentifier
2109         must be removed. This way UIKit will call insertText and do the right thing.
2110
2111         * UIProcess/ios/WKContentViewInteraction.mm:
2112         (-[WKContentView insertDictationResult:withCorrectionIdentifier:]): Deleted.
2113
2114 2015-03-03  Dean Jackson  <dino@apple.com>
2115
2116         Controls panel should have system blurry background
2117         https://bugs.webkit.org/show_bug.cgi?id=142154
2118         <rdar://problem/20000964>
2119
2120         Reviewed by Simon Fraser.
2121
2122         In order to replicate the system style of media controls
2123         on OS X and iOS, we need to expose a special -webkit-appearance.
2124         This patch adds the new property value, and implements
2125         the iOS part of the appearance, which is a blurry shaded
2126         background.
2127
2128         * Shared/mac/RemoteLayerBackingStore.mm:
2129         (WebKit::RemoteLayerBackingStore::drawInContext): Add entries for
2130         the new layer types, even though they are not correct yet.
2131
2132         * Shared/mac/RemoteLayerTreePropertyApplier.mm:
2133         (WebKit::updateCustomAppearance):
2134         (WebKit::RemoteLayerTreePropertyApplier::applyProperties): UIBackdropViews
2135         have a defined hierarchy that we don't create. We need to make sure we add our
2136         children to the right subview.
2137         * Shared/mac/RemoteLayerTreeTransaction.mm:
2138         (WebKit::RemoteLayerTreeTransaction::description): Logging.
2139
2140         * UIProcess/ios/RemoteLayerTreeHostIOS.mm: Rename existing WKBackdropView
2141         to WKSimpleBackdropView, and add a new WKBackdropView that inherits
2142         from UIBackdropView.
2143         (-[WKBackdropView hitTest:withEvent:]):
2144         (-[WKBackdropView description]):
2145         (WebKit::RemoteLayerTreeHost::createLayer): Handle the new LayerTypes.
2146         * UIProcess/mac/RemoteLayerTreeHost.mm:
2147         (WebKit::RemoteLayerTreeHost::createLayer):
2148
2149 2015-03-03  Chris Dumez  <cdumez@apple.com>
2150
2151         Access ApplicationCacheStorage global instance via singleton() static member function
2152         https://bugs.webkit.org/show_bug.cgi?id=142239
2153
2154         Reviewed by Anders Carlsson.
2155
2156         Access ApplicationCacheStorage global instance via singleton() static
2157         member function as per WebKit coding style.
2158
2159 2015-03-03  Joseph Pecoraro  <pecoraro@apple.com>
2160
2161         Build Fix: Add fall back handling in postprocess script for missing/unknown platform name.
2162
2163         Rubber-stamped by David Kilzer.
2164
2165         * mac/postprocess-framework-headers.sh:
2166
2167 2015-03-03  Enrica Casucci  <enrica@apple.com>
2168
2169         Build fix for iOS.
2170
2171         Unreviewed.
2172
2173         * UIProcess/ios/WKContentViewInteraction.mm: Adding forward declaration.
2174
2175 2015-03-03  Antti Koivisto  <antti@apple.com>
2176
2177         Include key to NetworkCacheStorage::Entry
2178         https://bugs.webkit.org/show_bug.cgi?id=142215
2179
2180         Reviewed by Chris Dumez.
2181
2182         This simplified code. The key is saved as part of the entry so it makes logical sense too.
2183
2184         * NetworkProcess/cache/NetworkCache.cpp:
2185         (WebKit::makeCacheKey):
2186         (WebKit::encodeStorageEntry):
2187         (WebKit::NetworkCache::retrieve):
2188         (WebKit::NetworkCache::store):
2189         (WebKit::NetworkCache::update):
2190         (WebKit::NetworkCache::traverse):
2191         (WebKit::entryAsJSON):
2192         (WebKit::NetworkCache::dumpContentsToFile):
2193         * NetworkProcess/cache/NetworkCacheKey.cpp:
2194         (WebKit::NetworkCacheKey::operator=):
2195         * NetworkProcess/cache/NetworkCacheKey.h:
2196         (WebKit::NetworkCacheKey::isNull):
2197         * NetworkProcess/cache/NetworkCacheStorage.h:
2198         * NetworkProcess/cache/NetworkCacheStorageCocoa.mm:
2199         (WebKit::decodeEntry):
2200         (WebKit::encodeEntryHeader):
2201         (WebKit::retrieveFromMemory):
2202         (WebKit::NetworkCacheStorage::retrieve):
2203         (WebKit::NetworkCacheStorage::store):
2204         (WebKit::NetworkCacheStorage::update):
2205         (WebKit::NetworkCacheStorage::traverse):
2206         (WebKit::NetworkCacheStorage::dispatchPendingWriteOperations):
2207         (WebKit::NetworkCacheStorage::dispatchFullWriteOperation):
2208         (WebKit::NetworkCacheStorage::dispatchHeaderWriteOperation):
2209
2210 2015-03-03  Antti Koivisto  <antti@apple.com>
2211
2212         Cache shrink leaves behind empty partition directories
2213         https://bugs.webkit.org/show_bug.cgi?id=142217
2214
2215         Reviewed by Andreas Kling.
2216
2217         * NetworkProcess/cache/NetworkCacheFileSystemPosix.h:
2218         (WebKit::traverseCacheFiles):
2219
2220             No need for std::function.
2221
2222         * NetworkProcess/cache/NetworkCacheStorageCocoa.mm:
2223         (WebKit::NetworkCacheStorage::shrinkIfNeeded):
2224
2225             After shrink traverse through the partition directories and try to delete them.
2226             System knows if they are actually empty.
2227
2228 2015-03-03  Anders Carlsson  <andersca@apple.com>
2229
2230         Use the correct display name for website data for local files
2231         https://bugs.webkit.org/show_bug.cgi?id=142228
2232
2233         Reviewed by Dan Bernstein.
2234
2235         * UIProcess/WebsiteData/WebsiteDataRecord.cpp:
2236         (displayNameForLocalFiles):
2237         Add new helper function.
2238
2239         (WebKit::WebsiteDataRecord::displayNameForCookieHostName):
2240         Check if the hostname is kCFHTTPCookieLocalFileDomain.
2241
2242         (WebKit::WebsiteDataRecord::displayNameForOrigin):
2243         Handle file URLs as well.
2244
2245 2015-03-03  Enrica Casucci  <enrica@apple.com>
2246
2247         Fixed typo in platform guard in http://trac.webkit.org/changeset/180939.
2248
2249         Unreviewed.
2250
2251         * UIProcess/ios/WKContentViewInteraction.mm:
2252
2253 2015-03-03  Enrica Casucci  <enrica@apple.com>
2254
2255         Adopt new API for keyboard interaction.
2256         https://bugs.webkit.org/show_bug.cgi?id=142201
2257         rdar://problem/19924949
2258
2259         Reviewed by Joseph Pecoraro.
2260
2261         * UIProcess/ios/WKContentViewInteraction.mm:
2262         (-[WKContentView inputAssistantItem]):
2263         (-[WKContentView _inputAssistantItem]):
2264
2265 2015-03-03  Carlos Garcia Campos  <cgarcia@igalia.com>
2266
2267         REGRESSION(r177075): WebProcess crashes when entering accelerating compositing mode before the WebView is realized
2268         https://bugs.webkit.org/show_bug.cgi?id=142079
2269
2270         Reviewed by Žan Doberšek.
2271
2272         The problem is that the texture mapper and native window handler
2273         are initialized when the LayerTreeHost is initialized, assuming
2274         the UI process has already sent the native window handler to the
2275         web process, but that doesn't always happen since we moved the
2276         redirected window creation to realize in r177075.
2277
2278         * WebProcess/WebPage/DrawingArea.h:
2279         (WebKit::DrawingArea::nativeSurfaceHandleForCompositing): Deleted.
2280         * WebProcess/WebPage/DrawingAreaImpl.cpp:
2281         (WebKit::DrawingAreaImpl::enterAcceleratedCompositingMode): Call
2282         LayerTreeHost::setNativeSurfaceHandleForCompositing if we
2283         already have a native window handle at this point.
2284         (WebKit::DrawingAreaImpl::setNativeSurfaceHandleForCompositing):
2285         Call LayerTreeHost::setNativeSurfaceHandleForCompositing also when
2286         not using threaded compositing.
2287         * WebProcess/WebPage/LayerTreeHost.h:
2288         * WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp:
2289         (WebKit::LayerTreeHostGtk::makeContextCurrent): Helper function to
2290         ensure a context and making it current.
2291         (WebKit::LayerTreeHostGtk::ensureTextureMapper): Ensure a texture
2292         is created for the current context.
2293         (WebKit::LayerTreeHostGtk::initialize): Use makeContextCurrent()
2294         and ensureTextureMapper(), and remove the LayerTreeContext
2295         initialization since that's is now always initialized in
2296         setNativeSurfaceHandleForCompositing().
2297         (WebKit::LayerTreeHostGtk::compositeLayersToContext): Use
2298         makeContextCurrent() helper function and also call
2299         ensureTextureMapper() just in case the texture could not be
2300         created during initialization because the native window handle was
2301         not yet available.
2302         (WebKit::LayerTreeHostGtk::flushAndRenderLayers): Use makeContextCurrent().
2303         (WebKit::LayerTreeHostGtk::setNativeSurfaceHandleForCompositing):
2304         Initialize the LayerTreeContext.
2305         (WebKit::LayerTreeHostGtk::glContext): Deleted.
2306         * WebProcess/WebPage/gtk/LayerTreeHostGtk.h:
2307
2308 2015-03-02  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
2309
2310         [WK2] Remove unnecessary create() factory functions.
2311         https://bugs.webkit.org/show_bug.cgi?id=142161
2312
2313         Reviewed by Chris Dumez.
2314
2315         We can replace some create() factory functions with std::make_unique(). Because
2316         it just returns new instance. Even some of those functions have used std::unique_ptr<>
2317         instead of std::make_unique<>. Fixed all.
2318
2319         * DatabaseProcess/IndexedDB/sqlite/SQLiteIDBTransaction.h:
2320         (WebKit::SQLiteIDBTransaction::create): Deleted.
2321         * DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.cpp:
2322         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::establishTransaction):
2323         * Platform/efl/DispatchQueueWorkItemEfl.h:
2324         (WorkItem::dispatch):
2325         (WorkItem::create): Deleted.
2326         * UIProcess/API/gtk/PageClientImpl.h:
2327         (WebKit::PageClientImpl::create): Deleted.
2328         * UIProcess/API/gtk/WebKitTextChecker.h:
2329         (WebKitTextChecker::create): Deleted.
2330         * UIProcess/API/gtk/WebKitWebContext.cpp:
2331         (webkitWebContextConstructed):
2332         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
2333         (webkitWebViewBaseConstructed):
2334
2335 2015-03-02  Brady Eidson  <beidson@apple.com>
2336
2337         Lots of: ERROR: Unhandled web process message WebPageGroupProxy:RemoveAllUserContentFilters
2338         https://bugs.webkit.org/show_bug.cgi?id=142155
2339
2340         Reviewed by Simon Fraser.
2341
2342         * WebProcess/WebProcess.cpp:
2343         (WebKit::WebProcess::didReceiveMessage): Return after handling WebPageGroupProxy messages
2344           instead of logging an error.
2345
2346 2015-03-02  Antti Koivisto  <antti@apple.com>
2347
2348         Add way to dump cache meta data to file
2349         https://bugs.webkit.org/show_bug.cgi?id=142183
2350
2351         Add a missing return so we don't try to decode a null entry.
2352
2353         * NetworkProcess/cache/NetworkCache.cpp:
2354         (WebKit::NetworkCache::dumpContentsToFile):
2355
2356 2015-03-02  Anders Carlsson  <andersca@apple.com>
2357
2358         Return disk cache entries from the new disk cache
2359         https://bugs.webkit.org/show_bug.cgi?id=142190
2360
2361         Reviewed by Antti Koivisto.
2362
2363         * NetworkProcess/NetworkProcess.cpp:
2364         (WebKit::fetchDiskCacheEntries):
2365         Call NetworkCache::traverse() to get all the cache entries, unique their origins and pass them back with the completion handler.
2366
2367         * NetworkProcess/cache/NetworkCache.cpp:
2368         (WebKit::NetworkCache::traverse):
2369         New helper function that traverses network cache entries.
2370
2371         * NetworkProcess/cache/NetworkCache.h:
2372
2373 2015-03-02  Antti Koivisto  <antti@apple.com>
2374
2375         Add way to dump cache meta data to file
2376         https://bugs.webkit.org/show_bug.cgi?id=142183
2377
2378         Reviewed by Andreas Kling.
2379
2380         Dump goes to WebKitCache/dump.json. On OSX it can be triggered with
2381
2382         notifyutil -p com.apple.WebKit.Cache.dump
2383
2384         * NetworkProcess/cache/NetworkCache.cpp:
2385         (WebKit::NetworkCache::initialize):
2386         (WebKit::NetworkCache::dumpFilePath):
2387         (WebKit::entryAsJSON):
2388         (WebKit::NetworkCache::dumpContentsToFile):
2389         (WebKit::NetworkCache::clear):
2390
2391             Also clear any dumps.
2392
2393         * NetworkProcess/cache/NetworkCache.h:
2394         * NetworkProcess/cache/NetworkCacheStorage.h:
2395         (WebKit::NetworkCacheStorage::baseDirectoryPath):
2396         * NetworkProcess/cache/NetworkCacheStorageCocoa.mm:
2397         (WebKit::fileNameForKey):
2398         (WebKit::filePathForKey):
2399         (WebKit::openFile):
2400         (WebKit::openFileForKey):
2401         (WebKit::decodeEntryHeader):
2402
2403             Separate header decoding.
2404
2405         (WebKit::decodeEntry):
2406         (WebKit::NetworkCacheStorage::traverse):
2407
2408             Add asynchronous cache traversal inteface.
2409
2410 2015-03-02  Anders Carlsson  <andersca@apple.com>
2411
2412         WebsiteDataStore should handle deleting cookies
2413         https://bugs.webkit.org/show_bug.cgi?id=142185
2414
2415         Reviewed by Beth Dakin.
2416
2417         * NetworkProcess/NetworkProcess.cpp:
2418         (WebKit::NetworkProcess::deleteWebsiteDataForOrigins):
2419         When asked to delete cookies, do so.
2420
2421         * NetworkProcess/NetworkProcess.h:
2422         Update the deleteWebsiteDataForOrigins signature.
2423
2424         * NetworkProcess/NetworkProcess.messages.in:
2425         Add cookieHostNames to DeleteWebsiteDataForOrigins.
2426
2427         * UIProcess/Network/NetworkProcessProxy.cpp:
2428         (WebKit::NetworkProcessProxy::deleteWebsiteDataForOrigins):
2429         * UIProcess/Network/NetworkProcessProxy.h:
2430         Update to take a vector of cookie host names.
2431
2432         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2433         (WebKit::WebsiteDataStore::removeData):
2434         Figure out if we need to ask the network process to delete data.
2435
2436 2015-03-02  Anders Carlsson  <andersca@apple.com>
2437
2438         WebsiteDataStore should support getting cookie host names
2439         https://bugs.webkit.org/show_bug.cgi?id=142178
2440
2441         Reviewed by Dan Bernstein.
2442
2443         * NetworkProcess/NetworkProcess.cpp:
2444         (WebKit::NetworkProcess::fetchWebsiteData):
2445         Assert that we're destroyed from the main thread since we end up copying the website data struct.
2446
2447         * Shared/WebsiteData/WebsiteData.cpp:
2448         (WebKit::WebsiteData::encode):
2449         (WebKit::WebsiteData::decode):
2450         * Shared/WebsiteData/WebsiteData.h:
2451         Add a hostnamesWithCookies member.
2452
2453         * UIProcess/WebsiteData/WebsiteDataRecord.cpp:
2454         (WebKit::WebsiteDataRecord::displayNameForCookieHostName):
2455         Add a new function that will return the display name for a cookie host name.
2456
2457         (WebKit::WebsiteDataRecord::addCookieHostName):
2458         * UIProcess/WebsiteData/WebsiteDataRecord.h:
2459         Add a hash set of cookie host names.
2460
2461         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2462         (WebKit::WebsiteDataStore::fetchData):
2463         Create data records for each host name with cookies.
2464
2465 2015-03-02  Jer Noble  <jer.noble@apple.com>
2466
2467         [WK2][Mac] WebPageProxy::supressVisibilityUpdates() should suppress visibility updates.
2468         https://bugs.webkit.org/show_bug.cgi?id=141907
2469
2470         Reviewed by Tim Horton.
2471
2472         At some point, the window/view/page visibility update code was refactored such that setting
2473         WebPageProxy::setSuppressVisibilityUpdate() no longer suppressed visibility updates. This causes
2474         full screen animations to become "flashy" when moving the WebView between the regular and full
2475         screen window, as a HTMLMediaElement in the full screen animation will receive a "!visible"
2476         notification and disconnect its rendering pipeline.
2477
2478         In WebPageProxy::viewStateDidChange(), respect m_suppressVisibilityUpdates and bail out early
2479         if set. In WebPageProxy::setSuppressVisibilityUpdates(), trigger an explicit update after
2480         clearing m_suppressVisibilityUpdates.
2481
2482         * UIProcess/WebPageProxy.cpp:
2483         (WebKit::WebPageProxy::setSuppressVisibilityUpdates):
2484         (WebKit::WebPageProxy::viewStateDidChange):
2485         * UIProcess/WebPageProxy.h:
2486         (WebKit::WebPageProxy::setSuppressVisibilityUpdates): Deleted.
2487
2488 2015-03-02  Jer Noble  <jer.noble@apple.com>
2489
2490         [WK1][WK2][Mac] Fullscreen animation is incorrect when page is scaled.
2491         https://bugs.webkit.org/show_bug.cgi?id=142121
2492
2493         Reviewed by Simon Fraser.
2494
2495         Change the order of operations when entering or exiting fullscreen. Change the page scale to
2496         1 before entering, so the final screen rect takes that scale into account, and vice-versa on
2497         exiting.
2498
2499         * UIProcess/mac/WKFullScreenWindowController.mm:
2500         (-[WKFullScreenWindowController enterFullScreen:]):
2501         (-[WKFullScreenWindowController exitFullScreen]):
2502
2503 2015-03-01  Simon Fraser  <simon.fraser@apple.com>
2504
2505         Make clip-path work on <video>, <canvas> etc.
2506         https://bugs.webkit.org/show_bug.cgi?id=138684
2507
2508         Reviewed by Darin Adler.
2509         
2510         Support encode/decode for WebCore Path objects, which is done by traversing
2511         the path.
2512
2513         * Shared/WebCoreArgumentCoders.cpp:
2514         (IPC::pathPointCountApplierFunction):
2515         (IPC::pathEncodeApplierFunction):
2516         (IPC::ArgumentCoder<Path>::encode):
2517         (IPC::ArgumentCoder<Path>::decode):
2518         * Shared/WebCoreArgumentCoders.h:
2519         * Shared/mac/RemoteLayerTreePropertyApplier.mm:
2520         (WebKit::applyPropertiesToLayer): Actually apply the path and wind rule to the shape layer.
2521         * Shared/mac/RemoteLayerTreeTransaction.h: Include path and wind rule in the layer properties.
2522         * Shared/mac/RemoteLayerTreeTransaction.mm:
2523         (WebKit::RemoteLayerTreeTransaction::LayerProperties::LayerProperties):
2524         (WebKit::RemoteLayerTreeTransaction::LayerProperties::encode): Encode shape and wind rule.
2525         (WebKit::RemoteLayerTreeTransaction::LayerProperties::decode): Decode shape and wind rule.
2526         * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
2527         (WebKit::PlatformCALayerRemote::shapePath):
2528         (WebKit::PlatformCALayerRemote::setShapePath):
2529         (WebKit::PlatformCALayerRemote::shapeWindRule):
2530         (WebKit::PlatformCALayerRemote::setShapeWindRule):
2531         * WebProcess/WebPage/mac/PlatformCALayerRemote.h:
2532
2533 2015-03-01  Chris Dumez  <cdumez@apple.com>
2534
2535         Make NotificationCenter / Notification suspendable
2536         https://bugs.webkit.org/show_bug.cgi?id=142117
2537         <rdar://problem/19923085>
2538
2539         Reviewed by Andreas Kling.
2540
2541         Provide implementation for NotificationClient::hasPendingPermissionRequests().
2542
2543         * WebProcess/Notifications/NotificationPermissionRequestManager.cpp:
2544         (WebKit::NotificationPermissionRequestManager::hasPendingPermissionRequests):
2545         * WebProcess/Notifications/NotificationPermissionRequestManager.h:
2546         * WebProcess/WebCoreSupport/WebNotificationClient.cpp:
2547         (WebKit::WebNotificationClient::hasPendingPermissionRequests):
2548         * WebProcess/WebCoreSupport/WebNotificationClient.h:
2549
2550 2015-03-01  Antti Koivisto  <antti@apple.com>
2551
2552         Enable new disk cache on iOS
2553         https://bugs.webkit.org/show_bug.cgi?id=142148
2554
2555         Reviewed by Sam Weinig.
2556
2557         * NetworkProcess/cache/NetworkCacheStorageCocoa.mm:
2558
2559             iOS build fix.
2560
2561         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
2562         (WebKit::registerUserDefaultsIfNeeded):
2563
2564             Disable the efficacy logging by default for now. It has significant performance impact.
2565
2566         * config.h:
2567
2568             Enable it.
2569
2570 2015-02-28  Anders Carlsson  <andersca@apple.com>
2571
2572         WebsiteDataStore should handle fetching and deleting local storage data
2573         https://bugs.webkit.org/show_bug.cgi?id=142137
2574
2575         Reviewed by Sam Weinig.
2576
2577         * UIProcess/Storage/StorageManager.cpp:
2578         (WebKit::StorageManager::deleteEntriesForOrigins):
2579         Add a new function that deletes entries from multiple origins.
2580
2581         * UIProcess/Storage/StorageManager.h:
2582         Add new members.
2583
2584         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2585         (WebKit::WebsiteDataStore::fetchData):
2586         Fetch local storage data as well.
2587
2588         (WebKit::WebsiteDataStore::removeData):
2589         Delete local storage data as well.
2590
2591 2015-02-28  Anders Carlsson  <andersca@apple.com>
2592
2593         Fetch cache origins from the network process
2594         https://bugs.webkit.org/show_bug.cgi?id=142135
2595
2596         Reviewed by Dan Bernstein.
2597
2598         * NetworkProcess/NetworkProcess.cpp:
2599         (WebKit::cfURLCacheOrigins):
2600         Add a new helper function that returns a vector of CFURL cache origins.
2601
2602         (WebKit::fetchDiskCacheOrigins):
2603         Fetch the disk cache origins and pass them along to the completion handler. Currently we don't handle the new disk cache.
2604
2605         (WebKit::NetworkProcess::fetchWebsiteData):
2606         Create a callback aggregator and fetch disk cache origins if we're asked for it.
2607
2608         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2609         (WebKit::computeNetworkProcessAccessTypeForDataFetch):
2610         New helper function that computes if we need to launch the network process in order to fetch data.
2611
2612         (WebKit::WebsiteDataStore::fetchData):
2613         Fetch website data from the network process as well.
2614
2615 2015-02-28  Anders Carlsson  <andersca@apple.com>
2616
2617         Simplify WebResourceCacheManagerCFNet.mm code
2618         https://bugs.webkit.org/show_bug.cgi?id=142134
2619
2620         Reviewed by Dan Bernstein.
2621
2622         - ENABLE(CACHE_PARTITIONING) is always true on Mac and iOS, so remove those #ifdefs.
2623         - Make cfURLCacheHostNamesWithCallback and clearCFURLCacheForHostNames public
2624           so they can be used by the new WebsiteDataStore code in an upcoming patch.
2625         - Change cfURLCacheHostNamesWithCallback to take an std::function instead of a block.
2626
2627         * WebProcess/ResourceCache/WebResourceCacheManager.cpp:
2628         (WebKit::WebResourceCacheManager::getCacheOrigins):
2629         * WebProcess/ResourceCache/WebResourceCacheManager.h:
2630         * WebProcess/ResourceCache/cf/WebResourceCacheManagerCFNet.mm:
2631         (WebKit::partitionName):
2632         (WebKit::WebResourceCacheManager::cfURLCacheHostNamesWithCallback):
2633         (WebKit::WebResourceCacheManager::clearCFURLCacheForHostNames):
2634         (WebKit::WebResourceCacheManager::cfURLCacheHostNames): Deleted.
2635
2636 2015-02-28  Commit Queue  <commit-queue@webkit.org>
2637
2638         Unreviewed, rolling out r180804.
2639         https://bugs.webkit.org/show_bug.cgi?id=142131
2640
2641         Broke nightlies (Requested by ap on #webkit).
2642
2643         Reverted changeset:
2644
2645         "[WK2] Drop legacy WKBundlePageDiagnosticLoggingClient API"
2646         https://bugs.webkit.org/show_bug.cgi?id=141176
2647         http://trac.webkit.org/changeset/180804
2648
2649 2015-02-27  Hunseop Jeong  <hs85.jeong@samsung.com>
2650
2651         [EFL][GTK] Fix build break after r180790,180798 
2652         https://bugs.webkit.org/show_bug.cgi?id=142127
2653
2654         Reviewed by Gyuyoung Kim.
2655
2656         * CMakeLists.txt:
2657
2658 2015-02-27  Chris Dumez  <cdumez@apple.com>
2659
2660         [WK2] Drop legacy WKBundlePageDiagnosticLoggingClient API
2661         https://bugs.webkit.org/show_bug.cgi?id=141176
2662
2663         Reviewed by Sam Weinig.
2664
2665         Drop legacy WKBundlePageDiagnosticLoggingClient WK2 API as we are now
2666         exposing this functionality via WKPageDiagnosticLoggingClient.h on
2667         UIProcess side. The client-side has already been ported over.
2668
2669         * CMakeLists.txt:
2670         * Shared/API/c/WKSharedAPICast.h:
2671         (WebKit::toAPI): Deleted.
2672         (WebKit::toDiagnosticLoggingResultType): Deleted.
2673         * UIProcess/API/C/WKAPICast.h:
2674         (WebKit::toAPI):
2675         * UIProcess/API/C/WKDiagnosticLoggingResultType.h: Renamed from Source/WebKit2/Shared/API/c/WKDiagnosticLoggingResultType.h.
2676         * WebKit2.xcodeproj/project.pbxproj:
2677         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
2678         (WKBundlePageSetDiagnosticLoggingClient): Deleted.
2679         * WebProcess/InjectedBundle/API/c/WKBundlePage.h:
2680         * WebProcess/InjectedBundle/API/c/WKBundlePageDiagnosticLoggingClient.h: Removed.
2681         * WebProcess/InjectedBundle/InjectedBundlePageDiagnosticLoggingClient.cpp: Removed.
2682         * WebProcess/InjectedBundle/InjectedBundlePageDiagnosticLoggingClient.h: Removed.
2683         * WebProcess/WebCoreSupport/WebDiagnosticLoggingClient.cpp:
2684         (WebKit::WebDiagnosticLoggingClient::logDiagnosticMessage):
2685         (WebKit::WebDiagnosticLoggingClient::logDiagnosticMessageWithResult):
2686         (WebKit::WebDiagnosticLoggingClient::logDiagnosticMessageWithValue):
2687         * WebProcess/WebPage/WebPage.cpp:
2688         (WebKit::WebPage::WebPage):
2689         (WebKit::WebPage::close):
2690         (WebKit::WebPage::initializeInjectedBundleDiagnosticLoggingClient): Deleted.
2691         * WebProcess/WebPage/WebPage.h:
2692         (WebKit::WebPage::injectedBundleDiagnosticLoggingClient): Deleted.
2693
2694 2015-02-27  Anders Carlsson  <andersca@apple.com>
2695
2696         Rename WebResourceCacheManagerCFNet.cpp to WebResourceCacheManagerCFNet.mm
2697
2698         Rubber-stamped by Dan Bernstein.
2699
2700         This will let us use lambda to block conversion in a subsequent patch.
2701
2702         * WebKit2.xcodeproj/project.pbxproj:
2703         * WebProcess/ResourceCache/cf/WebResourceCacheManagerCFNet.mm: Renamed from Source/WebKit2/WebProcess/ResourceCache/cf/WebResourceCacheManagerCFNet.cpp.
2704
2705 2015-02-27  Commit Queue  <commit-queue@webkit.org>
2706
2707         Unreviewed, rolling out r180203 and r180210.
2708         https://bugs.webkit.org/show_bug.cgi?id=142116
2709
2710         broke process suspension and tile map (Requested by thorton on
2711         #webkit).
2712
2713         Reverted changesets:
2714
2715         "Adopt CAMachPort-as-layer-contents"
2716         https://bugs.webkit.org/show_bug.cgi?id=141687
2717         http://trac.webkit.org/changeset/180203
2718
2719         "Fix the !USE(IOSURFACE) build"
2720         http://trac.webkit.org/changeset/180210
2721
2722 2015-02-27  Sam Weinig  <sam@webkit.org>
2723
2724         Add WebKit2 SPI to create a DOM File object
2725         https://bugs.webkit.org/show_bug.cgi?id=142109
2726
2727         Reviewed by Tim Horton.
2728
2729         Add a new handle type for exposing a DOM File object to script. Follow
2730         the pattern of WKBundleNodeHandleRef and WKBundleRangeHandleRef with the
2731         new class WKBundleFileHandleRef. It can be created for a specific path,
2732         and then the JS wrapper can be obtained via WKBundleFrameGetJavaScriptWrapperForFileForWorld.
2733
2734         * Shared/API/APIObject.h:
2735         * Shared/API/c/WKBase.h:
2736         * WebKit2.xcodeproj/project.pbxproj:
2737         * WebProcess/InjectedBundle/API/c/WKBundleAPICast.h:
2738         * WebProcess/InjectedBundle/API/c/WKBundleFileHandleRef.cpp: Added.
2739         (WKBundleFileHandleGetTypeID):
2740         (WKBundleFileHandleCreateWithPath):
2741         * WebProcess/InjectedBundle/API/c/WKBundleFileHandleRef.h: Added.
2742         * WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp:
2743         (WKBundleFrameGetJavaScriptWrapperForFileForWorld):
2744         * WebProcess/InjectedBundle/API/c/WKBundleFrame.h:
2745         * WebProcess/InjectedBundle/DOM/InjectedBundleFileHandle.cpp: Added.
2746         (WebKit::domHandleCache):
2747         (WebKit::InjectedBundleFileHandle::create):
2748         (WebKit::InjectedBundleFileHandle::getOrCreate):
2749         (WebKit::InjectedBundleFileHandle::InjectedBundleFileHandle):
2750         (WebKit::InjectedBundleFileHandle::~InjectedBundleFileHandle):
2751         (WebKit::InjectedBundleFileHandle::coreFile):
2752         * WebProcess/InjectedBundle/DOM/InjectedBundleFileHandle.h: Added.
2753         * WebProcess/WebPage/WebFrame.cpp:
2754         (WebKit::WebFrame::jsWrapperForWorld):
2755         * WebProcess/WebPage/WebFrame.h:
2756
2757 2015-02-27  Beth Dakin  <bdakin@apple.com>
2758
2759         Lookup panel dismisses when pages are loading in other tabs/windows
2760         https://bugs.webkit.org/show_bug.cgi?id=142104
2761         -and corresponding-
2762         rdar://problem/19882137
2763
2764         Reviewed by Tim Horton.
2765
2766         Until rdar://problem/13875766 is resolved, we should only call into Lookup and 
2767         DataDetectors for key windows.
2768         * UIProcess/API/mac/WKView.mm:
2769         (-[WKView _dismissContentRelativeChildWindows]):
2770
2771 2015-02-27  Anders Carlsson  <andersca@apple.com>
2772
2773         Add infrastructure for handling website data in the network process
2774         https://bugs.webkit.org/show_bug.cgi?id=142092
2775
2776         Reviewed by Andreas Kling.
2777
2778         * NetworkProcess/NetworkProcess.cpp:
2779         (WebKit::NetworkProcess::fetchWebsiteData):
2780         (WebKit::NetworkProcess::deleteWebsiteDataForOrigins):
2781         Send back "Did" messages without actually doing anything for now.
2782
2783         * NetworkProcess/NetworkProcess.h:
2784         Add new members.
2785
2786         * NetworkProcess/NetworkProcess.messages.in:
2787         Add FetchWebsiteData and DeleteWebsiteDataForOrigins messages.
2788
2789         * UIProcess/Network/NetworkProcessProxy.cpp:
2790         (WebKit::NetworkProcessProxy::~NetworkProcessProxy):
2791         Assert that all maps are empty.
2792
2793         (WebKit::NetworkProcessProxy::fetchWebsiteData):
2794         (WebKit::NetworkProcessProxy::deleteWebsiteDataForOrigins):
2795         Add callbacks and send fetch and delete messages respectively.
2796
2797         (WebKit::NetworkProcessProxy::networkProcessCrashedOrFailedToLaunch):
2798         Make sure to invoke all callbacks.
2799
2800         (WebKit::NetworkProcessProxy::didFetchWebsiteData):
2801         Find the callback and invoke it.
2802
2803         (WebKit::NetworkProcessProxy::didDeleteWebsiteDataForOrigins):
2804         Ditto.
2805
2806         * UIProcess/Network/NetworkProcessProxy.h:
2807         Add new members.
2808
2809         * UIProcess/Network/NetworkProcessProxy.messages.in:
2810         Add DidFetchWebsiteData and DidDeleteWebsiteDataForOrigins messages.
2811
2812         * UIProcess/WebProcessProxy.cpp:
2813         (WebKit::WebProcessProxy::connectionDidClose):
2814         Just pass an empty WebsiteData object.
2815
2816 2015-02-26  Enrica Casucci  <enrica@apple.com>
2817
2818         [WK2] REGRESSION(r180465): WebKit::WebPage::editorState() triggers a layout.
2819         https://bugs.webkit.org/show_bug.cgi?id=142015
2820
2821         Reviewed by Alexey Proskuryakov.
2822
2823         We no longer compute the font information at selection
2824         when we update the editor state.
2825         Instead, we request the font information only when the selection
2826         changes and the font panel is visible.
2827         I added an observer to be notified of the font panel visibility
2828         changes to update NSFontManager to reflect the font at the
2829         current selection.
2830
2831         * Shared/EditorState.cpp:
2832         (WebKit::EditorState::encode):
2833         (WebKit::EditorState::decode):
2834         * Shared/EditorState.h:
2835         (WebKit::EditorState::EditorState):
2836         * UIProcess/API/mac/WKView.mm:
2837         (-[WKView updateFontPanelIfNeeded]):
2838         (-[WKView _selectionChanged]):
2839         (-[WKView addWindowObserversForWindow:]):
2840         (-[WKView removeWindowObservers]):
2841         (-[WKView observeValueForKeyPath:ofObject:change:context:]):
2842         * UIProcess/WebPageProxy.h:
2843         * UIProcess/WebPageProxy.messages.in:
2844         * UIProcess/mac/WebPageProxyMac.mm:
2845         (WebKit::WebPageProxy::fontAtSelection):
2846         (WebKit::WebPageProxy::fontAtSelectionCallback):
2847         * WebProcess/WebPage/WebPage.h:
2848         * WebProcess/WebPage/WebPage.messages.in:
2849         * WebProcess/WebPage/mac/WebPageMac.mm:
2850         (WebKit::WebPage::platformEditorState):
2851         (WebKit::WebPage::fontAtSelection):
2852
2853 2015-02-27  Brady Eidson  <beidson@apple.com>
2854
2855         Add API to remove a single content filter.
2856         <rdar://problem/19977764> and https://bugs.webkit.org/show_bug.cgi?id=142088
2857
2858         Reviewed by Sam Weinig.
2859
2860         * Shared/WebPageGroupData.h:
2861
2862         * UIProcess/API/C/WKPageGroup.cpp:
2863         (WKPageGroupRemoveUserContentFilter):
2864
2865         * UIProcess/API/C/WKPageGroup.h:
2866         * UIProcess/API/Cocoa/WKUserContentController.mm:
2867         (-[WKUserContentController _removeUserContentFilter:]):
2868
2869         * UIProcess/API/Cocoa/WKUserContentControllerPrivate.h:
2870         * UIProcess/UserContent/WebUserContentControllerProxy.cpp:
2871         (WebKit::WebUserContentControllerProxy::WebUserContentControllerProxy):
2872         (WebKit::WebUserContentControllerProxy::addProcess):
2873         (WebKit::WebUserContentControllerProxy::addUserContentFilter):
2874         (WebKit::WebUserContentControllerProxy::removeUserContentFilter):
2875         (WebKit::WebUserContentControllerProxy::removeAllUserContentFilters):
2876         * UIProcess/UserContent/WebUserContentControllerProxy.h:
2877
2878         * UIProcess/WebPageGroup.cpp:
2879         (WebKit::WebPageGroup::addUserContentFilter):
2880         (WebKit::WebPageGroup::removeUserContentFilter):
2881         * UIProcess/WebPageGroup.h:
2882
2883         * WebProcess/UserContent/WebUserContentController.cpp:
2884         (WebKit::WebUserContentController::removeUserContentFilter):
2885         * WebProcess/UserContent/WebUserContentController.h:
2886         * WebProcess/UserContent/WebUserContentController.messages.in:
2887
2888         * WebProcess/WebPage/WebPageGroupProxy.cpp:
2889         (WebKit::WebPageGroupProxy::WebPageGroupProxy):
2890         (WebKit::WebPageGroupProxy::removeUserContentFilter):
2891         * WebProcess/WebPage/WebPageGroupProxy.h:
2892         * WebProcess/WebPage/WebPageGroupProxy.messages.in:
2893
2894 2015-02-26  Anders Carlsson  <andersca@apple.com>
2895
2896         Add API to remove all website data for the given data records
2897         https://bugs.webkit.org/show_bug.cgi?id=142060
2898
2899         Reviewed by Beth Dakin.
2900
2901         * UIProcess/API/Cocoa/_WKWebsiteDataStore.h:
2902         Add new method declaration.
2903
2904         * UIProcess/API/Cocoa/_WKWebsiteDataStore.mm:
2905         (toWebsiteDataRecords):
2906         Add a helper function that converts an NSArray of _WKWebsiteDataRecords to a Vector of WebsiteDataRecords.
2907
2908         (-[_WKWebsiteDataStore removeDataOfTypes:forDataRecords:completionHandler:]):
2909         Call through to the underlying WebsiteDataStore.
2910
2911         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2912         (WebKit::WebsiteDataStore::removeData):
2913         Figure out which processes to call deleteWebsiteDataForOrigins for and do so. Add a callback aggregator so we can
2914         call the completion handler at the right time.
2915
2916         * UIProcess/WebsiteData/WebsiteDataStore.h:
2917         Add new members.
2918
2919         * WebProcess/WebProcess.cpp:
2920         (WebKit::WebProcess::deleteWebsiteDataForOrigins):
2921         Use the newly added MemoryCache member function to delete all resources matching the set of origins.
2922
2923 2015-02-26  Chris Dumez  <cdumez@apple.com>
2924
2925         Rename DatabaseManager::manager() to DatabaseManager::singleton()
2926         https://bugs.webkit.org/show_bug.cgi?id=142054
2927
2928         Reviewed by Ryosuke Niwa.
2929
2930         Rename DatabaseManager::manager() to DatabaseManager::singleton() as
2931         per coding style and use WTF::NeverDestroyed.
2932
2933         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2934         (WebKit::WebChromeClient::exceededDatabaseQuota):
2935         * WebProcess/WebCoreSupport/WebDatabaseManager.cpp:
2936         (WebKit::WebDatabaseManager::initialize):
2937         (WebKit::WebDatabaseManager::getDatabasesByOrigin):
2938         (WebKit::WebDatabaseManager::getDatabaseOrigins):
2939         (WebKit::WebDatabaseManager::deleteDatabaseWithNameForOrigin):
2940         (WebKit::WebDatabaseManager::deleteDatabasesForOrigin):
2941         (WebKit::WebDatabaseManager::deleteAllDatabases):
2942         (WebKit::WebDatabaseManager::setQuotaForOrigin):
2943         * WebProcess/WebPage/WebPage.cpp:
2944         (WebKit::WebPage::updatePreferences):
2945
2946 2015-02-26  Myles C. Maxfield  <mmaxfield@apple.com>
2947
2948         [Mac] [iOS] Parsing support for -apple-trailing-word
2949         https://bugs.webkit.org/show_bug.cgi?id=141939
2950
2951         Reviewed by Andreas Kling.
2952
2953         * Configurations/FeatureDefines.xcconfig:
2954
2955 2015-02-26  Brady Eidson  <beidson@apple.com>
2956
2957         Make WKPageGroupRemoveAllUserContentFilters actually remove all user content filters
2958         https://bugs.webkit.org/show_bug.cgi?id=142047
2959
2960         Reviewed by Geoff Garen.
2961
2962         * UIProcess/API/C/WKPageGroup.cpp:
2963         (WKPageGroupRemoveAllUserContentFilters): Remove all content filters instead of removing all user scripts.
2964
2965 2015-02-25  Anders Carlsson  <andersca@apple.com>
2966
2967         Add (unused for now) code to delete website data for a set of origins
2968         https://bugs.webkit.org/show_bug.cgi?id=142019
2969
2970         Reviewed by Beth Dakin.
2971
2972         * UIProcess/WebProcessProxy.cpp:
2973         (WebKit::WebProcessProxy::~WebProcessProxy):
2974         Assert that there are no pending callbacks.
2975
2976         (WebKit::WebProcessProxy::connectionDidClose):
2977         Invoke all the didDeleteWebsiteDataForOrigins callbacks.
2978
2979         (WebKit::WebProcessProxy::didDeleteWebsiteDataForOrigins):
2980         Grab the didDeleteWebsiteDataForOrigins and invoke it.
2981
2982         (WebKit::WebProcessProxy::deleteWebsiteDataForOrigins):
2983         Add the pending callback and send a DeleteWebsiteDataForOrigins to the web process.
2984
2985         * UIProcess/WebProcessProxy.h:
2986         Add new members.
2987
2988         * UIProcess/WebProcessProxy.messages.in:
2989         Add a DidDeleteWebsiteDataForOrigins message.
2990
2991         * WebProcess/WebProcess.cpp:
2992         (WebKit::WebProcess::deleteWebsiteDataForOrigins):
2993         For now, just send back a DidDeleteWebsiteDataForOrigins message.
2994
2995         * WebProcess/WebProcess.h:
2996         Add new members.
2997
2998         * WebProcess/WebProcess.messages.in:
2999         Add a DeleteWebsiteDataForOrigins message.
3000
3001 2015-02-25  Shivakumar JM  <shiva.jm@samsung.com>
3002
3003         Fix build warning in WebKit2/UIProcess module.
3004         https://bugs.webkit.org/show_bug.cgi?id=142014
3005
3006         Reviewed by Anders Carlsson.
3007
3008         Fix build warning by using UNUSED_PARAM macro.
3009
3010         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
3011         (WebKit::computeWebProcessAccessTypeForDataFetch):
3012
3013 2015-02-24  Simon Fraser  <simon.fraser@apple.com>
3014
3015         Clarify some resizing terminology in ScrollView/FrameView
3016         https://bugs.webkit.org/show_bug.cgi?id=141996
3017
3018         Reviewed by Zalan Bujtas.
3019
3020         ScrollableArea/ScrollView/FrameView had some confusing terminology around
3021         contentsResized/visibleContentsResized/fixedLayoutSizeChanged.
3022         
3023         Clarify this by distinguishing between:
3024         1. Available size changes because of
3025             i) non-overlay scrollbar presence
3026            ii) ScrollableArea frame change
3027         2. Removing fixedLayoutSizeChanged() and just treating it like an
3028            available size change.
3029            
3030         contentsResized() is relegated to simply being a hook that allows Mac to
3031         flash overlay scrollbars.
3032         
3033         The confusingly named visibleContentsResized() is now updateContentsSize(),
3034         and is the way that a ScrollableArea tells its subclasss that it should recompute
3035         the size of the contents (i.e. do a layout).
3036
3037         * WebProcess/Plugins/PDF/PDFPlugin.mm:
3038         (WebKit::PDFPlugin::scrollbarStyleChanged): Call the base class method,
3039         which takes care of 
3040
3041 2015-02-24  Simon Fraser  <simon.fraser@apple.com>
3042
3043         Use an enum for scrollbar style
3044         https://bugs.webkit.org/show_bug.cgi?id=141985
3045
3046         Reviewed by Beth Dakin.
3047         
3048         Switch to an enum class for the scrollbar style (normal or overlay).
3049         
3050         Sadly it still has to be passed as an int across the process boundary.
3051
3052         * UIProcess/PageClient.h:
3053         * UIProcess/WebPageProxy.cpp:
3054         (WebKit::WebPageProxy::recommendedScrollbarStyleDidChange):
3055         * UIProcess/mac/PageClientImpl.h:
3056         * UIProcess/mac/PageClientImpl.mm:
3057         (WebKit::PageClientImpl::recommendedScrollbarStyleDidChange):
3058         * WebProcess/Plugins/PDF/PDFPlugin.h:
3059         * WebProcess/Plugins/PDF/PDFPlugin.mm:
3060         (WebKit::PDFPlugin::scrollbarStyleChanged):
3061         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
3062         (WebKit::WebChromeClient::recommendedScrollbarStyleDidChange):
3063         * WebProcess/WebCoreSupport/WebChromeClient.h:
3064
3065 2015-02-24  Chris Dumez  <cdumez@apple.com>
3066
3067         [Mac][WK2] ASSERTION FAILED: m_sendPort in IPC::Connection::open()
3068         https://bugs.webkit.org/show_bug.cgi?id=141934
3069
3070         Reviewed by Darin Adler.
3071
3072         Speculative fix for "ASSERTION FAILED: m_sendPort" in
3073         IPC::Connection::open(). This assertion seems to indicate we ended
3074         up in IPC::Connection::open() with MACH_PORT_NULL as port.
3075
3076         I found that in XPCServiceInitializerDelegate::getConnectionIdentifier()
3077         we return true unconditionally, even though
3078         xpc_dictionary_copy_mach_send() can return MACH_PORT_NULL. This patch
3079         updates this method to add a check for MACH_PORT_NULL and return false
3080         in this case.
3081
3082         * Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.mm:
3083         (WebKit::XPCServiceInitializerDelegate::getConnectionIdentifier):
3084
3085 2015-02-24  Commit Queue  <commit-queue@webkit.org>
3086
3087         Unreviewed, rolling out r180599.
3088         https://bugs.webkit.org/show_bug.cgi?id=141998
3089
3090         Lots of new test failures (Requested by smfr on #webkit).
3091
3092         Reverted changeset:
3093
3094         "Parsing support for -webkit-trailing-word"
3095         https://bugs.webkit.org/show_bug.cgi?id=141939
3096         http://trac.webkit.org/changeset/180599
3097
3098 2015-02-24  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
3099
3100         Fix build break on EFL and GTK port since r180585.
3101         https://bugs.webkit.org/show_bug.cgi?id=141994
3102
3103         Reviewed by Joseph Pecoraro.
3104
3105         * UIProcess/WebsiteData/WebsiteDataRecord.cpp:
3106         (WebKit::WebsiteDataRecord::displayNameForOrigin):
3107         * UIProcess/WebsiteData/WebsiteDataRecord.h:
3108         (WebKit::WebsiteDataRecord::WebsiteDataRecord):
3109
3110 2015-02-24  Myles C. Maxfield  <mmaxfield@apple.com>
3111
3112         [Mac] [iOS] Parsing support for -apple-trailing-word
3113         https://bugs.webkit.org/show_bug.cgi?id=141939
3114
3115         Reviewed by Andreas Kling.
3116
3117         * Configurations/FeatureDefines.xcconfig:
3118
3119 2015-02-24  Csaba Osztrogonác  <ossy@webkit.org>
3120
3121         Buildfix after r180585.
3122
3123         * CMakeLists.txt:
3124
3125 2015-02-24  Anders Carlsson  <andersca@apple.com>
3126
3127         Pass _WKWebsiteDataRecord objects to the fetchData completion handler
3128         https://bugs.webkit.org/show_bug.cgi?id=141984
3129
3130         Reviewed by Andreas Kling.
3131
3132         * Shared/Cocoa/APIObject.mm:
3133         (API::Object::newObject):
3134         Create _WKWebsiteDataRecord objects for WebsiteDataRecord API objects.
3135
3136         * UIProcess/API/APIWebsiteDataRecord.h:
3137         Add WebsiteDataRecord getter.
3138
3139         * UIProcess/API/Cocoa/_WKWebsiteDataRecord.h:
3140         Add displayName and dataTypes properties.
3141
3142         * UIProcess/API/Cocoa/_WKWebsiteDataRecord.mm:
3143         (dataTypesToString):
3144         Helper function to convert dataTypes bit-fields to strings.
3145
3146         (-[_WKWebsiteDataRecord description]):
3147         Include the display name and data types in the description.
3148
3149         (-[_WKWebsiteDataRecord displayName]):
3150         Return the display name.
3151
3152         (-[_WKWebsiteDataRecord dataTypes]):
3153         Return the data types.
3154
3155         * UIProcess/API/Cocoa/_WKWebsiteDataRecordInternal.h:
3156         (WebKit::toWebsiteDataTypes):
3157         Move this here from _WKWebsiteDataStore.mm.
3158
3159         (WebKit::toWKWebsiteDataTypes):
3160         Add new function to convert WebsiteDataTypes to WKWebsiteDataTypes.
3161
3162         * UIProcess/API/Cocoa/_WKWebsiteDataStore.mm:
3163         (-[_WKWebsiteDataStore fetchDataRecordsOfTypes:completionHandler:]):
3164         (-[_WKWebsiteDataStore removeDataOfTypes:modifiedSince:completionHandler:]):
3165         Qualify toWebsiteDataTypes calls.
3166
3167         * UIProcess/WebsiteData/WebsiteDataRecord.cpp: Added.
3168         (WebKit::WebsiteDataRecord::displayNameForOrigin):
3169         New helper that returns a display name given an origin.
3170
3171         (WebKit::WebsiteDataRecord::add):
3172         Add the origin as well as the type.
3173
3174         * UIProcess/WebsiteData/WebsiteDataRecord.h:
3175         Add new members.
3176
3177         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
3178         (WebKit::WebsiteDataStore::fetchData):
3179         Loop through the entries and add them to the m_websiteDataRecords hash map, which
3180         is keyed off of the display name. Pass the m_websiteDataRecords values to the completion handler.
3181
3182         * WebKit2.xcodeproj/project.pbxproj:
3183
3184 2015-02-24  Csaba Osztrogonác  <ossy@webkit.org>
3185
3186         One more buildfix after r180575.
3187
3188         * UIProcess/WebProcessProxy.cpp:
3189         (WebKit::WebProcessProxy::connectionDidClose):
3190
3191 2015-02-24  Csaba Osztrogonác  <ossy@webkit.org>
3192
3193         URTBF after 180575.
3194
3195         * CMakeLists.txt:
3196
3197 2015-02-24  Anders Carlsson  <andersca@apple.com>
3198
3199         Implement more of the data fetching API
3200         https://bugs.webkit.org/show_bug.cgi?id=141975
3201
3202         Reviewed by Andreas Kling.
3203
3204         * Shared/WebsiteData/WebsiteData.cpp: Added.
3205         (WebKit::WebsiteData::Entry::encode):
3206         (WebKit::WebsiteData::Entry::decode):
3207         (WebKit::WebsiteData::encode):
3208         (WebKit::WebsiteData::decode):
3209         * Shared/WebsiteData/WebsiteData.h: Added.
3210         Add a new WebsiteData class that will store website data. Currently it only stores
3211         origin + website data type, but in the future it is going to store more things, like 
3212         host names that have cookies associated.
3213
3214         * UIProcess/WebProcessProxy.cpp:
3215         (WebKit::WebProcessProxy::~WebProcessProxy):
3216         Assert that we don't have any pending fetch data callbacks.
3217
3218         (WebKit::WebProcessProxy::connectionDidClose):
3219         Invoke any pending fetch website data callbacks.
3220
3221         (WebKit::WebProcessProxy::didFetchWebsiteData):
3222         Grab the callback and invoke it.
3223
3224         (WebKit::WebProcessProxy::fetchWebsiteData):
3225         Set up a pending callback and send a FetchWebsiteData message to the web process.
3226
3227         * UIProcess/WebProcessProxy.h:
3228         Add new member.
3229
3230         * UIProcess/WebProcessProxy.messages.in:
3231         Add a DidFetchWebsiteData message.
3232
3233         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
3234         (WebKit::computeWebProcessAccessTypeForDataFetch):
3235         Return the web process access type for the given set of data types.
3236
3237         (WebKit::WebsiteDataStore::fetchData):
3238         Set up a callback aggregator that will assemble the needed website data into a vector of website data records.
3239
3240         (WebKit::computeNetworkProcessAccessTypeForDataRemoval):
3241         (WebKit::computeWebProcessAccessTypeForDataRemoval):
3242         Rename these functions to indicate that they are about data removal.
3243
3244         (WebKit::WebsiteDataStore::removeData):
3245         Append "ForDataRemoval" to function calls.
3246
3247         * WebKit2.xcodeproj/project.pbxproj:
3248         Add new files.
3249
3250         * WebProcess/Storage/StorageAreaMap.cpp:
3251         (WebKit::StorageAreaMap::StorageAreaMap):
3252         Tighten types.
3253
3254         * WebProcess/WebProcess.cpp:
3255         (WebKit::WebProcess::fetchWebsiteData):
3256         For now, just fetch memory cache data.
3257
3258         * WebProcess/WebProcess.h:
3259         Add new members.
3260
3261         * WebProcess/WebProcess.messages.in:
3262         Add FetchWebsiteData message.
3263
3264 2015-02-24  Yusuke Suzuki  <utatane.tea@gmail.com>
3265
3266         REGRESSION(r179429): Can't type comments in Facebook
3267         https://bugs.webkit.org/show_bug.cgi?id=141859
3268
3269         Reviewed by Brent Fulgham.
3270
3271         Enable SymbolEnabled in inspector context.
3272
3273         * Shared/WebPreferencesDefinitions.h:
3274         * UIProcess/API/C/WKPreferences.cpp:
3275         (WKPreferencesSetJavaScriptRuntimeFlags):
3276         (WKPreferencesGetJavaScriptRuntimeFlags):
3277         (WKPreferencesSetJavaScriptExperimentsEnabled): Deleted.
3278         (WKPreferencesGetJavaScriptExperimentsEnabled): Deleted.
3279         * UIProcess/API/C/WKPreferencesRef.h:
3280         * UIProcess/API/C/WKPreferencesRefPrivate.h:
3281         * UIProcess/API/Cocoa/WKPreferences.mm:
3282         (-[WKPreferences _javaScriptRuntimeFlags]):
3283         (-[WKPreferences _setJavaScriptRuntimeFlags:]):
3284         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
3285         * UIProcess/efl/WebInspectorProxyEfl.cpp:
3286         (WebKit::WebInspectorProxy::platformCreateInspectorPage):
3287         * UIProcess/gtk/WebInspectorProxyGtk.cpp:
3288         (WebKit::WebInspectorProxy::platformCreateInspectorPage):
3289         * UIProcess/mac/WebInspectorProxyMac.mm:
3290         (WebKit::WebInspectorProxy::platformCreateInspectorPage):
3291         * WebProcess/WebPage/WebPage.cpp:
3292         (WebKit::WebPage::updatePreferences):
3293         * mac/WebKit2.order:
3294
3295 2015-02-24  Anders Carlsson  <andersca@apple.com>
3296
3297         Tighten up some SecurityOrigin related code, use references where possible
3298         https://bugs.webkit.org/show_bug.cgi?id=141971
3299
3300         Reviewed by Antti Koivisto.
3301
3302         * DatabaseProcess/DatabaseProcess.cpp:
3303         (WebKit::DatabaseProcess::getIndexedDatabaseOrigins):
3304         * Shared/SecurityOriginData.cpp:
3305         (WebKit::SecurityOriginData::fromSecurityOrigin):
3306         (WebKit::SecurityOriginData::securityOrigin):
3307         * Shared/SecurityOriginData.h:
3308         * UIProcess/Storage/StorageManager.cpp:
3309         (WebKit::StorageManager::createTransientLocalStorageMap):
3310         * WebProcess/Databases/IndexedDB/WebIDBServerConnection.cpp:
3311         (WebKit::WebIDBServerConnection::WebIDBServerConnection):
3312         * WebProcess/MediaCache/WebMediaKeyStorageManager.cpp:
3313         (WebKit::WebMediaKeyStorageManager::getMediaKeyOrigins):
3314         * WebProcess/Storage/StorageAreaMap.cpp:
3315         (WebKit::StorageAreaMap::create):
3316         (WebKit::StorageAreaMap::StorageAreaMap):
3317         (WebKit::StorageAreaMap::dispatchSessionStorageEvent):
3318         (WebKit::StorageAreaMap::dispatchLocalStorageEvent):
3319         * WebProcess/Storage/StorageAreaMap.h:
3320         * WebProcess/Storage/StorageNamespaceImpl.cpp:
3321         (WebKit::StorageNamespaceImpl::storageArea):
3322
3323 2015-02-24  Michael Catanzaro  <mcatanzaro@igalia.com>
3324
3325         Crash loading local file with WebPageProxy::loadAlternateHTMLString
3326         https://bugs.webkit.org/show_bug.cgi?id=141867
3327
3328         Reviewed by Anders Carlsson.
3329
3330         WebPageProxy::loadAlternateHTMLString needs to assume read access to unreachableURL as well
3331         as baseURL, because unreachableURL will get added to the back/forward list, causing us to
3332         crash later on when we notice the unexpected URL received in checkURLReceivedFromWebProcess.
3333
3334         * UIProcess/WebPageProxy.cpp:
3335         (WebKit::WebPageProxy::loadAlternateHTMLString):
3336
3337 2015-02-24  Ryuan Choi  <ryuan.choi@navercorp.com>
3338
3339         [EFL] Add message APIs to communicate between ewk_context and extensions
3340         https://bugs.webkit.org/show_bug.cgi?id=137660
3341
3342         Reviewed by Gyuyoung Kim.
3343
3344         * PlatformEfl.cmake: Added dependencies for ewk2UnitTestExtensionSample
3345         * UIProcess/API/efl/ewk_context.cpp:
3346         (EwkContext::EwkContext):
3347         (EwkContext::didReceiveMessageFromInjectedBundle):
3348         (EwkContext::setMessageFromExtensionCallback):
3349         (EwkContext::processReceivedMessageFromInjectedBundle):
3350         (ewk_context_message_post_to_extensions):
3351         (ewk_context_message_from_extensions_callback_set):
3352         (EwkContext::didReceiveSynchronousMessageFromInjectedBundle):
3353         Deleted to split synchronouse message APIs from asynchronuous message APIs.
3354         ewebkit will not support this until there are requirements.
3355         (EwkContext::setMessageFromInjectedBundleCallback): Renamed to setMessageFromExtensionCallback.
3356         (ewk_context_message_post_to_injected_bundle): Renamed to ewk_context_message_post_to_extensions.
3357         (ewk_context_message_from_injected_bundle_callback_set): Renamed to ewk_context_message_from_injected_bundle_callback_set.
3358         * UIProcess/API/efl/ewk_context.h:
3359         * UIProcess/API/efl/ewk_context_private.h:
3360         * UIProcess/API/efl/tests/UnitTestUtils/EWK2UnitTestBase.cpp:
3361         Improved test case for ewk_context_new_with_extensions_path using the message APIs.
3362         (EWK2UnitTest::EWK2UnitTestBase::EWK2UnitTestBase):
3363         (EWK2UnitTest::EWK2UnitTestBase::SetUp):
3364         * UIProcess/API/efl/tests/UnitTestUtils/EWK2UnitTestBase.h:
3365         * UIProcess/API/efl/tests/UnitTestUtils/EWK2UnitTestEnvironment.cpp:
3366         (EWK2UnitTest::EWK2UnitTestEnvironment::extensionSample): Deleted.
3367         * UIProcess/API/efl/tests/UnitTestUtils/EWK2UnitTestEnvironment.h:
3368         * UIProcess/API/efl/tests/extensions/extension_sample.cpp:
3369         Improved test case for ewk_context_new_with_extensions_path using the message APIs.
3370         * UIProcess/API/efl/tests/test_ewk2_context.cpp: Ditto.
3371         (EWK2ContextTestWithExtension::messageReceivedCallback):
3372         (EWK2ContextTestWithExtension::EWK2ContextTestWithExtension):
3373         (TEST_F):
3374         * WebProcess/InjectedBundle/API/efl/ewk_extension.cpp:
3375         (toEwkExtendion):
3376         (EwkExtension::EwkExtension):
3377         (EwkExtension::didCreatePage):
3378         (EwkExtension::willDestroyPage):
3379         (EwkExtension::didReceiveMessage):
3380         (EwkExtension::didReceiveMessageToPage):
3381         (ewk_extension_message_post): Implemented to post message to ewk_context.
3382         * WebProcess/InjectedBundle/API/efl/ewk_extension.h:
3383         * WebProcess/InjectedBundle/API/efl/ewk_extension_private.h:
3384         (EwkExtension::bundle):
3385         * WebProcess/efl/ExtensionManagerEfl.cpp:
3386         (WebKit::ExtensionManagerEfl::initialize):
3387         Fixed the bug when there are different shared objects in extension path.
3388         This is spotted while improving test case.
3389
3390 2015-02-23  Commit Queue  <commit-queue@webkit.org>
3391
3392         Unreviewed, rolling out r180547 and r180550.
3393         https://bugs.webkit.org/show_bug.cgi?id=141957
3394
3395         Broke 10 Windows tests. (Requested by bfulgham_ on #webkit).
3396
3397         Reverted changesets:
3398
3399         "REGRESSION(r179429): Can't type comments in Facebook"
3400         https://bugs.webkit.org/show_bug.cgi?id=141859
3401         http://trac.webkit.org/changeset/180547
3402
3403         "Constructor returning null should construct an object instead
3404         of null"
3405         https://bugs.webkit.org/show_bug.cgi?id=141640
3406         http://trac.webkit.org/changeset/180550
3407
3408 2015-02-23  Ryosuke Niwa  <rniwa@webkit.org>
3409
3410         Disable font loading events until our implementation gets updated to match the latest spec
3411         https://bugs.webkit.org/show_bug.cgi?id=141938
3412
3413         Reviewed by Andreas Kling.
3414
3415         * Configurations/FeatureDefines.xcconfig:
3416
3417 2015-02-23  Yusuke Suzuki  <utatane.tea@gmail.com>
3418
3419         REGRESSION(r179429): Can't type comments in Facebook
3420         https://bugs.webkit.org/show_bug.cgi?id=141859
3421
3422         Reviewed by Geoffrey Garen.
3423
3424         Enable SymbolEnabled in inspector context.
3425
3426         * Shared/WebPreferencesDefinitions.h:
3427         * UIProcess/API/C/WKPreferences.cpp:
3428         (WKPreferencesSetJavaScriptRuntimeFlags):
3429         (WKPreferencesGetJavaScriptRuntimeFlags):
3430         (WKPreferencesSetJavaScriptExperimentsEnabled): Deleted.
3431         (WKPreferencesGetJavaScriptExperimentsEnabled): Deleted.
3432         * UIProcess/API/C/WKPreferencesRef.h:
3433         * UIProcess/API/C/WKPreferencesRefPrivate.h:
3434         * UIProcess/API/Cocoa/WKPreferences.mm:
3435         (-[WKPreferences _javaScriptRuntimeFlags]):
3436         (-[WKPreferences _setJavaScriptRuntimeFlags:]):
3437         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
3438         * UIProcess/efl/WebInspectorProxyEfl.cpp:
3439         (WebKit::WebInspectorProxy::platformCreateInspectorPage):
3440         * UIProcess/gtk/WebInspectorProxyGtk.cpp:
3441         (WebKit::WebInspectorProxy::platformCreateInspectorPage):
3442         * UIProcess/mac/WebInspectorProxyMac.mm:
3443         (WebKit::WebInspectorProxy::platformCreateInspectorPage):
3444         * WebProcess/WebPage/WebPage.cpp:
3445         (WebKit::WebPage::updatePreferences):
3446         * mac/WebKit2.order:
3447
3448 2015-02-23  Benjamin Poulain  <bpoulain@apple.com>
3449
3450         [iOS WK2] The WebProcess keep scrolling pages based on the last velocity after scrolling has been interrupted
3451         https://bugs.webkit.org/show_bug.cgi?id=141933
3452         rdar://problem/18746673
3453         rdar://problem/19711490
3454
3455         Reviewed by Simon Fraser.
3456
3457         The bug happened like this:
3458         1) The user scroll the page. WKContentView tracks the velocity and send
3459            the update rect + velocity to the WebProcess.
3460         2) The user interupts the scrolling but does not commit to either scrolling
3461            again or cancelling the scrolling.
3462            Since we were not notified of this state, the WebProcess still believed
3463            the velocity is stable.
3464         3) With any paint update, the WebProcess would account for the last velocity
3465            and try to guess the best repaint area. This would drift endlessly out
3466            of the view since the view is not really moving.
3467
3468         This patch fixes the issue by adding special handling for interrupted scrolling.
3469
3470         Kudos to Kurt Revis for providing us the required APIs.
3471
3472         * Shared/VisibleContentRectUpdateInfo.h:
3473         (WebKit::operator==):
3474         We can no longer filter VisibleContentRectUpdateInfo ignoring the velocity.
3475
3476         Typically, UIScrollView would call -scrollViewDidScroll: before being interrupted.
3477         If we filter based on the VisibleContentRectUpdateInfo, we have two identical
3478         states differing only by the velocity. If we filter the second update, the WebProcess
3479         would never know the velocity should be zero.
3480
3481         * UIProcess/API/Cocoa/WKWebView.mm:
3482         (-[WKWebView _scrollViewDidInterruptDecelerating:]):
3483         We get this callback when scrolling is interrupted. We just need to clear
3484         the velocity and re-send a new update for the current state.
3485
3486         (-[WKWebView _updateVisibleContentRects]):
3487         Do not consider an interrupted scroll as a stable state. We don't know if scrolling
3488         will resume or will stop.
3489
3490         * UIProcess/ios/WKContentView.h:
3491         * UIProcess/ios/WKContentView.mm:
3492         (-[WKContentView didInterruptScrolling]):
3493
3494 2015-02-23  Anders Carlsson  <andersca@apple.com>
3495
3496         Add API for fetching website data records to _WKWebsiteDataStore
3497         https://bugs.webkit.org/show_bug.cgi?id=141926
3498
3499         Reviewed by Beth Dakin.
3500
3501         * UIProcess/API/APIWebsiteDataRecord.cpp