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