REGRESSION (r171239): Much more time spent taking snapshots during the PLT
[WebKit-https.git] / Source / WebKit2 / ChangeLog
1 2014-07-23  Timothy Horton  <timothy_horton@apple.com>
2
3         REGRESSION (r171239): Much more time spent taking snapshots during the PLT
4         https://bugs.webkit.org/show_bug.cgi?id=135177
5         <rdar://problem/17764847>
6
7         Reviewed by Dan Bernstein.
8
9         * UIProcess/WebPageProxy.cpp:
10         (WebKit::WebPageProxy::willChangeCurrentHistoryItemForMainFrame):
11         (WebKit::WebPageProxy::willChangeCurrentHistoryItem): Deleted.
12         * UIProcess/WebPageProxy.h:
13         * UIProcess/WebPageProxy.messages.in:
14         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
15         (WebKit::WebFrameLoaderClient::willChangeCurrentHistoryItem):
16         * WebProcess/WebPage/WebPage.cpp:
17         (WebKit::WebPage::willChangeCurrentHistoryItemForMainFrame):
18         (WebKit::WebPage::willChangeCurrentHistoryItem): Deleted.
19         * WebProcess/WebPage/WebPage.h:
20         Rename WillChangeCurrentHistoryItem to WillChangeCurrentHistoryItemForMainFrame.
21         Only send it when the current history item for the main frame changes.
22
23 2014-07-23  Ryuan Choi  <ryuan.choi@samsung.com>
24
25         [EFL] EWebKit2.h should contain version information
26         https://bugs.webkit.org/show_bug.cgi?id=135189
27
28         Reviewed by Gyuyoung Kim.
29
30         Generate EWebKit2.h to contain the version information.
31
32         * PlatformEfl.cmake:
33         * UIProcess/API/efl/EWebKit2.h.in: Renamed from Source/WebKit2/UIProcess/API/efl/EWebKit2.h.
34
35 2014-07-23  Ryuan Choi  <ryuan.choi@samsung.com>
36
37         [EFL] Do not generate forwarding header for ewk headers
38         https://bugs.webkit.org/show_bug.cgi?id=135147
39
40         Reviewed by Gyuyoung Kim.
41
42         Only EWebKit2.h and ewk_text_checker.h are generated as forwarding header.
43         This is unnecessary.
44
45         * UIProcess/API/efl/tests/UnitTestUtils/EWK2UnitTestBase.h:
46         * UIProcess/API/efl/tests/test_ewk2_application_cache_manager.cpp:
47         * UIProcess/API/efl/tests/test_ewk2_context_menu.cpp:
48         * UIProcess/API/efl/tests/test_ewk2_window_features.cpp:
49         * UIProcess/efl/TextCheckerClientEfl.h:
50
51 2014-07-22  Commit Queue  <commit-queue@webkit.org>
52
53         Unreviewed, rolling out r171366.
54         https://bugs.webkit.org/show_bug.cgi?id=135190
55
56         Broke three API tests (Requested by ap on #webkit).
57
58         Reverted changeset:
59
60         "REGRESSION (r171239): Much more time spent taking snapshots
61         during the PLT"
62         https://bugs.webkit.org/show_bug.cgi?id=135177
63         http://trac.webkit.org/changeset/171366
64
65 2014-07-22  Oliver Hunt  <oliver@apple.com>
66
67         Reduce the size of the root WebContent sandbox profile
68         https://bugs.webkit.org/show_bug.cgi?id=135182
69         <rdar://problem/17739108>
70
71         Reviewed by Alexey Proskuryakov.
72
73         Switch from apple-ui-app to uikit-app as the root of the webcontent
74         profile.
75
76         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
77
78 2014-07-22  Jinwoo Song  <jinwoo7.song@samsung.com>
79
80         Unreviewed build fix on EFL port after r171356.
81
82         Implement a dummy platformMediaCacheDirectory() to avoid undefined reference error.
83
84         * UIProcess/efl/WebContextEfl.cpp:
85         (WebKit::WebContext::platformMediaCacheDirectory):
86
87 2014-07-22  Enrica Casucci  <enrica@apple.com>
88
89         REGRESSION (WebKit2): Selection inside accelerated overflow:scroll doesn't track scrolling.
90         https://bugs.webkit.org/show_bug.cgi?id=135180
91         <rdar://problem/16721055>
92
93         Reviewed by Simon Fraser.
94
95         Adds notifications to the WKContentView to know when scrolling starts and ends
96         in an overflow scroll. When scrolling starts, we hide the selection and we restore
97         it when scrolling ends, though not before the selection information in the editor
98         state has been updated.
99         It also adds a new method to the EditorClient class to force the
100         selection update when scrolling is completed.
101         
102         * UIProcess/PageClient.h:
103         * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h:
104         * UIProcess/Scrolling/RemoteScrollingTree.cpp:
105         (WebKit::RemoteScrollingTree::scrollingTreeNodeWillStartScroll):
106         (WebKit::RemoteScrollingTree::scrollingTreeNodeDidEndScroll):
107         * UIProcess/Scrolling/RemoteScrollingTree.h:
108         * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.h:
109         * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:
110         (-[WKOverflowScrollViewDelegate scrollViewWillBeginDragging:]):
111         (-[WKOverflowScrollViewDelegate scrollViewDidEndDragging:willDecelerate:]):
112         (-[WKOverflowScrollViewDelegate scrollViewDidEndDecelerating:]):
113         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::overflowScrollWillStart):
114         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::overflowScrollDidEnd):
115         * UIProcess/WebPageProxy.h:
116         * UIProcess/ios/PageClientImplIOS.h:
117         * UIProcess/ios/PageClientImplIOS.mm:
118         (WebKit::PageClientImpl::overflowScrollWillStartScroll):
119         (WebKit::PageClientImpl::overflowScrollDidEndScroll):
120         * UIProcess/ios/RemoteScrollingCoordinatorProxyIOS.mm:
121         (WebKit::RemoteScrollingCoordinatorProxy::scrollingTreeNodeWillStartScroll):
122         (WebKit::RemoteScrollingCoordinatorProxy::scrollingTreeNodeDidEndScroll):
123         * UIProcess/ios/WKContentViewInteraction.h:
124         * UIProcess/ios/WKContentViewInteraction.mm:
125         (-[WKContentView _overflowScrollingWillBegin]):
126         (-[WKContentView _overflowScrollingDidEnd]):
127         (-[WKContentView _updateChangedSelection]):
128         * UIProcess/ios/WebPageProxyIOS.mm:
129         (WebKit::WebPageProxy::overflowScrollWillStartScroll):
130         (WebKit::WebPageProxy::overflowScrollDidEndScroll):
131         * WebProcess/WebCoreSupport/WebEditorClient.h:
132         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
133         * WebProcess/WebCoreSupport/ios/WebEditorClientIOS.mm:
134         (WebKit::WebEditorClient::updateSelection):
135
136 2014-07-22  Benjamin Poulain  <bpoulain@apple.com>
137
138         [iOS][WK2] WebPageProxy should not do anything when responding to an animated resize is the page is not in a valid state
139         https://bugs.webkit.org/show_bug.cgi?id=135169
140         <rdar://problem/17740149>
141
142         Reviewed by Tim Horton.
143
144         * UIProcess/ios/WebPageProxyIOS.mm:
145         (WebKit::WebPageProxy::dynamicViewportSizeUpdate):
146         Neither m_dynamicViewportSizeUpdateWaitingForTarget nor m_dynamicViewportSizeUpdateWaitingForLayerTreeCommit should
147         be modified if there is not WebProcess to respond to DynamicViewportSizeUpdate.
148
149         (WebKit::WebPageProxy::synchronizeDynamicViewportUpdate):
150         We should not attempt to synchronize anything if the page was closed before the end of the dynamic viewport
151         update.
152
153 2014-07-22  Timothy Horton  <timothy_horton@apple.com>
154
155         REGRESSION (r171239): Much more time spent taking snapshots during the PLT
156         https://bugs.webkit.org/show_bug.cgi?id=135177
157         <rdar://problem/17764847>
158
159         Reviewed by Dan Bernstein.
160
161         * UIProcess/WebPageProxy.cpp:
162         (WebKit::WebPageProxy::willChangeCurrentHistoryItemForMainFrame):
163         (WebKit::WebPageProxy::willChangeCurrentHistoryItem): Deleted.
164         * UIProcess/WebPageProxy.h:
165         * UIProcess/WebPageProxy.messages.in:
166         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
167         (WebKit::WebFrameLoaderClient::willChangeCurrentHistoryItem):
168         * WebProcess/WebPage/WebPage.cpp:
169         (WebKit::WebPage::willChangeCurrentHistoryItemForMainFrame):
170         (WebKit::WebPage::willChangeCurrentHistoryItem): Deleted.
171         * WebProcess/WebPage/WebPage.h:
172         Rename WillChangeCurrentHistoryItem to WillChangeCurrentHistoryItemForMainFrame.
173         Only send it when the current history item for the main frame changes.
174
175 2014-07-22  Oliver Hunt  <oliver@apple.com>
176
177         Add accountsd access to network sandbox profile
178         https://bugs.webkit.org/show_bug.cgi?id=135176
179         <rdar://17656487>
180
181         Reviewed by Anders Carlsson.
182
183         This is available to the webcontent process already, but is also
184         needed for the networking process.
185
186         * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb:
187
188 2014-07-22  Oliver Hunt  <oliver@apple.com>
189
190         Remove unused com.apple.webkit.* rules from profiles
191         https://bugs.webkit.org/show_bug.cgi?id=135174
192         <rdar://17755931>
193
194         Reviewed by Anders Carlsson.
195
196         We never send these rules so we should just remove use of them
197         from the profiles.
198
199         * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb:
200         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
201
202 2014-07-22  Oliver Hunt  <oliver@apple.com>
203
204         Provide networking process with access to its HSTS db
205         https://bugs.webkit.org/show_bug.cgi?id=135121
206         <rdar://17654369>
207
208         Reviewed by Alexey Proskuryakov.
209
210         Add an extension parameter to pass the hsts database file.
211         This requires us to create the Caches/com.apple.WebKit.Networking
212         directory in the UI process, as the network sandbox
213         does not allow it to create the containing directory.
214
215         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
216         (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
217         * Shared/Network/NetworkProcessCreationParameters.cpp:
218         (WebKit::NetworkProcessCreationParameters::encode):
219         (WebKit::NetworkProcessCreationParameters::decode):
220         * Shared/Network/NetworkProcessCreationParameters.h:
221         * UIProcess/WebContext.cpp:
222         (WebKit::WebContext::ensureNetworkProcess):
223         (WebKit::WebContext::networkingHSTSDatabasePath):
224         * UIProcess/WebContext.h:
225         * UIProcess/mac/WebContextMac.mm:
226         (WebKit::WebContext::platformDefaultNetworkingHSTSDatabasePath):
227
228 2014-07-22  Benjamin Poulain  <bpoulain@apple.com>
229
230         [iOS][WK2] UI helpers that zoom on an element ignore the viewport's allowsUserScaling
231         https://bugs.webkit.org/show_bug.cgi?id=135140
232         <rdar://problem/17754921>
233
234         Reviewed by Tim Horton.
235
236         UIScrollView makes a difference between min/max zoom and allowUserScaling. To express that,
237         everything is set up on the LayerTransaction.
238
239         For zooming related helpers (find on page, double tap to zoom, etc), the min and max zoom
240         should be the actual min/max for the current page state.
241
242         This patch split the two explicitely.
243         For layer transactions, the values are taken from the viewport configuration directly.
244         For everything else, we should use minimumPageScaleFactor/maximumPageScaleFactor. Those two methods
245         have been updated to take into account allowsUserScaling.
246
247         * WebProcess/WebPage/WebPage.cpp:
248         (WebKit::WebPage::willCommitLayerTree):
249         * WebProcess/WebPage/ios/WebPageIOS.mm:
250         (WebKit::WebPage::minimumPageScaleFactor):
251         (WebKit::WebPage::maximumPageScaleFactor):
252         (WebKit::WebPage::getAssistedNodeInformation):
253
254 2014-07-22  Shivakumar JM  <shiva.jm@samsung.com>
255
256         Web Inspector: Fix unused parameter build warning
257         https://bugs.webkit.org/show_bug.cgi?id=135151
258
259         Reviewed by Joseph Pecoraro.
260
261         Fix unused parameter build warning by removing the parameter name 
262
263         * WebProcess/WebPage/WebInspector.cpp:
264         (WebKit::WebInspector::setJavaScriptProfilingEnabled):
265
266 2014-07-22  Shivakumar JM  <shiva.jm@samsung.com>
267
268         Fix unused parameter build warning in UIProcess module
269         https://bugs.webkit.org/show_bug.cgi?id=135154
270
271         Reviewed by Alexey Proskuryakov.
272
273         Fix unused parameter build warning in UIProcess module by using UNUSED_PARAM macro.
274
275         * UIProcess/WebPageProxy.cpp:
276         (WebKit::WebPageProxy::viewStateDidChange):
277
278 2014-07-22  Jeremy Jones  <jeremyj@apple.com>
279
280         Don't create new UIWindow for video fullscreen.
281         https://bugs.webkit.org/show_bug.cgi?id=135038
282
283         Reviewed by Darin Adler.
284
285         Use root UIView to parent fullscreen interface.
286
287         * UIProcess/ios/WebVideoFullscreenManagerProxy.mm:
288         (WebKit::WebVideoFullscreenManagerProxy::setupFullscreenWithID): pass parent UIView
289         * WebProcess/ios/WebVideoFullscreenManager.mm:
290         (WebKit::screenRectForNode): Use client rect instead of screen rect.
291
292 2014-07-21  Ryuan Choi  <ryuan.choi@samsung.com>
293
294         [EFL] Add Ewk prefix to enums of ewk_navigation_policy
295         https://bugs.webkit.org/show_bug.cgi?id=135144
296
297         Reviewed by Gyuyoung Kim.
298
299         All public enums of ewebkit should start with Ewk prefix.
300         This patch added Ewk prefix to Ewk_Event_Mouse_Button and Ewk_Event_Modifiers.
301         In addition, added missing description and default value for Ewk_Event_Modifier.
302
303         * UIProcess/API/efl/ewk_navigation_policy_decision.cpp:
304         (toEwkEventMouseButton):
305         (toEwkEventModifiers):
306         (EwkNavigationPolicyDecision::mouseButton):
307         (EwkNavigationPolicyDecision::modifiers):
308         (ewk_navigation_policy_mouse_button_get):
309         (ewk_navigation_policy_modifiers_get):
310         (toEventMouseButton): Deleted.
311         (toEventModifierKeys): Deleted.
312         * UIProcess/API/efl/ewk_navigation_policy_decision.h:
313         * UIProcess/API/efl/ewk_navigation_policy_decision_private.h:
314
315 2014-07-21  Benjamin Poulain  <bpoulain@apple.com>
316
317         [iOS][WK2] Improve event throttling for Scroll Events
318         https://bugs.webkit.org/show_bug.cgi?id=135082
319         <rdar://problem/17445266>
320
321         Reviewed by Simon Fraser.
322
323         In the WebKit layer, we want a measure that is representative of the responsiveness.
324
325         In this patch, I use the total delay between a VisibleContentRectUpdate being dispatched
326         by the UIProcess, and the time RemoteLayerTreeDrawingArea flushes the layer tree.
327
328         The value used for eventThrottlingDelay() is computed by averaging the new value with
329         the old values with a 80/20 split, favoring the old data. Favoring historical data
330         over the last timing avoid excessively throttling for a single slow frame.
331
332         The computation of m_estimatedMainThreadLatency can be improved in the future, this is
333         a first cut keeping things simple.
334
335         With m_estimatedMainThreadLatency in our hands, we can compute our eventThrottlingDelay().
336         If m_estimatedMainThreadLatency is smaller than a single frame timespan, we have a fast page
337         and nothing is throttled.
338
339         If is it more than a frame, we throttle such that we can at least render two frames
340         per event dispatch based on the historical data.
341
342         The exact values will need some tweaking, but this set ensures well written pages get
343         60 events per seconds, while slow pages do not waste too much time on events.
344
345         * WebProcess/WebCoreSupport/WebChromeClient.h:
346         * WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm:
347         (WebKit::WebChromeClient::eventThrottlingDelay):
348         * WebProcess/WebPage/ViewUpdateDispatcher.cpp:
349         (WebKit::ViewUpdateDispatcher::visibleContentRectUpdate):
350         (WebKit::ViewUpdateDispatcher::dispatchVisibleContentRectUpdate):
351         * WebProcess/WebPage/ViewUpdateDispatcher.h:
352         * WebProcess/WebPage/WebPage.cpp:
353         (WebKit::WebPage::WebPage):
354         (WebKit::WebPage::didFlushLayerTreeAtTime):
355         (WebKit::WebPage::didCommitLoad):
356         * WebProcess/WebPage/WebPage.h:
357         * WebProcess/WebPage/ios/WebPageIOS.mm:
358         (WebKit::WebPage::eventThrottlingDelay):
359         (WebKit::WebPage::updateVisibleContentRects):
360         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
361         (WebKit::RemoteLayerTreeDrawingArea::flushLayers):
362
363 2014-07-21  Simon Fraser  <simon.fraser@apple.com>
364
365         REGRESSION (r170361): In landscape with UI hidden, fixed position elements at top of screen are too low
366         https://bugs.webkit.org/show_bug.cgi?id=135141
367         <rdar://problem/17627525>
368
369         Reviewed by Benjamin Poulain.
370         
371         We can't use the WKWebView's UIScrollView contentInsets to determine the unobscured rect
372         in MobileSafari, because contentInsets can't be changed dynamically while scrolling.
373         To get around this, MobileSafari sets obscured insets instead (but also sets a fixed
374         contentInset).
375         
376         So if the client calls _setObscuredInsets:, always use _obscuredInsets to compute the 
377         content insets.
378
379         * UIProcess/API/Cocoa/WKWebView.mm:
380         (-[WKWebView _computedContentInset]):
381         (-[WKWebView _setObscuredInsets:]):
382
383 2014-07-21  Oliver Hunt  <oliver@apple.com>
384
385         Remove global cookie workaround from sandbox profiles
386         https://bugs.webkit.org/show_bug.cgi?id=135138
387         <rdar://17513375>
388
389         Reviewed by Alexey Proskuryakov.
390
391         Remove the workaround needed for global cookie access, and silencing
392         of the associated sandbox violation.
393
394         * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb:
395         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
396         * UIProcess/mac/WebContextMac.mm:
397         (WebKit::WebContext::platformDefaultCookieStorageDirectory):
398
399 2014-07-21  Oliver Hunt  <oliver@apple.com>
400
401         Correct sandbox profiles to fix some excess privileges
402         https://bugs.webkit.org/show_bug.cgi?id=135134
403         <rdar://problem/17741886>
404         <rdar://problem/17739080>
405
406         Reviewed by Alexey Proskuryakov.
407
408         This cleans up our sandbox profiles to fix a few issues - the profiles
409         no longer allow us to issue file extension we have the ability to consume,
410         and tightens some of the other file access rules.
411
412         This means we have to addd some rules to allow us to access things
413         that we previously had access to due to lax file system restrictions.
414
415         Some of the features were fixable simply by using entitlements on the
416         process rather than custom rules.
417
418         * Configurations/WebContent-iOS.entitlements:
419         * Resources/SandboxProfiles/ios/com.apple.WebKit.Databases.sb:
420         * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb:
421         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
422
423 2014-07-21  Simon Fraser  <simon.fraser@apple.com>
424
425         [iOS WK2] Turn off position:fixed behavior when the keyboard is up
426         https://bugs.webkit.org/show_bug.cgi?id=132537
427
428         Reviewed by Benjamin Poulain.
429         
430         Make interaction with form elements inside position:fixed less terrible by re-laying out
431         fixed elements relative to the document while we have an assisted node. This ensures
432         that all parts of a position:fixed are accessible (e.g. inputs on the right side
433         of a fixed-width top bar).
434         
435         * Shared/AssistedNodeInformation.cpp: Add a flag for being inside postion:fixed,
436         and encode/decode it.
437         (WebKit::AssistedNodeInformation::encode):
438         (WebKit::AssistedNodeInformation::decode):
439         * Shared/AssistedNodeInformation.h:
440         (WebKit::AssistedNodeInformation::AssistedNodeInformation):
441         * UIProcess/PageClient.h: Add isAssistingNode().
442         * UIProcess/ios/PageClientImplIOS.h:
443         * UIProcess/ios/PageClientImplIOS.mm:
444         (WebKit::PageClientImpl::isAssistingNode):
445         * UIProcess/ios/WebPageProxyIOS.mm:
446         (WebKit::WebPageProxy::computeCustomFixedPositionRect): If we have an assisted
447         node, just use the document rect as the custom fixed position rect.
448         * WebProcess/WebPage/ios/WebPageIOS.mm:
449         (WebKit::WebPage::getAssistedNodeInformation): Get the selection rect first,
450         since we have to fix it up for position:fixed. If the element is inside fixed
451         position in the main frame, re-set the fixed position rect to the document rect
452         (which forces a layout), re-fetch elementRect, then set it back. This ensures
453         that the UI process gets an elementRect which it can zoom to correctly.
454
455 2014-07-21  Timothy Horton  <timothy_horton@apple.com>
456
457         Random crashes on the Web Thread due to Timers firing on the wrong thread in the UI process
458         https://bugs.webkit.org/show_bug.cgi?id=135132
459         <rdar://problem/17719832>
460
461         Reviewed by Simon Fraser.
462
463         * UIProcess/ProcessThrottler.cpp:
464         (WebKit::ProcessThrottler::ProcessThrottler):
465         (WebKit::ProcessThrottler::suspendTimerFired):
466         * UIProcess/ProcessThrottler.h:
467         * UIProcess/ios/ViewGestureControllerIOS.mm:
468         (WebKit::ViewGestureController::ViewGestureController):
469         (WebKit::ViewGestureController::swipeSnapshotWatchdogTimerFired):
470         * UIProcess/mac/ViewGestureController.h:
471         * UIProcess/mac/ViewGestureControllerMac.mm:
472         (WebKit::ViewGestureController::ViewGestureController):
473         (WebKit::ViewGestureController::swipeSnapshotWatchdogTimerFired):
474         We can't use WebCore timers in the UI process because of coexistence concerns
475         (they fire on the Web Thread if there is one!), so use RunLoop::Timer instead.
476
477 2014-07-21  Andy Estes  <aestes@apple.com>
478
479         [iOS] Handle QuickLook ResourceLoaders in the web process
480         https://bugs.webkit.org/show_bug.cgi?id=135113
481
482         Reviewed by David Kilzer.
483
484         The QuickLook framework registers a NSURLProtocol to handle loading subresources of the HTML documents it
485         generates. In order for these loads to succeed, we need to start them in the same process in which QuickLook
486         generated the main resource.
487
488         * WebProcess/Network/WebResourceLoadScheduler.cpp:
489         (WebKit::WebResourceLoadScheduler::scheduleLoad):
490
491 2014-07-21  Brady Eidson  <beidson@apple.com>
492
493         DatabaseProcess doesn't relaunch after crashing.
494         <rdar://problem/17717343> and https://bugs.webkit.org/show_bug.cgi?id=135117
495
496         Reviewed by Alexey Proskuryakov.
497
498         * UIProcess/Databases/DatabaseProcessProxy.cpp:
499         (WebKit::DatabaseProcessProxy::didClose): Tell the WebContext.
500
501         * UIProcess/WebContext.cpp:
502         (WebKit::WebContext::databaseProcessCrashed): Notify supplements, then clear the DatabaseProcessProxy pointer.
503         * UIProcess/WebContext.h:
504
505         * UIProcess/WebContextSupplement.h:
506         (WebKit::WebContextSupplement::processDidClose): Added. No users right now, but the patch in bug 135035 will need this.
507
508 2014-07-20  KwangHyuk Kim  <hyuki.kim@samsung.com>
509
510         Fix warnings caused by unused parameter.
511         https://bugs.webkit.org/show_bug.cgi?id=134975
512
513         Reviewed by Gyuyoung Kim.
514
515         Fix warnings on EwkView.cpp and LegacySessionStateCodingNone.cpp that are caused by unused parameter data.
516
517         * UIProcess/API/efl/EwkView.cpp:
518         (EwkViewEventHandler<EVAS_CALLBACK_MOUSE_IN>::handleEvent):
519         * UIProcess/LegacySessionStateCodingNone.cpp:
520         (WebKit::decodeLegacySessionState):
521
522 2014-07-20  Jeremy Jones  <jeremyj@apple.com>
523
524         Disable ff/rw based on canPlayFastForward and canPlayFastRewind.
525         https://bugs.webkit.org/show_bug.cgi?id=134894
526
527         Reviewed by Darin Adler.
528
529         Add setCanPlayFastReverse
530
531         * UIProcess/ios/WebVideoFullscreenManagerProxy.messages.in: ditto
532         * WebProcess/ios/WebVideoFullscreenManager.h: ditto
533         * WebProcess/ios/WebVideoFullscreenManager.mm: ditto
534         (WebKit::WebVideoFullscreenManager::setCanPlayFastReverse): ditto
535
536 2014-07-20  Jeremy Jones  <jeremyj@apple.com>
537
538         Decrease flicker when enter and exit fullscreen.
539         https://bugs.webkit.org/show_bug.cgi?id=134919
540
541         Reviewed by Simon Fraser.
542
543         Change the sequence of tear down and use transparency to prevent flicker when entering and exiting fullscreen.
544
545         * UIProcess/ios/WebVideoFullscreenManagerProxy.mm: wait to remove layerHost until didCleanupFullscreen
546         (WebKit::WebVideoFullscreenManagerProxy::didExitFullscreen): removed from here
547         (WebKit::WebVideoFullscreenManagerProxy::didCleanupFullscreen): added here
548         * WebProcess/ios/WebVideoFullscreenManager.mm:
549         (WebKit::WebVideoFullscreenManager::didSetupFullscreen): use transparent background during transition
550
551 2014-07-20  Dan Bernstein  <mitz@apple.com>
552
553         <rdar://problem/17739526> REGRESSION (r171057): Crash in WebPage::getPositionInformation()
554         https://bugs.webkit.org/show_bug.cgi?id=135099
555
556         Reviewed by David Kilzer.
557
558         * WebProcess/WebPage/ios/WebPageIOS.mm:
559         (WebKit::WebPage::getPositionInformation): Added a null check.
560
561 2014-07-19  Zan Dobersek  <zdobersek@igalia.com>
562
563         Consistently use uint64_t as the handle parameter type for the SetAcceleratedCompositingWindowId message
564         https://bugs.webkit.org/show_bug.cgi?id=135047
565
566         Reviewed by Darin Adler.
567
568         UIProcess' WebPageProxy is handling this parameter as an uint64_t, it should be handled as such
569         in WebProcess as well.
570
571         * WebProcess/WebPage/WebPage.h:
572         * WebProcess/WebPage/WebPage.messages.in: Also changed the parameter name to match other places.
573         * WebProcess/WebPage/gtk/WebPageGtk.cpp:
574         (WebKit::WebPage::setAcceleratedCompositingWindowId):
575
576 2014-07-18  Oliver Hunt  <oliver@apple.com>
577
578         We don't provide an extension to the temp file used for uploads
579         https://bugs.webkit.org/show_bug.cgi?id=135079
580
581         Reviewed by Sam Weinig.
582
583         Make sure didChooseFilesForOpenPanelWithDisplayStringAndIcon vends
584         extensions for the files passed to the content process.
585
586         * UIProcess/WebPageProxy.cpp:
587         (WebKit::WebPageProxy::didChooseFilesForOpenPanelWithDisplayStringAndIcon):
588
589 2014-07-18  Tim Horton  <timothy_horton@apple.com>
590
591         ASSERTion failures in ViewGestureController indicating that we're copying WebBackForwardList
592         https://bugs.webkit.org/show_bug.cgi?id=135080
593         <rdar://problem/17734714>
594
595         Reviewed by Sam Weinig.
596
597         * UIProcess/ios/ViewGestureControllerIOS.mm:
598         (WebKit::ViewGestureController::beginSwipeGesture):
599         (WebKit::ViewGestureController::canSwipeInDirection):
600
601 2014-07-18  Yongjun Zhang  <yongjun_zhang@apple.com>
602
603         _WKActivatedElementInfo.title should fallback to innerText if the link doesn't have title attribute.
604         https://bugs.webkit.org/show_bug.cgi?id=135077
605
606         When populate InteractionInformationAtPosition's title value, use a link element's innerText if it
607         doesn't have title attribute.
608
609         Reviewed by Dan Bernstein.
610
611         * WebProcess/WebPage/ios/WebPageIOS.mm:
612         (WebKit::WebPage::getPositionInformation):
613
614 2014-07-18  Andy Estes  <aestes@apple.com>
615
616         [iOS] Tapping "Allow Website" on a restricted page does not bring up the keypad
617         https://bugs.webkit.org/show_bug.cgi?id=135072
618         <rdar://problem/17528188>
619
620         Reviewed by David Kilzer.
621
622         * Shared/WebCoreArgumentCoders.h: Declared an ArgumentCoder for WebCore::ContentFilter.
623         * Shared/mac/WebCoreArgumentCodersMac.mm:
624         (IPC::ArgumentCoder<ContentFilter>::encode): Encoded the ContentFilter using a NSKeyedArchiver.
625         (IPC::ArgumentCoder<ContentFilter>::decode): Decoded the ContentFilter using a NSKeyedUnarchiver.
626         * UIProcess/Cocoa/WebPageProxyCocoa.mm:
627         (WebKit::WebPageProxy::contentFilterDidBlockLoadForFrame): Called WebFrameProxy::setContentFilterForBlockedLoad().
628         * UIProcess/WebFrameProxy.cpp:
629         (WebKit::WebFrameProxy::didStartProvisionalLoad): Reset m_contentFilterForBlockedLoad to nullptr.
630         (WebKit::WebFrameProxy::contentFilterDidHandleNavigationAction): Called ContentFilter::handleUnblockRequestAndDispatchIfSuccessful().
631         If the unblock is successful, reload the WebPageProxy.
632         * UIProcess/WebFrameProxy.h:
633         (WebKit::WebFrameProxy::setContentFilterForBlockedLoad):
634         * UIProcess/WebPageProxy.cpp:
635         (WebKit::WebPageProxy::decidePolicyForNavigationAction): Check if this is navigation represents an unblock
636         request and ignore if so.
637         * UIProcess/WebPageProxy.h:
638         * UIProcess/WebPageProxy.messages.in: Defined ContentFilterDidBlockLoadForFrame.
639         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
640         (WebKit::WebFrameLoaderClient::contentFilterDidBlockLoad): Sent ContentFilterDidBlockLoadForFrame to the WebPageProxy.
641         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
642
643 2014-07-18  Simon Fraser  <simon.fraser@apple.com>
644
645         [iOS WK2] position:fixed in iframes with programmatic scroll could end up in the wrong place
646         https://bugs.webkit.org/show_bug.cgi?id=135078
647         <rdar://problem/17401823>
648
649         Reviewed by Tim Horton.
650         
651         Fix the logging of requested scroll position and frame scale factor.
652
653         * Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp:
654         (WebKit::RemoteScrollingTreeTextStream::dump):
655
656 2014-07-18  Joseph Pecoraro  <pecoraro@apple.com>
657
658         [Cocoa] Use RetainPtr in _WKRemoteObjectInterface
659         https://bugs.webkit.org/show_bug.cgi?id=135062
660
661         Reviewed by Anders Carlsson.
662
663         Switch to RetainPtr instead of manual memory management of ivars.
664
665         * Shared/API/Cocoa/_WKRemoteObjectInterface.h:
666         * Shared/API/Cocoa/_WKRemoteObjectInterface.mm:
667         (-[_WKRemoteObjectInterface initWithProtocol:identifier:]):
668         (-[_WKRemoteObjectInterface identifier]):
669         (-[_WKRemoteObjectInterface description]):
670         (-[_WKRemoteObjectInterface dealloc]): Deleted.
671
672 2014-07-18  Tim Horton  <timothy_horton@apple.com>
673
674         Take navigation snapshots whenever the current back-forward item is going to change
675         https://bugs.webkit.org/show_bug.cgi?id=135058
676         <rdar://problem/17464515>
677
678         Reviewed by Dan Bernstein.
679
680         Instead of trying to have the UI process figure out when to take navigation snapshots by itself,
681         snapshot whenever the Web process says that the current back-forward item is going to change.
682         This fixes snapshotting timing with pushState, and lets us bottleneck snapshotting down to
683         just two places instead of 5.
684
685         * UIProcess/WebPageProxy.cpp:
686         (WebKit::WebPageProxy::goForward):
687         (WebKit::WebPageProxy::goBack):
688         (WebKit::WebPageProxy::goToBackForwardItem):
689         (WebKit::WebPageProxy::didStartProvisionalLoadForFrame):
690         We no longer need to special-case taking navigation snapshots
691         when the UI process changes the back forward item or upon
692         didStartProvisionalLoadForFrame, because we'll always snapshot
693         in willChangeCurrentHistoryItem in all of these cases.
694
695         * UIProcess/WebPageProxy.cpp:
696         (WebKit::WebPageProxy::willChangeCurrentHistoryItem):
697         * UIProcess/WebPageProxy.h:
698         * UIProcess/WebPageProxy.messages.in:
699         Add willChangeCurrentHistoryItem message, which comes from the Web process.
700         When it arrives, take a navigation snapshot.
701
702         * UIProcess/ios/ViewGestureControllerIOS.mm:
703         (WebKit::ViewGestureController::beginSwipeGesture):
704         Take the pre-swipe navigation snapshot before telling WebPageProxy that we're doing a swipe,
705         so that it doesn't bail from taking the snapshot because we have a snapshot up.
706
707         (WebKit::ViewGestureController::endSwipeGesture):
708         We no longer need to explicitly disable snapshotting while navigating, because
709         we will avoid taking the snapshot if there's a snapshot being displayed.
710
711         * UIProcess/mac/ViewGestureControllerMac.mm:
712         (WebKit::ViewGestureController::~ViewGestureController):
713         Remove the snapshot if it's still up when ViewGestureController is destroyed.
714         The Mac version of ViewGestureController is destroyed on Web process crashes
715         because it is a message receiver, so it is not guaranteed to have the same
716         lifetime as the WebPageProxy and friends.
717
718         (WebKit::ViewGestureController::trackSwipeGesture):
719         Make use of recordNavigationSnapshot.
720
721         (WebKit::ViewGestureController::endSwipeGesture):
722         Ditto from the Mac version.
723
724         * UIProcess/mac/ViewSnapshotStore.h:
725         (WebKit::ViewSnapshotStore::disableSnapshotting): Deleted.
726         (WebKit::ViewSnapshotStore::enableSnapshotting): Deleted.
727         * UIProcess/mac/ViewSnapshotStore.mm:
728         (WebKit::ViewSnapshotStore::ViewSnapshotStore):
729         (WebKit::ViewSnapshotStore::recordSnapshot):
730         Remove the snapshot disabling mechanism and bail from snapshotting if we're
731         showing a snapshot, as mentioned above.
732
733         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
734         (WebKit::WebFrameLoaderClient::willChangeCurrentHistoryItem):
735         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
736         * WebProcess/WebPage/WebPage.cpp:
737         (WebKit::WebPage::willChangeCurrentHistoryItem):
738         * WebProcess/WebPage/WebPage.h:
739         Proxy willChangeCurrentHistoryItem from HistoryController to the UI process.
740
741 2014-07-18  Jon Honeycutt  <jhoneycutt@apple.com>
742
743         REGRESSION: Crash when typing into text field that clears itself on iOS
744
745         <https://bugs.webkit.org/show_bug.cgi?id=135044>
746         <rdar://problem/17640443>
747
748         Reviewed by Darin Adler.
749
750         * WebProcess/WebPage/ios/WebPageIOS.mm:
751         (WebKit::WebPage::requestAutocorrectionData):
752         wordRangeFromPosition() returns null in some cases; null check range
753         before dereferencing it. Moved some variable declarations around to
754         better match our style.
755
756 2014-07-18  Tim Horton  <timothy_horton@apple.com>
757
758         [WK2] Provide a mechanism to grab the back-forward list for gesture navigation purposes from another WKWebView
759         https://bugs.webkit.org/show_bug.cgi?id=134999
760         <rdar://problem/17238025>
761
762         Reviewed by Sam Weinig.
763
764         In some cases, clients may need to throw a WKWebView with no back-forward list over
765         another WKWebView, and want to participate in gesture swipe as if they were actually
766         the page being overlaid.
767
768         * UIProcess/API/Cocoa/WKWebView.mm:
769         (-[WKWebView setAllowsBackForwardNavigationGestures:]):
770         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
771         (-[WKWebViewConfiguration copyWithZone:]):
772         (-[WKWebViewConfiguration _alternateWebViewForNavigationGestures]):
773         (-[WKWebViewConfiguration _setAlternateWebViewForNavigationGestures:]):
774         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
775         Keep an "alternate" WKWebView "for navigation gestures", which ViewGestureController
776         will use as the real source of back-forward items, and the destination of the swipe navigation.
777         All swipe delegate callbacks will also fire from the alternate view, because it owns the items
778         and will be doing the navigation.
779
780         * UIProcess/ios/ViewGestureControllerIOS.mm:
781         (WebKit::ViewGestureController::setAlternateBackForwardListSourceView):
782         (WebKit::ViewGestureController::beginSwipeGesture):
783         Send navigationGestureDidBegin via the alternate view's WebPageProxy if it exists.
784         Record a new snapshot on the current page, but copy it to the alternate view if necessary,
785         so that when swiping forward from the alternate view, it will have the "right" snapshot.
786         Get the target back forward item from the alternate view.
787         Send navigationGestureWillEnd via the alternate view's WebPageProxy if it exists.
788
789         (WebKit::ViewGestureController::canSwipeInDirection):
790         Determine if we can swipe in a direction by looking at the alternate view's back-forward list if necessary.
791
792         (WebKit::ViewGestureController::endSwipeGesture):
793         Send navigationGestureDidEnd via the alternate view's WebPageProxy if it exists.
794         Perform the navigation on the alternate view if necessary.
795
796         (WebKit::ViewGestureController::removeSwipeSnapshot):
797         Send navigationGestureSnapshotWasRemoved via the alternate view's WebPageProxy if it exists.
798
799         * UIProcess/mac/ViewGestureController.h:
800
801 2014-07-17  David Kilzer  <ddkilzer@apple.com>
802
803         SECTORDER_FLAGS should be defined in target's xcconfig file, not Base.xcconfig
804         <http://webkit.org/b/135006>
805
806         Reviewed by Darin Adler.
807
808         * Configurations/Base.xcconfig: Move SECTORDER_FLAGS to
809         WebKit.xcconfig.
810         * Configurations/DebugRelease.xcconfig: Remove empty
811         SECTORDER_FLAGS definition.
812         * Configurations/WebKit.xcconfig: Use $(CONFIGURATION) so
813         SECTORDER_FLAGS is only set on Production builds.
814
815 2014-07-17  Alexey Proskuryakov  <ap@apple.com>
816
817         REGRESSION (r171167): LoaderClient processDidCrash call is made after load state changes
818         https://bugs.webkit.org/show_bug.cgi?id=135032
819         <rdar://problem/17716602>
820
821         Reviewed by Dan Bernstein.
822
823         * UIProcess/WebPageProxy.cpp:
824         (WebKit::WebPageProxy::processDidCrash): Create a transaction, so that the nested
825         transaction in resetStateAfterProcessExited() wouldn't be committed.
826         (WebKit::WebPageProxy::resetStateAfterProcessExited): Don't use auto - it was hiding
827         the most important fact that this is a stack object that can't be simply moved to
828         a different function.
829
830 2014-07-17  Benjamin Poulain  <bpoulain@apple.com>
831
832         [iOS][WK2] Fix the updateVisibleContentRects synchronization for load after r171154
833         https://bugs.webkit.org/show_bug.cgi?id=135036
834
835         Reviewed by Dan Bernstein.
836
837         * WebProcess/WebPage/ios/WebPageIOS.mm:
838         (WebKit::WebPage::updateVisibleContentRects):
839         I forgot to update one of the condition after changing from lastTransaction to next transaction
840         in r171154.
841
842 2014-07-17  Enrica Casucci  <enrica@apple.com>
843
844         [REGRESSION WK2]The menu bar does not show up when tapping on the caret.
845         https://bugs.webkit.org/show_bug.cgi?id=135023
846         <rdar://problem/17617282>
847
848         Reviewed by Benjamin Poulain and Ryosuke Niwa.
849
850         WKContentView needs to implement hasContent to correctly show
851         the appropriate menu bar content. The patch adds this information
852         to the EditorState.
853
854         * Shared/EditorState.cpp:
855         (WebKit::EditorState::encode):
856         (WebKit::EditorState::decode):
857         * Shared/EditorState.h:
858         (WebKit::EditorState::EditorState):
859         * UIProcess/ios/WKContentViewInteraction.mm:
860         (-[WKContentView hasContent]):
861         * WebProcess/WebPage/WebPage.cpp:
862         (WebKit::WebPage::editorState):
863
864 2014-07-17  Benjamin Poulain  <benjamin@webkit.org>
865
866         [iOS][WK2] Add SPI to do a dynamic viewport update without showing any content
867         https://bugs.webkit.org/show_bug.cgi?id=135010
868
869         Reviewed by Darin Adler.
870
871         This patch add a new SPI, [WKWebView _resizeWhileHidingContentWithUpdates:] to perform all the work
872         of a dynamic viewport size update, but instead of animating the old content, it is hidden.
873
874         The patch is built on top of the animated resize mechanism. Instead of having an animation driving
875         the beginning and end, we let the content do that. The dynamic resize begins, it runs for as long as
876         the WebProcess needs, and it ends when first layer tree commit with the new content is processed.
877
878         The attribute "_isAnimatingResize" is generalized to support two modes of resizing: animated and
879         hiding content.
880
881         The attribute "_hasCommittedLoadForMainFrame" is rather silly. It is only needed because
882         [WKWebView _resizeWhileHidingContentWithUpdates:] is intended to be called a lot before the page
883         is initialized, and doing an animated resize would trash the WebProcess state.
884         I wish I had a better solution, this is not great.
885
886         * UIProcess/API/Cocoa/WKWebView.mm:
887         (-[WKWebView _processDidExit]):
888         (-[WKWebView _didCommitLoadForMainFrame]):
889         (-[WKWebView _didCommitLayerTree:]):
890         This is the key to make this work properly. We want _resizeWhileHidingContentWithUpdates: to behave
891         exactly like an animated resize to avoid bugs. So we went to the whole update mechanism using
892         _resizeAnimationTransformAdjustments to accumulate the adjustments, now we need to restore a correct
893         view state.
894
895         Calling [WKWebView _endAnimatedResize] will do exactly that, but we need to make sure we do not hit
896         the synchronization path or we would be blocked there for a while, which is what we are trying to avoid.
897
898         After r171154, WebPageProxy keeps track of what stage of dynamic viewport update we are in. Since we are
899         executing the layer tree update stage, with the right transaction ID, WebPageProxy already knows we have
900         everything we need and does not use any synchronous messages.
901
902         (-[WKWebView _dynamicViewportUpdateChangedTargetToScale:position:nextValidLayerTreeTransactionID:]):
903         (-[WKWebView _restorePageStateToExposedRect:scale:]):
904         (-[WKWebView _restorePageStateToUnobscuredCenter:scale:]):
905         (-[WKWebView _scrollToContentOffset:]):
906         (-[WKWebView _frameOrBoundsChanged]):
907         (-[WKWebView _updateVisibleContentRects]):
908         (-[WKWebView _setMinimumLayoutSizeOverride:]):
909         (-[WKWebView _setMinimumLayoutSizeOverrideForMinimalUI:]):
910         (-[WKWebView _setInterfaceOrientationOverride:]):
911         (-[WKWebView _setMaximumUnobscuredSizeOverride:]):
912         (-[WKWebView _beginAnimatedResizeWithUpdates:]):
913         (-[WKWebView _endAnimatedResize]):
914         (-[WKWebView _resizeWhileHidingContentWithUpdates:]):
915         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
916
917 2014-07-17  Brent Fulgham  <bfulgham@apple.com>
918
919         [Mac] Full screen video not always animating in the correct Space
920         https://bugs.webkit.org/show_bug.cgi?id=135020
921         <rdar://problem/17542310>
922
923         Reviewed by Dean Jackson.
924
925        The fullscreen window can "remember" the Space it was part of the first time you enter fullscreen
926        mode. Subsequent fullscreen transitions will always start from this Space, even if you move
927        the WebKit-hosted application to a different Space.
928
929        We can help the display system know when we've moved to a new Space by calling NSWindow's
930        'orderBack' method on the fullscreen window prior to starting the transition to fullscreen mode.
931        This method call hooks the window into the current Space so everything works properly.
932
933         * UIProcess/mac/WKFullScreenWindowController.mm:
934         (-[WKFullScreenWindowController beganEnterFullScreenWithInitialFrame:finalFrame:]): Add the
935         new fullscreen window to the current Space before starting transition to fullscreen.
936
937 2014-07-17  Timothy Hatcher  <timothy@apple.com>
938
939         Make console.profile record to the Timeline.
940
941         https://bugs.webkit.org/show_bug.cgi?id=134643
942
943         Reviewed by Joseph Pecoraro.
944
945         * WebProcess/WebPage/WebInspector.cpp:
946         (WebKit::WebInspector::setJavaScriptProfilingEnabled):
947         (WebKit::WebInspector::startJavaScriptProfiling):
948         (WebKit::WebInspector::stopJavaScriptProfiling):
949
950 2014-07-17  Brady Eidson  <beidson@apple.com>
951
952         Crash in ServicesOverlayController::~ServicesOverlayController.
953         <rdar://problem/17622172> and https://bugs.webkit.org/show_bug.cgi?id=135022
954
955         Reviewed by Tim Horton.
956
957         * WebProcess/WebPage/mac/ServicesOverlayController.mm:
958         (WebKit::ServicesOverlayController::~ServicesOverlayController): Don’t need to uninstall the
959             PageOverlay as it has already been destroyed by this point in WebPage::~WebPage.
960
961 2014-07-17  Tim Horton  <timothy_horton@apple.com>
962
963         Sometimes purgeable (or empty!) tiles are shown on screen when resuming the app
964         https://bugs.webkit.org/show_bug.cgi?id=135018
965         <rdar://problem/17615038>
966
967         Reviewed by Simon Fraser.
968
969         * UIProcess/DrawingAreaProxy.h:
970         (WebKit::DrawingAreaProxy::hideContentUntilNextUpdate):
971         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h:
972         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
973         (WebKit::RemoteLayerTreeDrawingAreaProxy::hideContentUntilNextUpdate):
974         * UIProcess/mac/RemoteLayerTreeHost.h:
975         * UIProcess/mac/RemoteLayerTreeHost.mm:
976         (WebKit::RemoteLayerTreeHost::detachRootLayer):
977         Add a mechanism to "hide" drawing area content until the next commit,
978         by detaching the root layer. RemoteLayerTreeHost will automatically reattach
979         it at the next commit.
980
981         * UIProcess/WebPageProxy.cpp:
982         (WebKit::WebPageProxy::viewStateDidChange):
983         * UIProcess/WebPageProxy.h:
984         Add a parameter to viewStateDidChange specifying whether dispatching the change
985         to the Web process is deferrable or not. We will also automatically use "Immediate" if
986         the view is coming in-window, like we did before.
987
988         * UIProcess/ios/WKContentView.mm:
989         (-[WKContentView _applicationWillEnterForeground:]):
990         Make use of the aforementioned new mechanisms to ensure that we immediately dispatch
991         view state changes when coming into the foreground, and will have removed the root layer
992         if a commit didn't come in while waitForDidUpdateViewState blocks.
993         
994 2014-07-17  Sanghyup Lee  <sh53.lee@samsung.com>
995
996         [EFL][WK2] Add a "focus,notfound" signal.
997         https://bugs.webkit.org/show_bug.cgi?id=134674
998
999         Reviewed by Gyuyoung Kim.
1000
1001         Add a "focus,notfound" signal to handover focus control to application
1002         because there are no elements of webview to focus on the given direction.
1003
1004         Application can decide to move the focus to next widget of ewk_view or something else
1005         by using this signal.
1006
1007         * UIProcess/API/efl/EwkViewCallbacks.h:
1008         * UIProcess/API/efl/ewk_view.h:
1009         * UIProcess/API/efl/tests/UnitTestUtils/EWK2UnitTestBase.cpp: Added keyDown and keyUp function.
1010         (EWK2UnitTest::EWK2UnitTestBase::waitUntilDirectionChanged):
1011         (EWK2UnitTest::EWK2UnitTestBase::keyDown):
1012         (EWK2UnitTest::EWK2UnitTestBase::keyUp):
1013         * UIProcess/API/efl/tests/UnitTestUtils/EWK2UnitTestBase.h:
1014         * UIProcess/API/efl/tests/test_ewk2_view.cpp:
1015         (EWK2ViewTest::FocusNotFoundCallback):
1016         (TEST_F):
1017         * UIProcess/efl/PageUIClientEfl.cpp: Removed unnecessary calls to evas_object_focus_set().
1018         (WebKit::PageUIClientEfl::takeFocus):
1019
1020 2014-07-16  Brady Eidson  <beidson@apple.com>
1021
1022         Reintroduce the SPI _websiteDataURLForContainerWithURL: that was removed in r171160
1023         https://bugs.webkit.org/show_bug.cgi?id=134984
1024
1025         Reviewed by David Kilzer.
1026
1027         * UIProcess/API/Cocoa/WKProcessPool.mm:
1028         (+[WKProcessPool _websiteDataURLForContainerWithURL:]):
1029         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
1030
1031 2014-07-16  Alexey Proskuryakov  <ap@apple.com>
1032
1033         A test that hangs at cleanup stage confuses webkitpy hugely
1034         https://bugs.webkit.org/show_bug.cgi?id=122475
1035         <rdar://problem/17184354>
1036
1037         Reviewed by Anders Carlsson.
1038
1039         Reset m_pageLoadState when the process exits cleanly - otherwise messages from a
1040         new process for the same WebPageProxy would hit assertions.
1041
1042         * UIProcess/WebPageProxy.cpp:
1043         (WebKit::WebPageProxy::processDidCrash):
1044         (WebKit::WebPageProxy::resetStateAfterProcessExited):
1045
1046 2014-07-16  David Kilzer  <ddkilzer@apple.com>
1047
1048         [iOS] Update order file paths for WebKit and WebKit2
1049         <http://webkit.org/b/134993>
1050         <rdar://problem/17557776>
1051
1052         Reviewed by Darin Adler.
1053
1054         * Configurations/Base.xcconfig: Add order file for iOS
1055         named WebKit.order.
1056
1057 2014-07-16  Brady Eidson  <beidson@apple.com>
1058
1059         Add WebSecurityOrigin "webSecurityOriginFromDatabaseIdentifier" SPI and change _websiteDataURLForContainerWithURL: SPI
1060         <rdar://problem/17454712> and https://bugs.webkit.org/show_bug.cgi?id=134984
1061
1062         Reviewed by Dan Bernstein.
1063
1064         Change _websiteDataURLForContainerWithURL: SPI to include an optional bundle identifier argument:
1065         * UIProcess/API/Cocoa/WKProcessPool.mm:
1066         (+[WKProcessPool _websiteDataURLForContainerWithURL:bundleIdentifierIfNotInContainer:]):
1067         (+[WKProcessPool _websiteDataURLForContainerWithURL:]): Deleted.
1068         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
1069
1070         Add a big shiny comment in a few key places:
1071         * DatabaseProcess/DatabaseProcess.cpp:
1072         (WebKit::DatabaseProcess::initializeDatabaseProcess):
1073         * DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp:
1074         (WebKit::UniqueIDBDatabase::UniqueIDBDatabase):
1075         * UIProcess/WebContext.cpp:
1076         (WebKit::WebContext::applyPlatformSpecificConfigurationDefaults):
1077         (WebKit::WebContext::ensureDatabaseProcess):
1078
1079 2014-07-16  Enrica Casucci  <enrica@apple.com>
1080
1081         REGRESSION (iOS WebKit2): Cannot scroll while dragging a selection.
1082         https://bugs.webkit.org/show_bug.cgi?id=134992
1083         <rdar://problem/17528020>
1084
1085         Reviewed by Benjamin Poulain.
1086
1087         This patch exposes the scroller and the visible content rect so that
1088         UIKit can implement autoscroll when dragging the selections.
1089         It also changes that way we do hit testing to allow hit test outside
1090         the clipping region and fixes the way we compute the selection rectangle
1091         for the block selection, ensuring that we consider also non text elements
1092         like images.
1093
1094         * UIProcess/ios/WKContentViewInteraction.mm:
1095         (-[WKContentView scroller]):
1096         (-[WKContentView visibleRect]):
1097         * WebProcess/WebPage/ios/WebPageIOS.mm:
1098         (WebKit::selectionBoxForRange):
1099         (WebKit::WebPage::rangeForWebSelectionAtPosition):
1100         (WebKit::WebPage::rangeForBlockAtPoint):
1101         (WebKit::WebPage::expandedRangeFromHandle):
1102         (WebKit::WebPage::contractedRangeFromHandle):
1103         (WebKit::WebPage::computeExpandAndShrinkThresholdsForHandle):
1104         (WebKit::WebPage::changeBlockSelection):
1105
1106 2014-07-16  Alexey Proskuryakov  <ap@apple.com>
1107
1108         <rdar://problem/17669097> REGRESSION (r170155): Sandbox violations using a wrong
1109         CFNetwork cache path in WebContent process
1110
1111         Rubber-stamped by Sam Weinig.
1112
1113         Before r170155, we incorrectly checked usesNetworkProcess(), which always returns
1114         false at this point in initialization sequence. But we did the right thing, as we
1115         always need to set the cache path, even when network process is used for most loading.
1116
1117         * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::platformInitializeWebProcess):
1118
1119 2014-07-16  Timothy Horton  <timothy_horton@apple.com>
1120
1121         Dispatch top content inset changes immediately if synchronously waiting for view state changes
1122         ​https://bugs.webkit.org/show_bug.cgi?id=134942
1123         <rdar://problem/17666800>
1124
1125         Reviewed by Simon Fraser.
1126
1127         * UIProcess/API/mac/WKView.mm:
1128         (-[WKView _dispatchSetTopContentInset]):
1129         (-[WKView _setTopContentInset:]):
1130         Move the check from _setTopContentInset: to _dispatchSetTopContentInset
1131         that ensures that we only send the message if the top content inset changed.
1132
1133 2014-07-16  Benjamin Poulain  <bpoulain@apple.com>
1134
1135         [iOS][WK2] Synchronize the dynamic viewport updates with their layer tree commit
1136         https://bugs.webkit.org/show_bug.cgi?id=134965
1137         Related to <rdar://problem/17082607>
1138
1139         Reviewed by Tim Horton.
1140
1141         Dynamic viewport update relies on the _resizeAnimationTransformAdjustments being applied
1142         to the page at the new size during the transition.
1143
1144         Because of the races between the LayerTree Commit and DynamicViewportSizeUpdate, the transform
1145         can be applied to the wrong set of tiles.
1146         This is mostly a problem for unresponsive WebProcess or when the synchronization is done
1147         immediately.
1148
1149         There is at least one more case that is not handled: if synchronizeDynamicViewportUpdate()
1150         completely fails to get the new page, the UIProcess is in a somewhat messy state.
1151         I will look into that separately than the layer tree synchronization.
1152
1153         * UIProcess/API/Cocoa/WKWebView.mm:
1154         (-[WKWebView _didCommitLayerTree:]):
1155         (-[WKWebView _dynamicViewportUpdateChangedTargetToScale:position:nextValidLayerTreeTransactionID:]):
1156         (-[WKWebView _dynamicViewportUpdateChangedTargetToScale:position:]): Deleted.
1157         * UIProcess/API/Cocoa/WKWebViewInternal.h:
1158         * UIProcess/PageClient.h:
1159         * UIProcess/WebPageProxy.cpp:
1160         (WebKit::WebPageProxy::WebPageProxy):
1161         (WebKit::WebPageProxy::resetState):
1162         * UIProcess/WebPageProxy.h:
1163         * UIProcess/ios/PageClientImplIOS.h:
1164         * UIProcess/ios/PageClientImplIOS.mm:
1165         (WebKit::PageClientImpl::dynamicViewportUpdateChangedTarget):
1166         * UIProcess/ios/WebPageProxyIOS.mm:
1167         (WebKit::WebPageProxy::dynamicViewportSizeUpdate):
1168         (WebKit::WebPageProxy::synchronizeDynamicViewportUpdate):
1169         (WebKit::WebPageProxy::didCommitLayerTree):
1170         (WebKit::WebPageProxy::dynamicViewportUpdateChangedTarget):
1171         * WebProcess/WebPage/WebPage.cpp:
1172         (WebKit::WebPage::WebPage):
1173         (WebKit::WebPage::didCommitLoad):
1174         * WebProcess/WebPage/WebPage.h:
1175         * WebProcess/WebPage/WebPage.messages.in:
1176         * WebProcess/WebPage/ios/WebPageIOS.mm:
1177         (WebKit::WebPage::synchronizeDynamicViewportUpdate):
1178         (WebKit::WebPage::updateVisibleContentRects):
1179         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
1180         (WebKit::RemoteLayerTreeDrawingArea::nextTransactionID):
1181         (WebKit::RemoteLayerTreeDrawingArea::currentTransactionID): Deleted.
1182
1183 2014-07-16  Dan Bernstein  <mitz@apple.com>
1184
1185         REGRESSION (r170653): Web Content service’s Info.plist has wrong format
1186         https://bugs.webkit.org/show_bug.cgi?id=134973
1187
1188         Reviewed by Alexey Proskuryakov.
1189
1190         * WebKit2.xcodeproj/project.pbxproj: Updated the Add CFBundle Localization Info.plist Key
1191         script build phases to convert Info.plist back to binary format if the
1192         PLIST_FILE_OUTPUT_FORMAT build setting requires it.
1193
1194 2014-07-15  Benjamin Poulain  <bpoulain@apple.com>
1195
1196         Fix r171124
1197
1198         * UIProcess/API/Cocoa/WKWebView.mm:
1199         (-[WKWebView _scrollToContentOffset:]):
1200         On landing, I changed the min/max branches to shrunkTo/expandedTo, but the return value
1201         of those was ignored.
1202
1203 2014-07-15  Dan Bernstein  <mitz@apple.com>
1204
1205         WKWebView’s FormClient::willSubmitForm should use CompletionHandlerCallChecker
1206         https://bugs.webkit.org/show_bug.cgi?id=134951
1207
1208         Reviewed by Tim Horton.
1209
1210         * UIProcess/API/Cocoa/WKWebView.mm:
1211         (-[WKWebView _setFormDelegate:]):
1212
1213 2014-07-15  Benjamin Poulain  <benjamin@webkit.org>
1214
1215         [iOS][WK2] Scrolling request from the scrolling tree must be limited to offsets in the document
1216         https://bugs.webkit.org/show_bug.cgi?id=134952
1217         <rdar://problem/17647116>
1218
1219         Reviewed by Enrica Casucci.
1220
1221         When we received a scroll request, we were taking that offset directly to set the UIScrollView
1222         scroll position. This is a problem if a page request scrolling to an invalid position, we were
1223         still doing it.
1224
1225         This patch limits the position to be inside the document.
1226
1227         -- Why not limit the scroll offset in the WebProcess when we receive the scroll request? --
1228
1229         Some pages rely on the page scale factor changing instantly, because that is how it worked
1230         on WebKit1.
1231
1232         On WebKit2, the WebProcess cannot know the valid range because the obscured insets are changing
1233         dynamically, and the page scale factor can change in response to WebProcess events (the focus
1234         changing for example). To make the page works, the WebProcess does not restrict the scroll position.
1235
1236         In that architecture, the UIProcess has to sanitize the input, which was not done before this patch.
1237
1238         -- Why not use changeContentOffsetBoundedInValidRange()?
1239
1240         The scroll offset as seen by the page is relative to the unobscured rect. While the position used
1241         for history item is a visual position. All we need in this case is a position in the view.
1242
1243         * UIProcess/API/Cocoa/WKWebView.mm:
1244         (-[WKWebView _scrollToContentOffset:]):
1245         * UIProcess/WebPageProxy.h:
1246         * UIProcess/ios/WebPageProxyIOS.mm:
1247         (WebKit::WebPageProxy::resendLastVisibleContentRects):
1248
1249 2014-07-15  Timothy Horton  <timothy_horton@apple.com>
1250
1251         Dispatch top content inset changes immediately if synchronously waiting for view state changes
1252         https://bugs.webkit.org/show_bug.cgi?id=134942
1253         <rdar://problem/17666800>
1254
1255         Reviewed by Simon Fraser.
1256
1257         * UIProcess/API/mac/WKView.mm:
1258         (-[WKView endDeferringViewInWindowChanges]):
1259         (-[WKView endDeferringViewInWindowChangesSync]):
1260         (-[WKView _dispatchSetTopContentInset]):
1261         (-[WKView _setTopContentInset:]):
1262         Send top content inset changes immediately before sync-waiting for new tiles from the Web Process.
1263         This will ensure that the incoming contents have the right top content inset, and we don't
1264         flash between the wrong inset and the right one.
1265
1266 2014-07-15  Enrica Casucci  <enrica@apple.com>
1267
1268         REGRESSION(WK2 iOS): Safari hangs when switching focus from a field using the Tab key.
1269         https://bugs.webkit.org/show_bug.cgi?id=134934
1270         <rdar://problem/17224638>
1271
1272         Reviewed by Tim Horton.
1273
1274         * UIProcess/ios/WKContentViewInteraction.mm:
1275         
1276         Tab and back tab should be handled as special keys that have
1277         a command associated. The command specifies for each key the relevant
1278         action. This patch implements the commands property to create the association
1279         between key and command and the relevant actions that will execute the same
1280         code executed when the used taps on the < > buttons in the accessory bar.
1281         
1282         (-[WKContentView keyCommands]):
1283         (-[WKContentView _nextAccessoryTab:]):
1284         (-[WKContentView _prevAccessoryTab:]):
1285
1286 2014-07-15  Oliver Hunt  <oliver@apple.com>
1287
1288         More tidying of the webcontent sandbox profile
1289         https://bugs.webkit.org/show_bug.cgi?id=134938
1290
1291         Reviewed by Alexey Proskuryakov.
1292
1293         Remove some excessive abilities from the profile and make
1294         the required ones explicit.
1295
1296         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
1297
1298 2014-07-14  Andreas Kling  <akling@apple.com>
1299
1300         [iOS] Don't progressively re-render tiles while pinch-zooming under memory pressure.
1301         <https://webkit.org/b/134915>
1302
1303         When we're under memory pressure, the last thing we want to be doing is
1304         creating gratuitous new IOSurfaces. Just wait for the gesture to end before
1305         rendering at the new scale.
1306
1307         Reviewed by Tim Horton.
1308
1309         * WebProcess/WebPage/ios/WebPageIOS.mm:
1310         (WebKit::WebPage::updateVisibleContentRects):
1311
1312 2014-07-14  Joseph Pecoraro  <pecoraro@apple.com>
1313
1314         [Cocoa] _WKRemoteObjectInterface leaks NSString ivar
1315         https://bugs.webkit.org/show_bug.cgi?id=134914
1316
1317         Reviewed by Simon Fraser.
1318
1319         Release our copied NSString in dealloc.
1320
1321         * Shared/API/Cocoa/_WKRemoteObjectInterface.mm:
1322         (-[_WKRemoteObjectInterface dealloc]):
1323
1324 2014-07-14  Dean Jackson  <dino@apple.com>
1325
1326         [PlugIns] Check for a non-null snapshot image before trying to decode it
1327         https://bugs.webkit.org/show_bug.cgi?id=134913
1328         <rdar://problem/17606033>
1329
1330         Reviewed by Tim Horton.
1331
1332         Changeset r169820 introduced a bug where we could examine the pixels of
1333         an image (looking for solid colors) before checking if the image actually
1334         existed.
1335
1336         I added a null check, and moved the code around a bit to avoid checking
1337         for existence three times.
1338
1339         * WebProcess/Plugins/PluginView.cpp:
1340         (WebKit::PluginView::pluginSnapshotTimerFired): Check that snapshotImage exists
1341         before trying to look at it.
1342
1343 2014-07-14  Anders Carlsson  <andersca@apple.com>
1344
1345         Fix 32-bit build.
1346
1347         * UIProcess/Cocoa/SessionStateCoding.mm:
1348         (WebKit::encodeSessionState):
1349
1350 2014-07-14  Anders Carlsson  <andersca@apple.com>
1351
1352         Use the legacy session coder for encoding/decoding session state
1353         https://bugs.webkit.org/show_bug.cgi?id=134910
1354
1355         Reviewed by Beth Dakin.
1356
1357         * UIProcess/Cocoa/SessionStateCoding.mm:
1358         (WebKit::encodeSessionState):
1359         (WebKit::decodeSessionState):
1360
1361 2014-07-14  Oliver Hunt  <oliver@apple.com>
1362
1363         Restrict network process to remote connections
1364         https://bugs.webkit.org/show_bug.cgi?id=134908
1365
1366         Reviewed by Geoffrey Garen.
1367
1368         Further restrict network client
1369
1370         * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb:
1371
1372 2014-07-14  Tim Horton  <timothy_horton@apple.com>
1373
1374         ASSERT(isMainThread()) under OneShotDisplayLinkHandler
1375         https://bugs.webkit.org/show_bug.cgi?id=134900
1376
1377         Reviewed by Simon Fraser.
1378
1379         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
1380         (-[OneShotDisplayLinkHandler displayLinkFired:]):
1381         isMainThread means the Web thread sometimes.
1382
1383 2014-07-14  Tim Horton  <timothy_horton@apple.com>
1384
1385         Fix the build.
1386
1387         * UIProcess/API/Cocoa/WKWebView.mm:
1388         (-[WKWebView _frameOrBoundsChanged]):
1389         (-[WKWebView _beginAnimatedResizeWithUpdates:]):
1390         * UIProcess/API/ios/WKViewIOS.mm:
1391         (-[WKView _frameOrBoundsChanged]):
1392
1393 2014-07-14  Carlos Alberto Lopez Perez  <clopez@igalia.com>
1394
1395         [UNIX] Log error description when failing to create shared memory file.
1396         https://bugs.webkit.org/show_bug.cgi?id=134892
1397
1398         Reviewed by Darin Adler.
1399
1400         * Platform/unix/SharedMemoryUnix.cpp:
1401         (WebKit::SharedMemory::create): Print the string describing the error number (errno).
1402
1403 2014-07-14  Benjamin Poulain  <benjamin@webkit.org>
1404
1405         [iOS][WK2] On rotation, RemoteLayerTreeDrawingArea renders one extra frame at the wrong orientation
1406         https://bugs.webkit.org/show_bug.cgi?id=134875
1407
1408         Reviewed by Tim Horton.
1409
1410         On animated resize, the size of the DrawingAreaProxy was changed before the layout parameters were
1411         changed. This in turn caused the WebProcess's DrawingArea to flush the layer tree while still
1412         at the wrong orientation.
1413
1414         This patch fixes the issue by making a special case for animated resize:
1415         -While starting animated resize, _frameOrBoundsChanged can be called several times in response to
1416          the API's client changing the WKWebView. In that case, we do not update the drawing area.
1417         -After the "updateBlock" is executed and the size have been changed, the dynamic viewport update
1418          is computed, the dynamicViewportSizeUpdate is sent to the WebProcess, followed by the message
1419          DrawingArea::updateGeometry(). Since both messages are asynchronous, they are received in that
1420          order, and the updateGeometry() is always done after the viewport configuration has been updated.
1421
1422         * UIProcess/API/Cocoa/WKWebView.mm:
1423         (-[WKWebView _frameOrBoundsChanged]):
1424         (-[WKWebView _beginAnimatedResizeWithUpdates:]):
1425         * UIProcess/ios/WKContentView.h:
1426         * UIProcess/ios/WKContentView.mm:
1427         (-[WKContentView setMinimumSize:]): Deleted.
1428
1429 2014-07-14  Benjamin Poulain  <bpoulain@apple.com>
1430
1431         [iOS][WK2] Fix withinEpsilon()
1432         https://bugs.webkit.org/show_bug.cgi?id=134798
1433
1434         Reviewed by Darin Adler.
1435
1436         Move the function back to WKWebView, it is no longer needed in WKContentView.
1437
1438         Use the real types as input to properly verify that the two inputs are within
1439         a small value of the 32bit floating point.
1440
1441         The epsilon we use is always on 32 bits float because we want to avoid doing work for changes
1442         that would not make any difference on float.
1443
1444         The source of those small changes comes from the fact UIProcess does a lot of processing
1445         on CGFloat, which are double on 64bits architecture, while the WebProcess use 32bits floating point
1446         for scale. When we are getting updates from the WebProcess, we should ignore any small differences
1447         caused by the computations done with less precision.
1448
1449         * UIProcess/API/Cocoa/WKWebView.mm:
1450         (withinEpsilon):
1451         * UIProcess/ios/WKContentViewInteraction.h:
1452         (withinEpsilon): Deleted.
1453
1454 2014-07-14  Bear Travis  <betravis@adobe.com>
1455
1456         [Feature Queries] Enable Feature Queries on Mac
1457         https://bugs.webkit.org/show_bug.cgi?id=134404
1458
1459         Reviewed by Antti Koivisto.
1460
1461         Enable Feature Queries on Mac and resume running the
1462         feature tests.
1463
1464         * Configurations/FeatureDefines.xcconfig: Turn on
1465         ENABLE_CSS3_CONDITIONAL_RULES.
1466
1467 2014-07-14  Anders Carlsson  <andersca@apple.com>
1468
1469         Make shouldKeepCurrentBackForwardListItemInList part of WKPageLoaderClientV5 to avoid breaking ABI
1470         https://bugs.webkit.org/show_bug.cgi?id=134889
1471
1472         Reviewed by Beth Dakin.
1473
1474         * UIProcess/API/C/WKPage.cpp:
1475         * UIProcess/API/C/WKPageLoaderClient.h:
1476
1477 2014-07-14  Dan Bernstein  <mitz@apple.com>
1478
1479         REGRESSION (r171045): Reproducible crash on navigation in PageClientImpl::willRecordNavigationSnapshot
1480         https://bugs.webkit.org/show_bug.cgi?id=134887
1481
1482         Reviewed by Tim Horton.
1483
1484         * UIProcess/mac/PageClientImpl.mm:
1485         (WebKit::PageClientImpl::navigationGestureDidBegin): nil-check m_webView. It can be nil when
1486         the client is using WKView directly.
1487         (WebKit::PageClientImpl::navigationGestureWillEnd): Ditto.
1488         (WebKit::PageClientImpl::navigationGestureDidEnd): Ditto.
1489         (WebKit::PageClientImpl::willRecordNavigationSnapshot): Ditto.
1490
1491 2014-07-14  Eric Carlson  <eric.carlson@apple.com>
1492
1493         [Mac] don't enable low power audio mode on external output devices
1494         https://bugs.webkit.org/show_bug.cgi?id=134877
1495
1496         Reviewed by Sam Weinig.
1497
1498         * PluginProcess/PluginProcess.h: Add an empty implementation of 
1499             AudioHardwareListener::audioOutputDeviceChanged.
1500
1501 2014-07-14  Tim Horton  <timothy_horton@apple.com>
1502
1503         [iOS] Throttle painting using a UI-process-side CADisplayLink
1504         https://bugs.webkit.org/show_bug.cgi?id=134879
1505         <rdar://problem/17641699>
1506
1507         Reviewed by Simon Fraser.
1508
1509         Just waiting for CA to commit is insufficient to actually throttle to 60fps,
1510         because nothing will block the main runloop from spinning.
1511
1512         Instead, listen to a CADisplayLink, and send didUpdate to the WebProcess
1513         the first time it fires after we commit. This is not a guarantee that
1514         our content is on the screen, but we don't have any way to make that guarantee yet.
1515
1516         This will throttle painting, rAF, etc. to the display refresh rate.
1517
1518         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h:
1519         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
1520         (-[OneShotDisplayLinkHandler initWithDrawingAreaProxy:]):
1521         (-[OneShotDisplayLinkHandler dealloc]):
1522         (-[OneShotDisplayLinkHandler displayLinkFired:]):
1523         (-[OneShotDisplayLinkHandler invalidate]):
1524         (-[OneShotDisplayLinkHandler schedule]):
1525         (WebKit::RemoteLayerTreeDrawingAreaProxy::RemoteLayerTreeDrawingAreaProxy):
1526         (WebKit::RemoteLayerTreeDrawingAreaProxy::~RemoteLayerTreeDrawingAreaProxy):
1527         (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
1528         (WebKit::RemoteLayerTreeDrawingAreaProxy::didRefreshDisplay):
1529         (WebKit::RemoteLayerTreeDrawingAreaProxy::coreAnimationDidCommitLayers): Deleted.
1530
1531 2014-07-14  Dan Bernstein  <mitz@apple.com>
1532
1533         <rdar://problem/17657391> [iOS] Networking process writes persistent credentials to the keychain
1534         https://bugs.webkit.org/show_bug.cgi?id=134878
1535
1536         Reviewed by Sam Weinig.
1537
1538         Route CFNetwork’s calls to Security API through to the UI process.
1539
1540         * NetworkProcess/ios/NetworkProcessIOS.mm:
1541         (WebKit::NetworkProcess::platformInitializeNetworkProcess): Initialize SecItemShim.
1542
1543         * Shared/mac/SecItemShim.cpp:
1544         (WebKit::SecItemShim::initialize): On iOS, rather than using a shim library, supply
1545         CFNetwork with alternate functions to call.
1546
1547         * Shared/mac/SecItemShim.messages.in: Removed #if !PLATFORM(IOS).
1548         * UIProcess/mac/SecItemShimProxy.messages.in: Ditto.
1549
1550         * config.h: Define ENABLE_SEC_ITEM_SHIM to 1 on iOS as well.
1551
1552 2014-07-14  Dan Bernstein  <mitz@apple.com>
1553
1554         <rdar://problem/17398060> NetworkProcess sometimes hangs under copyDefaultCredentialForProtectionSpace
1555         https://bugs.webkit.org/show_bug.cgi?id=134666
1556
1557         Reviewed by Tim Horton.
1558
1559         A SecItem may have an attribute whose value is a SecAccessControlRef, which is not supported
1560         by ArgumentCodersCF. In debug builds, trying to encode a CFDictionary containing a value of
1561         unsupprted type causes an assertion to fail, but in release builds encoding succeeds, and
1562         only decoding fails, in this case silently, simply not delivering the
1563         SecItemShim::secItemResponse message.
1564
1565         The fix is to teach ArgumentCodersCF about SecAccessControlRef.
1566
1567         * Shared/cf/ArgumentCodersCF.cpp:
1568         (IPC::typeFromCFTypeRef): Check for the SecAccessControlRef type.
1569         (IPC::encode): Encode the SecAccessControl serialized into CFData.
1570         (IPC::decode): Deserialize a SecAccessControl from the decoded CFData.
1571         * Shared/cf/ArgumentCodersCF.h:
1572         * config.h: Defined HAVE_SEC_ACCESS_CONTROL.
1573
1574 2014-07-13  Dan Bernstein  <mitz@apple.com>
1575
1576         <rdar://problem/17295636> [Cocoa] Include element snapshot in _WKActivatedElementInfo
1577         https://bugs.webkit.org/show_bug.cgi?id=134872
1578
1579         Reviewed by Sam Weinig.
1580
1581         * Shared/InteractionInformationAtPosition.cpp:
1582         (WebKit::InteractionInformationAtPosition::encode): Encode the image if there is one.
1583         (WebKit::InteractionInformationAtPosition::decode): Decode the image if there is one.
1584         * Shared/InteractionInformationAtPosition.h: Added an image member to the struct.
1585
1586         * UIProcess/API/Cocoa/_WKActivatedElementInfo.h: Exposed the boundingRect property and added
1587         an image property.
1588         * UIProcess/API/Cocoa/_WKActivatedElementInfo.mm:
1589         (-[_WKActivatedElementInfo _initWithType:URL:location:title:rect:image:]): Added an image
1590         parameter, which is stored in a new ivar.
1591         (-[_WKActivatedElementInfo image]): Added this getter, which converts the ShareableBitmap
1592         into a cached Cocoa image and returns it.
1593         * UIProcess/API/Cocoa/_WKActivatedElementInfoInternal.h: Added image parameter to the
1594         initializer, removed _boundingRect property declaration from here.
1595
1596         * UIProcess/ios/WKActionSheetAssistant.mm:
1597         (-[WKActionSheetAssistant showImageSheet]): Pass the image from the position information
1598         into the _WKActivatedElementInfo initializer.
1599         (-[WKActionSheetAssistant showLinkSheet]): Ditto.
1600
1601         * WebProcess/WebPage/WebPage.cpp:
1602         (WebKit::WebPage::snapshotNode): Added.
1603         * WebProcess/WebPage/WebPage.h:
1604
1605         * WebProcess/WebPage/ios/WebPageIOS.mm:
1606         (WebKit::WebPage::getPositionInformation): If the element is a link or an image, store a
1607         snapshot of it in the image member of the InteractionInformationAtPosition.
1608
1609 2014-07-13  Dan Bernstein  <mitz@apple.com>
1610
1611         [Cocoa] Clean up session state API a little
1612         https://bugs.webkit.org/show_bug.cgi?id=134871
1613
1614         Reviewed by Darin Adler.
1615
1616         * UIProcess/API/Cocoa/WKWebView.mm:
1617         (-[WKWebView _sessionState]):
1618         (-[WKWebView _restoreFromSessionState:]): Deleted.
1619         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1620
1621 2014-07-13  Javier Fernandez  <jfernandez@igalia.com>
1622
1623         REGRESSION(r171045) [GTK] Build broken.
1624         https://bugs.webkit.org/show_bug.cgi?id=134867
1625
1626         Unreviewed GTK build fix after r171045.
1627
1628         * UIProcess/API/gtk/PageClientImpl.cpp:
1629         (WebKit::PageClientImpl::willRecordNavigationSnapshot):
1630         * UIProcess/API/gtk/PageClientImpl.h:
1631
1632 2014-07-13  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
1633
1634         Unreviewed, EFL build fix since r171045.
1635
1636         * UIProcess/CoordinatedGraphics/WebView.h:
1637
1638 2014-07-12  Dan Bernstein  <mitz@apple.com>
1639
1640         [Cocoa] Notify the client when a navigation snapshot is taken
1641         https://bugs.webkit.org/show_bug.cgi?id=134865
1642
1643         Reviewed by Sam Weinig.
1644
1645         * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h: Declared new delegate method.
1646
1647         * UIProcess/Cocoa/NavigationState.h:
1648         * UIProcess/Cocoa/NavigationState.mm:
1649         (WebKit::NavigationState::setNavigationDelegate): Initialize new flag in
1650         m_navigationDelegateMethods.
1651         (WebKit::NavigationState::willRecordNavigationSnapshot): Added. Calls the new
1652         WKNavigationDelegate method.
1653
1654         * UIProcess/PageClient.h: Declared new client function.
1655
1656         * UIProcess/WebPageProxy.cpp:
1657         (WebKit::WebPageProxy::willRecordNavigationSnapshot): Added. Calls the new client function.
1658         * UIProcess/WebPageProxy.h:
1659
1660         * UIProcess/ios/PageClientImplIOS.h:
1661         * UIProcess/ios/PageClientImplIOS.mm:
1662         (WebKit::PageClientImpl::willRecordNavigationSnapshot): Override that calls
1663         NavigationState::willRecordNavigationSnapshot.
1664
1665         * UIProcess/mac/PageClientImpl.h:
1666         * UIProcess/mac/PageClientImpl.mm:
1667         (WebKit::PageClientImpl::willRecordNavigationSnapshot): Ditto.
1668
1669         * UIProcess/mac/ViewSnapshotStore.mm:
1670         (WebKit::ViewSnapshotStore::recordSnapshot): Added a call to
1671         WebPageProxy::willRecordNavigationSnapshot.
1672
1673 2014-07-12  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
1674
1675         Unreviewed, fix EFL build break since r171034.
1676
1677         * UIProcess/CoordinatedGraphics/WebView.h:
1678         * UIProcess/efl/WebContextEfl.cpp:
1679         (WebKit::WebContext::platformMediaCacheDirectory):
1680
1681 2014-07-12  Darin Adler  <darin@apple.com>
1682
1683         Try to fix 32-bit Mac build.
1684
1685         * UIProcess/mac/PageClientImpl.mm:
1686         (WebKit::PageClientImpl::navigationGestureDidBegin): Added WK_API_ENABLED conditional.
1687         (WebKit::PageClientImpl::navigationGestureWillEnd): Ditto.
1688         (WebKit::PageClientImpl::navigationGestureDidEnd): Ditto.
1689
1690 2014-07-12  Javier Fernandez  <jfernandez@igalia.com>
1691
1692         REGRESSION(r171034) [GTK] Build broken.
1693         https://bugs.webkit.org/show_bug.cgi?id=134861
1694
1695         Unreviewed GTK build fix.
1696
1697         * UIProcess/API/gtk/PageClientImpl.cpp:
1698         (WebKit::PageClientImpl::navigationGestureDidBegin):
1699         (WebKit::PageClientImpl::navigationGestureWillEnd):
1700         (WebKit::PageClientImpl::navigationGestureDidEnd):
1701         * UIProcess/API/gtk/PageClientImpl.h:
1702
1703 2014-07-12  Javier Fernandez  <jfernandez@igalia.com>
1704
1705         REGRESSION(r171024) [GTK] Build broken.
1706         https://bugs.webkit.org/show_bug.cgi?id=134859
1707
1708         Unreviewed GTK build fix.
1709
1710         * UIProcess/gtk/WebContextGtk.cpp:
1711         (WebKit::WebContext::platformMediaCacheDirectory):
1712
1713 2014-07-12  Dan Bernstein  <mitz@apple.com>
1714
1715         <rdar://problem/16020380> [Cocoa] Inform the client when back-forward navigation gestures begin and end
1716         https://bugs.webkit.org/show_bug.cgi?id=134853
1717
1718         Reviewed by Sam Weinig.
1719
1720         * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h: Declared new WKNavigationDelegate
1721         methods.
1722
1723         * UIProcess/API/Cocoa/WKWebView.mm:
1724         (-[WKWebView _isShowingNavigationGestureSnapshot]): Added this getter.
1725
1726         * UIProcess/API/Cocoa/WKWebViewPrivate.h: Declared new property
1727         _isShowingNavigationGestureSnapshot.
1728
1729         * UIProcess/Cocoa/NavigationState.h:
1730         * UIProcess/Cocoa/NavigationState.mm:
1731         (WebKit::NavigationState::setNavigationDelegate): Initialize new flags in
1732         m_navigationDelegateMethods.
1733         (WebKit::NavigationState::navigationGestureDidBegin): Added. Calls the new
1734         WKNavigationDelegate method.
1735         (WebKit::NavigationState::navigationGestureWillEnd): Ditto.
1736         (WebKit::NavigationState::navigationGestureDidEnd): Ditto.
1737
1738         * UIProcess/PageClient.h: Declared new client functions.
1739
1740         * UIProcess/WebPageProxy.cpp:
1741         (WebKit::WebPageProxy::WebPageProxy): Initialize new member variable.
1742         (WebKit::WebPageProxy::navigationGestureDidBegin): Set m_isShowingNavigationGestureSnapshot
1743         and call the new client function.
1744         (WebKit::WebPageProxy::navigationGestureWillEnd): Call the new client function.
1745         (WebKit::WebPageProxy::navigationGestureDidEnd): Ditto.
1746         (WebKit::WebPageProxy::navigationGestureSnapshotWasRemoved): Clear
1747         m_isShowingNavigationGestureSnapshot.
1748         * UIProcess/WebPageProxy.h:
1749         (WebKit::WebPageProxy::isShowingNavigationGestureSnapshot): Added this getter.
1750
1751         * UIProcess/ios/PageClientImplIOS.h: Declared overrides of new client functions.
1752         * UIProcess/ios/PageClientImplIOS.mm:
1753         (WebKit::PageClientImpl::navigationGestureDidBegin): Override that calls the new
1754         NavigationState function.
1755         (WebKit::PageClientImpl::navigationGestureWillEnd): Ditto.
1756         (WebKit::PageClientImpl::navigationGestureDidEnd): Ditto.
1757
1758         * UIProcess/ios/ViewGestureControllerIOS.mm:
1759         (WebKit::ViewGestureController::beginSwipeGesture): Added calls to
1760         WebPageProxy::navigationGestureDidBegin and WebPageProxy::navigationGestureWillEnd.
1761         (WebKit::ViewGestureController::endSwipeGesture): Added calls to
1762         WebPageProxy::navigationGestureDidEnd.
1763         (WebKit::ViewGestureController::removeSwipeSnapshot): Added call to
1764         WebPageProxy::navigationGestureSnapshotWasRemoved.
1765
1766         * UIProcess/mac/PageClientImpl.h: Declared overrides of new client functions.
1767         * UIProcess/mac/PageClientImpl.mm:
1768         (WebKit::PageClientImpl::navigationGestureDidBegin): Override that calls the new
1769         NavigationState function.
1770         (WebKit::PageClientImpl::navigationGestureWillEnd): Ditto.
1771         (WebKit::PageClientImpl::navigationGestureDidEnd): Ditto.
1772
1773         * UIProcess/mac/ViewGestureControllerMac.mm:
1774         (WebKit::ViewGestureController::beginSwipeGesture): Added call to
1775         WebPageProxy::navigationGestureDidBegin.
1776         (WebKit::ViewGestureController::endSwipeGesture): Added calls to
1777         WebPageProxy::navigationGestureDidEnd.
1778         (WebKit::ViewGestureController::removeSwipeSnapshot): Added call to
1779         WebPageProxy::navigationGestureSnapshotWasRemoved.
1780
1781 2014-07-12  Oliver Hunt  <oliver@apple.com>
1782
1783         Fix typo in prior patch
1784         https://bugs.webkit.org/show_bug.cgi?id=134858
1785
1786         Reviewed by Sam Weinig.
1787
1788         Fix typo
1789
1790         * UIProcess/mac/WebContextMac.mm:
1791         (WebKit::WebContext::platformDefaultCookieStorageDirectory):
1792
1793 2014-07-12  Dan Bernstein  <mitz@apple.com>
1794
1795         [Cocoa] Client is not notified of same-document navigations
1796         https://bugs.webkit.org/show_bug.cgi?id=134855
1797
1798         Reviewed by Sam Weinig.
1799
1800         * UIProcess/API/APILoaderClient.h:
1801         (API::LoaderClient::didSameDocumentNavigationForFrame): Added navigationID parameter.
1802
1803         * UIProcess/API/C/WKPage.cpp:
1804         (WKPageSetPageLoaderClient): Ditto.
1805
1806         * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h: Added new enum and delegate method.
1807
1808         * UIProcess/Cocoa/NavigationState.h: Declare override of
1809         API::LoaderClient::didSameDocumentNavigationForFrame. Added flag in
1810         m_navigationDelegateMethods struct.
1811         * UIProcess/Cocoa/NavigationState.mm:
1812         (WebKit::NavigationState::setNavigationDelegate): Initialize new m_navigationDelegateMethods
1813         flag.
1814         (WebKit::toWKSameDocumentNavigationType): Added this helper to convert from internal to API
1815         values.
1816         (WebKit::NavigationState::LoaderClient::didSameDocumentNavigationForFrame): Override to call
1817         the delegate method, if implemented.
1818
1819         * UIProcess/WebPageProxy.cpp:
1820         (WebKit::WebPageProxy::didSameDocumentNavigationForFrame): Added navigationID parameter,
1821         which is forwarded to the client.
1822         * UIProcess/WebPageProxy.h: Added navigationID parameter.
1823         * UIProcess/WebPageProxy.messages.in: Ditto.
1824
1825         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1826         (WebKit::WebFrameLoaderClient::dispatchDidChangeLocationWithinPage): Send the navigation ID.
1827         (WebKit::WebFrameLoaderClient::dispatchDidPushStateWithinPage): Ditto.
1828         (WebKit::WebFrameLoaderClient::dispatchDidReplaceStateWithinPage): Ditto.
1829         (WebKit::WebFrameLoaderClient::dispatchDidPopStateWithinPage): Ditto.
1830
1831 2014-07-12  Oliver Hunt  <oliver@apple.com>
1832
1833         Extend WebContent sandbox to allow some extra access for frameworks
1834         https://bugs.webkit.org/show_bug.cgi?id=134844
1835
1836         Reviewed by Sam Weinig.
1837
1838         Open up the webcontent sandbox a bit so that some external frameworks
1839         can work correctly.
1840
1841         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
1842         * Shared/WebProcessCreationParameters.cpp:
1843         (WebKit::WebProcessCreationParameters::encode):
1844         (WebKit::WebProcessCreationParameters::decode):
1845         * Shared/WebProcessCreationParameters.h:
1846         * UIProcess/WebContext.cpp:
1847         (WebKit::WebContext::createNewWebProcess):
1848         (WebKit::WebContext::mediaCacheDirectory):
1849         * UIProcess/WebContext.h:
1850         * UIProcess/mac/WebContextMac.mm:
1851         (WebKit::WebContext::platformMediaCacheDirectory):
1852         * WebProcess/cocoa/WebProcessCocoa.mm:
1853         (WebKit::WebProcess::platformInitializeWebProcess):
1854
1855 2014-07-12  Oliver Hunt  <oliver@apple.com>
1856
1857         Temporary work around for <rdar://<rdar://problem/17513375>
1858         https://bugs.webkit.org/show_bug.cgi?id=134848
1859
1860         Reviewed by Sam Weinig.
1861
1862         Temporarily work around <rdar://<rdar://problem/17513375> by
1863         dropping the explicit cookie storage if it points out of the
1864         container.
1865
1866         * UIProcess/mac/WebContextMac.mm:
1867         (WebKit::WebContext::platformDefaultCookieStorageDirectory):
1868
1869 2014-07-11  Enrica Casucci  <enrica@apple.com>
1870
1871         Implement textStylingAtPosition in WK2.
1872         https://bugs.webkit.org/show_bug.cgi?id=134843
1873         <rdar://problem/17614981>
1874
1875         Reviewed by Benjamin Poulain.
1876
1877         Adding information about typing attributes to EditorState so
1878         that we can implement textStylingAtPosition.
1879
1880         * Shared/EditorState.cpp:
1881         (WebKit::EditorState::encode):
1882         (WebKit::EditorState::decode):
1883         * Shared/EditorState.h:
1884         (WebKit::EditorState::EditorState):
1885         * UIProcess/ios/WKContentViewInteraction.mm:
1886         (-[WKContentView textStylingAtPosition:inDirection:]):
1887         (-[WKContentView canPerformAction:withSender:]):
1888         (-[WKContentView toggleBoldface:]):
1889         (-[WKContentView toggleItalics:]):
1890         (-[WKContentView toggleUnderline:]):
1891         * WebProcess/WebPage/WebPage.cpp:
1892         (WebKit::WebPage::editorState):
1893
1894 2014-07-11  Oliver Hunt  <oliver@apple.com>
1895
1896         Tighten WebContent sandbox
1897         https://bugs.webkit.org/show_bug.cgi?id=134834
1898
1899         Reviewed by Sam Weinig.
1900
1901         Define a much tighter sandbox profile for the WebContent process
1902
1903         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
1904
1905 2014-07-11  Antti Koivisto  <antti@apple.com>
1906
1907         REGRESSION (r170163?): Web content shifts revealing space equivalent to the find bar when clicking a link while a phrase is targeted via Cmd+F
1908         https://bugs.webkit.org/show_bug.cgi?id=134833
1909         <rdar://problem/17580021>
1910
1911         Reviewed by Zalan Bujtas.
1912         
1913         Some versions of OS X Safari can't handle the new unfreeze timing. Revert back to DidFirstLayout on Mac.
1914
1915         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1916         (WebKit::WebFrameLoaderClient::dispatchDidLayout):
1917
1918 2014-07-11  Zalan Bujtas  <zalan@apple.com>
1919
1920         Subpixel layout: return integral results for offset*, client*, scroll* by default.
1921         https://bugs.webkit.org/show_bug.cgi?id=134651
1922
1923         Reviewed by Simon Fraser.
1924
1925         Revert to returning integral values for Element.offset* client* scroll* by default.
1926         Fractional values break number of sites(tight design) and JS frameworks(fail to handle fractional values).
1927
1928         Since snapped dimension depends on both the original point and the width/height of the box,
1929         we need to call RenderBoxModelObject::pixelSnapped*() helpers, instead of round().
1930
1931         Covered by existing tests
1932
1933         * Shared/WebPreferencesDefinitions.h:
1934         * UIProcess/API/C/WKPreferencesRefPrivate.h:
1935
1936 2014-07-10  Jinwoo Song  <jinwoo7.song@samsung.com>
1937
1938         Unreviewed EFL build fix after r170970.
1939
1940         * UIProcess/efl/WebContextEfl.cpp:
1941         (WebKit::WebContext::platformDefaultOpenGLCacheDirectory):
1942
1943 2014-07-10  Carlos Alberto Lopez Perez  <clopez@igalia.com>
1944
1945         REGRESSION(r170970) REGRESSION(r170974): [GTK] Build broken.
1946         https://bugs.webkit.org/show_bug.cgi?id=134825
1947
1948         Unreviewed GTK build fix.
1949
1950         * Shared/SessionState.h: Put ifdefs for ViewSnapshot on Mac port.
1951         * Shared/WebBackForwardListItem.h: Idem.
1952         * UIProcess/gtk/WebContextGtk.cpp:
1953         (WebKit::WebContext::platformDefaultOpenGLCacheDirectory): Implement skeleton.
1954
1955 2014-07-10  Benjamin Poulain  <bpoulain@apple.com>
1956
1957         [iOS][WK2] It should be safe to call WKContentViewInteraction's cleanupInteraction multiple times
1958         https://bugs.webkit.org/show_bug.cgi?id=134820
1959
1960         Reviewed by Andreas Kling.
1961
1962         If a view is destroyed just after a crash, "cleanupInteraction" is called twice: once on crash,
1963         once on dealloc.
1964
1965         The code handling _interactionViewsContainerView is using KVO to monitor transform changes. It is not safe
1966         to remove the observer if we are not already observing on that view.
1967
1968         To solve the problem, this patch makes the cleanup actually remove the view so that setup and cleanup
1969         are completely symmetrical. If cleanup is called twice, the second time would not enter the branch because
1970         the view is already nil.
1971
1972         * UIProcess/ios/WKContentViewInteraction.mm:
1973         (-[WKContentView setupInteraction]):
1974         (-[WKContentView cleanupInteraction]):
1975
1976 2014-07-10  Simon Fraser  <simon.fraser@apple.com>
1977
1978         [iOS WK2] Move WKInspectorHighlightView to its own file
1979         https://bugs.webkit.org/show_bug.cgi?id=134819
1980
1981         Reviewed by Joseph Pecoraro.
1982         
1983         WKInspectorHighlightView brought a lot of path/quad-related code into WKContentView.mm,
1984         so move it into its own file.
1985
1986         * UIProcess/WKInspectorHighlightView.h: Added.
1987         * UIProcess/WKInspectorHighlightView.mm: Added.
1988         (-[WKInspectorHighlightView dealloc]):
1989         (-[WKInspectorHighlightView _removeAllLayers]):
1990         (-[WKInspectorHighlightView _createLayers:]):
1991         (findIntersectionOnLineBetweenPoints):
1992         (quadIntersection):
1993         (layerPathWithHole):
1994         (layerPath):
1995         (-[WKInspectorHighlightView _layoutForNodeHighlight:]):
1996         (-[WKInspectorHighlightView _layoutForRectsHighlight:]):
1997         (-[WKInspectorHighlightView update:]):
1998         * UIProcess/ios/WKContentView.mm:
1999         (-[WKInspectorHighlightView initWithFrame:]): Deleted.
2000         (-[WKInspectorHighlightView dealloc]): Deleted.
2001         (-[WKInspectorHighlightView _removeAllLayers]): Deleted.
2002         (-[WKInspectorHighlightView _createLayers:]): Deleted.
2003         (findIntersectionOnLineBetweenPoints): Deleted.
2004         (quadIntersection): Deleted.
2005         (layerPathWithHole): Deleted.
2006         (layerPath): Deleted.
2007         (-[WKInspectorHighlightView _layoutForNodeHighlight:]): Deleted.
2008         (-[WKInspectorHighlightView _layoutForRectsHighlight:]): Deleted.
2009         (-[WKInspectorHighlightView update:]): Deleted.
2010         * WebKit2.xcodeproj/project.pbxproj:
2011
2012 2014-07-10  Tim Horton  <timothy_horton@apple.com>
2013
2014         REGRESSION (r170935): WKWebView is always transparent until the first layer tree commit
2015         https://bugs.webkit.org/show_bug.cgi?id=134818
2016         <rdar://problem/17632468>
2017
2018         Reviewed by Anders Carlsson.
2019
2020         * UIProcess/API/Cocoa/WKWebView.mm:
2021         (scrollViewBackgroundColor):
2022         r170935 made it so that we would initialize the scroll view background color to an
2023         invalid color until the first layer tree commit. We should go with white instead.
2024
2025 2014-07-10  Enrica Casucci  <enrica@apple.com>
2026
2027         Add a mechanism to notify the UIProcess when an editing command is done executing.
2028         https://bugs.webkit.org/show_bug.cgi?id=134807
2029
2030         Reviewed by Tim Horton.
2031
2032         Some editing commands have an effect on some parts of the system that
2033         run inside the UIProcess. A good example are the cursor movement commands
2034         that require an update of the autocorrection/autosuggestion machinery.
2035         This patch adds a way to reliably know when the command has been executed
2036         in the WebProcess. A previous attempt at solving this problem was added in
2037         r170858 and was partially reverted in r170948.
2038         The change also removes the selectionWillChange notification added in r170858.
2039
2040         * UIProcess/PageClient.h:
2041         * UIProcess/WebPageProxy.cpp:
2042         (WebKit::WebPageProxy::editorStateChanged):
2043         * UIProcess/WebPageProxy.h:
2044         * UIProcess/ios/PageClientImplIOS.h:
2045         * UIProcess/ios/PageClientImplIOS.mm:
2046         (WebKit::PageClientImpl::selectionWillChange): Deleted.
2047         * UIProcess/ios/WKContentViewInteraction.h:
2048         * UIProcess/ios/WKContentViewInteraction.mm:
2049         (-[WKContentView executeEditCommandWithCallback:]):
2050         (-[WKContentView _moveUp:withHistory:]):
2051         (-[WKContentView _moveDown:withHistory:]):
2052         (-[WKContentView _moveLeft:withHistory:]):
2053         (-[WKContentView _moveRight:withHistory:]):
2054         (-[WKContentView _moveToStartOfWord:withHistory:]):
2055         (-[WKContentView _moveToStartOfParagraph:withHistory:]):
2056         (-[WKContentView _moveToStartOfLine:withHistory:]):
2057         (-[WKContentView _moveToStartOfDocument:withHistory:]):
2058         (-[WKContentView _moveToEndOfWord:withHistory:]):
2059         (-[WKContentView _moveToEndOfParagraph:withHistory:]):
2060         (-[WKContentView _moveToEndOfLine:withHistory:]):
2061         (-[WKContentView _moveToEndOfDocument:withHistory:]):
2062         (-[WKContentView _selectionWillChange]): Deleted.
2063         * UIProcess/ios/WebPageProxyIOS.mm:
2064         (WebKit::WebPageProxy::executeEditCommand):
2065         (WebKit::WebPageProxy::notifySelectionWillChange): Deleted.
2066         * WebProcess/WebPage/WebPage.h:
2067         * WebProcess/WebPage/WebPage.messages.in:
2068         * WebProcess/WebPage/ios/WebPageIOS.mm:
2069         (WebKit::WebPage::executeEditCommandWithCallback):
2070
2071 2014-07-10  Joseph Pecoraro  <pecoraro@apple.com>
2072
2073         [Mac] NSWindow warning: adding an unknown subview opening detached Inspector
2074         https://bugs.webkit.org/show_bug.cgi?id=134813
2075
2076         Reviewed by Timothy Hatcher.
2077
2078         * UIProcess/mac/WebInspectorProxyMac.mm:
2079         (WebKit::WebInspectorProxy::createInspectorWindow):
2080         Use a selector that will avoid the warning message.
2081
2082 2014-07-10  Oliver Hunt  <oliver@apple.com>
2083
2084         Remove use of container relative restrictions in the network process sandbox
2085         https://bugs.webkit.org/show_bug.cgi?id=134816
2086
2087         Reviewed by Anders Carlsson.
2088
2089         As i'm tidying up the various sandboxes and that's meaning we
2090         need to reduce some file restrictions in the network process.
2091
2092         * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb:
2093
2094 2014-07-10  Pratik Solanki  <psolanki@apple.com>
2095
2096         Unreviewed iOS build fix after r170974. Define id if building a non ObjC file.
2097
2098         * UIProcess/mac/ViewSnapshotStore.h:
2099
2100 2014-07-10  Tim Horton  <timothy_horton@apple.com>
2101
2102         Store ViewSnapshots directly on the WebBackForwardListItem
2103         https://bugs.webkit.org/show_bug.cgi?id=134667
2104         <rdar://problem/17082639>
2105
2106         Reviewed by Dan Bernstein.
2107
2108         Make ViewSnapshot a refcounted class. Store it directly on the back-forward item
2109         instead of in a side map referenced by UUID. Switch to a very simple LRU eviction model for now.
2110         This fixes a ton of snapshot management bugs; for example, we would start throwing out snapshots
2111         in the page that was actively being interacted with *first* when evicting snapshots, instead of
2112         preferring older snapshots. Additionally, we would not throw away snapshots when back forward items
2113         became unreachable.
2114
2115         There is definitely room for improvement of the eviction mechanism, but this is closer to a time-tested implementation.
2116
2117         * Shared/SessionState.h:
2118         Keep a ViewSnapshot instead of a UUID on the BackForwardListItemState.
2119
2120         * Shared/WebBackForwardListItem.h:
2121         Fix some indented namespace contents.
2122
2123         (WebKit::WebBackForwardListItem::snapshot):
2124         (WebKit::WebBackForwardListItem::setSnapshot):
2125         (WebKit::WebBackForwardListItem::setSnapshotUUID): Deleted.
2126         (WebKit::WebBackForwardListItem::snapshotUUID): Deleted.
2127         Switch the snapshot getter/setter to operate on ViewSnapshots instead of UUIDs.
2128
2129         * UIProcess/API/Cocoa/WKWebView.mm:
2130         (-[WKWebView _takeViewSnapshot]):
2131         * UIProcess/API/Cocoa/WKWebViewInternal.h:
2132         * UIProcess/API/mac/WKView.mm:
2133         (-[WKView _takeViewSnapshot]):
2134         * UIProcess/API/mac/WKViewInternal.h:
2135         * UIProcess/PageClient.h:
2136         * UIProcess/WebPageProxy.cpp:
2137         (WebKit::WebPageProxy::takeViewSnapshot):
2138         * UIProcess/WebPageProxy.h:
2139         * UIProcess/ios/PageClientImplIOS.h:
2140         * UIProcess/ios/PageClientImplIOS.mm:
2141         (WebKit::PageClientImpl::takeViewSnapshot):
2142         * UIProcess/mac/PageClientImpl.h:
2143         * UIProcess/mac/PageClientImpl.mm:
2144         (WebKit::PageClientImpl::takeViewSnapshot):
2145         Adopt ViewSnapshot::create, return a PassRefPtr, and class-ify ViewSnapshot.
2146
2147         * UIProcess/ios/ViewGestureControllerIOS.mm:
2148         (WebKit::ViewGestureController::beginSwipeGesture):
2149         (WebKit::ViewGestureController::endSwipeGesture):
2150         * UIProcess/mac/ViewGestureController.h:
2151         * UIProcess/mac/ViewGestureControllerMac.mm:
2152         (WebKit::ViewGestureController::shouldUseSnapshotForSize):
2153         (WebKit::ViewGestureController::beginSwipeGesture):
2154         (WebKit::ViewGestureController::endSwipeGesture):
2155         Grab the ViewSnapshot directly from the WebBackForwardListItem, and adopt the new functions.
2156
2157         * UIProcess/ios/WebMemoryPressureHandlerIOS.mm:
2158         (WebKit::WebMemoryPressureHandler::WebMemoryPressureHandler):
2159         Rename discardSnapshots to discardSnapshotImages, because we're really only discarding
2160         the images; the render tree size/background color "snapshot" remains and is useful.
2161
2162         * UIProcess/mac/ViewSnapshotStore.h:
2163         (WebKit::ViewSnapshot::setRenderTreeSize):
2164         (WebKit::ViewSnapshot::renderTreeSize):
2165         (WebKit::ViewSnapshot::setBackgroundColor):
2166         (WebKit::ViewSnapshot::backgroundColor):
2167         (WebKit::ViewSnapshot::setDeviceScaleFactor):
2168         (WebKit::ViewSnapshot::deviceScaleFactor):
2169         (WebKit::ViewSnapshot::imageSizeInBytes):
2170         (WebKit::ViewSnapshot::surface):
2171         (WebKit::ViewSnapshot::size):
2172         (WebKit::ViewSnapshot::creationTime):
2173         Make ViewSnapshot a refcounted class.
2174         Add create functions which take an image (or slot ID), and relevant sizes.
2175         It is expected that a ViewSnapshot is created with an image, and it is only possible
2176         to remove that image, never to replace it. A new ViewSnapshot is required in that case.
2177         Add setters for things that ViewSnapshotStore sets on the snapshot after the PageClient
2178         retrieves it from the view. Add getters for things that the ViewGestureControllers need.
2179
2180         Remove removeSnapshotImage, getSnapshot, and the snapshot map.
2181
2182         * UIProcess/mac/ViewSnapshotStore.mm:
2183         (WebKit::ViewSnapshotStore::~ViewSnapshotStore):
2184         (WebKit::ViewSnapshotStore::didAddImageToSnapshot):
2185         (WebKit::ViewSnapshotStore::willRemoveImageFromSnapshot):
2186         Manage m_snapshotCacheSize and m_snapshotsWithImages via didAddImageToSnapshot and willRemoveImageFromSnapshot.
2187         willRemoveImageFromSnapshot will -always- be called before the ViewSnapshot is destroyed.
2188
2189         (WebKit::ViewSnapshotStore::pruneSnapshots):
2190         Switch to a simple LRU eviction model. As previously mentioned, it's possible to do better, but
2191         this is much less broken than the previous implementation.
2192
2193         (WebKit::ViewSnapshotStore::recordSnapshot):
2194         (WebKit::ViewSnapshotStore::discardSnapshotImages):
2195         (WebKit::ViewSnapshot::create):
2196         (WebKit::ViewSnapshot::ViewSnapshot):
2197         (WebKit::ViewSnapshot::~ViewSnapshot):
2198         (WebKit::ViewSnapshot::hasImage):
2199         (WebKit::ViewSnapshot::clearImage):
2200         (WebKit::ViewSnapshot::asLayerContents):
2201         If a surface is Empty when it comes back from being volatile, throw away the surface
2202         and notify the Store to remove it from m_snapshotCacheSize (via clearImage()).
2203
2204         (WebKit::ViewSnapshotStore::removeSnapshotImage): Deleted.
2205         (WebKit::ViewSnapshotStore::getSnapshot): Deleted.
2206         (WebKit::ViewSnapshotStore::discardSnapshots): Deleted.
2207
2208 2014-07-10  Beth Dakin  <bdakin@apple.com>
2209
2210         Need Setting/WKPreference that allows clients to prevent scrollbars from drawing 
2211         on a secondary thread
2212         https://bugs.webkit.org/show_bug.cgi?id=134778
2213         -and corresponding-
2214         <rdar://problem/17595333>
2215
2216         Reviewed by Tim Horton.
2217
2218         This is a requirement for some types of performance tests.
2219
2220         New pref.
2221         * Shared/WebPreferencesDefinitions.h:
2222
2223         PDFPlugin has to implement this new ScrollableArea virtual function to indicate 
2224         the Setting’s value.
2225         * WebProcess/Plugins/PDF/PDFPlugin.h:
2226         * WebProcess/Plugins/PDF/PDFPlugin.mm:
2227         (WebKit::PDFPlugin::forceUpdateScrollbarsOnMainThreadForPerformanceTesting):
2228
2229         New pref.
2230         * WebProcess/WebPage/WebPage.cpp:
2231         (WebKit::WebPage::updatePreferences):
2232
2233 2014-07-10  Tim Horton  <timothy_horton@apple.com>
2234
2235         [iOS] Frequent assertion failures when swiping back
2236
2237         Reviewed by Dan Bernstein.
2238
2239         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
2240         (WebKit::RemoteLayerTreeDrawingAreaProxy::dispatchAfterEnsuringDrawing):
2241         Don't create an unused VoidCallback. It will assert when destroyed without being called.
2242
2243 2014-07-10  Oliver Hunt  <oliver@apple.com>
2244
2245         Pass sandbox extension for GL cache over to webprocess
2246         https://bugs.webkit.org/show_bug.cgi?id=134806
2247
2248         Reviewed by Anders Carlsson.
2249
2250         Add additional WebProcess parameters to pass an extension
2251         that allows access to the opengl cache directory in the
2252         host application's container.
2253
2254         * Shared/WebProcessCreationParameters.cpp:
2255         (WebKit::WebProcessCreationParameters::encode):
2256         (WebKit::WebProcessCreationParameters::decode):
2257         * Shared/WebProcessCreationParameters.h:
2258         * UIProcess/WebContext.cpp:
2259         (WebKit::WebContext::createNewWebProcess):
2260         (WebKit::WebContext::openGLCacheDirectory):
2261         * UIProcess/WebContext.h:
2262         * UIProcess/mac/WebContextMac.mm:
2263         (WebKit::WebContext::platformDefaultOpenGLCacheDirectory):
2264         * WebProcess/cocoa/WebProcessCocoa.mm:
2265         (WebKit::WebProcess::platformInitializeWebProcess):
2266
2267 2014-07-10  Dan Bernstein  <mitz@apple.com>
2268
2269         iOS build fix.
2270
2271         * WebProcess/WebPage/ServicesOverlayController.h:
2272
2273 2014-07-09  Brady Eidson  <beidson@apple.com>
2274
2275         Phone number highlights should always be visible if the mouse hovers over.
2276         <rdar://problem/17527476> and https://bugs.webkit.org/show_bug.cgi?id=134784
2277
2278         Reviewed by Tim Horton.
2279
2280         This is a fairly extensive rewrite of ServicesOverlayController.
2281         It allows one selection highlight for the entire selection, and as many telephone number highlights as there are numbers.
2282         If a telephone number highlight is hovered over, it wins and is painted.
2283         If no telephone number highlight is hovered but the selection highlight is, then it is painted.
2284        
2285         The purposes of each method are self evident by their name, and the concepts are mostly the same as they used to be.
2286
2287         The exception is establishHoveredTelephoneHighlight which gets a more detailed explanation below.
2288         
2289         * Platform/Logging.h: Add a Services logging channel.
2290
2291         * WebProcess/WebPage/ServicesOverlayController.h:
2292         (WebKit::TelephoneNumberData::TelephoneNumberData):
2293
2294         * WebProcess/WebPage/mac/ServicesOverlayController.mm:
2295         (WebKit::ServicesOverlayController::ServicesOverlayController):
2296         (WebKit::ServicesOverlayController::selectionRectsDidChange):
2297         (WebKit::ServicesOverlayController::selectedTelephoneNumberRangesChanged):
2298         (WebKit::ServicesOverlayController::clearHighlightState):
2299         (WebKit::ServicesOverlayController::drawRect):
2300         (WebKit::ServicesOverlayController::drawSelectionHighlight):
2301         (WebKit::ServicesOverlayController::maybeDrawTelephoneNumberHighlight):
2302         (WebKit::ServicesOverlayController::drawHighlight):
2303         (WebKit::ServicesOverlayController::clearSelectionHighlight):
2304         (WebKit::ServicesOverlayController::clearHoveredTelephoneNumberHighlight):
2305         (WebKit::ServicesOverlayController::establishHoveredTelephoneHighlight): Starts walking the telephone number ranges and
2306             creating a highlight for each one that doesn’t already have a highlight. If that highlight is also being hovered by
2307             the mouse, then it is set as the hovered telephone number highlight and the method stops creating new highlights.
2308         (WebKit::ServicesOverlayController::maybeCreateSelectionHighlight):
2309         (WebKit::ServicesOverlayController::mouseEvent):
2310         (WebKit::ServicesOverlayController::handleClick):
2311         (WebKit::ServicesOverlayController::drawTelephoneNumberHighlight): Deleted.
2312         (WebKit::ServicesOverlayController::drawCurrentHighlight): Deleted.
2313
2314 2014-07-10  Timothy Horton  <timothy_horton@apple.com>
2315
2316         Assertions or crashes under _takeViewSnapshot when restoring windows
2317         https://bugs.webkit.org/show_bug.cgi?id=134792
2318
2319         Reviewed by Simon Fraser.
2320
2321         * UIProcess/API/mac/WKView.mm:
2322         (-[WKView _takeViewSnapshot]):
2323         Taking a window-server snapshot of a non-visible window tends to not succeed.
2324
2325 2014-07-09  Pratik Solanki  <psolanki@apple.com>
2326
2327         Buffer CSS and JS resources in network process before sending over to web process
2328         https://bugs.webkit.org/show_bug.cgi?id=134560
2329         <rdar://problem/16737186>
2330
2331         Reviewed by Antti Koivisto.
2332
2333         For CSS and JS resources, ask the network process to buffer the entire resource instead of
2334         sending it to web process in chunks since the web process can't do anything with a partial
2335         css or js file.
2336
2337         * NetworkProcess/NetworkResourceLoader.cpp:
2338         (WebKit::NetworkResourceLoader::NetworkResourceLoader):
2339         * Shared/Network/NetworkResourceLoadParameters.cpp:
2340         (WebKit::NetworkResourceLoadParameters::NetworkResourceLoadParameters):
2341         (WebKit::NetworkResourceLoadParameters::encode):
2342         (WebKit::NetworkResourceLoadParameters::decode):
2343         * Shared/Network/NetworkResourceLoadParameters.h:
2344         * WebProcess/Network/WebResourceLoadScheduler.cpp:
2345         (WebKit::WebResourceLoadScheduler::scheduleLoad):
2346
2347 2014-07-09  Benjamin Poulain  <bpoulain@apple.com>
2348
2349         [iOS][WK2] Disable text quantization while actively changing the page's scale factor
2350         https://bugs.webkit.org/show_bug.cgi?id=134781
2351
2352         Reviewed by Tim Horton and Myles C. Maxfield.
2353
2354         While zooming a page, text quantization causes glyphs to "move" in order to get to the closest
2355         boundary for the current scale factor.
2356
2357         We do not want this to happen while dynamically changing the scale factor because the effect
2358         is visible. To avoid this, we disable text quantization if the page's scale factor changes
2359         in response to a non-stable contentRect update.
2360
2361         * WebProcess/WebCoreSupport/WebChromeClient.h:
2362         * WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm:
2363         (WebKit::WebChromeClient::hasStablePageScaleFactor):
2364         * WebProcess/WebPage/WebPage.cpp:
2365         (WebKit::WebPage::WebPage):
2366         * WebProcess/WebPage/WebPage.h:
2367         (WebKit::WebPage::hasStablePageScaleFactor):
2368         * WebProcess/WebPage/ios/WebPageIOS.mm:
2369         (WebKit::WebPage::updateVisibleContentRects):
2370
2371 2014-07-09  Joseph Pecoraro  <pecoraro@apple.com>
2372
2373         [iOS] Use UIAlertController API in WKFileUploadPanel instead of SPI
2374         https://bugs.webkit.org/show_bug.cgi?id=134777
2375
2376         Reviewed by Sam Weinig.
2377
2378         * UIProcess/ios/forms/WKFileUploadPanel.mm:
2379         (-[WKFileUploadPanel _showMediaSourceSelectionSheet]):
2380
2381 2014-07-09  Shivakumar JM  <shiva.jm@samsung.com>
2382
2383         [EFL][WK2] Add new Public API in ewk_download_job.h to get size of the data already downloaded.
2384         https://bugs.webkit.org/show_bug.cgi?id=134759
2385
2386         Reviewed by Gyuyoung Kim.
2387
2388         Add new API in ewk_download_job.h to get size of the data already downloaded.
2389
2390         * UIProcess/API/efl/ewk_download_job.cpp:
2391         (ewk_download_job_received_data_length_get):
2392         (EwkDownloadJob::receivedData):
2393         * UIProcess/API/efl/ewk_download_job.h:
2394         * UIProcess/API/efl/ewk_download_job_private.h:
2395         * UIProcess/API/efl/tests/test_ewk2_download_job.cpp:
2396         (EWK2DownloadJobTest::on_download_requested):
2397         (EWK2DownloadJobTest::on_download_finished):
2398
2399 2014-07-09  Enrica Casucci  <enrica@apple.com>
2400
2401         REGRESSION(r170858): Safari freezes upon making a search on a website (yelp.com).
2402         https://bugs.webkit.org/show_bug.cgi?id=134791
2403         <rdar://problem/17616971>
2404
2405         Reviewed by Benjamin Poulain.
2406
2407         After r170858 we notify the keyboard too often about
2408         the changed selection. This patch removes the notification
2409         until we find a better way to do it that doesn't cause
2410         deadlocks.
2411
2412         * UIProcess/ios/WKContentViewInteraction.mm:
2413         (-[WKContentView _selectionWillChange]):
2414         (-[WKContentView _selectionChanged]):
2415
2416 2014-07-09  Anders Carlsson  <andersca@apple.com>
2417
2418         Safari showing blank pages
2419         https://bugs.webkit.org/show_bug.cgi?id=134790
2420         <rdar://problem/17617166>
2421
2422         Reviewed by Simon Fraser.
2423
2424         * UIProcess/API/Cocoa/WKWebView.mm:
2425         (-[WKWebView initWithFrame:configuration:]):
2426         Make sure to add the content view to the scroll view.
2427
2428 2014-07-09  Anders Carlsson  <andersca@apple.com>
2429
2430         Closed web views should never create new web processes
2431         https://bugs.webkit.org/show_bug.cgi?id=134787
2432         <rdar://problem/16892526>
2433
2434         Reviewed by Simon Fraser.
2435
2436         * UIProcess/API/Cocoa/WKWebView.mm:
2437         (-[WKWebView loadHTMLString:baseURL:]):
2438         (-[WKWebView reload]):
2439         (-[WKWebView reloadFromOrigin]):
2440         Return nil if the returned navigation ID is 0.
2441
2442         * UIProcess/WebPageProxy.cpp:
2443         (WebKit::WebPageProxy::reattachToWebProcess):
2444         Assert that the page is not closed.
2445
2446         (WebKit::WebPageProxy::reattachToWebProcessWithItem):
2447         (WebKit::WebPageProxy::loadRequest):
2448         (WebKit::WebPageProxy::loadFile):
2449         (WebKit::WebPageProxy::loadData):
2450         (WebKit::WebPageProxy::loadHTMLString):
2451         (WebKit::WebPageProxy::loadAlternateHTMLString):
2452         (WebKit::WebPageProxy::loadPlainTextString):
2453         (WebKit::WebPageProxy::loadWebArchiveData):
2454         Add early returns if the page is closed.
2455
2456         * UIProcess/WebPageProxy.h:
2457
2458 2014-07-09  Anders Carlsson  <andersca@apple.com>
2459
2460         Support transparent WKWebViews
2461         https://bugs.webkit.org/show_bug.cgi?id=134779
2462         <rdar://problem/17351058>
2463
2464         Reviewed by Tim Horton.
2465
2466         * UIProcess/API/Cocoa/WKWebView.mm:
2467         (-[WKWebView initWithFrame:configuration:]):
2468         Call _updateScrollViewBackground instead of setting the background color.
2469
2470         (contentZoomScale):
2471         Use dot notation.
2472
2473         (scrollViewBackgroundColor):
2474         Helper function that returns the scroll view background color. 
2475         If the web view isn't opaque, we want the scroll view to be transparent.
2476
2477         (-[WKWebView _updateScrollViewBackground]):
2478         Call scrollViewBackgroundColor.
2479
2480         (-[WKWebView setOpaque:]):
2481         Call WebPageProxy::setDrawsBackground and update the scroll view background.
2482
2483         (-[WKWebView setBackgroundColor:]):
2484         Call setBackgroundColor on the content view.
2485
2486 2014-07-09  Andy Estes  <aestes@apple.com>
2487
2488         [iOS] WebKit can crash under QuickLookDocumentData::encode() when viewing a QuickLook preview
2489         https://bugs.webkit.org/show_bug.cgi?id=134780
2490
2491         Reviewed by Tim Horton.
2492
2493         Don't use CFDataCreateWithBytesNoCopy() when we can't guarantee the lifetime of the copied-from DataReference
2494         will match or exceed that of the CFDataRef. Copy the data instead.
2495
2496         * WebProcess/Network/WebResourceLoader.cpp:
2497         (WebKit::WebResourceLoader::didReceiveData):
2498
2499 2014-07-09  Pratik Solanki  <psolanki@apple.com>
2500
2501         Move resource buffering from SynchronousNetworkLoaderClient to NetworkResourceLoader
2502         https://bugs.webkit.org/show_bug.cgi?id=134732
2503
2504         Reviewed by Darin Adler.
2505
2506         Buffer the resource in NetworkResourceLoader instead of SynchronousNetworkLoaderClient. This
2507         is in preparation for bug 134560 where we will be supporting JS and CSS resource buffering
2508         that uses AsynchronousNetworkLoaderClient.
2509
2510         * NetworkProcess/NetworkResourceLoader.cpp:
2511         (WebKit::NetworkResourceLoader::NetworkResourceLoader):
2512         (WebKit::NetworkResourceLoader::didReceiveBuffer):
2513         (WebKit::NetworkResourceLoader::didFinishLoading):
2514         * NetworkProcess/NetworkResourceLoader.h:
2515         (WebKit::NetworkResourceLoader::bufferedData):
2516         * NetworkProcess/SynchronousNetworkLoaderClient.cpp:
2517         (WebKit::SynchronousNetworkLoaderClient::didReceiveBuffer):
2518         (WebKit::SynchronousNetworkLoaderClient::didFinishLoading):
2519         (WebKit::SynchronousNetworkLoaderClient::didFail):
2520         (WebKit::SynchronousNetworkLoaderClient::sendDelayedReply):
2521         * NetworkProcess/SynchronousNetworkLoaderClient.h:
2522
2523 2014-07-09  Benjamin Poulain  <bpoulain@apple.com>
2524
2525         [iOS][WK2] subviews of the unscaled view drift out during CA animations
2526         https://bugs.webkit.org/show_bug.cgi?id=134751
2527
2528         Reviewed by Enrica Casucci.
2529
2530         It is not possible to animate the WKContentView and the inverse view in such a way
2531         that the combined matrix remain the identity for every frame of the animation.
2532
2533         This patch solves the issue by moving the unscaled view as a sibling of WKContentView
2534         instead of a child so that we do not need to update two scales simultaneously.
2535
2536         * UIProcess/API/Cocoa/WKWebView.mm:
2537         (-[WKWebView initWithFrame:configuration:]):
2538         (-[WKWebView _processDidExit]):
2539         (-[WKWebView _dynamicViewportUpdateChangedTargetToScale:position:]):
2540         Set the z scale to 1 or no coordinate transform will work with this view.
2541
2542         (-[WKWebView _beginAnimatedResizeWithUpdates:]):
2543         (-[WKWebView _endAnimatedResize]):
2544         * UIProcess/ios/WKContentView.mm:
2545         (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:]):
2546         * UIProcess/ios/WKContentViewInteraction.h:
2547         * UIProcess/ios/WKContentViewInteraction.mm:
2548         (-[WKContentView setupInteraction]):
2549         Since we need to observe changes inside the animation block, the code now use KVO to observe changes of scale.
2550
2551         (-[WKContentView cleanupInteraction]):
2552         (-[WKContentView unscaledView]):
2553         (-[WKContentView inverseScale]):
2554         (-[WKContentView observeValueForKeyPath:ofObject:change:context:]):
2555         We update the utility views as usual. The extra bits here are to deal with views coming in during an animation.
2556
2557         If a new utility view comes in during a scaling animation, we do not want to start a new animation with the same curve
2558         to end up at the right place. To avoid any issue, we just hide the view until the animation is finished.
2559
2560         (-[WKContentView hitTest:withEvent:]):
2561         (-[WKContentView _showTapHighlight]):
2562         (-[WKContentView _updateUnscaledView]): Deleted.
2563
2564 2014-07-09  Tim Horton  <timothy_horton@apple.com>
2565
2566         Use IOSurface ViewSnapshots everywhere on Mac, remove JPEG encoding path
2567         https://bugs.webkit.org/show_bug.cgi?id=134773
2568
2569         Reviewed by Anders Carlsson.
2570
2571         * UIProcess/API/mac/WKView.mm:
2572         (-[WKView _takeViewSnapshot]):
2573         * UIProcess/mac/ViewSnapshotStore.h:
2574         * UIProcess/mac/ViewSnapshotStore.mm:
2575         (WebKit::ViewSnapshotStore::ViewSnapshotStore):
2576         (WebKit::ViewSnapshotStore::~ViewSnapshotStore):
2577         (WebKit::ViewSnapshotStore::recordSnapshot):
2578         (WebKit::ViewSnapshot::clearImage):
2579         (WebKit::ViewSnapshot::asLayerContents):
2580         (WebKit::createIOSurfaceFromImage): Deleted.
2581         (WebKit::compressImageAsJPEG): Deleted.
2582         (WebKit::ViewSnapshotStore::reduceSnapshotMemoryCost): Deleted.
2583         (WebKit::ViewSnapshotStore::didCompressSnapshot): Deleted.
2584         Remove all ViewSnapshot(Store) code related to JPEG-encoded snapshots.
2585         Remove the "image" member on ViewSnapshot; Mac will always start out with an IOSurface instead.
2586         Adopt WebCore::IOSurface::createFromImage to make that happen.
2587         Add a comment noting that if a snapshot comes back empty, we should throw it away completely.
2588
2589 2014-07-09  Anders Carlsson  <andersca@apple.com>
2590
2591         RemoteLayerBackingStore::ensureBackingStore should ensure that the entire backing store gets redrawn
2592         https://bugs.webkit.org/show_bug.cgi?id=134772
2593
2594         Reviewed by Tim Horton.
2595
2596         * Shared/mac/RemoteLayerBackingStore.h:
2597         (WebKit::RemoteLayerBackingStore::Buffer::operator bool):
2598         * Shared/mac/RemoteLayerBackingStore.mm:
2599         (WebKit::RemoteLayerBackingStore::ensureBackingStore):
2600
2601 2014-07-09  KwangHyuk Kim  <hyuki.kim@samsung.com>
2602
2603         [EFL] Fix crash caused by invalid cursor image.
2604         https://bugs.webkit.org/show_bug.cgi?id=134663
2605
2606         Reviewed by Gyuyoung Kim.
2607
2608         Remove calling of updateCursor since the custom cursor image is invalid once a mouse is out of the webview.
2609
2610         * UIProcess/API/efl/EwkView.cpp:
2611         (EwkViewEventHandler<EVAS_CALLBACK_MOUSE_IN>::handleEvent):
2612
2613 2014-07-08  Tim Horton  <timothy_horton@apple.com>
2614
2615         Remove WebBackForwardListItems when their owning page goes away
2616         https://bugs.webkit.org/show_bug.cgi?id=134709
2617         <rdar://problem/17584645>
2618
2619         Reviewed by Dan Bernstein.
2620
2621         * Shared/WebBackForwardListItem.cpp:
2622         (WebKit::WebBackForwardListItem::create):
2623         (WebKit::WebBackForwardListItem::WebBackForwardListItem):
2624         * Shared/WebBackForwardListItem.h:
2625         (WebKit::WebBackForwardListItem::pageID):
2626         Add the associated PageID to the WebBackForwardListItem.
2627
2628         * UIProcess/WebBackForwardList.cpp:
2629         (WebKit::WebBackForwardList::restoreFromState):
2630         Push the current PageID onto the WebBackForwardListItem.
2631
2632         * UIProcess/WebProcessProxy.cpp:
2633         (WebKit::WebProcessProxy::removeWebPage):
2634         Remove all of the WebBackForwardListItems from m_backForwardListItemMap when
2635         the page they are associated with is removed.
2636
2637         (WebKit::WebProcessProxy::addBackForwardItem):
2638         Push the PageID from the WebProcess onto the WebBackForwardListItem.
2639
2640         * UIProcess/WebProcessProxy.h:
2641         * UIProcess/WebProcessProxy.messages.in:
2642         * WebProcess/WebPage/WebBackForwardListProxy.cpp:
2643         (WebKit::idToHistoryItemMap):
2644         (WebKit::historyItemToIDMap):
2645         (WebKit::updateBackForwardItem):
2646         (WebKit::WebBackForwardListProxy::addItemFromUIProcess):
2647         (WebKit::WK2NotifyHistoryItemChanged):
2648         (WebKit::WebBackForwardListProxy::idForItem):
2649         (WebKit::WebBackForwardListProxy::addItem):
2650         (WebKit::WebBackForwardListProxy::goToItem):
2651         (WebKit::WebBackForwardListProxy::close):
2652         * WebProcess/WebPage/WebBackForwardListProxy.h:
2653         * WebProcess/WebPage/WebPage.cpp:
2654         (WebKit::WebPage::restoreSession):
2655         Keep track of the PageID that back-forward items were created by.
2656         Pass the PageID along when registering WebBackForwardListItems.
2657
2658 2014-07-08  Tim Horton  <timothy_horton@apple.com>
2659
2660         [WK2] Expose a few drawing/compositing settings on WKPreferences(Private)
2661         https://bugs.webkit.org/show_bug.cgi?id=134645
2662
2663         Reviewed by Dan Bernstein.
2664
2665         * UIProcess/API/Cocoa/WKPreferences.mm:
2666         (-[WKPreferences _compositingBordersVisible]):
2667         (-[WKPreferences _setCompositingBordersVisible:]):
2668         (-[WKPreferences _compositingRepaintCountersVisible]):
2669         (-[WKPreferences _setCompositingRepaintCountersVisible:]):
2670         (-[WKPreferences _tiledScrollingIndicatorVisible]):
2671         (-[WKPreferences _setTiledScrollingIndicatorVisible:]):
2672         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
2673         Expose layer borders, repaint counters, and the tiled scrolling indicator on WKPreferences, as SPI.
2674
2675 2014-07-08  Tim Horton  <timothy_horton@apple.com>
2676
2677         WKProcessPoolConfigurationPrivate's maximumProcessCount property has no effect
2678         https://bugs.webkit.org/show_bug.cgi?id=134711
2679
2680         Reviewed by Dan Bernstein.
2681
2682         * UIProcess/API/Cocoa/WKProcessPool.mm:
2683         (-[WKProcessPool _initWithConfiguration:]):
2684         Respect the maximumProcessCount.
2685         Currently the default limit is UINT_MAX; if maximumProcessCount = 0 (the default), we'll use that limit.
2686
2687 2014-07-08  Adrian Perez de Castro  <aperez@igalia.com>
2688
2689         [GTK] Move user style sheet API out of WebKitWebViewGroup
2690         https://bugs.webkit.org/show_bug.cgi?id=134551
2691
2692         Reviewed by Carlos Garcia Campos.
2693
2694         * PlatformGTK.cmake: Include the new source files in the build.
2695         * UIProcess/API/C/gtk/WKView.cpp:
2696         (WKViewCreate):
2697         Adapt to the additional webkitWebViewBaseCreateWebPage() parameter.
2698         * UIProcess/API/gtk/WebKitUserContent.cpp: Added.
2699         (toUserContentInjectedFrames):
2700         (toUserStyleLevel):
2701         (toStringVector):
2702         (_WebKitUserStyleSheet::_WebKitUserStyleSheet):
2703         (webkit_user_style_sheet_ref):
2704         (webkit_user_style_sheet_unref):
2705         (webkit_user_style_sheet_new):
2706         (webkitWebKitUserStyleSheetToUserStyleSheet):
2707         * UIProcess/API/gtk/WebKitUserContent.h: Added.
2708         * UIProcess/API/gtk/WebKitUserContentManager.cpp: Added.
2709         (_WebKitUserContentManagerPrivate::_WebKitUserContentManagerPrivate):
2710         (webkit_user_content_manager_class_init):
2711         (webkit_user_content_manager_new):
2712         (webkit_user_content_manager_add_style_sheet):
2713         (webkit_user_content_manager_remove_all_style_sheets):
2714         (webkitUserContentManagerGetUserContentControllerProxy):
2715         * UIProcess/API/gtk/WebKitUserContentManager.h: Added.
2716         * UIProcess/API/gtk/WebKitUserContentManagerPrivate.h: Added.
2717         * UIProcess/API/gtk/WebKitUserContentPrivate.h: Added.
2718         * UIProcess/API/gtk/WebKitWebContext.cpp:
2719         (webkitWebContextCreatePageForWebView): Add a new parameter to allow
2720         passing the WebKitUserContentManager that the web view will use.
2721         * UIProcess/API/gtk/WebKitWebContextPrivate.h: Ditto.
2722         * UIProcess/API/gtk/WebKitWebView.cpp:
2723         (webkitWebViewConstructed): Added handling of the
2724         "user-content-manager" property on construction.
2725         (webkitWebViewSetProperty): Added support for the
2726         "user-content-manager" property.
2727         (webkitWebViewGetProperty): Added support for the
2728         "user-content-manager" property.
2729         (webkit_web_view_class_init): Added the "user-content-manager"
2730         property definition to the WebKitWebView class.
2731         (webkit_web_view_new_with_related_view): Made related views share
2732         the same WebKitUserContentManager used by the view they are
2733         related to.
2734         (webkit_web_view_new_with_user_content_manager): Added.
2735         (webkit_web_view_get_user_content_manager): Added.
2736         * UIProcess/API/gtk/WebKitWebView.h: Add new API methods.
2737         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
2738         (webkitWebViewBaseCreate): Added a parameter to pass the user
2739         content manager.
2740         (webkitWebViewBaseCreateWebPage): Added a parameter to pass the user
2741         content manager.
2742         * UIProcess/API/gtk/WebKitWebViewBasePrivate.h: Ditto.
2743         * UIProcess/API/gtk/WebKitWebViewGroup.cpp: Removed the bits related
2744         to user style sheet support from WebKitWebViewGroup.
2745         (webkit_web_view_group_set_settings):
2746         (toAPIArray): Deleted.
2747         (webkit_web_view_group_add_user_style_sheet): Deleted.
2748         (webkit_web_view_group_remove_all_user_style_sheets): Deleted.
2749         * UIProcess/API/gtk/WebKitWebViewGroup.h: Deleted the API methods
2750         for user style sheet handling.
2751         * UIProcess/API/gtk/docs/webkit2gtk-sections.txt: Added the new API
2752         functions and types, and removed the methods which are no longer
2753         available in WebKitWebViewGroup.
2754         * UIProcess/API/gtk/webkit2.h: Add the new headers.
2755         * UIProcess/UserContent/WebUserContentControllerProxy.cpp: Added
2756         methods to add and remove user style sheets, alike those used for
2757         user scripts.
2758         (WebKit::WebUserContentControllerProxy::addProcess):
2759         (WebKit::WebUserContentControllerProxy::addUserStyleSheet):
2760         (WebKit::WebUserContentControllerProxy::removeAllUserStyleSheets):
2761         * UIProcess/UserContent/WebUserContentControllerProxy.h: Ditto.
2762         * UIProcess/gtk/WebInspectorProxyGtk.cpp:
2763         (WebKit::WebInspectorProxy::platformCreateInspectorPage):
2764         Adapt to the additional webkitWebViewBaseCreateWebPage() parameter.
2765         * WebProcess/UserContent/WebUserContentController.cpp: Added methods
2766         to add and remove user style sheets, alike those used for user scripts.
2767         (WebKit::WebUserContentController::addUserStyleSheets):
2768         (WebKit::WebUserContentController::removeAllUserStyleSheets):
2769         * WebProcess/UserContent/WebUserContentController.h: Ditto.
2770         * WebProcess/UserContent/WebUserContentController.messages.in:
2771         Ditto.
2772
2773 2014-07-08  Zan Dobersek  <zdobersek@igalia.com>
2774
2775         [GTK] Guard uses of RedirectedXCompositeWindow in WebKitWebViewBase with PLATFORM(X11)
2776         https://bugs.webkit.org/show_bug.cgi?id=133871
2777
2778         Reviewed by Martin Robinson.
2779
2780         Guard uses of the RedirectedXCompositeWindow object in WebKitWebViewBase with the
2781         PLATFORM(X11) build guard. This is required to properly support building the GTK
2782         port only for the Wayland target.
2783
2784         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
2785         (webkitWebViewBaseConstructed):
2786         (webkitWebViewRenderAcceleratedCompositingResults):
2787         (resizeWebKitWebViewBaseFromAllocation):
2788         (webkitWebViewBaseUpdatePreferences):
2789         (webkitWebViewBaseCreateWebPage):
2790
2791 2014-07-07  Tim Horton  <timothy_horton@apple.com>
2792
2793         Turn on accelerated drawing for WebKit2 by default
2794         https://bugs.webkit.org/show_bug.cgi?id=134708
2795         <rdar://problem/17584642>
2796
2797         Reviewed by Simon Fraser.
2798
2799         * Shared/WebPreferencesDefinitions.h:
2800         Make Mac match iOS, in that accelerated drawing is on by default.
2801
2802 2014-07-07  Timothy Horton  <timothy_horton@apple.com>
2803
2804         Don't leak _WKRemoteObjectRegistry in WKBrowsingContextController
2805         https://bugs.webkit.org/show_bug.cgi?id=134703
2806
2807         Reviewed by Simon Fraser.
2808
2809         * UIProcess/API/Cocoa/WKBrowsingContextController.mm:
2810         (-[WKBrowsingContextController _remoteObjectRegistry]):
2811         Adoption is important!!
2812
2813 2014-07-07  Simon Fraser  <simon.fraser@apple.com>
2814
2815         [UI-side compositing] Support reflections on custom layers like video
2816         https://bugs.webkit.org/show_bug.cgi?id=134701
2817
2818         Reviewed by Tim Horton.
2819         
2820         For video reflections, we have to support cloning of PlatformCALayerRemoteCustom
2821         in the web process. Do so by implementing PlatformCALayerRemoteCustom::clone(),
2822         which does the right gyrations to get AVPlayerLayers cloned, then makes a
2823         new PlatformCALayerRemoteCustom to wrap the new layer. This ends up getting
2824         its own context hosting ID, allowing the clone to show in the UI process.
2825         
2826         Attempt to do the same for WebGL, but turn it off because it breaks.
2827
2828         * Shared/mac/RemoteLayerBackingStore.mm:
2829         (WebKit::RemoteLayerBackingStore::drawInContext):
2830         * Shared/mac/RemoteLayerTreeTransaction.mm:
2831         (WebKit::RemoteLayerTreeTransaction::LayerCreationProperties::encode): Unconditionally encode/decode
2832         the hostingContextID. It will be 0 for most layers.
2833         (WebKit::RemoteLayerTreeTransaction::LayerCreationProperties::decode):
2834         (WebKit::RemoteLayerTreeTransaction::description):
2835         * UIProcess/ios/RemoteLayerTreeHostIOS.mm:
2836         (WebKit::RemoteLayerTreeHost::createLayer):
2837         * UIProcess/mac/RemoteLayerTreeHost.mm:
2838         (WebKit::RemoteLayerTreeHost::createLayer):
2839         * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
2840         (WebKit::PlatformCALayerRemote::create): Creation with a custom PlatformLayer* always
2841         creates a PlatformCALayerRemoteCustom.
2842         (WebKit::PlatformCALayerRemote::clone): Factor some code.
2843         (WebKit::PlatformCALayerRemote::updateClonedLayerProperties):
2844         (WebKit::PlatformCALayerRemote::recursiveBuildTransaction):
2845         * WebProcess/WebPage/mac/PlatformCALayerRemote.h:
2846         * WebProcess/WebPage/mac/PlatformCALayerRemoteCustom.h:
2847         * WebProcess/WebPage/mac/PlatformCALayerRemoteCustom.mm:
2848         (WebKit::PlatformCALayerRemoteCustom::create):
2849         (WebKit::PlatformCALayerRemoteCustom::PlatformCALayerRemoteCustom):
2850         (WebKit::PlatformCALayerRemoteCustom::clone): Clone by making an instance of the 
2851         correct type of platform layer when possible, then wrapping a PlatformCALayerRemoteCustom
2852         around it.
2853         (WebKit::PlatformCALayerRemoteCustom::contents):
2854         (WebKit::PlatformCALayerRemoteCustom::setContents):
2855         * WebProcess/WebPage/mac/RemoteLayerTreeContext.mm:
2856         (WebKit::RemoteLayerTreeContext::layerWasCreated):
2857         (WebKit::RemoteLayerTreeContext::layerWillBeDestroyed):
2858
2859 2014-07-07  Simon Fraser  <simon.fraser@apple.com>
2860
2861         [UI-side compositing] Crash when starting a filter transition on a reflected layer
2862         https://bugs.webkit.org/show_bug.cgi?id=134694
2863
2864         Reviewed by Tim Horton.
2865         
2866         When cloned layers had animations, we would fire two animationDidStart callbacks,
2867         but the second would pass an empty animationKey string to the web process, resulting
2868         in a crash.
2869         
2870         Fix by not blindly copying all layer properties when cloning PlatformCALayerRemotes,
2871         since the clone would include addedAnimations, and then get the same animations
2872         added on top by the caller.
2873         
2874         Also protect against an empty animation key in the animationDidStart callback.
2875
2876         * UIProcess/mac/RemoteLayerTreeHost.mm:
2877         (WebKit::RemoteLayerTreeHost::animationDidStart):
2878         * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
2879         (WebKit::PlatformCALayerRemote::PlatformCALayerRemote):
2880         (WebKit::PlatformCALayerRemote::clone): Don't copy all the properties; copy
2881         them manually as PlatformCALayerMac does. Only copy the big things if they don't
2882         have their default values.
2883         (WebKit::PlatformCALayerRemote::copyFiltersFrom): Need an implementation of this
2884         for clone() to call.
2885
2886 2014-07-07  Tim Horton  <timothy_horton@apple.com>
2887
2888         Nearly everything in the UIProcess "leaks" when WKWebView is torn down
2889         https://bugs.webkit.org/show_bug.cgi?id=134699
2890         <rdar://problem/17581777>
2891
2892         Reviewed by Simon Fraser.
2893
2894         * UIProcess/API/Cocoa/WKWebView.mm:
2895         (-[WKWebView initWithFrame:configuration:]):
2896         Adoption is important!
2897
2898 2014-07-07  Enrica Casucci  <enrica@apple.com>
2899
2900         REGRESSION(iOS WK2): arrow keys movements don't work.
2901         https://bugs.webkit.org/show_bug.cgi?id=134561
2902         <rdar://problem/16827629>
2903
2904         Reviewed by Benjamin Poulain.
2905
2906         This change add the implementations for cursor movement selectors.
2907         It also provides a mechanism to ensure that every selection
2908         change in WebKit is reflected in UIKit so that it can update the 
2909         autocorrection data. This way we ensure that the autocorraction state
2910         is consistent even when selection changes are originated by JavaScript.
2911         WebPageProxy::editorStateChanged now notifies the page client when the
2912         selection is about to change as well as when it actually changed.
2913         
2914         * UIProcess/PageClient.h:
2915         * UIProcess/WebPageProxy.cpp:
2916         (WebKit::WebPageProxy::editorStateChanged):
2917         * UIProcess/WebPageProxy.h:
2918         * UIProcess/ios/PageClientImplIOS.h:
2919         * UIProcess/ios/PageClientImplIOS.mm:
2920         (WebKit::PageClientImpl::selectionWillChange):
2921         * UIProcess/ios/WKContentViewInteraction.h:
2922         * UIProcess/ios/WKContentViewInteraction.mm:
2923         (-[WKContentView cut:]): Removed incorrect calls to textWillChange and
2924         textDidChange.
2925         (-[WKContentView paste:]):
2926         (-[WKContentView _moveUp:withHistory:]):
2927         (-[WKContentView _moveDown:withHistory:]):
2928         (-[WKContentView _moveLeft:withHistory:]):
2929         (-[WKContentView _moveRight:withHistory:]):
2930         (-[WKContentView _moveToStartOfWord:withHistory:]):
2931         (-[WKContentView _moveToStartOfParagraph:withHistory:]):
2932         (-[WKContentView _moveToStartOfLine:withHistory:]):
2933         (-[WKContentView _moveToStartOfDocument:withHistory:]):
2934         (-[WKContentView _moveToEndOfWord:withHistory:]):
2935         (-[WKContentView _moveToEndOfParagraph:withHistory:]):
2936         (-[WKContentView _moveToEndOfLine:withHistory:]):
2937         (-[WKContentView _moveToEndOfDocument:withHistory:]):
2938         (-[WKContentView _selectionWillChange]):
2939         (-[WKContentView _selectionChanged]):
2940         * UIProcess/ios/WebPageProxyIOS.mm:
2941         (WebKit::WebPageProxy::notifySelectionWillChange):
2942
2943 2014-07-07  Anders Carlsson  <andersca@apple.com>
2944
2945         Add SPI for saving and restoring a WKWebView's _WKSessionState
2946         https://bugs.webkit.org/show_bug.cgi?id=134693
2947
2948         Reviewed by Dan Bernstein.
2949
2950         * UIProcess/API/C/WKPage.cpp:
2951         (WKPageRestoreFromSessionState):
2952         * UIProcess/API/Cocoa/WKWebView.mm:
2953         (-[WKWebView _sessionState]):
2954         (-[WKWebView _restoreFromSessionStateData:]):
2955         (-[WKWebView _restoreFromSessionState:]):
2956         (-[WKWebView _restoreSessionState:andNavigate:]):
2957         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2958         * UIProcess/API/Cocoa/_WKSessionState.mm:
2959         (-[_WKSessionState _initWithSessionState:]):
2960         * UIProcess/API/Cocoa/_WKSessionStateInternal.h:
2961         * UIProcess/WebPageProxy.cpp:
2962         (WebKit::WebPageProxy::restoreFromSessionState):
2963         * UIProcess/WebPageProxy.h:
2964
2965 2014-07-07  Anders Carlsson  <andersca@apple.com>
2966
2967         Add a stubbed out _WKSessionState class
2968         https://bugs.webkit.org/show_bug.cgi?id=134690
2969
2970         Reviewed by Geoffrey Garen.
2971
2972         * UIProcess/API/Cocoa/_WKSessionState.h: Copied from Source/WebKit2/UIProcess/LegacySessionStateCoding.h.
2973         * UIProcess/API/Cocoa/_WKSessionState.mm: Copied from Source/WebKit2/UIProcess/LegacySessionStateCoding.h.
2974         (-[_WKSessionState initWithData:]):
2975         (-[_WKSessionState data]):
2976         * UIProcess/API/Cocoa/_WKSessionStateInternal.h: Copied from Source/WebKit2/UIProcess/LegacySessionStateCoding.h.
2977         * UIProcess/Cocoa/SessionStateCoding.h: Copied from Source/WebKit2/UIProcess/LegacySessionStateCoding.h.
2978         * UIProcess/Cocoa/SessionStateCoding.mm: Copied from Source/WebKit2/UIProcess/LegacySessionStateCoding.h.
2979         (WebKit::encodeSessionState):
2980         (WebKit::decodeSessionState):
2981         * UIProcess/LegacySessionStateCoding.h:
2982         * WebKit2.xcodeproj/project.pbxproj:
2983
2984 2014-07-07  Anders Carlsson  <andersca@apple.com>
2985
2986         Some of the WKPreferences (API) property getters read like questions
2987         https://bugs.webkit.org/show_bug.cgi?id=134678
2988         <rdar://problem/17576847>
2989
2990         Reviewed by Dan Bernstein.
2991
2992         * UIProcess/API/Cocoa/WKPreferences.h:
2993         * UIProcess/API/Cocoa/WKPreferences.mm:
2994         (-[WKPreferences javaScriptIsEnabled]):
2995         (-[WKPreferences javaIsEnabled]):
2996         (-[WKPreferences plugInsAreEnabled]):
2997         (-[WKPreferences isJavaScriptEnabled]): Deleted.
2998         (-[WKPreferences isJavaEnabled]): Deleted.
2999         (-[WKPreferences arePlugInsEnabled]): Deleted.
3000
3001 2014-07-07  Brady Eidson  <beidson@apple.com>
3002
3003         ServicesOverlayController menus show up in the wrong place.
3004         <rdar://problem/17130576> and https://bugs.webkit.org/show_bug.cgi?id=134684
3005
3006         Reviewed by Tim Horton.
3007
3008         * WebProcess/WebPage/mac/ServicesOverlayController.mm:
3009         (WebKit::ServicesOverlayController::selectedTelephoneNumberRangesChanged): Handle cases where
3010           the telephone number is in a subframe.
3011         (WebKit::ServicesOverlayController::handleClick): The click point is always in main frame document
3012           coordinates, so convert it to window coordinates using the main frame’s FrameView.
3013
3014 2014-07-07  Dan Bernstein  <mitz@apple.com>
3015
3016         [Cocoa] Assertion failure in NavigationState::LoaderClient::didStartProvisionalLoadForFrame (navigationID) when navigating through the page cache
3017         https://bugs.webkit.org/show_bug.cgi?id=134682
3018
3019         Reviewed by Tim Horton.
3020
3021         * UIProcess/Cocoa/NavigationState.mm:
3022         (WebKit::NavigationState::LoaderClient::didStartProvisionalLoadForFrame): Replaced the
3023         assertion with a FIXME.
3024         (WebKit::NavigationState::LoaderClient::didReceiveServerRedirectForProvisionalLoadForFrame):
3025         Ditto.
3026         (WebKit::NavigationState::LoaderClient::didFailProvisionalLoadWithErrorForFrame): Ditto.
3027         (WebKit::NavigationState::LoaderClient::didCommitLoadForFrame): Ditto.
3028         (WebKit::NavigationState::LoaderClient::didFinishDocumentLoadForFrame): Ditto.
3029         (WebKit::NavigationState::LoaderClient::didFinishLoadForFrame): Ditto.
3030         (WebKit::NavigationState::LoaderClient::didFailLoadWithErrorForFrame): Ditto.
3031
3032 2014-07-07  KwangHyuk Kim  <hyuki.kim@samsung.com>
3033
3034         [EFL] Fix cursor artifacts on naver map site.
3035         https://bugs.webkit.org/show_bug.cgi?id=134649
3036
3037         Reviewed by Gyuyoung Kim.
3038
3039         Old evas cursor and ecore x cursor are reset before new cursor is applied.
3040
3041         * UIProcess/API/efl/EwkView.cpp:
3042         (EwkView::updateCursor):
3043
3044 2014-07-06  Benjamin Poulain  <bpoulain@apple.com>
3045
3046         [iOS][WK2] The tap highlight ID is not invalidated when a long press ends
3047         https://bugs.webkit.org/show_bug.cgi?id=134660
3048
3049         Reviewed by Darin Adler.
3050
3051         * UIProcess/ios/WKContentViewInteraction.mm:
3052         (-[WKContentView _cancelInteraction]):
3053         (-[WKContentView _finishInteraction]):
3054         (cancelPotentialTapIfNecessary):
3055         I messed that up in r170600. I only accounted for the web process being too fast.
3056
3057         If the web process is too slow, _cancelInteraction or _finishInteraction happen before
3058         _didGetTapHighlightForRequest:, and we also need to nuke the tap highlight.
3059
3060 2014-07-06  Tim Horton  <timothy_horton@apple.com>
3061
3062         [WK2] Don't support dynamically enabling the RemoteLayerTree debug indicator
3063         https://bugs.webkit.org/show_bug.cgi?id=134644
3064
3065         Reviewed by Darin Adler.
3066
3067         * UIProcess/DrawingAreaProxy.h:
3068         (WebKit::DrawingAreaProxy::setShouldShowDebugIndicator): Deleted.
3069         * UIProcess/WebPageProxy.cpp:
3070         (WebKit::WebPageProxy::preferencesDidChange):
3071         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h:
3072         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
3073         (WebKit::RemoteLayerTreeDrawingAreaProxy::RemoteLayerTreeDrawingAreaProxy):
3074         (WebKit::RemoteLayerTreeDrawingAreaProxy::initializeDebugIndicator):
3075         (WebKit::RemoteLayerTreeDrawingAreaProxy::setShouldShowDebugIndicator): Deleted.
3076         The indicator depends on the live layer tree commits coming in, including layer creation,
3077         so it can't be turned on after the root layer is created. Even a refresh is insufficient
3078         to get it working; the debug indicator really needs to exist from the first commit.
3079         So, don't even attempt to dynamically enable the indicator; create it at
3080         RemoteLayerTreeDrawingAreaProxy construction time if the pref is enabled.
3081
3082 2014-07-06  Yoav Weiss  <yoav@yoav.ws>
3083
3084         Turn on img@sizes compile flag
3085         https://bugs.webkit.org/show_bug.cgi?id=134634
3086
3087         Reviewed by Benjamin Poulain.
3088
3089         * Configurations/FeatureDefines.xcconfig: Moved compile flag to alphabetical order.
3090
3091 2014-07-06  Brady Eidson  <beidson@apple.com>
3092
3093         Speculative fix for: NetworkProcess sometimes hangs under copyDefaultCredentialForProtectionSpace
3094         https://bugs.webkit.org/show_bug.cgi?id=134666
3095
3096         Reviewed by Tim Horton.
3097
3098         * Shared/mac/SecItemRequestData.cpp:
3099         (WebKit::SecItemRequestData::encode): Encode whether or not the query dictionary exists.
3100         (WebKit::SecItemRequestData::decode): Only fail when query dictionary fails to decode if we expect one. 
3101
3102         * UIProcess/mac/SecItemShimProxy.cpp:
3103         (WebKit::SecItemShimProxy::secItemRequest): If the request is of type Invalid, log an error message asking 
3104           for a bug, and respond with an "invalid parameter" error.
3105
3106 2014-07-06  Antti Koivisto  <antti@apple.com>
3107
3108         Don't throttle layer flushes when the main resource is a GIF
3109         https://bugs.webkit.org/show_bug.cgi?id=134650
3110
3111         Reviewed by Simon Fraser.
3112
3113         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
3114         (WebKit::RemoteLayerTreeDrawingArea::adjustLayerFlushThrottling):
3115
3116 2014-07-04  Rohit Kumar  <kumar.rohit@samsung.com>
3117
3118         [EFL][WK2]Fix build break in EFL WK2
3119         https://bugs.webkit.org/show_bug.cgi?id=134629
3120
3121         Unreviewed build fix.
3122
3123         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedDrawingArea.cpp:
3124         (WebKit::CoordinatedDrawingArea::scheduleCompositingLayerFlushImmediately):
3125         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedDrawingArea.h:
3126
3127 2014-07-04  Dan Bernstein  <mitz@apple.com>
3128
3129         [Cocoa] -[WKWebView _reload] is unused
3130         https://bugs.webkit.org/show_bug.cgi?id=134638
3131
3132         Reviewed by Sam Weinig.
3133
3134         * UIProcess/API/Cocoa/WKWebView.mm:
3135         (-[WKWebView _reload]): Deleted.
3136         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
3137
3138 2014-07-04  Tim Horton  <timothy_horton@apple.com>
3139
3140         [WK2] Take TopContentInset into account when sending dictionary lookup point to PluginView
3141         https://bugs.webkit.org/show_bug.cgi?id=134624
3142         <rdar://problem/17222041>
3143
3144         Reviewed by Sam Weinig.
3145
3146         * WebProcess/Plugins/PDF/PDFPlugin.mm:
3147         (WebKit::PDFPlugin::performDictionaryLookupAtLocation):
3148         Perform the same coordinate conversion we use for mouse events, which happens
3149         to take the top content inset into account.
3150
3151 2014-07-04  Philippe Normand  <pnormand@igalia.com>
3152
3153         Unreviewed, GTK WK2 build fix after r170787.
3154
3155         * WebProcess/WebPage/DrawingAreaImpl.cpp:
3156         (WebKit::DrawingAreaImpl::scheduleCompositingLayerFlushImmediately):
3157         * WebProcess/WebPage/DrawingAreaImpl.h:
3158
3159 2014-07-04  Zan Dobersek  <zdobersek@igalia.com>
3160
3161         Unreviewed. Reverting the bad changes introduced in r170795.
3162
3163         * Platform/IPC/ArgumentDecoder.cpp:
3164         (IPC::ArgumentDecoder::decode): Deleted.
3165         * Platform/IPC/ArgumentDecoder.h:
3166         * Platform/IPC/ArgumentEncoder.cpp:
3167         (IPC::ArgumentEncoder::encode): Deleted.
3168         * Platform/IPC/ArgumentEncoder.h:
3169
3170 2014-07-04  Zan Dobersek  <zdobersek@igalia.com>
3171
3172         Unreviewed. Fixing the build for ports on 64-bit Linux.
3173
3174         Add IPC encoding and decoding overloads for the long long type, needed
3175         after r170755 started encoding and decoding long long variables in
3176         FormDataElement.
3177
3178         * Platform/IPC/ArgumentDecoder.cpp:
3179         (IPC::ArgumentDecoder::decode):
3180         * Platform/IPC/ArgumentDecoder.h:
3181         * Platform/IPC/ArgumentEncoder.cpp:
3182         (IPC::ArgumentEncoder::encode):
3183         * Platform/IPC/ArgumentEncoder.h:
3184
3185 2014-07-04  Timothy Horton  <timothy_horton@apple.com>
3186
3187         [iOS][WK2] Black web view after un-suspending process
3188         https://bugs.webkit.org/show_bug.cgi?id=134623
3189         <rdar://problem/17513223>
3190
3191         Reviewed by Simon Fraser.
3192
3193         * UIProcess/WebPageProxy.cpp:
3194         (WebKit::WebPageProxy::viewStateDidChange):
3195         Add an argument to viewStateDidChange that allows callers (-[WKContentView _applicationWillEnterForeground:])
3196         to force us to wait for a synchronous reply from the Web process after performing a view state change.
3197
3198         (WebKit::WebPageProxy::dispatchViewStateChange):
3199         Move the has-been-in-window-and-now-is-newly-in-window check into dispatchViewStateChange.
3200         Adjust the logic surrounding going into/out of window by factoring out the IsInWindow-did-change check, for clarity.
3201
3202         * UIProcess/WebPageProxy.h:
3203         * UIProcess/ios/WKContentView.mm:
3204         (-[WKContentView _applicationWillEnterForeground:]):
3205         As previously mentioned, wait for a reply when foregrounding.
3206
3207         * WebProcess/WebPage/DrawingArea.h:
3208         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
3209         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
3210         (WebKit::RemoteLayerTreeDrawingArea::scheduleCompositingLayerFlushImmediately):
3211         (WebKit::RemoteLayerTreeDrawingArea::scheduleCompositingLayerFlush):
3212         (WebKit::RemoteLayerTreeDrawingArea::viewStateDidChange):
3213         Make sure to schedule a commit immediately if the UI process is waiting for a reply.
3214         Previously we assumed that a commit would be scheduled anyway because we would have to reparent the
3215         layer tree, but that doesn't happen in the suspension-without-unparenting case. Also, we want to skip
3216         all throttling in this case.
3217
3218         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
3219         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
3220         (WebKit::TiledCoreAnimationDrawingArea::scheduleCompositingLayerFlushImmediately):
3221
3222 2014-07-03  Gavin Barraclough  <baraclough@apple.com>
3223
3224         Should not take background task assertion for NetworkProcess
3225         https://bugs.webkit.org/show_bug.cgi?id=134622
3226
3227         Reviewed by Tim Horton.
3228
3229         When the WebContent wants to complete a task in the background we take a process assertion on the child process, and also need to prevent the UI process from suspending.
3230         However for the NetworkProcess we always just hold a process assertion, and don't want this to interfere with UIApp suspension.
3231
3232         * Platform/IPC/mac/ConnectionMac.mm:
3233         (IPC::ConnectionTerminationWatchdog::ConnectionTerminationWatchdog):
3234             - ProcessAssertion -> ProcessAndUIAssertion
3235         * UIProcess/ProcessAssertion.cpp:
3236         (WebKit::ProcessAssertion::ProcessAssertion):
3237             - assignment -> initializer list.
3238         (WebKit::ProcessAndUIAssertion::ProcessAndUIAssertion):
3239         (WebKit::ProcessAndUIAssertion::~ProcessAndUIAssertion):
3240         (WebKit::ProcessAndUIAssertion::setState):
3241             - added no-op implementation.
3242         (WebKit::ProcessAssertion::~ProcessAssertion): Deleted.
3243         * UIProcess/ProcessAssertion.h:
3244             - removed ~ProcessAssertion, added ProcessAndUIAssertion class.
3245         * UIProcess/ProcessThrottler.cpp:
3246         (WebKit::ProcessThrottler::didConnnectToProcess):
3247             - ProcessAssertion -> ProcessAndUIAssertion
3248         * UIProcess/ProcessThrottler.h:
3249             - ProcessAssertion -> ProcessAndUIAssertion
3250         * UIProcess/ios/ProcessAssertionIOS.mm:
3251         (WebKit::ProcessAssertion::ProcessAssertion):
3252             - assignment -> initializer list.
3253             - moved code to manage WKProcessAssertionBackgroundTaskManager
3254         (WebKit::ProcessAssertion::setState):
3255             - moved code to manage WKProcessAssertionBackgroundTaskManager
3256         (WebKit::ProcessAndUIAssertion::ProcessAndUIAssertion):
3257         (WebKit::ProcessAndUIAssertion::~ProcessAndUIAssertion):
3258         (WebKit::ProcessAndUIAssertion::setState):
3259             - moved code to manage WKProcessAssertionBackgroundTaskManager from ProcessAssertion.
3260         (WebKit::ProcessAssertion::~ProcessAssertion): Deleted.
3261             - delete - moved code to manage WKProcessAssertionBackgroundTaskManager
3262
3263 2014-07-03  Simon Fraser  <simon.fraser@apple.com>
3264
3265         Clean up Brady's mess on iOS.
3266
3267         * Platform/mac/StringUtilities.h:
3268         * Platform/mac/StringUtilities.mm:
3269
3270 2014-07-03  Simon Fraser  <simon.fraser@apple.com>
3271
3272         [iOS WK2] Compositing layers draw outside page bounds
3273         https://bugs.webkit.org/show_bug.cgi?id=134619
3274         <rdar://problem/16953222>
3275
3276         Reviewed by Benjamin Poulain.
3277         
3278         With the new rubber-banding behavior, we no longer have the root content layer clipping all
3279         the web layers, but this resulted in web layers which were moved outside the viewport by CSS
3280         transforms not being clipped.
3281         
3282         Fix by adding a clipping layer inside the scroll view, above _rootContentView. This layer
3283         normally has the same bounds as the content, but when rubber-banding or pinching,
3284         it takes the union of the content bounds and the rect used for fixed positioning.
3285         To make scrolling work as expected in this scenario, when it has non-zero offset, it
3286         has to compensate by setting its bounds origin.
3287
3288         The bounds of the clipping layer are updated on scrolling/zooming, and when the
3289         layer commit tells us that the content size changed.
3290
3291         * UIProcess/API/Cocoa/WKWebView.mm:
3292         (-[WKWebView _updateScrollViewBackground]):
3293         * UIProcess/ios/WKContentView.mm:
3294         (-[WKContentView initWithFrame:context:configuration:webView:]):
3295         (-[WKContentView updateFixedClippingView:]):
3296         (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:]):
3297         (-[WKContentView _didCommitLayerTree:]):
3298
3299 2014-07-03  Brady Eidson  <beidson@apple.com>
3300
3301         When showing the selection menu, include menu options for all selected phone numbers.
3302         <rdar://problem/16983434>, <rdar://problem/16874568>, and https://bugs.webkit.org/show_bug.cgi?id=134613
3303
3304         Reviewed by Tim Horton.
3305
3306         Move some telephone number menu logic from WebKitSystemInterface here.
3307         Also provide utility to get just the one menu item relevant to a telephone number.
3308         * Platform/mac/MenuUtilities.h:
3309         * Platform/mac/MenuUtilities.mm: Added.
3310         (WebKit::menuItemForTelephoneNumber):
3311         (WebKit::menuItemsForTelephoneNumber):
3312
3313         * Platform/mac/StringUtilities.h:
3314         * Platform/mac/StringUtilities.mm:
3315         (WebKit::formattedPhoneNumberString): Return a localized formatted phone number.
3316
3317         Add a member to track the selected phone numbers:
3318         * Shared/ContextMenuContextData.h:
3319         (WebKit::ContextMenuContextData::ContextMenuContextData):
3320         (WebKit::ContextMenuContextData::selectedTelephoneNumbers):
3321
3322         * UIProcess/WebPageProxy.h:
3323         * UIProcess/WebPageProxy.messages.in:
3324
3325         * UIProcess/mac/WebContextMenuProxyMac.mm:
3326         (WebKit::WebContextMenuProxyMac::setupServicesMenu): Also add menu items for each phone number that is
3327           in the selection.
3328
3329         Switch away from a WKSI method, and remove a lot of unneeded forward declarations and soft linking:
3330         * UIProcess/mac/WebPageProxyMac.mm:
3331         (WebKit::WebPageProxy::showTelephoneNumberMenu):
3332         (WebKit::WebPageProxy::showSelectionServiceMenu):
3333
3334         * WebKit2.xcodeproj/project.pbxproj:
3335
3336         * WebProcess/WebPage/mac/ServicesOverlayController.mm:
3337         (WebKit::ServicesOverlayController::drawSelectionHighlight):
3338         (WebKit::ServicesOverlayController::handleClick): Pass the phone numbers along.
3339
3340         * WebProcess/WebPage/WebPage.h:
3341         * WebProcess/WebPage/mac/WebPageMac.mm:
3342         (WebKit::WebPage::handleSelectionServiceClick): Pass the phone numbers along.
3343
3344 2014-07-03  Gavin Barraclough  <baraclough@apple.com>
3345
3346         WKProcessAssertionBackgroundTaskManager should clear member if task expires
3347         https://bugs.webkit.org/show_bug.cgi?id=134618
3348
3349         Reviewed by Anders Carlson.
3350
3351         Failure to do so results in a warning, and could result in us erroneously completing a background task too soon.
3352
3353         * UIProcess/ios/ProcessAssertionIOS.mm:
3354         (-[WKProcessAssertionBackgroundTaskManager _updateBackgroundTask]):
3355             - remove local variable, _backgroundTask = UIBackgroundTaskInvalid;
3356
3357 2014-07-03  Joseph Pecoraro  <pecoraro@apple.com>
3358
3359         Unreviewed iOS build fix for r170774.
3360
3361         Remove some unnecessary WTF::moves on iOS:
3362         error: static_assert failed "T is not an lvalue reference; move() is unnecessary."
3363
3364         * WebProcess/WebPage/EventDispatcher.cpp:
3365         (WebKit::EventDispatcher::getQueuedTouchEventsForPage):
3366         (WebKit::EventDispatcher::touchEvent):
3367
3368 2014-07-03  Anders Carlsson  <andersca@apple.com>
3369
3370         Try to fix the iOS build.
3371
3372         Add WebPageProxyCocoa.mm for code shared between iOS and OS X. Put the recent searches save/restore code there.
3373
3374         * UIProcess/Cocoa/WebPageProxyCocoa.mm: Added.
3375         (WebKit::autosaveKey):
3376         (WebKit::WebPageProxy::saveRecentSearches):
3377         (WebKit::WebPageProxy::loadRecentSearches):
3378         * UIProcess/mac/WebPageProxyMac.mm:
3379         * WebKit2.xcodeproj/project.pbxproj:
3380
3381 2014-07-03  Dan Bernstein  <mitz@apple.com>
3382
3383         <rdar://problem/16337741> The UI process needs to track the number of HTTP subresource loads in progress (or at least whether there are any)
3384         https://bugs.webkit.org/show_bug.cgi?id=134615
3385
3386         Reviewed by Anders Carlsson.
3387
3388         Added a _networkRequestsInProgress boolean property to WKWebView.
3389
3390         * UIProcess/API/Cocoa/WKBrowsingContextController.mm: Added no-op overrides of new
3391         PageLoadStateObserver member functions.
3392
3393         * UIProcess/API/Cocoa/WKWebView.mm:
3394         (-[WKWebView _networkRequestsInProgress]): New getter that gets this state from the
3395         PageLoadState.
3396         * UIProcess/API/Cocoa/WKWebViewPrivate.h: Declared new property.
3397
3398         * UIProcess/Cocoa/NavigationState.h:
3399         * UIProcess/Cocoa/NavigationState.mm:
3400         (WebKit::NavigationState::willChangeNetworkRequestsInProgress):: Override this new
3401         PageLoadState::Observer member function by sending the appropriate KVO change message to the
3402         WKWebView.
3403         (WebKit::NavigationState::didChangeNetworkRequestsInProgress): Ditto.
3404
3405         * UIProcess/PageLoadState.cpp:
3406         (WebKit::PageLoadState::commitChanges): Check for changes to networkRequestsInProgress
3407         and call the observers if needed.
3408         (WebKit::PageLoadState::reset): Reset networkRequestsInProgress in the uncommitted state.
3409         (WebKit::PageLoadState::setNetworkRequestsInProgress): Set networkRequestsInProgress in the
3410         uncommitted state.
3411         * UIProcess/PageLoadState.h:
3412         (WebKit::PageLoadState::networkRequestsInProgress): Added this getter.
3413         (WebKit::PageLoadState::Data::Data): Initialize new networkRequestsInProgress member.
3414
3415         * UIProcess/WebPageProxy.cpp:
3416         (WebKit::WebPageProxy::setNetworkRequestsInProgress): Added. Updates the PageLoadState.
3417         * UIProcess/WebPageProxy.h:
3418         * UIProcess/WebPageProxy.messages.in: Added SetNetworkRequestsInProgress message.
3419
3420         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3421         (WebKit::WebFrameLoaderClient::assignIdentifierToInitialRequest): Call
3422         WebPage::addResourceRequest.
3423         (WebKit::WebFrameLoaderClient::dispatchDidFinishLoading): Call
3424         WebPage::removeResourceRequest.
3425         (WebKit::WebFrameLoaderClient::dispatchDidFailLoading): Ditto.
3426
3427         * WebProcess/WebPage/WebPage.cpp:
3428         (WebKit::WebPage::addResourceRequest): Added. If the new request is for an HTTP-family URL,
3429         add its identifier to the set of network resourece request identifiers. If the set was
3430         previously empty, send the WebPageProxy a message.
3431         (WebKit::WebPage::removeResourceRequest): Added. Remove the identifier from the set. If it
3432         becomes empty, send the WebPageProxy a message.
3433         * WebProcess/WebPage/WebPage.h:
3434
3435 2014-07-03  Anders Carlsson  <andersca@apple.com>
3436
3437         Remove two unused functions
3438         https://bugs.webkit.org/show_bug.cgi?id=134614
3439
3440         Reviewed by Andreas Kling.
3441
3442         * UIProcess/LegacySessionStateCoding.h:
3443         * UIProcess/mac/LegacySessionStateCoding.cpp:
3444         (WebKit::encodeLegacySessionHistoryEntryData): Deleted.
3445         (WebKit::decodeLegacySessionHistoryEntryData): Deleted.
3446
3447 2014-07-03  Daniel Bates  <dabates@apple.com>
3448
3449         Add WTF::move()
3450         https://bugs.webkit.org/show_bug.cgi?id=134500
3451