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