Implement Data Detectors immediate actions for WebKit2
[WebKit-https.git] / Source / WebKit2 / ChangeLog
1 2014-12-15  Timothy Horton  <timothy_horton@apple.com>
2
3         Implement Data Detectors immediate actions for WebKit2
4         https://bugs.webkit.org/show_bug.cgi?id=139617
5         <rdar://problem/19198539>
6
7         Reviewed by Beth Dakin.
8
9         * Shared/API/c/WKImmediateActionTypes.h:
10         Add a new type.
11
12         * UIProcess/API/mac/WKView.mm:
13         (-[WKView mouseDown:]):
14         Send mouseDown along to the WKImmediateActionController too.
15
16         (-[WKView initWithFrame:context:configuration:webView:]):
17         Temporarily disable action menus.
18
19         (-[WKView _dismissContentRelativeChildWindows]):
20         Hide the immediate action preview when detaching child windows.
21
22         * UIProcess/mac/WKImmediateActionController.h:
23         * UIProcess/mac/WKImmediateActionController.mm:
24         (-[WKImmediateActionController willDestroyView:]):
25         Clear the DDActionContext when tearing down the view.
26
27         (-[WKImmediateActionController wkView:willHandleMouseDown:]):
28         (-[WKImmediateActionController _cancelImmediateAction]):
29         (-[WKImmediateActionController _clearImmediateActionState]):
30         (-[WKImmediateActionController immediateActionRecognizerWillPrepare:]):
31         (-[WKImmediateActionController immediateActionRecognizerWillBeginAnimation:]):
32         (-[WKImmediateActionController _defaultAnimationController]):
33         (-[WKImmediateActionController _updateImmediateActionItem]):
34         (-[WKImmediateActionController hidePreview]):
35         (-[WKImmediateActionController popoverWillClose:]):
36         (-[WKImmediateActionController _menuItemForDataDetectedText]):
37         Copy most of the DataDetectors implementation into WKImmediateActionController.
38
39 2014-12-15  Myles C. Maxfield  <mmaxfield@apple.com>
40
41         Delete Notation because we don't use it
42         https://bugs.webkit.org/show_bug.cgi?id=139171
43
44         Reviewed by Kent Tamura.
45
46         * WebProcess/InjectedBundle/API/mac/WKDOMInternals.mm:
47         (WebKit::WKDOMNodeClass):
48         * mac/MigrateHeadersFromWebKitLegacy.make:
49
50 2014-12-15  David Kilzer  <ddkilzer@apple.com>
51
52         Remove last references to OfflineStorage process
53         <http://webkit.org/b/139648>
54
55         Reviewed by Anders Carlsson.
56
57         * WebKit2.xcodeproj/project.pbxproj: Remove last references to
58         the OfflineStorage process.  See r154251 and r154256.
59
60 2014-12-15  Gavin Barraclough  <barraclough@apple.com>
61
62         Change HysteresisActivity to use a lambda
63         https://bugs.webkit.org/show_bug.cgi?id=139636
64
65         Reviewed by Darin Adler.
66
67         The current implementation provides notifications via callbacks to a delegate. Using a delegate
68         with callbacks is limiting a number of ways. The callback names are very ambiguous, the callbacks
69         must either be on a separate object (more boilerplate), or the callback must be public for
70         HysteresisActivity to call them, or friends get involved. Without the boilerplate of extra
71         delegate objects it's hard to scale use of these objects – a single object can't serve as a
72         delegate for multiple HysteresisActivity members.
73
74         Instead, make HysteresisActivity take a lambda to callback on state change. To simplify, changed
75         HysteresisState to only track Started/Stopped states (removed WillStopPendingTimeout).
76
77         * WebProcess/WebCoreSupport/WebSQLiteDatabaseTracker.cpp:
78         (WebKit::WebSQLiteDatabaseTracker::WebSQLiteDatabaseTracker):
79             - HysteresisActivity now takes a lambda, not a delegate.
80         (WebKit::WebSQLiteDatabaseTracker::hysteresisUpdated):
81         (WebKit::WebSQLiteDatabaseTracker::started): Deleted.
82         (WebKit::WebSQLiteDatabaseTracker::stopped): Deleted.
83             - started/stopped merged into hysteresisUpdated
84         * WebProcess/WebCoreSupport/WebSQLiteDatabaseTracker.h:
85             - HysteresisActivity is no longer templated on delegate type, changed function declarations.
86
87 2014-12-15  Antti Koivisto  <antti@apple.com>
88
89         WebKit level persistent caching
90         https://bugs.webkit.org/show_bug.cgi?id=30322
91
92         Reviewed by Sam Weinig.
93
94         We can improve performance and open new optimization possibilities by bringing network caching into WebKit.
95
96         This patch implements an experimental HTTP cache living in the network process.
97
98         The main classes are:
99
100         NetworkCache
101             - Implements HTTP cache validation logic including Vary header
102             - Initially non-range GET only
103             - Fast serialization using WebKit types (ResourcesResponse etc) instead of native network layer types
104
105         NetworkCacheKey
106             - Unique identifier for cache entries
107             - Keyed on method/partition/URL
108
109         NetworkCacheStorage
110             - Storage backend
111             - dispatch-IO based implementation (generic posix implementation wouldn't be difficult)
112             - File system only (no SQLite or similar)
113             - One file per resource containing both header and body data
114             - Zero persistent global metadata
115             - Bloom filter for fast fail
116
117         NetworkCacheEncoder/Decoder
118             - Serializisation support with integrity verification.
119
120         The code is behind the NETWORK_CACHE feature flag and requires network process to be enabled to use.
121
122         This patch does not enable the feature yet by default.
123
124         Test: http/tests/cache/disk-cache-validation.html
125
126         * NetworkProcess/cache/NetworkCache.cpp: Added.
127         * NetworkProcess/cache/NetworkCache.h: Added.
128         * NetworkProcess/cache/NetworkCacheKey.cpp: Added.
129         * NetworkProcess/cache/NetworkCacheKey.h: Added.
130         * NetworkProcess/cache/NetworkCacheStorage.h: Added.
131         * NetworkProcess/cache/NetworkCacheStorage.mm: Added.
132         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
133         (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
134         (WebKit::NetworkProcess::platformSetCacheModel):
135         * NetworkProcess/ios/NetworkProcessIOS.mm:
136         (WebKit::NetworkProcess::clearCacheForAllOrigins):
137         * NetworkProcess/mac/NetworkProcessMac.mm:
138         (WebKit::NetworkProcess::clearCacheForAllOrigins):
139         * NetworkProcess/mac/NetworkResourceLoaderMac.mm:
140         (WebKit::tryGetShareableHandleFromCFData):
141         * Platform/Logging.h:
142         * WebKit2.xcodeproj/project.pbxproj:
143         * config.h:
144
145 2014-12-15  Gavin Barraclough  <barraclough@apple.com>
146
147         Simplify tracking of process suppression disabled for PluginProcessManager
148         https://bugs.webkit.org/show_bug.cgi?id=139611
149
150         Reviewed by Darin Adler.
151
152         Previously if process suppression state changed for any context we would
153         iterate over all contexts to recompute.
154
155         There was also an inconsistency in the code. When plugin processes are
156         created they called processSuppressionIsEnabledForAllContexts(), which
157         checked WebContext::processSuppressionEnabled(), which in turn checks
158         two things - whether any page is currently visible, and whether the
159         suppression is currently disabled for any page. However when updating
160         process supression state we would call
161         processSuppressionPreferenceIsEnabledForAllContexts(), which would just
162         check the value of the key from the context's default PageGroup.
163
164         We shouldn't be taking visibility into account (this is handled from the
165         content, where we know which pages have instances of which plugins), but
166         we should be checking the current pref value of each page.
167
168         We already track in each context whether any page has teh pref set to
169         disable throttling; add a counter to the shared PluginProcessManager to
170         coallesce across all contexts.
171
172         * UIProcess/Plugins/PluginProcessManager.cpp:
173         (WebKit::PluginProcessManager::PluginProcessManager):
174             - added m_processSuppressionDisabledForPageCounter, m_processSuppressionEnabled.
175         * UIProcess/Plugins/PluginProcessManager.h:
176         (WebKit::PluginProcessManager::processSuppressionDisabledForPageCount):
177             - accessor for WebContext to increment count.
178         (WebKit::PluginProcessManager::processSuppressionEnabled):
179             - accessor for PluginProcessProxy.
180         * UIProcess/Plugins/PluginProcessProxy.cpp:
181         (WebKit::PluginProcessProxy::didFinishLaunching):
182             - get initial supression state from the PluginProcessManager, not WebContext.
183         * UIProcess/Plugins/mac/PluginProcessManagerMac.mm:
184         (WebKit::PluginProcessManager::updateProcessSuppressionState):
185         (WebKit::PluginProcessManager::setProcessSuppressionEnabled): Deleted.
186             - setProcessSuppressionEnabled -> updateProcessSuppressionState
187               rather than WebContext setting suppression state, PluginProcessManager detects
188               when this may need to change & determines a new value for itself.
189         * UIProcess/WebContext.h:
190             - removed processSuppressionIsEnabledForAllContexts, processSuppressionPreferenceIsEnabledForAllContexts
191               updateProcessSuppressionState is no longer const (updates m_pluginProcessManagerProcessSuppressionDisabledCount).
192         * UIProcess/mac/WebContextMac.mm:
193         (WebKit::WebContext::updateProcessSuppressionState):
194             - instead of explicitly recomputing plugin throttling state from Within the WebContext, just update
195               m_pluginProcessManagerProcessSuppressionDisabledCount to count a RefCounter on the shared PluginProcessManager.
196         (WebKit::WebContext::processSuppressionIsEnabledForAllContexts): Deleted.
197         (WebKit::WebContext::processSuppressionPreferenceIsEnabledForAllContexts): Deleted.
198             - removed.
199
200 2014-12-15  Carlos Garcia Campos  <cgarcia@igalia.com>
201
202         [GTK] Use API::LoaderClient instead of WKPageLoaderClient
203         https://bugs.webkit.org/show_bug.cgi?id=139583
204
205         Reviewed by Gustavo Noronha Silva.
206
207         It simplifies the code and it will make easier to implement new
208         loader client methods.
209
210         * UIProcess/API/gtk/WebKitBackForwardList.cpp:
211         (webkitBackForwardListChanged):
212         * UIProcess/API/gtk/WebKitBackForwardListPrivate.h:
213         * UIProcess/API/gtk/WebKitLoaderClient.cpp:
214         (LoaderClient::LoaderClient):
215         (attachLoaderClientToView):
216         (didStartProvisionalLoadForFrame): Deleted.
217         (didReceiveServerRedirectForProvisionalLoadForFrame): Deleted.
218         (didFailProvisionalLoadWithErrorForFrame): Deleted.
219         (didCommitLoadForFrame): Deleted.
220         (didFinishLoadForFrame): Deleted.
221         (didFailLoadWithErrorForFrame): Deleted.
222         (didDisplayInsecureContentForFrame): Deleted.
223         (didRunInsecureContentForFrame): Deleted.
224         (didChangeBackForwardList): Deleted.
225         (didReceiveAuthenticationChallengeInFrame): Deleted.
226         (processDidCrash): Deleted.
227
228 2014-12-15  Gwang Yoon Hwang  <yoon@igalia.com>
229
230         Add initial implementation of ThreadSafeCoordinatedSurface, ThreadedCompositor, and SimpleViewportController
231         https://bugs.webkit.org/show_bug.cgi?id=118383
232
233         Reviewed by Martin Robinson.
234
235         Implements an initial version of the Threaded Compositor.
236
237         Threaded Compositor is a variant of Coordinated Graphics implementation.
238         Basic structure of the implementaion is simliar, thus, Threaded
239         Compositor reuses lots of classes from Coordinated Graphics. However,
240         instead of compositing on UI Process, Threaded Compositor performs
241         compositing on a dedicate thread of Web Process.
242
243         No new test, because it is in experimental stage.
244
245         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
246         (WebKit::CoordinatedGraphicsScene::CoordinatedGraphicsScene):
247         Removed a assertion not to force its creation in the main thread. In
248         the Threaded Compositor, it can be created in the dedicated thread.
249
250         * Shared/CoordinatedGraphics/threadedcompositor/ThreadSafeCoordinatedSurface.cpp: Added.
251         * Shared/CoordinatedGraphics/threadedcompositor/ThreadSafeCoordinatedSurface.h: Added.
252         Implements a surface using ImageBuffer as a backend to use in the Web
253         Process.
254
255         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h: Added.
256         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp: Added.
257         Implements a compositor which runs on the created thread. It owns
258         SimpleViewportController and CoordinatedGraphicsScene to render scene on the
259         actual surface.
260
261         * Shared/CoordinatedGraphics/SimpleViewportController.cpp: Added.
262         * Shared/CoordinatedGraphics/SimpleViewportController.h: Added.
263         This class is responsible to handle scale factor and scrolling position
264         with a simplifed logic in the compositing thread.
265
266 2014-12-14  Andreas Kling  <akling@apple.com>
267
268         Replace PassRef with Ref/Ref&& across the board.
269         <https://webkit.org/b/139587>
270
271         Reviewed by Darin Adler.
272
273         * UIProcess/WebBackForwardList.h:
274         (WebKit::WebBackForwardList::create):
275         * UIProcess/WebBatteryManagerProxy.cpp:
276         (WebKit::WebBatteryManagerProxy::create):
277         * UIProcess/WebBatteryManagerProxy.h:
278         * UIProcess/WebPageGroup.cpp:
279         (WebKit::WebPageGroup::createNonNull):
280         * UIProcess/WebPageGroup.h:
281         * UIProcess/efl/BatteryProvider.cpp:
282         (BatteryProvider::create):
283         * UIProcess/efl/BatteryProvider.h:
284         * WebProcess/MediaStream/UserMediaPermissionRequestManager.h:
285         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
286         (WebKit::WebEditorClient::shouldApplyStyle):
287         * WebProcess/WebCoreSupport/WebUserMediaClient.cpp:
288         (WebKit::WebUserMediaClient::requestPermission):
289         * WebProcess/WebCoreSupport/WebUserMediaClient.h:
290         * WebProcess/WebPage/ViewUpdateDispatcher.cpp:
291         (WebKit::ViewUpdateDispatcher::create):
292         * WebProcess/WebPage/ViewUpdateDispatcher.h:
293
294 2014-12-12  Gavin Barraclough  <barraclough@apple.com>
295
296         Split WebPageProxy::m_preventProcessSuppression to track pref/visibility separately
297         https://bugs.webkit.org/show_bug.cgi?id=139600
298
299         Reviewed by Geoff Garen.
300
301         Previously WebPageProxy::m_preventProcessSuppression would be set if either the page was visible
302         or its suppression was disabled by the pref. Instead track these separately. This will make the
303         user observability state applicable on iOS, too.
304
305         Add a new counter to WebContext, and split the counting in WebPageProxy.
306         ::updateProccessSuppressionState continues to track the pref change (which matches its name),
307         tracking of user observability changes moved to updateActivityToken (which we should further
308         merge with; it already tracks observability to control process state for iOS).
309
310         * UIProcess/WebContext.cpp:
311         (WebKit::m_processSuppressionDisabledForPageCounter):
312             - added new RefCounter.
313         * UIProcess/WebContext.h:
314         (WebKit::WebContext::processSuppressionDisabledForPageCount):
315             - added new RefCounter.
316         * UIProcess/WebPageProxy.cpp:
317         (WebKit::WebPageProxy::reattachToWebProcess):
318             - no longer needs to call updateProccessSuppressionState (pref has not changed; handled by the call to updateActivityToken).
319         (WebKit::WebPageProxy::dispatchViewStateChange):
320             - no longer needs to call updateProccessSuppressionState (pref has not changed; handled by the call to updateActivityToken).
321         (WebKit::WebPageProxy::updateActivityToken):
322             - this now also updated the user observability counter.
323         (WebKit::WebPageProxy::updateProccessSuppressionState):
324             - now only tracks whether this is disabled via the preference.
325         (WebKit::WebPageProxy::resetStateAfterProcessExited):
326             - clear the user observability counter; thsi will be reset on reattach.
327         * UIProcess/WebPageProxy.h:
328             - added new RefCounter::Count.
329         * UIProcess/mac/WebContextMac.mm:
330         (WebKit::WebContext::processSuppressionEnabled):
331             - processSuppressionEnabled is disabled if *neither*:
332                 - there are user observable pages
333                 - disabled by pref for any page.
334
335 2014-12-12  Beth Dakin  <bdakin@apple.com>
336
337         Need a fake mouse move after hiding data detectors UI
338         https://bugs.webkit.org/show_bug.cgi?id=139608
339         -and corresponding-
340         rdar://problem/19221935
341
342         Reviewed by Tim Horton.
343
344         * WebProcess/WebPage/mac/WebPageMac.mm:
345         (WebKit::WebPage::dataDetectorsDidHideUI):
346
347 2014-12-12  Anders Carlsson  <andersca@apple.com>
348
349         Handle caches in WebsiteDataStore
350         https://bugs.webkit.org/show_bug.cgi?id=139607
351         <rdar://problem/19107614>
352
353         Reviewed by Sam Weinig.
354
355         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
356         (WebKit::computeNetworkProcessAccessType):
357
358 2014-12-12  Enrica Casucci  <enrica@apple.com>
359
360         [iOS] Predictions are not updated when using navigation buttons.
361         https://bugs.webkit.org/show_bug.cgi?id=139567
362         rdar://problem/19132585
363
364         Reviewed by Dan Bernstein.
365
366         When moving focus programmatically, we need to notify the keyboard so that it
367         can update the prediction bar.
368
369         * UIProcess/WebPageProxy.h:
370         * UIProcess/ios/WKContentViewInteraction.mm:
371         (-[WKFormInputSession setAccessoryViewCustomButtonTitle:]):
372         (-[WKContentView requiresAccessoryView]):
373         (-[WKContentView inputAssistantButtonItems]):
374         (-[WKContentView accessoryTab:]):
375         (-[WKContentView _startAssistingKeyboard]):
376         (-[WKContentView _stopAssistingNode]):
377         * UIProcess/ios/WebPageProxyIOS.mm:
378         (WebKit::WebPageProxy::focusNextAssistedNode):
379         * WebProcess/WebPage/WebPage.h:
380         * WebProcess/WebPage/WebPage.messages.in:
381         * WebProcess/WebPage/ios/WebPageIOS.mm:
382         (WebKit::WebPage::focusNextAssistedNode):
383
384 2014-12-12  Timothy Horton  <timothy_horton@apple.com>
385
386         TextIndicator (and other view-relative subwindows) is not dismissed on zoom gesture
387         https://bugs.webkit.org/show_bug.cgi?id=139580
388         <rdar://problem/19226350>
389
390         Reviewed by Anders Carlsson.
391
392         * UIProcess/PageClient.h:
393         * UIProcess/mac/PageClientImpl.h:
394         * UIProcess/mac/PageClientImpl.mm:
395         (WebKit::PageClientImpl::dismissContentRelativeChildWindows):
396         (WebKit::PageClientImpl::dismissDictionaryLookupPanel): Deleted.
397         (WebKit::PageClientImpl::dismissActionMenuPopovers): Deleted.
398         Merge dismissDictionaryLookupPanel and dismissActionMenuPopovers into
399         _dismissContentRelativeChildWindows, which also dismisses TextIndicator and the
400         text correction panel. Dismissal of any child windows which are anchored to
401         the page content now bottlenecks through this function.
402
403         (WebKit::PageClientImpl::navigationGestureDidBegin):
404         Dismiss all anchored subwindows when starting a navigation gesture, not
405         just TextIndicator and action menu popovers.
406
407         * UIProcess/API/mac/WKView.mm:
408         (-[WKView scrollWheel:]):
409         No need to dismiss TextIndicator here; we've got this covered in the more-inclusive
410         WebPageProxy::pageDidScroll, and will now dismiss more things.
411
412         (-[WKView mouseDown:]):
413         Dismiss more things.
414
415         (-[WKView viewDidMoveToWindow]):
416         Dismiss more things.
417
418         (-[WKView _dismissContentRelativeChildWindows]):
419         The aforementioned combined dismissal function.
420
421         (-[WKView magnifyWithEvent:]):
422         (-[WKView smartMagnifyWithEvent:]):
423         (-[WKView setMagnification:centeredAtPoint:]):
424         (-[WKView setMagnification:]):
425         Any time the page magnification changes, dismiss all the things.
426
427         * UIProcess/API/mac/WKViewPrivate.h:
428         Expose _dismissContentRelativeChildWindows instead of _dismissActionMenuPopovers;
429         for all existing clients, it makes more sense to dismiss all view-relative subwindows
430         than just a subset of them.
431         
432         * UIProcess/WebPageProxy.cpp:
433         (WebKit::WebPageProxy::didCommitLoadForFrame):
434         (WebKit::WebPageProxy::pageDidScroll):
435         (WebKit::WebPageProxy::resetStateAfterProcessExited):
436         Make use of dismissAnchoredSubwindows.
437
438         * UIProcess/mac/WKActionMenuController.h:
439         * UIProcess/mac/WKActionMenuController.mm:
440         (-[WKActionMenuController prepareForMenu:withEvent:]):
441         Dismiss more things.
442
443         (-[WKActionMenuController _defaultMenuItemsForDataDetectedText]):
444         (-[WKActionMenuController dismissActionMenuPopovers]): Deleted.
445         dismissActionMenuPopovers is folded into WKView's _dismissContentRelativeChildWindows.
446
447         (-[WKActionMenuController _showTextIndicator]): Deleted.
448         (-[WKActionMenuController _hideTextIndicator]): Deleted.
449         Fold _showTextIndicator and _hideTextIndicator into their only callers.
450         _isShowingTextIndicator was never necessary, because it's OK to change
451         the current TextIndicator at any time, and a newer one is always more relevant.
452
453 2014-12-12  Gavin Barraclough  <barraclough@apple.com>
454
455         Keep single RefCounter to track whether any pages in a context are process suppressible
456         https://bugs.webkit.org/show_bug.cgi?id=139576
457
458         Reviewed by Sam Weinig.
459
460         Currently we keep separate counters in each process, and coallesce these in the
461         context. Instead we should have a counter in the WebContext.
462
463         Also, changed the name to better describe the state we're tracking, rather than
464         describing what it's currently used for. This counter will also be useful for
465         iOS, to better manage background state of the networking process.
466
467         * UIProcess/WebContext.cpp:
468         (WebKit::WebContext::WebContext):
469             - initialize m_userObservablePageCounter.
470         * UIProcess/WebContext.h:
471         (WebKit::WebContext::updateProcessSuppressionState):
472             - Added no-op implementation for non-cocoa platforms.
473         (WebKit::WebContext::userObservablePageCount):
474             - Count the number of user visible (audible / visible) pages in Context.
475         * UIProcess/WebPageProxy.cpp:
476         (WebKit::WebPageProxy::updateProccessSuppressionState):
477             - WebProcessProxy::processSuppressionCounter -> WebContext::userObservablePageCount
478         * UIProcess/WebProcessProxy.cpp:
479         (WebKit::WebProcessProxy::WebProcessProxy):
480         (WebKit::WebProcessProxy::didFinishLaunching):
481             - moved all processs supression state tracking to the WebContext.
482         * UIProcess/WebProcessProxy.h:
483         (WebKit::WebProcessProxy::processSuppressionCounter): Deleted.
484             - moved all processs supression state tracking to the WebContext.
485         * UIProcess/ios/WebProcessProxyIOS.mm:
486         (WebKit::WebProcessProxy::allPagesAreProcessSuppressible): Deleted.
487         (WebKit::WebProcessProxy::updateProcessSuppressionState): Deleted.
488             - moved all processs supression state tracking to the WebContext.
489         * UIProcess/mac/WebContextMac.mm:
490         (WebKit::WebContext::processSuppressionEnabled):
491             - no need to interate all processes; just have a single counter.
492         * UIProcess/mac/WebProcessProxyMac.mm:
493         (WebKit::WebProcessProxy::allPagesAreProcessSuppressible): Deleted.
494         (WebKit::WebProcessProxy::updateProcessSuppressionState): Deleted.
495             - moved all processs supression state tracking to the WebContext.
496
497 2014-12-12  Alexey Proskuryakov  <ap@apple.com>
498
499         Layout Test http/tests/loading/307-after-303-after-post.html is flaky
500         https://bugs.webkit.org/show_bug.cgi?id=73030
501
502         Reviewed by Anders Carlsson.
503
504         * UIProcess/WebContext.cpp:
505         (WebKit::WebContext::createNewWebProcess): Added a FIXME comment.
506         (WebKit::WebContext::setIconDatabasePath): Don't enable m_iconDatabase if the path
507         is empty, meaning that the database is disabled (which is not a great way to say
508         that, but WebKit2 icon database doesn't support enabling/disabling cleanly).
509         (WebKit::WebContext::iconDatabasePath): Keep it empty if it was empty.
510
511 2014-12-12  Mark Rowe  <mrowe@apple.com>
512
513         Fix the 32-bit build.
514
515         * UIProcess/API/mac/WKView.mm:
516         (-[WKView _setPreviewTitle:]):
517
518 2014-12-12  Timothy Horton  <timothy_horton@apple.com>
519
520         Fix the 32-bit build.
521
522         * UIProcess/mac/WKImmediateActionController.h:
523
524 2014-12-12  Rohit Kumar  <kumar.rohit@samsung.com>
525
526         Fix Build Warning in WebKit2/UIProcess module for GTK build and WebKit2/NetworkProcess module in GTK and EFL build
527         https://bugs.webkit.org/show_bug.cgi?id=139535
528
529         Reviewed by Martin Robinson.
530
531         * UIProcess/API/gtk/WebKitWebView.cpp: Use UNUSED_PARAM for conditional #if case
532         (webkitWebViewShowNotification):
533         (webkitWebViewCloseNotification):
534
535 2014-12-12  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
536
537         [EFL] Disable all EWK2Accessibility unit tests
538         https://bugs.webkit.org/show_bug.cgi?id=139577
539
540         Reviewed by Csaba Osztrogonác.
541
542         WebAccessibility functionality isn't supported by EFL WebKit2 though,
543         EWK2Accessibility unit tests have been tested. That's why those tests have been failed
544         so far.
545
546         * UIProcess/API/efl/tests/test_ewk2_accessibility.cpp:
547         (TEST_F):
548
549 2014-12-12  Simon Fraser  <simon.fraser@apple.com>
550
551         Layer borders on contentsLayers don't correctly toggle with the rest of the borders
552         https://bugs.webkit.org/show_bug.cgi?id=139570
553         rdar://problem/18007746
554
555         Reviewed by Tim Horton.
556         
557         Return nil if the color is invalid, to remove the color from the layer's
558         border or background.
559
560         * Shared/mac/RemoteLayerTreePropertyApplier.mm:
561         (WebKit::cgColorFromColor):
562
563 2014-12-11  Gavin Barraclough  <barraclough@apple.com>
564
565         Track pages preventing suppression in WebProcessProxy using RefCounter
566         https://bugs.webkit.org/show_bug.cgi?id=139108
567
568         Reviewed by Benjamin Poulain.
569
570         The networking process is allowed to app nap if all web pages are also currently in app nap.
571         In order to detect whether any page in any process currently requires the networking process
572         to be active we:
573          - maintain hash sets in every WebProcessProxy of pages that are okay with suppression.
574          - if anything changes, the WebContext iterates every WebProcessProxy to recompute state.
575
576         This is all crazy - all we actually need is a simple count of the number of pages that need
577         to prevent the networking process from entering app nap. This patch gets us half way there -
578         replace the HashSet with a RefCounter. Next step will be to hoist the RefCounters from the
579         process proxies up to the context to do away with the iteration.
580
581         * UIProcess/WebPageProxy.cpp:
582         (WebKit::WebPageProxy::WebPageProxy):
583         (WebKit::WebPageProxy::reattachToWebProcess):
584             - make sure we prevent process suppression, per current viewstate & preferences.
585         (WebKit::WebPageProxy::dispatchViewStateChange):
586             - make sure we prevent process suppression, per viewstate change.
587         (WebKit::WebPageProxy::updateProccessSuppressionState):
588             - recompute whether we need to prevent process suppression.
589         (WebKit::WebPageProxy::preferencesDidChange):
590             - when preferences change process supression may be disabled.
591         (WebKit::WebPageProxy::resetStateAfterProcessExited):
592             - we need to drop the old ref, to allow a new one to be taken when we reattach.
593         (WebKit::WebPageProxy::isProcessSuppressible): Deleted.
594             - moreged into updateProccessSuppressionState.
595         * UIProcess/WebPageProxy.h:
596             - added m_preventProcessSuppression.
597         * UIProcess/WebProcessProxy.cpp:
598         (WebKit::WebProcessProxy::WebProcessProxy):
599             - initialize m_pagesPreventingSuppression
600         (WebKit::WebProcessProxy::createWebPage):
601             - moved to WebPageProxy::WebPageProxy
602         (WebKit::WebProcessProxy::addExistingWebPage):
603             - moved to WebPageProxy::reattachToWebProcess
604         (WebKit::WebProcessProxy::removeWebPage):
605             - now implicit; when the page is destroyed the RefPtr will release.
606         (WebKit::WebProcessProxy::pageSuppressibilityChanged): Deleted.
607             - moved to WebPageProxy::dispatchViewStateChange.
608         (WebKit::WebProcessProxy::pagePreferencesChanged): Deleted.
609             - moved to WebPageProxy::preferencesDidChange.
610         * UIProcess/WebProcessProxy.h:
611         (WebKit::WebProcessProxy::preventProcessSuppressionForPage):
612             - reference count m_pagesPreventingSuppression
613         * UIProcess/mac/WebProcessProxyMac.mm:
614         (WebKit::WebProcessProxy::allPagesAreProcessSuppressible):
615             - converted to use m_pagesPreventingSuppression.
616             - removed guard that meant processes with no pages would keep the networking
617               process from entering app nap, which made no sense.
618
619 2014-12-11  Anders Carlsson  <andersca@apple.com>
620
621         Temporarily use WebCore session storage for transient local storage
622         https://bugs.webkit.org/show_bug.cgi?id=139574
623
624         Reviewed by Dan Bernstein.
625
626         * WebProcess/Storage/StorageNamespaceImpl.h:
627         Change the header guard so it won't conflict with StorageNamespaceImpl.h in WebCore.
628
629         * WebProcess/Storage/WebStorageNamespaceProvider.cpp:
630         (WebKit::WebStorageNamespaceProvider::createTransientLocalStorageNamespace):
631         Use the WebCore session storage for now, to avoid crashes.
632
633 2014-12-11  Commit Queue  <commit-queue@webkit.org>
634
635         Unreviewed, rolling out r177081.
636         https://bugs.webkit.org/show_bug.cgi?id=139569
637
638         broke iOS video playback (Requested by eric_carlson on
639         #webkit).
640
641         Reverted changeset:
642
643         "Fix iOS builders for 8.0"
644         https://bugs.webkit.org/show_bug.cgi?id=139495
645         http://trac.webkit.org/changeset/177081
646
647 2014-12-11  Beth Dakin  <bdakin@apple.com>
648
649         WK2: Need new SPI for Webkit clients to override default immediate action
650         https://bugs.webkit.org/show_bug.cgi?id=139564
651         -and corresponding-
652         rdar://problem/19225448
653
654         Reviewed by Tim Horton.
655
656         New SPI _immediateActionAnimationControllerForHitTestResult:withType:userData:
657         * UIProcess/API/Cocoa/WKViewPrivate.h:
658         * UIProcess/API/mac/WKView.mm:
659         (-[WKView _immediateActionAnimationControllerForHitTestResult:withType:userData:]):
660
661         Keep at ivar for the userData so that it can be passed to the new SPI.
662         * UIProcess/mac/WKImmediateActionController.h:
663         * UIProcess/mac/WKImmediateActionController.mm:
664         (-[WKImmediateActionController _clearImmediateActionState]):
665         (-[WKImmediateActionController didPerformActionMenuHitTest:userData:]):
666
667         Always give the SPI a chance to override the animationController.
668         (-[WKImmediateActionController _updateImmediateActionItem]):
669
670         Need to mark WKImmediateActionTypes.h as Private.
671         * WebKit2.xcodeproj/project.pbxproj:
672
673 2014-12-11  Timothy Horton  <timothy_horton@apple.com>
674
675         Move the preview popover to WebImmediateActionController
676         https://bugs.webkit.org/show_bug.cgi?id=139563
677         <rdar://problem/19208291>
678
679         Reviewed by Beth Dakin.
680
681         * UIProcess/mac/WKImmediateActionController.h:
682         Remove an unnecessary forward declaration.
683
684         * UIProcess/mac/WKImmediateActionController.mm:
685         (-[WKImmediateActionController willDestroyView:]):
686         Clear the immediate action recognizer when the view goes away.
687
688 2014-12-11  Timothy Horton  <timothy_horton@apple.com>
689
690         Fix the build.
691
692         * UIProcess/mac/WKImmediateActionController.h:
693         * UIProcess/mac/WKImmediateActionController.mm:
694
695 2014-12-11  Timothy Horton  <timothy_horton@apple.com>
696
697         Move the preview popover to WKImmediateActionController
698         https://bugs.webkit.org/show_bug.cgi?id=139560
699         <rdar://problem/19208291>
700
701         Reviewed by Beth Dakin.
702
703         * Shared/API/c/WKImmediateActionTypes.h:
704         Add a link preview type.
705
706         * UIProcess/API/mac/WKView.mm:
707         (-[WKView initWithFrame:context:configuration:webView:]):
708         Pass the gesture recognizer to the WKImmediateActionController.
709
710         (-[WKView _setPreviewTitle:]):
711         Forward preview title changes to the WKImmediateActionController,
712         because that's where the preview popover lives now.
713
714         * UIProcess/mac/WKActionMenuController.h:
715         * UIProcess/mac/WKActionMenuController.mm:
716         Move WKPagePreviewViewController into its own file.
717         Move page preview popover related code to WKImmediateActionController.
718
719         * UIProcess/mac/WKImmediateActionController.h:
720         * UIProcess/mac/WKImmediateActionController.mm:
721         Compare the gesture recognizers directly instead of their views, for accuracy.
722         Move page preview popover related code in from WKActionMenuController.
723         Some of this should eventually move to WKPagePreviewViewController, but
724         for now for ease of transition we will move it here.
725
726         * UIProcess/mac/WKPagePreviewViewController.h: Added.
727         * UIProcess/mac/WKPagePreviewViewController.mm: Added.
728         * WebKit2.xcodeproj/project.pbxproj:
729         Move WKPagePreviewViewController into its own file.
730
731 2014-12-11  Tomas Popela  <tpopela@redhat.com>
732
733         [GTK] Minor fixes for documentation and translations
734         https://bugs.webkit.org/show_bug.cgi?id=139450
735
736         Reviewed by Sergio Villar Senin.
737
738         * UIProcess/API/gtk/WebKitNavigationAction.cpp:
739         Fix typo in documentation.
740         * UIProcess/API/gtk/WebKitWebView.cpp:
741         (webkit_web_view_class_init):
742         Mark zoom-level and is-loading properties names for translation and
743         when touching them also fix the indentation style.
744
745 2014-12-11  Joseph Pecoraro  <pecoraro@apple.com>
746
747         Web Inspector: Inspector Process crash when navigating to non-inspectable page
748         https://bugs.webkit.org/show_bug.cgi?id=139508
749
750         Reviewed by Zalan Bujtas.
751
752         The Inspector Process can still receive InspectorFrontendHost messages
753         even though the backend connection has been invalidated and cleared.
754         Only send messages if the connection exists.
755
756         * WebProcess/WebPage/WebInspectorUI.cpp:
757         (WebKit::WebInspectorUI::openInNewTab):
758         (WebKit::WebInspectorUI::sendMessageToBackend):
759
760 2014-12-11  Yongjun Zhang  <yongjun_zhang@apple.com>
761
762         WebKit2 should expose FirstVisuallyNonEmptyLayout rendering milestone.
763         https://bugs.webkit.org/show_bug.cgi?id=139514
764
765         Expose DidFirstVisuallyNonEmptyLayout so that WebKit2 client can listen to visually non-empty layout rendering event.
766
767         Reviewed by Dan Bernstein.
768
769         * Shared/API/Cocoa/WKRenderingProgressEvents.h: Add WKRenderingProgressEventFirstVisuallyNonEmptyLayout to WKRenderingProgressEvents.
770         * Shared/API/Cocoa/WKRenderingProgressEventsInternal.h: Also map kWKDidFirstVisuallyNonEmptyLayout to WKRenderingProgressEventFirstVisuallyNonEmptyLayout.
771         (renderingProgressEvents):
772         * UIProcess/API/Cocoa/WKWebView.mm:
773         (layoutMilestones): Map _WKRenderingProgressEventFirstVisuallyNonEmptyLayout to WebCore::DidFirstVisuallyNonEmptyLayout.
774         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
775         * UIProcess/Cocoa/NavigationState.mm: Add _WKRenderingProgressEventFirstVisuallyNonEmptyLayout to _WKRenderingProgressEventFirstLayout.
776         (WebKit::renderingProgressEvents): Map WebCore::DidFirstVisuallyNonEmptyLayout to _WKRenderingProgressEventFirstVisuallyNonEmptyLayout.
777
778 2014-12-11  Michael Catanzaro  <mcatanzaro@igalia.com>
779
780         [GTK] Disable backspace key navigation
781         https://bugs.webkit.org/show_bug.cgi?id=136231
782
783         Reviewed by Carlos Garcia Campos.
784
785         * WebProcess/WebPage/gtk/WebPageGtk.cpp:
786         (WebKit::WebPage::performDefaultBehaviorForKeyEvent): remove handling
787         for backspace and <shift>backspace key combinations.
788
789 2014-12-11  Michael Catanzaro  <mcatanzaro@igalia.com>
790
791         [GTK] String changes for the HTTP authentication dialog
792         https://bugs.webkit.org/show_bug.cgi?id=136782
793
794         Reviewed by Carlos Garcia Campos.
795
796         * UIProcess/API/gtk/WebKitAuthenticationDialog.cpp:
797         (webkitAuthenticationDialogInitialize): Add a title to the dialog, add
798         some missing mnemonics, and tweak a few strings.
799
800 2014-12-09  Jeremy Jones  <jeremyj@apple.com>
801
802         Restore interface state when stopping optimized fullscreen.
803         https://bugs.webkit.org/show_bug.cgi?id=139465
804
805         Reviewed by Simon Fraser.
806
807         Implement fullscreenMayReturnToInline() to request the client application show the corresponding tab.
808
809         * UIProcess/API/APIUIClient.h:
810         (API::UIClient::fullscreenMayReturnToInline): added
811         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: add declaration
812         * UIProcess/Cocoa/UIDelegate.h: add declaration
813         * UIProcess/Cocoa/UIDelegate.mm:
814         (WebKit::UIDelegate::setDelegate): check for responds to selector
815         (WebKit::UIDelegate::UIClient::fullscreenMayReturnToInline): added
816         * UIProcess/WebPageProxy.cpp:
817         (WebKit::WebPageProxy::fullscreenMayReturnToInline): added.
818         * UIProcess/WebPageProxy.h: add declaration
819         * UIProcess/ios/WebVideoFullscreenManagerProxy.h: add declaration
820         * UIProcess/ios/WebVideoFullscreenManagerProxy.mm:
821         (WebKit::WebVideoFullscreenManagerProxy::fullscreenMayReturnToInline): show the tab.
822
823 2014-12-11  Alexey Proskuryakov  <ap@apple.com>
824
825         REGRESSION (Async Text Input): Text input method state is not reset when reloading a page
826         https://bugs.webkit.org/show_bug.cgi?id=139504
827         rdar://problem/19034674
828
829         Reviewed by Enrica Casucci.
830
831         WebKit2 used to look at EditorState changes and guess when to cancel a composition.
832         This was quite unreliable, and needlessly complicated - WebCore knows when it decides
833         to destroy a composition, so it now explicitly notifies the clients.
834
835         * UIProcess/API/mac/WKView.mm: (-[WKView _processDidExit]): Address crashing case too.
836         * UIProcess/WebPageProxy.cpp:
837         (WebKit::WebPageProxy::resetStateAfterProcessExited):
838         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
839         (WebKit::WebEditorClient::discardedComposition):
840         * WebProcess/WebCoreSupport/WebEditorClient.h:
841         * WebProcess/WebPage/WebPage.cpp:
842         (WebKit::WebPage::didChangeSelection):
843         (WebKit::WebPage::discardedComposition):
844         * WebProcess/WebPage/WebPage.h:
845
846 2014-12-10  Anders Carlsson  <andersca@apple.com>
847
848         Get rid of the storage strategy
849         https://bugs.webkit.org/show_bug.cgi?id=139519
850
851         Reviewed by Antti Koivisto.
852
853         * NetworkProcess/NetworkProcessPlatformStrategies.cpp:
854         (WebKit::NetworkProcessPlatformStrategies::createStorageStrategy): Deleted.
855         * NetworkProcess/NetworkProcessPlatformStrategies.h:
856         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
857         (WebKit::WebPlatformStrategies::createStorageStrategy): Deleted.
858         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
859
860 2014-12-11  Carlos Garcia Campos  <cgarcia@igalia.com>
861
862         [GTK] WebKitNotification is defined twice
863         https://bugs.webkit.org/show_bug.cgi?id=139538
864
865         Reviewed by Martin Robinson.
866
867         Remove the typedef from WebKitForwardDeclarations.h since it's
868         already in WebKitNotification.h and include WebKitNotification.h
869         in WebKitWebView.h.
870
871         * UIProcess/API/gtk/WebKitForwardDeclarations.h:
872         * UIProcess/API/gtk/WebKitWebView.h:
873
874 2014-12-11  Carlos Garcia Campos  <cgarcia@igalia.com>
875
876         [GTK] Move click counter logic back to WebKitWebViewBase
877         https://bugs.webkit.org/show_bug.cgi?id=137685
878
879         Reviewed by Martin Robinson.
880
881         It was moved to a shared class in platform to be used by both
882         WebKit1 and WebKit2, but it's currently only used by WebKitWebViewBase.
883
884         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
885         (ClickCounter::reset):
886         (ClickCounter::currentClickCountForGdkButtonEvent):
887         (webkitWebViewBaseButtonPressEvent):
888
889 2014-12-11  Carlos Alberto Lopez Perez  <clopez@igalia.com>
890
891         [SOUP] [GTK] warning: unused parameter at NetworkProcessSoup.cpp after r177056.
892         https://bugs.webkit.org/show_bug.cgi?id=139534
893
894         Reviewed by Martin Robinson.
895
896         * NetworkProcess/soup/NetworkProcessSoup.cpp:
897         (WebKit::NetworkProcess::clearDiskCache): Comment the parameter names.
898
899 2014-12-11  Carlos Garcia Campos  <cgarcia@igalia.com>
900
901         [GTK] Timers might never be fired during animations
902         https://bugs.webkit.org/show_bug.cgi?id=139062
903
904         Reviewed by Martin Robinson.
905
906         This can happen in old/slow machines where the time to render
907         layers might take more than 0.016. Since the layer flush timer is
908         using a higher priority than WebCore timers, when scheduling all
909         (or several) layer flushes immediately, no other sources with
910         lower priority are dispatched in the main loop. We could detect if
911         we are scheduling layer flushes immediately for too long (100ms)
912         and schedule the next flush after a delay to ensure other sources
913         with lower priority have a chance to be dispatched. Also use a
914         lower priority, GDK_PRIORITY_EVENTS is too high, so we use
915         GDK_PRIORITY_REDRAW - 1 to ensure it's higher than WebCore timers.
916
917         * WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp:
918         (WebKit::LayerTreeHostGtk::LayerTreeHostGtk): Rename
919         m_lastFlushTime as m_lastImmediateFlushTime.
920         (WebKit::LayerTreeHostGtk::layerFlushTimerFired): Save the
921         fireTime before calling flushAndRenderLayers() and compute the
922         next flush delay based on the elapsed time using monotonically
923         increasing time instead of current time. Use the target delay
924         as next flush delay if we have scheduled flushes immediately for
925         more than 100ms.
926         (WebKit::LayerTreeHostGtk::flushAndRenderLayers): Do not save the
927         layer flush time here, it's done in layerFlushTimerFired() so that
928         we don't need to keep it as a member.
929         (WebKit::LayerTreeHostGtk::scheduleLayerFlush): Use global
930         layerFlushTimerPriority.
931         * WebProcess/WebPage/gtk/LayerTreeHostGtk.h:
932
933 2014-12-10  Jaehun Lim  <ljaehun.lim@samsung.com>
934
935         [CMake] Fix build after WebStorageNamespaceProvider
936
937         Unreviewed, fix build.
938
939         * CMakeLists.txt: Add WebStorageNamespaceProvider.cpp to the source list.
940
941 2014-12-10  Sanghyup Lee  <sh53.lee@samsung.com>
942
943         Build fix for EFL and GTK ports since r177104
944         https://bugs.webkit.org/show_bug.cgi?id=139513
945
946         Reviewed by Tim Horton.
947
948         Moved WebPageProxy::installViewStateChangeCompletionHandler in PLATFORM(MAC) macro.
949
950         * UIProcess/WebPageProxy.cpp:
951         * UIProcess/WebPageProxy.h:
952
953 2014-12-10  Anders Carlsson  <andersca@apple.com>
954
955         Switch WebKit2 over to using the storage namespace provider
956         https://bugs.webkit.org/show_bug.cgi?id=139509
957
958         Reviewed by Tim Horton.
959
960         * WebProcess/Storage/StorageNamespaceImpl.cpp:
961         (WebKit::StorageNamespaceImpl::createLocalStorageNamespace):
962         (WebKit::StorageNamespaceImpl::~StorageNamespaceImpl):
963         (WebKit::localStorageNamespaceMap): Deleted.
964         Get rid of the storage namespace map - we have a map inside WebStorageNamespaceProvider now.
965
966         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
967         (WebKit::WebPlatformStrategies::createStorageStrategy):
968         (WebKit::WebPlatformStrategies::populatePluginCache): Deleted.
969         (WebKit::WebPlatformStrategies::localStorageNamespace): Deleted.
970         (WebKit::WebPlatformStrategies::transientLocalStorageNamespace): Deleted.
971         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
972         Get rid of the storage strategy.
973
974         * WebProcess/WebPage/WebPage.cpp:
975         (WebKit::WebPage::WebPage):
976         Set a storage namespace provider.
977
978 2014-12-10  Beth Dakin  <bdakin@apple.com>
979
980          Follow-up build fix.
981
982         * UIProcess/API/mac/WKView.mm:
983         (-[WKView initWithFrame:context:configuration:webView:]):
984
985 2014-12-09  Jon Honeycutt  <jhoneycutt@apple.com>
986
987         Null dereference performing a "TapAndAHalf" gesture in Google search field
988
989         <https://bugs.webkit.org/show_bug.cgi?id=139506>
990         <rdar://problem/19028828>
991
992         Reviewed by Darin Adler.
993
994         * WebProcess/WebPage/ios/WebPageIOS.mm:
995         (WebKit::WebPage::selectWithGesture):
996         Add a null check in the case that there is no word range for the
997         current position.
998
999 2014-12-10  Beth Dakin  <bdakin@apple.com>
1000
1001         Speculative build fix.
1002
1003         * UIProcess/API/mac/WKView.mm:
1004         (-[WKView initWithFrame:context:configuration:webView:]):
1005
1006 2014-12-10  Beth Dakin  <bdakin@apple.com>
1007
1008         WK2: Add initial support for immediate actions
1009         https://bugs.webkit.org/show_bug.cgi?id=139511
1010
1011         Reviewed by Tim Horton.
1012
1013         New enum to track immediate action types as we add them.
1014         * Shared/API/c/WKImmediateActionTypes.h: Added.
1015
1016         Create an NSImmediateActionGestureRecognizer if possible and a controller.
1017         * UIProcess/API/mac/WKView.mm:
1018         (-[WKView dealloc]):
1019         (-[WKView initWithFrame:context:configuration:webView:]):
1020         (-[WKView _didPerformActionMenuHitTest:userData:]):
1021
1022         This basic implementation of the controller will use the delegate methods to 
1023         perform an ActionMenuHitTest when relevant. Future patches will patch 
1024         _updateImmediateActionItem to use the hit test result to determine if there is any 
1025         immediate action that should be taken.
1026         * UIProcess/mac/WKImmediateActionController.h: Added.
1027         * UIProcess/mac/WKImmediateActionController.mm: Added.
1028         (-[WKImmediateActionController willDestroyView:]):
1029         (-[WKImmediateActionController _clearImmediateActionState]):
1030         (-[WKImmediateActionController didPerformActionMenuHitTest:userData:]):
1031
1032         Does much of the work done in Action Menu’s prepareForMenu.
1033         (-[WKImmediateActionController immediateActionRecognizerWillPrepare:]):
1034
1035         Does much of the work done in Action Menu’s menuNeedsUpdate.
1036         (-[WKImmediateActionController immediateActionRecognizerWillBeginAnimation:]):
1037
1038         Does much of the work done in Action Menu’s didCloseMenu.
1039         (-[WKImmediateActionController immediateActionRecognizerDidCancelAnimation:]):
1040
1041         Does much of the work done in Action Menu’s willOpenMenu.
1042         (-[WKImmediateActionController immediateActionRecognizerDidCompleteAnimation:]):
1043
1044         To be filled in.
1045         (-[WKImmediateActionController _updateImmediateActionItem]):
1046         * WebKit2.xcodeproj/project.pbxproj:
1047
1048 2014-12-10  Timothy Horton  <timothy_horton@apple.com>
1049
1050         Should have copy and paste items in all text menus
1051         https://bugs.webkit.org/show_bug.cgi?id=139510
1052         <rdar://problem/19198388>
1053
1054         Reviewed by Beth Dakin.
1055
1056         * UIProcess/mac/WKActionMenuController.mm:
1057         (-[WKActionMenuController _defaultMenuItemsForText]):
1058         Add a disabled paste menu item into the read-only text menu.
1059
1060         (-[WKActionMenuController _defaultMenuItemsForWhitespaceInEditableArea]):
1061         Add a disabled copy menu item into the editable whitespace text menu.
1062
1063 2014-12-10  Martin Hock  <mhock@apple.com>
1064
1065         [iOS] Add setting to ignore viewport scaling constraints
1066         https://bugs.webkit.org/show_bug.cgi?id=139466
1067         <rdar://problem/19200328>
1068
1069         Reviewed by Benjamin Poulain.
1070
1071         * Shared/WebPreferencesDefinitions.h: Add ignoreViewportScalingConstraints preference.
1072         * UIProcess/API/C/WKPreferences.cpp:
1073         (WKPreferencesSetIgnoreViewportScalingConstraints):
1074         (WKPreferencesGetIgnoreViewportScalingConstraints):
1075         * UIProcess/API/C/WKPreferencesRef.h:
1076         * WebProcess/WebPage/WebPage.cpp:
1077         (WebKit::WebPage::updatePreferences):
1078
1079 2014-12-10  Timothy Horton  <timothy_horton@apple.com>
1080
1081         Fix the build.
1082
1083         * UIProcess/API/mac/WKView.mm:
1084         (-[WKView _targetWindowForMovePreparation]):
1085
1086 2014-12-10  Timothy Horton  <timothy_horton@apple.com>
1087
1088         Provide SPI to asynchronously move a WKView into a window and know when it has painted
1089         https://bugs.webkit.org/show_bug.cgi?id=139460
1090         <rdar://problem/19135389>
1091
1092         Reviewed by Anders Carlsson.
1093
1094         * UIProcess/API/Cocoa/WKViewPrivate.h:
1095         Add _prepareForMoveToWindow:withCompletionHandler:, which internally
1096         goes through the motions of being parented in that window and calls
1097         the completion handler once painting is done and the view is ready
1098         to be displayed (upon which we expect the view to actually move into the window).
1099
1100         * UIProcess/API/mac/WKView.mm:
1101         (-[WKView viewWillMoveToWindow:]):
1102         If we currently have a _targetWindowForMovePreparation (and are
1103         pretending to be in that window), avoid performing viewWillMoveToWindow:
1104         for a different window.
1105
1106         (-[WKView viewDidMoveToWindow]):
1107         (-[WKView doWindowDidChangeScreen]):
1108         (-[WKView _intrinsicDeviceScaleFactor]):
1109         (-[WKView _colorSpace]):
1110         (-[WKView _targetWindowForMovePreparation]):
1111         If we have a _targetWindowForMovePreparation, use its properties instead
1112         of self.window's.
1113
1114         (-[WKView _prepareForMoveToWindow:withCompletionHandler:]):
1115         Simulate a move into the target window, but defer sending the view state update.
1116         Then, send the view state update after registering the completion handler.
1117
1118         * UIProcess/API/mac/WKViewInternal.h:
1119         * UIProcess/WebPageProxy.cpp:
1120         (WebKit::WebPageProxy::WebPageProxy):
1121         Rename m_viewStateChangeWantsReply to m_viewStateChangeWantsSynchronousReply.
1122
1123         (WebKit::WebPageProxy::installViewStateChangeCompletionHandler):
1124         Added. Allow installing a block that will be called the next time
1125         we get a didUpdateViewState back from the WebProcess after pushing the
1126         current view state changes.
1127
1128         (WebKit::WebPageProxy::viewStateDidChange):
1129         Adapt to the aforementioned rename.
1130
1131         (WebKit::WebPageProxy::dispatchViewStateChange):
1132         Adapt to the aforementioned rename.
1133         Send the view state change callback IDs along with SetViewState.
1134
1135         (WebKit::WebPageProxy::updateViewState):
1136         Adapt to the aforementioned rename.
1137
1138         * UIProcess/WebPageProxy.h:
1139         * UIProcess/mac/PageClientImpl.h:
1140         * UIProcess/mac/PageClientImpl.mm:
1141         (WebKit::PageClientImpl::activeWindow):
1142         (WebKit::PageClientImpl::isViewWindowActive):
1143         (WebKit::PageClientImpl::isViewVisible):
1144         (WebKit::PageClientImpl::isViewVisibleOrOccluded):
1145         (WebKit::PageClientImpl::isViewInWindow):
1146         (WebKit::PageClientImpl::viewLayerHostingMode):
1147         If we have a _targetWindowForMovePreparation, use its properties instead
1148         of the WKView's window's.
1149
1150         * WebProcess/WebPage/DrawingArea.h:
1151         (WebKit::DrawingArea::viewStateDidChange):
1152         * WebProcess/WebPage/WebPage.cpp:
1153         (WebKit::WebPage::reinitializeWebPage):
1154         (WebKit::WebPage::setViewState):
1155         * WebProcess/WebPage/WebPage.h:
1156         * WebProcess/WebPage/WebPage.messages.in:
1157         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
1158         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
1159         (WebKit::RemoteLayerTreeDrawingArea::viewStateDidChange):
1160         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
1161         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
1162         (WebKit::TiledCoreAnimationDrawingArea::viewStateDidChange):
1163         Push the callback IDs to the WebProcess, and accumulate them in TiledCoreAnimationDrawingArea.
1164
1165         (WebKit::TiledCoreAnimationDrawingArea::didUpdateViewStateTimerFired):
1166         Call all of the callbacks after one runloop cycle, just like DidUpdateViewState.
1167
1168 2014-12-10  Anders Carlsson  <andersca@apple.com>
1169
1170         Add session storage handling to StorageNamespaceProvider
1171         https://bugs.webkit.org/show_bug.cgi?id=139507
1172
1173         Reviewed by Tim Horton.
1174
1175         * WebProcess/Storage/StorageNamespaceImpl.cpp:
1176         (WebKit::StorageNamespaceImpl::createSessionStorageNamespace):
1177         * WebProcess/Storage/StorageNamespaceImpl.h:
1178         * WebProcess/Storage/WebStorageNamespaceProvider.cpp:
1179         (WebKit::WebStorageNamespaceProvider::createSessionStorageNamespace):
1180         * WebProcess/Storage/WebStorageNamespaceProvider.h:
1181
1182 2014-12-10  Anders Carlsson  <andersca@apple.com>
1183
1184         Implement the rest of the transient local storage namespace code
1185         https://bugs.webkit.org/show_bug.cgi?id=139505
1186
1187         Reviewed by Tim Horton.
1188
1189         * UIProcess/Storage/StorageManager.cpp:
1190         (WebKit::StorageManager::TransientLocalStorageNamespace::create):
1191         (WebKit::StorageManager::TransientLocalStorageNamespace::~TransientLocalStorageNamespace):
1192         (WebKit::StorageManager::TransientLocalStorageNamespace::getOrCreateStorageArea):
1193         (WebKit::StorageManager::TransientLocalStorageNamespace::clearStorageAreasMatchingOrigin):
1194         (WebKit::StorageManager::TransientLocalStorageNamespace::clearAllStorageAreas):
1195         (WebKit::StorageManager::TransientLocalStorageNamespace::TransientLocalStorageNamespace):
1196         Introduce a new TransientLocalStorageNamespace that's just a glorified SecurityOrigin -> StorageArea HashMap.
1197
1198         (WebKit::StorageManager::StorageArea::create):
1199         Change the return type to RefPtr.
1200
1201         (WebKit::StorageManager::deleteEntriesForOrigin):
1202         (WebKit::StorageManager::deleteAllEntries):
1203         (WebKit::StorageManager::deleteLocalStorageOriginsModifiedSince):
1204         Use lambdas instead of bind. Delete the transient local storage as well.
1205
1206         (WebKit::StorageManager::createTransientLocalStorageMap):
1207         Get a transient local storage namespace and ask it for a storage area.
1208
1209         (WebKit::StorageManager::getOrCreateTransientLocalStorageNamespace):
1210         Look up the namespace from the map and create one if it doesn't exist.
1211
1212         (WebKit::StorageManager::deleteEntriesForOriginInternal): Deleted.
1213         (WebKit::StorageManager::deleteAllEntriesInternal): Deleted.
1214
1215         * UIProcess/Storage/StorageManager.h:
1216
1217 2014-12-10  Anders Carlsson  <andersca@apple.com>
1218
1219         Begin fixing transient local storage handling
1220         https://bugs.webkit.org/show_bug.cgi?id=139503
1221
1222         Reviewed by Sam Weinig.
1223
1224         * UIProcess/Storage/StorageManager.cpp:
1225         (WebKit::StorageManager::createTransientLocalStorageMap):
1226         * UIProcess/Storage/StorageManager.h:
1227         Add empty stub implementation of createTransientLocalStorageMap.
1228
1229         * UIProcess/Storage/StorageManager.messages.in:
1230         Add CreateTransientLocalStorageMap message.
1231
1232         * WebProcess/Storage/StorageAreaMap.cpp:
1233         (WebKit::StorageAreaMap::StorageAreaMap):
1234         If we have a local storage namespace with a non-null top-level origin, create a 
1235         transient local storage map.
1236
1237         * WebProcess/Storage/StorageNamespaceImpl.cpp:
1238         (WebKit::StorageNamespaceImpl::createLocalStorageNamespace):
1239         Pass a null top-level origin to the StorageNamespaceImpl constructor.
1240
1241         (WebKit::StorageNamespaceImpl::createTransientLocalStorageNamespace):
1242         Create a new StorageNamespaceImpl, passing the top-level origin to the constructor.
1243
1244         (WebKit::StorageNamespaceImpl::createSessionStorageNamespace):
1245         Pass a null top-level origin to the StorageNamespaceImpl constructor.
1246
1247         (WebKit::StorageNamespaceImpl::StorageNamespaceImpl):
1248         Add a top-level origin parameter.
1249
1250         * WebProcess/Storage/StorageNamespaceImpl.h:
1251         (WebKit::StorageNamespaceImpl::topLevelOrigin):
1252         Add top-level origin member and getter.
1253
1254         * WebProcess/Storage/WebStorageNamespaceProvider.cpp:
1255         (WebKit::WebStorageNamespaceProvider::createTransientLocalStorageNamespace):
1256         Call StorageNamespaceImpl::createTransientLocalStorageNamespace.
1257
1258 2014-12-10  Anders Carlsson  <andersca@apple.com>
1259
1260         Implement WebStorageNamespaceProvider::createLocalStorageNamespace
1261         https://bugs.webkit.org/show_bug.cgi?id=139498
1262
1263         Reviewed by Beth Dakin.
1264
1265         * WebProcess/Storage/StorageNamespaceImpl.cpp:
1266         (WebKit::StorageNamespaceImpl::createLocalStorageNamespace):
1267         Add a new overload that takes an identifier + quota. Have the old overload call the new one.
1268
1269         * WebProcess/Storage/StorageNamespaceImpl.h:
1270         Add new member.
1271
1272         * WebProcess/Storage/WebStorageNamespaceProvider.cpp:
1273         (WebKit::WebStorageNamespaceProvider::createLocalStorageNamespace):
1274         Call StorageNamespaceImpl::createLocalStorageNamespace.
1275
1276 2014-12-10  Anders Carlsson  <andersca@apple.com>
1277
1278         Add a stubbed out WebStorageNamespaceProvider class to WebKit2
1279         https://bugs.webkit.org/show_bug.cgi?id=139497
1280
1281         Reviewed by Beth Dakin.
1282
1283         * WebKit2.xcodeproj/project.pbxproj:
1284         * WebProcess/Storage/WebStorageNamespaceProvider.cpp: Added.
1285         (WebKit::storageNamespaceProviders):
1286         (WebKit::WebStorageNamespaceProvider::getOrCreate):
1287         (WebKit::WebStorageNamespaceProvider::WebStorageNamespaceProvider):
1288         (WebKit::WebStorageNamespaceProvider::~WebStorageNamespaceProvider):
1289         (WebKit::WebStorageNamespaceProvider::createLocalStorageNamespace):
1290         (WebKit::WebStorageNamespaceProvider::createTransientLocalStorageNamespace):
1291         * WebProcess/Storage/WebStorageNamespaceProvider.h: Added.
1292
1293 2014-12-10  Enrica Casucci  <enrica@apple.com>
1294
1295         Fix iOS builders for 8.0
1296         https://bugs.webkit.org/show_bug.cgi?id=139495
1297
1298         Reviewed by Eric Carlson.
1299
1300         * UIProcess/API/Cocoa/WKWebView.mm:
1301         (-[WKWebView _mayAutomaticallyShowVideoOptimized]):
1302         * UIProcess/WebPageProxy.cpp:
1303         (WebKit::WebPageProxy::WebPageProxy):
1304         (WebKit::WebPageProxy::reattachToWebProcess):
1305         * UIProcess/ios/WebVideoFullscreenManagerProxy.mm:
1306
1307 2014-12-10  Julien Isorce  <j.isorce@samsung.com>
1308
1309         [GTK] Enable depth 32 for the RedirectedXCompositeWindow
1310         https://bugs.webkit.org/show_bug.cgi?id=139028
1311
1312         On gtk/X11, the layout compositing is done in the web process.
1313         If one needs to handle alpha with the rest of the application
1314         then it is not enough to make to browser's window as RGBA.
1315         The shared redirected window needs to be RGBA as well.
1316         (The shared X composite window between UIProcess and WebProcess).
1317
1318         This allows an end-to-end RGBA solution when the application
1319         wants to interact with the alpha channel at compositing time.
1320         For example for transparent Web UI.
1321
1322         Reviewed by Martin Robinson.
1323
1324         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
1325         (webkitWebViewBaseRealize):
1326         (webkitWebViewBaseConstructed):
1327         (webkitWebViewRenderAcceleratedCompositingResults):
1328         (webkitWebViewBaseUpdatePreferences):
1329         (webkitWebViewBaseCreateWebPage):
1330         * UIProcess/gtk/RedirectedXCompositeWindow.cpp:
1331         (WebKit::RedirectedXCompositeWindow::create):
1332         (WebKit::RedirectedXCompositeWindow::RedirectedXCompositeWindow):
1333         * UIProcess/gtk/RedirectedXCompositeWindow.h:
1334
1335 2014-12-09  Claudio Saavedra  <csaavedra@igalia.com> and Gustavo Noronha Silva  <gustavo.noronha@collabora.com>
1336
1337         [GTK][WK2] Add HTML5 Notifications support
1338         https://bugs.webkit.org/show_bug.cgi?id=61140
1339
1340         Reviewed by Carlos Garcia Campos.
1341
1342         * PlatformGTK.cmake: add new files to the build.
1343         * UIProcess/API/gtk/WebKitForwardDeclarations.h:
1344         * UIProcess/API/gtk/WebKitNotification.cpp: Added. New GObject used to expose information about
1345         the notification to the API.
1346         (webkitNotificationGetProperty):
1347         (webkit_notification_class_init):
1348         (webkitNotificationCreate):
1349         (webkit_notification_get_id):
1350         (webkit_notification_get_title):
1351         (webkit_notification_get_body):
1352         * UIProcess/API/gtk/WebKitNotification.h: Added.
1353         * UIProcess/API/gtk/WebKitNotificationPermissionRequest.cpp: Added. Permission request object
1354         for notifications.
1355         (webkitNotificationPermissionRequestAllow):
1356         (webkitNotificationPermissionRequestDeny):
1357         (webkit_permission_request_interface_init):
1358         (webkitNotificationPermissionRequestDispose):
1359         (webkit_notification_permission_request_class_init):
1360         (webkitNotificationPermissionRequestCreate):
1361         * UIProcess/API/gtk/WebKitNotificationPermissionRequest.h: Added.
1362         * UIProcess/API/gtk/WebKitNotificationPermissionRequestPrivate.h: Added.
1363         * UIProcess/API/gtk/WebKitNotificationPrivate.h: Added.
1364         * UIProcess/API/gtk/WebKitNotificationProvider.cpp: Added. Notification provider that emits signals.
1365         The C API allows overriding the notification providers and managers for customizing the handling of
1366         notifications. We decided to go for a single manager and a single provider which provide more idiomatic
1367         GObject API - signals.
1368         (toNotificationProvider):
1369         (showCallback):
1370         (cancelCallback):
1371         (WebKitNotificationProvider::~WebKitNotificationProvider):
1372         (WebKitNotificationProvider::create):
1373         (WebKitNotificationProvider::WebKitNotificationProvider):
1374         (WebKitNotificationProvider::show):
1375         (WebKitNotificationProvider::cancel):
1376         * UIProcess/API/gtk/WebKitNotificationProvider.h: Added.
1377         * UIProcess/API/gtk/WebKitUIClient.cpp: implemented decidePolicyForNotificationPermissionRequest.
1378         * UIProcess/API/gtk/WebKitWebContext.cpp:
1379         (webkitWebContextConstructed): initialize the notification provider.
1380         * UIProcess/API/gtk/WebKitWebView.cpp:
1381         (webkitWebViewShowNotification): default implementation for showing the notification, currently
1382         using GNotification, about to be ported to libnotify.
1383         (webkit_web_view_class_init): set the default implementation for the show-notification signal.
1384         (webkitWebViewEmitCloseNotification): emit the close-notification signal.
1385         (webkitWebViewEmitShowNotification): emit the show-notification signal.
1386         * UIProcess/API/gtk/WebKitWebView.h:
1387         * UIProcess/API/gtk/WebKitWebViewPrivate.h:
1388         * UIProcess/API/gtk/docs/webkit2gtk-sections.txt: list new objects and methods.
1389         * UIProcess/API/gtk/webkit2.h: include new headers.
1390
1391 2014-12-10  Grzegorz Czajkowski  <g.czajkowski@samsung.com>
1392
1393         [EFL][[WK2] test_ewk2_text_checker is failed
1394         https://bugs.webkit.org/show_bug.cgi?id=132982
1395
1396         Reviewed by Gyuyoung Kim.
1397
1398         Insert misspelled word to the input field using execCommand instead of
1399         input.value attribute change which stops spell check, tracked by
1400         https://bugs.webkit.org/show_bug.cgi?id=139473.
1401
1402         Since text checker API tests do not verify spellchecker itself (it's being
1403         tested by LayoutTests/editing/spelling) but rather opportunity for overriding
1404         its functionality this patch unskips those tests in order to API coverage.
1405
1406         * PlatformEfl.cmake:
1407         Unskip test_ewk2_text_checker
1408
1409         * UIProcess/API/efl/tests/resources/spelling_test.html:
1410         Use document.execCommand("InsertText", false, "aa ") instead of
1411         input.value = "aa " to trigger spellchecker.
1412
1413 2014-12-10  Carlos Alberto Lopez Perez  <clopez@igalia.com>
1414
1415         REGRESSION(r177038): [SOUP] [GTK] Debug build broken
1416         https://bugs.webkit.org/show_bug.cgi?id=139475
1417
1418         Reviewed by Martin Robinson.
1419
1420         * NetworkProcess/soup/NetworkProcessSoup.cpp:
1421         (WebKit::NetworkProcess::clearCacheForAllOrigins): Call clearDiskCache().
1422         (WebKit::NetworkProcess::clearDiskCache): Implement this for SOUP.
1423         SoupCache don't seems to have API for clearing a part of the cache,
1424         so add a FIXME note regarding that.
1425
1426 2014-12-09  Csaba Osztrogonác  <ossy@webkit.org>
1427
1428         URTBF after r177032.
1429
1430         * CMakeLists.txt:
1431
1432 2014-12-09  Alexey Proskuryakov  <ap@apple.com>
1433
1434         Kotoeri sometimes doesn't correctly process the first chanaracter in a text field in Safari 7.1 or 6.2
1435         https://bugs.webkit.org/show_bug.cgi?id=139459
1436         rdar://problem/19017432
1437         rdar://problem/19036869
1438
1439         Reviewed by Enrica Casucci.
1440
1441         When inputContext changes, notify the application. We already did this when the context
1442         changed due to plug-ins, and this used to sort of make it work on on yahoo.co.jp,
1443         which has plug-ins. But that was quite unreliable, as evidenced by the reproducible
1444         cases where we didn't use an input method for the first keypress.
1445
1446         * UIProcess/PageClient.h:
1447         * UIProcess/WebPageProxy.cpp:
1448         (WebKit::WebPageProxy::editorStateChanged):
1449         * UIProcess/mac/PageClientImpl.h:
1450         * UIProcess/mac/PageClientImpl.mm:
1451         (WebKit::PageClientImpl::notifyApplicationAboutInputContextChange):
1452
1453 2014-12-09  Jeremy Jones  <jeremyj@apple.com>
1454
1455         Enable automatic optimized fullscreen mode.
1456         https://bugs.webkit.org/show_bug.cgi?id=139437
1457
1458         Reviewed by Simon Fraser.
1459
1460         Anticipate the automatic transition to optimized video fullscreen mode when deciding if the page is visible.
1461
1462         * UIProcess/API/Cocoa/WKWebView.mm:
1463         (-[WKWebView _isShowingVideoOptimized]): Renamed. Test precondition.
1464         (-[WKWebView _mayAutomaticallyShowVideoOptimized]): Added.
1465         (-[WKWebView _isPlayingFullscreenOptimizedVideo]): Deleted.
1466         * UIProcess/API/Cocoa/WKWebViewInternal.h:
1467         * UIProcess/ios/PageClientImplIOS.mm:
1468         (WebKit::PageClientImpl::isViewVisible): Test for optimized modes even when not in a window.
1469
1470 2014-12-09  Anders Carlsson  <andersca@apple.com>
1471
1472         Add support for clearing the disk cache
1473         https://bugs.webkit.org/show_bug.cgi?id=139458
1474
1475         Reviewed by Antti Koivisto.
1476
1477         * NetworkProcess/NetworkProcess.cpp:
1478         (WebKit::NetworkProcess::deleteWebsiteData):
1479         If we're asked to clear the disk cache, do so. Clearing the cache is asynchronous,
1480         so we make sure not to call the completion handler right away in that case.
1481
1482         * NetworkProcess/NetworkProcess.h:
1483         Add clearDiskCache member function.
1484
1485         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
1486         (WebKit::NetworkProcess::clearDiskCache):
1487         Clear the disk cache, then call the completion handler.
1488
1489         * NetworkProcess/mac/NetworkProcessMac.mm:
1490         (WebKit::NetworkProcess::clearCacheForAllOrigins):
1491         Call the new clearDiskCache function.
1492
1493         * Shared/WebsiteData/WebsiteDataTypes.h:
1494         Add WebsiteDataTypeDiskCache.
1495
1496         * UIProcess/API/Cocoa/_WKWebsiteDataStore.h:
1497         * UIProcess/API/Cocoa/_WKWebsiteDataStore.mm:
1498         (toWebsiteDataTypes):
1499         Handle WKWebsiteDataTypeDiskCache.
1500
1501 2014-12-09  Myles C. Maxfield  <mmaxfield@apple.com>
1502
1503         Delete Node::boundingBox()
1504         https://bugs.webkit.org/show_bug.cgi?id=139333
1505
1506         Reviewed by Zalan Bujtas.
1507
1508         * Shared/WebHitTestResult.cpp:
1509         (WebKit::WebHitTestResult::Data::elementBoundingBoxInWindowCoordinates):
1510         Use RenderObject::absoluteBoundingBoxRect().
1511         * WebProcess/WebPage/CoordinatedGraphics/WebPageCoordinatedGraphics.cpp:
1512         (WebKit::WebPage::findZoomableAreaForPoint): Use
1513         RenderObject::absoluteBoundingBoxRect().
1514
1515 2014-12-09  Chris Dumez  <cdumez@apple.com>
1516
1517         [WK2] Crash when answering notification permission request after navigating
1518         https://bugs.webkit.org/show_bug.cgi?id=139429
1519         <rdar://problem/18921122>
1520
1521         Reviewed by Andreas Kling.
1522
1523         When requesting a notification permission, navigating away and then
1524         answering the permission, WebKit2 would crash. This is because upon
1525         navigating, the request is cancelled and removed from the HashMaps
1526         in NotificationPermissionRequestManager. When
1527         didReceiveNotificationPermissionDecision() is later called, it would
1528         look for the request identifier in m_idToOriginMap HashMap. As the
1529         request was cancelled, HashMap::take() call would return null for
1530         the SecurityOrigin*. This security origin pointer is then removed
1531         from m_originToIDMap, but the code was failing to do a null check
1532         first. Calling HashMap::remove(nullptr) would then crash.
1533
1534         This patch adds the missing null check and a layout test to cover
1535         this case.
1536
1537         Test: http/tests/notifications/legacy/notification-request-permission-then-navigate.html
1538         
1539
1540         * WebProcess/Notifications/NotificationPermissionRequestManager.cpp:
1541         (WebKit::NotificationPermissionRequestManager::didReceiveNotificationPermissionDecision):
1542
1543 2014-12-09  Anders Carlsson  <andersca@apple.com>
1544
1545         Implement clearing of cookies
1546         https://bugs.webkit.org/show_bug.cgi?id=139455
1547
1548         Reviewed by Andreas Kling.
1549
1550         * NetworkProcess/NetworkProcess.cpp:
1551         (WebKit::NetworkProcess::deleteWebsiteData):
1552         Handle deleting cookies by finding the right network storage session and deleting the cookies from it.
1553         Then, send a DidDeleteWebsiteData message back.
1554
1555         * NetworkProcess/NetworkProcess.h:
1556         Add new members.
1557
1558         * NetworkProcess/NetworkProcess.messages.in:
1559         Add new DeleteWebsiteData message.
1560
1561         * Shared/WebsiteData/WebsiteDataTypes.h:
1562         Move the website data types enum to its own file so it can be shared.
1563
1564         * UIProcess/API/Cocoa/_WKWebsiteDataStore.mm:
1565         (toWebsiteDataTypes):
1566         Update now that WebsiteDataTypes is its own enum.
1567
1568         (-[_WKWebsiteDataStore removeDataOfTypes:modifiedSince:completionHandler:]):
1569         removeDataModifiedSince was renamed to removeData.
1570
1571         * UIProcess/Network/NetworkProcessProxy.cpp:
1572         (WebKit::generateCallbackID):
1573         Helper function to create a callback ID.
1574
1575         (WebKit::NetworkProcessProxy::~NetworkProcessProxy):
1576         Assert that we have no pending callbacks.
1577
1578         (WebKit::NetworkProcessProxy::deleteWebsiteData):
1579         Put the completion handler in our map and message the network process.
1580
1581         (WebKit::NetworkProcessProxy::networkProcessCrashedOrFailedToLaunch):
1582         Call all completion handlers.
1583
1584         (WebKit::NetworkProcessProxy::didDeleteWebsiteData):
1585         Grab the completion handler and call it.
1586
1587         * UIProcess/Network/NetworkProcessProxy.h:
1588         Add new members.
1589
1590         * UIProcess/Network/NetworkProcessProxy.messages.in:
1591         Add DidDeleteWebsiteData callback.
1592
1593         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1594         (WebKit::computeNetworkProcessAccessType):
1595         Helper function that computes the type of process access we'd need for the given mask of
1596         website data types.
1597
1598         (WebKit::WebsiteDataStore::removeData):
1599         Gather all the network processes and message them. Use a callback aggregator object to track callbacks
1600         so we'll call the completion handler once all callbacks have been invoked.
1601
1602         * UIProcess/WebsiteData/WebsiteDataStore.h:
1603         Move WebsiteDataTypes to its own file.
1604
1605         * WebKit2.xcodeproj/project.pbxproj:
1606         Add new files.
1607
1608 2014-12-09  Anders Carlsson  <andersca@apple.com>
1609
1610         Give WebsiteDataStore a unique ID
1611         https://bugs.webkit.org/show_bug.cgi?id=139448
1612
1613         Reviewed by Andreas Kling.
1614
1615         * Shared/WebPageCreationParameters.cpp:
1616         (WebKit::WebPageCreationParameters::encode):
1617         (WebKit::WebPageCreationParameters::decode):
1618         * Shared/WebPageCreationParameters.h:
1619         * UIProcess/WebPageProxy.cpp:
1620         (WebKit::WebPageProxy::creationParameters):
1621         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1622         (WebKit::generateIdentifier):
1623         (WebKit::WebsiteDataStore::WebsiteDataStore):
1624         * UIProcess/WebsiteData/WebsiteDataStore.h:
1625         (WebKit::WebsiteDataStore::identifier):
1626
1627 2014-12-09  Anders Carlsson  <andersca@apple.com>
1628
1629         Build fix.
1630
1631         * UIProcess/API/Cocoa/_WKWebsiteDataStore.h:
1632
1633 2014-12-09  Ting-Wei Lan  <lantw44@gmail.com>
1634
1635         [GTK] LDFLAGS is ignored when running g-ir-scanner
1636         https://bugs.webkit.org/show_bug.cgi?id=138832
1637
1638         Reviewed by Carlos Garcia Campos.
1639
1640         GTK+ requires libintl on FreeBSD because there is no gettext
1641         implementation in FreeBSD libc. In order to link to libintl, which is
1642         not located in the default search path of the linker, we need to add
1643         the required path via the linker command line. However, LDFLAGS is
1644         ignored when running g-ir-scanner starting from r167873, so we have
1645         to manually pick required flags from CMAKE_SHARED_LINKER_FLAGS and
1646         put them in correct order to prevent g-ir-scanner from linking to
1647         the installed version of libraries.
1648
1649         * PlatformGTK.cmake:
1650
1651 2014-12-09  Jeremy Jones  <jeremyj@apple.com>
1652
1653         Enable activating optimized fullscreen mode from standard fulscreen mode.
1654         https://bugs.webkit.org/show_bug.cgi?id=139137
1655
1656         Reviewed by Simon Fraser.
1657
1658         Going from standard fullscreen mode to optimized fullscreen mode requires the ability to
1659         update the fullscreen mode and a new standard-and-optimized-fullscreen mode.
1660
1661         * UIProcess/API/Cocoa/WKWebView.mm:
1662         (-[WKWebView _isPlayingFullscreenOptimizedVideo]): 
1663         Treat new standard-and-optimized as a kind of optimized.
1664         * UIProcess/ios/WebVideoFullscreenManagerProxy.h: IPC fullscreen mode changes
1665         * UIProcess/ios/WebVideoFullscreenManagerProxy.mm: ditto
1666         (WebKit::WebVideoFullscreenManagerProxy::fullscreenModeChanged): dito
1667         * WebProcess/ios/WebVideoFullscreenManager.h: ditto
1668         * WebProcess/ios/WebVideoFullscreenManager.messages.in: ditto
1669         * WebProcess/ios/WebVideoFullscreenManager.mm: dito
1670         (WebKit::WebVideoFullscreenManager::WebVideoFullscreenManager): ditto
1671         (WebKit::WebVideoFullscreenManager::setFullscreenModeChanged): ditto
1672
1673 2014-12-08  Jaehun Lim  <ljaehun.lim@samsung.com>
1674
1675         [EFL] Use DependenciesEFL instead of Dependencies
1676
1677         Unreviewed, fix simple typo.
1678
1679         * PlatformEfl.cmake:
1680
1681 2014-12-08  Beth Dakin  <bdakin@apple.com>
1682
1683         Copy and Lookup menu items should be disabled when something is not copyable
1684         https://bugs.webkit.org/show_bug.cgi?id=139423
1685
1686         Reviewed by Tim Horton.
1687
1688         Add allowsCopy to the WebHitTestResult.
1689         * Shared/WebHitTestResult.cpp:
1690         (WebKit::WebHitTestResult::Data::Data):
1691         (WebKit::WebHitTestResult::Data::encode):
1692         (WebKit::WebHitTestResult::Data::decode):
1693         * Shared/WebHitTestResult.h:
1694         (WebKit::WebHitTestResult::allowsCopy):
1695
1696         Set autoenablesItems to NO. It’s messing with our ability to control the enable/
1697         disable state otherwise.
1698         * UIProcess/API/mac/WKView.mm:
1699         (-[WKView initWithFrame:context:configuration:webView:]):
1700
1701         Disable both lookup and copy when a WebHitTestResult does not allow copy.
1702         * UIProcess/mac/WKActionMenuController.mm:
1703
1704 2014-12-08  Dan Bernstein  <mitz@apple.com>
1705
1706         <rdar://problem/18905383> [iOS] Crash due to null m_webPageProxyForBackForwardListForCurrentSwipe in ViewGestureController::endSwipeGesture
1707         https://bugs.webkit.org/show_bug.cgi?id=138750
1708
1709         Reviewed by Tim Horton.
1710
1711         The snapshot for the current gesture was being removed mid-gesture by the callback from
1712         dispatchAfterEnsuringDrawing scheduled by the previous gesture. The fix is to ignore the
1713         callback for a gesture if it is made after the snapshot for that gesture has already been
1714         removed (which can happen as a result of the watchdog timer firing).
1715
1716         * UIProcess/ios/ViewGestureControllerIOS.mm:
1717         (WebKit::ViewGestureController::ViewGestureController): Initialize new member variable.
1718         (WebKit::addLogEntry): Fixed the log message format.
1719         (WebKit::ViewGestureController::endSwipeGesture): When dispatchAfterEnsuringDrawing() calls
1720         us back, bail out if the gesture snapshot has already been removed.
1721         (WebKit::ViewGestureController::removeSwipeSnapshot): Increment
1722         m_gesturePendingSnapshotRemoval.
1723         * UIProcess/mac/ViewGestureController.h: Added m_gesturePendingSnapshotRemoval member
1724         variable.
1725
1726 2014-12-08  Anders Carlsson  <andersca@apple.com>
1727
1728         The website data store should know all its associated pages
1729         https://bugs.webkit.org/show_bug.cgi?id=139411
1730
1731         Reviewed by Tim Horton.
1732
1733         * UIProcess/WebPageProxy.cpp:
1734         (WebKit::WebPageProxy::WebPageProxy):
1735         (WebKit::WebPageProxy::close):
1736         * UIProcess/WebPageProxy.h:
1737         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1738         (WebKit::WebsiteDataStore::~WebsiteDataStore):
1739         (WebKit::WebsiteDataStore::addWebPage):
1740         (WebKit::WebsiteDataStore::removeWebPage):
1741         * UIProcess/WebsiteData/WebsiteDataStore.h:
1742
1743 2014-12-08  Dan Bernstein  <mitz@apple.com>
1744
1745         <rdar://problem/18046692> [iOS] Safari crashes at -[_NSUndoStack popAndInvoke] when trying to undo typing on closed tab
1746         https://bugs.webkit.org/show_bug.cgi?id=139408
1747
1748         Reviewed by Anders Carlsson.
1749
1750         * UIProcess/ios/WKContentView.mm:
1751         (-[WKContentView undoManager]): Override to initialize if necessary and return a unique undo
1752         manager for this instance. This ensures that undoable operations for this webview don’t get
1753         put in other undo managers, and matches UIWebView behavior.
1754
1755 2014-12-08  Chris Dumez  <cdumez@apple.com>
1756
1757         Revert r176293 & r176275
1758
1759         Unreviewed, revert r176293 & r176275 changing the Vector API to use unsigned type
1760         instead of size_t. There is some disagreement regarding the long-term direction
1761         of the API and we shouldn’t leave the API partly transitioned to unsigned type
1762         while making a decision.
1763
1764         * Platform/IPC/ArgumentCoders.h:
1765         * Platform/IPC/DataReference.h:
1766
1767 2014-12-08  Anders Carlsson  <andersca@apple.com>
1768
1769         Make deleting all cookies after a given date a little more sane
1770         https://bugs.webkit.org/show_bug.cgi?id=139409
1771
1772         Reviewed by Antti Koivisto.
1773
1774         Change all the doubles to std::chrono::system_clock::time_points instead.
1775
1776         * Platform/IPC/ArgumentCoders.cpp:
1777         (IPC::ArgumentCoder<std::chrono::system_clock::time_point>::encode):
1778         (IPC::ArgumentCoder<std::chrono::system_clock::time_point>::decode):
1779         * Platform/IPC/ArgumentCoders.h:
1780         * Scripts/webkit/messages.py:
1781         (headers_for_type):
1782         * UIProcess/API/C/WKCookieManager.cpp:
1783         (WKCookieManagerDeleteAllCookiesModifiedAfterDate):
1784         * UIProcess/API/C/WKCookieManager.h:
1785         * UIProcess/WebCookieManagerProxy.cpp:
1786         (WebKit::WebCookieManagerProxy::deleteAllCookiesModifiedSince):
1787         (WebKit::WebCookieManagerProxy::deleteAllCookiesModifiedAfterDate): Deleted.
1788         * UIProcess/WebCookieManagerProxy.h:
1789         * WebProcess/Cookies/WebCookieManager.cpp:
1790         (WebKit::WebCookieManager::deleteAllCookiesModifiedSince):
1791         (WebKit::WebCookieManager::deleteAllCookiesModifiedAfterDate): Deleted.
1792         * WebProcess/Cookies/WebCookieManager.h:
1793         * WebProcess/Cookies/WebCookieManager.messages.in:
1794
1795 2014-12-08  Anders Carlsson  <andersca@apple.com>
1796
1797         Move the callback invocation outside of the loop.
1798
1799         Rubber-stamped by Tim Horton.
1800
1801         * UIProcess/WebKeyValueStorageManager.cpp:
1802         (WebKit::WebKeyValueStorageManager::getStorageDetailsByOrigin):
1803
1804 2014-12-08  Anders Carlsson  <andersca@apple.com>
1805
1806         Add a stub implementation of WebsiteDataStore::removeDataModifiedSince
1807         https://bugs.webkit.org/show_bug.cgi?id=139406
1808
1809         Reviewed by Antti Koivisto.
1810
1811         Change _WKWebsiteDataStore to call the newly added function.
1812
1813         * UIProcess/API/Cocoa/_WKWebsiteDataStore.mm:
1814         (toWebsiteDataTypes):
1815         (toSystemClockTime):
1816         (-[_WKWebsiteDataStore removeDataOfTypes:modifiedSince:completionHandler:]):
1817         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1818         (WebKit::WebsiteDataStore::removeDataModifiedSince):
1819         * UIProcess/WebsiteData/WebsiteDataStore.h:
1820
1821 2014-12-08  Gwang Yoon Hwang  <yoon@igalia.com>
1822
1823         [GTK] Let DrawingArea manages setAcceleratedCompositingWindowId
1824         https://bugs.webkit.org/show_bug.cgi?id=117230
1825
1826         Reviewed by Anders Carlsson.
1827
1828         This is a preparation patch for Threaded Coordinated Graphics.
1829
1830         LayerTreeHostGtk uses a native window handle to make glContext for
1831         accelerated compositing. Therefore it is natural for DrawingArea to take
1832         responsibility for the native window handle. And, in Coordinated
1833         Graphics case, WebPage creates LayerTreeHost before receiving a native
1834         window handle from UIProcess. It means we need a method to pass the
1835         native window handle to already created LayerTreeHost.
1836
1837         This patch uses DrawingAreaProxy::setNativeSurfaceHandleForCompositing
1838         instead of WebCoreProxy::setAcceleratedCompositingWindowId to set window
1839         ID for accelerated compositing.
1840
1841         Also, this patch renames the setAcceleratedCompositingWindowId with a
1842         more generic name, setNativeSurfaceHandleForCompositing.
1843
1844         No new tests. No change in functionality.
1845
1846         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
1847         (webkitWebViewBaseCreateWebPage):
1848         * UIProcess/DrawingAreaProxyImpl.cpp:
1849         (WebKit::DrawingAreaProxyImpl::setNativeSurfaceHandleForCompositing):
1850         * UIProcess/DrawingAreaProxyImpl.h:
1851         * UIProcess/WebPageProxy.h:
1852         * UIProcess/gtk/WebPageProxyGtk.cpp:
1853         (WebKit::WebPageProxy::setAcceleratedCompositingWindowId): Deleted.
1854         * WebProcess/WebPage/DrawingArea.h:
1855         (WebKit::DrawingArea::nativeSurfaceHandleForCompositing):
1856         * WebProcess/WebPage/DrawingArea.messages.in:
1857         * WebProcess/WebPage/DrawingAreaImpl.cpp:
1858         (WebKit::DrawingAreaImpl::setNativeSurfaceHandleForCompositing):
1859         * WebProcess/WebPage/DrawingAreaImpl.h:
1860         * WebProcess/WebPage/WebPage.h:
1861         * WebProcess/WebPage/WebPage.messages.in:
1862         * WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp:
1863         (WebKit::LayerTreeHostGtk::glContext):
1864         (WebKit::LayerTreeHostGtk::initialize):
1865         * WebProcess/WebPage/gtk/WebPageGtk.cpp:
1866         (WebKit::WebPage::platformInitialize):
1867         (WebKit::WebPage::setAcceleratedCompositingWindowId): Deleted.
1868
1869 2014-12-08  Philippe Normand  <pnormand@igalia.com>
1870
1871         [GTK] UserMedia Permission Request API
1872         https://bugs.webkit.org/show_bug.cgi?id=136449
1873
1874         Reviewed by Carlos Garcia Campos.
1875
1876         * PlatformGTK.cmake: GTK-specific new files.
1877         * UIProcess/API/gtk/WebKitUIClient.cpp:  DecidePolicy handler
1878         implementation for UserMediaPermissionRequest.
1879         * UIProcess/API/gtk/WebKitUserMediaPermissionRequest.cpp: Added,
1880         WebKitGTK API for UserMediaPermissionRequest, very similar to the
1881         one used for Geolocation.
1882         (webkitUserMediaPermissionRequestAllow):
1883         (webkitUserMediaPermissionRequestDeny):
1884         (webkit_permission_request_interface_init):
1885         (webkitUserMediaPermissionRequestDispose):
1886         (webkit_user_media_permission_get_media_types):
1887         (webkitUserMediaPermissionRequestGetProperty):
1888         (webkit_user_media_permission_request_class_init):
1889         (webkitUserMediaPermissionRequestCreate):
1890         * UIProcess/API/gtk/WebKitUserMediaPermissionRequest.h: Added.
1891         * UIProcess/API/gtk/WebKitUserMediaPermissionRequestPrivate.h: Added.
1892         * UIProcess/API/gtk/docs/webkit2gtk-docs.sgml: Expose new API
1893         in documentation.
1894         * UIProcess/API/gtk/docs/webkit2gtk-sections.txt: Ditto.
1895         * UIProcess/API/gtk/webkit2.h: Expose UserMediaPermissionRequest API.
1896
1897 2014-12-08  Anders Carlsson  <andersca@apple.com>
1898
1899         Add a stubbed out method for clearing out the website data store
1900         https://bugs.webkit.org/show_bug.cgi?id=139404
1901
1902         Reviewed by Antti Koivisto.
1903
1904         Add stubbed out method that just calls the completion handler.
1905
1906         * UIProcess/API/Cocoa/_WKWebsiteDataStore.h:
1907         * UIProcess/API/Cocoa/_WKWebsiteDataStore.mm:
1908         (-[_WKWebsiteDataStore removeDataOfTypes:modifiedSince:completionHandler:]):
1909
1910 2014-12-06  Antti Koivisto  <antti@apple.com>
1911
1912         REGRESSION (173394): Support for webcam is broken
1913         https://bugs.webkit.org/show_bug.cgi?id=139313
1914
1915         Reviewed by Alexey Proskuryakov.
1916
1917         * NetworkProcess/NetworkResourceLoader.cpp:
1918         (WebKit::NetworkResourceLoader::didReceiveResponseAsync):
1919
1920             Don't buffer when handling multipart/x-mixed-replace. Multiple calls to didReceiveResponseAsync break assumptions.
1921
1922 2014-12-08  Gwang Yoon Hwang  <yoon@igalia.com>
1923
1924         [CoordinatedGraphics] Move CoordinatedBackingStore and CoordinatedGraphicsScene to Shared
1925         https://bugs.webkit.org/show_bug.cgi?id=139385
1926
1927         Reviewed by Martin Robinson.
1928
1929         For the Threaded Compositor, CoordinatedBackingStore and
1930         CoordinatedGraphicsScene should be placed at the Shared instead of
1931         UIProcess because it can be used in the WebProcess also.
1932
1933         No new tests because there is no behavior change.
1934
1935         * PlatformEfl.cmake:
1936         * Shared/CoordinatedGraphics/CoordinatedBackingStore.cpp: Renamed from Source/WebKit2/UIProcess/CoordinatedGraphics/CoordinatedBackingStore.cpp.
1937         * Shared/CoordinatedGraphics/CoordinatedBackingStore.h: Renamed from Source/WebKit2/UIProcess/CoordinatedGraphics/CoordinatedBackingStore.h.
1938         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp: Renamed from Source/WebKit2/UIProcess/CoordinatedGraphics/CoordinatedGraphicsScene.cpp.
1939         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h: Renamed from Source/WebKit2/UIProcess/CoordinatedGraphics/CoordinatedGraphicsScene.h.
1940
1941 2014-12-08  Shivakumar JM  <shiva.jm@samsung.com>
1942
1943         Fix build warning in WebKit2/UIProcess module.
1944         https://bugs.webkit.org/show_bug.cgi?id=139386
1945
1946         Reviewed by Alexey Proskuryakov.
1947
1948         Fix build warning by removing unused parameter name from function
1949
1950         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1951         (WebKit::WebsiteDataStore::WebsiteDataStore):
1952
1953 2014-12-07  Gwang Yoon Hwang  <yoon@igalia.com>
1954
1955         [CoordinatedGraphics] Change the namespace of CoordinatedBackingStore and CoordinatedGraphicsScene
1956         https://bugs.webkit.org/show_bug.cgi?id=139372
1957
1958         Reviewed by Gyuyoung Kim.
1959
1960         CoordinatedBackingStore and CoordinatedGraphicsScene should be declared in the WebKit namespace
1961         instead of WebCore namespace.
1962
1963         * UIProcess/API/CoordinatedGraphics/WKCoordinatedScene.cpp:
1964         * UIProcess/CoordinatedGraphics/CoordinatedBackingStore.cpp:
1965         * UIProcess/CoordinatedGraphics/CoordinatedBackingStore.h:
1966         (WebKit::CoordinatedBackingStoreTile::CoordinatedBackingStoreTile):
1967         (WebKit::CoordinatedBackingStore::rect):
1968         (WebCore::CoordinatedBackingStoreTile::CoordinatedBackingStoreTile): Deleted.
1969         (WebCore::CoordinatedBackingStore::rect): Deleted.
1970         * UIProcess/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
1971         * UIProcess/CoordinatedGraphics/CoordinatedGraphicsScene.h:
1972         (WebKit::CoordinatedGraphicsScene::setViewBackgroundColor):
1973         (WebKit::CoordinatedGraphicsScene::viewBackgroundColor):
1974         (WebKit::CoordinatedGraphicsScene::layerByID):
1975         (WebKit::CoordinatedGraphicsScene::rootLayer):
1976         (WebCore::CoordinatedGraphicsScene::setViewBackgroundColor): Deleted.
1977         (WebCore::CoordinatedGraphicsScene::viewBackgroundColor): Deleted.
1978         (WebCore::CoordinatedGraphicsScene::layerByID): Deleted.
1979         (WebCore::CoordinatedGraphicsScene::rootLayer): Deleted.
1980         * UIProcess/CoordinatedGraphics/CoordinatedLayerTreeHostProxy.h:
1981         (WebKit::CoordinatedLayerTreeHostProxy::coordinatedGraphicsScene):
1982         * UIProcess/CoordinatedGraphics/WKCoordinatedSceneAPICast.h:
1983         (WebKit::toImpl):
1984         (WebKit::toAPI):
1985         (toImpl): Deleted.
1986         (toAPI): Deleted.
1987         * UIProcess/CoordinatedGraphics/WebView.h:
1988
1989 2014-12-07  Dan Bernstein  <mitz@apple.com>
1990
1991         Introduce and deploy a function that allocates and returns an instance of a soft-linked class
1992         https://bugs.webkit.org/show_bug.cgi?id=139348
1993
1994         Reviewed by Anders Carlsson.
1995
1996         In [[getFooClass() alloc] init*], the type of the result of +alloc is id, so the compiler
1997         picks an arbitrary declaration of init*, not necessarily the Foo one. This can then lead
1998         to warnings or errors if the types or attributes don’t match, or to runtime errors if Foo
1999         doesn’t even have the expected initializer. The new allocFooInstance() returns a Foo *, thus
2000         avoiding the ambiguity.
2001
2002         * UIProcess/ios/forms/WKAirPlayRoutePicker.mm:
2003         (-[WKAirPlayRoutePicker showAirPlayPickerIPad:fromRect:]):
2004         (-[WKAirPlayRoutePicker showAirPlayPickerIPhone:]):
2005         (-[WKAirPlayRoutePicker show:fromRect:]):
2006         * UIProcess/ios/forms/WKFileUploadPanel.mm:
2007         (-[_WKVideoFileUploadItem displayImage]):
2008         * UIProcess/mac/WKActionMenuController.mm:
2009         (-[WKActionMenuController _defaultMenuItemsForDataDetectableLink]):
2010         * WebProcess/WebPage/mac/PlatformCALayerRemoteCustom.mm:
2011         (WebKit::PlatformCALayerRemoteCustom::clone):
2012
2013 2014-12-06  Anders Carlsson  <andersca@apple.com>
2014
2015         Fix build with newer versions of clang.
2016         rdar://problem/18978733
2017
2018         Add missing overrides and casts.
2019
2020         * NetworkProcess/NetworkProcess.h:
2021         * Shared/Downloads/DownloadAuthenticationClient.h:
2022         (WebKit::DownloadAuthenticationClient::refAuthenticationClient): Deleted.
2023         (WebKit::DownloadAuthenticationClient::derefAuthenticationClient): Deleted.
2024         * UIProcess/API/C/WKPage.cpp:
2025         (WKPageSetPageUIClient):
2026         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
2027         (-[WKWebViewConfiguration copyWithZone:]):
2028         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
2029         (-[_WKProcessPoolConfiguration copyWithZone:]):
2030         * UIProcess/Cocoa/NavigationState.h:
2031         * UIProcess/Network/NetworkProcessProxy.h:
2032         * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.h:
2033         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::updateLayersAfterViewportChange): Deleted.
2034         * UIProcess/WebPageProxy.h:
2035         * WebProcess/EntryPoint/mac/LegacyProcess/WebContentProcessMain.mm:
2036         (WebKit::WebContentProcessMainDelegate::doPreInitializationWork): Deleted.
2037         (WebKit::WebContentProcessMainDelegate::getConnectionIdentifier): Deleted.
2038         (WebKit::WebContentProcessMainDelegate::getClientIdentifier): Deleted.
2039         (WebKit::WebContentProcessMainDelegate::getClientProcessName): Deleted.
2040         * WebProcess/IconDatabase/WebIconDatabaseProxy.h:
2041         * WebProcess/InjectedBundle/mac/InjectedBundleMac.mm:
2042         (WebKit::InjectedBundle::initialize):
2043         * WebProcess/WebCoreSupport/WebChromeClient.h:
2044         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
2045         * WebProcess/WebPage/WebBackForwardListProxy.h:
2046         * WebProcess/WebPage/WebInspector.h:
2047         (WebKit::WebInspector::didClose): Deleted.
2048         (WebKit::WebInspector::didReceiveInvalidMessage): Deleted.
2049         * WebProcess/WebPage/WebInspectorUI.h:
2050         (WebKit::WebInspectorUI::didClose): Deleted.
2051         (WebKit::WebInspectorUI::didReceiveInvalidMessage): Deleted.
2052         * WebProcess/WebPage/mac/PlatformCALayerRemoteCustom.h:
2053         * WebProcess/WebProcess.h:
2054         * WebProcess/ios/WebVideoFullscreenManager.h:
2055
2056 2014-12-06  Anders Carlsson  <andersca@apple.com>
2057
2058         Only include TUCallSPI on Mac.
2059
2060         * Platform/mac/MenuUtilities.mm:
2061
2062 2014-12-06  Commit Queue  <commit-queue@webkit.org>
2063
2064         Unreviewed, rolling out r176905.
2065         https://bugs.webkit.org/show_bug.cgi?id=139337
2066
2067         the test case is failing in bots (Requested by anttik on
2068         #webkit).
2069
2070         Reverted changeset:
2071
2072         "REGRESSION (173394): Support for webcam is broken"
2073         https://bugs.webkit.org/show_bug.cgi?id=139313
2074         http://trac.webkit.org/changeset/176905
2075
2076 2014-12-05  Antti Koivisto  <antti@apple.com>
2077
2078         REGRESSION (173394): Support for webcam is broken
2079         https://bugs.webkit.org/show_bug.cgi?id=139313
2080
2081         Reviewed by Alexey Proskuryakov.
2082
2083         * NetworkProcess/NetworkResourceLoader.cpp:
2084         (WebKit::NetworkResourceLoader::didReceiveResponseAsync):
2085
2086             Don't buffer when handling multipart/x-mixed-replace. Multiple calls to didReceiveResponseAsync break assumptions.
2087
2088 2014-12-05  Yongjun Zhang  <yongjun_zhang@apple.com>
2089
2090         Add a delegate method for didReceiveServerRedirectForProvisionalLoadForFrame.
2091         https://bugs.webkit.org/show_bug.cgi?id=139325
2092
2093         Add delegate method webProcessPlugInBrowserContextController:didReceiveServerRedirectForProvisionalLoadForFrame: into
2094         WKWebProcessPlugInLoadDelegate to listen to server side redirect in injected bundle.
2095
2096         Reviewed by Dan Bernstein.
2097
2098         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInLoadDelegate.h:
2099         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
2100         (didReceiveServerRedirectForProvisionalLoadForFrame):
2101         (setUpPageLoaderClient):
2102
2103 2014-12-05  Csaba Osztrogonác  <ossy@webkit.org>
2104
2105         URTBF, EFL is happy now.
2106
2107         * UIProcess/API/APIWebsiteDataStore.cpp:
2108         (API::WebsiteDataStore::defaultDataStoreConfiguration):
2109         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2110         (WebKit::WebsiteDataStore::createNonPersistent):
2111
2112 2014-12-05  Mark Lam  <mark.lam@apple.com>
2113
2114         Gardening: one more build fix for GTK builds.
2115
2116         * CMakeLists.txt:
2117
2118 2014-12-05  Csaba Osztrogonác  <ossy@webkit.org>
2119
2120         URTBF, remove duplicated entry due to parallel buildfixing.
2121
2122         * CMakeLists.txt:
2123
2124 2014-12-05  Csaba Osztrogonác  <ossy@webkit.org>
2125
2126         URTBF after r176849.
2127
2128         * CMakeLists.txt: Added WebProcess/InjectedBundle/DOM/InjectedBundleCSSStyleDeclarationHandle.cpp.
2129
2130 2014-12-05  Mark Lam  <mark.lam@apple.com>
2131
2132         Gardening: another build fix for GTK builds.
2133
2134         * CMakeLists.txt:
2135
2136 2014-12-05  Mark Lam  <mark.lam@apple.com>
2137
2138         Gardening: more speculative build fix for GTK builds.
2139
2140         * CMakeLists.txt:
2141
2142 2014-12-05  Tim Horton  <timothy_horton@apple.com>
2143
2144         Use the system string for telephone number menu
2145         https://bugs.webkit.org/show_bug.cgi?id=139324
2146         <rdar://problem/18726471>
2147
2148         Reviewed by Anders Carlsson.
2149
2150         * Platform/mac/MenuUtilities.mm:
2151         (WebKit::menuItemTitleForTelephoneNumberGroup):
2152         Make use of the SPI to retrieve the string if it exists.
2153
2154 2014-12-05  Tim Horton  <timothy_horton@apple.com>
2155
2156         If the action menu hit test times out, a menu with a single separator appears
2157         https://bugs.webkit.org/show_bug.cgi?id=139320
2158         <rdar://problem/19158331>
2159
2160         Reviewed by Beth Dakin.
2161
2162         * UIProcess/mac/WKActionMenuController.h:
2163         * UIProcess/mac/WKActionMenuController.mm:
2164         (-[WKActionMenuController menuNeedsUpdate:]):
2165         (-[WKActionMenuController _defaultMenuItems]):
2166         Add a new "TimedOut" state, which we get into if the sync wait for
2167         didPerformActionMenuHitTest times out. In this case, we'll drop the
2168         separator item and give up on the menu. This way, the menu will never
2169         have just a single separator item at the end of menuNeedsUpdate:.
2170
2171 2014-12-05  Mark Lam  <mark.lam@apple.com>
2172
2173         Gardening: speculative build fix for GTK builds.
2174
2175         * CMakeLists.txt:
2176
2177 2014-12-05  Anders Carlsson  <andersca@apple.com>
2178
2179         Fix build.
2180
2181         * UIProcess/API/Cocoa/APIWebsiteDataStoreCocoa.mm:
2182         (API::WebsiteDataStore::defaultDataStoreConfiguration):
2183
2184 2014-12-05  Anders Carlsson  <andersca@apple.com>
2185
2186         Give all web pages a website data store
2187         https://bugs.webkit.org/show_bug.cgi?id=139317
2188
2189         Reviewed by Tim Horton.
2190
2191         * UIProcess/API/Cocoa/WKWebView.mm:
2192         (-[WKWebView initWithFrame:configuration:]):
2193         Set the website data store on the window.
2194
2195         * UIProcess/WebContext.cpp:
2196         (WebKit::websiteDataStoreConfiguration):
2197         Helper function that will create the default website data store configuration for a context.
2198
2199         (WebKit::WebContext::WebContext):
2200         Create a new, per-context data store.
2201
2202         (WebKit::WebContext::createWebPage):
2203         If we don't have a data store filled in, use the default per-context one.
2204
2205         * UIProcess/WebContext.h:
2206         * UIProcess/WebPageProxy.h:
2207
2208 2014-12-05  Anders Carlsson  <andersca@apple.com>
2209
2210         Move the website data store code to a new file
2211         https://bugs.webkit.org/show_bug.cgi?id=139312
2212
2213         Reviewed by Tim Horton.
2214
2215         It's weird to have all the website data code in the API class, so move it to a new file.
2216
2217         * UIProcess/API/APIWebsiteDataStore.cpp:
2218         (API::WebsiteDataStore::WebsiteDataStore):
2219         (API::WebsiteDataStore::isNonPersistent):
2220         (API::generateNonPersistentSessionID): Deleted.
2221         * UIProcess/API/APIWebsiteDataStore.h:
2222         * UIProcess/API/Cocoa/WKWebView.mm:
2223         (-[WKWebView initWithFrame:configuration:]):
2224         * UIProcess/WebsiteData/WebsiteDataStore.cpp: Copied from Source/WebKit2/UIProcess/API/APIWebsiteDataStore.cpp.
2225         (WebKit::generateNonPersistentSessionID):
2226         (WebKit::WebsiteDataStore::createNonPersistent):
2227         (WebKit::WebsiteDataStore::create):
2228         (WebKit::WebsiteDataStore::WebsiteDataStore):
2229         (WebKit::WebsiteDataStore::~WebsiteDataStore):
2230         * UIProcess/WebsiteData/WebsiteDataStore.h: Copied from Source/WebKit2/UIProcess/API/APIWebsiteDataStore.h.
2231         (WebKit::WebsiteDataStore::isNonPersistent):
2232         (WebKit::WebsiteDataStore::sessionID):
2233         * WebKit2.xcodeproj/project.pbxproj:
2234
2235 2014-12-05  Tim Horton  <timothy_horton@apple.com>
2236
2237         Keyboard input should be disabled in the preview popover
2238         https://bugs.webkit.org/show_bug.cgi?id=139219
2239         <rdar://problem/19052381>
2240
2241         Reviewed by Anders Carlsson.
2242
2243         * UIProcess/API/mac/WKView.mm:
2244         (-[WKView performKeyEquivalent:]):
2245         (-[WKView keyUp:]):
2246         (-[WKView keyDown:]):
2247         (-[WKView flagsChanged:]):
2248         There are two implementations of each of these methods in this file.
2249         Adjust the ones that the original patch missed.
2250
2251 2014-12-05  Antti Koivisto  <antti@apple.com>
2252
2253         In NetworkResourceLoader always bail out after abort()
2254         https://bugs.webkit.org/show_bug.cgi?id=139299
2255
2256         Reviewed by Alexey Proskuryakov.
2257
2258         Invoking abort() may kill the current object. Take care to bail out after it.
2259
2260         * NetworkProcess/NetworkResourceLoader.cpp:
2261         (WebKit::NetworkResourceLoader::didReceiveResponseAsync):
2262         (WebKit::NetworkResourceLoader::didReceiveBuffer):
2263         (WebKit::NetworkResourceLoader::didFinishLoading):
2264
2265             Either make sure sendAbortingOnFailure() is called last in callbacks or the results is explicitly tested.
2266
2267         (WebKit::NetworkResourceLoader::bufferingTimerFired):
2268         (WebKit::NetworkResourceLoader::sendBufferMaybeAborting):
2269
2270             Rename and return a boolean to indicate if load should continue.
2271
2272         (WebKit::NetworkResourceLoader::sendBuffer): Deleted.
2273         * NetworkProcess/NetworkResourceLoader.h:
2274
2275 2014-12-05  Anders Carlsson  <andersca@apple.com>
2276
2277         Don't use PLATFORM(IOS) in non-project headers.
2278
2279         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
2280         (-[WKWebViewConfiguration _allowsAlternateFullscreen]):
2281         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
2282
2283 2014-12-05  Sam Weinig  <sam@webkit.org>
2284
2285         WKBundleCSSStyleDeclarationRef needs to be a real API::Object
2286         https://bugs.webkit.org/show_bug.cgi?id=139291
2287
2288         Reviewed by Dan Bernstein.
2289
2290         Change WKBundleCSSStyleDeclarationRef from being a WebCore::CSSStyleDeclaration, to
2291         being a real API::Object.  WKRetain and WKRelease require this.
2292
2293         * Shared/APIObject.h:
2294         * WebKit2.xcodeproj/project.pbxproj:
2295         * WebProcess/InjectedBundle/API/c/WKBundleAPICast.h:
2296         * WebProcess/InjectedBundle/DOM/InjectedBundleCSSStyleDeclarationHandle.cpp: Added.
2297         (WebKit::domHandleCache):
2298         (WebKit::InjectedBundleCSSStyleDeclarationHandle::getOrCreate):
2299         (WebKit::InjectedBundleCSSStyleDeclarationHandle::InjectedBundleCSSStyleDeclarationHandle):
2300         (WebKit::InjectedBundleCSSStyleDeclarationHandle::~InjectedBundleCSSStyleDeclarationHandle):
2301         * WebProcess/InjectedBundle/DOM/InjectedBundleCSSStyleDeclarationHandle.h: Added.
2302         * WebProcess/InjectedBundle/InjectedBundlePageEditorClient.cpp:
2303         (WebKit::InjectedBundlePageEditorClient::shouldApplyStyle):
2304
2305 2014-12-05  Anders Carlsson  <andersca@apple.com>
2306
2307         Oops, didn't mean to commit this.
2308
2309         * Shared/API/Cocoa/WKFoundation.h:
2310
2311 2014-12-05  Anders Carlsson  <andersca@apple.com>
2312
2313         Add an API::WebsiteDataStore object and use it for _WKWebsiteDataStore
2314         https://bugs.webkit.org/show_bug.cgi?id=139304
2315
2316         Reviewed by Tim Horton.
2317
2318         * Shared/APIObject.h:
2319         * Shared/Cocoa/APIObject.mm:
2320         (API::Object::newObject):
2321         Make _WKWebsiteDataStore a wrapper for API::WebsiteDataStore instead of API::Session.
2322
2323         * UIProcess/API/APIWebsiteDataStore.cpp: Added.
2324         (API::generateNonPersistentSessionID):
2325         (API::WebsiteDataStore::defaultDataStore):
2326         (API::WebsiteDataStore::createNonPersistentDataStore):
2327         (API::WebsiteDataStore::WebsiteDataStore):
2328         (API::WebsiteDataStore::~WebsiteDataStore):
2329         (API::WebsiteDataStore::isNonPersistent):
2330         Add new WebsiteDataStore implementation. Currently it only contains the WebCore Session ID, but more will be
2331         added to it in upcoming commits.
2332
2333         * UIProcess/API/APIWebsiteDataStore.h:
2334         Add header.
2335
2336         * UIProcess/API/Cocoa/APIWebsiteDataStoreCocoa.mm: Added.
2337         (API::WebsiteDataStore::defaultDataStoreConfiguration):
2338         Platform specific file that returns the default data store configuration.
2339
2340         * UIProcess/API/Cocoa/WKWebView.mm:
2341         (-[WKWebView initWithFrame:configuration:]):
2342         Set the session ID from the website data store.
2343
2344         * UIProcess/API/Cocoa/_WKWebsiteDataStore.mm:
2345         (+[_WKWebsiteDataStore defaultDataStore]):
2346         (+[_WKWebsiteDataStore nonPersistentDataStore]):
2347         (-[_WKWebsiteDataStore dealloc]):
2348         (-[_WKWebsiteDataStore isNonPersistent]):
2349         (-[_WKWebsiteDataStore _apiObject]):
2350         Update now that we wrap an API::WebsiteDataStore instead.
2351
2352         * UIProcess/API/Cocoa/_WKWebsiteDataStoreInternal.h:
2353         (WebKit::wrapper):
2354         Update for API::Session -> API::WebsiteDataStore change.
2355
2356         * WebKit2.xcodeproj/project.pbxproj:
2357         Add new files.
2358
2359 2014-12-05  David Kilzer  <ddkilzer@apple.com>
2360
2361         FeatureDefines.xcconfig: Workaround bug in Xcode 5.1.1 when defining ENABLE_WEB_REPLAY
2362         <http://webkit.org/b/139286>
2363
2364         Reviewed by Daniel Bates.
2365
2366         * Configurations/FeatureDefines.xcconfig: Switch back to using
2367         PLATFORM_NAME to workaround a bug in Xcode 5.1.1 on 10.8.
2368
2369 2014-12-05  Anders Carlsson  <andersca@apple.com>
2370
2371         Make WebPageProxy hold on to a SessionID instead of an API:Session
2372         https://bugs.webkit.org/show_bug.cgi?id=139302
2373
2374         Reviewed by Sam Weinig.
2375
2376         This is in preparation for adding API::WebsiteDataStore. Currently we have to keep the
2377         Session ID and the WebsiteDataStore separate because we still need to support toggling private browsing.
2378
2379         * UIProcess/API/C/WKPage.cpp:
2380         (WKPageSetSession):
2381         * UIProcess/API/C/WKSessionRef.cpp:
2382         (WKSessionCreate):
2383         * UIProcess/API/Cocoa/WKWebView.mm:
2384         (-[WKWebView initWithFrame:configuration:]):
2385         * UIProcess/API/Cocoa/_WKWebsiteDataStore.mm:
2386         (+[_WKWebsiteDataStore nonPersistentDataStore]):
2387         * UIProcess/APISession.cpp:
2388         (API::generateID):
2389         (API::Session::Session):
2390         (API::Session::createEphemeral):
2391         (API::Session::legacyPrivateSession): Deleted.
2392         (API::Session::create): Deleted.
2393         * UIProcess/APISession.h:
2394         * UIProcess/WebContext.cpp:
2395         (WebKit::WebContext::createWebPage):
2396         * UIProcess/WebPageProxy.cpp:
2397         (WebKit::WebPageProxy::WebPageProxy):
2398         (WebKit::WebPageProxy::setSessionID):
2399         (WebKit::WebPageProxy::creationParameters):
2400         (WebKit::WebPageProxy::setSession): Deleted.
2401         * UIProcess/WebPageProxy.h:
2402         (WebKit::WebPageProxy::sessionID):
2403
2404 2014-12-05  Eric Carlson  <eric.carlson@apple.com>
2405
2406         [iOS] allow host application to opt-out of alternate fullscreen pt. 2
2407         https://bugs.webkit.org/show_bug.cgi?id=139227
2408
2409         Reviewed by Jer Noble and Anders Carlsson.
2410
2411         * UIProcess/ios/WebVideoFullscreenManagerProxy.h: Add bool param to setupFullscreenWithID.
2412         * UIProcess/ios/WebVideoFullscreenManagerProxy.messages.in: Ditto.
2413         * UIProcess/ios/WebVideoFullscreenManagerProxy.mm:
2414         (WebKit::WebVideoFullscreenManagerProxy::setupFullscreenWithID): Ditto.
2415
2416         * WebProcess/ios/WebVideoFullscreenManager.mm:
2417         (WebKit::WebVideoFullscreenManager::enterVideoFullscreenForVideoElement): Pass new parameter
2418             to SetupFullscreenWithID.
2419
2420 2014-12-04  Anders Carlsson  <andersca@apple.com>
2421
2422         Add missing includes in preparation for making toAPI require that it's passed an API::Object
2423         https://bugs.webkit.org/show_bug.cgi?id=139278
2424
2425         Reviewed by Tim Horton.
2426
2427         * UIProcess/API/C/WKAuthenticationChallenge.cpp:
2428         * UIProcess/API/C/WKAuthenticationDecisionListener.cpp:
2429         * UIProcess/API/C/WKContext.cpp:
2430         * UIProcess/API/C/WKDownload.cpp:
2431         * UIProcess/API/C/WKFrame.cpp:
2432         * UIProcess/API/C/WKGeolocationManager.cpp:
2433         * UIProcess/API/C/WKInspector.cpp:
2434         * UIProcess/API/C/WKPage.cpp:
2435         * UIProcess/GenericCallback.h:
2436         * UIProcess/Notifications/WebNotificationProvider.cpp:
2437         * UIProcess/WebContextConnectionClient.cpp:
2438         * UIProcess/WebContextInjectedBundleClient.cpp:
2439         * UIProcess/WebCookieManagerProxyClient.cpp:
2440         * UIProcess/WebDatabaseManagerProxyClient.cpp:
2441         * UIProcess/WebFindClient.cpp:
2442         * UIProcess/WebFormClient.cpp:
2443         * UIProcess/WebIconDatabaseClient.cpp:
2444         * UIProcess/WebPageContextMenuClient.cpp:
2445         * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
2446         * WebProcess/InjectedBundle/API/c/WKBundleDOMWindowExtension.cpp:
2447         * WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp:
2448         * WebProcess/InjectedBundle/API/c/WKBundleHitTestResult.cpp:
2449         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
2450         * WebProcess/InjectedBundle/InjectedBundleClient.cpp:
2451         * WebProcess/InjectedBundle/InjectedBundlePageFormClient.cpp:
2452         * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp:
2453         * WebProcess/InjectedBundle/InjectedBundlePagePolicyClient.cpp:
2454         * WebProcess/InjectedBundle/InjectedBundlePageResourceLoadClient.cpp:
2455         * WebProcess/InjectedBundle/InjectedBundlePageUIClient.cpp:
2456
2457 2014-12-04  Anders Carlsson  <andersca@apple.com>
2458
2459         Make API::String copy the underlying strings if needed, for thread safety
2460         https://bugs.webkit.org/show_bug.cgi?id=139261
2461
2462         Reviewed by Sam Weinig.
2463
2464         * Shared/API/c/WKString.cpp:
2465         (WKStringCreateWithUTF8CString):
2466         (WKStringCreateWithJSString):
2467         (WKStringCopyJSString):
2468         Move the implementations from API::String and directly into the API functions.
2469
2470         * Shared/APIString.h:
2471         Add a create overload that takes an rvalue reference. Call it from the create overload
2472         that takes an lvalue reference, but explicitly copy the string.
2473         We call isolatedCopy() again on the string in the rvalue reference overload, but that is a no-op
2474         if the string can be sent to another thread. Add assertions in the String constructor that we can
2475         send the string to another thread.
2476
2477 2014-12-04  Beth Dakin  <bdakin@apple.com>
2478
2479         Clients disabling action menus sometimes still invoke action menu behaviors
2480         https://bugs.webkit.org/show_bug.cgi?id=139270
2481         -and corresponding-
2482         rdar://problem/19147218
2483
2484         Reviewed by Tim Horton.
2485
2486         By default, we will keep a single item in the action menu up until the point where 
2487         _state == ActionMenuState::Ready. So by checking _state here, we are preventing 
2488         clients from opting out of our choice to wait. Ideally we would always still wait 
2489         for the Ready state, but this will get the best behavior in the mean time.
2490         * UIProcess/mac/WKActionMenuController.mm:
2491         (-[WKActionMenuController _updateActionMenuItems]):
2492
2493 2014-12-04  Antti Koivisto  <antti@apple.com>
2494
2495         REGRESSION (r173468): Cannot step in WebInspector
2496         https://bugs.webkit.org/show_bug.cgi?id=139260
2497
2498         Reviewed by Alexey Proskuryakov.
2499
2500         Inspector defers all loads and starts a nested runloop when it hits a breakpoint. When continuing it undefers the loads.
2501         If the script execution was triggered from the didFinishLoading callback of the main resource then the main resource would
2502         already be in the finished state in the network process side and setDefersLoading(false) message would end up restarting its load.
2503         Since loads are not meant to restart the generated callbacks would assert or crash the web process when handled in the next
2504         nested inspector runloop.
2505
2506         Fix by taking care that cleaned up NetworkResourceLoaders are always removed from the loader map of
2507         the NetworkConnectionToWebProcess and so can't end up handling late messages.
2508
2509         No test, this requires JS debugger to trigger.
2510
2511         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
2512         (WebKit::NetworkConnectionToWebProcess::didCleanupResourceLoader):
2513
2514             This is now the only way to remove resource loaders.
2515             It is called from NetworkResourceLoader::cleanup only.
2516
2517         (WebKit::NetworkConnectionToWebProcess::didClose):
2518         (WebKit::NetworkConnectionToWebProcess::removeLoadIdentifier):
2519
2520             Calling abort  removes the resource loader (since it calls cleanup) so no need to do it explicitly anymore.
2521
2522         * NetworkProcess/NetworkConnectionToWebProcess.h:
2523         * NetworkProcess/NetworkResourceLoader.cpp:
2524         (WebKit::NetworkResourceLoader::start):
2525
2526             We are guaranteed to be reffed by NetworkConnectionToWebProcess until cleanup so the explicit ref/deref can be removed.
2527
2528         (WebKit::NetworkResourceLoader::cleanup):
2529
2530             Call to NetworkConnectionToWebProcess::didCleanupResourceLoader to make the loader unreachable.
2531
2532         * NetworkProcess/NetworkResourceLoader.h:
2533         (WebKit::NetworkResourceLoader::identifier):
2534
2535 2014-12-04  Timothy Horton  <timothy_horton@apple.com>
2536
2537         Fix the 32-bit build.
2538
2539         * UIProcess/API/mac/WKView.mm:
2540         (-[WKView _setTextIndicator:fadeOut:animationCompletionHandler:]):
2541
2542 2014-12-04  Tim Horton  <timothy_horton@apple.com>
2543
2544         TextIndicator::createWithSelectionInFrame does synchronous IPC in WebKit2
2545         https://bugs.webkit.org/show_bug.cgi?id=139252
2546         <rdar://problem/19140827>
2547
2548         Reviewed by Anders Carlsson.
2549
2550         It turns out contentsToScreen requires sync IPC in Mac WebKit2, which we
2551         really don't want to be doing here (especially since the UI process will often
2552         be sitting in waitForAndDispatchImmediately waiting for didPerformActionMenuHitTest).
2553
2554         Go back to keeping TextIndicator rects in "window" coordinates and do the conversion
2555         in each of the WebKits instead of trying to share that code.
2556
2557         * Shared/WebCoreArgumentCoders.cpp:
2558         (IPC::ArgumentCoder<TextIndicatorData>::encode):
2559         (IPC::ArgumentCoder<TextIndicatorData>::decode):
2560         * UIProcess/API/mac/WKView.mm:
2561         (-[WKView _setTextIndicator:fadeOut:animationCompletionHandler:]):
2562         * WebProcess/WebPage/FindController.cpp:
2563         (WebKit::FindController::updateFindIndicator):
2564         (WebKit::FindController::drawRect):
2565         Adjust to the WebCore changes.
2566
2567 2014-12-04  Anders Carlsson  <andersca@apple.com>
2568
2569         Simplify StorageManager callback functions
2570         https://bugs.webkit.org/show_bug.cgi?id=139257
2571
2572         Reviewed by Antti Koivisto.
2573
2574         * UIProcess/Storage/StorageManager.cpp:
2575         (WebKit::StorageManager::getOrigins):
2576         (WebKit::StorageManager::getStorageDetailsByOrigin):
2577         (WebKit::callCallbackFunction): Deleted.
2578         (WebKit::StorageManager::getOriginsInternal): Deleted.
2579         (WebKit::StorageManager::getStorageDetailsByOriginInternal): Deleted.
2580         * UIProcess/Storage/StorageManager.h:
2581         * UIProcess/WebKeyValueStorageManager.cpp:
2582         (WebKit::WebKeyValueStorageManager::getKeyValueStorageOrigins):
2583         (WebKit::WebKeyValueStorageManager::getStorageDetailsByOrigin):
2584         (WebKit::didGetKeyValueStorageOrigins): Deleted.
2585         (WebKit::didGetStorageDetailsByOrigin): Deleted.
2586
2587 2014-12-04  Csaba Osztrogonác  <ossy@webkit.org>
2588
2589         URTBF after r176794.
2590
2591         * UIProcess/Storage/LocalStorageDatabaseTracker.cpp:
2592         (WebKit::fileCreationTime):
2593         (WebKit::fileModificationTime):
2594
2595 2014-12-03  Anders Carlsson  <andersca@apple.com>
2596
2597         Add a way to delete local storage origins modified after a given date
2598         https://bugs.webkit.org/show_bug.cgi?id=139249
2599
2600         Reviewed by Tim Horton.
2601
2602         Also change LocalStorageDatabaseTracker to hold on to WTF::Optional time_t values
2603         instead of treating missing values as zero.
2604
2605         * UIProcess/LocalStorageDetails.h:
2606         * UIProcess/Storage/LocalStorageDatabaseTracker.cpp:
2607         (WebKit::fileCreationTime):
2608         (WebKit::fileModificationTime):
2609         (WebKit::LocalStorageDatabaseTracker::deleteDatabasesModifiedSince):
2610         (WebKit::LocalStorageDatabaseTracker::details):
2611         * UIProcess/Storage/LocalStorageDatabaseTracker.h:
2612         * UIProcess/Storage/StorageManager.cpp:
2613         (WebKit::StorageManager::deleteLocalStorageOriginsModifiedSince):
2614         * UIProcess/Storage/StorageManager.h:
2615         * UIProcess/WebKeyValueStorageManager.cpp:
2616         (WebKit::didGetStorageDetailsByOrigin):
2617
2618 2014-12-04  Peter Molnar  <pmolnar.u-szeged@partner.samsung.com>
2619
2620         [EFL][WK2] Add ewk API to allow accepting a specific TLS certificate for a specific host
2621         https://bugs.webkit.org/show_bug.cgi?id=131160
2622
2623         Reviewed by Gyuyoung Kim.
2624
2625         * UIProcess/API/efl/ewk_context.cpp:
2626         (EwkContext::allowSpecificHTTPSCertificateForHost):
2627         (ewk_context_tls_certificate_for_host_allow):
2628         * UIProcess/API/efl/ewk_context.h:
2629         * UIProcess/API/efl/ewk_context_private.h:
2630         * UIProcess/API/efl/tests/test_ewk2_ssl.cpp:
2631
2632 2014-12-03  Commit Queue  <commit-queue@webkit.org>
2633
2634         Unreviewed, rolling out r176457.
2635         https://bugs.webkit.org/show_bug.cgi?id=139247
2636
2637         More iOS breakage (Requested by andersca on #webkit).
2638
2639         Reverted changeset:
2640
2641         "Fix iOS build."
2642         http://trac.webkit.org/changeset/176457
2643
2644 2014-12-03  Beth Dakin  <bdakin@apple.com>
2645
2646         <input> elements get whitespace action menu instead of editable text menu
2647         https://bugs.webkit.org/show_bug.cgi?id=139241
2648         -and corresponding-
2649         rdar://problem/19072083
2650
2651         Reviewed by Sam Weinig.
2652
2653         Add isOverTextInsideFormControlElement to WebHitTestResult.
2654         * Shared/WebHitTestResult.cpp:
2655         (WebKit::WebHitTestResult::Data::Data):
2656         (WebKit::WebHitTestResult::Data::encode):
2657         (WebKit::WebHitTestResult::Data::decode):
2658         * Shared/WebHitTestResult.h:
2659         (WebKit::WebHitTestResult::isOverTextInsideFormControlElement):
2660
2661         Offer the text menus for text inside form controls.
2662         * UIProcess/mac/WKActionMenuController.mm:
2663         (-[WKActionMenuController _defaultMenuItems]):
2664
2665         We should disallow shadow content in the hit test. This is the default and it is 
2666         how context menus behave. We originally wanted to text inside shadow content so 
2667         that we could find the text, but the new function I added to HitTestResult will 
2668         allow that.
2669         * WebProcess/WebPage/mac/WebPageMac.mm:
2670
2671         Adjust to the fact that we don’t hit test shadow content any more.
2672         (WebKit::WebPage::performActionMenuHitTestAtLocation):
2673         (WebKit::WebPage::lookupTextAtLocation):
2674         (WebKit::WebPage::focusAndSelectLastActionMenuHitTestResult):
2675
2676 2014-12-03  Commit Queue  <commit-queue@webkit.org>
2677
2678         Unreviewed, rolling out r176489.
2679         https://bugs.webkit.org/show_bug.cgi?id=139242
2680
2681         More iOS breakage (Requested by andersca on #webkit).
2682
2683         Reverted changeset:
2684
2685         "Unreviewed, iOS build fix after r176452."
2686         http://trac.webkit.org/changeset/176489
2687
2688 2014-12-03  Tim Horton  <timothy_horton@apple.com>
2689
2690         Implement action menus for tel: URLs
2691         https://bugs.webkit.org/show_bug.cgi?id=139240
2692         <rdar://problem/19115662>
2693
2694         Reviewed by Anders Carlsson.
2695
2696         * Shared/API/c/WKActionMenuTypes.h:
2697         Add a new type.
2698
2699         * UIProcess/mac/WKActionMenuController.mm:
2700         (-[WKActionMenuController _defaultMenuItemsForDataDetectableLink]):
2701         Rename this function as it will work for both mailto and tel URLs.
2702         Adjust it to use contextForView:.
2703
2704         (-[WKActionMenuController _clearActionMenuState]):
2705         (-[WKActionMenuController menuNeedsUpdate:]):
2706         (-[WKActionMenuController _defaultMenuItems]):
2707         Don't check the menu type when going to interact with _currentActionContext.
2708         We'll only have a _currentActionContext if we have a data detected item,
2709         and there are multiple menu types that end up using DDActionContext.
2710
2711 2014-12-03  Commit Queue  <commit-queue@webkit.org>
2712
2713         Unreviewed, rolling out r176452 and r176559.
2714         https://bugs.webkit.org/show_bug.cgi?id=139239
2715
2716         Broke iOS (Requested by andersca on #webkit).
2717
2718         Reverted changesets:
2719
2720         "Remove alignment code from IPC coders"
2721         https://bugs.webkit.org/show_bug.cgi?id=138963
2722         http://trac.webkit.org/changeset/176452
2723
2724         "[WK2] SecComp buildfix after r176452"
2725         https://bugs.webkit.org/show_bug.cgi?id=139081
2726         http://trac.webkit.org/changeset/176559
2727
2728 2014-12-03  Tim Horton  <timothy_horton@apple.com>
2729
2730         Keyboard input should be disabled in the preview popover
2731         https://bugs.webkit.org/show_bug.cgi?id=139219
2732         <rdar://problem/19052381>
2733
2734         Reviewed by Anders Carlsson.
2735
2736         Make sure that keyboard input, Quick Look, etc. are blocked in preview popovers
2737         and WKThumbnailViews. Also block the fake mouseMove events that originate in
2738         the Web process upon scrolling, because we were missing those despite blocking
2739         ordinary mouseMove events.
2740
2741         * UIProcess/API/Cocoa/WKViewPrivate.h:
2742         * UIProcess/API/mac/WKView.mm:
2743         Rename _ignoresNonWheelMouseEvents to _ignoresNonWheelEvents, because it will
2744         apply not only to mouse events but also key events, Quick Look events, menu
2745         preparation events, swipe events, etc.
2746
2747         Add _ignoresAllEvents, which means the same thing as _ignoresNonWheelEvents
2748         with the addition of ignoring scrollWheel events.
2749
2750         (-[WKView scrollWheel:]):
2751         (-[WKView swipeWithEvent:]):
2752         (-[WKView mouseMoved:]):
2753         (-[WKView mouseDown:]):
2754         (-[WKView mouseUp:]):
2755         (-[WKView mouseDragged:]):
2756         Adjust to the new name.
2757
2758         (-[WKView performKeyEquivalent:]):
2759         (-[WKView keyUp:]):
2760         (-[WKView keyDown:]):
2761         (-[WKView flagsChanged:]):
2762         (-[WKView quickLookWithEvent:]):
2763         (-[WKView prepareForMenu:withEvent:]):
2764         (-[WKView willOpenMenu:withEvent:]):
2765         (-[WKView didCloseMenu:withEvent:]):
2766         Block all of these events as well as those we were previously blocking.
2767
2768         (-[WKView _setIgnoresAllEvents:]):
2769         (-[WKView _setIgnoresNonWheelMouseEvents:]):
2770         (-[WKView _setIgnoresNonWheelEvents:]):
2771         (-[WKView _ignoresNonWheelEvents]):
2772         (-[WKView _ignoresAllEvents]):
2773         * UIProcess/API/mac/WKViewInternal.h:
2774         Adjust to the new names and the addition of ignoresAllEvents.
2775
2776         * UIProcess/mac/WKActionMenuController.mm:
2777         (-[WKPagePreviewViewController loadView]):
2778         Adjust to the new name.
2779
2780         (-[WKActionMenuController prepareForMenu:withEvent:]):
2781         Move bailing from prepareForMenu: up to WKView.
2782
2783         * UIProcess/API/Cocoa/WKWebView.mm:
2784         (-[WKWebView _ignoresNonWheelEvents]):
2785         (-[WKWebView _setIgnoresNonWheelEvents:]):
2786         (-[WKWebView _ignoresNonWheelMouseEvents]): Deleted.
2787         (-[WKWebView _setIgnoresNonWheelMouseEvents:]): Deleted.
2788         * UIProcess/API/Cocoa/WKWebViewInternal.h:
2789         Adjust to the new name (without "mouse" in it).
2790
2791         * UIProcess/API/Cocoa/_WKThumbnailView.mm:
2792         (-[_WKThumbnailView _viewWasUnparented]):
2793         (-[_WKThumbnailView _viewWasParented]):
2794         Explicitly tell WKView to disable event handling while thumbnailed,
2795         instead of having WKView special-case thumbnail views internally.
2796
2797         * UIProcess/WebPageProxy.cpp:
2798         (WebKit::WebPageProxy::setShouldDispatchFakeMouseMoveEvents):
2799         * UIProcess/WebPageProxy.h:
2800         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2801         (WebKit::WebChromeClient::shouldDispatchFakeMouseMoveEvents):
2802         * WebProcess/WebCoreSupport/WebChromeClient.h:
2803         * WebProcess/WebPage/WebPage.cpp:
2804         (WebKit::WebPage::WebPage):
2805         * WebProcess/WebPage/WebPage.h:
2806         (WebKit::WebPage::shouldDispatchFakeMouseMoveEvents):
2807         (WebKit::WebPage::setShouldDispatchFakeMouseMoveEvents):
2808         * WebProcess/WebPage/WebPage.messages.in:
2809         Plumb shouldDispatchFakeMouseMoveEvents from the UI process to the Web process
2810         and through to WebKit2's ChromeClient implementation.
2811
2812 2014-12-03  Anders Carlsson  <andersca@apple.com>
2813
2814         Remove ENABLE_UI_PROCESS_STORAGE define, it's always 1.
2815
2816         Rubber-stamped by Beth Dakin.
2817
2818         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
2819         (WebKit::WebPlatformStrategies::localStorageNamespace):
2820         (WebKit::WebPlatformStrategies::transientLocalStorageNamespace):
2821         (WebKit::WebPlatformStrategies::sessionStorageNamespace):
2822
2823 2014-12-03  Anders Carlsson  <andersca@apple.com>
2824
2825         Use an @autoreleasepool instead of NSAutoreleasePool.
2826
2827         Rubber-stamped by Tim Horton.
2828
2829         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
2830         (WebKit::TiledCoreAnimationDrawingArea::flushLayers):
2831
2832 2014-12-03  Dan Bernstein  <mitz@apple.com>
2833
2834         REGRESSION(r176687): Caused webkit2 test assertion failure crashes in WebKit::WebPage::willStartDrag()
2835         https://bugs.webkit.org/show_bug.cgi?id=139224
2836
2837         Reviewed by Alexey Proskuryakov.
2838
2839         * WebProcess/WebPage/WebPage.cpp:
2840         (WebKit::WebPage::mouseEventSyncForTesting): Wait for the UI process to start dragging if
2841         needed before handling the event.
2842
2843 2014-12-03  Michael Catanzaro  <mcatanzaro@igalia.com>
2844
2845         [GTK] outdated comment
2846         https://bugs.webkit.org/show_bug.cgi?id=137801
2847
2848         Reviewed by Carlos Garcia Campos.
2849
2850         Remove a comment that is no longer correct.
2851
2852         * NetworkProcess/gtk/NetworkProcessMainGtk.cpp:
2853
2854 2014-12-02  Conrad Shultz  <conrad_shultz@apple.com>
2855
2856         Don't block menu highlighting when presenting a page preview
2857         https://bugs.webkit.org/show_bug.cgi?id=139217
2858
2859         Reviewed by Tim Horton.
2860
2861         * UIProcess/mac/WKActionMenuController.mm:
2862         (-[WKActionMenuController _previewURLFromActionMenu:]):
2863         Defer popover presentation to the next turn of the runloop.
2864
2865 2014-12-02  Timothy Horton  <timothy_horton@apple.com>
2866
2867         Fix the build.
2868
2869         * UIProcess/mac/WebContextMac.mm:
2870
2871 2014-12-02  Dan Bernstein  <mitz@apple.com>
2872
2873         <rdar://problem/18441138> [iOS] Text selection in WKWebView with WKSelectionGranularityCharacter only works in the most recent WKWebView to load
2874         https://bugs.webkit.org/show_bug.cgi?id=139211
2875
2876         Reviewed by Anders Carlsson.
2877
2878         * UIProcess/ios/WKContentViewInteraction.mm:
2879         (-[WKContentView becomeFirstResponder]): Override to activate the text selection for when
2880         becoming first resopnder.
2881         (-[WKContentView resignFirstResponder]): Deactiavte the text selection when resigning first
2882         responder. This ensures that if another WKWebView becomes first responder, and it uses
2883         block selection, we don’t end up with two active selection views.
2884         (-[WKContentView useSelectionAssistantWithMode:]): Only activate the text selection if this
2885         is the first responder. This ensures that loading content into a non-first-responder
2886         WKWebView doesn‘t deactivate the text selection in the current first responder.
2887
2888 2014-12-02  Alexey Proskuryakov  <ap@apple.com>
2889
2890         http/tests/appcache/main-resource-fallback-for-network-error-crash.html can break subsequent tests
2891         https://bugs.webkit.org/show_bug.cgi?id=139149
2892
2893         Reviewed by Anders Carlsson.
2894
2895         This changes API behavior. I think that it's OK, because existing behavior made no sense.
2896         We used to delete caches from disk, but they were still active in memory. Now we also
2897         obsolete them in memory, so documents that use a cache still work, but new ones don't
2898         pick one up.
2899
2900         * WebProcess/ApplicationCache/WebApplicationCacheManager.cpp:
2901         (WebKit::WebApplicationCacheManager::deleteAllEntries): Use the new WebCore function
2902         that properly deletes caches.
2903
2904 2014-12-02  Tim Horton  <timothy_horton@apple.com>
2905
2906         Remove a SnowLeopard-era quirk for QuickLook
2907         https://bugs.webkit.org/show_bug.cgi?id=139208
2908         <rdar://problem/19121822>
2909
2910         Reviewed by Alexey Proskuryakov.
2911
2912         * Shared/WebProcessCreationParameters.cpp:
2913         (WebKit::WebProcessCreationParameters::encode):
2914         (WebKit::WebProcessCreationParameters::decode):
2915         * Shared/WebProcessCreationParameters.h:
2916         * UIProcess/mac/WebContextMac.mm:
2917         (WebKit::WebContext::platformInitializeWebProcess):
2918         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2919         (WebKit::WebFrameLoaderClient::needsQuickLookResourceCachingQuirks): Deleted.
2920         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
2921         * WebProcess/WebProcess.cpp:
2922         (WebKit::WebProcess::WebProcess):
2923         * WebProcess/WebProcess.h:
2924         (WebKit::WebProcess::needsQuickLookResourceCachingQuirks): Deleted.
2925         * WebProcess/cocoa/WebProcessCocoa.mm:
2926         (WebKit::WebProcess::platformInitializeWebProcess):
2927
2928 2014-12-02  Beth Dakin  <bdakin@apple.com>
2929
2930         Build fix.
2931
2932         * UIProcess/mac/WKActionMenuController.mm:
2933         (-[WKActionMenuController _defaultMenuItemsForLink]):
2934
2935 2014-12-02  Beth Dakin  <bdakin@apple.com>
2936
2937         More build fix.
2938
2939         * UIProcess/mac/WKActionMenuController.mm:
2940         (-[WKActionMenuController _defaultMenuItemsForLink]):
2941
2942 2014-12-02  Dan Bernstein  <mitz@apple.com>
2943
2944         REGRESSION: Dragging selected text changes the selection
2945         https://bugs.webkit.org/show_bug.cgi?id=139110
2946
2947         Reviewed by Simon Fraser.
2948
2949         After it sent the UI process the message to start dragging, the Web process handled mouse
2950         move events that had already been in flight, interpreting them as a drag to start a new
2951         selection. This is fixed by ignoring any mouse events received after asking the UI process
2952         to start dragging.
2953
2954         * UIProcess/mac/WebPageProxyMac.mm:
2955         (WebKit::WebPageProxy::setDragImage): Send the new DidStartDrag message back to the Web
2956         process, so that it stops ignoring mouse events.
2957
2958         * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
2959         (WebKit::WebDragClient::startDrag): Call the new WebPage::willStartDrag, so that it starts
2960         ignoring mouse events.
2961
2962         * WebProcess/WebPage/WebPage.cpp:
2963         (WebKit::WebPage::WebPage): Initialize new member variable.
2964         (WebKit::WebPage::mouseEvent): Don’t handle the event if we have asked the UI process to
2965         start dragging.
2966
2967         * WebProcess/WebPage/WebPage.h:
2968         (WebKit::WebPage::willStartDrag): Added. Sets new member variable m_isStartingDrag to true.
2969         (WebKit::WebPage::didStartDrag): Added. Handles the message from the UI process by setting
2970         m_isStartingDrag back to false.
2971
2972         * WebProcess/WebPage/WebPage.messages.in: Added DidStartDrag.
2973
2974 2014-12-02  Beth Dakin  <bdakin@apple.com>
2975
2976         Should use standardQuickLookMenuItem for apps that don't implement customizations
2977         https://bugs.webkit.org/show_bug.cgi?id=139193
2978         -and corresponding-
2979         rdar://problem/18944696
2980
2981         Reviewed by Anders Carlsson.
2982
2983         New SPI will allow clients to opt-out of the standardQuickLookMenuItem. By 
2984         default, opt in.
2985         * UIProcess/API/Cocoa/WKViewPrivate.h:
2986         * UIProcess/API/mac/WKView.mm:
2987         (-[WKView _shouldUseStandardQuickLookPreview]):
2988         * UIProcess/mac/WKActionMenuController.mm:
2989
2990         Use [NSMenuItem standardQuickLookMenuItem] unless the client has requested 
2991         otherwise.
2992         (-[WKActionMenuController _defaultMenuItemsForLink]):
2993
2994         Delegate methods to set up the standardQuickLookMenuItem.
2995         (-[WKActionMenuController menuItem:viewAtScreenPoint:]):
2996         (-[WKActionMenuController menuItem:previewItemAtPoint:]):
2997         (-[WKActionMenuController menuItem:preferredEdgeForPoint:]):
2998
2999 2014-12-02  Tim Horton  <timothy_horton@apple.com>
3000
3001         TextIndicator can get stuck (especially if we don't get LUNotificationPopoverWillClose when we should)
3002         https://bugs.webkit.org/show_bug.cgi?id=139175
3003         <rdar://problem/19072236>
3004
3005         Reviewed by Beth Dakin.
3006
3007         * UIProcess/API/mac/WKView.mm:
3008         (-[WKView scrollWheel:]):
3009         (-[WKView mouseDown:]):
3010         Work around <rdar://problem/19086993> by always explicitly clearing the
3011         active text indicator in mouseDown: and scrollWheel:.
3012         This way, even if you manage to get a text indicator that outlives the
3013         Look Up popover (or find-in-page, or whatever), it will be dismissed
3014         by clicking or scrolling the view.
3015
3016 2014-12-02  Anders Carlsson  <andersca@apple.com>
3017
3018         Remove visited link handling from PageGroup
3019         https://bugs.webkit.org/show_bug.cgi?id=139185
3020
3021         Reviewed by Sam Weinig.
3022
3023         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
3024         (WebKit::WebChromeClient::populateVisitedLinks): Deleted.
3025         * WebProcess/WebCoreSupport/WebChromeClient.h:
3026
3027 2014-12-01  Anders Carlsson  <andersca@apple.com>
3028
3029         Remove WKBundleRemoveAllVisitedLinks
3030         https://bugs.webkit.org/show_bug.cgi?id=139163
3031
3032         Reviewed by Sam Weinig.
3033
3034         WKBundleRemoveAllVisitedLinks has been a no-op since at least Yosemite; get rid of it.
3035
3036         * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
3037         (WKBundleRemoveAllVisitedLinks): Deleted.
3038         * WebProcess/InjectedBundle/API/c/WKBundlePrivate.h:
3039         * WebProcess/InjectedBundle/InjectedBundle.cpp:
3040         (WebKit::InjectedBundle::removeAllVisitedLinks): Deleted.
3041         * WebProcess/InjectedBundle/InjectedBundle.h:
3042
3043 2014-12-02  Eva Balazsfalvi  <evab.u-szeged@partner.samsung.com>
3044
3045         Fix class was previously declared as a struct warnings
3046         https://bugs.webkit.org/show_bug.cgi?id=139131
3047
3048         Reviewed by Csaba Osztrogonác.
3049
3050         * UIProcess/CoordinatedGraphics/CoordinatedLayerTreeHostProxy.h:
3051         * UIProcess/CoordinatedGraphics/WebViewClient.h:
3052
3053 2014-12-02  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
3054
3055         [EFL] ewk_view_scale_set() doesn't work correctly
3056         https://bugs.webkit.org/show_bug.cgi?id=139109
3057
3058         Reviewed by Csaba Osztrogonác.
3059
3060         When ewk_view_scale_set() is called, it has only updated a scale factor which is maintained by WebPageProxy.
3061         It causes WebPageProxy unsynchronized with PageViewportController's scale factor. That's why wrong scale
3062         behavior has occured through ewk_view_scale_set(). Besides zooming has similar problem as well.
3063
3064         Thus this patch updates m_pageScaleFactor of PageViewportController as well as prohibits to change the scale
3065         factor through viewport meta tag update. Because ewk_view_scale_set() means that user wants to set a specific
3066         value to scale factor of current viewport.
3067
3068         * UIProcess/API/efl/EwkView.cpp:
3069         (EwkView::updateScaleToPageViewportController):
3070             Set m_initiallyFitToViewport to false. And call didChangeContentsVisibility() with new scale and scale position.
3071
3072         * UIProcess/API/efl/EwkView.h:
3073         * UIProcess/API/efl/ewk_view.cpp:
3074         (ewk_view_scale_set):
3075         * UIProcess/API/efl/tests/test_ewk2_view.cpp:
3076         (TEST_F):
3077         * UIProcess/CoordinatedGraphics/PageViewportController.cpp:
3078         (WebKit::PageViewportController::didCommitLoad):
3079             Set m_initiallyFitToViewport to true in order to fit content to viewport size by default.
3080             Initizlize content position with (0, 0).
3081
3082         (WebKit::PageViewportController::pageTransitionViewportReady):
3083            Do not update scale when m_initiallyFitToViewport is false.
3084
3085         (WebKit::PageViewportController::syncVisibleContents):
3086            Return false when syncVisibleContents is failed.
3087
3088         (WebKit::PageViewportController::didChangeViewportAttributes):
3089            Do not update scale when m_initiallyFitToViewport is false.
3090
3091         (WebKit::PageViewportController::applyScaleAfterRenderingContents):
3092             If syncVisibleContents() is failed, m_pageScaleFactor should be restored with previous value.
3093             If not, new scale factor isn't applied though, PageViewportController uses it as own scale factor.
3094
3095         (WebKit::PageViewportController::updateMinimumScaleToFit):
3096            Do not update scale when m_initiallyFitToViewport is false or m_hadUserInteraction is true.
3097
3098         * UIProcess/CoordinatedGraphics/PageViewportController.h:
3099         (WebKit::PageViewportController::setInitiallyFitToViewport):
3100
3101 2014-11-20  Jeffrey Pfau  <jpfau@apple.com>
3102
3103         Add cancelable version of willSendRequest
3104         https://bugs.webkit.org/show_bug.cgi?id=138987
3105
3106         Reviewed by Anders Carlsson.
3107
3108         * WebProcess/Network/WebResourceLoader.cpp:
3109         (WebKit::WebResourceLoader::willSendRequest):
3110
3111 2014-12-01  Conrad Shultz  <conrad_shultz@apple.com>
3112
3113         Clients need a way to explicitly set the title of a page preview
3114         https://bugs.webkit.org/show_bug.cgi?id=139161
3115
3116         Reviewed by Beth Dakin.
3117
3118         This implicitly assumes that only one page preview can be associate with a given WKView at a time.
3119
3120         * UIProcess/API/Cocoa/WKViewPrivate.h:
3121         * UIProcess/API/mac/WKView.mm:
3122         (-[WKView _setPreviewTitle:]):
3123         Wrap -[WKActionMenuController setPreviewTitle:]
3124
3125         * UIProcess/mac/WKActionMenuController.h:
3126         * UIProcess/mac/WKActionMenuController.mm:
3127         Add ivars for the title and the title text field (previously not independently exposed).
3128         (-[WKPagePreviewViewController previewTitle]):
3129         Accessor.
3130         (-[WKPagePreviewViewController setPreviewTitle:]):
3131         Accessor; set the text field's string value.
3132         (-[WKPagePreviewViewController loadView]):
3133         Adopt the _titleTextField ivar; assume that if a client has explicitly set the previewTitle then we don't
3134         need to ask for it again.
3135         (-[WKActionMenuController setPreviewTitle:]):
3136         Wrap -[WKPagePreviewViewController setPreviewTitle:].
3137
3138 2014-12-01  Anders Carlsson  <andersca@apple.com>
3139
3140         Make WebKit2 work slightly better with garbage collection
3141         https://bugs.webkit.org/show_bug.cgi?id=139159
3142         <rdar://problem/19108390>
3143
3144         Reviewed by Dan Bernstein.
3145
3146         * Shared/Cocoa/APIObject.mm:
3147         (API::Object::ref):
3148         (API::Object::deref):
3149         Call CFRetain/CFRelease to prevent the memory from being collected.
3150
3151         (API::Object::newObject):
3152         Call CFRetain under GC so we'll prevent memory from being collected prematurely.
3153
3154 2014-12-01  Tim Horton  <timothy_horton@apple.com>
3155
3156         Implement yellow highlight for WebKit1 data detectors
3157         https://bugs.webkit.org/show_bug.cgi?id=138956
3158         <rdar://problem/18992185>
3159
3160         Reviewed by Beth Dakin.
3161
3162         * Shared/WebCoreArgumentCoders.cpp:
3163         (IPC::ArgumentCoder<TextIndicatorData>::encode):
3164         (IPC::ArgumentCoder<TextIndicatorData>::decode):
3165         * WebProcess/WebPage/FindController.cpp:
3166         (WebKit::FindController::updateFindIndicator):
3167         (WebKit::FindController::drawRect):
3168         Adjust to the fact that TextIndicator keeps screen-relative rects.
3169
3170 2014-12-01  Anders Carlsson  <andersca@apple.com>
3171
3172         Remove old site specific quirks code that was added in 2009
3173         https://bugs.webkit.org/show_bug.cgi?id=139141
3174
3175         Reviewed by Antti Koivisto.
3176
3177         * NetworkProcess/RemoteNetworkingContext.h:
3178         * NetworkProcess/mac/RemoteNetworkingContext.mm:
3179         (WebKit::RemoteNetworkingContext::needsSiteSpecificQuirks): Deleted.
3180         * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.h:
3181         * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm:
3182         (WebKit::WebFrameNetworkingContext::needsSiteSpecificQuirks): Deleted.
3183
3184 2014-12-01  Joseph Pecoraro  <pecoraro@apple.com>
3185
3186         Web Inspector: Crash in WebInspectorClient::hideHighlight when page is destroyed
3187         https://bugs.webkit.org/show_bug.cgi?id=139136
3188
3189         Reviewed by Simon Fraser.
3190
3191         * WebProcess/WebCoreSupport/WebInspectorClient.cpp:
3192         (WebKit::WebInspectorClient::hideHighlight):
3193         Speculatively fix by null-checking the main frame which
3194         can be null during page destruction.
3195
3196 2014-11-30  Jaehun Lim  <ljaehun.lim@samsung.com>
3197
3198         [EFL] Add eldbus to the library list
3199         https://bugs.webkit.org/show_bug.cgi?id=139120
3200
3201         Reviewed by Gyuyoung Kim.
3202
3203         Fix undefined reference errors for eldbus APIs.
3204
3205         * PlatformEfl.cmake:
3206
3207 2014-11-29  Anders Carlsson  <andersca@apple.com>
3208
3209         Crash when calling WKPageClose on the originated page from within createNewPage callback
3210         https://bugs.webkit.org/show_bug.cgi?id=139099
3211         <rdar://problem/19052564>
3212
3213         Reviewed by Sam Weinig.
3214
3215         Null check the namespace ID.
3216
3217         * UIProcess/Storage/StorageManager.cpp:
3218         (WebKit::StorageManager::cloneSessionStorageNamespaceInternal):
3219
3220 2014-11-28  Tim Horton  <timothy_horton@apple.com>
3221
3222         Stale userData is handed to WKView _actionMenuItemsForHitTestResult under prepareForMenu
3223         https://bugs.webkit.org/show_bug.cgi?id=139069
3224         <rdar://problem/19075587>
3225
3226         Reviewed by Sam Weinig.
3227
3228         * UIProcess/mac/WKActionMenuController.mm:
3229         (-[WKActionMenuController wkView:willHandleMouseDown:]):
3230         (-[WKActionMenuController didCloseMenu:withEvent:]):
3231         (-[WKActionMenuController _clearActionMenuState]):
3232         Previously, _userData was not being cleared in didCloseMenu, so a subsequent
3233         action menu invocation would end up sending stale userData to _actionMenuItemsForHitTestResult.
3234
3235         Additionally, factor all of the cleanup code out into _clearActionMenuState,
3236         and call it from both wkView:willHandleMouseDown: and didCloseMenu:withEvent:.
3237
3238 2014-11-26  Timothy Horton  <timothy_horton@apple.com>
3239
3240         DataDetectors PageOverlay callbacks are never called
3241         https://bugs.webkit.org/show_bug.cgi?id=139067
3242         <rdar://problem/19086676>
3243
3244         Reviewed by Anders Carlsson.
3245
3246         * Shared/mac/ActionMenuHitTestResult.mm:
3247         (WebKit::ActionMenuHitTestResult::encode):
3248         (WebKit::ActionMenuHitTestResult::decode):
3249         Encode/decode the PageOverlay ID.
3250
3251 2014-11-28  Simon Fraser  <simon.fraser@apple.com>
3252
3253         Allow clients of the WKRenderLayerRef C SPI to connect layer trees across frame boundaries
3254         https://bugs.webkit.org/show_bug.cgi?id=139021
3255
3256         Reviewed by Dan Bernstein.
3257         
3258         Add WKRenderLayerGetFrameContentsLayer which returns a WKRenderLayerRef for
3259         the content document of a RenderWidget, if its has one (e.g. frames, iframes
3260         and <object> with document contents).
3261
3262         * Shared/API/c/WKRenderLayer.cpp:
3263         (WKRenderLayerGetFrameContentsLayer):
3264         * Shared/API/c/WKRenderLayer.h:
3265         * Shared/UserMessageCoders.h:
3266         (WebKit::UserMessageEncoder::baseEncode):
3267         (WebKit::UserMessageDecoder::baseDecode):
3268         * Shared/WebRenderLayer.cpp:
3269         (WebKit::WebRenderLayer::create):
3270         (WebKit::WebRenderLayer::WebRenderLayer):
3271         * Shared/WebRenderLayer.h:
3272         (WebKit::WebRenderLayer::frameContentsLayer):
3273
3274 2014-11-28  Csaba Osztrogonác  <ossy@webkit.org>
3275
3276         [WK2] SecComp buildfix after r176452
3277         https://bugs.webkit.org/show_bug.cgi?id=139081
3278
3279         Reviewed by Antti Koivisto.
3280
3281         * Shared/linux/SeccompFilters/SeccompBroker.cpp:
3282         (WebKit::SeccompBrokerClient::dispatch):
3283         (WebKit::SeccompBroker::runLoop):
3284
3285 2014-11-28  Csaba Osztrogonác  <ossy@webkit.org>
3286
3287         Fix -Wc++11-narrowing error in SeccompFilters.cpp
3288         https://bugs.webkit.org/show_bug.cgi?id=139079
3289
3290         Reviewed by Carlos Garcia Campos.
3291
3292         * Shared/linux/SeccompFilters/SeccompFilters.cpp:
3293         (WebKit::SeccompFilters::addRule):
3294         * Shared/linux/SeccompFilters/SeccompFilters.h:
3295
3296 2014-11-28  Csaba Osztrogonác  <ossy@webkit.org>
3297
3298         [WK2] SecComp buildfix after r168605 and r168999
3299         https://bugs.webkit.org/show_bug.cgi?id=139080
3300
3301         Reviewed by Carlos Garcia Campos.
3302
3303         * Shared/linux/SeccompFilters/SyscallPolicy.cpp:
3304         (WebKit::SyscallPolicy::addDefaultWebProcessPolicy):
3305
3306 2014-11-27  Ryuan Choi  <ryuan.choi@navercorp.com>
3307
3308         [EFL] Remove E_Dbus dependency
3309         https://bugs.webkit.org/show_bug.cgi?id=136355
3310
3311         Reviewed by Gyuyoung Kim.
3312
3313         * UIProcess/API/efl/ewk_main.cpp: Added init/shutdown for eldbus.
3314         (WebKit::EwkMain::initialize):
3315         (WebKit::EwkMain::finalize):
3316         (WebKit::EwkMain::shutdownInitializedEFLModules):
3317
3318 2014-11-25  Anders Carlsson  <andersca@apple.com>
3319
3320         Remove user content handling from PageGroup
3321         https://bugs.webkit.org/show_bug.cgi?id=139051
3322
3323         Reviewed by Antti Koivisto.
3324
3325         * WebProcess/InjectedBundle/InjectedBundle.cpp:
3326         (WebKit::InjectedBundle::addUserScript):
3327         (WebKit::InjectedBundle::addUserStyleSheet):
3328         (WebKit::InjectedBundle::removeUserScript):
3329         (WebKit::InjectedBundle::removeUserStyleSheet):
3330         (WebKit::InjectedBundle::removeUserScripts):
3331         (WebKit::InjectedBundle::removeUserStyleSheets):
3332         (WebKit::InjectedBundle::removeAllUserContent):
3333         Talk to the user content controller from the passed in WebPageGroupProxy.
3334
3335         * WebProcess/WebPage/WebPage.cpp:
3336         (WebKit::WebPage::WebPage):
3337         Create the WebPageGroupProxy before creating the page so we can get its user content controller and
3338         pass it to the page configuration if necessary.
3339         
3340         * WebProcess/WebPage/WebPageGroupProxy.cpp:
3341         (WebKit::WebPageGroupProxy::userContentController):
3342         New function that lazily creates a user content controller. We don't want to create this eagerly since
3343         it's not used with the modern API.
3344
3345         (WebKit::WebPageGroupProxy::addUserStyleSheet):
3346         (WebKit::WebPageGroupProxy::addUserScript):
3347         (WebKit::WebPageGroupProxy::removeAllUserStyleSheets):
3348         (WebKit::WebPageGroupProxy::removeAllUserScripts):
3349         (WebKit::WebPageGroupProxy::removeAllUserContent):
3350         Call through to the user content controller.
3351
3352         * WebProcess/WebPage/WebPageGroupProxy.h:
3353         Add an m_userContentController member.
3354
3355 2014-11-25  Ting-Wei Lan  <lantw44@gmail.com>
3356
3357         [GTK] Use LD_LIBRARY_PATH to make g-ir-scanner use the newly-built
3358         version of libraries when running the temporary executable
3359         https://bugs.webkit.org/show_bug.cgi?id=138833
3360
3361         Reviewed by Carlos Garcia Campos.
3362
3363         This patch modifies LD_LIBRARY_PATH to make sure the dynamic linker
3364         find the correct version of libraries when running the temporary
3365         executable to generate the .gir file.
3366
3367         * PlatformGTK.cmake:
3368
3369 2014-11-25  Csaba Osztrogonác  <ossy@webkit.org>
3370
3371         [EFL] REGRESSION(r176514): It made performance tests fail
3372         https://bugs.webkit.org/show_bug.cgi?id=139037
3373
3374         Reviewed by Gyuyoung Kim.
3375
3376         * WebProcess/efl/WebProcessMainEfl.cpp: Don't try to load/shutdown eail if eailLibraryPath() is empty.
3377
3378 2014-11-24  Eva Balazsfalvi  <evab.u-szeged@partner.samsung.com>
3379
3380         Remove Qt cruft related to tap higlighting
3381         https://bugs.webkit.org/show_bug.cgi?id=139030
3382
3383         Reviewed by Andreas Kling.
3384
3385         * CMakeLists.txt:
3386         * WebProcess/WebPage/TapHighlightController.cpp: Removed.
3387         * WebProcess/WebPage/TapHighlightController.h: Removed.
3388
3389 2014-11-24  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
3390
3391         Unreviewed, EFL build fix since r176530.
3392
3393         * UIProcess/CoordinatedGraphics/WebView.cpp: Replace pointer with reference.
3394         (WebKit::WebView::processDidExit):
3395
3396 2014-11-24  Benjamin Poulain  <bpoulain@apple.com>
3397
3398         [WK2] Remove some bad stuff from WebPageProxy
3399         https://bugs.webkit.org/show_bug.cgi?id=138896
3400
3401         Reviewed by Sam Weinig.
3402
3403         The state loadStateAtProcessExit does not seem to be used anywhere.
3404
3405         The state urlAtProcessExit only exists to forward the url from
3406         WebPageProxy::resetStateAfterProcessExited() to the coordinated graphics code
3407         WebView::processDidExit().
3408
3409         * UIProcess/CoordinatedGraphics/WebView.cpp:
3410         (WebKit::WebView::processDidExit):
3411         * UIProcess/WebPageProxy.cpp:
3412         (WebKit::WebPageProxy::WebPageProxy):
3413         (WebKit::WebPageProxy::resetStateAfterProcessExited):
3414         * UIProcess/WebPageProxy.h:
3415         (WebKit::WebPageProxy::urlAtProcessExit): Deleted.
3416         (WebKit::WebPageProxy::loadStateAtProcessExit): Deleted.
3417
3418 2014-11-24  Ryuan Choi  <ryuan.choi@navercorp.com>
3419
3420         [EFL] REGRESSION(176066): It made all performance tests fail
3421         https://bugs.webkit.org/show_bug.cgi?id=138865
3422
3423         Reviewed by Csaba Osztrogonác.
3424
3425         Since r176066, there are crash because evas_gl_surface is destroyed with
3426         invalid evas_gl instance after evas_gl is destroyed.
3427
3428         * UIProcess/API/efl/EwkView.cpp:
3429         (EwkView::~EwkView):
3430
3431 2014-11-24  Alberto Garcia  <berto@igalia.com>
3432
3433         Webkit2 doesnt build on powerpc 32 bits
3434         https://bugs.webkit.org/show_bug.cgi?id=130837
3435
3436         Reviewed by Carlos Garcia Campos.
3437
3438         Check if libatomic is needed in order to use std::atomic, and add
3439         it to the list of WebKit2 libraries.
3440
3441         * PlatformGTK.cmake:
3442
3443 2014-11-24  Carlos Garcia Campos  <cgarcia@igalia.com>
3444
3445         Unreviewed. Update OptionsGTK.cmake and NEWS for 2.7.2 release.
3446
3447         * gtk/NEWS: Add release notes for 2.7.2.
3448
3449 2014-11-24  Krzysztof Czech  <k.czech@samsung.com>
3450
3451         [EFL] Utilize Eail library to support accessibility in EFL
3452         https://bugs.webkit.org/show_bug.cgi?id=137742
3453
3454         Reviewed by Gyuyoung Kim.
3455
3456         Initialize EAIL module so that all the listeners and atk-bridge started properly.
3457         Dynamic loading of EAIL help us to avoid elementary dependencies in WebKit.
3458
3459         * WebProcess/efl/WebProcessMainEfl.cpp:
3460         (eailLibraryPath): reads path provided by ACCESSIBILITY_EAIL_LIBRARY_PATH variable.
3461         (eail):
3462
3463 2014-11-24  Carlos Garcia Campos  <cgarcia@igalia.com>
3464
3465         [GTK] WebKitWebView is created with the wrong web context when using webkit_web_view_new_with_related_view()
3466         https://bugs.webkit.org/show_bug.cgi?id=139023
3467
3468         Reviewed by Sergio Villar Senin.
3469
3470         The WebKitWebContext is a construct only property, so it's always
3471         set to the default value when not provided, during the
3472         construction. When a related-view is used to create a new web view
3473         we should ensure that the same web context is used for the new web
3474         view, instead of the default. We should also ignore any web
3475         context given as construct parameter if a related view is alos provided.
3476
3477         * UIProcess/API/gtk/WebKitWebView.cpp:
3478         (webkitWebViewConstructed): Do not set the context to the default
3479         one when not given during construction.
3480         (webkitWebViewSetProperty): Only use the default web context when
3481         not provided as construct parameter and there isn't a related view.
3482
3483 2014-11-23  Carlos Garcia Campos  <cgarcia@igalia.com>
3484
3485         [GTK] Add API to override the default local storage directory