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