190c936ce20701438184b42abd9dd0d0cf4ae2d6
[WebKit-https.git] / Source / WebKit2 / ChangeLog
1 2014-05-19  Simon Fraser  <simon.fraser@apple.com>
2
3         REGRESSION (r169063) Fixed and sticky nodes misplaced on scrolling sometimes
4         https://bugs.webkit.org/show_bug.cgi?id=133106
5         <rdar://problem/16967648>
6
7         Reviewed by Sam Weinig.
8
9         Fix regression from r169063. That commit removed scrolledContentsLayers from 
10         frame scrolling nodes, but they do actually use them.
11         
12         So put them back; not in the base class, because they have a somewhat different
13         meaning for overflow scrolling and frame scrolling.
14
15         * Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp:
16         (ArgumentCoder<ScrollingStateFrameScrollingNode>::encode):
17         (ArgumentCoder<ScrollingStateFrameScrollingNode>::decode):
18         (WebKit::RemoteScrollingTreeTextStream::dump):
19         * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp:
20         (WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers):
21
22 2014-05-20  Alexey Proskuryakov  <ap@apple.com>
23
24         [Mac] WebProcess doesn't follow localization of UI process when run as a service
25         https://bugs.webkit.org/show_bug.cgi?id=133126
26         <rdar://problem/13396515>
27         <rdar://problem/16561084>
28
29         Reviewed by Sam Weinig and Tim Horton.
30
31         * Shared/EntryPointUtilities/mac/XPCService/XPCServiceMain.Development.mm:
32         (WebKit::handleXPCBootstrap):
33         (main):
34         * Shared/EntryPointUtilities/mac/XPCService/XPCServiceMain.mm:
35         (WebKit::handleXPCBootstrap):
36         (main):
37         Set localization very early in process lifetime (in development builds, that's
38         even before WebKit framework is loaded).
39
40         * UIProcess/Launcher/mac/ProcessLauncherMac.mm: (WebKit::connectToService):
41         Pass UI process localization to the service, computing it in the same way we do
42         for child processes.
43
44 2014-05-20  Anders Carlsson  <andersca@apple.com>
45
46         Fix a header comment
47         https://bugs.webkit.org/show_bug.cgi?id=133123
48         <rdar://problem/16973783>
49
50         Reviewed by Geoffrey Garen.
51
52         * UIProcess/API/Cocoa/WKUserContentController.h:
53
54 2014-05-20  Carlos Garcia Campos  <cgarcia@igalia.com>
55
56         [GTK] WebKitWebPage::send-request always pass a valid pointer for redirected response
57         https://bugs.webkit.org/show_bug.cgi?id=133119
58
59         Reviewed by Sergio Villar Senin.
60
61         The problem is that we were checking whether the passed in
62         WKURLResponseRef is NULL or not, but it's always a valid object
63         that can contain a NULL WebCore::ResourceResponse.
64
65         * WebProcess/InjectedBundle/API/gtk/WebKitWebPage.cpp:
66         (willSendRequestForFrame): Pass NULL as redirect-response
67         parameter of WebKitWebPage::send-request signal when the
68         WebCore::ResourceResponse of the passed in WKURLResponseRef is NULL.
69
70 2014-05-20  Antti Koivisto  <antti@apple.com>
71
72         Double-tap zoom does not take obscuring insets into account
73         https://bugs.webkit.org/show_bug.cgi?id=133116
74         <rdar://problem/16765604>
75
76         Reviewed by Anders Carlsson.
77
78         * UIProcess/API/Cocoa/WKWebView.mm:
79         (-[WKWebView _zoomToRect:WebCore::atScale:origin:WebCore::]):
80         
81             Compute the zoom target taking insets into account.
82
83 2014-05-19  Gavin Barraclough  <baraclough@apple.com>
84
85         WebKit2/iOS: parented view should be considered hidden if app is backgrounded
86         https://bugs.webkit.org/show_bug.cgi?id=133099
87         radar://16942183
88
89         Reviewed by Simon Fraser.
90
91         * UIProcess/ios/PageClientImplIOS.mm:
92         (WebKit::PageClientImpl::isViewWindowActive):
93             - implemented in terms of isViewVisible.
94             - FIXME: https://bugs.webkit.org/show_bug.cgi?id=133098
95         (WebKit::PageClientImpl::isViewFocused):
96             - implemented in terms of isViewWindowActive.
97             - FIXME: https://bugs.webkit.org/show_bug.cgi?id=133098
98         (WebKit::PageClientImpl::isViewVisible):
99             - take UIApplication applicationState into account in determining visibility.
100         (WebKit::PageClientImpl::isViewVisibleOrOccluded):
101             - implemented in terms of isViewVisible.
102         (WebKit::PageClientImpl::isVisuallyIdle):
103             - implemented in terms of isViewVisible.
104         * UIProcess/ios/WKContentView.mm:
105         (-[WKContentView initWithFrame:context:WebKit::configuration:WebKit::webView:]):
106             - register for UIApplicationDidEnterBackgroundNotification.
107         (-[WKContentView _applicationDidEnterBackground:]):
108         (-[WKContentView _applicationWillEnterForeground:]):
109             - when the application state changes all flags except IsInWindow may be affected.
110
111 2014-05-19  Enrica Casucci  <enrica@apple.com>
112
113         WK2 iOS: Pressing the form navigation button causes the keyboard to be dismissed.
114         https://bugs.webkit.org/show_bug.cgi?id=133100
115         <rdar://problem/16808673>
116
117         Reviewed by Benjamin Poulain.
118
119         The call to focusNextAssistedNode is the result of a user action, since
120         it is called when the user pressed the form navigation buttons.
121         Therefore we must set m_userIsInteracting to true before changing the focus
122         to make sure the focus change is honored.
123
124         * WebProcess/WebPage/ios/WebPageIOS.mm:
125         (WebKit::WebPage::focusNextAssistedNode):
126
127 2014-05-19  Beth Dakin  <bdakin@apple.com>
128
129         TelephoneNumberOverlayController should use a modern loop for text quad bounding 
130         boxes
131         https://bugs.webkit.org/show_bug.cgi?id=133096
132
133         Reviewed by Anders Carlsson.
134
135         * WebProcess/WebPage/mac/TelephoneNumberOverlayControllerMac.mm:
136         (WebKit::textQuadsToBoundingRectForRange):
137
138 2014-05-19  Jeremy Jones  <jeremyj@apple.com>
139
140         PlatformCALayerRemoteCustom properties aren't initialized to match the PlatformLayer
141         https://bugs.webkit.org/show_bug.cgi?id=133025
142
143         Reviewed by Simon Fraser.
144
145         * WebProcess/WebPage/mac/PlatformCALayerRemoteCustom.mm:
146         (WebKit::PlatformCALayerRemoteCustom::PlatformCALayerRemoteCustom):
147         Initialize PlatformCALayerRemote properties from the PlatformLayer.
148
149 2014-05-19  Benjamin Poulain  <bpoulain@apple.com>
150
151         [iOS][WK2] When a page relayout on dynamic resize, keep the same relative width in view
152         https://bugs.webkit.org/show_bug.cgi?id=133026
153         <rdar://problem/16833971>
154
155         Reviewed by Simon Fraser.
156
157         When a page does not relayout, we keep the same width in view.
158         When a page relayout, we should keep the same relative width in view.
159
160         * WebProcess/WebPage/ios/WebPageIOS.mm:
161         (WebKit::isResponsiveDesignWithContentLargerThanLayout):
162         (WebKit::WebPage::dynamicViewportSizeUpdate):
163
164 2014-05-19  Benjamin Poulain  <benjamin@webkit.org>
165
166         [WK2] Add some missing state reset on crash
167         https://bugs.webkit.org/show_bug.cgi?id=133036
168
169         Reviewed by Sam Weinig.
170
171         * UIProcess/WebPageProxy.cpp:
172         (WebKit::WebPageProxy::resetState):
173         The missing reset for m_isTrackingTouchEvents would cause the WebPageProxy to send
174         touch events when it shouldn't. That would only be for an active touch sequence.
175
176         The missing reset m_lastVisibleContentRectUpdate would prevent pushing the new UI state
177         to the new page on reload, that is very bad.
178
179         Also moved m_videoFullscreenManager to be in the same order as initialization, and invalidate
180         the callbacks for dictation.
181
182 2014-05-19  Benjamin Poulain  <bpoulain@apple.com>
183
184         [iOS][WK2] Move scale noise filtering to the WebProcess
185         https://bugs.webkit.org/show_bug.cgi?id=133021
186
187         Reviewed by Darin Adler.
188
189         Filtering in the UIProcess was stupid. It forces to handle a third kind of scale just for updates.
190
191         The WebProcess already adjusts the input scale based on the viewport. Changing the input scale at that level
192         is already supported. It is a better place to have the filtering.
193
194         * UIProcess/ios/WKContentView.mm:
195         (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:]):
196         * WebProcess/WebPage/ios/WebPageIOS.mm:
197         (WebKit::WebPage::updateVisibleContentRects):
198
199 2014-05-19  Simon Fraser  <simon.fraser@apple.com>
200
201         Split scrolling tree ScrollingNodes into FrameScrollingNodes and OverflowScrollingNodes
202         https://bugs.webkit.org/show_bug.cgi?id=133022
203
204         Reviewed by Sam Weinig.
205         
206         In both the scrolling state tree and the scrolling tree, split the "scrolling nodes"
207         into FrameScrolling and OverflowScrolling nodes.
208         
209         Move what was the "viewportSize" property onto the base class for the scrolling
210         nodes, calling it "scrollableAreaSize".
211         
212         Make minimum/maximumScrollPosition() virtual so we can share more code (and there
213         is more code sharing to be done in future).
214
215         * Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp:
216         (ArgumentCoder<ScrollingStateScrollingNode>::encode):
217         (ArgumentCoder<ScrollingStateFrameScrollingNode>::encode):
218         (ArgumentCoder<ScrollingStateOverflowScrollingNode>::encode):
219         (ArgumentCoder<ScrollingStateScrollingNode>::decode):
220         (ArgumentCoder<ScrollingStateFrameScrollingNode>::decode):
221         (ArgumentCoder<ScrollingStateOverflowScrollingNode>::decode):
222         (WebKit::encodeNodeAndDescendants):
223         (WebKit::RemoteScrollingCoordinatorTransaction::decode):
224         (WebKit::RemoteScrollingTreeTextStream::dump):
225         * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp:
226         (WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers):
227         * UIProcess/Scrolling/RemoteScrollingTree.cpp:
228         (WebKit::RemoteScrollingTree::createNode):
229         * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.h:
230         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::scrollLayer):
231         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::updateLayersAfterViewportChange):
232         * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:
233         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::ScrollingTreeOverflowScrollingNodeIOS):
234         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::updateBeforeChildren):
235         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::updateAfterChildren):
236         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::setScrollLayerPosition):
237         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::updateChildNodesAfterScroll):
238         * UIProcess/ios/RemoteScrollingCoordinatorProxyIOS.mm:
239         (WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers):
240
241 2014-05-19  Alexey Proskuryakov  <ap@apple.com>
242
243         [Mac] Fix a typo in plug-in sandbox
244         https://bugs.webkit.org/show_bug.cgi?id=133074
245
246         Reviewed by Anders Carlsson.
247
248         * Resources/PlugInSandboxProfiles/com.apple.WebKit.plugin-common.sb:
249
250 2014-05-16  Andy Estes  <aestes@apple.com>
251
252         [WebKit2] Wake up threads blocked in waitForAndDispatchImmediately() if we lose our connection
253         https://bugs.webkit.org/show_bug.cgi?id=133010
254
255         Reviewed by Geoffrey Garen.
256
257         If a thread is blocked on m_waitForMessageCondition and we lose our connection, treat that like we do a timeout.
258
259         * Platform/IPC/Connection.cpp:
260         (IPC::Connection::Connection):
261         (IPC::Connection::waitForMessage):
262         (IPC::Connection::connectionDidClose):
263         * Platform/IPC/Connection.h:
264
265 2014-05-19  Mark Rowe  <mrowe@apple.com>
266
267         Build fix after r169023.
268
269         * Shared/API/Cocoa/WebKitPrivate.h: Stop including headers that no longer exist.
270         I hope for weinig's sake that no-one was relying on them.
271
272 2014-05-18  Anders Carlsson  <andersca@apple.com>
273
274         Relax an assertion when creating document loaders
275         https://bugs.webkit.org/show_bug.cgi?id=133058
276
277         Reviewed by Sam Weinig.
278
279         When navigating back/forward items recursively, createDocumentLoader will be called
280         for subframes before main frames so only associate the navigation with main frames.
281
282         * WebProcess/WebPage/WebPage.cpp:
283         (WebKit::WebPage::createDocumentLoader):
284
285 2014-05-18  Zsolt Borbely  <zsborbely.u-szeged@partner.samsung.com>
286
287         CMake Buildfix after r169023.
288
289         Reviewed by Csaba Osztrogonác.
290
291         * CMakeLists.txt: Add new files after r168994.
292
293 2014-05-18  Sam Weinig  <sam@webkit.org>
294
295         [WebKit2] Implement ScriptMessageHandlers
296         https://bugs.webkit.org/show_bug.cgi?id=133053
297
298         Reviewed by Anders Carlsson.
299
300         * DerivedSources.make:
301         * Scripts/webkit2/messages.py:
302         (struct_or_class):
303         (argument_coder_headers_for_type):
304         (headers_for_type):
305         * UIProcess/API/Cocoa/WKScriptMessage.mm:
306         (-[WKScriptMessage _initWithBody:webView:name:]):
307         (-[WKScriptMessage body]):
308         (-[WKScriptMessage webView]):
309         (-[WKScriptMessage name]):
310         (-[WKScriptMessage _scriptWorld]): Deleted.
311         * UIProcess/API/Cocoa/WKScriptMessageInternal.h: Copied from Source/WebKit2/UIProcess/API/Cocoa/WKScriptMessagePrivate.h.
312         * UIProcess/API/Cocoa/WKScriptMessagePrivate.h: Removed.
313         * UIProcess/API/Cocoa/WKUserContentController.mm:
314         (-[WKUserContentController addScriptMessageHandler:name:]):
315         (-[WKUserContentController removeScriptMessageHandlerForName:]):
316         (-[WKUserContentController _addScriptMessageHandler:name:world:]): Deleted.
317         (-[WKUserContentController _removeScriptMessageHandlerForName:world:]): Deleted.
318         * UIProcess/API/Cocoa/WKUserContentControllerInternal.h:
319         * UIProcess/API/Cocoa/WKUserContentControllerPrivate.h: Removed.
320         * UIProcess/API/Cocoa/WKWebView.mm:
321         (pageToViewMap):
322         (fromWebPageProxy):
323         (-[WKWebView initWithFrame:configuration:]):
324         (-[WKWebView dealloc]):
325         * UIProcess/API/Cocoa/WKWebViewInternal.h:
326         * UIProcess/UserContent/WebScriptMessageHandler.cpp: Added.
327         (WebKit::WebScriptMessageHandlerHandle::encode):
328         (WebKit::WebScriptMessageHandlerHandle::decode):
329         (WebKit::generateIdentifier):
330         (WebKit::WebScriptMessageHandler::create):
331         (WebKit::WebScriptMessageHandler::WebScriptMessageHandler):
332         (WebKit::WebScriptMessageHandler::~WebScriptMessageHandler):
333         * UIProcess/UserContent/WebScriptMessageHandler.h: Added.
334         (WebKit::WebScriptMessageHandler::Client::~Client):
335         (WebKit::WebScriptMessageHandler::handle):
336         (WebKit::WebScriptMessageHandler::identifier):
337         (WebKit::WebScriptMessageHandler::name):
338         (WebKit::WebScriptMessageHandler::client):
339         * UIProcess/UserContent/WebUserContentControllerProxy.cpp:
340         (WebKit::WebUserContentControllerProxy::addProcess):
341         (WebKit::WebUserContentControllerProxy::removeProcess):
342         (WebKit::WebUserContentControllerProxy::addUserScriptMessageHandler):
343         (WebKit::WebUserContentControllerProxy::removeUserMessageHandlerForName):
344         (WebKit::WebUserContentControllerProxy::didPostMessage):
345         * UIProcess/UserContent/WebUserContentControllerProxy.h:
346         * UIProcess/UserContent/WebUserContentControllerProxy.messages.in: Added.
347         * WebKit2.xcodeproj/project.pbxproj:
348         * WebProcess/UserContent/WebUserContentController.cpp:
349         (WebKit::WebUserMessageHandlerDescriptorProxy::create):
350         (WebKit::WebUserMessageHandlerDescriptorProxy::~WebUserMessageHandlerDescriptorProxy):
351         (WebKit::WebUserMessageHandlerDescriptorProxy::didPostMessage):
352         (WebKit::WebUserMessageHandlerDescriptorProxy::descriptor):
353         (WebKit::WebUserMessageHandlerDescriptorProxy::identifier):
354         (WebKit::WebUserMessageHandlerDescriptorProxy::WebUserMessageHandlerDescriptorProxy):
355         (WebKit::WebUserContentController::addUserScriptMessageHandlers):
356         (WebKit::WebUserContentController::removeUserScriptMessageHandler):
357         * WebProcess/UserContent/WebUserContentController.h:
358         * WebProcess/UserContent/WebUserContentController.messages.in:
359
360 2014-05-18  Rik Cabanier  <cabanier@adobe.com>
361
362         support for navigator.hardwareConcurrency
363         https://bugs.webkit.org/show_bug.cgi?id=132588
364
365         Reviewed by Filip Pizlo.
366
367         * Configurations/FeatureDefines.xcconfig:
368
369 2014-05-18  Anders Carlsson  <andersca@apple.com>
370
371         Implement Navigations for all methods declared returning one
372         https://bugs.webkit.org/show_bug.cgi?id=133048
373         <rdar://problem/16830064>
374
375         Reviewed by Sam Weinig.
376
377         * UIProcess/API/Cocoa/WKWebView.mm:
378         (-[WKWebView goToBackForwardListItem:]):
379         (-[WKWebView goBack]):
380         (-[WKWebView goForward]):
381         (-[WKWebView reload]):
382         (-[WKWebView reloadFromOrigin]):
383         Create and return navigations.
384
385         (-[WKWebView _reload]):
386         Call -[WKWebView reload].
387
388         * UIProcess/Cocoa/NavigationState.h:
389         * UIProcess/Cocoa/NavigationState.mm:
390         (WebKit::NavigationState::createBackForwardNavigation):
391         Create a back/forward navigation.
392
393         (WebKit::NavigationState::createReloadNavigation):
394         Create a reload navigation.
395
396         * UIProcess/WebPageProxy.cpp:
397         (WebKit::WebPageProxy::reattachToWebProcessWithItem):
398         Generate a navigation ID and send it with the GoToBackForwardItem message.
399
400         (WebKit::WebPageProxy::reload):
401         Return a navigation ID.
402
403         (WebKit::WebPageProxy::goForward):
404         Generate a navigation ID and send it with the GoForward message.
405         
406         (WebKit::WebPageProxy::goBack):
407         Generate a navigation ID and send it with the GoBack message.
408
409         (WebKit::WebPageProxy::goToBackForwardItem):
410         Generate a navigation ID and send it with the GoToBackForwardItem message.
411
412         * UIProcess/WebPageProxy.h:
413         Return navigation IDs where appropriate.
414
415         * UIProcess/cf/WebPageProxyCF.cpp:
416         (WebKit::WebPageProxy::restoreFromSessionStateData):
417         Generate a navigation ID and send it with the RestoreSessionAndNavigateToCurrentItem message.
418         
419         * WebProcess/WebPage/WebPage.cpp:
420         (WebKit::WebPage::goForward):
421         (WebKit::WebPage::goBack):
422         (WebKit::WebPage::goToBackForwardItem):
423         Set up the pending navigation ID.
424
425         (WebKit::WebPage::restoreSessionAndNavigateToCurrentItem):
426         Call goToBackForwardItem with a navigation ID.
427
428         * WebProcess/WebPage/WebPage.h:
429         Add navigation IDs.
430
431         * WebProcess/WebPage/WebPage.messages.in:
432         Add navigation IDs.
433
434 2014-05-18  Commit Queue  <commit-queue@webkit.org>
435
436         Unreviewed, rolling out r169001.
437         https://bugs.webkit.org/show_bug.cgi?id=133050
438
439         We can't expose the C SPI from WKWebView (Requested by
440         andersca on #webkit).
441
442         Reverted changeset:
443
444         "Need a way to get a WKPageRef from a WKWebView"
445         https://bugs.webkit.org/show_bug.cgi?id=133015
446         http://trac.webkit.org/changeset/169001
447
448 2014-05-18  Martin Hodovan  <mhodovan.u-szeged@partner.samsung.com>
449
450         [WK2][GTK] Buildfix after r168999.
451
452         Reviewed by Csaba Osztrogonác.
453
454         * UIProcess/gtk/WebContextGtk.cpp:
455         (WebKit::WebContext::platformDefaultWebSQLDatabaseDirectory): Renamed from WebKit::WebContext::platformDefaultDatabaseDirectory().
456         (WebKit::WebContext::platformDefaultIndexedDBDatabaseDirectory): Added.
457
458 2014-05-18  Martin Hodovan  <mhodovan.u-szeged@partner.samsung.com>
459
460         [WK2][EFL] Buildfix after r168999.
461
462         Reviewed by Csaba Osztrogonác.
463
464         * UIProcess/efl/WebContextEfl.cpp:
465         (WebKit::WebContext::platformDefaultWebSQLDatabaseDirectory): Renamed from WebKit::WebContext::platformDefaultDatabaseDirectory().
466         (WebKit::WebContext::platformDefaultIndexedDBDatabaseDirectory): Added.
467
468 2014-05-18  Martin Hodovan  <mhodovan.u-szeged@partner.samsung.com>
469
470         [WK2][cmake] Buildfix after r168994.
471
472         Reviewed by Csaba Osztrogonác.
473
474         * CMakeLists.txt: Added new files to the build system introduced in r168994.
475
476 2014-05-17  Alexey Proskuryakov  <ap@apple.com>
477
478         REGRESSION (NetworkProcess): Trying to use appcache fallback crashes in ApplicationCacheHost::scheduleLoadFallbackResourceFromApplicationCache
479         https://bugs.webkit.org/show_bug.cgi?id=133007
480         <rdar://problem/13702706>
481
482         appcache tests often fail on the Mac WebKit2 bot
483         https://bugs.webkit.org/show_bug.cgi?id=82061
484
485         Reviewed by Maciej Stachowiak.
486
487         * WebProcess/Network/WebResourceLoader.cpp:
488         (WebKit::WebResourceLoader::willSendRequest):
489         (WebKit::WebResourceLoader::didReceiveResponseWithCertificateInfo):
490         (WebKit::WebResourceLoader::didFailResourceLoad):
491         Perform the same appcache checks that ResourceHandleClient implementation in ResourceLoader
492         does. We should eventually come up with a way to share the code. Perhaps add a class that
493         isolates ResourceLoader from networking details? But ResourceLoader was itself supposed
494         to be the class that isolates DocumentLoader from networking details. So, unsure.
495
496 2014-05-17  Jae Hyun Park  <jaepark@webkit.org>
497
498         [EFL] Remove m_contentPosition from PageViewportControllerClientEfl
499         https://bugs.webkit.org/show_bug.cgi?id=132774
500
501         Reviewed by Anders Carlsson.
502
503         m_contentPosition is not used anywhere. So, this patch removes
504         m_contentPosition and reduces one unnecessary assignment in
505         setViewportPosition. Also, it renames contentsPoint to contentsPosition.
506
507         * UIProcess/PageViewportControllerClient.h:
508         * UIProcess/efl/PageViewportControllerClientEfl.cpp:
509         (WebKit::PageViewportControllerClientEfl::setViewportPosition):
510         * UIProcess/efl/PageViewportControllerClientEfl.h:
511
512 2014-05-17  David Kilzer  <ddkilzer@apple.com>
513
514         Need a way to get a WKPageRef from a WKWebView
515         <http://webkit.org/b/133015>
516
517         Reviewed by Benjamin Poulain.
518
519         * UIProcess/API/Cocoa/WKWebView.mm:
520         (-[WKWebView _pageRef]): Added.
521         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
522         (-[WKWebView _pageRef]): Added declaration.
523
524 2014-05-17  Anders Carlsson  <andersca@apple.com>
525
526         Give user scripts custom URLs
527         https://bugs.webkit.org/show_bug.cgi?id=133035
528
529         Reviewed by Beth Dakin.
530
531         * UIProcess/API/Cocoa/WKUserContentController.mm:
532         (-[WKUserContentController addUserScript:]):
533         Create a user-script:<number> URL for user scripts.
534
535         * UIProcess/API/Cocoa/WKUserScript.h:
536         Move the init method after the properties.
537
538 2014-05-17  Anders Carlsson  <andersca@apple.com>
539
540         Replace WKContextSetDatabaseDirectory with two WKContextConfiguration parameters
541         https://bugs.webkit.org/show_bug.cgi?id=133033
542         <rdar://problem/16830143>
543
544         Reviewed by Sam Weinig.
545
546         * Shared/WebProcessCreationParameters.cpp:
547         (WebKit::WebProcessCreationParameters::encode):
548         (WebKit::WebProcessCreationParameters::decode):
549         * Shared/WebProcessCreationParameters.h:
550         Rename databaseDirectory to webSQLDatabaseDirectory to better indicate the directory type.
551
552         * UIProcess/API/C/WKContext.cpp:
553         (WKContextSetDatabaseDirectory): Deleted.
554         This is no longer needed.
555
556         * UIProcess/API/C/WKContextConfigurationRef.cpp:
557         (WKContextConfigurationCopyIndexedDBDatabaseDirectory):
558         (WKContextConfigurationSetIndexedDBDatabaseDirectory):
559         (WKContextConfigurationCopyWebSQLDatabaseDirectory):
560         (WKContextConfigurationSetWebSQLDatabaseDirectory):
561         * UIProcess/API/C/WKContextConfigurationRef.h:
562         Add setters and getters.
563
564         * UIProcess/API/C/WKContextPrivate.h:
565         Remove WKContextSetDatabaseDirectory.
566
567         * UIProcess/APIContextConfiguration.cpp:
568         (API::ContextConfiguration::webContextConfiguration):
569         Set m_indexedDBDatabaseDirectory and m_webSQLDatabaseDirectory on the configuration.
570
571         * UIProcess/APIContextConfiguration.h:
572         (API::ContextConfiguration::indexedDBDatabaseDirectory):
573         (API::ContextConfiguration::setIndexedDBDatabaseDirectory):
574         (API::ContextConfiguration::webSQLDatabaseDirectory):
575         (API::ContextConfiguration::setWebSQLDatabaseDirectory):
576         Add getters and setters to the C++ part of WKContextConfigurationRef.
577
578         * UIProcess/WebContext.cpp:
579         (WebKit::WebContext::applyPlatformSpecificConfigurationDefaults):
580         Set webSQLDatabaseDirectory and indexedDBDatabaseDirectory.
581
582         (WebKit::WebContext::WebContext):
583         Initialize m_webSQLDatabaseDirectory and m_indexedDBDatabaseDirectory.
584
585         (WebKit::WebContext::ensureDatabaseProcess):
586         Set parameters.indexedDatabaseDirectory from m_indexedDBDatabaseDirectory.
587
588         (WebKit::WebContext::createNewWebProcess):
589         Set parameters.webSQLDatabaseDirectory from m_webSQLDatabaseDirectory.
590
591         * UIProcess/mac/WebContextMac.mm:
592         (WebKit::WebContext::platformDefaultWebSQLDatabaseDirectory):
593         Rename this to indicate that it's about WebSQL databases.
594
595         (WebKit::WebContext::platformDefaultIndexedDBDatabaseDirectory):
596         Add this.
597
598         * WebProcess/WebCoreSupport/WebDatabaseManager.cpp:
599         (WebKit::WebDatabaseManager::initialize):
600         Update for WebProcessCreationParameters rename.
601
602         * WebProcess/cocoa/WebProcessCocoa.mm:
603         (WebKit::WebProcess::platformInitializeWebProcess):
604         Update for WebProcessCreationParameters rename.
605
606 2014-05-17  Brent Fulgham  <bfulgham@apple.com>
607
608         [Phone Number Detection] drop-down menu in the phone number detection box doesn't appear.
609         https://bugs.webkit.org/show_bug.cgi?id=133024
610
611         Reviewed by Sam Weinig.
612
613         * WebProcess/WebPage/mac/TelephoneNumberOverlayControllerMac.mm:
614         (WebKit::TelephoneNumberOverlayController::drawRect): Don't clear the set of found phone numbers each
615         time we call drawRect. This gets called ~9 times per screen refresh, so end up with no active
616         phone numbers to interact with.
617
618 2014-05-17  Alexey Proskuryakov  <ap@apple.com>
619
620         NetworkProcess can repeatedly crash handling Blob messages after any unrelated crash
621         https://bugs.webkit.org/show_bug.cgi?id=133032
622         <rdar://problem/16951630>
623
624         Reviewed by Geoffrey Garen.
625
626         Replaced assertions with runtime checks. This can happen if NetworkProcess previously
627         crashed for any unrelated reason.
628
629         * NetworkProcess/FileAPI/NetworkBlobRegistry.cpp:
630         (WebKit::NetworkBlobRegistry::registerBlobURL):
631         (WebKit::NetworkBlobRegistry::registerBlobURLForSlice):
632         (WebKit::NetworkBlobRegistry::unregisterBlobURL):
633
634 2014-05-17  Anders Carlsson  <andersca@apple.com>
635
636         -[WKWebView dealloc] should close the page
637         https://bugs.webkit.org/show_bug.cgi?id=133031
638         <rdar://problem/16929815>
639
640         Reviewed by Simon Fraser.
641
642         * UIProcess/API/Cocoa/WKWebView.mm:
643         (-[WKWebView dealloc]):
644
645 2014-05-16  Anders Carlsson  <andersca@apple.com>
646
647         Expose WKUserScript as API
648         https://bugs.webkit.org/show_bug.cgi?id=133017
649         <rdar://problem/16948059>
650
651         Reviewed by Sam Weinig.
652
653         * DerivedSources.make:
654         Add WebUserContentController.
655
656         * Shared/API/Cocoa/WebKit.h:
657         Add WKUserScript.h
658
659         * Shared/API/c/WKSharedAPICast.h:
660         (WebKit::toUserScriptInjectionTime):
661         Update for WKUserScriptInjectionTime -> _WKUserScriptInjectionTime rename.
662
663         * Shared/API/c/WKUserScriptInjectionTime.h:
664         Rename WKUserScriptInjectionTime to _WKUserScriptInjectionTime to free up the name for the Objective-C API
665
666         * Shared/WebPageCreationParameters.cpp:
667         (WebKit::WebPageCreationParameters::encode):
668         Encode the user content controller ID.
669
670         (WebKit::WebPageCreationParameters::decode):
671         Decode the user content controller ID.
672
673         * Shared/WebPageCreationParameters.h:
674         Add userContentControllerID.
675
676         * UIProcess/API/C/WKPageGroup.cpp:
677         (WKPageGroupAddUserScript):
678         Update for WKUserScriptInjectionTime -> _WKUserScriptInjectionTime rename.
679
680         * UIProcess/API/C/WKPageGroup.h:
681         Update for WKUserScriptInjectionTime -> _WKUserScriptInjectionTime rename.
682
683         * UIProcess/API/Cocoa/WKBrowsingContextGroup.h:
684         Update for WKUserScriptInjectionTime -> _WKUserScriptInjectionTime rename.
685
686         * UIProcess/API/Cocoa/WKBrowsingContextGroup.mm:
687         (-[WKBrowsingContextGroup addUserScript:baseURL:whitelistedURLPatterns:blacklistedURLPatterns:injectionTime:mainFrameOnly:]):
688         Update for WKUserScriptInjectionTime -> _WKUserScriptInjectionTime rename.
689
690         * UIProcess/API/Cocoa/WKUserContentController.h:
691         Add new methods.
692
693         * UIProcess/API/Cocoa/WKUserContentController.mm:
694         (-[WKUserContentController init]):
695         Create the WebUserContentControllerProxy object and user scripts array.
696
697         (-[WKUserContentController userScripts]):
698         Return the user scripts array.
699
700         (toWebCoreUserScriptInjectionTime):
701         Helper for converting from a WKUserScriptInjectionTime enum to WebCore::UserScriptInjectionTime.
702
703         (-[WKUserContentController addUserScript:]):
704         Call through to the _userContentControllerProxy object.
705
706         (-[WKUserContentController removeAllUserScripts]):
707         Call through to the _userContentControllerProxy object.
708         
709         * UIProcess/API/Cocoa/WKUserContentControllerInternal.h: Added.
710         Add WebUserContentControllerProxy ivar.
711
712         * UIProcess/API/Cocoa/WKUserScript.h: Added.
713         Add new header.
714
715         * UIProcess/API/Cocoa/WKUserScript.mm:
716         (-[WKUserScript initWithSource:injectionTime:forMainFrameOnly:]):
717         Initialize the WKUserScript object.
718
719         (-[WKUserScript source]):
720         (-[WKUserScript injectionTime]):
721         (-[WKUserScript isForMainFrameOnly]):
722         Add getters.
723
724         (-[WKUserScript copyWithZone:]):
725         Since WKUserScript is immutable, just return a retained object.
726
727         * UIProcess/API/Cocoa/WKUserScriptInternal.h:
728         Add ivars.
729
730         * UIProcess/API/Cocoa/WKWebView.mm:
731         (-[WKWebView initWithFrame:configuration:]):
732         Set the user content controller from the configuration.
733
734         * UIProcess/UserContent/WebUserContentControllerProxy.cpp: Added.
735         (WebKit::generateIdentifier):
736         Return a unique identifier.
737
738         (WebKit::WebUserContentControllerProxy::create):
739         Return a new WebUserContentControllerProxy object.
740
741         (WebKit::WebUserContentControllerProxy::WebUserContentControllerProxy):
742         Initialize m_identifier.
743
744         (WebKit::WebUserContentControllerProxy::~WebUserContentControllerProxy):
745         Add destructor.
746
747         (WebKit::WebUserContentControllerProxy::addProcess):
748         Add the process to the m_processes set. If it's the first time doing so, add the user scripts we know about.
749
750         (WebKit::WebUserContentControllerProxy::removeProcess):
751         Remove the process from m_processes.
752
753         (WebKit::WebUserContentControllerProxy::addUserScript):
754         Add the user script and let all the web processes know that it was added.
755
756         (WebKit::WebUserContentControllerProxy::removeAllUserScripts):
757         Remove all user scripts and tell all the web processes about it.
758         
759         * UIProcess/UserContent/WebUserContentControllerProxy.h:
760         Add new class.
761
762         * UIProcess/WebPageProxy.cpp:
763         (WebKit::WebPageProxy::WebPageProxy):
764         If the process is already running, add it to the user content controller.
765
766         (WebKit::WebPageProxy::close):
767         If the process is running, remove it from the user content controller.
768
769         (WebKit::WebPageProxy::connectionWillOpen):
770         Add the process to the user content controller.
771
772         (WebKit::WebPageProxy::resetStateAfterProcessExited):
773         Remove the process from the user content controller.
774
775         (WebKit::WebPageProxy::creationParameters):
776         Pass along the user content controller ID when creating the web page.
777
778         * UIProcess/WebPageProxy.h:
779         Add a WebUserContentControllerProxy object to the web page configuration.
780
781         * WebKit2.xcodeproj/project.pbxproj:
782         Add new files.
783
784         * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
785         * WebProcess/InjectedBundle/API/c/WKBundlePrivate.h:
786         Update for WKUserScriptInjectionTime -> _WKUserScriptInjectionTime rename.
787         
788         * WebProcess/UserContent/WebUserContentController.cpp: Added.
789         New class that manages a WebCore::UserContentController object.
790
791         (WebKit::WebUserContentController::getOrCreate):
792         Look up (or create) a WebUserContentController object given its identifier.
793
794         (WebKit::WebUserContentController::WebUserContentController):
795         Add ourselves as a message receiver.
796
797         (WebKit::WebUserContentController::~WebUserContentController):
798         Remove ourselves as a message receiver.
799
800         (WebKit::WebUserContentController::addUserScripts):
801         Add all passed in user scripts to the WebCore user content controller object.
802
803         (WebKit::WebUserContentController::removeAllUserScripts):
804         Remove all user scripts from the WebCore user content controller object.
805
806         * WebProcess/UserContent/WebUserContentController.messages.in: Added.
807         Add new messages file.
808
809         * WebProcess/WebPage/WebPage.cpp:
810         (WebKit::WebPage::WebPage):
811         Get a WebUserContentController object and pass it along to WebCore.
812
813         * WebProcess/WebPage/WebPage.h:
814         Add WebUserContentController member.
815
816 2014-05-16  Piotr Grad  <p.grad@samsung.com>
817
818         [GTK] Build break after 168978.
819         https://bugs.webkit.org/show_bug.cgi?id=133012.
820
821         Reviewed by Simon Fraser.
822
823         * UIProcess/API/gtk/WebKitSettings.cpp:
824         (webKitSettingsConstructed):
825
826 2014-05-16  Simon Fraser  <simon.fraser@apple.com>
827
828         Put back a symbol removed in r168978 that Safari needs, but deprecate it.
829
830         Reviewed by Anders Carlsson.
831
832         * Shared/API/c/WKDeprecatedFunctions.cpp:
833         (WKPreferencesSetRegionBasedColumnsEnabled):
834         (WKPreferencesGetRegionBasedColumnsEnabled):
835
836 2014-05-16  Oliver Hunt  <oliver@apple.com>
837
838         Separate enabling sandbox extensions from the WEB_PROCESS_SANDBOX flag
839         https://bugs.webkit.org/show_bug.cgi?id=133016
840
841         Reviewed by Alexey Proskuryakov.
842
843         Add a distinct SANDBOX_EXTENSIONS flag to guard sandbox extensions
844         and switch over to it in the places that extensions are used.
845
846         * Shared/SandboxExtension.h:
847         * Shared/mac/SandboxExtensionMac.mm:
848         * UIProcess/WebPageProxy.cpp:
849         (WebKit::WebPageProxy::didChooseFilesForOpenPanel):
850         * WebKit2Prefix.h:
851         * WebProcess/WebPage/WebPage.cpp:
852         * WebProcess/WebPage/WebPage.h:
853         * WebProcess/WebPage/WebPage.messages.in:
854         * WebProcess/cocoa/WebProcessCocoa.mm:
855         (WebKit::WebProcess::platformInitializeWebProcess):
856
857 2014-05-16  Benjamin Poulain  <bpoulain@apple.com>
858
859         [iOS][WK2] Add a heuristic to set the right horizontal offset on rotation for responsive websites
860         https://bugs.webkit.org/show_bug.cgi?id=132937
861         <rdar://problem/16710097>
862
863         Reviewed by Simon Fraser.
864
865         When responsive websites have the content size lay out larger than the minimal layout size,
866         we should not keep the relative horizontal position into view,
867         many of those websites have all the content on the left.
868
869         * WebProcess/WebPage/ios/WebPageIOS.mm:
870         (WebKit::WebPage::dynamicViewportSizeUpdate):
871
872 2014-05-16  Benjamin Poulain  <bpoulain@apple.com>
873
874         [iOS][WK2] On dynamic resize, the content offset is contrained to the old content size
875         https://bugs.webkit.org/show_bug.cgi?id=132972
876
877         Reviewed by Simon Fraser.
878
879         When we set the content offset, UIScrollView limits the value to the current valid range for
880         content size. Since the content size was only updated after the animation, when the first frame
881         comes in, the content offset would sometimes be limited to a smaller rect that the actual content.
882
883         To fix this, set the expected future content size before changing the offset.
884
885         During the animation, the content size could have changed arbitrarily. At the end of the animation,
886         we take the actual frame and set the definite content size.
887         Any update after that will be regular updates through didCommitLayer. 
888
889         * UIProcess/API/Cocoa/WKWebView.mm:
890         (-[WKWebView _beginAnimatedResizeWithUpdates:]):
891         (-[WKWebView _endAnimatedResize]):
892
893 2014-05-16  Simon Fraser  <simon.fraser@apple.com>
894
895         Remove "region-based columns" prefs
896         https://bugs.webkit.org/show_bug.cgi?id=133006
897         <rdar://problem/16945824>
898
899         Reviewed by Dave Hyatt.
900
901         Remove "region-based columns" prefs and related code, since this is only
902         way to render columns now.
903
904         * Shared/WebPreferencesStore.h:
905         * UIProcess/API/C/WKPreferences.cpp:
906         (WKPreferencesSetRegionBasedColumnsEnabled): Deleted.
907         (WKPreferencesGetRegionBasedColumnsEnabled): Deleted.
908         * UIProcess/API/C/WKPreferencesRefPrivate.h:
909         * WebProcess/WebPage/WebPage.cpp:
910         (WebKit::WebPage::updatePreferences):
911
912 2014-05-16  Brent Fulgham  <bfulgham@apple.com>
913
914         Work around bug in Silverlight
915         https://bugs.webkit.org/show_bug.cgi?id=133004
916
917         Reviewed by Anders Carlsson.
918
919         * PluginProcess/EntryPoint/mac/LegacyProcess/PluginProcessMain.mm:
920         (WebKit::PluginProcessMainDelegate::doPreInitializationWork): Add low-resolution flag
921         to user defaults prior to NSApplication invocation. This code was moved from
922         PluginProcess::platformInitializeProcess.
923         * PluginProcess/mac/PluginProcessMac.mm:
924         (WebKit::PluginProcess::platformInitializeProcess): Move low-resolution flag
925         setting to PluginProcessMainDelegate.
926
927 2014-05-16  Martin Hodovan  <mhodovan.u-szeged@partner.samsung.com>
928
929         [WK2] Change the remaining framework includes from WebKit2 to WebKit
930         https://bugs.webkit.org/show_bug.cgi?id=132956
931
932         Reviewed by Sam Weinig.
933
934         * NetworkProcess/unix/NetworkProcessMainUnix.cpp:
935         * NetworkProcess/unix/NetworkProcessMainUnix.h:
936         * PluginProcess/unix/PluginProcessMainUnix.h:
937         * Shared/API/c/cairo/WKImageCairo.h:
938         * Shared/API/c/cf/WKURLRequestCF.h:
939         * Shared/API/c/cf/WKURLResponseCF.h:
940         * Shared/API/c/efl/WKArrayEfl.cpp:
941         * Shared/API/c/efl/WKArrayEfl.h:
942         * UIProcess/API/C/CoordinatedGraphics/WKView.h:
943         * UIProcess/API/C/WKBatteryManager.h:
944         * UIProcess/API/C/WKBatteryStatus.h:
945         * UIProcess/API/C/WKGrammarDetail.h:
946         * UIProcess/API/C/WKTextChecker.h:
947         * UIProcess/API/C/WKVibration.h:
948         * UIProcess/API/C/WKViewportAttributes.h:
949         * UIProcess/API/C/cairo/WKIconDatabaseCairo.h:
950         * UIProcess/API/C/efl/WKAPICastEfl.h:
951         * UIProcess/API/C/efl/WKColorPickerResultListener.h:
952         * UIProcess/API/C/efl/WKEventEfl.h:
953         * UIProcess/API/C/efl/WKPageEfl.h:
954         * UIProcess/API/C/efl/WKPopupItem.h:
955         * UIProcess/API/C/efl/WKPopupMenuListener.h:
956         * UIProcess/API/C/efl/WKViewEfl.cpp:
957         * UIProcess/API/C/efl/WKViewEfl.h:
958         * UIProcess/API/C/gtk/WKFullScreenClientGtk.h:
959         * UIProcess/API/C/gtk/WKInspectorClientGtk.h:
960         * UIProcess/API/C/gtk/WKView.h:
961         * UIProcess/API/C/gtk/WKViewPrivate.h:
962         * UIProcess/API/C/soup/WKContextSoup.h:
963         * UIProcess/API/C/soup/WKCookieManagerSoup.h:
964         * UIProcess/API/C/soup/WKSoupCustomProtocolRequestManager.h:
965         * UIProcess/API/C/soup/WKSoupRequestManager.h:
966         * UIProcess/API/Cocoa/WKErrorRecoveryAttempting.h:
967         * UIProcess/API/CoordinatedGraphics/WKCoordinatedScene.h:
968         * UIProcess/API/cpp/efl/WKEinaSharedString.cpp:
969         * UIProcess/API/cpp/efl/WKEinaSharedString.h:
970         * UIProcess/API/efl/EwkView.cpp:
971         * UIProcess/API/efl/EwkView.h:
972         * UIProcess/API/efl/EwkViewCallbacks.h:
973         * UIProcess/API/efl/GestureRecognizer.h:
974         * UIProcess/API/efl/ewk_application_cache_manager_private.h:
975         * UIProcess/API/efl/ewk_auth_request_private.h:
976         * UIProcess/API/efl/ewk_back_forward_list_item_private.h:
977         * UIProcess/API/efl/ewk_back_forward_list_private.h:
978         * UIProcess/API/efl/ewk_context_menu_item.cpp:
979         * UIProcess/API/efl/ewk_context_private.h:
980         * UIProcess/API/efl/ewk_cookie_manager_private.h:
981         * UIProcess/API/efl/ewk_database_manager_private.h:
982         * UIProcess/API/efl/ewk_error_private.h:
983         * UIProcess/API/efl/ewk_favicon_database_private.h:
984         * UIProcess/API/efl/ewk_file_chooser_request_private.h:
985         * UIProcess/API/efl/ewk_page_group_private.h:
986         * UIProcess/API/efl/ewk_popup_menu_item_private.h:
987         * UIProcess/API/efl/ewk_popup_menu_private.h:
988         * UIProcess/API/efl/ewk_security_origin_private.h:
989         * UIProcess/API/efl/ewk_settings_private.h:
990         * UIProcess/API/efl/ewk_storage_manager_private.h:
991         * UIProcess/API/efl/ewk_view.cpp:
992         * UIProcess/API/efl/ewk_view_private.h:
993         * UIProcess/API/efl/ewk_window_features_private.h:
994         * UIProcess/API/efl/tests/InjectedBundle/injected_bundle_sample.cpp:
995         * UIProcess/API/efl/tests/test_ewk2_eina_shared_string.cpp:
996         * UIProcess/API/gtk/WebKitDownloadClient.cpp:
997         * UIProcess/API/gtk/WebKitPrivate.h:
998         * UIProcess/CoordinatedGraphics/WKCoordinatedSceneAPICast.h:
999         * UIProcess/efl/BatteryProvider.h:
1000         * UIProcess/efl/ContextHistoryClientEfl.h:
1001         * UIProcess/efl/DownloadManagerEfl.h:
1002         * UIProcess/efl/FindClientEfl.h:
1003         * UIProcess/efl/FormClientEfl.h:
1004         * UIProcess/efl/PageLoadClientEfl.h:
1005         * UIProcess/efl/PagePolicyClientEfl.h:
1006         * UIProcess/efl/PageUIClientEfl.h:
1007         * UIProcess/efl/RequestManagerClientEfl.h:
1008         * UIProcess/efl/TextCheckerClientEfl.h:
1009         * UIProcess/efl/VibrationClientEfl.h:
1010         * UIProcess/efl/ViewClientEfl.cpp:
1011         * UIProcess/efl/ViewClientEfl.h:
1012         * UIProcess/efl/WebInspectorProxyEfl.cpp:
1013         * WebProcess/WebCoreSupport/efl/WebErrorsEfl.cpp:
1014         * WebProcess/WebCoreSupport/gtk/WebErrorsGtk.cpp:
1015         * WebProcess/efl/SeccompFiltersWebProcessEfl.cpp:
1016         * WebProcess/efl/SeccompFiltersWebProcessEfl.h:
1017         * WebProcess/efl/WebProcessMainEfl.cpp:
1018         * WebProcess/efl/WebProcessMainEfl.h:
1019         * WebProcess/gtk/WebGtkInjectedBundleMain.cpp:
1020         * WebProcess/gtk/WebProcessMainGtk.cpp:
1021         * WebProcess/gtk/WebProcessMainGtk.h:
1022         * mac/WKPreferences.h:
1023
1024 2014-05-15  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
1025
1026         [EFL][WK2] Skip failing unit tests
1027         https://bugs.webkit.org/show_bug.cgi?id=132979
1028
1029         Reviewed by Daniel Bates.
1030
1031         * PlatformEfl.cmake: Skip failing unit tests for now.
1032
1033 2014-05-15  Simon Fraser  <simon.fraser@apple.com>
1034
1035         [iOS WK2] When zoomed, fixed elements jump at the start of a scroll, and jump back at the end.
1036         https://bugs.webkit.org/show_bug.cgi?id=132978
1037         <rdar://problem/16894428>
1038
1039         Reviewed by Benjamin Poulain.
1040         
1041         Move the static function fixedPositionRectFromExposedRect() to a member function on
1042         WebPageProxy so we can call it from more places. Also never give WebCore a customFixedPosition
1043         rect that extends past the document bounds, but allow rubber-banding/pinching in the UI process to
1044         move fixed elements outside the document.
1045         
1046         * UIProcess/PageClient.h: Need to expose minimumZoomScale() and contentsSize() to WebPageProxy.
1047         * UIProcess/WebPageProxy.h:
1048         * UIProcess/ios/PageClientImplIOS.h:
1049         * UIProcess/ios/PageClientImplIOS.mm:
1050         (WebKit::PageClientImpl::minimumZoomScale):
1051         (WebKit::PageClientImpl::contentsSize):
1052         * UIProcess/ios/WKContentView.mm:
1053         (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:]):
1054         Pass the computeCustomFixedPositionRect(ConstrainedToDocumentRect) to WebCore, but use computeCustomFixedPositionRect()
1055         for the ScrollingCoordinator update.
1056         (adjustedUnexposedEdge): Deleted.
1057         (adjustedUnexposedMaxEdge): Deleted.
1058         (fixedPositionRectFromExposedRect): Deleted.
1059         * UIProcess/ios/WebPageProxyIOS.mm:
1060         (WebKit::adjustedUnexposedEdge):
1061         (WebKit::adjustedUnexposedMaxEdge):
1062         (WebKit::WebPageProxy::computeCustomFixedPositionRect):
1063         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
1064         (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree): This fixes some flashing when the scrolling tree
1065         was being updated while scrolling; we now pass the correct rect.
1066
1067 2014-05-15  Mark Rowe  <mrowe@apple.com>
1068
1069         <https://webkit.org/b/132976> Move discovery of sharing services off the main thread
1070
1071         Discovery of sharing services can require disk access and IPC. Since the interface to
1072         ServicesController is already asynchronous, we can easily perform the discovery on a
1073         background queue. This can eliminate tens to hundreds of milliseconds worth of work
1074         from the main thread when creating the first web process.
1075
1076         Reviewed by Brady Eidson.
1077
1078         * UIProcess/mac/ServicesController.h:
1079         * UIProcess/mac/ServicesController.mm:
1080         (WebKit::ServicesController::ServicesController):
1081         (WebKit::ServicesController::refreshExistingServices): Bail out early if we're already
1082         in the process of refreshing the services. Kick the discovery over to a background queue,
1083         with it hopping back to the main queue to update the actual state and notify any contexts
1084         that were interested.
1085
1086 2014-05-15  Dan Bernstein  <mitz@apple.com>
1087
1088         Fixed a typo in a comment and updated previous change log entry.
1089
1090         * WebProcess/WebPage/ios/WebPageIOS.mm:
1091         (WebKit::WebPage::elementDidFocus):
1092
1093 2014-05-15  Dan Bernstein  <mitz@apple.com>
1094
1095         <rdar://problem/16844952> [iOS] www.wikipedia.org is loading much slower due to FormClient::willBeginInputSession
1096         https://bugs.webkit.org/show_bug.cgi?id=132974
1097
1098         Reviewed by Enrica Casucci.
1099
1100         * WebProcess/WebPage/ios/WebPageIOS.mm:
1101         (WebKit::WebPage::elementDidFocus): Don’t call FormClient::willBeginInputSession if the
1102         focus isn’t user-initiated, because in that case the UI process will bail out of
1103         -_startAssistingNode:userIsInteracting:userObject: before creating an input session and
1104         calling the -_webView:didStartInputSession:.
1105
1106 2014-05-15  Benjamin Poulain  <bpoulain@apple.com>
1107
1108         [iOS][WK2] WKWebView sends invalid content offsets at the end of animated resize
1109         https://bugs.webkit.org/show_bug.cgi?id=132941
1110         <rdar://problem/16921557>
1111
1112         Reviewed by Tim Horton.
1113
1114         Since we cannot change the scale and content inset simultaneously while accounting for the obscured insets,
1115         we end up with invalid contentOffsets.
1116
1117         To work around the problem, change the content scale outside of UIScrollView to ensure none of the side effect
1118         happens.
1119
1120         * UIProcess/API/Cocoa/WKWebView.mm:
1121         (-[WKWebView _endAnimatedResize]):
1122
1123 2014-05-15  Tim Horton  <timothy_horton@apple.com>
1124
1125         WebKit2 View Gestures (Zoom): Document size changes during zoom gesture cause erratic scrolling
1126         https://bugs.webkit.org/show_bug.cgi?id=132944
1127         <rdar://problem/15769454>
1128
1129         Reviewed by Simon Fraser.
1130
1131         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
1132         (WebKit::TiledCoreAnimationDrawingArea::flushLayers):
1133         If a layer flush occurs and we have an active transient zoom,
1134         re-apply the transient zoom to the relevant platform layers, because
1135         WebCore might have overwritten the relevant layer properties.
1136
1137         (WebKit::TiledCoreAnimationDrawingArea::applyTransientZoomToPage):
1138         Reset m_transientZoomScale before flushLayers() so that we don't
1139         re-apply the transient zoom when we're actually trying to commit it.
1140
1141 2014-05-15  Alex Christensen  <achristensen@webkit.org>
1142
1143         Add pointer lock to features without enabling it.
1144         https://bugs.webkit.org/show_bug.cgi?id=132961
1145
1146         Reviewed by Sam Weinig.
1147
1148         * Configurations/FeatureDefines.xcconfig:
1149         Added ENABLE_POINTER_LOCK to list of features.
1150
1151 2014-05-15  Simon Fraser  <simon.fraser@apple.com>
1152
1153         [UI-side compositing] Fix copying animations between layers, and pausing them
1154         https://bugs.webkit.org/show_bug.cgi?id=132943
1155         <rdar://problem/16906369&16906541>
1156
1157         Reviewed by Tim Horton.
1158         
1159         Fix PlatformCAAnimationRemote to support animation copying, and to record
1160         the beginTime for implicitly started animations. This fixes animation pausing,
1161         and copying of animations between layers when they go between tiled and non-tiled.
1162         
1163         This requires sending the animation key back through animationDidStart() so that
1164         we can record this beginTime on the PlatformCAAnimationRemote in the web process.
1165         This path doesn't set the "hasExplicitBeginTime" flag.
1166         
1167         PlatformCAAnimationRemote also now stores a hash of active animations, so that
1168         it can implement animationForKey(), and record the beginTime.
1169
1170         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h:
1171         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
1172         (WebKit::RemoteLayerTreeDrawingAreaProxy::acceleratedAnimationDidStart):
1173         * UIProcess/mac/RemoteLayerTreeHost.h:
1174         * UIProcess/mac/RemoteLayerTreeHost.mm:
1175         (WebKit::RemoteLayerTreeHost::animationDidStart): Grovel for the key for this
1176         animation; sadly CA doesn't give us an easier way.
1177         * WebProcess/WebPage/DrawingArea.h:
1178         (WebKit::DrawingArea::acceleratedAnimationDidStart):
1179         * WebProcess/WebPage/DrawingArea.messages.in:
1180         * WebProcess/WebPage/mac/PlatformCAAnimationRemote.h:
1181         * WebProcess/WebPage/mac/PlatformCAAnimationRemote.mm:
1182         (-[WKAnimationDelegate animationDidStart:]):
1183         (WebKit::PlatformCAAnimationRemote::copy):
1184         (WebKit::PlatformCAAnimationRemote::copyTimingFunctionFrom):
1185         (WebKit::PlatformCAAnimationRemote::copyFromValueFrom):
1186         (WebKit::PlatformCAAnimationRemote::copyToValueFrom):
1187         (WebKit::PlatformCAAnimationRemote::copyValuesFrom):
1188         (WebKit::PlatformCAAnimationRemote::copyKeyTimesFrom):
1189         (WebKit::PlatformCAAnimationRemote::copyTimingFunctionsFrom):
1190         (WebKit::addAnimationToLayer):
1191         * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
1192         (WebKit::PlatformCALayerRemote::addAnimationForKey):
1193         (WebKit::PlatformCALayerRemote::removeAnimationForKey):
1194         (WebKit::PlatformCALayerRemote::animationForKey):
1195         (WebKit::PlatformCALayerRemote::animationStarted):
1196         * WebProcess/WebPage/mac/PlatformCALayerRemote.h:
1197         * WebProcess/WebPage/mac/RemoteLayerTreeContext.h:
1198         * WebProcess/WebPage/mac/RemoteLayerTreeContext.mm:
1199         (WebKit::RemoteLayerTreeContext::animationDidStart):
1200         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
1201         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
1202         (WebKit::RemoteLayerTreeDrawingArea::acceleratedAnimationDidStart):
1203
1204 2014-05-14  Simon Fraser  <simon.fraser@apple.com>
1205
1206         Clean up "has non-zero begin time" terminology in animations
1207         https://bugs.webkit.org/show_bug.cgi?id=132942
1208
1209         Reviewed by Tim Horton.
1210
1211         Change the "non-zero beginTime" terminology in the platform CA animations
1212         code to "explicit beginTime": this flag really means that we explicitly set
1213         the beginTime of the animation, rather than let CA set the beginTime when
1214         committing the animation. This flag is used for animations with negative
1215         delay, and when pausing.
1216
1217         * Shared/mac/RemoteLayerTreeTransaction.mm:
1218         (WebKit::RemoteLayerTreeTextStream::operator<<):
1219         * WebProcess/WebPage/mac/PlatformCAAnimationRemote.h:
1220         * WebProcess/WebPage/mac/PlatformCAAnimationRemote.mm:
1221         (-[WKAnimationDelegate animationDidStart:]):
1222         (WebKit::PlatformCAAnimationRemote::Properties::encode):
1223         (WebKit::PlatformCAAnimationRemote::Properties::decode):
1224         (WebKit::PlatformCAAnimationRemote::setBeginTime):
1225         (WebKit::addAnimationToLayer):
1226
1227 2014-05-15  Tim Horton  <timothy_horton@apple.com>
1228
1229         [iOS] Incremental updates during scroll-to-top shouldn’t count as “stable” updates
1230         https://bugs.webkit.org/show_bug.cgi?id=132934
1231
1232         Reviewed by Simon Fraser.
1233
1234         * UIProcess/API/Cocoa/WKWebView.mm:
1235         (-[WKWebView _updateVisibleContentRects]):
1236         If we're in a scroll-to-top programmatic scroll, the update is not stable.
1237         The last event comes in with _isScrollingToTop false, so we do our stable update.
1238
1239 2014-05-15  Carlos Garcia Campos  <cgarcia@igalia.com>
1240
1241         [GTK] Compile all installed resources as GResources
1242         https://bugs.webkit.org/show_bug.cgi?id=131099
1243
1244         Reviewed by Philippe Normand.
1245
1246         It avoids conflicts with old WebKit versions, and resources are
1247         always found even without installing or using environment variables.
1248
1249         * PlatformGTK.cmake: Add rules to write the xml file with the
1250         resources depending on the configure options and to generate and
1251         build the GResources file.
1252
1253 2014-05-14  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
1254
1255         [EFL][WK2] Fix an unit test of ewk_context_url_scheme_register()
1256         https://bugs.webkit.org/show_bug.cgi?id=132902
1257
1258         Reviewed by Anders Carlsson.
1259
1260         This test can be run when CUSTOM_PROTOCOL is enabled. Besides the test needs 
1261         to check if registered callback function works well.
1262
1263         * UIProcess/API/efl/tests/test_ewk2_context.cpp:
1264         (EWK2ContextTest::schemeRequestCallback):
1265         (TEST_F):
1266
1267 2014-05-14  Ryuan Choi  <ryuan.choi@samsung.com>
1268
1269         [EFL][WK2] Use default context for ewk_view_add
1270         https://bugs.webkit.org/show_bug.cgi?id=132936
1271
1272         Reviewed by Gyuyoung Kim.
1273
1274         Since r146265, ewk_view_add created new context and it's regression.
1275         This patch restores the behavior of ewk_view_add to original one.
1276
1277         * UIProcess/API/efl/ewk_view.cpp:
1278         (ewk_view_add):
1279         * UIProcess/API/efl/tests/test_ewk2_view.cpp:
1280         (TEST_F):
1281
1282 2014-05-14  Maciej Stachowiak  <mjs@apple.com>
1283
1284         Database Process crashes after loading html5test.com
1285         https://bugs.webkit.org/show_bug.cgi?id=132938
1286         <rdar://problem/16241419>
1287
1288         Reviewed by Ryosuke Niwa.
1289
1290         * DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.cpp:
1291         (WebKit::DatabaseProcessIDBConnection::disconnectedFromWebProcess): Expand comment
1292         about the null check.
1293         (WebKit::DatabaseProcessIDBConnection::deleteDatabase): Call disconnectedFromWebProcess
1294         to pick up its null check and to avoid duplicating code.
1295
1296 2014-05-14  Benjamin Poulain  <bpoulain@apple.com>
1297
1298         [iOS][WK2] The top/bottom edges should not be sticky when restoring the scroll position from the dynamic size update history
1299         https://bugs.webkit.org/show_bug.cgi?id=132931
1300
1301         Reviewed by Sam Weinig.
1302
1303         The goal of dynamicSizeUpdateHistory is to make dynamic resize completely reversible.
1304         Because of the stick-to-edges heuristics, this was not true near the top and bottom edges.
1305
1306         For example, start in landscape, scroll the page a bit, then rotate to portrait. Now you have
1307         a lot more vertical space, and the top edge of the document is at the edge of the scrollview.
1308         Rotate back to landscape: the position is restored  correct, but it is then overriden by
1309         the stick-to-edges branch.
1310
1311         When we restore the position from history, we should only put it back in the valid bounds, skipping
1312         stick-to-edges entirely.
1313
1314         * WebProcess/WebPage/ios/WebPageIOS.mm:
1315         (WebKit::WebPage::dynamicViewportSizeUpdate):
1316
1317 2014-05-14  Tim Horton  <timothy_horton@apple.com>
1318
1319         Enable IOSurface view snapshots for 10.9+
1320         https://bugs.webkit.org/show_bug.cgi?id=132932
1321         <rdar://problem/16900619>
1322
1323         Reviewed by Dean Jackson.
1324
1325         * UIProcess/mac/ViewSnapshotStore.h:
1326         r166005 unintentionally worked around <rdar://problem/16734031>.
1327         r168689 fixed another bug that caused sometimes randomly white snapshots.
1328         It's safe to turn on IOSurface view snapshots where purgeability is supported.
1329
1330 2014-05-14  Alexey Proskuryakov  <ap@apple.com>
1331
1332         Use the correct client in WebPageProxy::unwrapCryptoKey
1333         https://bugs.webkit.org/show_bug.cgi?id=132924
1334
1335         Reviewed by Darin Adler.
1336
1337         * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::unwrapCryptoKey): Match what
1338         we now do in wrapCryptoKey().
1339
1340 2014-05-14  Zalan Bujtas  <zalan@apple.com>
1341
1342         Subpixel layout: Change Element.offset* client* scroll* return type to double.
1343         https://bugs.webkit.org/show_bug.cgi?id=132895
1344
1345         Reviewed by Simon Fraser.
1346
1347         This patch changes Element.offset*, Element.client* and Element.scroll* APIs return
1348         type from long to double to match the latest CSSOM View Module spec[1].
1349         Element.offset* and Element.client* do return subpixel values from now on.
1350         Element.scroll* still return integral values as the scrolling code hasn't adopted to subpixel rendering yet.
1351
1352         subpixelCSSOMElementMetricsEnabled setting is added to be able to turn this feature on/off
1353         from WK2 preferences. It toggles the return value from subpixel to floored integral.
1354         It does not change layout/rendering behavior.
1355
1356         Reference list of what other browsers do:
1357         IE: http://blogs.msdn.com/b/ie/archive/2012/02/17/sub-pixel-rendering-and-the-css-object-model.aspx
1358         Blink: http://www.chromestatus.com/features/5497402177880064
1359         Firefox: https://bugzilla.mozilla.org/show_bug.cgi?id=825607
1360
1361         [1] http://www.w3.org/TR/2013/WD-cssom-view-20131217/
1362
1363         * Shared/WebPreferencesStore.h:
1364         * UIProcess/API/C/WKPreferences.cpp:
1365         (WKPreferencesSetSubpixelCSSOMElementMetricsEnabled):
1366         (WKPreferencesGetSubpixelCSSOMElementMetricsEnabled):
1367         * UIProcess/API/C/WKPreferencesRefPrivate.h:
1368         * WebProcess/WebPage/WebPage.cpp:
1369         (WebKit::WebPage::updatePreferences):
1370
1371 2014-05-14  Benjamin Poulain  <bpoulain@apple.com>
1372
1373         [iOS][WK2] Expose the viewport meta tag width on the UIProcess
1374         https://bugs.webkit.org/show_bug.cgi?id=132926
1375         <rdar://problem/16892115>
1376
1377         Reviewed by Sam Weinig.
1378
1379         Safari requires the viewport meta tag width for legacy stuff on WebApps. Just send it
1380         over to the UIProcess when it changes.
1381
1382         * UIProcess/API/Cocoa/WKWebView.mm:
1383         (-[WKWebView initWithFrame:configuration:]):
1384         (-[WKWebView _setViewportMetaTagWidth:]):
1385         (-[WKWebView _viewportMetaTagWidth]):
1386         * UIProcess/API/Cocoa/WKWebViewInternal.h:
1387         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1388         * UIProcess/PageClient.h:
1389         * UIProcess/WebPageProxy.h:
1390         * UIProcess/WebPageProxy.messages.in:
1391         * UIProcess/ios/PageClientImplIOS.h:
1392         * UIProcess/ios/PageClientImplIOS.mm:
1393         (WebKit::PageClientImpl::didChangeViewportMetaTagWidth):
1394         * UIProcess/ios/WebPageProxyIOS.mm:
1395         (WebKit::WebPageProxy::viewportMetaTagWidthDidChange):
1396         * WebProcess/WebPage/ios/WebPageIOS.mm:
1397         (WebKit::WebPage::viewportPropertiesDidChange):
1398
1399 2014-05-13  Simon Fraser  <simon.fraser@apple.com>
1400
1401         [iOS WK2] Make view debugging easier
1402         https://bugs.webkit.org/show_bug.cgi?id=132892
1403
1404         Reviewed by Tim Horton.
1405         
1406         Enhance -[WKCompositingView description] to show WebKit-related information
1407         which is useful when dumping a window's UIView hierarchy.
1408         
1409         Also have WKTransformView and WKRemoteView inherit from WKCompositingView,
1410         and thereby get the hitTest:withEvent: override for free, as well as better dumping.
1411
1412         * UIProcess/ios/RemoteLayerTreeHostIOS.mm:
1413         (-[WKCompositingView description]):
1414         (-[WKTransformView hitTest:withEvent:]): Deleted.
1415         (-[WKRemoteView hitTest:withEvent:]): Deleted.
1416
1417 2014-05-14  Benjamin Poulain  <bpoulain@apple.com>
1418
1419         [iOS][WK2] Fixed positioned element must relayout correctly before sending resize events to the page
1420         https://bugs.webkit.org/show_bug.cgi?id=132920
1421         <rdar://problem/16836866>
1422
1423         Reviewed by Simon Fraser.
1424
1425         During the dynamic resize operation, we do not update the fixed position elements because
1426         it is a very hard problem on the UI Process side.
1427
1428         When the animation finishes, the fixed positioned rect is recomputed on the UIProcess and pushed
1429         to the WebProcess.
1430
1431         The problem is sending the rect after the animation is too late, the content can observe the fixed
1432         elements layout through JavaScript and would get the old size.
1433
1434         This patch fixes the issue updating the CustomFixedPositionLayoutRect on the WebProcess before
1435         notifying the content of the resize.
1436         First, we layout the content to the new fixed layout size to get the new content size.
1437         Then, we compute the new FixedPositionedLayoutRect with FrameView's viewportConstrainedObjectsRect(),
1438         this use the real content size and our estimated unobscured content rect.
1439
1440         * WebProcess/WebPage/ios/WebPageIOS.mm:
1441         (WebKit::WebPage::dynamicViewportSizeUpdate):
1442
1443 2014-05-14  Enrica Casucci  <enrica@apple.com>
1444
1445         REGRESSION(WK2): Many pages have very wrong text size after rotating.
1446         https://bugs.webkit.org/show_bug.cgi?id=132893
1447         <rdar://problem/16806958>
1448
1449         Reviewed by Benjamin Poulain.
1450
1451         Whenever our viewport width changes we must reset text autosizing
1452         on the renderer.
1453
1454         * WebProcess/WebPage/WebPage.h:
1455         * WebProcess/WebPage/ios/WebPageIOS.mm:
1456         (WebKit::WebPage::setViewportConfigurationMinimumLayoutSize):
1457         (WebKit::WebPage::setMinimumLayoutSizeForMinimalUI):
1458         (WebKit::WebPage::resetTextAutosizingBeforeLayoutIfNeeded):
1459         (WebKit::WebPage::dynamicViewportSizeUpdate):
1460
1461 2014-05-14  Alex Christensen  <achristensen@webkit.org>
1462
1463         Use references instead of pointers with ResourceLoadTiming.
1464         https://bugs.webkit.org/show_bug.cgi?id=132846
1465
1466         Reviewed by Alexey Proskuryakov.
1467
1468         * Shared/WebCoreArgumentCoders.cpp:
1469         (IPC::ArgumentCoder<ResourceResponse>::encode):
1470         (IPC::ArgumentCoder<ResourceResponse>::decode):
1471         Use references instead of pointers and null checks.
1472
1473 2014-05-14  Tibor Meszaros  <tmeszaros.u-szeged@partner.samsung.com>
1474
1475         Remove CSS_STICKY_POSITION guards
1476         https://bugs.webkit.org/show_bug.cgi?id=132676
1477
1478         Reviewed by Simon Fraser.
1479
1480         * Configurations/FeatureDefines.xcconfig:
1481
1482 2014-05-13  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
1483
1484         [EFL][WK2] Add ewk_view_fixed_layout_size_set|get()
1485         https://bugs.webkit.org/show_bug.cgi?id=132811
1486
1487         Reviewed by Christophe Dumez.
1488
1489         Some EFL applications need to set size of fixed layout when enabling fixed layout.
1490         This APIs can pass ownership regarding the size of fixed layout to application side.
1491
1492         * UIProcess/API/efl/ewk_view.cpp:
1493         (ewk_view_layout_fixed_size_set):
1494         (ewk_view_layout_fixed_size_get):
1495         * UIProcess/API/efl/ewk_view.h:
1496         * UIProcess/API/efl/tests/test_ewk2_view.cpp:
1497         (TEST_F):
1498
1499 2014-05-13  Simon Fraser  <simon.fraser@apple.com>
1500
1501         Fix "ASSERTION FAILED: m_representation == PlatformLayerRepresentation" with UI-side compositing
1502         https://bugs.webkit.org/show_bug.cgi?id=132899
1503
1504         Reviewed by Beth Dakin.
1505         
1506         The new InsetClipLayer and ContentShadowLayer members on scrolling nodes
1507         need to be correctly encoded/decoded for UI-side compositing, and dumped
1508         correctly.
1509
1510         * Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp:
1511         (ArgumentCoder<ScrollingStateScrollingNode>::encode):
1512         (ArgumentCoder<ScrollingStateScrollingNode>::decode):
1513         (WebKit::RemoteScrollingTreeTextStream::dump):
1514         * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp:
1515         (WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers):
1516
1517 2014-05-13  Anders Carlsson  <andersca@apple.com>
1518
1519         Another build fix.
1520
1521         Reviewed by Dan Bernstein.
1522
1523         * Shared/API/Cocoa/WKFoundation.h:
1524         Make sure to include Availability.h
1525
1526 2014-05-13  Beth Dakin  <bdakin@apple.com>
1527
1528         REGRESSION (topContentInset): Searching through Facebook Messenger's chat causes 
1529         scrolling in News Feed
1530         https://bugs.webkit.org/show_bug.cgi?id=132889
1531         -and corresponding-
1532         <rdar://problem/16715716>
1533
1534         Reviewed by Simon Fraser.
1535
1536         Re-name scrollOffsetRelativeToDocument() to 
1537         documentScrollPositionRelativeToViewOrigin().
1538         * WebProcess/WebPage/FindController.cpp:
1539         (WebKit::FindController::rectsForTextMatches):
1540         * WebProcess/WebPage/WebPage.cpp:
1541         (WebKit::WebPage::determinePrimarySnapshottedPlugIn):
1542
1543 2014-05-13  Dean Jackson  <dino@apple.com>
1544
1545         [iOS] Page scale update messages for media controls should only fire at the end of zooming
1546         https://bugs.webkit.org/show_bug.cgi?id=132857
1547         <rdar://problem/16631009>
1548
1549         Reviewed by Simon Fraser.
1550
1551         As the user was zooming, the media controls that responded
1552         to the page scale (and resized themselves) would do so
1553         slightly out of sync with the screen refreshes, and it looked
1554         terrible.
1555
1556         We already know if a pageScale change is happening inside
1557         a gesture using the inStableState property of the visibleContentRectUpdateInfo.
1558         Simply pass this along to WebCore::Page.
1559
1560         * WebProcess/WebPage/ios/WebPageIOS.mm:
1561         (WebKit::WebPage::updateVisibleContentRects): Pass inStableState onto the
1562         WebCore::Page. Note that we have to send this message even if the
1563         scale has not changed, since the last changing update might not have
1564         been stable.
1565
1566 2014-05-13  Benjamin Poulain  <bpoulain@apple.com>
1567
1568         [iOS][WK2] When the secondary UIScrollView delegates respond to callbacks, delay the state change until both delegates have finished
1569         https://bugs.webkit.org/show_bug.cgi?id=132849
1570         <rdar://problem/16863716>
1571
1572         Reviewed by Anders Carlsson.
1573
1574         When there are two delegates responding to UIScrollView changes, there was often an intermediate invalid
1575         state forwarded to the UIProcess.
1576
1577         For example, on scroll, WKWebView would update the state based on the current obscured insets in response to
1578         delegate callbacks.
1579         After that update, Safari would modify the insets, thus updating the state again.
1580         The first state changed by WKWebView is incomplete, and should never have been set.
1581
1582         This patch works around the issue by delaying visible update rect in those cases.
1583
1584         When the two delegates of WKScrollView respond to the same selector, WKScrollView invokes 
1585         [UIWebView _willInvokeUIScrollViewDelegateCallback] on entry, and
1586         [UIWebView _didInvokeUIScrollViewDelegateCallback] on exit.
1587
1588         Between those two calls, WKWebView does not forward the new UI state to the WebProcess.
1589
1590         * UIProcess/API/Cocoa/WKWebView.mm:
1591         (-[WKWebView _willInvokeUIScrollViewDelegateCallback]):
1592         (-[WKWebView _didInvokeUIScrollViewDelegateCallback]):
1593         (-[WKWebView _updateVisibleContentRects]):
1594         * UIProcess/API/Cocoa/WKWebViewInternal.h:
1595         * UIProcess/API/ios/WKViewIOS.mm:
1596         (-[WKView _commonInitializationWithContextRef:pageGroupRef:relatedToPage:]):
1597         * UIProcess/ios/WKScrollView.h:
1598         * UIProcess/ios/WKScrollView.mm:
1599         (-[WKScrollViewDelegateForwarder initWithInternalDelegate:externalDelegate:]):
1600         (-[WKScrollViewDelegateForwarder forwardInvocation:]):
1601         (-[WKScrollView setInternalDelegate:]):
1602
1603 2014-05-13  Benjamin Poulain  <bpoulain@apple.com>
1604
1605         [iOS][WK2] Remove the _extendedBackgroundExclusionInsets SPI
1606         https://bugs.webkit.org/show_bug.cgi?id=132848
1607         <rdar://problem/16875093>
1608
1609         Reviewed by Darin Adler.
1610
1611         The SPI is no longer needed by Safari.
1612
1613         * UIProcess/API/Cocoa/WKWebView.mm:
1614         (-[WKWebView initWithFrame:configuration:]):
1615         (-[WKWebView _updateScrollViewBackground]):
1616         (-[WKWebView _frameOrBoundsChanged]):
1617         (-[WKWebView _setObscuredInsets:]):
1618         (-[WKWebView _endAnimatedResize]):
1619         (updateTopAndBottomExtendedBackgroundExclusionIfNecessary): Deleted.
1620         (-[WKWebView _setExtendedBackgroundExclusionInsets:]): Deleted.
1621         (-[WKWebView _extendedBackgroundExclusionInsets]): Deleted.
1622         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1623
1624 2014-05-13  Samuel White  <samuel_white@apple.com>
1625
1626         AX: Hit testing not accounting for top content inset.
1627         https://bugs.webkit.org/show_bug.cgi?id=132876
1628
1629         Reviewed by Chris Fleizach.
1630
1631         Updated accessibilityHitTest: to account for top content inset when converting from screen coords to WebKit coords.
1632
1633         * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm:
1634         (-[WKAccessibilityWebPageObject accessibilityHitTest:]):
1635
1636 2014-05-13  Enrica Casucci  <enrica@apple.com>
1637
1638         REGRESSION (WebKit2): Zooming to text field leaves it partially hidden by the form assistant.
1639         https://bugs.webkit.org/show_bug.cgi?id=132879
1640         <rdar://problem/16318049>
1641
1642         Reviewed by Benjamin Poulain.
1643
1644         Adds the heuristics to zoom and scroll to ensure the element being focused
1645         is fully visible and its text readable.
1646
1647         * Shared/AssistedNodeInformation.cpp:
1648         (WebKit::AssistedNodeInformation::encode):
1649         (WebKit::AssistedNodeInformation::decode):
1650         * Shared/AssistedNodeInformation.h:
1651         (WebKit::AssistedNodeInformation::AssistedNodeInformation):
1652         * UIProcess/API/Cocoa/WKWebView.mm:
1653         (-[WKWebView _zoomToFocusRect:WebCore::selectionRect:WebCore::fontSize:minimumScale:maximumScale:allowUserScaling:forceScroll:]):
1654         (-[WKWebView _keyboardChangedWithInfo:adjustScrollView:]):
1655         * UIProcess/API/Cocoa/WKWebViewInternal.h:
1656         * UIProcess/ios/WKContentView.h:
1657         * UIProcess/ios/WKContentView.mm:
1658         (-[WKContentView _zoomToFocusRect:selectionRect:fontSize:minimumScale:maximumScale:allowUserScaling:forceScroll:]):
1659         * UIProcess/ios/WKContentViewInteraction.mm:
1660         (-[WKContentView _displayFormNodeInputView]):
1661         (-[WKContentView _startAssistingNode:userIsInteracting:userObject:]):
1662         * WebProcess/WebPage/ios/WebPageIOS.mm:
1663         (WebKit::WebPage::getAssistedNodeInformation):
1664
1665 2014-05-13  Simon Fraser  <simon.fraser@apple.com>
1666
1667         Fix the iOS Simulator build.
1668
1669         * UIProcess/mac/ViewSnapshotStore.h:
1670
1671 2014-05-13  Tim Horton  <timothy_horton@apple.com>
1672
1673         Speculative build fix for iOS.
1674
1675         * UIProcess/ios/WebMemoryPressureHandlerIOS.cpp: Removed.
1676         * UIProcess/ios/WebMemoryPressureHandlerIOS.mm: Added.
1677         (WebKit::WebMemoryPressureHandler::shared):
1678         (WebKit::WebMemoryPressureHandler::WebMemoryPressureHandler):
1679         * WebKit2.xcodeproj/project.pbxproj:
1680         Make WebMemoryPressureHandlerIOS Obj-C.
1681
1682 2014-05-13  Anders Carlsson  <andersca@apple.com>
1683
1684         Another follow-up build fix.
1685
1686         * Shared/API/Cocoa/WKFoundation.h:
1687
1688 2014-05-13  Anders Carlsson  <andersca@apple.com>
1689
1690         Another follow-up build fix.
1691
1692         * Shared/API/Cocoa/WKFoundation.h:
1693
1694 2014-05-13  Anders Carlsson  <andersca@apple.com>
1695
1696         Follow-up fix.
1697
1698         * UIProcess/API/Cocoa/WKNavigationAction.mm:
1699         (-[WKNavigationAction _initWithNavigationActionData:WebKit::]):
1700         (-[WKNavigationAction _isUserInitiated]):
1701
1702 2014-05-13  Anders Carlsson  <andersca@apple.com>
1703
1704         Add -[WKNavigationAction modifierFlags] and -[WKNavigationAction buttonNumber]
1705         https://bugs.webkit.org/show_bug.cgi?id=132880
1706         <rdar://problem/16901354>
1707
1708         Reviewed by Dan Bernstein.
1709
1710         * Shared/API/Cocoa/WKFoundation.h:
1711         Add typedef for older systems.
1712
1713         * UIProcess/API/Cocoa/WKNavigationAction.h:
1714         Add -[WKNavigationAction modifierFlags] and -[WKNavigationAction buttonNumber]
1715
1716         * UIProcess/API/Cocoa/WKNavigationAction.mm:
1717         (toWKNavigationType):
1718         This can be static now.
1719
1720         (toNSEventModifierFlags):
1721         Helper to convert WebEvent::Modifiers to NSEventModifierFlags.
1722
1723         (toNSButtonNumber):
1724         Helper to convert WebMouseEvent::Button to an AppKit button number.
1725
1726         (-[WKNavigationAction initWithNavigationActionData:WebKit::]):
1727         New initializer that takes a NavigationActionData and fills in the relevant ivars from it.
1728
1729         (-[WKNavigationAction _isUserInitiated]):
1730         Return the new ivar.
1731
1732         * UIProcess/API/Cocoa/WKNavigationActionInternal.h:
1733         Remove readwrite overrides.
1734
1735         * UIProcess/Cocoa/NavigationState.mm:
1736         (WebKit::NavigationState::PolicyClient::decidePolicyForNavigationAction):
1737         Use initWithNavigationActionData:
1738
1739         * UIProcess/Cocoa/UIDelegate.mm:
1740         (WebKit::UIDelegate::UIClient::createNewPage):
1741         Use initWithNavigationActionData:
1742
1743 2014-05-13  Tim Horton  <timothy_horton@apple.com>
1744
1745         WebKit2 View Gestures (Swipe): Encode snapshots as JPEG on some platforms
1746         https://bugs.webkit.org/show_bug.cgi?id=127788
1747         <rdar://problem/15928241>
1748
1749         Reviewed by Anders Carlsson.
1750
1751         Allow JPEG snapshots. Compression is done asynchronously.
1752         Enable JPEG snapshots (for now) on all PLATFORM(MAC).
1753         We'll switch back to IOSurface snapshots on 10.9+ after <rdar://problem/16734031> is resolved.
1754
1755         * UIProcess/API/Cocoa/WKWebView.mm:
1756         * UIProcess/API/mac/WKView.mm:
1757         (-[WKView _takeViewSnapshot]):
1758         Store the image size on the ViewSnapshot.
1759         Move IOSurface-related code to ViewSnapshotStore.
1760
1761         * UIProcess/ios/ViewGestureControllerIOS.mm:
1762         (WebKit::ViewGestureController::beginSwipeGesture):
1763         Adopt asLayerContents().
1764
1765         * UIProcess/mac/ViewGestureController.h:
1766         * UIProcess/mac/ViewGestureControllerMac.mm:
1767         (WebKit::ViewGestureController::retrieveSnapshotForItem):
1768         (WebKit::ViewGestureController::beginSwipeGesture):
1769         (WebKit::ViewGestureController::removeSwipeSnapshot):
1770         Adopt asLayerContents().
1771         Put the snapshot on the right layer (the parent of the snapshot image layer);
1772         if it's on the snapshot image layer itself, if there is no image, the shadow
1773         is displayed on top of the white placeholder.
1774         Only reset snapshot purgeability if we're using IOSurface snapshots.
1775
1776         * UIProcess/mac/ViewSnapshotStore.h:
1777         Add a bunch of macros to allow us to switch the snapshot backing store implementation.
1778
1779         * UIProcess/mac/ViewSnapshotStore.mm:
1780         (WebKit::ViewSnapshotStore::ViewSnapshotStore):
1781         (WebKit::ViewSnapshotStore::~ViewSnapshotStore):
1782         (WebKit::ViewSnapshotStore::recordSnapshot):
1783         If takeViewSnapshot() fails, don't remove the existing snapshot.
1784
1785         (WebKit::createIOSurfaceFromImage):
1786         (WebKit::compressImageAsJPEG):
1787         (WebKit::ViewSnapshotStore::reduceSnapshotMemoryCost):
1788         (WebKit::ViewSnapshotStore::didCompressSnapshot):
1789         (WebKit::ViewSnapshot::clearImage):
1790         (WebKit::ViewSnapshot::asLayerContents):
1791         Asynchronously compress snapshots - if we're using JPEG snapshots - for a
1792         very large memory win (~20-30x).
1793
1794 2014-05-12  Darin Adler  <darin@apple.com>
1795
1796         Make a few icon database improvements
1797         https://bugs.webkit.org/show_bug.cgi?id=132812
1798
1799         Reviewed by Brady Eidson.
1800
1801         * UIProcess/API/C/WKIconDatabase.cpp:
1802         (WKIconDatabaseCopyIconDataForPageURL): Moved the actual implementation of this
1803         out of the bindings into the WebIconDatabase class.
1804
1805         * UIProcess/API/C/WKIconDatabase.h: Fixed argument names that were inconsistent.
1806
1807         * UIProcess/WebIconDatabase.cpp: Removed unneeded includes.
1808         (WebKit::WebIconDatabase::create): Pass a reference instead of a pointer.
1809         (WebKit::WebIconDatabase::WebIconDatabase): Take a reference instead of a pointer.
1810         (WebKit::WebIconDatabase::invalidate): Use nullptr.
1811         (WebKit::WebIconDatabase::setDatabasePath): Use make_unique.
1812         (WebKit::WebIconDatabase::setIconDataForIconURL): Removed unneeded local variable.
1813         (WebKit::WebIconDatabase::imageForPageURL): Use nullptr.
1814         (WebKit::WebIconDatabase::nativeImageForPageURL): Ditto.
1815         (WebKit::WebIconDatabase::didFinishURLImport): Use a modern for loop.
1816         (WebKit::WebIconDatabase::iconDataForPageURL): Added. Moved this here from
1817         WKIconDatabase.cpp, but also changed to use createWithoutCopying to avoid making
1818         another copy of the data for each icon.
1819
1820         * UIProcess/WebIconDatabase.h: Removed unneeded includes. Derive from
1821         IconDatabaseClient privately. Use nullptr. Added iconDataForPageURL member
1822         function. Use a reference for the constructor argument. Use override for
1823         virtual functions. Use unique_ptr instead of OwnPtr.
1824
1825 2014-05-12  Mark Lam  <mark.lam@apple.com>
1826
1827         WebKit2 on iOS needs to capture the main thread's floating point environment.
1828         <https://webkit.org/b/132755>
1829
1830         Reviewed by Geoffrey Garen.
1831
1832         * Shared/mac/ChildProcessMac.mm:
1833         (WebKit::ChildProcess::platformInitialize):
1834         - Call FloatingPointEnv::enableNeededFloatingPointModes() to initialize
1835           the ARMv7 FP env to support denormalized numbers.
1836         - Call FloatingPointEnv::saveMainThreadEnvironment() to capture the main thread
1837           fp env.
1838
1839 2014-05-12  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
1840
1841         [EFL][WK2] Fix ewk_view_navigation test in EWK2ViewTest 
1842         https://bugs.webkit.org/show_bug.cgi?id=132817
1843
1844         Reviewed by Dirk Schulze.
1845
1846         To load test html pages, call ewk_view_uri_set() instead of EWK2UnitTestServer.
1847         Besides this patch adds test html page for ewk_view_navigation unit test.
1848
1849         * UIProcess/API/efl/tests/resources/Page1.html: Added.
1850         * UIProcess/API/efl/tests/resources/Page2.html: Added.
1851         * UIProcess/API/efl/tests/resources/Page3.html: Added.
1852         * UIProcess/API/efl/tests/test_ewk2_view.cpp:
1853         (TEST_F):
1854
1855 2014-05-12  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
1856
1857         Unreviewed, EFL build fix since r168625.
1858
1859         * UIProcess/efl/WebContextEfl.cpp:
1860         (WebKit::WebContext::platformDefaultLocalStorageDirectory): Remove const keyword.
1861
1862 2014-05-12  Simon Fraser  <simon.fraser@apple.com>
1863
1864         [iOS WK2] Fuzzy tiles on some sites on loading
1865         https://bugs.webkit.org/show_bug.cgi?id=132847
1866         <rdar://problem/16816178>
1867
1868         Reviewed by Benjamin Poulain.
1869         
1870         PlatformCALayerRemoteTiledBacking overrode setContentsScale() but not contentsScale(),
1871         causing us to early-return from GraphicsLayerCA::updateContentsScale() and leave the
1872         scale wrong. Fix by overriding contentsScale() also.
1873
1874         * WebProcess/WebPage/mac/PlatformCALayerRemoteTiledBacking.cpp:
1875         (WebKit::PlatformCALayerRemoteTiledBacking::contentsScale):
1876         * WebProcess/WebPage/mac/PlatformCALayerRemoteTiledBacking.h:
1877
1878 2014-05-12  Tim Horton  <timothy_horton@apple.com>
1879
1880         Triple-buffer RemoteLayerBackingStore
1881         https://bugs.webkit.org/show_bug.cgi?id=132786
1882         <rdar://problem/16877498>
1883
1884         Reviewed by Simon Fraser.
1885
1886         We need three buffers because we're currently unable to synchronize
1887         with the render server to swap when they're not in use, so we were
1888         throwing surfaces away far too frequently.
1889
1890         This hugely reduces time spent in IOSurface::create on various repaint benchmarks.
1891
1892         * Shared/mac/RemoteLayerBackingStore.h:
1893         (WebKit::RemoteLayerBackingStore::hasFrontBuffer):
1894         (WebKit::RemoteLayerBackingStore::volatility): Deleted.
1895         * Shared/mac/RemoteLayerBackingStore.mm:
1896         (WebKit::RemoteLayerBackingStore::RemoteLayerBackingStore):
1897         (WebKit::RemoteLayerBackingStore::clearBackingStore):
1898         (WebKit::RemoteLayerBackingStore::encode):
1899         (WebKit::RemoteLayerBackingStore::decode):
1900         (WebKit::RemoteLayerBackingStore::swapToValidFrontBuffer):
1901         (WebKit::RemoteLayerBackingStore::display):
1902         (WebKit::RemoteLayerBackingStore::applyBackingStoreToLayer):
1903         (WebKit::RemoteLayerBackingStore::setBufferVolatility):
1904         (WebKit::RemoteLayerBackingStore::Buffer::discard):
1905         (WebKit::RemoteLayerBackingStore::setVolatility): Deleted.
1906         * Shared/mac/RemoteLayerBackingStoreCollection.mm:
1907         (WebKit::RemoteLayerBackingStoreCollection::purgeabilityTimerFired):
1908         Put the ShareableBitmap/IOSurface and a volatility bit in a Buffer struct.
1909         Also factor out "throw away this buffer and put it in the pool" into Buffer::discard().
1910         We keep a volatility bit because querying IOSurface purgeability is expensive,
1911         and we have a guarantee that any changes will happen in the Web process
1912         and go through this class (the lack of this guarantee in most cases is why I'm not
1913         putting this bit in WebCore::IOSurface itself).
1914
1915         Make it so that each buffer's volatility can be adjusted individually
1916         by setBufferVolatility(), and adopt in RemoteLayerBackingStoreCollection.
1917
1918         Add a third buffer, m_secondaryBackBuffer, which will swap with the back buffer
1919         before swapping front and back if the back buffer (soon to be the front buffer)
1920         is still in use by the render server. This means that we will almost never
1921         have to throw away a surface because it's in use (and conversely never need
1922         to make a new surface).
1923
1924         Adjust RemoteLayerBackingStoreCollection to make secondary back surfaces purgeable
1925         more aggressively than others.
1926
1927 2014-05-12  Alexey Proskuryakov  <ap@apple.com>
1928
1929         REGRESSION (r165972): Can't type into text fields in Flash
1930         https://bugs.webkit.org/show_bug.cgi?id=132840
1931         <rdar://problem/16671969>
1932
1933         Reviewed by Anders Carlsson.
1934
1935         * UIProcess/API/mac/WKView.mm: (-[WKView inputContext]): Restore a function that
1936         got accidentally lost when adding async text input code.
1937
1938 2014-05-12  Chris Fleizach  <cfleizach@apple.com>
1939
1940         AX: .js dialogs shown in unload while AX is running crash WebKit.
1941         https://bugs.webkit.org/show_bug.cgi?id=123828
1942
1943         Reviewed by Anders Carlsson.
1944
1945         Utilize platform API to inform AX clients when the WebProcess will suspend and resume.
1946         This allows us to avoid having special behavior for accessibility when the WebProcess needs
1947         to wait on a reply.
1948
1949         * Platform/IPC/Connection.cpp:
1950         (IPC::Connection::waitForSyncReply):
1951         * Platform/IPC/Connection.h:
1952         * Platform/IPC/mac/ConnectionMac.cpp:
1953         (IPC::Connection::willSendSyncMessage):
1954         (IPC::Connection::didReceiveSyncReply):
1955         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1956         (WebKit::WebChromeClient::runBeforeUnloadConfirmPanel):
1957         (WebKit::WebChromeClient::runJavaScriptAlert):
1958         (WebKit::WebChromeClient::runJavaScriptConfirm):
1959         (WebKit::WebChromeClient::runJavaScriptPrompt):
1960         (WebKit::WebChromeClient::print):
1961         (WebKit::WebChromeClient::exceededDatabaseQuota):
1962         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1963         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):
1964
1965 2014-05-12  Alex Christensen  <achristensen@webkit.org>
1966
1967         Progress on web timing.
1968         https://bugs.webkit.org/show_bug.cgi?id=132574
1969
1970         Reviewed by Alexey Proskuryakov.
1971
1972         * Shared/WebCoreArgumentCoders.cpp:
1973         (IPC::ArgumentCoder<ResourceResponse>::encode):
1974         (IPC::ArgumentCoder<ResourceResponse>::decode):
1975         Transfer ResourceLoadTiming values if they exist.
1976
1977 2014-05-12  Dan Bernstein  <mitz@apple.com>
1978
1979         [Cocoa] Expose WebPage::usesEphemeralSession to the bundle
1980         https://bugs.webkit.org/show_bug.cgi?id=132836
1981
1982         Reviewed by Anders Carlsson.
1983
1984         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
1985         (-[WKWebProcessPlugInBrowserContextController _usesNonPersistentWebsiteDataStore]):
1986         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextControllerPrivate.h:
1987
1988 2014-05-12  Carlos Alberto Lopez Perez  <clopez@igalia.com>
1989
1990         REGRESSION(168625): [GTK] build broken due to WKContextSetLocalStorageDirectory
1991         https://bugs.webkit.org/show_bug.cgi?id=132831
1992
1993         Unreviewed GTK build fix.
1994
1995         * UIProcess/gtk/WebContextGtk.cpp:
1996         (WebKit::WebContext::platformDefaultLocalStorageDirectory):
1997         This is now a static member function.
1998
1999 2014-05-12  Anders Carlsson  <andersca@apple.com>
2000
2001         WKWebViewConfiguration should fill in the blanks
2002         https://bugs.webkit.org/show_bug.cgi?id=132832
2003         <rdar://problem/16886408>
2004
2005         Reviewed by Dan Bernstein.
2006
2007         * UIProcess/API/Cocoa/WKWebView.mm:
2008         (-[WKWebView initWithFrame:configuration:]):
2009         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
2010         (-[WKWebViewConfiguration init]):
2011         (-[WKWebViewConfiguration _validate]):
2012         * UIProcess/API/Cocoa/WKWebViewConfigurationInternal.h:
2013
2014 2014-05-12  Anders Carlsson  <andersca@apple.com>
2015
2016         WKWebView should default to _backgroundExtendsBeyondPage = YES
2017         https://bugs.webkit.org/show_bug.cgi?id=132829
2018         <rdar://problem/16886364>
2019
2020         Reviewed by Beth Dakin.
2021
2022         * UIProcess/API/Cocoa/WKWebView.mm:
2023         (-[WKWebView initWithFrame:configuration:]):
2024
2025 2014-05-12  Anders Carlsson  <andersca@apple.com>
2026
2027         Pass local storage directory to StorageManager::create
2028         https://bugs.webkit.org/show_bug.cgi?id=132827
2029
2030         Reviewed by Tim Horton.
2031
2032         Since we know the local storage directory at creation time and we know it never changes,
2033         we can get rid of setLocalStorageDirectory and just pass the local storage directory at creation time.
2034
2035         * UIProcess/Storage/LocalStorageDatabaseTracker.cpp:
2036         (WebKit::LocalStorageDatabaseTracker::create):
2037         (WebKit::LocalStorageDatabaseTracker::LocalStorageDatabaseTracker):
2038         (WebKit::LocalStorageDatabaseTracker::~LocalStorageDatabaseTracker):
2039         (WebKit::LocalStorageDatabaseTracker::setLocalStorageDirectory): Deleted.
2040         (WebKit::LocalStorageDatabaseTracker::setLocalStorageDirectoryInternal): Deleted.
2041         * UIProcess/Storage/LocalStorageDatabaseTracker.h:
2042         * UIProcess/Storage/StorageManager.cpp:
2043         (WebKit::StorageManager::create):
2044         (WebKit::StorageManager::StorageManager):
2045         (WebKit::StorageManager::setLocalStorageDirectory): Deleted.
2046         * UIProcess/Storage/StorageManager.h:
2047         * UIProcess/WebContext.cpp:
2048         (WebKit::WebContext::WebContext):
2049
2050 2014-05-11  Anders Carlsson  <andersca@apple.com>
2051
2052         Replace WKContextSetLocalStorageDirectory with a context configuration getter/setter
2053         https://bugs.webkit.org/show_bug.cgi?id=132809
2054
2055         Reviewed by Dan Bernstein.
2056
2057         * UIProcess/API/C/WKContext.cpp:
2058         (WKContextSetLocalStorageDirectory): Deleted.
2059
2060         * UIProcess/API/C/WKContextConfigurationRef.cpp:
2061         (WKContextConfigurationCopyLocalStorageDirectory):
2062         (WKContextConfigurationSetLocalStorageDirectory):
2063         * UIProcess/API/C/WKContextConfigurationRef.h:
2064         Add getters and setters for the local storage directory.
2065
2066         * UIProcess/API/C/WKContextPrivate.h:
2067         Remove WKContextSetLocalStorageDirectory.
2068
2069         * UIProcess/API/Cocoa/WKProcessGroup.mm:
2070         (-[WKProcessGroup initWithInjectedBundleURL:]):
2071         Call WebContext::applyPlatformSpecificConfigurationDefaults.
2072
2073         * UIProcess/API/Cocoa/WKProcessPool.mm:
2074         (-[WKProcessPool _initWithConfiguration:]):
2075         Call WebContext::applyPlatformSpecificConfigurationDefaults (for now).
2076
2077         * UIProcess/APIContextConfiguration.cpp:
2078         (API::ContextConfiguration::webContextConfiguration):
2079         Set the local storage. Also, call WebContext::applyPlatformSpecificConfigurationDefaults.
2080
2081         * UIProcess/APIContextConfiguration.h:
2082         (API::ContextConfiguration::injectedBundlePath):
2083         This should be const.
2084
2085         (API::ContextConfiguration::localStorageDirectory):
2086         (API::ContextConfiguration::setLocalStorageDirectory):
2087         Add getter and setter.
2088
2089         * UIProcess/Storage/StorageManager.cpp:
2090         (WebKit::StorageManager::setLocalStorageDirectory):
2091         ASSERT that the path isn't null.
2092
2093         * UIProcess/WebContext.cpp:
2094         (WebKit::WebContext::applyPlatformSpecificConfigurationDefaults):
2095         New helper function that will fill in platform specific defaults for empty parameters.
2096
2097         (WebKit::WebContext::WebContext):
2098         Get the local storage directory from the configuration.
2099
2100         (WebKit::WebContext::setLocalStorageDirectory): Deleted.
2101         (WebKit::WebContext::localStorageDirectory): Deleted.
2102         These are no longer needed.
2103
2104         * UIProcess/mac/WebContextMac.mm:
2105         (WebKit::WebContext::platformDefaultLocalStorageDirectory):
2106         This should be a static member function.
2107
2108 2014-05-12  Martin Hodovan  <mhodovan.u-szeged@partner.samsung.com>
2109
2110         Typo fix in generate-forwarding-headers
2111         https://bugs.webkit.org/show_bug.cgi?id=132820
2112
2113         Reviewed by Anders Carlsson.
2114
2115         * Scripts/generate-forwarding-headers.pl:
2116         (collectFrameworkHeaderPaths):
2117         
2118 2014-05-12  Peter Molnar  <pmolnar.u-szeged@partner.samsung.com>
2119
2120         [EFL] TLSErrors do not cause page load to fail when not ignored
2121         https://bugs.webkit.org/show_bug.cgi?id=131104
2122
2123         Reviewed by Gyuyoung Kim.
2124
2125         Added EFL unit test for the bug https://bugs.webkit.org/show_bug.cgi?id=121548
2126
2127         * UIProcess/API/efl/tests/test_ewk2_ssl.cpp: Added new test: ewk_ssl_bad_cert_redirect_https_to_http
2128
2129 2014-05-11  Gordon Sheridan  <gordon_sheridan@apple.com>
2130
2131         Expose a function to copy favicon data without image conversion.
2132         https://bugs.webkit.org/show_bug.cgi?id=132805
2133
2134         Reviewed by Darin Adler.
2135
2136         * UIProcess/API/C/WKIconDatabase.cpp:
2137         (WKIconDatabaseCopyIconDataForPageURL):
2138         Add a function to copy the data from the image of a favicon for an associated page url.
2139
2140         * UIProcess/API/C/WKIconDatabase.h:
2141         Declare WKIconDatabaseCopyIconDataForPageURL.
2142
2143 2014-05-11  Seongjun Kim  <isAir@company100.com>
2144
2145         REGRESSION(r168603): [GTK] Build broken.
2146         https://bugs.webkit.org/show_bug.cgi?id=132810
2147
2148         Reviewed by Carlos Garcia Campos.
2149
2150         * UIProcess/API/gtk/WebKitWebContext.cpp:
2151         (createDefaultWebContext):
2152         Construct a WebContextConfiguration object and pass it to WebContext::create.
2153
2154 2014-05-11  Anders Carlsson  <andersca@apple.com>
2155
2156         Remove local storage directory and sandbox extension from WebProcessCreationParameters
2157         https://bugs.webkit.org/show_bug.cgi?id=132808
2158
2159         Reviewed by Beth Dakin.
2160
2161         * Shared/WebProcessCreationParameters.cpp:
2162         (WebKit::WebProcessCreationParameters::encode):
2163         (WebKit::WebProcessCreationParameters::decode):
2164         * Shared/WebProcessCreationParameters.h:
2165         * UIProcess/WebContext.cpp:
2166         (WebKit::WebContext::createNewWebProcess):
2167         * WebProcess/cocoa/WebProcessCocoa.mm:
2168         (WebKit::WebProcess::platformInitializeWebProcess):
2169
2170 2014-05-11  Jaehun Lim  <ljaehun.lim@samsung.com>
2171
2172         Unreviewed, CMake build fix after r168603
2173
2174         Add APIContextConfiguration.cpp and WKContextConfigurationRef.cpp to the source list.
2175
2176         * CMakeLists.txt:
2177
2178 2014-05-11  Anders Carlsson  <andersca@apple.com>
2179
2180         Add a WKContextConfigurationRef object and make the injected bundle path part of the configuration
2181         https://bugs.webkit.org/show_bug.cgi?id=132806
2182         <rdar://problem/16830143>
2183
2184         Reviewed by Beth Dakin.
2185
2186         Many setters on WKContextRef really only make sense to set early on, so move to a pattern where we create a
2187         configuration object, a WKContextConfiguration which WKContexts can be created from. Add the injected bundle path
2188         as a configuration property. More setters will follow.
2189
2190         * Shared/API/c/WKBase.h:
2191         Add WKContextConfigurationRef.
2192
2193         * Shared/APIObject.h:
2194         Add ContextConfiguration enum declaration.
2195
2196         * UIProcess/API/C/WKAPICast.h:
2197         Handle WKContextConfigurationRef.
2198
2199         * UIProcess/API/C/WKContext.cpp:
2200         (WKContextCreate):
2201         Create an empty WKContextConfigurationRef object and pass it to WKContextCreateWithConfiguration.
2202
2203         (WKContextCreateWithInjectedBundlePath):
2204         Create a WKContextConfigurationRef object, set its bundle path and pass the configuration to WKContextCreateWithConfiguration.
2205
2206         (WKContextCreateWithConfiguration):
2207         Convert the WKContextConfigurationRef object to a WebContextConfiguration and pass it to WebContext::create.
2208
2209         * UIProcess/API/C/WKContext.h:
2210         Add WKContextCreateWithConfiguration.
2211
2212         * UIProcess/API/C/WKContextConfigurationRef.cpp: Added.
2213         (WKContextConfigurationCreate):
2214         Create an API::ContextConfiguration object.
2215
2216         (WKContextConfigurationCopyInjectedBundlePath):
2217         Return the injected bundle path.
2218
2219         (WKContextConfigurationSetInjectedBundlePath):
2220         Set the injected bundle path.
2221
2222         * UIProcess/API/C/WKContextConfigurationRef.h: Added.
2223         New C SPI header.
2224         
2225         * UIProcess/API/Cocoa/WKProcessGroup.mm:
2226         (-[WKProcessGroup initWithInjectedBundleURL:]):
2227         Construct a WebContextConfiguration object and pass it to WebContext::Create.
2228     
2229         * UIProcess/API/Cocoa/WKProcessPool.mm:
2230         (-[WKProcessPool _initWithConfiguration:]):
2231         Construct a WebContextConfiguration object and pass it to WebContext::Create.
2232
2233         * UIProcess/APIContextConfiguration.cpp: Added.
2234         New API::ContextConfiguration object.
2235
2236         (API::ContextConfiguration::webContextConfiguration):
2237         Construct a WebContextConfiguration struct from our current configuration.
2238
2239         * UIProcess/APIContextConfiguration.h: Added.
2240         
2241         * UIProcess/WebContext.cpp:
2242         (WebKit::WebContext::create):
2243         Pass the WebContextConfiguration to the constructor.
2244
2245         (WebKit::WebContext::WebContext):
2246         Set the injected bundle path from the WebContextConfiguration object.
2247
2248         * UIProcess/WebContext.h:
2249         Change the WebContext constructor and create function to take a WebContextConfiguration object.
2250
2251         * WebKit2.xcodeproj/project.pbxproj:
2252         Add new files.
2253
2254 2014-05-10  Csaba Osztrogonác  <ossy@webkit.org>
2255
2256         [WK2] URTBF after r168585.
2257
2258         * Platform/IPC/Connection.h:
2259         * Shared/ChildProcessProxy.cpp:
2260         (WebKit::ChildProcessProxy::terminate):
2261
2262 2014-05-10  Tim Horton  <timothy_horton@apple.com>
2263
2264         [WKWebView _updateScrollViewBackground] churns UI-and-CGColors while repainting
2265         https://bugs.webkit.org/show_bug.cgi?id=132793
2266         <rdar://problem/16877870>
2267
2268         Reviewed by Dan Bernstein.
2269
2270         * UIProcess/API/Cocoa/WKWebView.mm:
2271         (-[WKWebView _updateScrollViewBackground]):
2272         Don't bypass the cache and make a copy of the CGColor just to set its alpha.
2273         Cache the last color and don't bother creating a UIColor nor updating the
2274         color on our views if it hasn't changed.
2275
2276 2014-05-10  Tim Horton  <timothy_horton@apple.com>
2277
2278         Implement -forwardingTargetForSelector on WKScrollViewDelegateForwarder
2279         https://bugs.webkit.org/show_bug.cgi?id=132790
2280         <rdar://problem/16877802>
2281
2282         Reviewed by Dan Bernstein.
2283
2284         * UIProcess/ios/WKScrollView.mm:
2285         (-[WKScrollViewDelegateForwarder forwardingTargetForSelector:]):
2286         If only one of the delegates will respond to a selector,
2287         we can return it from forwardingTargetForSelector: to avoid
2288         NSInvocation overhead.
2289
2290 2014-05-10  Dan Bernstein  <mitz@apple.com>
2291
2292         [Mac] Some targets that link or soft-link WebKit.framework don't depend on it
2293         https://bugs.webkit.org/show_bug.cgi?id=132776
2294
2295         Reviewed by Darin Adler.
2296
2297         * WebKit2.xcodeproj/project.pbxproj:
2298
2299 2014-05-10  Ryuan Choi  <ryuan.choi@samsung.com>
2300
2301         [EFL][WK2] Move the ownership of EwkSettings from EwkView to EwkPageGroup
2302         https://bugs.webkit.org/show_bug.cgi?id=132771
2303
2304         Reviewed by Gyuyoung Kim.
2305
2306         Moved ownership of EwkSettings from EwkView to EwkPageGroup.
2307
2308         * UIProcess/API/efl/EwkView.cpp:
2309         (EwkView::EwkView):
2310         * UIProcess/API/efl/EwkView.h:
2311         (EwkView::settings): Deleted.
2312         * UIProcess/API/efl/ewk_page_group.cpp:
2313         (EwkPageGroup::EwkPageGroup):
2314         * UIProcess/API/efl/ewk_page_group_private.h:
2315         (EwkPageGroup::settings):
2316         * UIProcess/API/efl/ewk_settings_private.h:
2317         * UIProcess/API/efl/ewk_view.cpp:
2318         (ewk_view_settings_get):
2319
2320 2014-05-10  Tim Horton  <timothy_horton@apple.com>
2321
2322         [iOS WebKit2] REGRESSION (r168493): Canvasmark 2013 benchmark always hits the RELEASE_ASSERT in RemoteLayerTreeDrawingArea::flushLayers()
2323         https://bugs.webkit.org/show_bug.cgi?id=132783
2324         <rdar://problem/16877326>
2325
2326         Reviewed by Anders Carlsson.
2327
2328         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
2329         (WebKit::RemoteLayerTreeDrawingArea::BackingStoreFlusher::flush):
2330         There's a race window between the BackingStoreFlusher sending the new
2331         layer tree to the UI process and updating m_hasFlushed where we can
2332         get a reply back in (on the Web process main thread) from the UI process
2333         that we committed the new layer tree (didUpdate).
2334         This will cause the RELEASE_ASSERT in flushLayers() to fire incorrectly.
2335         Since the RELEASE_ASSERT is there only to avoid painting garbage, move
2336         our code to set m_hasFlushed=true to after we finish calling CGContextFlush
2337         on all of the contexts, instead of after we send the layer tree commit message,
2338         which will remove the race entirely.
2339
2340 2014-05-10  Anders Carlsson  <andersca@apple.com>
2341
2342         ASSERTION FAILED: !m_connection under RunJavaScriptAlert
2343         https://bugs.webkit.org/show_bug.cgi?id=132792
2344         <rdar://problem/16691138>
2345
2346         Reviewed by Dan Bernstein.
2347
2348         Detect if someone implementing a UI delegate method with a completion handler never calls the completion
2349         handler and raise an exception instead of asserting.
2350
2351         * UIProcess/Cocoa/UIDelegate.mm:
2352         (WebKit::CompletionHandlerCallChecker::create):
2353         (WebKit::CompletionHandlerCallChecker::~CompletionHandlerCallChecker):
2354         (WebKit::CompletionHandlerCallChecker::didCallCompletionHandler):
2355         (WebKit::CompletionHandlerCallChecker::CompletionHandlerCallChecker):
2356         (WebKit::CompletionHandlerCallChecker::classImplementingDelegateMethod):
2357         (WebKit::UIDelegate::UIClient::runJavaScriptAlert):
2358         (WebKit::UIDelegate::UIClient::runJavaScriptConfirm):
2359         (WebKit::UIDelegate::UIClient::runJavaScriptPrompt):
2360
2361 2014-05-10  Anders Carlsson  <andersca@apple.com>
2362
2363         Use xpc_connection_kill for killing child processes where appropriate
2364         https://bugs.webkit.org/show_bug.cgi?id=132788
2365         <rdar://problem/16664185>
2366
2367         Reviewed by Sam Weinig.
2368
2369         * Platform/IPC/Connection.h:
2370         * Platform/IPC/mac/ConnectionMac.mm:
2371         (IPC::Connection::kill):
2372         * Platform/IPC/mac/XPCPtr.h:
2373         (IPC::XPCPtr::operator bool):
2374         * Shared/ChildProcessProxy.cpp:
2375         (WebKit::ChildProcessProxy::terminate):
2376
2377 2014-05-10  Anders Carlsson  <andersca@apple.com>
2378
2379         WebKit2 is leaking an xpc_connection per web process it creates
2380         https://bugs.webkit.org/show_bug.cgi?id=132785
2381         <rdar://problem/14912160>
2382
2383         Reviewed by Sam Weinig.
2384
2385         Introduce an IPC::XPCPtr smart pointer class and use it for XPC connections inside Connection::Identifier and Connection itself.
2386
2387         Make sure we always adopt any connections that are created.
2388
2389         * DatabaseProcess/EntryPoint/mac/XPCService/DatabaseServiceEntryPoint.mm:
2390         (DatabaseServiceInitializer):
2391         * NetworkProcess/EntryPoint/mac/XPCService/NetworkServiceEntryPoint.mm:
2392         (WebKit::NetworkServiceInitializerDelegate::NetworkServiceInitializerDelegate):
2393         (NetworkServiceInitializer):
2394         * Platform/IPC/Connection.h:
2395         (IPC::Connection::Identifier::Identifier):
2396         (IPC::Connection::xpcConnection):
2397         * Platform/IPC/mac/ConnectionMac.mm:
2398         (IPC::Connection::platformInvalidate):
2399         (IPC::Connection::platformInitialize):
2400         (IPC::Connection::getAuditToken):
2401         * Platform/IPC/mac/XPCPtr.h: Added.
2402         (IPC::XPCPtr::XPCPtr):
2403         (IPC::XPCPtr::~XPCPtr):
2404         (IPC::XPCPtr::get):
2405         (IPC::XPCPtr::operator!):
2406         (IPC::XPCPtr::operator=):
2407         (IPC::adoptXPC):
2408         * PluginProcess/EntryPoint/mac/XPCService/PluginServiceEntryPoint.mm:
2409         (WebKit::PluginServiceInitializerDelegate::PluginServiceInitializerDelegate):
2410         (PluginServiceInitializer):
2411         * Shared/EntryPointUtilities/mac/LegacyProcess/ChildProcessMain.mm:
2412         (WebKit::BootstrapMain):
2413         * Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.h:
2414         (WebKit::XPCServiceInitializerDelegate::XPCServiceInitializerDelegate):
2415         (WebKit::XPCServiceInitializer):
2416         * Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.mm:
2417         (WebKit::XPCServiceInitializerDelegate::hasEntitlement):
2418         (WebKit::XPCServiceInitializerDelegate::isClientSandboxed):
2419         * Shared/EntryPointUtilities/mac/XPCService/XPCServiceMain.Development.mm:
2420         (WebKit::XPCServiceEventHandler):
2421         * Shared/EntryPointUtilities/mac/XPCService/XPCServiceMain.mm:
2422         (WebKit::XPCServiceEventHandler):
2423         * UIProcess/Launcher/ProcessLauncher.cpp:
2424         (WebKit::ProcessLauncher::didFinishLaunchingProcess):
2425         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
2426         (WebKit::connectToService):
2427         * WebKit2.xcodeproj/project.pbxproj:
2428         * WebProcess/EntryPoint/mac/XPCService/WebContentServiceEntryPoint.mm:
2429         (WebContentServiceInitializer):
2430
2431 2014-05-10  Anders Carlsson  <andersca@apple.com>
2432
2433         Simplify createDataAvailableSource
2434         https://bugs.webkit.org/show_bug.cgi?id=132782
2435         <rdar://problem/16815202>
2436
2437         Reviewed by Sam Weinig.
2438
2439         * Platform/IPC/mac/ConnectionMac.mm: Renamed from Source/WebKit2/Platform/IPC/mac/ConnectionMac.cpp.
2440         Rename to make this Objective-C++ so we get the lambda-to-block conversion.
2441
2442         (IPC::createDataAvailableSource):
2443         Make this a function template and just pass the function directly to dispatch_source_set_event_handler.
2444
2445         (IPC::Connection::open):
2446         Use lambdas instead of WTF::bind, so we'll make sure the connection is kept alive.
2447
2448         * WebKit2.xcodeproj/project.pbxproj:
2449         Update for ConnectionMac.cpp to ConnectionMac.mm rename.
2450
2451 2014-05-10  Anders Carlsson  <andersca@apple.com>
2452
2453         Follow-up fix.
2454
2455         Reviewed by Darin Adler.
2456
2457         * UIProcess/API/Cocoa/WKNavigationResponse.h:
2458         * UIProcess/API/Cocoa/WKNavigationResponse.mm:
2459         (-[WKNavigationResponse isForMainFrame]):
2460         Use a slightly better name.
2461
2462 2014-05-10  Anders Carlsson  <andersca@apple.com>
2463
2464         Make -[WKNavigationResponse frame] SPI and only expose -[WKNavigationResponse isMainFrame]
2465         https://bugs.webkit.org/show_bug.cgi?id=132781
2466         <rdar://problem/16868319>
2467
2468         Reviewed by Darin Adler.
2469
2470         * UIProcess/API/Cocoa/WKNavigationResponse.h:
2471         * UIProcess/API/Cocoa/WKNavigationResponse.mm:
2472         (-[WKNavigationResponse description]):
2473         (-[WKNavigationResponse isMainFrameNavigation]):
2474         (-[WKNavigationResponse _frame]):
2475         (-[WKNavigationResponse frame]): Deleted.
2476         (-[WKNavigationResponse setFrame:]): Deleted.
2477         * UIProcess/API/Cocoa/WKNavigationResponseInternal.h:
2478         * UIProcess/API/Cocoa/WKNavigationResponsePrivate.h: Added.
2479         * UIProcess/Cocoa/NavigationState.mm:
2480         (WebKit::NavigationState::PolicyClient::decidePolicyForResponse):
2481         * WebKit2.xcodeproj/project.pbxproj:
2482
2483 2014-05-09  Dan Bernstein  <mitz@apple.com>
2484
2485         [Cocoa] Remove a deprecated bundle form delegate method now that no one implements it
2486         https://bugs.webkit.org/show_bug.cgi?id=132769
2487
2488         Reviewed by Sam Weinig.
2489
2490         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
2491         (-[WKWebProcessPlugInBrowserContextController _setFormDelegate:]):
2492
2493 2014-05-09  Benjamin Poulain  <bpoulain@apple.com>
2494
2495         [iOS][WK2] Fix bugs exposed by r168556
2496         https://bugs.webkit.org/show_bug.cgi?id=132768
2497
2498         Reviewed by Ryosuke Niwa.
2499
2500         Fix two bugs exposed by r168556.
2501         1) We were only changing the page scale factor when the scale was not adjusted by live
2502            resize. The idea was that the scale would either be the same (responsive content)
2503            or that it would be defined by the next viewContentRectUpdate.
2504
2505            Now that we also send resize and scroll events, we must always update the scale since
2506            it affects some APIs observable from JavaScript (like scrolling bounds).
2507
2508         2) Internally, Page's scaleFactor is stored as a float and not double. The rounding error
2509            were causing us to send DynamicViewportUpdateChangedTarget() in cases were there is no change
2510            of target.
2511
2512         * WebProcess/WebPage/ios/WebPageIOS.mm:
2513         (WebKit::withinEpsilon):
2514         (WebKit::WebPage::dynamicViewportSizeUpdate):
2515
2516 2014-05-09  Ryuan Choi  <ryuan.choi@samsung.com>
2517
2518         [EFL][WK2] Close icondatabase when EwkFaviconDatabase is destroyed
2519         https://bugs.webkit.org/show_bug.cgi?id=132767
2520
2521         Reviewed by Gyuyoung Kim.
2522
2523         IconDatabase should be closed explicitly.
2524
2525         * UIProcess/API/efl/ewk_favicon_database.cpp:
2526         (EwkFaviconDatabase::~EwkFaviconDatabase):
2527
2528 2014-05-09  Anders Carlsson  <andersca@apple.com>
2529
2530         Another build fix.
2531
2532         * mac/MigrateHeadersToWebKit2.make:
2533         Don't migrate the WKPreferences.h header, WebKit2 provides its own header.
2534
2535 2014-05-09  Benjamin Poulain  <benjamin@webkit.org>
2536
2537         [iOS][WK2] Reset the scroll position on the first frame after didCommitLoad
2538         https://bugs.webkit.org/show_bug.cgi?id=132765
2539
2540         Reviewed by Tim Horton.
2541
2542         Since WebCore does not update our scroll view on load, we need to do that ourself.
2543
2544         In case where we need to restore the state from the history, RemoteLayerTreeDrawingAreaProxy
2545         will always invoke the scrolling after didCommitLayerTree() (since r167916).
2546         Consequently, it is now safe again to reset the scroll position ourself on the first frame.
2547
2548         * UIProcess/API/Cocoa/WKWebView.mm:
2549         (-[WKWebView _didCommitLoadForMainFrame]):
2550         (-[WKWebView _didCommitLayerTree:WebKit::]):
2551         * UIProcess/API/Cocoa/WKWebViewInternal.h:
2552         * UIProcess/ios/WKContentView.mm:
2553         (-[WKContentView _didCommitLoadForMainFrame]):
2554
2555 2014-05-09  Anders Carlsson  <andersca@apple.com>
2556
2557         Update availability macros
2558         https://bugs.webkit.org/show_bug.cgi?id=132763
2559         <rdar://problem/15311800>
2560
2561         Reviewed by Dan Bernstein.
2562
2563         * Configurations/WebKit.xcconfig:
2564         * Shared/API/Cocoa/WKBrowsingContextHandle.h:
2565         * Shared/API/Cocoa/WKFoundation.h:
2566         * Shared/API/Cocoa/_WKFrameHandle.h:
2567         * Shared/API/Cocoa/_WKRemoteObjectInterface.h:
2568         * Shared/API/Cocoa/_WKRemoteObjectRegistry.h:
2569         * UIProcess/API/Cocoa/WKBackForwardList.h:
2570         * UIProcess/API/Cocoa/WKBackForwardListItem.h:
2571         * UIProcess/API/Cocoa/WKBackForwardListPrivate.h:
2572         * UIProcess/API/Cocoa/WKBrowsingContextController.h:
2573         * UIProcess/API/Cocoa/WKBrowsingContextGroup.h:
2574         * UIProcess/API/Cocoa/WKConnection.h:
2575         * UIProcess/API/Cocoa/WKFrameInfo.h:
2576         * UIProcess/API/Cocoa/WKNavigation.h:
2577         * UIProcess/API/Cocoa/WKNavigationAction.h:
2578         (NS_ENUM):
2579         * UIProcess/API/Cocoa/WKNavigationData.h:
2580         * UIProcess/API/Cocoa/WKNavigationDelegate.h:
2581         (NS_ENUM):
2582         * UIProcess/API/Cocoa/WKNavigationResponse.h:
2583         * UIProcess/API/Cocoa/WKPreferences.h:
2584         * UIProcess/API/Cocoa/WKProcessGroup.h:
2585         * UIProcess/API/Cocoa/WKProcessPool.h:
2586         * UIProcess/API/Cocoa/WKScriptMessage.h:
2587         * UIProcess/API/Cocoa/WKScriptMessageHandler.h:
2588         * UIProcess/API/Cocoa/WKTypeRefWrapper.h:
2589         * UIProcess/API/Cocoa/WKUIDelegate.h:
2590         * UIProcess/API/Cocoa/WKUserContentController.h:
2591         * UIProcess/API/Cocoa/WKWebView.h:
2592         * UIProcess/API/Cocoa/WKWebViewConfiguration.h:
2593         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2594         (NS_OPTIONS):
2595         (NS_ENUM):
2596         * UIProcess/API/Cocoa/WKWindowFeatures.h:
2597         * UIProcess/API/Cocoa/_WKActivatedElementInfo.h:
2598         (NS_ENUM):
2599         * UIProcess/API/Cocoa/_WKDownload.h:
2600         * UIProcess/API/Cocoa/_WKElementAction.h:
2601         (NS_ENUM):
2602         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
2603         * UIProcess/API/Cocoa/_WKScriptWorld.h:
2604         * UIProcess/API/Cocoa/_WKThumbnailView.h:
2605         * UIProcess/API/Cocoa/_WKVisitedLinkProvider.h:
2606         * UIProcess/API/Cocoa/_WKWebsiteDataStore.h:
2607         * WebKit2.xcodeproj/project.pbxproj:
2608         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFrame.h:
2609         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInHitTestResult.h:
2610         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.h:
2611         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInPageGroup.h:
2612         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInScriptWorld.h:
2613         * WebProcess/InjectedBundle/API/mac/WKDOMDocument.h:
2614         * WebProcess/InjectedBundle/API/mac/WKDOMElement.h:
2615         * WebProcess/InjectedBundle/API/mac/WKDOMNode.h:
2616         * WebProcess/InjectedBundle/API/mac/WKDOMRange.h:
2617         * WebProcess/InjectedBundle/API/mac/WKDOMText.h:
2618         * WebProcess/InjectedBundle/API/mac/WKDOMTextIterator.h:
2619         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugIn.h:
2620         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.h:
2621         * mac/rewrite-availability-macros.sh: Added.
2622
2623 2014-05-09  Joseph Pecoraro  <pecoraro@apple.com>
2624
2625         Web Inspector: Allow Remote Inspector to entitlement check UIProcess through WebProcess
2626         https://bugs.webkit.org/show_bug.cgi?id=132409
2627
2628         Reviewed by Timothy Hatcher.
2629
2630         * WebProcess/WebCoreSupport/WebInspectorClient.h:
2631         * WebProcess/WebCoreSupport/WebInspectorClient.cpp:
2632         (WebKit::WebInspectorClient::parentProcessIdentifier): Deleted.
2633         pid per debuggable is no longer needed.
2634
2635         * WebProcess/WebProcess.cpp:
2636         (WebKit::WebProcess::initializeWebProcess):
2637         Immediately pass the parent process pid and audit_token on
2638         to the RemoteInspector singleton when the process is created
2639         so that it can be sent to webinspectord.
2640
2641 2014-05-09  Enrica Casucci  <enrica@apple.com>
2642
2643         REGRESSION (WebKit2): Tapping in search field at wikipedia.org doesn’t bring up the keyboard.
2644         https://bugs.webkit.org/show_bug.cgi?id=132761
2645         <rdar://problem/16857491>
2646
2647         Reviewed by Benjamin Poulain.
2648
2649         The interactionAssistant accessor should never create an instance of
2650         UIWKTextInteractionAssistant, but simply return the value of _textInteractionAssistant.
2651         The text interaction assistant should only be created when needed so that the rest of
2652         the code could reliably check if we are interacting with text or not.
2653
2654         * UIProcess/ios/WKContentViewInteraction.mm:
2655         (-[WKContentView interactionAssistant]):
2656
2657 2014-05-09  Simon Fraser  <simon.fraser@apple.com>
2658
2659         Fix some issues with scrolling tree logging
2660         https://bugs.webkit.org/show_bug.cgi?id=132762
2661
2662         Reviewed by Tim Horton.
2663         
2664         Only dump viewport constraints when they change, and dump the primary layer on
2665         scrolling nodes.
2666         
2667         * Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp:
2668         (WebKit::RemoteScrollingTreeTextStream::dump): Dump the primary layer.
2669
2670 2014-05-09  Simon Fraser  <simon.fraser@apple.com>
2671
2672         [iOS WK2] Fixed elements can go outside the document on pinching
2673         https://bugs.webkit.org/show_bug.cgi?id=132759
2674         <rdar://problem/16870835>
2675
2676         Reviewed by Benjamin Poulain.
2677         
2678         Constrain the rect used to position fixed position objects when pinching (when
2679         the scale goes below the minimumScale). Do so in such a way that there's a smooth
2680         transition between rubber-banding and pinching.
2681
2682         * UIProcess/API/Cocoa/WKWebView.mm:
2683         (-[WKWebView _updateScrollViewBackground]): Use a nicer form for std::max<>.
2684         (-[WKWebView _updateVisibleContentRects]): Pass the minimum scale.
2685         * UIProcess/API/ios/WKViewIOS.mm:
2686         (-[WKView _updateVisibleContentRects]): Ditto.
2687         * UIProcess/ios/WKContentView.h:
2688         * UIProcess/ios/WKContentView.mm:
2689         (adjustedUnexposedEdge): Helper to adjust the left/top.
2690         (adjustedUnexposedMaxEdge): Helper to adjust the right/bottom.
2691         (fixedPositionRectFromExposedRect):
2692         (-[WKContentView didUpdateVisibleRect:unobscuredRect:scale:minimumScale:inStableState:]):
2693         (-[WKContentView didUpdateVisibleRect:unobscuredRect:scale:inStableState:]): Deleted.
2694
2695 2014-05-09  Zalan Bujtas  <zalan@apple.com>
2696
2697         Subpixel rendering[iOS]: Top bar on apple.com/support jiggles when the swoosh animates.
2698         https://bugs.webkit.org/show_bug.cgi?id=132750
2699         <rdar://problem/16803281>
2700
2701         Reviewed by Simon Fraser.
2702
2703         This patch ensures that GraphicsLayer and RemoteLayerBackingStore have the same dimensions.
2704         
2705         Remove integral enclosing when we set the size on RemoteLayerBackingStore. It makes the layer's size
2706         different from the backingstore when the passed value is fractional.
2707         We scale and integral round this value to size the shareable bitmap later. Rounding ensures that
2708         the final size value matches what we calculated at GraphicsLayerCA::updateGeometry()
2709
2710         Currently not testable.
2711
2712         * Shared/mac/RemoteLayerBackingStore.h:
2713         (WebKit::RemoteLayerBackingStore::size):
2714         * Shared/mac/RemoteLayerBackingStore.mm:
2715         (WebKit::RemoteLayerBackingStore::ensureBackingStore):
2716         (WebKit::RemoteLayerBackingStore::setNeedsDisplay): use enclosing here to ensure we cover the entire backing store.
2717         (WebKit::RemoteLayerBackingStore::display):
2718         (WebKit::RemoteLayerBackingStore::drawInContext):
2719         * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
2720         (WebKit::PlatformCALayerRemote::updateBackingStore):
2721
2722 2014-05-09  Benjamin Poulain  <bpoulain@apple.com>
2723
2724         [iOS][WK2] Set up the resize events
2725         https://bugs.webkit.org/show_bug.cgi?id=132726
2726
2727         Reviewed by Darin Adler and Simon Fraser.
2728
2729         Wire the UI Process updates to FrameView to send the resize events appropriately.
2730
2731         * Shared/VisibleContentRectUpdateInfo.cpp:
2732         (WebKit::VisibleContentRectUpdateInfo::encode):
2733         (WebKit::VisibleContentRectUpdateInfo::decode):
2734         * Shared/VisibleContentRectUpdateInfo.h:
2735         (WebKit::VisibleContentRectUpdateInfo::VisibleContentRectUpdateInfo):
2736         (WebKit::VisibleContentRectUpdateInfo::isChangingObscuredInsetsInteractively):
2737         * UIProcess/API/Cocoa/WKWebView.mm:
2738         (-[WKWebView _updateVisibleContentRects]):
2739         * UIProcess/ios/WKContentView.h:
2740         * UIProcess/ios/WKContentView.mm:
2741         (-[WKContentView didUpdateVisibleRect:unobscuredRect:scale:inStableState:isChangingObscuredInsetsInteractively:]):
2742         (-[WKContentView didUpdateVisibleRect:unobscuredRect:scale:inStableState:]): Deleted.
2743         Pass down the status of the content insets with the view update to main frame's FrameView
2744         when needed.
2745
2746         * WebProcess/WebPage/ios/WebPageIOS.mm:
2747         (WebKit::WebPage::dynamicViewportSizeUpdate):
2748         On live resize, send the resize event, then the scroll events (if needed).
2749
2750         Since JavaScript now gets two chances to change the content (resize event + scroll event),
2751         we query the actual scroll offset and scale for the DynamicViewportUpdateChangedTarget.
2752
2753         (WebKit::WebPage::viewportConfigurationChanged):
2754         Define the custom size on load before the app gets a chance to send different rects.
2755         If for some reason the app changes its mind about the insets, the content will be notified with a resize event.
2756
2757         (WebKit::WebPage::updateVisibleContentRects):
2758         Send the resize event when the insets are stable.
2759         Also move the scroll event after the resize event for consistency with live resize.
2760
2761 2014-05-09  Benjamin Poulain  <benjamin@webkit.org>
2762
2763         [iOS] Switch geolocation to an explicit authorization query model
2764         https://bugs.webkit.org/show_bug.cgi?id=132717
2765
2766         Reviewed by Sam Weinig.
2767
2768         Switch WKGeolocationProviderIOS to use the new API of WebGeolocationCoreLocationProvider.
2769
2770         On WebKit2, the whole logic to track requesters is in WebGeolocationManagerProxy.
2771
2772         Without the warmup sequence, WKGeolocationProviderIOS becomes really dumb: it just provides
2773         the two step authorization and forward the start/stop messages to the WebGeolocationCoreLocationProvider.
2774
2775         * UIProcess/ios/WKGeolocationProviderIOS.mm:
2776         (-[WKGeolocationProviderIOS _stopUpdating]):
2777         (-[WKGeolocationProviderIOS decidePolicyForGeolocationRequestFromOrigin:frame:request:window:]):
2778         (-[WKGeolocationProviderIOS geolocationAuthorizationGranted]):
2779         (-[WKGeolocationProviderIOS geolocationAuthorizationDenied]):
2780         (-[WKWebAllowDenyPolicyListener initWithPermissionRequestProxy:]):
2781         (-[WKWebAllowDenyPolicyListener deny]):
2782         (-[WKGeolocationProviderIOS _stopUpdatingIfPossible]): Deleted.
2783         (-[WKGeolocationProviderIOS geolocationDelegateStarted]): Deleted.
2784         (-[WKGeolocationProviderIOS geolocationDelegateUnableToStart]): Deleted.
2785         (-[WKGeolocationProviderIOS permissionDenied:]): Deleted.
2786         (-[WKWebAllowDenyPolicyListener initWithProvider:permissionRequestProxy:]): Deleted.
2787
2788 2014-05-09  Gordon Sheridan  <gordon_sheridan@apple.com>
2789
2790         Expose functions necessary for copying favicon between IconDatabases.
2791         https://bugs.webkit.org/show_bug.cgi?id=132709
2792
2793         Reviewed by Brady Eidson.
2794
2795         * UIProcess/API/C/WKIconDatabase.cpp:
2796         (WKIconDatabaseSetIconURLForPageURL):
2797         Add C API wrapper for WebIconDatabase::setIconURLForPageURL().
2798
2799         (WKIconDatabaseCopyIconURLForPageURL):
2800         Add C API wrapper for WebIconDatabase::synchronousIconURLForPageURL().
2801
2802         * UIProcess/API/C/WKIconDatabase.h:
2803         Added declarations for wrapper functions above.
2804
2805 2014-05-09  Tim Horton  <timothy_horton@apple.com>
2806
2807         Fix the iOS DRT build by including CG headers in WKPreferences.h, which uses CGFloat.
2808
2809         * UIProcess/API/Cocoa/WKPreferences.h:
2810
2811 2014-05-09  Brent Fulgham  <bfulgham@apple.com>
2812
2813         {TelephoneNumber, Selection}ControllerMac implementations dosn't handle tiled drawing properly.
2814         https://bugs.webkit.org/show_bug.cgi?id=132746
2815         <rdar://problem/16789588>
2816
2817         Reviewed by Tim Horton.
2818
2819         Don't try to draw the detector UI if no part of the selection bounds are inside
2820         the current tile. Don't limit the detector UI to the bounds of this tile, or else
2821         it will attempt to squeeze itself into the possibly small space available. Let it
2822         draw as if it had the whole screen, and rely on the context clip region to
2823         avoid overdrawing.
2824
2825         * WebProcess/WebPage/mac/TelephoneNumberOverlayControllerMac.mm:
2826         (WebKit::TelephoneNumberOverlayController::drawRect): Correct tiled drawing behavior.
2827         * WebProcess/WebPage/mac/SelectionOverlayControllerMac.mm:
2828         (WebKit::SelectionOverlayController::drawRect): Ditto.
2829
2830 2014-05-09  Anders Carlsson  <andersca@apple.com>
2831
2832         Production build fix.
2833
2834         Reviewed by Dan Bernstein.
2835
2836         * Configurations/BaseTarget.xcconfig:
2837         Add SDKROOT in front of UMBRELLA_FRAMEWORKS_DIR for OS X Production builds.
2838
2839 2014-05-09  Tim Horton  <timothy_horton@apple.com>
2840
2841         [iOS WebKit2] Flush RemoteLayerBackingStore contexts on a secondary queue
2842         https://bugs.webkit.org/show_bug.cgi?id=132667
2843         <rdar://problem/15349483>
2844
2845         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
2846         (WebKit::RemoteLayerTreeDrawingArea::BackingStoreFlusher::create):
2847         Address a missed review comment about a missing std::move.
2848
2849 2014-05-09  Anders Carlsson  <andersca@apple.com>
2850
2851         Rename WebKit2.framework to WebKit.framework
2852         https://bugs.webkit.org/show_bug.cgi?id=132743
2853         <rdar://problem/15920046>
2854
2855         Reviewed by Dan Bernstein.
2856
2857         * Configurations/BaseLegacyProcess.xcconfig:
2858         Change INSTALL_PATH to WebKit.framework.
2859
2860         * Configurations/BaseTarget.xcconfig:
2861         Change WEBKIT2_FRAMEWORKS_DIR to WEBKIT_FRAMEWORKS_DIR and add WEBKIT_LEGACY_PRIVATE_HEADERS_DIR.
2862
2863         * Configurations/BaseXPCService.xcconfig:
2864         Change WebKit2.framework to WebKit.framework.
2865
2866         * Configurations/WebKit.xcconfig: Copied from Source/WebKit2/Configurations/WebKit2.xcconfig.
2867         New configuration file for WebKit.framework. Re-export WebKitLegacy.framework.
2868
2869         * Configurations/WebKit2.xcconfig:
2870         New configuration file for the WebKit2 shim framework. Re-export WebKit.framework.
2871
2872         * NetworkProcess/EntryPoint/mac/XPCService/NetworkService/Info-OSX.plist:
2873         Update DYLD_INSERT_LIBRARIES to refer to WebKit.framework.
2874
2875         * PluginProcess/EntryPoint/mac/XPCService/PluginService.32-64.Info.plist:
2876         Update DYLD_INSERT_LIBRARIES to refer to WebKit.framework.
2877         
2878         * Shared/API/Cocoa/WKBrowsingContextHandle.h:
2879         * Shared/API/Cocoa/WKRenderingProgressEvents.h:
2880         Update header imports.
2881
2882         * Shared/API/Cocoa/WebKit.h: Renamed from Source/WebKit/mac/WebKitLegacy/WebKit.h.
2883         New umbrella header. Imports the modern WebKit API as well as the legacy API.
2884
2885         * Shared/API/Cocoa/WebKit.m: Renamed from Source/WebKit/mac/WebKitLegacy/WebKit.m.
2886         Export install name symbols on iOS.
2887
2888         * Shared/API/Cocoa/WebKitPrivate.h: Renamed from Source/WebKit/mac/WebKitLegacy/WebKitPrivate.h.
2889         New umbrella SPI header. Imports the modern WebKit SPI.
2890
2891         * Many headers:
2892         Change WebKit2 includes to WebKit includes.
2893
2894         * Shared/EntryPointUtilities/mac/XPCService/XPCServiceMain.Development.mm:
2895         (WebKit::XPCServiceEventHandler):
2896         Change bundle identifiers from com.apple.WebKit2 to com.apple.WebKit.
2897
2898         * Shared/EntryPointUtilities/mac/XPCService/XPCServiceMain.mm:
2899         (WebKit::XPCServiceEventHandler):
2900         Change bundle identifier from com.apple.WebKit2 to com.apple.WebKit.
2901         
2902         * UIProcess/API/Cocoa/WKPreferences.h:
2903         Stop including WKPreferencesRef.h, we have a WebKit2 header that handles this workaround for us now.
2904
2905         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
2906         (WebKit::addDYLDEnvironmentAdditions):
2907         (WebKit::connectToService):
2908         (WebKit::createProcess):
2909         (WebKit::ProcessLauncher::launchProcess):
2910         Change bundle identifiers from com.apple.WebKit2 to com.apple.WebKit.
2911
2912         * UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
2913         (WebKit::PluginProcessProxy::createPropertyListFile):
2914         Change bundle identifiers from com.apple.WebKit2 to com.apple.WebKit.
2915
2916         * UIProcess/mac/WebContextMac.mm:
2917         (WebKit::WebContext::platformDefaultDiskCacheDirectory):
2918         Change bundle identifier from com.apple.WebKit2 to com.apple.WebKit.
2919         
2920         * WebKit2.xcodeproj/project.pbxproj:
2921         Copy the python message scripts to the WebKit2 framework.
2922         Rename WebKit2.framework to WebKit.framework everywhere.
2923         Add a new WebKit2 target that builds the shim WebKit2 framework.
2924         Move the build script phase that migrates WebKitLegacy headers to WebKit.
2925         Add a new build script phase that adds forwarding headers from WebKit2 to WebKit.
2926
2927         * WebProcess/EntryPoint/mac/XPCService/WebContentService/Info-OSX.plist:
2928         Update DYLD_INSERT_LIBRARIES to refer to WebKit.framework.
2929
2930         * mac/MigrateHeadersFromWebKitLegacy.make: Renamed from Source/WebKit/mac/WebKitLegacy/MigrateHeadersFromWebKitLegacy.make.
2931         Move the makefile that migrates WebKitLegacy headers here. On OS X, it copies the header contents and on iOS it creates forarding headers.
2932
2933         * mac/MigrateHeadersToWebKit2.make:
2934         New makefile that creates forwarding headers for the WebKit2 shim framework.
2935
2936         * mac/WKPreferences.h: Added.
2937         Add WebKit2/WKPreferences.h header that imports WebKit2/WKPreferencesref.h.
2938
2939         * mac/WebKit2.m:
2940         Skeleton for the WebKit2 shim framework.
2941
2942         * mac/Info-WebKit2.plist: Added.
2943         New Info.plist file for the WebKit2 shim framework.
2944
2945 2014-05-09  Martin Hodovan  <mhodovan.u-szeged@partner.samsung.com>
2946
2947         [WK2] Make generate-forwarding-headers.pl work after WebKit2.framework -> WebKit.framework rename
2948         https://bugs.webkit.org/show_bug.cgi?id=132733
2949
2950         Reviewed by Csaba Osztrogonác.
2951
2952         Rewrite framework's directory name to WebKit2 if the framework is WebKit (former WebKit2)
2953         and then collect headers inside the fixed framework directory and generate forwarding
2954         headers point to the fixed directory.
2955
2956         Leave WebKit2 in @frameworks list during the transition. It can be removed
2957         once <WebKit2/foo.h> style includes were renamed to <WebKit/foo.h> everywhere.
2958
2959         * Scripts/generate-forwarding-headers.pl:
2960         (collectFameworkHeaderPaths):
2961         (createForwardingHeadersForFramework):
2962
2963 2014-05-08  Alexey Proskuryakov  <ap@apple.com>
2964
2965         Automatically zip document bundles used via File API
2966         https://bugs.webkit.org/show_bug.cgi?id=132713
2967         <rdar://problem/13397892>
2968
2969         Reviewed by Anders Carlsson.
2970
2971         * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in: NetworkProcess
2972         now uses FileCoordination (WebProcess already had this allowed).
2973
2974         * Shared/BlobDataFileReferenceWithSandboxExtension.h: Added final to the class.
2975
2976 2014-05-08  Simon Fraser  <simon.fraser@apple.com>
2977
2978         [iOS WK2] Bottom-relative position:fixed elements are misplaced on page load
2979         https://bugs.webkit.org/show_bug.cgi?id=132719
2980         <rdar://problem/16860837>
2981
2982         Reviewed by Benjamin Poulain.
2983         
2984         If we haven't received visible rects from the web process, compute the
2985         fixed position rect, but only after scale has been set.
2986
2987         * WebProcess/WebPage/ios/WebPageIOS.mm:
2988         (WebKit::WebPage::viewportConfigurationChanged):
2989
2990 2014-05-08  Jer Noble  <jer.noble@apple.com>
2991
2992         [Mac, iOS] Add source application accounting to AVURLAsset.
2993         https://bugs.webkit.org/show_bug.cgi?id=132637
2994
2995         Reviewed by Eric Carlson.
2996
2997         Add accessor for sourceApplicationIdentifier.
2998
2999         * NetworkProcess/RemoteNetworkingContext.h:
3000         * NetworkProcess/mac/RemoteNetworkingContext.mm:
3001         (WebKit::RemoteNetworkingContext::sourceApplicationIdentifier):
3002         * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.h:
3003         * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm:
3004         (WebKit::WebFrameNetworkingContext::sourceApplicationIdentifier):
3005
3006 2014-05-08  Tim Horton  <timothy_horton@apple.com>
3007
3008         [iOS WebKit2] Flush RemoteLayerBackingStore contexts on a secondary queue
3009         ​https://bugs.webkit.org/show_bug.cgi?id=132667
3010         <rdar://problem/16861454>
3011
3012         Rubber-stamped by Simon Fraser.
3013
3014         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
3015         (WebKit::RemoteLayerTreeDrawingArea::flushLayers):
3016         Add a null check to fix a crash on layers which lose backing store.
3017
3018 2014-05-08  Beth Dakin  <bdakin@apple.com>
3019
3020         REGRESSION (r168053): Phone number detection boxes are wrong when scrolled
3021         https://bugs.webkit.org/show_bug.cgi?id=132706
3022         -and corresponding-
3023         <rdar://problem/16787957>
3024
3025         Reviewed by Tim Horton.
3026
3027         We need to paint the boxes in Document coordinates. Range::boundingRect() was 
3028         giving us a point that took scroll position into account, and that’s not what we 
3029         want. Here we use Range::textQuads() instead so that we can get something in 
3030         Document coordinates, and then we need to convert that up to the main Document’s 
3031         coordinates.
3032         * WebProcess/WebPage/mac/TelephoneNumberOverlayControllerMac.mm:
3033         (WebKit::textQuadsToBoundingRectForRange):
3034         (WebKit::TelephoneNumberOverlayController::drawRect):
3035
3036         The telephone click function wants a point in Window coordinates.
3037         (WebKit::TelephoneNumberOverlayController::mouseEvent):
3038
3039 2014-05-08  Tim Horton  <timothy_horton@apple.com>
3040
3041         [iOS WebKit2] Flush RemoteLayerBackingStore contexts on a secondary queue
3042         https://bugs.webkit.org/show_bug.cgi?id=132667
3043         <rdar://problem/15349483>
3044
3045         Reviewed by Darin Adler.
3046
3047         * Shared/mac/RemoteLayerBackingStore.h:
3048         * Shared/mac/RemoteLayerBackingStore.mm:
3049         (WebKit::RemoteLayerBackingStore::takeFrontContextPendingFlush):
3050         (WebKit::RemoteLayerBackingStore::flush): Deleted.
3051         Add takeFrontContextPendingFlush, which returns the painted-but-not-yet-flushed front context,
3052         and drops our reference to it. This needs to be called on all backing store between paints.
3053
3054         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
3055         (WebKit::RemoteLayerTreeDrawingArea::BackingStoreFlusher::hasFlushed):
3056         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
3057         (WebKit::RemoteLayerTreeDrawingArea::RemoteLayerTreeDrawingArea):
3058         (WebKit::RemoteLayerTreeDrawingArea::~RemoteLayerTreeDrawingArea):
3059         (WebKit::RemoteLayerTreeDrawingArea::flushLayers):
3060         (WebKit::RemoteLayerTreeDrawingArea::BackingStoreFlusher::create):
3061         (WebKit::RemoteLayerTreeDrawingArea::BackingStoreFlusher::BackingStoreFlusher):
3062         (WebKit::RemoteLayerTreeDrawingArea::BackingStoreFlusher::flush):
3063         (WebKit::flushBackingStoreChangesInTransaction): Deleted.
3064         Flush backing store and send the layer tree commit to the UI process from a dispatch queue.
3065         We will only ever have a single commit in flight at a time, and there's a new
3066         RELEASE_ASSERT to ensure that is the case.
3067         We package up the commit on the main thread; the queue calls CGContextFlush
3068         on all of the newly painted contexts and then tosses the commit over to the UI process.
3069         This is a win in many cases because the Web process main thread can go ahead
3070         and do other non-painting tasks while the queue is blocked on painting.
3071
3072 2014-05-08  Tim Horton  <timothy_horton@apple.com>
3073
3074         [wk2] Don't use the XPC-based plugin process for Adobe Reader
3075         https://bugs.webkit.org/show_bug.cgi?id=132701
3076         <rdar://problem/16792692>
3077
3078         Reviewed by Anders Carlsson.
3079
3080         * UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
3081         (WebKit::shouldUseXPC):
3082         Rename the debugging default to a more modern and accurate name.
3083         Don't use XPC for Adobe Reader.
3084
3085         (WebKit::PluginProcessProxy::platformGetLaunchOptions):
3086         Move the check for plugins that need an executable heap into shouldUseXPC.
3087
3088 2014-05-08  Benjamin Poulain  <benjamin@webkit.org>
3089
3090         [iOS][WK2] Remove an incorrect assertion on asynchronous touch dispatch
3091         https://bugs.webkit.org/show_bug.cgi?id=132660
3092
3093         Reviewed by Enrica Casucci.
3094
3095         This assertion no longer make sense after r168393. Now the asynchronous behavior is maintained
3096         until the last finger leaves the screen.
3097
3098         * UIProcess/WebPageProxy.cpp:
3099         (WebKit::WebPageProxy::handleTouchEventAsynchronously):
3100
3101 2014-05-08  Alexey Proskuryakov  <ap@apple.com>
3102
3103         Make BlobDataFileReference manage its sandbox extension
3104         https://bugs.webkit.org/show_bug.cgi?id=132689
3105
3106         Reviewed by Anders Carlsson.
3107
3108         * CMakeLists.txt:
3109         * PlatformGTK.cmake:
3110         * WebKit2.xcodeproj/project.pbxproj:
3111         Added BlobDataFileReferenceWithSandboxExtension.
3112
3113         * NetworkProcess/FileAPI/NetworkBlobRegistry.cpp:
3114         (WebKit::NetworkBlobRegistry::registerFileBlobURL):
3115         (WebKit::NetworkBlobRegistry::registerBlobURL):
3116         (WebKit::NetworkBlobRegistry::registerBlobURLForSlice):
3117         (WebKit::NetworkBlobRegistry::unregisterBlobURL):
3118         (WebKit::NetworkBlobRegistry::connectionToWebProcessDidClose):
3119         (WebKit::NetworkBlobRegistry::filesInBlob):
3120         (WebKit::NetworkBlobRegistry::sandboxExtensions): Deleted.
3121         * NetworkProcess/FileAPI/NetworkBlobRegistry.h:
3122         We no longer track sandbox extensions here. Instead, provide a way to get files
3123         for a blob, which contain extensions and can allow access to themselves.
3124
3125         * NetworkProcess/NetworkResourceLoader.cpp:
3126         (WebKit::NetworkResourceLoader::NetworkResourceLoader):
3127         (WebKit::NetworkResourceLoader::consumeSandboxExtensions):
3128         (WebKit::NetworkResourceLoader::invalidateSandboxExtensions):
3129         * NetworkProcess/NetworkResourceLoader.h:
3130         Allow/revoke access to files in blob, just like we do for explicitly passed extensions.
3131
3132         * Shared/BlobDataFileReferenceWithSandboxExtension.cpp: Added.
3133         (WebKit::BlobDataFileReferenceWithSandboxExtension::BlobDataFileReferenceWithSandboxExtension):
3134         (WebKit::BlobDataFileReferenceWithSandboxExtension::~BlobDataFileReferenceWithSandboxExtension):
3135         (WebKit::BlobDataFileReferenceWithSandboxExtension::prepareForFileAccess):
3136         (WebKit::BlobDataFileReferenceWithSandboxExtension::revokeFileAccess):
3137         * Shared/BlobDataFileReferenceWithSandboxExtension.h: Added.
3138         (WebKit::BlobDataFileReferenceWithSandboxExtension::create):
3139         A subclass of BlobDataFileReference that also contains a sandbox extension. NetworkProcess
3140         always uses it in BlobRegistryImpl.
3141
3142         * WebProcess/FileAPI/BlobRegistryProxy.cpp: (WebKit::BlobRegistryProxy::registerFileBlobURL):
3143         * WebProcess/FileAPI/BlobRegistryProxy.h:
3144         Updated for BlobRegistry interface changes. BlobRegistryProxy doesn't really need
3145         a BlobDataFileReference here, as it only uses a path, but it needs to implement the same interface
3146         as BlobRegistryImpl.
3147
3148 2014-05-08  Brady Eidson  <beidson@apple.com>
3149
3150         "shouldKeepCurrentBackForwardListItemInList" API should pass clientInfo to the callback
3151         <rdar://problem/16855357> and https://bugs.webkit.org/show_bug.cgi?id=132692
3152
3153         Reviewed by Tim Horton.
3154
3155         * UIProcess/API/C/WKPage.cpp:
3156         (WKPageSetPageLoaderClient):
3157         * UIProcess/API/C/WKPageLoaderClient.h:
3158
3159 2014-05-08  Antti Koivisto  <antti@apple.com>
3160
3161         [iOS WebKit2] Can't activate text fields on Facebook
3162         https://bugs.webkit.org/show_bug.cgi?id=132682
3163
3164         Reviewed by Enrica Casucci.
3165
3166         * WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm:
3167         (WebKit::WebChromeClient::observedContentChange):
3168         
3169             Implement content change observer callback.
3170
3171         * WebProcess/WebPage/WebPage.h:
3172         * WebProcess/WebPage/ios/WebPageIOS.mm:
3173         (WebKit::WebPage::handleSyntheticClick):
3174         
3175             If the event gets canceled by a potential change (a started short-duration timer)
3176             save the position and node so we can continue later.
3177
3178         (WebKit::WebPage::completePendingSyntheticClickForContentChangeObserver):
3179         
3180             If it turns out the observed timer changed nothing continue the click event.
3181
3182         (WebKit::WebPage::completeSyntheticClick):
3183         
3184             Factored click event dispatch part of handleSyntheticClick here.
3185
3186 2014-05-07  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
3187
3188         [CoordinatedGraphics][WK2] Scale factor and scroll position is not being restored properly in a back/forward load
3189         https://bugs.webkit.org/show_bug.cgi?id=126022
3190
3191         Reviewed by Benjamin Poulain.
3192
3193         Original author : Thiago de Barros Lacerda, and finished by Gyuyoung Kim.
3194
3195         When user is navigating back/forward to a page that has been scrolled and/or scaled, that page must be shown
3196         with its last scroll position and scale factor. However, when fixed layout was enabled with CoordinatedGraphics
3197         and TILED_BACKING_STORE, Page::setPageScaleFactor() doesn't send previous scroll position since r165652 and r165913.
3198
3199         This patch allows the Page::setPageScaleFactor() send stored position to WK2 implementation.
3200
3201         * UIProcess/CoordinatedGraphics/WebView.cpp:
3202         (WebKit::WebView::didCommitLoadForMainFrame):
3203
3204 2014-05-07  Simon Fraser  <simon.fraser@apple.com>
3205
3206         Put a better version of the assertion back, and add one when we ensureBackingStore.
3207
3208         Reviewed by Tim Horton.
3209
3210         * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
3211         (WebKit::PlatformCALayerRemote::recursiveBuildTransaction):
3212         (WebKit::PlatformCALayerRemote::ensureBackingStore):
3213
3214 2014-05-07  Simon Fraser  <simon.fraser@apple.com>
3215
3216         This assertion was wrong and fired every time. Remove it.
3217
3218         * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
3219         (WebKit::PlatformCALayerRemote::recursiveBuildTransaction):
3220
3221 2014-05-07  Enrica Casucci  <enrica@apple.com>
3222
3223         WK2: Programatic scroll requests during scroll or zoom animation to reveal focused element are ignored.
3224         https://bugs.webkit.org/show_bug.cgi?id=132657
3225         <rdar://problem/16468462>
3226
3227         Reviewed by Benjamin Poulain.
3228
3229         With the scrolling model we use on iOS, a programatic scroll
3230         request can be received while we are still animating to reveal
3231         the focused input element. Changing the scroll offset while animating
3232         leads to unpredictable results. We now cancel the animation if
3233         a programatic scroll request is received.
3234
3235         * UIProcess/API/Cocoa/WKWebView.mm:
3236         (-[WKWebView _scrollToContentOffset:WebCore::]):
3237         * WebProcess/WebPage/ios/WebPageIOS.mm:
3238         (WebKit::WebPage::getAssistedNodeInformation):
3239
3240 2014-05-07  Simon Fraser  <simon.fraser@apple.com>
3241
3242         [iOS WK2] Speculative fix for crash in PlatformCALayerRemote::recursiveBuildTransaction
3243         https://bugs.webkit.org/show_bug.cgi?id=132666
3244
3245         Reviewed by Tim Horton.
3246         
3247         Crash reports suggest that owner() can be null. Assert and protect
3248         against this.
3249
3250         * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
3251         (WebKit::PlatformCALayerRemote::recursiveBuildTransaction):
3252
3253 2014-05-07  Dan Bernstein  <mitz@apple.com>
3254
3255         <rdar://problem/16831276> [iOS] Unparenting a WKWebView that’s loading pauses it
3256         https://bugs.webkit.org/show_bug.cgi?id=132659
3257
3258         Reviewed by Tim Horton.
3259
3260         * UIProcess/Cocoa/NavigationState.h: Added a member variable.
3261         * UIProcess/Cocoa/NavigationState.mm:
3262         (WebKit::NavigationState::didChangeIsLoading): When transitioning into loading state,
3263         acquire a background activity token. When transitioning out of loading state, dispose of
3264         the token.
3265
3266 2014-05-07  Jeremy Jones  <jeremyj@apple.com>
3267
3268         HTMLMediaElement should exitFullscreen when view is removed from the window.
3269         https://bugs.webkit.org/show_bug.cgi?id=132506
3270
3271         Reviewed by Tim Horton.
3272
3273         * UIProcess/WebPageProxy.cpp:
3274         (WebKit::WebPageProxy::viewStateDidChange):
3275         Request WebVideoFUllscreenManagerProxy to exitFullscreen when removed from the window.
3276         * UIProcess/ios/WebVideoFullscreenManagerProxy.h:
3277         Make requestExitFullscreen() public instead of private.
3278
3279 2014-05-07  Alexey Proskuryakov  <ap@apple.com>
3280
3281         Make blob size computation lazy
3282         https://bugs.webkit.org/show_bug.cgi?id=132653
3283
3284         Reviewed by Anders Carlsson.
3285
3286         * NetworkProcess/FileAPI/NetworkBlobRegistry.cpp:
3287         (WebKit::NetworkBlobRegistry::registerBlobURL):
3288         (WebKit::NetworkBlobRegistry::registerBlobURLForSlice):
3289         (WebKit::NetworkBlobRegistry::blobSize):
3290         * NetworkProcess/FileAPI/NetworkBlobRegistry.h:
3291         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
3292         (WebKit::NetworkConnectionToWebProcess::registerBlobURL):
3293         (WebKit::NetworkConnectionToWebProcess::registerBlobURLForSlice):
3294         (WebKit::NetworkConnectionToWebProcess::blobSize):
3295         * NetworkProcess/NetworkConnectionToWebProcess.h:
3296         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
3297         * WebProcess/FileAPI/BlobRegistryProxy.cpp:
3298         (WebKit::BlobRegistryProxy::registerBlobURL):
3299         (WebKit::BlobRegistryProxy::registerBlobURLForSlice):
3300         (WebKit::BlobRegistryProxy::blobSize):
3301         * WebProcess/FileAPI/BlobRegistryProxy.h:
3302
3303 2014-05-06  Simon Fraser  <simon.fraser@apple.com>
3304
3305         Add scrolling tree logging to RemoteLayerTree output
3306         https://bugs.webkit.org/show_bug.cgi?id=132640
3307
3308         Reviewed by Beth Dakin.
3309         
3310         Support scrolling tree logging in the RemoteLayerTree log channel
3311         output.
3312         
3313         Encode/decode ScrollingStateTree::hasChangedProperties() so we can use
3314         it to avoid logging. Log all the things.
3315
3316         * Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp:
3317         (WebKit::RemoteScrollingCoordinatorTransaction::encode):
3318         (WebKit::RemoteScrollingCoordinatorTransaction::decode):
3319         (WebKit::RemoteScrollingTreeTextStream::RemoteScrollingTreeTextStream):
3320         (WebKit::RemoteScrollingTreeTextStream::increaseIndent):
3321         (WebKit::RemoteScrollingTreeTextStream::decreaseIndent):
3322         (WebKit::RemoteScrollingTreeTextStream::writeIndent):
3323         (WebKit::dumpProperty):
3324         (WebKit::RemoteScrollingTreeTextStream::operator<<):
3325         (WebKit::RemoteScrollingTreeTextStream::dump):
3326         (WebKit::RemoteScrollingTreeTextStream::recursiveDumpNodes):
3327         (WebKit::RemoteScrollingCoordinatorTransaction::description):
3328         (WebKit::RemoteScrollingCoordinatorTransaction::dump):
3329         * Shared/Scrolling/RemoteScrollingCoordinatorTransaction.h:
3330         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
3331         (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
3332
3333 2014-05-07  Hyowon Kim  <hw1008.kim@samsung.com>
3334
3335         GraphicsLayer::client() should return a reference.
3336         https://bugs.webkit.org/show_bug.cgi?id=126372
3337
3338         Reviewed by Simon Fraser.
3339
3340         GraphicsLayers always have a GraphicsLayerClient attached,
3341         so make client() a reference and remove some unnecessary branches.
3342         The author of the changes in the mac port is Andreas Kling <akling@apple.com>.
3343
3344         * WebProcess/WebPage/PageOverlayController.cpp:
3345         (WebKit::PageOverlayController::initialize):
3346         (WebKit::PageOverlayController::installPageOverlay):
3347         * WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp:
3348         (WebKit::LayerTreeHostGtk::initialize):
3349         (WebKit::LayerTreeHostGtk::createPageOverlayLayer):
3350         * WebProcess/WebPage/mac/GraphicsLayerCARemote.h:
3351         * WebProcess/WebPage/mac/RemoteLayerTreeContext.h:
3352         * WebProcess/WebPage/mac/RemoteLayerTreeContext.mm:
3353         (WebKit::RemoteLayerTreeContext::createGraphicsLayer):
3354         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
3355         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
3356         (WebKit::RemoteLayerTreeDrawingArea::RemoteLayerTreeDrawingArea):
3357
3358 2014-05-07  Shivakumar JM  <shiva.jm@samsung.com>
3359
3360         Cleanup the build from unused parameter in UIProcess Module
3361         https://bugs.webkit.org/show_bug.cgi?id=131969
3362
3363         Reviewed by Csaba Osztrogonác.
3364
3365         Fixed unused parameter by omitting the parameter name
3366
3367         * UIProcess/API/C/WKPage.cpp:
3368         (WKPageSetPageFindClient):
3369         * UIProcess/WebFindClient.cpp:
3370         (WebKit::WebFindClient::didFindString):
3371
3372 2014-05-07  Manuel Rego Casasnovas  <rego@igalia.com>
3373
3374         [CSS Grid Layout] Remove runtime feature
3375         https://bugs.webkit.org/show_bug.cgi?id=132382
3376
3377         Reviewed by Benjamin Poulain.
3378
3379         Remove cssGridLayoutEnabled setting usage.
3380
3381         * Shared/WebPreferencesStore.h:
3382         * UIProcess/API/C/WKPreferences.cpp:
3383         (WKPreferencesSetCSSGridLayoutEnabled): Deleted.
3384         (WKPreferencesGetCSSGridLayoutEnabled): Deleted.
3385         * UIProcess/API/C/WKPreferencesRefPrivate.h:
3386         * UIProcess/API/gtk/WebKitSettings.cpp:
3387         (webKitSettingsConstructed):
3388         * UIProcess/gtk/ExperimentalFeatures.cpp:
3389         * UIProcess/gtk/ExperimentalFeatures.h:
3390         * WebProcess/InjectedBundle/InjectedBundle.cpp:
3391         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
3392         * WebProcess/WebPage/WebPage.cpp:
3393         (WebKit::WebPage::updatePreferences):
3394         * mac/WebKit2.order:
3395
3396 2014-05-07  Csaba Osztrogonác  <ossy@webkit.org>
3397
3398         URTBF after r168393 to fix !IOS builds.
3399
3400         * Shared/WebEvent.h:
3401
3402 2014-05-06  Brady Eidson  <beidson@apple.com>
3403
3404         Followup to "Add WK2 SPI to prevent the previous back/forward item from remaining in the list"
3405         <rdar://problem/16248710> and https://bugs.webkit.org/show_bug.cgi?id=132636
3406
3407         Reviewed by NOBODY (My mistake while addressing previous review feedback)
3408
3409         * UIProcess/API/C/WKPage.cpp:
3410         (WKPageSetPageLoaderClient): During review feedback, this client switched from default negative to default
3411           positve, so when the client isn't implemented...  return true instead of false.
3412
3413         * UIProcess/WebBackForwardList.cpp:
3414         (WebKit::WebBackForwardList::addItem): Fix nonsensical comments while I'm at it.
3415
3416 2014-05-06  Brady Eidson  <beidson@apple.com>
3417
3418         Add WK2 SPI to prevent the previous back/forward item from remaining in the list
3419         <rdar://problem/16248710> and https://bugs.webkit.org/show_bug.cgi?id=132636
3420
3421         Reviewed by Sam Weinig.
3422
3423         Add new PageLoaderClient SPI to keep the current back/forward item from remaining in the list:
3424         * UIProcess/API/APILoaderClient.h:
3425         (API::LoaderClient::shouldKeepCurrentBackForwardListItemInList):
3426         * UIProcess/API/C/WKPage.cpp:
3427         (WKPageSetPageLoaderClient):
3428         * UIProcess/API/C/WKPageLoaderClient.h:
3429         * UIProcess/WebPageProxy.cpp:
3430         (WebKit::WebPageProxy::shouldKeepCurrentBackForwardListItemInList):
3431         * UIProcess/WebPageProxy.h:
3432
3433         * UIProcess/WebBackForwardList.cpp:
3434         (WebKit::WebBackForwardList::addItem): Use that SPI to determine whether we should insert the new item after
3435         the previous item, or simply replace the previous item.
3436         (WebKit::WebBackForwardList::goToItem): Use that SPI to determine whether the previous item stays or goes.
3437
3438 2014-05-06  Dan Bernstein  <mitz@apple.com>
3439
3440         -[WKWebView isLoading] is NO immediately after -loadRequest: until the provisional load starts
3441         https://bugs.webkit.org/show_bug.cgi?id=132639
3442
3443         Reviewed by Darin Adler.
3444
3445         * UIProcess/PageLoadState.cpp:
3446         (WebKit::PageLoadState::commitChanges): Updated for change from isLoadingState to isLoading.
3447         (WebKit::PageLoadState::isLoading): Renamed from isLoadingState, changed to take Data and
3448         check whether there is a non-null pending API request URL. If so, return true.
3449         * UIProcess/PageLoadState.h:
3450
3451 2014-05-06  Dean Jackson  <dino@apple.com>
3452
3453         [Mac] Allow focus rings to redraw themselves if necessary
3454         https://bugs.webkit.org/show_bug.cgi?id=132593
3455
3456         Reviewed by Simon Fraser.
3457
3458         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
3459         (InitWebCoreSystemInterface): Add DrawFocusRingAtTime and DrawCellFocusRingWithFrameAtTime.
3460
3461 2014-05-06  Benjamin Poulain  <benjamin@webkit.org>
3462
3463         <rdar://problem/16833442> [iOS WebKit2]: Keep the order of contentView in _scrollView after rotation
3464         https://bugs.webkit.org/show_bug.cgi?id=132634
3465
3466         Reviewed by Enrica Casucci.
3467
3468         Nice idea of Yongjun.
3469
3470         * UIProcess/API/Cocoa/WKWebView.mm:
3471         (-[WKWebView _beginAnimatedResizeWithUpdates:]):
3472         (-[WKWebView _endAnimatedResize]):
3473
3474 2014-05-06  Timothy Hatcher  <timothy@apple.com>
3475
3476         Take WKView's topContentInset into account when docking Web Inspector to the right.
3477
3478         https://bugs.webkit.org/show_bug.cgi?id=132631
3479
3480         Reviewed by Joseph Pecoraro.
3481
3482         * UIProcess/mac/WebInspectorProxyMac.mm:
3483         (WebKit::WebInspectorProxy::inspectedViewFrameDidChange): Subtract topContentInset
3484         from the height of the frame for the Inspector.
3485
3486 2014-05-06  Benjamin Poulain  <bpoulain@apple.com>
3487
3488         [iOS][WK2] WebKit2 does not set CanPreventNativeGestures on the platform events
3489         https://bugs.webkit.org/show_bug.cgi?id=132594
3490
3491         Reviewed by Simon Fraser.
3492
3493         Set CanPreventNativeGestures on the plaform event.
3494         Change the tracking of WKContentView to be similar to WebPageProxy.
3495
3496         * Shared/WebEvent.h:
3497         (WebKit::WebTouchEvent::WebTouchEvent):
3498         (WebKit::WebTouchEvent::canPreventNativeGestures):
3499         (WebKit::WebTouchEvent::setCanPreventNativeGestures):
3500         * Shared/WebEventConversion.cpp:
3501         (WebKit::WebKit2PlatformTouchEvent::WebKit2PlatformTouchEvent):
3502         * Shared/ios/WebTouchEventIOS.cpp:
3503         (WebKit::WebTouchEvent::encode):
3504         (WebKit::WebTouchEvent::decode):
3505         * UIProcess/ios/WKContentViewInteraction.mm:
3506         (-[WKContentView _webTouchEventsRecognized:]):
3507
3508 2014-05-06  Benjamin Poulain  <bpoulain@apple.com>
3509
3510         [iOS][WK2] Add tap highlight on the simple UITapGestureRecognizer
3511         https://bugs.webkit.org/show_bug.cgi?id=132623
3512         <rdar://problem/16709507>
3513
3514         Reviewed by Enrica Casucci.
3515
3516         Add a low latency highlight for tap/click.
3517
3518         * UIProcess/PageClient.h:
3519         * UIProcess/WebPageProxy.h:
3520         * UIProcess/WebPageProxy.messages.in:
3521         * UIProcess/ios/PageClientImplIOS.h:
3522         * UIProcess/ios/PageClientImplIOS.mm:
3523         (WebKit::PageClientImpl::commitPotentialTapFailed):
3524         * UIProcess/ios/WKContentViewInteraction.h:
3525         * UIProcess/ios/WKContentViewInteraction.mm:
3526         (-[WKContentView setupInteraction]):
3527         (-[WKContentView _showTapHighlightWithColor:WebCore::quads:WebCore::topLeftRadius:WebCore::topRightRadius:WebCore::bottomLeftRadius:WebCore::bottomRightRadius:WebCore::]):
3528         (-[WKContentView _didGetTapHighlightForRequest:color:WebCore::quads:WebCore::topLeftRadius:WebCore::topRightRadius:WebCore::bottomLeftRadius:WebCore::bottomRightRadius:WebCore::]):
3529         (-[WKContentView _finishInteraction]):
3530         (-[WKContentView _highlightLongPressRecognized:]):
3531         (-[WKContentView _singleTapRecognized:]):
3532         (-[WKContentView _singleTapDidReset:]):
3533         (-[WKContentView _commitPotentialTapFailed]):
3534         (-[WKContentView _singleTapCommited:]):
3535         (-[WKContentView _attemptClickAtLocation:]):
3536         * UIProcess/ios/WKSyntheticClickTapGestureRecognizer.h: Added.
3537         * UIProcess/ios/WKSyntheticClickTapGestureRecognizer.m: Added.
3538         (-[WKSyntheticClickTapGestureRecognizer setGestureRecognizedTarget:action:]):
3539         (-[WKSyntheticClickTapGestureRecognizer setResetTarget:action:]):
3540         (-[WKSyntheticClickTapGestureRecognizer setState:]):
3541         (-[WKSyntheticClickTapGestureRecognizer reset]):
3542         * UIProcess/ios/WebPageProxyIOS.mm:
3543         (WebKit::WebPageProxy::potentialTapAtPosition):
3544         (WebKit::WebPageProxy::commitPotentialTap):
3545         (WebKit::WebPageProxy::cancelPotentialTap):
3546         (WebKit::WebPageProxy::tapHighlightAtPosition):
3547         (WebKit::WebPageProxy::commitPotentialTapFailed):
3548         * WebKit2.xcodeproj/project.pbxproj:
3549         * WebProcess/WebPage/WebPage.h:
3550         * WebProcess/WebPage/WebPage.messages.in:
3551         * WebProcess/WebPage/ios/WebPageIOS.mm:
3552         (WebKit::WebPage::handleSyntheticClick):
3553         (WebKit::WebPage::handleTap):
3554         (WebKit::WebPage::sendTapHighlightForNodeIfNecessary):
3555         (WebKit::WebPage::potentialTapAtPosition):
3556         (WebKit::WebPage::commitPotentialTap):
3557         (WebKit::WebPage::cancelPotentialTap):
3558         (WebKit::WebPage::tapHighlightAtPosition):
3559
3560 2014-05-06  Anders Carlsson  <andersca@apple.com>
3561
3562         Put WebArchive and WebArchiveResource in the API namespace.
3563
3564         Rubber-stamped by Dan Bernstein.
3565
3566         * Shared/API/c/WKSharedAPICast.h:
3567         * Shared/API/c/mac/WKWebArchive.cpp:
3568         (WKWebArchiveGetTypeID):
3569         (WKWebArchiveCreate):
3570         (WKWebArchiveCreateWithData):
3571         (WKWebArchiveCreateFromRange):
3572         (WKWebArchiveCopyMainResource):
3573         * Shared/API/c/mac/WKWebArchiveResource.cpp:
3574         (WKWebArchiveResourceGetTypeID):
3575         (WKWebArchiveResourceCreate):
3576         * Shared/APIWebArchive.cpp: Renamed from Source/WebKit2/Shared/WebArchive.cpp.
3577         (API::WebArchive::create):
3578         (API::WebArchive::WebArchive):
3579         (API::WebArchive::~WebArchive):
3580         (API::WebArchive::mainResource):
3581         (API::WebArchive::subresources):
3582         (API::WebArchive::subframeArchives):
3583         (API::releaseCFData):
3584         (API::WebArchive::data):
3585         (API::WebArchive::coreLegacyWebArchive):
3586         * Shared/APIWebArchive.h: Renamed from Source/WebKit2/Shared/WebArchive.h.
3587         * Shared/APIWebArchiveResource.cpp: Renamed from Source/WebKit2/Shared/WebArchiveResource.cpp.
3588         (API::WebArchiveResource::create):
3589         (API::WebArchiveResource::WebArchiveResource):
3590         (API::WebArchiveResource::~WebArchiveResource):
3591         (API::releaseCFData):
3592         (API::WebArchiveResource::data):
3593         (API::WebArchiveResource::URL):
3594         (API::WebArchiveResource::MIMEType):
3595         (API::WebArchiveResource::textEncoding):
3596         (API::WebArchiveResource::coreArchiveResource):
3597         * Shared/APIWebArchiveResource.h: Renamed from Source/WebKit2/Shared/WebArchiveResource.h.
3598         * WebKit2.xcodeproj/project.pbxproj:
3599
3600 2014-05-06  Alex Christensen  <achristensen@webkit.org>
3601
3602         Removed unnecessary notImplemented.h includes.
3603         https://bugs.webkit.org/show_bug.cgi?id=132587
3604
3605         Reviewed by Anders Carlsson.
3606
3607         * UIProcess/ios/WKContentViewInteraction.mm:
3608         * UIProcess/mac/WebContextMenuProxyMac.mm:
3609         * WebProcess/Databases/IndexedDB/WebIDBFactoryBackend.cpp:
3610         * WebProcess/WebCoreSupport/WebInspectorFrontendClient.cpp:
3611         Removed notImplemented from list of includes.
3612
3613 2014-05-05  Jeremy Jones  <jeremyj@apple.com>
3614
3615         Implement scan backward and forward in video fullscreen.
3616         https://bugs.webkit.org/show_bug.cgi?id=132517
3617
3618         Reviewed by Simon Fraser.
3619
3620         Plumb through scanning/seeking functions.
3621
3622         * UIProcess/ios/WebVideoFullscreenManagerProxy.h:
3623         * UIProcess/ios/WebVideoFullscreenManagerProxy.mm:
3624         (WebKit::WebVideoFullscreenManagerProxy::fastSeek):
3625         (WebKit::WebVideoFullscreenManagerProxy::beginScanningForward):
3626         (WebKit::WebVideoFullscreenManagerProxy::beginScanningBackward):
3627         (WebKit::WebVideoFullscreenManagerProxy::endScanning):
3628         * WebProcess/ios/WebVideoFullscreenManager.messages.in:
3629
3630 2014-05-05  Benjamin Poulain  <bpoulain@apple.com>
3631
3632         [iOS][WK2] Prefetch DNS hostnames on tap highlight
3633         https://bugs.webkit.org/show_bug.cgi?id=132509
3634
3635         Reviewed by Alexey Proskuryakov.
3636
3637         * WebProcess/WebPage/ios/WebPageIOS.mm:
3638         (WebKit::WebPage::tapHighlightAtPosition):
3639
3640 2014-05-05  Simon Fraser  <simon.fraser@apple.com>
3641
3642         [iOS WK2] Flickery scrolling inside overflow-scrolling: touch
3643         https://bugs.webkit.org/show_bug.cgi?id=132591
3644         <rdar://problem/16760466>
3645
3646         Reviewed by Tim Horton.
3647         
3648         Avoid triggering layer tree commits that touch the layer's boundsOrigin
3649         while the user is scrolling in the UI process.
3650         
3651         Fix the WKOverflowScrollViewDelegate to pass along an "inUserInteration"
3652         flag to the ScrollingTree to say that we're in the middle of a user interaction
3653         (and also to send a final non-interactive update). That gets passed along
3654         to the web process, and turned into "SyncScrollingLayerPosition" update.
3655         AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll() consults
3656         this, and uses it to set a flag on the ScrollableArea to say that the scroll
3657         is a user scroll.
3658         
3659         RenderLayerBacking then makes use of this (in existing code, shared with WK1)
3660         to avoid triggering layer bounds setting. Instead, it now just calls syncBoundsOrigin(),
3661         which updates the GraphicsLayer without touching platform layers. This is necessary
3662         so that GraphicsLayer geometry is up-to-date (used for tiled layer visibility
3663         computations).
3664         
3665         Finally, a hack in GraphicsLayerCA::computeVisibleRect() is conditionalized
3666         for WebKit1 by checking the type of platform layer.
3667
3668         * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp:
3669         (WebKit::RemoteScrollingCoordinatorProxy::rootScrollingNodeID):
3670         (WebKit::RemoteScrollingCoordinatorProxy::isPointInNonFastScrollableRegion):
3671         (WebKit::RemoteScrollingCoordinatorProxy::viewportChangedViaDelegatedScrolling):
3672         (WebKit::RemoteScrollingCoordinatorProxy::scrollingTreeNodeDidScroll):
3673         * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h:
3674         * UIProcess/Scrolling/RemoteScrollingTree.cpp:
3675         (WebKit::RemoteScrollingTree::scrollingTreeNodeDidScroll):
3676         * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.h:
3677         * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:
3678         (-[WKOverflowScrollViewDelegate scrollViewDidScroll:]):
3679         (-[WKOverflowScrollViewDelegate scrollViewDidEndDragging:willDecelerate:]):
3680         (-[WKOverflowScrollViewDelegate scrollViewDidEndDecelerating:]):
3681         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::scrollViewDidScroll):
3682         * WebProcess/Scrolling/RemoteScrollingCoordinator.h:
3683         * WebProcess/Scrolling/RemoteScrollingCoordinator.messages.in:
3684         * WebProcess/Scrolling/RemoteScrollingCoordinator.mm:
3685         (WebKit::RemoteScrollingCoordinator::scrollPositionChangedForNode):
3686
3687 2014-05-05  Alexey Proskuryakov  <ap@apple.com>
3688
3689         Stop using BlobData on client side
3690         https://bugs.webkit.org/show_bug.cgi?id=132582
3691
3692         Reviewed by Sam Weinig.
3693
3694         Update for WebCore changes.
3695
3696         * CMakeLists.txt:
3697         * NetworkProcess/FileAPI/NetworkBlobRegistry.cpp:
3698         (WebKit::NetworkBlobRegistry::registerFileBlobURL):
3699         (WebKit::NetworkBlobRegistry::registerBlobURL):
3700         * NetworkProcess/FileAPI/NetworkBlobRegistry.h:
3701         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
3702         (WebKit::NetworkConnectionToWebProcess::registerFileBlobURL):
3703         (WebKit::NetworkConnectionToWebProcess::registerBlobURL):
3704         * NetworkProcess/NetworkConnectionToWebProcess.h:
3705         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
3706         * Shared/FileAPI/BlobRegistrationData.cpp: Removed.
3707         * Shared/FileAPI/BlobRegistrationData.h: Removed.
3708         * Shared/WebCoreArgumentCoders.cpp:
3709         (IPC::ArgumentCoder<BlobPart>::encode):
3710         (IPC::ArgumentCoder<BlobPart>::decode):
3711         * Shared/WebCoreArgumentCoders.h:
3712         * WebKit2.xcodeproj/project.pbxproj:
3713         * WebProcess/FileAPI/BlobRegistryProxy.cpp:
3714         (WebKit::BlobRegistryProxy::registerFileBlobURL):
3715         (WebKit::BlobRegistryProxy::registerBlobURL):
3716         * WebProcess/FileAPI/BlobRegistryProxy.h:
3717
3718 2014-05-05  Beth Dakin  <bdakin@apple.com>
3719
3720         Need a delegate that informs the UI process when the page's pin state changes
3721         https://bugs.webkit.org/show_bug.cgi?id=132583
3722         -and corresponding-
3723         <rdar://problem/16806231>
3724
3725         Reviewed by Anders Carlsson.
3726
3727         New UIClient function pinnedStateDidChange. 
3728
3729         * UIProcess/API/APIUIClient.h:
3730         (API::UIClient::pinnedStateDidChange):
3731
3732         Create WKPageUIClientV3 to add this function.
3733         * UIProcess/API/C/WKPage.cpp:
3734         (WKPageSetPageUIClient):
3735         * UIProcess/API/C/WKPageUIClient.h:
3736
3737         Change default initialization to true instead of false, which makes more sense for 
3738         this API.
3739         * UIProcess/WebPageProxy.cpp:
3740         (WebKit::WebPageProxy::WebPageProxy):
3741         (WebKit::WebPageProxy::didCommitLoadForFrame):
3742         (WebKit::WebPageProxy::resetState):
3743         (WebKit::WebPageProxy::didChangeScrollOffsetPinningForMainFrame):
3744         * WebProcess/WebPage/WebPage.cpp:
3745         (WebKit::WebPage::WebPage):
3746
3747 2014-05-05  Anders Carlsson  <andersca@apple.com>
3748
3749         Add SPI to provide the WebCrypto master key
3750         https://bugs.webkit.org/show_bug.cgi?id=132586
3751         <rdar://problem/16091460>
3752
3753         Reviewed by Dan Bernstein.
3754
3755         * UIProcess/API/APILoaderClient.h:
3756         (API::LoaderClient::webCryptoMasterKey):
3757         * UIProcess/API/C/WKPage.cpp:
3758         (WKPageSetPageLoaderClient):
3759         * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
3760         * UIProcess/Cocoa/NavigationState.h:
3761         * UIProcess/Cocoa/NavigationState.mm:
3762         (WebKit::NavigationState::setNavigationDelegate):
3763         (WebKit::NavigationState::LoaderClient::webCryptoMasterKey):
3764         * UIProcess/WebPageProxy.cpp:
3765         (WebKit::WebPageProxy::wrapCryptoKey):
3766
3767 2014-05-05  Gavin Barraclough  <baraclough@apple.com>
3768
3769         https://bugs.webkit.org/show_bug.cgi?id=132522
3770         Clean up ProcessThrottler
3771
3772         Unreviewed: bad build fix. Will work out what the right include is asap.
3773
3774         * UIProcess/ios/WebProcessProxyIOS.mm:
3775
3776 2014-05-05  Sam Weinig  <sam@webkit.org>
3777
3778         [Cocoa WebKit2] Add SPI to clear all visited links in a VisitedLinkProvider
3779         https://bugs.webkit.org/show_bug.cgi?id=132573
3780
3781         Reviewed by Dan Bernstein.
3782
3783         * Shared/VisitedLinkTable.cpp:
3784         (WebKit::VisitedLinkTable::VisitedLinkTable):
3785         (WebKit::VisitedLinkTable::clear):
3786         * Shared/VisitedLinkTable.h:
3787         Add functions to clear the visited link table.
3788
3789         * UIProcess/API/Cocoa/_WKVisitedLinkProvider.h:
3790         * UIProcess/API/Cocoa/_WKVisitedLinkProvider.mm:
3791         (-[_WKVisitedLinkProvider removeAll]):
3792         Add SPI.
3793
3794         * UIProcess/VisitedLinkProvider.cpp:
3795         (WebKit::VisitedLinkProvider::removeAll):
3796         * UIProcess/VisitedLinkProvider.h:
3797         A remove all resets the provider and notifies all the attached processes.
3798
3799         * WebProcess/WebPage/VisitedLinkTableController.cpp:
3800         (WebKit::VisitedLinkTableController::removeAllVisitedLinks):
3801         * WebProcess/WebPage/VisitedLinkTableController.h:
3802         * WebProcess/WebPage/VisitedLinkTableController.messages.in:
3803         Add message to clear the visited links for a process.
3804
3805 2014-05-05  Benjamin Poulain  <benjamin@webkit.org>
3806
3807         [iOS][WK2] Special case ViewGestureGeometryCollector::collectGeometryForSmartMagnificationGesture() for image documents
3808         https://bugs.webkit.org/show_bug.cgi?id=132553
3809
3810         Reviewed by Tim Horton.
3811
3812         When collecting the geometry for the smart magnification gesture, always return the image of an image document
3813         on iOS. On iOS, it does not make much sense to return the whole document rect when the gesture is not over the image.
3814
3815         * WebProcess/WebPage/ViewGestureGeometryCollector.cpp:
3816         (WebKit::ViewGestureGeometryCollector::collectGeometryForSmartMagnificationGesture):
3817
3818 2014-05-02  Gavin Barraclough  <baraclough@apple.com>
3819
3820         https://bugs.webkit.org/show_bug.cgi?id=132522
3821         Clean up ProcessThrottler
3822
3823         Reviewed by Geoffrey Garen.
3824
3825         The initial implementation of ProcessThrottler relied on the reply from the
3826         SetViewState message to ensure the page visibility notifications have a chance
3827         to be delivered. This resulted in:
3828             - unnecessarily complicated interface to ProcessThrottler (in VisibilityState class)
3829             - complexity bleeding out into WebPageProxy (handling 'hiding' state).
3830             - for cases other than view hiding, no suspension notification in the WebContent.
3831
3832         To fix these issues add an explicit handshake from the ProcessThrottler to the WebPage.
3833         This gives us two things:
3834             - All previously posted messages (e.g. SetViewState) will be processed before suspension.
3835             - WebContent is always (bar timeout) notified before suspension.
3836
3837         Since this interlock ensures the SetViewState message will be processed, the WKContentView no
3838         longer needs to request a reply from SetViewState, and WebPageProxy can lose all the 'hiding'
3839         state tracking. In turn, we can simplify VisibilityToken to a couple of simpler types, without
3840         the interface to change state - just acquire/release to keep the process runnable or permit
3841         suspension.
3842
3843         * UIProcess/API/Cocoa/WKWebView.mm:
3844         (-[WKWebView _snapshotRect:intoImageOfWidth:completionHandler:]):
3845             - VisibilityToken -> BackgroundActivityToken
3846         * UIProcess/WebPageProxy.cpp:
3847         (WebKit::WebPageProxy::WebPageProxy):
3848             - m_visibilityToken -> m_activityToken, remove m_pendingViewStateUpdates
3849               updateVisibilityToken -> updateActivityToken
3850         (WebKit::WebPageProxy::reattachToWebProcess):
3851             - updateVisibilityToken -> updateActivityToken
3852         (WebKit::WebPageProxy::viewStateDidChange):
3853             - remove m_pendingViewStateUpdates, updateActivityToken after sending SetViewState
3854         (WebKit::WebPageProxy::updateActivityToken):
3855             - m_visibilityToken -> m_activityToken, no need to handle 'hiding' state.
3856         (WebKit::WebPageProxy::updateVisibilityToken): Deleted.
3857             - renamed to updateActivityToken
3858         (WebKit::WebPageProxy::didUpdateViewState): Deleted.
3859             - implementation moved back into header.
3860         * UIProcess/WebPageProxy.h:
3861         (WebKit::WebPageProxy::didUpdateViewState):
3862             - implementation moved back into header.
3863         * UIProcess/WebProcessProxy.cpp:
3864         (WebKit::WebProcessProxy::WebProcessProxy):
3865             - ProcessThrottler constructor now passed WebProcessProxy.
3866         * UIProcess/WebProcessProxy.h:
3867             - added ProcessWillSuspend/ProcessReadyToSuspend
3868         * UIProcess/WebProcessProxy.messages.in:
3869             - added ProcessWillSuspend/ProcessReadyToSuspend
3870         * UIProcess/ios/ProcessAssertion.h:
3871         (WebKit::ProcessAssertion::state):
3872             - accessor
3873         * UIProcess/ios/ProcessThrottler.h:
3874         (WebKit::ProcessThrottler::VisibilityToken::visibility): Deleted.
3875         (WebKit::ProcessThrottler::VisibilityToken::setVisibility): Deleted.
3876             - removed VisibilityToken class, replaced with ForegroundActivityToken/BackgroundActivityToken.
3877         (WebKit::ProcessThrottler::ProcessThrottler): Deleted.
3878         (WebKit::ProcessThrottler::visibilityToken): Deleted.
3879         (WebKit::ProcessThrottler::didConnnectToProcess): Deleted.
3880         (WebKit::ProcessThrottler::assertionState): Deleted.
3881         (WebKit::ProcessThrottler::updateAssertion): Deleted.
3882             - moved implementations to .mm.
3883         * UIProcess/ios/ProcessThrottler.mm:
3884         (WebKit::ProcessThrottler::ForegroundActivityToken::ForegroundActivityToken):
3885         (WebKit::ProcessThrottler::ForegroundActivityToken::~ForegroundActivityToken):
3886         (WebKit::ProcessThrottler::BackgroundActivityToken::BackgroundActivityToken):
3887         (WebKit::ProcessThrottler::BackgroundActivityToken::~BackgroundActivityToken):
3888             - new, simpler replacement for VisibilityToken. Instantiate to keep a processes running, release to suspend.
3889         (WebKit::ProcessThrottler::ProcessThrottler):
3890             - constructor, now initializes WebProcessProxy pointer & timer mechanism
3891         (WebKit::ProcessThrottler::assertionState):
3892             - select the appropriate AssertionState give current ActivityTokens.
3893         (WebKit::ProcessThrottler::updateAssertionNow):
3894             - update the current ProcessAssertion.
3895         (WebKit::ProcessThrottler::updateAssertion):
3896             - update the current ProcessAssertion, delay running->suspended transitions to give the process a chance to clean up.
3897         (WebKit::ProcessThrottler::didConnnectToProcess):
3898             - moved from header.
3899         (WebKit::ProcessThrottler::suspendTimerFired):
3900             - timeout to prevent processes from running in the background for too long.
3901         (WebKit::ProcessThrottler::processReadyToSuspend):
3902             - handshake from the WebContent process to acknowledge it is ready to suspend.
3903         (WebKit::ProcessThrottler::VisibilityToken::VisibilityToken): Deleted.
3904         (WebKit::ProcessThrottler::VisibilityToken::~VisibilityToken): Deleted.
3905         (WebKit::ProcessThrottler::VisibilityToken::hideTimerFired): Deleted.
3906         (WebKit::ProcessThrottler::VisibilityToken::setVisibilityInternal): Deleted.
3907             - removed VisibilityToken class, replaced with ForegroundActivityToken/BackgroundActivityToken.
3908         * UIProcess/ios/WKContentView.mm:
3909         (-[WKContentView didMoveToWindow]):
3910             - no longer necessary to request a response from SetViewState; this interlock is now managed by the ProcessThrottler.
3911         * UIProcess/ios/WebProcessProxyIOS.mm:
3912         (WebKit::WebProcessProxy::sendProcessWillSuspend):
3913         (WebKit::WebProcessProxy::processReadyToSuspend):
3914             - added ProcessWillSuspend/ProcessReadyToSuspend
3915         * WebProcess/WebProcess.cpp:
3916         (WebKit::WebProcess::processWillSuspend):
3917             - notification from the WebContent process that we will be suspended; for now just send back an ack.
3918         * WebProcess/WebProcess.h:
3919             - added ProcessWillSuspend/ProcessReadyToSuspend
3920         * WebProcess/WebProcess.messages.in:
3921             - added ProcessWillSuspend/ProcessReadyToSuspend
3922
3923 2014-05-05  Jeremy Jones  <jeremyj@apple.com>
3924
3925         Implement beginScrubbing and endScrubbing for video fullscreen.
3926         https://bugs.webkit.org/show_bug.cgi?id=132520
3927
3928         Reviewed by Eric Carlson.
3929
3930         Plumb through beginScrubbing and endScrubbing.
3931
3932         * UIProcess/ios/WebVideoFullscreenManagerProxy.h:
3933         * UIProcess/ios/WebVideoFullscreenManagerProxy.mm:
3934         (WebKit::WebVideoFullscreenManagerProxy::beginScrubbing):
3935         (WebKit::WebVideoFullscreenManagerProxy::endScrubbing):
3936         * WebProcess/ios/WebVideoFullscreenManager.messages.in:
3937
3938 2014-05-05  Tim Horton  <timothy_horton@apple.com>
3939
3940         Use a layer delegate instead of web_disableAllActions wherever possible
3941         https://bugs.webkit.org/show_bug.cgi?id=132560
3942         <rdar://problem/16459284>
3943
3944         Reviewed by Simon Fraser.
3945
3946         * UIProcess/API/mac/WKView.mm:
3947         (-[WKView _setAcceleratedCompositingModeRootLayer:]):
3948         * UIProcess/ios/RemoteLayerTreeHostIOS.mm:
3949         (WebKit::RemoteLayerTreeHost::createLayer):
3950         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
3951         (WebKit::RemoteLayerTreeDrawingAreaProxy::showDebugIndicator):
3952         * UIProcess/mac/RemoteLayerTreeHost.mm:
3953         (WebKit::RemoteLayerTreeHost::createLayer):
3954         * UIProcess/mac/ViewGestureControllerMac.mm:
3955         (WebKit::ViewGestureController::beginSwipeGesture):
3956         Make use of WebActionDisablingCALayerDelegate where possible.
3957         Also, UIKit disables actions for us, so don't bother doing anything on iOS.
3958
3959 2014-05-05  Martin Hock  <mhock@apple.com>
3960
3961         Session-aware plugin autostart data
3962         https://bugs.webkit.org/show_bug.cgi?id=131758
3963         <rdar://problem/15906540>
3964
3965         Reviewed by Alexey Proskuryakov.
3966
3967         * Shared/WebProcessCreationParameters.cpp:
3968         * Shared/WebProcessCreationParameters.h:
3969         * UIProcess/Plugins/PlugInAutoStartProvider.cpp:
3970         (WebKit::PlugInAutoStartProvider::PlugInAutoStartProvider):
3971         (WebKit::PlugInAutoStartProvider::addAutoStartOriginHash):
3972         (WebKit::PlugInAutoStartProvider::autoStartOriginHashesCopy):
3973         (WebKit::PlugInAutoStartProvider::autoStartOriginsTableCopy):
3974         (WebKit::PlugInAutoStartProvider::setAutoStartOriginsTableWithItemsPassingTest):
3975         (WebKit::PlugInAutoStartProvider::setAutoStartOriginsArray):
3976         (WebKit::PlugInAutoStartProvider::didReceiveUserInteraction):
3977         * UIProcess/Plugins/PlugInAutoStartProvider.h:
3978         * UIProcess/WebContext.cpp:
3979         (WebKit::WebContext::addPlugInAutoStartOriginHash):
3980         (WebKit::WebContext::plugInDidReceiveUserInteraction):
3981         * UIProcess/WebContext.h:
3982         * UIProcess/WebContext.messages.in:
3983         * WebProcess/Plugins/PluginView.cpp:
3984         (WebKit::PluginView::pluginDidReceiveUserInteraction):
3985         * WebProcess/WebCoreSupport/WebPlugInClient.cpp:
3986         (WebKit::WebPlugInClient::didStartFromOrigin):
3987         * WebProcess/WebCoreSupport/WebPlugInClient.h:
3988         * WebProcess/WebProcess.cpp:
3989         (WebKit::WebProcess::WebProcess):
3990         (WebKit::WebProcess::isPlugInAutoStartOriginHash):
3991         (WebKit::WebProcess::shouldPlugInAutoStartFromOrigin):
3992         (WebKit::WebProcess::plugInDidStartFromOrigin):
3993         (WebKit::WebProcess::didAddPlugInAutoStartOriginHash):
3994         (WebKit::WebProcess::resetPlugInAutoStartOriginDefaultHashes):
3995         (WebKit::WebProcess::resetPlugInAutoStartOriginHashes):
3996         (WebKit::WebProcess::plugInDidReceiveUserInteraction):
3997         * WebProcess/WebProcess.h:
3998         * WebProcess/WebProcess.messages.in:
3999
4000 2014-05-05  Andy Estes  <aestes@apple.com>
4001
4002         Another iOS build fix after r168260.
4003
4004         Removed an unnecessary 'using namespace WebCore'.
4005
4006         * UIProcess/ios/WebMemoryPressureHandlerIOS.cpp:
4007
4008 2014-05-05  Tim Horton  <timothy_horton@apple.com>
4009
4010         Fix the iOS build.
4011
4012         * UIProcess/API/Cocoa/WKWebView.mm:
4013
4014 2014-05-05  Ryuan Choi  <ryuan.choi@samsung.com>
4015
4016         [EFL][WK2] Refactor favicon database APIs
4017         https://bugs.webkit.org/show_bug.cgi?id=132519
4018
4019         Reviewed by Gyuyoung Kim.
4020
4021         ewebkit2 has two options to get favicon.
4022
4023         The first option is ewk_view_favicon_get with "favicon,changed" signal.
4024         It's simple to use but it always adds the callback to EwkView although applications does not use favicon.
4025
4026         The other option is ewk_favicon_database_icon_get with ewk_favicon_database_icon_change_callback_add API.
4027         But the callback doesn't have information about Ewk_Favicon_Database to call ewk_favicon_database_icon_get.
4028
4029         This patch removed ewk_view_favicon_get and "favicon,changed" signal.
4030         In addition, improved ewk_favicon_database_icon_change_callback.
4031
4032         * UIProcess/API/efl/EwkView.cpp: Remove ewk_favicon_database related code.
4033         (EwkView::EwkView):
4034         (EwkView::~EwkView):
4035         (EwkView::informURLChange):
4036         (EwkView::handleFaviconChanged):
4037         (EwkView::createFavicon): Deleted.
4038         * UIProcess/API/efl/EwkViewCallbacks.h:
4039         * UIProcess/API/efl/ewk_favicon_database.cpp:
4040         (EwkFaviconDatabase::iconDataReadyForPageURL):
4041         (EwkFaviconDatabase::didChangeIconForPageURL): Deleted. dead code.
4042         * UIProcess/API/efl/ewk_favicon_database.h:
4043         Refactor Ewk_Favicon_Database_Icon_Change_Cb and improve doxygen.
4044         * UIProcess/API/efl/ewk_favicon_database_private.h:
4045         * UIProcess/API/efl/ewk_view.cpp:
4046         (ewk_view_favicon_get): Deleted.
4047         * UIProcess/API/efl/ewk_view.h:
4048         * UIProcess/API/efl/tests/test_ewk2_favicon_database.cpp:
4049         (EWK2FaviconDatabaseTest::requestFaviconData):
4050         (TEST_F):
4051
4052 2014-05-05  Tim Horton  <timothy_horton@apple.com>
4053
4054         [iOS WebKit2] Swipe snapshots should be taken asynchronously
4055         https://bugs.webkit.org/show_bug.cgi?id=132417
4056         <rdar://problem/16535921>
4057
4058         Reviewed by Anders Carlsson.
4059
4060         Reorganize takeViewSnapshot to return a ViewSnaphot with the image
4061         filled in (the other properties are filled in by ViewSnapshotStore).
4062
4063         Make ViewSnapshotStore use a fixed size instead of count for the snapshot cache.
4064         iOS doesn't use purgeable snapshots, so make the cache much smaller there.
4065
4066         Use CARenderServerCaptureLayerWithTransform to achieve async snapshotting.
4067
4068         Rename WebKit::ViewSnapshotStore::Snapshot to WebKit::ViewSnapshot so that
4069         it can be forward-declared in a bunch of places.
4070
4071         * UIProcess/API/Cocoa/WKWebView.mm:
4072         (-[WKWebView _takeViewSnapshot:]):
4073         Use CARenderServerCaptureLayerWithTransform.
4074
4075         * UIProcess/API/Cocoa/WKWebViewInternal.h:
4076         * UIProcess/API/mac/WKView.mm:
4077         (createIOSurfaceFromImage):
4078         (-[WKView _takeViewSnapshot:]):
4079         Adjust to the new push model.
4080
4081 &nb