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