71190ae84eab334fa0d095d829b739f8d30a94c4
[WebKit-https.git] / Source / WebKit2 / ChangeLog
1 2014-07-01  Tim Horton  <timothy_horton@apple.com>
2
3         Handle invalid data more gracefully.
4
5         Reviewed by Anders Carlsson.
6
7         * UIProcess/mac/LegacySessionStateCoding.cpp:
8         (WebKit::decodeFormData):
9         (WebKit::decodeBackForwardTreeNode):
10
11 2014-07-01  Mark Rowe  <mrowe@apple.com>
12
13         Add a missing return statement in WKPageCopySessionState.
14
15         Reviewed by Anders Carlsson.
16
17         * UIProcess/API/C/WKPage.cpp:
18         (WKPageCopySessionState):
19
20 2014-07-01  Anders Carlsson  <andersca@apple.com>
21
22         Don't encode/decode the snapshot UUID
23         https://bugs.webkit.org/show_bug.cgi?id=134532
24
25         Reviewed by Sam Weinig.
26
27         * UIProcess/mac/LegacySessionStateCoding.cpp:
28         (WebKit::encodeSessionHistory):
29         (WebKit::decodeSessionHistoryEntry):
30
31 2014-07-01  Commit Queue  <commit-queue@webkit.org>
32
33         Unreviewed, rolling out r170608.
34         https://bugs.webkit.org/show_bug.cgi?id=134533
35
36         Safari keeps crashing on device due to sandbox violation.
37         (Requested by enrica on #webkit).
38
39         Reverted changeset:
40
41         "Restrict network process sandbox"
42         https://bugs.webkit.org/show_bug.cgi?id=134360
43         http://trac.webkit.org/changeset/170608
44
45 2014-07-01  Pratik Solanki  <psolanki@apple.com>
46
47         Encode/decode CFURLRequestRefs when USE(CFNETWORK) is enabled
48         https://bugs.webkit.org/show_bug.cgi?id=134454
49         <rdar://problem/17510980>
50
51         Reviewed by Andreas Kling.
52
53         Use new helper methods to serialize/deserialize CFURLRequestRef directly so we can avoid
54         creating NSURLRequest.
55
56         * Shared/mac/WebCoreArgumentCodersMac.mm:
57         (IPC::ArgumentCoder<ResourceRequest>::encodePlatformData):
58         (IPC::ArgumentCoder<ResourceRequest>::decodePlatformData):
59
60 2014-07-01  Benjamin Poulain  <benjamin@webkit.org>
61
62         [iOS][WK2] Fix a race between the short tap and long tap highlight
63         https://bugs.webkit.org/show_bug.cgi?id=134530
64
65         Reviewed by Enrica Casucci.
66
67         There was a potential race of event that can theoretically cause WKContentViewInteraction
68         to call [WKContentView _showTapHighlight] after all interactions have been cancelled.
69
70         The race would be like this:
71         1) On a short tap, _singleTapRecognized: is called, a tap highlight ID is defined and
72            _potentialTapInProgress is set to YES.
73         2) For some reason, the gesture is cancelled. The method _singleTapDidReset is called, 
74            setting _potentialTapInProgress but leaving the tap highlight ID as valid.
75         3) The UIProcess receives the tap highlight information from the WebProcess, _didGetTapHighlightForRequest:
76            has a valid ID, _potentialTapInProgress is false -> the highlight is shown right away as if a long tap
77            was in progress.
78
79         The missing piece that causes this is _singleTapDidReset: must also invalidate the tap highlight ID. This is done
80         in the new static function cancelPotentialTapIfNecessary().
81
82         Just invalidating the ID would create another race:
83         1) Short tap gesture recognizer starts.
84         2) The long press recognizer starts before (1) is commited.
85         3) The long press recognizers sets up its own tap highlight ID.
86         4) The short tap gesture recognizer resets, erasing the tap highlight ID defined in (3).
87
88         To avoid this, the long press gesture recognizers immediately cancels any potential tap in progress.
89         If _singleTapDidReset: is called before (3), this does nothing. If the reset is called after (3),
90         _singleTapDidReset does nothing.
91
92         * UIProcess/ios/WKContentViewInteraction.mm:
93         (-[WKContentView _highlightLongPressRecognized:]):
94         (cancelPotentialTapIfNecessary):
95         (-[WKContentView _singleTapDidReset:]):
96
97 2014-07-01  Anders Carlsson  <andersca@apple.com>
98
99         Add ABI hacks to allow WKPageRef to use WKSessionStateRef
100         https://bugs.webkit.org/show_bug.cgi?id=134529
101
102         Reviewed by Sam Weinig.
103
104         * UIProcess/API/APISessionState.h:
105         Add a sessionState() getter.
106         
107         * UIProcess/API/C/WKPage.cpp:
108         (WKPageCopySessionState):
109         Add a hack where we return a WKSessionStateRef if the least significant bit of the context pointer
110         is 1, and a WKDataRef otherwise.
111
112         (WKPageRestoreFromSessionState):
113         Handle both WKDataRef and WKSessionStateref.
114
115         * UIProcess/API/C/WKPage.h:
116         Use WKTypeRefs for state saving and restoration.
117
118         * UIProcess/API/C/WKSessionStateRef.cpp:
119         (WKSessionStateCopyData):
120         Add helper function.
121
122 2014-07-01  Anders Carlsson  <andersca@apple.com>
123
124         WKPageRestoreFromSessionState should use the new session state restore code path
125         https://bugs.webkit.org/show_bug.cgi?id=134526
126
127         Reviewed by Tim Horton.
128
129         * UIProcess/API/C/WKPage.cpp:
130         (WKPageRestoreFromSessionState):
131         Use the new code path.
132
133         * UIProcess/WebPageProxy.cpp:
134         (WebKit::WebPageProxy::restoreFromState):
135         Only restore the back-forward state if we have a back-forward list.
136
137         * UIProcess/mac/LegacySessionStateCoding.cpp:
138         (WebKit::encodeSessionHistory):
139         Save the original URL string as well.
140
141         (WebKit::decodeV1SessionHistory):
142         If we don't have a current index, set it to Nullopt instead of 0.
143
144 2014-07-01  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
145
146         Unreviewed. EFL and GTK build fix since r170654.
147
148         * UIProcess/LegacySessionStateCodingNone.cpp: Add a dummy encodeLegacySessionState(const SessionState&).
149         (WebKit::encodeLegacySessionState):
150
151 2014-07-01  Dan Bernstein  <mitz@apple.com>
152
153         Crash in WebDocumentLoader::setNavigationID
154         https://bugs.webkit.org/show_bug.cgi?id=134520
155
156         Reviewed by Anders Carlsson.
157
158         * WebProcess/WebPage/WebFrame.cpp:
159         (WebKit::WebFrame::didReceivePolicyDecision): Null-check the policy document loader.
160
161 2014-07-01  Dan Bernstein  <mitz@apple.com>
162
163         Build fix.
164
165         * UIProcess/API/APILoaderClient.h:
166         (API::LoaderClient::didDestroyNavigation):
167
168 2014-07-01  Anders Carlsson  <andersca@apple.com>
169
170         Use the new legacy session state coding in WKPageCopySessionState
171         https://bugs.webkit.org/show_bug.cgi?id=134516
172
173         Reviewed by Tim Horton.
174
175         * UIProcess/API/C/WKPage.cpp:
176         (WKPageCopySessionState):
177         Call encodeLegacySessionState.
178
179         * UIProcess/mac/LegacySessionStateCoding.cpp:
180         (WebKit::encodeSessionHistoryEntryData):
181         Use leakPtr() so we won't attempt to double-free the buffer.
182
183         (WebKit::createDictionary):
184         Fix a typo.
185
186         (WebKit::encodeLegacySessionState):
187         Don't encode the provisional URL if it's empty.
188
189 2014-07-01  Chris Fleizach  <cfleizach@apple.com>
190
191         AX: [iOS WebKit2] Support for Speak selection
192         https://bugs.webkit.org/show_bug.cgi?id=134512
193
194         Reviewed by Darin Adler.
195
196         Implement a method that Speak Selection can use to retrieve the selected content.
197
198         * UIProcess/ios/WKContentViewInteraction.mm:
199         (-[WKContentView accessibilityRetrieveSpeakSelectionContent]):
200
201 2014-07-01  Anders Carlsson  <andersca@apple.com>
202
203         Update the highest back-forward list item ID in the other WebBackForwardListItem constructor
204         https://bugs.webkit.org/show_bug.cgi?id=134515
205
206         Reviewed by Tim Horton.
207
208         * Shared/WebBackForwardListItem.cpp:
209         (WebKit::WebBackForwardListItem::WebBackForwardListItem):
210
211 2014-07-01  Brady Eidson  <beidson@apple.com>
212
213         Fix ServicesOverlayController teardown
214         <rdar://problem/17523998> and https://bugs.webkit.org/show_bug.cgi?id=134510
215
216         Reviewed by Mark Rowe.
217
218         * WebProcess/WebPage/mac/ServicesOverlayController.mm:
219         (WebKit::ServicesOverlayController::~ServicesOverlayController): Flipped logic on null-checking the overlay.
220
221 2014-07-01  Sam Weinig  <sam@webkit.org>
222
223         [Cocoa][Mac] WKWebView should automatically set topContentInset when beneath a toolbar
224         <rdar://problem/17523159>
225         https://bugs.webkit.org/show_bug.cgi?id=134496
226
227         Reviewed by Beth Dakin.
228
229         - Adds _automaticallyAdjustsContentInsets SPI to both WKView and WKWebView.
230         - Defaults _automaticallyAdjustsContentInsets to NO for WKView to keep legacy clients working.
231         - Defaults _automaticallyAdjustsContentInsets to YES for WKWebView.
232
233         * UIProcess/API/Cocoa/WKViewPrivate.h:
234         Add _automaticallyAdjustsContentInsets SPI.
235
236         * UIProcess/API/Cocoa/WKWebView.mm:
237         (-[WKWebView initWithFrame:configuration:]):
238         Default _automaticallyAdjustsContentInsets to YES for WKWebView.
239
240         (-[WKWebView _setTopContentInset:]):
241         (-[WKWebView _topContentInset]):
242         Change to forward to the WKView, since we now do coalescing and caching there.
243
244         (-[WKWebView _setAutomaticallyAdjustsContentInsets:]):
245         (-[WKWebView _automaticallyAdjustsContentInsets]):
246         Forward to the WKView.
247
248         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
249         Add _automaticallyAdjustsContentInsets SPI.
250
251         * UIProcess/API/mac/WKView.mm:
252         (-[WKView renewGState]):
253         Ensure the contentInset is updated when the view changes, as its relative location to the toolbar may have changed.
254
255         (-[WKView addWindowObserversForWindow:]):
256         (-[WKView removeWindowObservers]):
257         (-[WKView observeValueForKeyPath:ofObject:change:context:]):
258         Add observers for the contentLayoutRect and titlebarAppearsTransparent properties on the window. If either of them
259         change, we need to recalculate the content inset.
260
261         (-[WKView _updateContentInsetsIfAutomatic]):
262         If _automaticallyAdjustsContentInsets is YES, follow the same rules as AppKit in setting the top content inset. Like
263         AppKit this is only done when:
264             - The window's style mask has the NSFullSizeContentViewWindowMask bit.
265             - The window does not have titlebarAppearsTransparent set.
266             - And we are not in an enclosing NSScrollView.
267
268         (-[WKView _setTopContentInset:]):
269         (-[WKView _topContentInset]):
270         Coalesce setting the topContentInset to avoid a visual lag when resizing the window that was caused by us sending
271         multiple topContentInsets to the WebContentProcess per runloop cycle. The reason for the lag was that at the time
272         we observe the contentLayoutRect changing, our view may not yet be in its final position yet, so the inset will be
273         temporarily wrong. When the view is finally positioned correctly, we will get a renewGState, at which point we will
274         again calculate the inset, which now will be correct. Since these both happen in the same runloop iteration, we can
275         just defer sending the inset to the WebContentProcess.
276
277         (-[WKView _setAutomaticallyAdjustsContentInsets:]):
278         (-[WKView _automaticallyAdjustsContentInsets]):
279         Add the new SPI.
280
281 2014-07-01  Anders Carlsson  <andersca@apple.com>
282
283         Add a function for restoring page state given a SessionState object
284         https://bugs.webkit.org/show_bug.cgi?id=134509
285
286         Reviewed by Tim Horton.
287
288         * Shared/WebBackForwardListItem.h:
289         (WebKit::WebBackForwardListItem::itemState):
290         * UIProcess/WebBackForwardList.cpp:
291         (WebKit::WebBackForwardList::saveState):
292         * UIProcess/WebBackForwardList.h:
293         * UIProcess/WebPageProxy.cpp:
294         (WebKit::WebPageProxy::saveState):
295         * UIProcess/WebPageProxy.h:
296
297 2014-07-01  Dan Bernstein  <mitz@apple.com>
298
299         [Cocoa] Navigation parameter in navigation delegate messages is nil for navigations started by the Web Content process
300         https://bugs.webkit.org/show_bug.cgi?id=134482
301
302         Reviewed by Tim Horton.
303
304         * UIProcess/API/APILoaderClient.h:
305         (API::LoaderClient::didDestroyNavigation): New client function, called when a navigation ID
306         is not going to be used anymore.
307
308         * UIProcess/API/Cocoa/WKWebView.mm:
309         (-[WKWebView _restoreFromSessionState:]): If restoring triggered a navigation, create a
310         WKNavigation for its ID.
311
312         * UIProcess/Cocoa/NavigationState.h:
313         * UIProcess/Cocoa/NavigationState.mm:
314         (WebKit::NavigationState::createLoadRequestNavigation): Removed FIXME, because we now remove
315         navigations from the map in LoaderClient::didDestroyNavigation.
316         (WebKit::NavigationState::createBackForwardNavigation): Ditto.
317         (WebKit::NavigationState::createReloadNavigation): Ditto.
318         (WebKit::NavigationState::createLoadDataNavigation): Ditto.
319         (WebKit::NavigationState::PolicyClient::decidePolicyForNavigationAction): If we are only
320         getting a navigation ID now, create a WKNavigation for it. Also changed to create the
321         NSURLRequest lazily.
322         (WebKit::NavigationState::LoaderClient::didStartProvisionalLoadForFrame): Assert that
323         navigationID is not zero and that it maps to an existing WKNavigation.
324         (WebKit::NavigationState::LoaderClient::didReceiveServerRedirectForProvisionalLoadForFrame):
325         Ditto.
326         (WebKit::NavigationState::LoaderClient::didFailProvisionalLoadWithErrorForFrame): Ditto.
327         (WebKit::NavigationState::LoaderClient::didCommitLoadForFrame): Ditto.
328         (WebKit::NavigationState::LoaderClient::didFinishDocumentLoadForFrame): Ditto.
329         (WebKit::NavigationState::LoaderClient::didFinishLoadForFrame): Ditto.
330         (WebKit::NavigationState::LoaderClient::didFailLoadWithErrorForFrame): Ditto.
331         (WebKit::NavigationState::LoaderClient::didDestroyNavigation): Override the new client
332         function to remove the navigation from the map.
333         (WebKit::NavigationState::LoaderClient::processDidCrash): Clear the navigations map.
334
335         * UIProcess/WebFrameListenerProxy.cpp:
336         (WebKit::WebFrameListenerProxy::WebFrameListenerProxy): Initialize new m_navigationID
337         member variable.
338         (WebKit::WebFrameListenerProxy::receivedPolicyDecision): Pass the navigation ID to
339         WebFrame::receivedPolicyDecision.
340         * UIProcess/WebFrameListenerProxy.h:
341         (WebKit::WebFrameListenerProxy::navigationID): Added this accessor.
342         (WebKit::WebFrameListenerProxy::setNavigationID): Ditto.
343
344         * UIProcess/WebFrameProxy.cpp:
345         (WebKit::WebFrameProxy::receivedPolicyDecision): Added navigationID parameter, which is
346         passed along to the WebPageProxy.
347         * UIProcess/WebFrameProxy.h:
348
349         * UIProcess/WebPageProxy.cpp:
350         (WebKit::WebPageProxy::receivedPolicyDecision): Added navigationID parameter, which is
351         passed along in the message to the Web Content process.
352         (WebKit::WebPageProxy::restoreFromSessionStateData): Changed to return a navigation ID of 0.
353         (WebKit::WebPageProxy::restoreFromState): Changed to return a navigation ID if one was
354         started.
355         (WebKit::WebPageProxy::didDestroyNavigation): Added. Calls the new client function.
356         (WebKit::WebPageProxy::decidePolicyForNavigationAction): Added navigationID and
357         newNavigationID parameters. If a main-frame navigation doesn’t already have an ID, assign it
358         a new ID and return it in the newNavigationID parmeter as well as setting it on the listener
359         for the asynchronous case.
360         * UIProcess/WebPageProxy.h:
361
362         * UIProcess/WebPageProxy.messages.in: Added navigationID and newNavigationID parameters.
363
364         * UIProcess/cf/WebPageProxyCF.cpp:
365         (WebKit::WebPageProxy::restoreFromSessionStateData): Changed to return a navigation ID if
366         one was started.
367
368         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
369         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse): Updated for additional
370         parameter.
371         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction): Send the navigation
372         ID to the UI process, get the new navigation ID from the reply, and set it on the document
373         loader.
374
375         * WebProcess/WebPage/WebDocumentLoader.cpp:
376         (WebKit::WebDocumentLoader::detachFromFrame): Override to let the UI process know that the
377         navigation ID will not be used anymore.
378         * WebProcess/WebPage/WebDocumentLoader.h:
379
380         * WebProcess/WebPage/WebFrame.cpp:
381         (WebKit::WebFrame::didReceivePolicyDecision): Added navigationID parameter, set it on the
382         document loader.
383         (WebKit::WebFrame::documentLoaderDetached): Pass the message along to the UI process.
384         * WebProcess/WebPage/WebFrame.h:
385
386         * WebProcess/WebPage/WebPage.cpp:
387         (WebKit::WebPage::didReceivePolicyDecision): Pass new navigationID parameter along.
388         * WebProcess/WebPage/WebPage.h:
389
390         * WebProcess/WebPage/WebPage.messages.in: Added navigationID parameter.
391
392 2014-07-01  Anders Carlsson  <andersca@apple.com>
393
394         Fix build.
395
396         * WebKit2.xcodeproj/project.pbxproj:
397
398 2014-07-01  Anders Carlsson  <andersca@apple.com>
399
400         Temporarily encode and decode the snapshot UUID
401         https://bugs.webkit.org/show_bug.cgi?id=134507
402
403         Reviewed by Tim Horton.
404
405         * UIProcess/mac/LegacySessionStateCoding.cpp:
406         (WebKit::encodeSessionHistory):
407         (WebKit::decodeSessionHistoryEntry):
408         (WebKit::decodeSessionHistoryEntries):
409
410 2014-07-01  Anders Carlsson  <andersca@apple.com>
411
412         Implement encodeSessionHistoryEntryData
413         https://bugs.webkit.org/show_bug.cgi?id=134505
414
415         Reviewed by Tim Horton.
416
417         * UIProcess/API/C/WKPage.cpp:
418         (WKPageCopySessionState):
419         Add back a missing null check for the filter pointer.
420
421         * UIProcess/mac/LegacySessionStateCoding.cpp:
422         (WebKit::encodeSessionHistoryEntryData):
423
424 2014-07-01  Simon Fraser  <simon.fraser@apple.com>
425
426         [UI-side compositing] Bad spinner on news.google.com: animations need to be ordered
427         https://bugs.webkit.org/show_bug.cgi?id=134504
428         <rdar://problem/17507892>
429
430         Reviewed by Tim Horton.
431         
432         The layer's addedAnimations property needs to maintain order, since the order
433         in which transforms are applied is important.
434
435         * Shared/mac/RemoteLayerTreeTransaction.h: Use a Vector<pair<>> for addedAnimations.
436         * Shared/mac/RemoteLayerTreeTransaction.mm:
437         (WebKit::dumpChangedLayers):
438         * WebProcess/WebPage/mac/PlatformCAAnimationRemote.h:
439         * WebProcess/WebPage/mac/PlatformCAAnimationRemote.mm:
440         (WebKit::PlatformCAAnimationRemote::updateLayerAnimations):
441         * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
442         (WebKit::PlatformCALayerRemote::addAnimationForKey): If this is a new entry, we
443         can just append to addedAnimations, otherwise we have to find the existing one
444         and update its properties.
445         (WebKit::PlatformCALayerRemote::removeAnimationForKey): Do linear search to
446         find the animation to remove (this list will normally be short).
447
448 2014-07-01  Anders Carlsson  <andersca@apple.com>
449
450         Add a encodeLegacySessionState function
451         https://bugs.webkit.org/show_bug.cgi?id=134502
452
453         Reviewed by Tim Horton.
454
455         * UIProcess/LegacySessionStateCoding.h:
456         * UIProcess/mac/LegacySessionStateCoding.cpp:
457         (WebKit::encodeSessionHistoryEntryData):
458         (WebKit::encodeLegacySessionHistoryEntryData):
459         (WebKit::createDictionary):
460         (WebKit::encodeSessionHistory):
461         (WebKit::encodeLegacySessionState):
462
463 2014-07-01  Alexey Proskuryakov  <ap@apple.com>
464
465         [Cocoa] WebProcess doesn't follow localization of UI process when run as a service
466         https://bugs.webkit.org/show_bug.cgi?id=133126
467         <rdar://problem/13396515>
468
469         Patch by Alexey Proskuryakov.
470         Reviewed by Tim Horton.
471
472         * Configurations/WebContentService.Development.xcconfig:
473         * Configurations/WebContentService.xcconfig:
474         Figure out which of the two keys to use. CFBundleAllowMixedLocalizations was
475         a workaround before we got CFBundleFollowParentLocalization, and these cannot be
476         used together.
477
478         * UIProcess/Launcher/mac/ProcessLauncherMac.mm: (WebKit::connectToService): Set up
479         XPC bootstrap for CFBundle to use.
480
481         * WebKit2.xcodeproj/project.pbxproj: Added a script that applies the key to Info.plist.
482
483         * WebProcess/EntryPoint/mac/XPCService/WebContentService.Development/Info-OSX.plist:
484         * WebProcess/EntryPoint/mac/XPCService/WebContentService.Development/Info-iOS.plist:
485         * WebProcess/EntryPoint/mac/XPCService/WebContentService/Info-OSX.plist:
486         * WebProcess/EntryPoint/mac/XPCService/WebContentService/Info-iOS.plist:
487         Removed CFBundleAllowMixedLocalizations, we now add it programmatically.
488
489 2014-07-01  Alex Christensen  <achristensen@webkit.org>
490
491         [iOS] Unreviewed build fix after r170640.
492
493         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
494         (WebKit::WebEditorClient::selectedTelephoneNumberRangesChanged):
495         (WebKit::WebEditorClient::selectionRectsDidChange):
496         * WebProcess/WebCoreSupport/WebEditorClient.h:
497         * WebProcess/WebPage/WebPage.h:
498         Add ifdefs to make everything compile and link.
499
500 2014-07-01  Anders Carlsson  <andersca@apple.com>
501
502         Add WKSessionStateGetTypeID
503         https://bugs.webkit.org/show_bug.cgi?id=134499
504
505         Reviewed by Tim Horton.
506
507         * UIProcess/API/C/WKSessionStateRef.cpp:
508         (WKSessionStateGetTypeID):
509         * UIProcess/API/C/WKSessionStateRef.h:
510
511 2014-07-01  Daniel Bates  <dabates@apple.com>
512
513         Remove unnecessary calls to std::move()
514         https://bugs.webkit.org/show_bug.cgi?id=134493
515
516         Reviewed by Anders Carlsson.
517
518         * Shared/ShareableResource.cpp:
519         (WebKit::ShareableResource::Handle::tryWrapInCFData):
520         * WebProcess/WebPage/WebFrame.cpp:
521         (WebKit::WebFrame::certificateInfo): Return a WebCore::CertificateInfo instead
522         of const WebCore::CertificateInfo& to avoid returning a dangling reference to
523         a local variable. Also, remove the unnecessary calls to std::move() as the compiler
524         will invoke the move constructor for WebCore::CertificateInfo on return from the
525         function.
526         * WebProcess/WebPage/WebFrame.h:
527
528 2014-07-01  Anders Carlsson  <andersca@apple.com>
529
530         Add a BackForwardListItemState struct and put the snapshot UUID there
531         https://bugs.webkit.org/show_bug.cgi?id=134497
532
533         Reviewed by Sam Weinig.
534
535         * Shared/SessionState.cpp:
536         (WebKit::PageState::encode):
537         (WebKit::PageState::decode):
538         (WebKit::BackForwardListItemState::encode):
539         (WebKit::BackForwardListItemState::decode):
540         * Shared/SessionState.h:
541         * Shared/WebBackForwardListItem.cpp:
542         (WebKit::WebBackForwardListItem::create):
543         (WebKit::WebBackForwardListItem::WebBackForwardListItem):
544         (WebKit::WebBackForwardListItem::backForwardData):
545         (WebKit::WebBackForwardListItem::setBackForwardData):
546         (WebKit::WebBackForwardListItem::encode):
547         * Shared/WebBackForwardListItem.h:
548         (WebKit::WebBackForwardListItem::setPageState):
549         (WebKit::WebBackForwardListItem::setOriginalURL):
550         (WebKit::WebBackForwardListItem::originalURL):
551         (WebKit::WebBackForwardListItem::setURL):
552         (WebKit::WebBackForwardListItem::url):
553         (WebKit::WebBackForwardListItem::setTitle):
554         (WebKit::WebBackForwardListItem::title):
555         (WebKit::WebBackForwardListItem::setSnapshotUUID):
556         (WebKit::WebBackForwardListItem::snapshotUUID):
557         * UIProcess/WebBackForwardList.cpp:
558         (WebKit::WebBackForwardList::restoreFromState):
559         * UIProcess/WebProcessProxy.cpp:
560         (WebKit::WebProcessProxy::addBackForwardItem):
561         * UIProcess/mac/LegacySessionStateCoding.cpp:
562         (WebKit::decodeSessionHistoryEntries):
563
564 2014-07-01  Yongjun Zhang  <yongjun_zhang@apple.com>
565
566         Add encodeInteger and decodeInteger for remote object encoder and decoder.
567         https://bugs.webkit.org/show_bug.cgi?id=134453
568
569         In 64bit system, encodeInteger/decodeInteger is by default mapped into encodeInt64/decodeInt64.  For
570         32bit system, they are mapped to encodeInt32/decodeInt32.  However, since we don't have encodeInt32/decodeInt32
571         implementation in WKRemoteObjectCoder, we could hit crash in 32bit systems.
572
573         Reviewed by Sam Weinig.
574
575         * Shared/API/Cocoa/WKRemoteObjectCoder.mm:
576         (-[WKRemoteObjectEncoder encodeInteger:forKey:]): Instead of creating a new number type UInt32, use encodeInt64 for
577             encoding NSInteger.
578         (-[WKRemoteObjectDecoder decodeIntegerForKey:]):
579
580 2014-06-30  Anders Carlsson  <andersca@apple.com>
581
582         Use an std::function for filtering session state data
583         https://bugs.webkit.org/show_bug.cgi?id=134481
584
585         Reviewed by Sam Weinig.
586
587         * UIProcess/API/C/WKPage.cpp:
588         (WKPageCopySessionState):
589         * UIProcess/API/Cocoa/WKWebView.mm:
590         (-[WKWebView _sessionState]):
591         * UIProcess/WebBackForwardList.h:
592         * UIProcess/WebPageProxy.cpp:
593         (WebKit::WebPageProxy::sessionStateData):
594         * UIProcess/WebPageProxy.h:
595         * UIProcess/cf/WebBackForwardListCF.cpp:
596         (WebKit::WebBackForwardList::createCFDictionaryRepresentation):
597         * UIProcess/cf/WebPageProxyCF.cpp:
598         (WebKit::WebPageProxy::sessionStateData):
599
600 2014-07-01  Rohit Kumar  <kumar.rohit@samsung.com>
601
602         Clean up the WebKit build from unused parameter warning in Webkit2/UIProcess module
603         https://bugs.webkit.org/show_bug.cgi?id=134294
604
605         Reviewed by Darin Adler.
606
607         * UIProcess/API/APIUIClient.h:
608         (API::UIClient::reachedApplicationCacheOriginQuota):
609
610 2014-07-01  Brady Eidson  <beidson@apple.com>
611
612         Followup for: Combine the Telephone and Selection overlay controllers, updating UI behavior.
613         https://bugs.webkit.org/show_bug.cgi?id=134461
614
615         Rubberstamped by Tim Horton.
616
617         * WebProcess/WebPage/mac/ServicesOverlayController.mm: Include the correct constant.
618
619 2014-07-01  Brady Eidson  <beidson@apple.com>
620
621         Build fix.
622
623         Forgot to commit locally before pushing.
624
625         * WebProcess/WebPage/WebPage.cpp:
626         (WebKit::WebPage::servicesOverlayController): s/this/*this/
627
628 2014-07-01  Brady Eidson  <beidson@apple.com>
629
630         Combine the Telephone and Selection overlay controllers, updating UI behavior.
631         https://bugs.webkit.org/show_bug.cgi?id=134461
632
633         Reviewed by Tim Horton.
634
635         * WebKit2.xcodeproj/project.pbxproj:
636
637         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
638         (WebKit::WebEditorClient::selectedTelephoneNumberRangesChanged):
639         (WebKit::WebEditorClient::selectionRectsDidChange):
640
641         Remove the separate Selection overlay controller:
642         * WebProcess/WebPage/SelectionOverlayController.cpp: Removed.
643         * WebProcess/WebPage/ServicesOverlayController.h: Renamed from Source/WebKit2/WebProcess/WebPage/SelectionOverlayController.h.
644         (WebKit::ServicesOverlayController::create):
645         * WebProcess/WebPage/mac/SelectionOverlayControllerMac.mm: Removed.
646
647         Remove the separate TelephoneNumber overlay controller:
648         * WebProcess/WebPage/TelephoneNumberOverlayController.cpp: Removed.
649         * WebProcess/WebPage/TelephoneNumberOverlayController.h: Removed.
650         * WebProcess/WebPage/mac/TelephoneNumberOverlayControllerMac.mm: Removed.
651
652         * WebProcess/WebPage/WebPage.cpp:
653         (WebKit::WebPage::servicesOverlayController):
654         (WebKit::WebPage::telephoneNumberOverlayController): Deleted.
655         (WebKit::WebPage::selectionOverlayController): Deleted.
656         (WebKit::WebPage::didChangeScrollOffsetForFrame): Deleted.
657         * WebProcess/WebPage/WebPage.h:
658         (WebKit::WebPage::serviceControlsEnabled): Deleted.
659
660         ServicesOverlayController is a combination of the old TelephoneNumber and Selection overlay controllers.
661         A lot of code duplication is resolved, and things are generally easier to follow.
662         It enforces displaying a telephone number highlight if precisely one telephone number is selected, or
663         the selection highlight if the selection contains more than a single phone number
664         * WebProcess/WebPage/mac/ServicesOverlayController.mm: Added.
665         (WebKit::textQuadsToBoundingRectForRange):
666         (WebKit::ServicesOverlayController::ServicesOverlayController):
667         (WebKit::ServicesOverlayController::destroyOverlay):
668         (WebKit::ServicesOverlayController::pageOverlayDestroyed):
669         (WebKit::ServicesOverlayController::willMoveToWebPage):
670         (WebKit::ServicesOverlayController::didMoveToWebPage):
671         (WebKit::ServicesOverlayController::createOverlayIfNeeded):
672         (WebKit::ServicesOverlayController::selectionRectsDidChange):
673         (WebKit::ServicesOverlayController::selectedTelephoneNumberRangesChanged):
674         (WebKit::ServicesOverlayController::clearHighlightState):
675         (WebKit::ServicesOverlayController::drawRect):
676         (WebKit::ServicesOverlayController::drawSelectionHighlight):
677         (WebKit::ServicesOverlayController::drawTelephoneNumberHighlight):
678         (WebKit::ServicesOverlayController::drawCurrentHighlight):
679         (WebKit::ServicesOverlayController::mouseEvent):
680         (WebKit::ServicesOverlayController::handleClick):
681
682 2014-07-01  Zan Dobersek  <zdobersek@igalia.com>
683
684         [WK2] IPC messages' arguments() method returns const std::tuple<> copies
685         https://bugs.webkit.org/show_bug.cgi?id=131975
686
687         Reviewed by Darin Adler.
688
689         The arguments() method of the different IPC message objects should return a const reference
690         to the std::tuple<> containing the arguments, instead of a const value. This avoids copying
691         the std::tuple<> every time the arguments are encoded, and works best with the
692         ArgumentEncoder::encode<std::tuple<...>>(const std::tuple<...>&) template instantiation.
693
694         The unit test baselines are updated accordingly.
695
696         * Scripts/webkit2/LegacyMessages-expected.h:
697         (Messages::WebPage::LoadURL::arguments):
698         (Messages::WebPage::LoadSomething::arguments):
699         (Messages::WebPage::TouchEvent::arguments):
700         (Messages::WebPage::AddEvent::arguments):
701         (Messages::WebPage::LoadSomethingElse::arguments):
702         (Messages::WebPage::DidReceivePolicyDecision::arguments):
703         (Messages::WebPage::Close::arguments):
704         (Messages::WebPage::PreferencesDidChange::arguments):
705         (Messages::WebPage::SendDoubleAndFloat::arguments):
706         (Messages::WebPage::SendInts::arguments):
707         (Messages::WebPage::CreatePlugin::arguments):
708         (Messages::WebPage::RunJavaScriptAlert::arguments):
709         (Messages::WebPage::GetPlugins::arguments):
710         (Messages::WebPage::GetPluginProcessConnection::arguments):
711         (Messages::WebPage::TestMultipleAttributes::arguments):
712         (Messages::WebPage::TestParameterAttributes::arguments):
713         (Messages::WebPage::TemplateTest::arguments):
714         (Messages::WebPage::SetVideoLayerID::arguments):
715         (Messages::WebPage::DidCreateWebProcessConnection::arguments):
716         (Messages::WebPage::InterpretKeyEvent::arguments):
717         (Messages::WebPage::DeprecatedOperation::arguments):
718         (Messages::WebPage::ExperimentalOperation::arguments):
719         * Scripts/webkit2/Messages-expected.h:
720         (Messages::WebPage::LoadURL::arguments):
721         (Messages::WebPage::LoadSomething::arguments):
722         (Messages::WebPage::TouchEvent::arguments):
723         (Messages::WebPage::AddEvent::arguments):
724         (Messages::WebPage::LoadSomethingElse::arguments):
725         (Messages::WebPage::DidReceivePolicyDecision::arguments):
726         (Messages::WebPage::Close::arguments):
727         (Messages::WebPage::PreferencesDidChange::arguments):
728         (Messages::WebPage::SendDoubleAndFloat::arguments):
729         (Messages::WebPage::SendInts::arguments):
730         (Messages::WebPage::CreatePlugin::arguments):
731         (Messages::WebPage::RunJavaScriptAlert::arguments):
732         (Messages::WebPage::GetPlugins::arguments):
733         (Messages::WebPage::GetPluginProcessConnection::arguments):
734         (Messages::WebPage::TestMultipleAttributes::arguments):
735         (Messages::WebPage::TestParameterAttributes::arguments):
736         (Messages::WebPage::TemplateTest::arguments):
737         (Messages::WebPage::SetVideoLayerID::arguments):
738         (Messages::WebPage::DidCreateWebProcessConnection::arguments):
739         (Messages::WebPage::InterpretKeyEvent::arguments):
740         (Messages::WebPage::DeprecatedOperation::arguments):
741         (Messages::WebPage::ExperimentalOperation::arguments):
742         * Scripts/webkit2/MessagesSuperclass-expected.h:
743         (Messages::WebPage::LoadURL::arguments):
744         * Scripts/webkit2/messages.py:
745         (message_to_struct_declaration):
746
747 2014-07-01  Evan Nemerson  <evan@nemerson.com>
748
749         [GTK] Annotations for WebResource.get_data produce wrong signature in Vala binding
750         https://bugs.webkit.org/show_bug.cgi?id=134476
751
752         Reviewed by Carlos Garcia Campos.
753
754         * UIProcess/API/gtk/WebKitWebResource.cpp: Add array length and
755         element-type annotations to return value of webkit_web_resource_get_data_finish().
756
757 2014-07-01  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
758
759         [WK2] Can not convert ‘sessionState.WebKit::SessionState::provisionalURL’ from ‘WebCore::URL’ to ‘bool’
760         https://bugs.webkit.org/show_bug.cgi?id=134487
761
762         Rubber-stamped by Carlos Garcia Campos.
763
764         * UIProcess/WebPageProxy.cpp: Use isNull().
765         (WebKit::WebPageProxy::restoreFromState):
766
767 2014-07-01  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
768
769         Fix build break on EFL and GTK ports since r170611 and r170614
770         https://bugs.webkit.org/show_bug.cgi?id=134479
771
772         Reviewed by Carlos Garcia Campos.
773
774         Add LegacySessionStateCodingNone.cpp in order to fix build break on EFL and GTK ports. Additionally
775         SessionStateConversion.cpp is added to CMakeLists.txt as well.
776
777         * CMakeLists.txt:
778         * UIProcess/LegacySessionStateCoding.h: Copied from Source/WebKit2/UIProcess/mac/LegacySessionStateCoding.h.
779         * UIProcess/LegacySessionStateCodingNone.cpp: Renamed from Source/WebKit2/UIProcess/mac/LegacySessionStateCoding.h.
780         (WebKit::encodeLegacySessionHistoryEntryData):
781         (WebKit::decodeLegacySessionState):
782         (WebKit::decodeLegacySessionHistoryEntryData):
783         * UIProcess/WebPageProxy.cpp:
784         (WebKit::WebPageProxy::loadFile):
785         (WebKit::WebPageProxy::restoreFromState):
786         * WebKit2.xcodeproj/project.pbxproj:
787
788 2014-06-30  Benjamin Poulain  <benjamin@webkit.org>
789
790         [iOS][WK2] The long press gesture recognizers should not block the pinch gesture
791         https://bugs.webkit.org/show_bug.cgi?id=134477
792         <rdar://problem/17514936>
793
794         Reviewed by Tim Horton.
795
796         * UIProcess/ios/WKContentViewInteraction.mm:
797         (-[WKContentView gestureRecognizer:canPreventGestureRecognizer:]):
798
799 2014-06-30  Anders Carlsson  <andersca@apple.com>
800
801         Add WebPageProxy::restoreFromState
802         https://bugs.webkit.org/show_bug.cgi?id=134480
803
804         Reviewed by Tim Horton.
805
806         * UIProcess/WebPageProxy.cpp:
807         (WebKit::WebPageProxy::restoreFromState):
808         * UIProcess/WebPageProxy.h:
809
810 2014-06-30  Anders Carlsson  <andersca@apple.com>
811
812         Add a function to restore a WebBackForwardList object from a BackForwardListState object
813         https://bugs.webkit.org/show_bug.cgi?id=134478
814
815         Reviewed by Tim Horton.
816
817         * UIProcess/WebBackForwardList.cpp:
818         (WebKit::generateWebBackForwardItemID):
819         (WebKit::WebBackForwardList::restoreFromState):
820         * UIProcess/WebBackForwardList.h:
821         * UIProcess/cf/WebBackForwardListCF.cpp:
822         (WebKit::generateWebBackForwardItemID): Deleted.
823
824 2014-06-30  Anders Carlsson  <andersca@apple.com>
825
826         Change the AddBackForwardItem message to take a page state object
827         https://bugs.webkit.org/show_bug.cgi?id=134475
828
829         Reviewed by Andreas Kling.
830
831         * Scripts/webkit2/messages.py:
832         (struct_or_class):
833         (headers_for_type):
834         * Shared/WebBackForwardListItem.cpp:
835         (WebKit::WebBackForwardListItem::create):
836         (WebKit::WebBackForwardListItem::WebBackForwardListItem):
837         * Shared/WebBackForwardListItem.h:
838         (WebKit::WebBackForwardListItem::setPageState):
839         * UIProcess/WebProcessProxy.cpp:
840         (WebKit::WebProcessProxy::addBackForwardItem):
841         * UIProcess/WebProcessProxy.h:
842         * UIProcess/WebProcessProxy.messages.in:
843         * WebProcess/WebPage/WebBackForwardListProxy.cpp:
844         (WebKit::updateBackForwardItem):
845
846 2014-06-30  Tim Horton  <timothy_horton@apple.com>
847
848         [WK2] Add a flatter find-in-page current match indicator style
849         https://bugs.webkit.org/show_bug.cgi?id=134434
850         <rdar://problem/16225673>
851
852         Reviewed by Simon Fraser.
853
854         * UIProcess/FindIndicator.cpp:
855         (WebKit::findIndicatorsForTextRectsOverlap):
856         (WebKit::FindIndicator::frameRect):
857         (WebKit::flatHighlightColor):
858         (WebKit::flatRimShadowColor):
859         (WebKit::flatDropShadowColor):
860         (WebKit::FindIndicator::draw):
861         Add a flatter find indicator, with a bigger shadow.
862
863         * WebProcess/WebPage/FindController.cpp:
864         (WebKit::FindController::updateFindUIAfterPageScroll):
865         (WebKit::FindController::getFindIndicatorBitmapAndRect):
866         (WebKit::FindController::hideFindIndicator):
867         (WebKit::FindController::drawRect):
868         Don't paint a shadow behind the secondary matches if we're using the new style.
869
870 2014-06-30  Benjamin Poulain  <benjamin@webkit.org>
871
872         [iOS][WK2] Improve double-tap-to-scroll on image documents
873         https://bugs.webkit.org/show_bug.cgi?id=134474
874         <rdar://problem/17496778>
875
876         Reviewed by Enrica Casucci.
877
878         On image document, we were always rendering the center of the image as the origin, which broke
879         double tap to scroll.
880
881         This patch improves on this in two ways:
882         1) If the hit testing already got the image, only change the type to replaced (to get the right
883            scaling behavior for images since the type is block on iOS's image document).
884         2) If the hit testing is outside the image, only center the axis that is not in the image.
885            This way, we "fix" the component that is not valid, and keep the vali component.
886            This works great for viewing comics on iPad.
887
888         * WebProcess/WebPage/ViewGestureGeometryCollector.cpp:
889         (WebKit::ViewGestureGeometryCollector::collectGeometryForSmartMagnificationGesture):
890
891 2014-06-30  Enrica Casucci  <enrica@apple.com>
892
893         REGRESSION (WK2): Weird selection behavior on autos.yahoo.com, en.wikipedia.org.
894         https://bugs.webkit.org/show_bug.cgi?id=134466
895         <rdar://problem/16817263>
896
897         Reviewed by Benjamin Poulain.
898
899         Avoid selecting blocks across frame boundaries and skip non-selectable
900         blocks. If the only block we find is almost the same height as the
901         visible area, we should not select at all.
902         This patch also fixes the logic to compute the next block when
903         shrinking the selection. When calculating the new range after shrinking,
904         we should not include the block that corresponds to the current handle position.
905
906         * WebProcess/WebPage/ios/WebPageIOS.mm:
907         (WebKit::WebPage::rangeForWebSelectionAtPosition):
908         (WebKit::WebPage::expandedRangeFromHandle):
909         (WebKit::WebPage::contractedRangeFromHandle):
910         (WebKit::WebPage::updateSelectionWithTouches):
911
912 2014-06-30  Anders Carlsson  <andersca@apple.com>
913
914         WebBackForwardListItem should not store back-forward data
915         https://bugs.webkit.org/show_bug.cgi?id=134469
916
917         Reviewed by Darin Adler.
918
919         Change WebBackForwardListItem::backForwardData to encode the main frame state lazily,
920         and change WebBackForwardListItem::setBackForwardData to decode it into the main frame state.
921
922         * Shared/WebBackForwardListItem.cpp:
923         (WebKit::WebBackForwardListItem::backForwardData):
924         (WebKit::WebBackForwardListItem::setBackForwardData):
925         (WebKit::WebBackForwardListItem::encode):
926         * Shared/WebBackForwardListItem.h:
927         (WebKit::WebBackForwardListItem::backForwardData): Deleted.
928         * UIProcess/cf/WebBackForwardListCF.cpp:
929         (WebKit::WebBackForwardList::createCFDictionaryRepresentation):
930         * WebProcess/WebPage/WebPage.cpp:
931         (WebKit::WebPage::restoreSession):
932
933 2014-06-30  Anders Carlsson  <andersca@apple.com>
934
935         WebBackForwardListItems should hold on to PageState objects
936         https://bugs.webkit.org/show_bug.cgi?id=134467
937
938         Reviewed by Darin Adler.
939
940         * Shared/WebBackForwardListItem.cpp:
941         (WebKit::WebBackForwardListItem::WebBackForwardListItem):
942         (WebKit::WebBackForwardListItem::encode):
943         * Shared/WebBackForwardListItem.h:
944         (WebKit::WebBackForwardListItem::setOriginalURL):
945         (WebKit::WebBackForwardListItem::originalURL):
946         (WebKit::WebBackForwardListItem::setURL):
947         (WebKit::WebBackForwardListItem::url):
948         (WebKit::WebBackForwardListItem::setTitle):
949         (WebKit::WebBackForwardListItem::title):
950
951 2014-06-30  Benjamin Poulain  <benjamin@webkit.org>
952
953         Add a missing semicolon in WKContentViewInteraction
954
955         * UIProcess/ios/WKContentViewInteraction.mm:
956         (nsSizeForTapHighlightBorderRadius):
957         I messed up this when fixing the patch on landing.
958
959 2014-06-30  Anders Carlsson  <andersca@apple.com>
960
961         Adopt the legacy session decoding inside WebPage::restoreSession for now
962         https://bugs.webkit.org/show_bug.cgi?id=134465
963
964         Reviewed by Sam Weinig.
965
966         * UIProcess/mac/LegacySessionStateCoding.cpp:
967         (WebKit::decodeLegacySessionHistoryEntryData):
968         * UIProcess/mac/LegacySessionStateCoding.h:
969         * WebProcess/WebPage/WebPage.cpp:
970         (WebKit::WebPage::restoreSession):
971
972 2014-06-30  Simon Fraser  <simon.fraser@apple.com>
973
974         [iOS WK2] Don't crash on status bar tap with overflow scroll views
975         https://bugs.webkit.org/show_bug.cgi?id=134459
976
977         Reviewed by Tim Horton.
978         
979         The tiled scrolling indicator parents UIViews under CALayers, but that causes
980         those views to miss -willMoveToWindow:nil notifications on teardown. This can leave
981         deleted UIScrollViews in UIKit's "scroll to top" list.
982         
983         Fix by not making UIScrollViews in the debug layer tree host.
984
985         * UIProcess/ios/RemoteLayerTreeHostIOS.mm:
986         (WebKit::RemoteLayerTreeHost::createLayer):
987
988 2014-06-28  Oliver Hunt  <oliver@apple.com>
989
990        Restrict network process sandbox
991        https://bugs.webkit.org/show_bug.cgi?id=134360
992
993        Reviewed by Sam Weinig.
994
995        Add more restrictions to the network process sandbox.
996
997        * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
998        (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
999          Always use the cache directory provided in the initialization parameters,
1000          and make sure we consume the cookie directory extension.
1001        * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb:
1002          Make the sandbox profile much more restrictive.
1003        * Shared/Network/NetworkProcessCreationParameters.cpp:
1004        (WebKit::NetworkProcessCreationParameters::encode):
1005        (WebKit::NetworkProcessCreationParameters::decode):
1006        * Shared/Network/NetworkProcessCreationParameters.h:
1007          The network process now requires an extension to access
1008          its cookie storage.
1009        * Shared/mac/SandboxUtilities.cpp:
1010        (WebKit::pathForProcessContainer):
1011        * Shared/mac/SandboxUtilities.h:
1012          We need to be able to get hold of our container so
1013          that we can get the correct cookie storage directory.
1014        * UIProcess/WebContext.cpp:
1015        (WebKit::WebContext::ensureNetworkProcess):
1016          We have to pass in the an extension for the cookie storage directory when
1017        initalising the network process
1018        * UIProcess/mac/WebContextMac.mm:
1019        (WebKit::WebContext::platformDefaultCookieStorageDirectory):
1020          Make sure we provide the correct location on IOS
1021        * WebProcess/cocoa/WebProcessCocoa.mm:
1022        (WebKit::WebProcess::platformInitializeWebProcess):
1023          Consume the cookie storage extension
1024
1025 2014-06-30  Simon Fraser  <simon.fraser@apple.com>
1026
1027         [iOS WK2] Turn off scrollsToTop on overflow UIScrollViews
1028         https://bugs.webkit.org/show_bug.cgi?id=134456
1029
1030         Reviewed by Tim Horton.
1031         
1032         Set scrollsToTop to NO on our UIScrollViews created for overflow scrolling, since
1033         we don't have a good strategy for when to allow it, and doing so would also require
1034         some smarts in the main UIScrollView.
1035
1036         * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:
1037         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::updateAfterChildren):
1038
1039 2014-06-30  Enrica Casucci  <enrica@apple.com>
1040
1041         REGRESSION (Okemo): The contextual menu on tap and hold does not cancel the other gestures.
1042         https://bugs.webkit.org/show_bug.cgi?id=134463
1043         <rdar://problem/17388907>
1044
1045         Reviewed by Benjamin Poulain.
1046
1047         * UIProcess/ios/WKContentViewInteraction.mm:
1048         (-[WKContentView _longPressRecognized:]):
1049
1050 2014-06-30  Anders Carlsson  <andersca@apple.com>
1051
1052         Implement the last pieces of encodeFrameStateNode
1053         https://bugs.webkit.org/show_bug.cgi?id=134460
1054
1055         Reviewed by Andreas Kling.
1056
1057         * UIProcess/mac/LegacySessionStateCoding.cpp:
1058         (WebKit::HistoryEntryDataEncoder::operator<<):
1059         (WebKit::isValidEnum):
1060         (WebKit::encodeFormDataElement):
1061         (WebKit::encodeFormData):
1062         (WebKit::encodeFrameStateNode):
1063
1064 2014-06-30  Benjamin Poulain  <bpoulain@apple.com>
1065
1066         [iOS][WK2] Move tap highlight to the inverseScaleRootView
1067         https://bugs.webkit.org/show_bug.cgi?id=134424
1068         <rdar://problem/17480880>
1069
1070         Reviewed by Tim Horton.
1071
1072         Enrica introduced the inverseScaleRootView that is a dynamic version of _highlightRootView.
1073
1074         This patch moves the tap highlight from its own inverse root to inverseScaleRootView. This provides better handling
1075         of scale, better behavior on crash, and remove one extra view from the hierarchy.
1076
1077         The code is pretty much the same, just moved around. Some of the changes:
1078
1079         Now the code needs to handle repainting live when the view scale. To do that, _showTapHighlightXXX was split in two:
1080         -_showTapHighlight to setup the view.
1081         -_updateTapHighlight to update the view based on the current scale.
1082
1083         Since the view updates live on scaling, we need to recompute the coordinates for each update. To do that, the _potentialTapHighlightInformation
1084         was generalized to handle all cases of highlight.
1085
1086         Since we can no longer test for the nullity of _potentialTapHighlightInformation,
1087         a new attribute is introduced for that: _hasTapHighlightForPotentialTap.
1088
1089         The last bit of change concern reentering the tap highlight. This becomes quite simple:
1090         1) _isTapHighlightIDValid is updated before the animation starts
1091            so that it can be set again during an animation.
1092         2) The animation checks the "finished" flags before removing the view from its superview
1093            to avoid breaking the new animation.
1094
1095         * UIProcess/API/Cocoa/WKWebView.mm:
1096         (withinEpsilon): Deleted.
1097         * UIProcess/ios/WKContentView.mm:
1098         (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:]):
1099         Make _updateUnscaledView conditional to scale changes, that thing isn't cheap!
1100
1101         * UIProcess/ios/WKContentViewInteraction.h:
1102         (withinEpsilon):
1103         Move withinEpsilon() from WKContentView to use it from both classes.
1104
1105         * UIProcess/ios/WKContentViewInteraction.mm:
1106         (-[WKContentView cleanupInteraction]):
1107         (-[WKContentView _updateUnscaledView]):
1108         (-[WKContentView _updateTapHighlight]):
1109         (-[WKContentView _showTapHighlight]):
1110         (-[WKContentView _didGetTapHighlightForRequest:color:quads:topLeftRadius:topRightRadius:bottomLeftRadius:bottomRightRadius:]):
1111         (-[WKContentView _cancelInteraction]):
1112         (-[WKContentView _finishInteraction]):
1113         (-[WKContentView _singleTapDidReset:]):
1114         (-[WKContentView _singleTapCommited:]):
1115         (-[WKContentView _showTapHighlightWithColor:quads:topLeftRadius:topRightRadius:bottomLeftRadius:bottomRightRadius:]): Deleted.
1116
1117 2014-06-30  Anders Carlsson  <andersca@apple.com>
1118
1119         Add code for encoding legacy session history entries
1120         https://bugs.webkit.org/show_bug.cgi?id=134452
1121
1122         Reviewed by Andreas Kling.
1123
1124         * UIProcess/mac/LegacySessionStateCoding.cpp:
1125         (WebKit::HistoryEntryDataEncoder::HistoryEntryDataEncoder):
1126         (WebKit::HistoryEntryDataEncoder::operator<<):
1127         (WebKit::HistoryEntryDataEncoder::finishEncoding):
1128         (WebKit::HistoryEntryDataEncoder::encodeArithmeticType):
1129         (WebKit::HistoryEntryDataEncoder::encodeFixedLengthData):
1130         (WebKit::HistoryEntryDataEncoder::grow):
1131         (WebKit::HistoryEntryDataEncoder::growCapacity):
1132         (WebKit::encodeFrameStateNode):
1133         (WebKit::encodeLegacySessionHistoryEntryData):
1134         (WebKit::decodeSessionHistoryEntryData):
1135         (WebKit::decodeLegacySessionHistoryEntryData):
1136         * UIProcess/mac/LegacySessionStateCoding.h:
1137
1138 2014-06-29  Yoav Weiss  <yoav@yoav.ws>
1139
1140         Add support for HTMLImageElement's sizes attribute
1141         https://bugs.webkit.org/show_bug.cgi?id=133620
1142
1143         Reviewed by Dean Jackson.
1144
1145         Added an ENABLE_PICTURE_SIZES compile flag.
1146
1147         * Configurations/FeatureDefines.xcconfig:
1148
1149 2014-06-28  Tim Horton  <timothy_horton@apple.com>
1150
1151         [iOS][WK2] PDFs never load inline again after the Web process crashes
1152         https://bugs.webkit.org/show_bug.cgi?id=134432
1153         <rdar://problem/17484205>
1154
1155         Reviewed by Dan Bernstein.
1156
1157         After a crash, the WebPage never gets mimeTypesWithCustomContentProviders filled back in.
1158
1159         * Shared/WebPageCreationParameters.cpp:
1160         (WebKit::WebPageCreationParameters::encode):
1161         (WebKit::WebPageCreationParameters::decode):
1162         * Shared/WebPageCreationParameters.h:
1163         * UIProcess/WebPageProxy.cpp:
1164         (WebKit::WebPageProxy::creationParameters):
1165         * WebProcess/WebPage/WebPage.cpp:
1166         (WebKit::WebPage::WebPage):
1167         Add mimeTypesWithCustomContentProviders to WebPageCreationParameters.
1168
1169         * UIProcess/Cocoa/WKWebViewContentProviderRegistry.h:
1170         * UIProcess/Cocoa/WKWebViewContentProviderRegistry.mm:
1171         (-[WKWebViewContentProviderRegistry addPage:]):
1172         We don't need to send the MIME types across when a page is added, because it already got them in its creation parameters.
1173
1174         (-[WKWebViewContentProviderRegistry removePage:]):
1175         (-[WKWebViewContentProviderRegistry _mimeTypesWithCustomContentProviders]):
1176         Return a vector of all registered MIME types.
1177
1178         * UIProcess/ios/PageClientImplIOS.h:
1179         * UIProcess/ios/PageClientImplIOS.mm:
1180         (WebKit::PageClientImpl::mimeTypesWithCustomContentProviders):
1181         * UIProcess/PageClient.h:
1182         Add (iOS only for now) mimeTypesWithCustomContentProviders to PageClient.
1183
1184 2014-06-28  Dan Bernstein  <mitz@apple.com>
1185
1186         REGRESSION: WebPageProxy::attributedSubstringForCharacterRangeAsync never calls its callback function
1187         https://bugs.webkit.org/show_bug.cgi?id=134429
1188
1189         Reviewed by Tim Horton.
1190
1191         * UIProcess/mac/WebPageProxyMac.mm:
1192         (WebKit::WebPageProxy::attributedSubstringForCharacterRangeAsync):
1193
1194 2014-06-27  Simon Fraser  <simon.fraser@apple.com>
1195
1196         [iOS WK2] position:fixed inside accelerated overflow:scroll is jumpy
1197         https://bugs.webkit.org/show_bug.cgi?id=134426
1198         <rdar://problem/17474523>
1199
1200         Reviewed by Tim Horton.
1201
1202         After committing a new layer tree (with possibly stale position:fixed layer
1203         positions), we need the scrolling tree to update those positions based on
1204         the current scroll offset.
1205         
1206         To achieve that, implement ScrollingTreeOverflowScrollingNodeIOS::updateLayersAfterAncestorChange()
1207         and have it add to the cumulative delta the difference between the last committed scroll
1208         position and the current scroll position.
1209         
1210         Also make sure that ScrollingTreeOverflowScrollingNodeIOS doesn't call back to scrollViewDidScroll()
1211         when we're updating its scroll position inside a scrolling tree commit.
1212
1213         * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.h:
1214         * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:
1215         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::ScrollingTreeOverflowScrollingNodeIOS):
1216         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::updateAfterChildren):
1217         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::updateLayersAfterAncestorChange):
1218         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::scrollViewDidScroll):
1219
1220 2014-06-27  Antti Koivisto  <antti@apple.com>
1221
1222         Flush throttling with remote layers
1223         https://bugs.webkit.org/show_bug.cgi?id=134398
1224
1225         Reviewed by Darin Adler.
1226
1227         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1228         (WebKit::WebChromeClient::adjustLayerFlushThrottling):
1229         * WebProcess/WebCoreSupport/WebChromeClient.h:
1230         * WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm:
1231         * WebProcess/WebPage/DrawingArea.h:
1232         (WebKit::DrawingArea::adjustLayerFlushThrottling):
1233         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
1234         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
1235         (WebKit::RemoteLayerTreeDrawingArea::RemoteLayerTreeDrawingArea):
1236         (WebKit::RemoteLayerTreeDrawingArea::updateScrolledExposedRect):
1237         (WebKit::RemoteLayerTreeDrawingArea::scheduleCompositingLayerFlush):
1238
1239             Delay layer flushes during page loading.
1240             If use interacts with the page the next flush in unthrottled even if loading is in progress.
1241
1242         (WebKit::RemoteLayerTreeDrawingArea::adjustLayerFlushThrottling):
1243         
1244             Compute the new delay. The first visual flush uses a shorter delay.
1245             Flush immediately when we are no longer throttling.
1246
1247         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
1248         (WebKit::TiledCoreAnimationDrawingArea::updateScrolledExposedRect):
1249
1250 2014-06-27  Joseph Pecoraro  <pecoraro@apple.com>
1251
1252         [iOS][WK2] <select> tapping "next" does not save new picker value
1253         https://bugs.webkit.org/show_bug.cgi?id=134409
1254
1255         Reviewed by Enrica Casucci.
1256
1257         * UIProcess/ios/WKContentViewInteraction.mm:
1258         (-[WKContentView accessoryTab:]):
1259         We know the assisted node will change, so call endEditing
1260         before the assisted node changes in the WebProcess.
1261
1262         (-[WKContentView _stopAssistingNode]):
1263         Ensure we call endEditing to trigger controlEndEditing.
1264
1265         * UIProcess/ios/forms/WKFormSelectPicker.mm:
1266         (-[WKMultipleSelectPicker initWithView:]):
1267         (-[WKMultipleSelectPicker pickerView:row:column:checked:]):
1268         (-[WKSelectSinglePicker dealloc]):
1269         Style fixes.
1270
1271 2014-06-27  Peyton Randolph  <prandolph@apple.com>
1272
1273          Add feature flag for link long-press gesture.                                                                   
1274          https://bugs.webkit.org/show_bug.cgi?id=134262                                                                  
1275                                                                                                                          
1276          Reviewed by Enrica Casucci.                                                                                     
1277                                                                                                                          
1278          * Configurations/FeatureDefines.xcconfig:                                                                       
1279          Add ENABLE_LINK_LONG_PRESS. 
1280
1281 2014-06-26  Simon Fraser  <simon.fraser@apple.com>
1282
1283         [iOS WK2] Fix touch-scrollable elements with overflow:scroll on just one axis, and RTL scrolling
1284         https://bugs.webkit.org/show_bug.cgi?id=134377
1285         <rdar://problem/16762224>
1286
1287         Reviewed by Tim Horton.
1288
1289         Make -webkit-overflow-scrolling:touch scrolling work correctly when one axis
1290         has overflow:scroll and the other overflow:hidden. Also fix scrolling in RTL
1291         contexts.
1292         
1293         An RTL scroller with overflow-x:hidden will have a non-zero scroll origin,
1294         and needs to truncate the scrolled content on the left side. To pass the
1295         correct geometry to the UI process, we need to introduce the concept of
1296         "reachable" size as well as total content size; normally these are the same,
1297         but will differ when scrolling is only allowed on one axis but there is overflow
1298         on both axes.
1299         
1300         ScrollingTreeOverflowScrollingNodeIOS::updateAfterChildren() uses the total and
1301         reachable content sizes to set a negative edge inset on the left (for RTL) or top
1302         (for bottom-to-top) so prevent scrolling into these areas.
1303
1304         * Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp:
1305         (ArgumentCoder<ScrollingStateScrollingNode>::encode):
1306         (ArgumentCoder<ScrollingStateScrollingNode>::decode):
1307         (WebKit::RemoteScrollingTreeTextStream::dump):
1308         * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:
1309         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::updateAfterChildren): 
1310
1311 2014-06-27  Joseph Pecoraro  <pecoraro@apple.com>
1312
1313         Fix various leaks, RetainPtrs should adopt allocs
1314         https://bugs.webkit.org/show_bug.cgi?id=134308
1315
1316         Reviewed by Alexey Proskuryakov.
1317
1318         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
1319         (-[WKWebProcessPlugInBrowserContextController _remoteObjectRegistry]):
1320
1321 2014-06-27  Dan Bernstein  <mitz@apple.com>
1322
1323         Remove unused definitions that were mistakenly added back in r170323 and then again in r170329
1324         https://bugs.webkit.org/show_bug.cgi?id=134397
1325
1326         Reviewed by Geoff Garen.
1327
1328         * UIProcess/API/Cocoa/WKBackForwardList.mm:
1329
1330 2014-06-26  Daniel Bates  <dabates@apple.com>
1331
1332         [iOS][WK2] Distant focusable element may not be scrolled into view when focused using keyboard
1333         https://bugs.webkit.org/show_bug.cgi?id=134309
1334         <rdar://problem/17427385>
1335
1336         Reviewed by Darin Adler.
1337
1338         Fixes an issue where the focusable element may not be scrolled into view when it's focused by
1339         using the keyboard accessory (i.e. the < and > buttons). In particular, we don't scroll a
1340         keyboard focused text field into view when it's positioned significantly outside the visible region.
1341
1342         * UIProcess/ios/WKContentViewInteraction.h: Added an instance variable called _didAccessoryTabInitiateFocus
1343         to track whether an accessory tab initiated the focus of the focusable element.
1344         * UIProcess/ios/WKContentViewInteraction.mm:
1345         (-[WKContentView cleanupInteraction]): Clear _didAccessoryTabInitiateFocus so that we're in a good state
1346         should the WebProcess crash between the time the UIProcess receives the accessory tab request and the
1347         WebProcess calls back to the UIProcess to zoom/scroll to the newly focused element.
1348         (-[WKContentView _displayFormNodeInputView]): Modified to pass an empty rectangle for the selection
1349         rectangle to -_zoomToFocusRect to avoid constraining the scroll to the newly focused element when it
1350         was focused using the keyboard accessory tab buttons
1351         (-[WKContentView accessoryTab:]): Modified to set _didAccessoryTabInitiateFocus to YES. We'll set
1352         this boolean to NO in -_displayFormNodeInputView.
1353
1354 2014-06-26  Timothy Horton  <timothy_horton@apple.com>
1355
1356         [iOS][WK2] Implement WKPDFView smart magnification
1357         https://bugs.webkit.org/show_bug.cgi?id=134269
1358         <rdar://problem/17272825>
1359
1360         Reviewed by Dan Bernstein.
1361
1362         * UIProcess/API/Cocoa/WKWebView.mm:
1363         (-[WKWebView _currentContentView]):
1364         (contentZoomScale):
1365         Factor _currentContentView out of contentZoomScale.
1366
1367         (-[WKWebView _zoomToRect:WebCore::atScale:origin:WebCore::]):
1368         (-[WKWebView _scrollToRect:WebCore::origin:WebCore::minimumScrollDistance:]):
1369         (-[WKWebView _contentRectForUserInteraction]):
1370         Use it in a bunch more places so we query the right view when zooming/scrolling for smart magnification.
1371
1372         * UIProcess/ios/WKPDFView.h:
1373         * UIProcess/ios/WKPDFView.mm:
1374         (-[WKPDFView scrollViewDidScroll:]):
1375         (-[WKPDFView _revalidateViews]):
1376         (-[WKPDFView zoom:to:atPoint:kind:]):
1377         (-[WKPDFView resetZoom:]):
1378         Implement zoom:to:atPoint:kind: and resetZoom: UIPDFPageViewDelegate methods.
1379         Convert the rects/points and forward them on to the WKWebView to do the zoom.
1380         resetZoom: doesn't provide the gesture origin, so we zoom out using the view center as our origin.
1381         Avoid parenting new UIPDFPageViews while starting a zoom; they'll end up with a bizarre
1382         animation on them and go flying across the screen (even before _isAnimatingZoom is set).
1383
1384 2014-06-26  Tim Horton  <timothy_horton@apple.com>
1385
1386         [WK2] Pinch-zoom shadows can overlap headers and footers
1387         https://bugs.webkit.org/show_bug.cgi?id=134372
1388         <rdar://problem/16004095>
1389
1390         Reviewed by Simon Fraser.
1391
1392         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
1393         (WebKit::shadowLayerPositionForFrame):
1394         (WebKit::shadowLayerBoundsForFrame):
1395         Compute the initial shadow layer and shadow bounds exactly as RenderLayerCompositor does
1396         (in updateRootLayerPosition and friends). Also, clip the shadow layer to the old document rect,
1397         otherwise it can extend over top of the header/footers. The content is automatically clipped to
1398         this rect by the root content layer, but the shadow is outside of that.
1399
1400         (WebKit::TiledCoreAnimationDrawingArea::applyTransientZoomToLayers):
1401         (WebKit::TiledCoreAnimationDrawingArea::commitTransientZoom):
1402         Pass all of the arguments to constrainScrollPositionForOverhang, not just half of them.
1403         There's still a bug where we constrain incorrectly with header/footer layers, but that
1404         will be addressed elsewhere.
1405
1406         (WebKit::TiledCoreAnimationDrawingArea::applyTransientZoomToPage):
1407         Make use of the new helpers.
1408
1409 2014-06-26  Tim Horton  <timothy_horton@apple.com>
1410
1411         Don't leak WKBrowsingContextControllers
1412         https://bugs.webkit.org/show_bug.cgi?id=134368
1413         <rdar://problem/17476582>
1414
1415         Reviewed by Sam Weinig.
1416
1417         * UIProcess/API/mac/WKView.mm:
1418         (-[WKView browsingContextController]):
1419         Adoption is important.
1420
1421 2014-06-26  Alexey Proskuryakov  <ap@apple.com>
1422
1423         REGRESSION: Mountain Lion: Gmail's "in new window" view of mail threads is very slow to load its content
1424         https://bugs.webkit.org/show_bug.cgi?id=133882
1425         <rdar://problem/17271965>
1426
1427         Reviewed by Brady Eidson.
1428
1429         * NetworkProcess/mac/NetworkResourceLoadSchedulerMac.mm:
1430         (WebKit::NetworkResourceLoadScheduler::platformInitializeMaximumHTTPConnectionCountPerHost):
1431         Same fix as in WebCore.
1432
1433 2014-06-26  Brady Eidson  <beidson@apple.com>
1434
1435         Remove use of PlatformStrategies for Gamepad API.
1436         https://bugs.webkit.org/show_bug.cgi?id=134348
1437
1438 https://bugs.webkit.org/show_bug.cgi?id=134348
1439         * NetworkProcess/NetworkProcessPlatformStrategies.cpp:
1440         (WebKit::NetworkProcessPlatformStrategies::createGamepadStrategy): Deleted.
1441         * NetworkProcess/NetworkProcessPlatformStrategies.h:
1442
1443         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
1444         (WebKit::WebPlatformStrategies::createGamepadStrategy): Deleted.
1445         (WebKit::WebPlatformStrategies::startMonitoringGamepads): Deleted.
1446         (WebKit::WebPlatformStrategies::stopMonitoringGamepads): Deleted.
1447         (WebKit::WebPlatformStrategies::platformGamepads): Deleted.
1448         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
1449
1450 2014-06-26  Dan Bernstein  <mitz@apple.com>
1451
1452         [iOS] Add API for opting into character selection granularity
1453         https://bugs.webkit.org/show_bug.cgi?id=134354
1454
1455         Reviewed by Geoff Garen.
1456
1457         * Shared/API/Cocoa/WKFoundation.h: Added a definition of WK_ENUM_AVAILABLE_IOS.
1458         * UIProcess/API/Cocoa/WKWebViewConfiguration.h:
1459         (WKSelectionGranularity): Added this enum with two values, one representing dynamic
1460         granularity( the current, default behavior) and one representing character granularity.
1461         Delcared new selectionGranularity property.
1462         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
1463         (-[WKWebViewConfiguration copyWithZone:]): Copy the _selectionGranularity ivar.
1464
1465         * UIProcess/ios/WKContentViewInteraction.mm:
1466         (toUIWebSelectionMode): Added this helper function for mapping WKSelectionGranularity values
1467         to UIWebSelectionMode values.
1468         (-[WKContentView setupInteraction]): Use a selection assistant with the mode specified in
1469         the configuration.
1470         (-[WKContentView _stopAssistingKeyboard]): Ditto.
1471
1472         * WebProcess/WebPage/ios/WebPageIOS.mm:
1473         (WebKit::WebPage::selectWithGesture): Changed the behavior of the loupe gesture type in
1474         non-editable text to select a word, rather than an empty range, matching the UITextView
1475         behavior.
1476
1477 2014-06-26  Ada Chan  <adachan@apple.com>
1478
1479         Change the target membership of WKBackForwardListPrivate.h from WebKit2 to WebKit.
1480
1481         Rubber-stamped by Dan Bernstein.
1482
1483         * WebKit2.xcodeproj/project.pbxproj:
1484
1485 2014-06-26  Benjamin Poulain  <bpoulain@apple.com>
1486
1487         Remove a useless return in WebPageProxyIOS
1488
1489         * UIProcess/ios/WebPageProxyIOS.mm:
1490         (WebKit::WebPageProxy::updateVisibleContentRects):
1491         Darin caught this mistake in r170460.
1492
1493 2014-06-26  Chris Fleizach  <cfleizach@apple.com>
1494
1495         Add an undo group for each dictated utterance in WebKit
1496         https://bugs.webkit.org/show_bug.cgi?id=134086
1497
1498         Applied review comments from Sam Weinig.
1499
1500         Move the associated USE #define into Platform.h.
1501
1502         * UIProcess/PageClient.h:
1503
1504 2014-06-24  Roger Fong  <roger_fong@apple.com>
1505
1506         Don't allow sudden termination while writing to local storage.
1507         https://bugs.webkit.org/show_bug.cgi?id=134254.
1508         <rdar://problem/15093854>.
1509
1510         Reviewed by Darin Adler.
1511
1512         * UIProcess/Storage/LocalStorageDatabase.cpp:
1513         (WebKit::LocalStorageDatabase::scheduleDatabaseUpdate):
1514         Disable sudden termination when a database update is scheduled.
1515         (WebKit::LocalStorageDatabase::updateDatabase):
1516         Re-enable sudden termination when the update completes.
1517         * UIProcess/Storage/LocalStorageDatabase.h:
1518
1519 2014-06-25  Benjamin Poulain  <bpoulain@apple.com>
1520
1521         [iOS][WK2] Update the long press interactions correctly when an overflow scroll view scrolls
1522         https://bugs.webkit.org/show_bug.cgi?id=134334
1523
1524         Reviewed by Simon Fraser.
1525
1526         * UIProcess/PageClient.h:
1527         * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp:
1528         (WebKit::RemoteScrollingCoordinatorProxy::scrollingTreeNodeDidScroll):
1529         * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.h:
1530         * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:
1531         (-[WKOverflowScrollViewDelegate scrollViewWillBeginDragging:]):
1532         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::overflowScrollViewWillStartPanGesture):
1533         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::scrollViewWillStartPanGesture): Deleted.
1534         * UIProcess/WebPageProxy.h:
1535         * UIProcess/ios/PageClientImplIOS.h:
1536         * UIProcess/ios/PageClientImplIOS.mm:
1537         (WebKit::PageClientImpl::overflowScrollViewWillStartPanGesture):
1538         (WebKit::PageClientImpl::overflowScrollViewDidScroll):
1539         (WebKit::PageClientImpl::scrollViewWillStartPanGesture): Deleted.
1540         * UIProcess/ios/RemoteScrollingCoordinatorProxyIOS.mm:
1541         (WebKit::RemoteScrollingCoordinatorProxy::scrollingTreeNodeWillStartPanGesture):
1542         * UIProcess/ios/WKContentViewInteraction.h:
1543         * UIProcess/ios/WebPageProxyIOS.mm:
1544         (WebKit::WebPageProxy::overflowScrollViewWillStartPanGesture):
1545         (WebKit::WebPageProxy::overflowScrollViewDidScroll):
1546         (WebKit::WebPageProxy::scrollViewWillStartPanGesture): Deleted.
1547
1548 2014-06-25  Simon Fraser  <simon.fraser@apple.com>
1549
1550         [iOS WK2] Page jumps when rubber-banding on azuremagazine.com 
1551         https://bugs.webkit.org/show_bug.cgi?id=134238
1552         <rdar://problem/16918228>
1553
1554         Reviewed by Benjamin Poulain.
1555         
1556         If the scroll view is in the process of rubber-banding when -setContentSize: is called,
1557         it clamps the scroll offsets between zero and the max value, which visibly interrupts the
1558         rubberband. This can easily happen now that we continually send scroll events to the page
1559         on scrolling, especially when pages like azuremagazine.com do fake sticky by toggling
1560         in-flow elements into position:fixed.
1561         
1562         Fix by computing the amount of rubber-band before calling -setContentSize:, and then
1563         restoring the contentOffset with the same amount of rubber-band even when the content size
1564         is different, for top/left rubberbands.
1565         
1566         * UIProcess/API/Cocoa/WKWebView.mm:
1567         (-[WKWebView _didCommitLayerTree:WebKit::]):
1568         * UIProcess/ios/WKScrollView.h:
1569         * UIProcess/ios/WKScrollView.mm:
1570         (-[WKScrollView _currentTopLeftRubberbandAmount]):
1571         (-[WKScrollView _restoreContentOffsetWithRubberbandAmount:]):
1572         (-[WKScrollView _setContentSizePreservingContentOffsetDuringRubberband:]):
1573
1574 2014-06-25  Simon Fraser  <simon.fraser@apple.com>
1575
1576         [iOS WK2] Fixed position elements jump around when zooming
1577         https://bugs.webkit.org/show_bug.cgi?id=134328
1578         <rdar://problem/17447048>
1579
1580         Reviewed by Zalan Bujtas.
1581
1582         If a given remote layer tree commit contains changes of layers for viewport-constrained
1583         objects, then the associated scrolling tree also needs to show that the layers changed,
1584         since we need to re-run the "viewport changed" logic in the UI process to get the
1585         layers correctly positioned for the current zoom level.
1586         
1587         The bug was that page scale changes resulted in small "pixel alignment" position
1588         changes which touched layers, but we didn't commit any scrolling tree changes. So
1589         the scrolling tree commit would result in visibly stale layer positions, with no scrolling tree
1590         update to adjust them for the current transient zoom.
1591
1592         Fix by making use of the existing "alignment offset" field in the ViewportConstraints
1593         data, and having RemoteScrollingCoordinatorProxy::connectStateNodeLayers() note that
1594         fixed or sticky layers changed if any properties of fixed or sticky scrolling tree
1595         nodes were updated.
1596
1597         * UIProcess/ios/RemoteScrollingCoordinatorProxyIOS.mm:
1598         (WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers):
1599
1600 2014-06-25  Benjamin Poulain  <bpoulain@apple.com>
1601
1602         REGRESSION (r170325): UI process crashes in lastCommittedLayerTreeTransactionID() when the Web Content process crashes
1603         https://bugs.webkit.org/show_bug.cgi?id=134284
1604
1605         Reviewed by Simon Fraser.
1606
1607         The crash was caused by the access to the Drawing Area after the crash.
1608         This lead to discovering another bug: m_lastVisibleContentRectUpdate could have been updated after WebPageProxy::resetState(),
1609         which in turn would prevent valid updates when a new WebProcess is created.
1610
1611         This patch fixes both issues by moving the VisibleContentRectUpdateInfo to be internal to WebPageProxy,
1612         then early return if we get there in an invalid state.
1613
1614         * UIProcess/WebPageProxy.h:
1615         * UIProcess/ios/WKContentView.mm:
1616         (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:]):
1617         * UIProcess/ios/WebPageProxyIOS.mm:
1618         (WebKit::WebPageProxy::updateVisibleContentRects):
1619
1620 2014-06-25  Brady Eidson  <beidson@apple.com>
1621
1622         Add new platform gamepad abstractions
1623         https://bugs.webkit.org/show_bug.cgi?id=134325
1624
1625         Reviewed by Dean Jackson.
1626
1627         * NetworkProcess/NetworkProcessPlatformStrategies.cpp:
1628         (WebKit::NetworkProcessPlatformStrategies::createGamepadStrategy):
1629         * NetworkProcess/NetworkProcessPlatformStrategies.h:
1630
1631         Actually return a GamepadStrategy in WK2 with no implementation for now:
1632         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
1633         (WebKit::WebPlatformStrategies::createGamepadStrategy):
1634         (WebKit::WebPlatformStrategies::startMonitoringGamepads):
1635         (WebKit::WebPlatformStrategies::stopMonitoringGamepads):
1636         (WebKit::WebPlatformStrategies::platformGamepads):
1637         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
1638
1639 2014-06-25  Jaehun Lim  <ljaehun.lim@samsung.com>
1640
1641         Unreviewed, CMake build fix after r170450
1642
1643         * CMakeLists.txt: Add ProcessAssertion.cpp and ProcessThrottler.cpp.
1644         * UIProcess/ProcessAssertion.cpp: Replace #import with #include.
1645
1646 2014-06-25  Tim Horton  <timothy_horton@apple.com>
1647
1648         [WK2] Shadow layer is in the wrong place while pinch-zooming
1649         https://bugs.webkit.org/show_bug.cgi?id=134321
1650
1651         Reviewed by Dan Bernstein.
1652
1653         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
1654         (WebKit::TiledCoreAnimationDrawingArea::applyTransientZoomToLayers):
1655         (WebKit::TiledCoreAnimationDrawingArea::commitTransientZoom):
1656         (WebKit::TiledCoreAnimationDrawingArea::applyTransientZoomToPage):
1657         The anchor point of the shadow layer changed, so we no longer need to shift our position to the center.
1658
1659 2014-06-25  Dan Bernstein  <mitz@apple.com>
1660
1661         Fixed crashes after r170450.
1662
1663         Reviewed by Tim Horton.
1664
1665         * UIProcess/WebProcessProxy.cpp:
1666         (WebKit::WebProcessProxy::WebProcessProxy): Removed iOS platform #ifdef around
1667         initialization of m_throttler.
1668
1669 2014-06-25  Beth Dakin  <bdakin@apple.com>
1670
1671         Crash in ScrollingTree::isRubberBandInProgress()
1672         https://bugs.webkit.org/show_bug.cgi?id=134316
1673         -and corresponding-
1674         <rdar://problem/16247911>
1675
1676         Reviewed by Geoffrey Garen.
1677
1678         Move all ScrollingTreeNode creation from ScrollingCoordinator subclasses into 
1679         ScrollingTree subclasses.
1680
1681         * UIProcess/Scrolling/RemoteScrollingTree.cpp:
1682         (WebKit::RemoteScrollingTree::createScrollingTreeNode):
1683         (WebKit::RemoteScrollingTree::createNode): Deleted.
1684         * UIProcess/Scrolling/RemoteScrollingTree.h:
1685         * WebProcess/Scrolling/RemoteScrollingCoordinator.h:
1686         * WebProcess/Scrolling/RemoteScrollingCoordinator.mm:
1687         (WebKit::RemoteScrollingCoordinator::createScrollingTreeNode): Deleted.
1688
1689 2014-06-25  Dan Bernstein  <mitz@apple.com>
1690
1691         Web process should become active when sent a message that requires a callback
1692         https://bugs.webkit.org/show_bug.cgi?id=134315
1693
1694         Reviewed by Tim Horton.
1695
1696         * UIProcess/API/Cocoa/WKWebView.mm:
1697         (-[WKWebView _snapshotRect:intoImageOfWidth:completionHandler:]): Removed one-off code to
1698         acquire an activity token, now that WebPageProxy::takeSnapshot does it automatically for us.
1699
1700         * UIProcess/GenericCallback.h:
1701         (WebKit::CallbackBase::CallbackBase): Made this constructor take and adopt an activity
1702         token.
1703         (WebKit::GenericCallback::create): Added an optional activity token parameter.
1704         (WebKit::GenericCallback::GenericCallback): Pass the activity token to the CallbackBase
1705         constructor.
1706         (WebKit::CallbackMap::put): Added an activity token parameter, which is passed along to
1707         GenericCallback::create.
1708
1709         * UIProcess/ProcessAssertion.cpp: Moved from Source/WebKit2/UIProcess/ios/ProcessAssertion.mm.
1710         This copy includes generic no-op implementations for platforms that don’t have assertions.
1711         (WebKit::ProcessAssertion::ProcessAssertion):
1712         (WebKit::ProcessAssertion::setState):
1713         * UIProcess/ProcessAssertion.h: Moved from Source/WebKit2/UIProcess/ios/ProcessAssertion.h.
1714         Changed platform #ifdefs to make this usable by all platforms.
1715
1716         * UIProcess/ProcessThrottler.cpp: Moved from Source/WebKit2/UIProcess/ios/ProcessThrottler.mm.
1717         Removed iOS platform #ifdef.
1718         * UIProcess/ProcessThrottler.h: Moved from Source/WebKit2/UIProcess/ios/ProcessThrottler.h.
1719         Ditto.
1720
1721         * UIProcess/WebPageProxy.cpp:
1722         (WebKit::WebPageProxy::validateCommand): Create a background activity token and pass it
1723         along to CallbackMap::put.
1724         (WebKit::WebPageProxy::runJavaScriptInMainFrame): Ditto.
1725         (WebKit::WebPageProxy::getRenderTreeExternalRepresentation): Ditto.
1726         (WebKit::WebPageProxy::getSourceForFrame): Ditto.
1727         (WebKit::WebPageProxy::getContentsAsString): Ditto.
1728         (WebKit::WebPageProxy::getBytecodeProfile): Ditto.
1729         (WebKit::WebPageProxy::getSelectionOrContentsAsString): Ditto.
1730         (WebKit::WebPageProxy::getSelectionAsWebArchiveData): Ditto.
1731         (WebKit::WebPageProxy::getMainResourceDataOfFrame): Ditto.
1732         (WebKit::WebPageProxy::getResourceDataFromFrame): Ditto.
1733         (WebKit::WebPageProxy::getWebArchiveOfFrame): Ditto.
1734         (WebKit::WebPageProxy::getMarkedRangeAsync): Ditto.
1735         (WebKit::WebPageProxy::getSelectedRangeAsync): Ditto.
1736         (WebKit::WebPageProxy::characterIndexForPointAsync): Ditto.
1737         (WebKit::WebPageProxy::firstRectForCharacterRangeAsync): Ditto.
1738         (WebKit::WebPageProxy::takeSnapshot): Ditto.
1739
1740         * UIProcess/WebProcessProxy.cpp:
1741         (WebKit::WebProcessProxy::sendProcessWillSuspend): Moved from WebProcessProxyIOS.mm.
1742         (WebKit::WebProcessProxy::sendCancelProcessWillSuspend): Ditto.
1743         (WebKit::WebProcessProxy::processReadyToSuspend): Ditto.
1744         (WebKit::WebProcessProxy::didCancelProcessSuspension): Ditto.
1745         * UIProcess/WebProcessProxy.h: Removed iOS platform #ifdef.
1746         * UIProcess/WebProcessProxy.messages.in: Ditto.
1747
1748         * UIProcess/ios/ProcessAssertionIOS.mm: Renamed from Source/WebKit2/UIProcess/ios/ProcessAssertion.mm.
1749
1750         * UIProcess/ios/WebPageProxyIOS.mm:
1751         (WebKit::WebPageProxy::selectWithGesture): Changed to pass the function directly to
1752         CallbackMap::put, along with a background activity token.
1753         (WebKit::WebPageProxy::updateSelectionWithTouches): Ditto.
1754         (WebKit::WebPageProxy::requestAutocorrectionData): Ditto.
1755         (WebKit::WebPageProxy::applyAutocorrection): Ditto.
1756         (WebKit::WebPageProxy::requestDictationContext): Ditto.
1757         (WebKit::WebPageProxy::requestAutocorrectionContext): Ditto.
1758         (WebKit::WebPageProxy::selectWithTwoTouches): Ditto.
1759
1760         * UIProcess/ios/WebProcessProxyIOS.mm:
1761         (WebKit::WebProcessProxy::sendProcessWillSuspend): Moved to WebProcessProxy.cpp.
1762         (WebKit::WebProcessProxy::sendCancelProcessWillSuspend): Ditto.
1763         (WebKit::WebProcessProxy::processReadyToSuspend): Ditto.
1764         (WebKit::WebProcessProxy::didCancelProcessSuspension): Ditto.
1765
1766         * UIProcess/mac/WebPageProxyMac.mm:
1767         (WebKit::WebPageProxy::attributedSubstringForCharacterRangeAsync): Create a background
1768         activity token and pass it along to CallbackMap::put.
1769
1770         * WebKit2.xcodeproj/project.pbxproj: Updated for moves and copies.
1771
1772         * WebProcess/WebProcess.cpp:
1773         (WebKit::WebProcess::WebProcess): Moved iOS platform #ifdef.
1774         * WebProcess/WebProcess.h: Ditto.
1775         * WebProcess/WebProcess.messages.in: Ditto.
1776
1777 2014-06-25  Chris Fleizach  <cfleizach@apple.com>
1778
1779         Add an undo group for each dictated utterance in WebKit
1780         https://bugs.webkit.org/show_bug.cgi?id=134086
1781
1782         Reviewed by Enrica Casucci.
1783
1784         * UIProcess/API/mac/WKView.mm:
1785         (-[WKView insertText:replacementRange:]):
1786         (-[WKView validAttributesForMarkedText]):
1787         * UIProcess/PageClient.h:
1788         * UIProcess/WebPageProxy.cpp:
1789         (WebKit::WebPageProxy::registerInsertionUndoGrouping):
1790         (WebKit::WebPageProxy::insertTextAsync):
1791         * UIProcess/WebPageProxy.h:
1792         * UIProcess/WebPageProxy.messages.in:
1793         * UIProcess/ios/PageClientImplIOS.mm:
1794         (WebKit::PageClientImpl::registerInsertionUndoGrouping):
1795         * UIProcess/mac/PageClientImpl.h:
1796         * UIProcess/mac/PageClientImpl.mm:
1797         (WebKit::PageClientImpl::registerInsertionUndoGrouping):
1798         * UIProcess/mac/WebPageProxyMac.mm:
1799         (WebKit::WebPageProxy::insertDictatedTextAsync):
1800         * WebProcess/WebPage/WebPage.cpp:
1801         (WebKit::WebPage::insertTextAsync):
1802         * WebProcess/WebPage/WebPage.h:
1803         * WebProcess/WebPage/WebPage.messages.in:
1804         * WebProcess/WebPage/mac/WebPageMac.mm:
1805         (WebKit::WebPage::insertDictatedTextAsync):
1806
1807 2014-06-25  Joseph Pecoraro  <pecoraro@apple.com>
1808
1809         [iOS]: WK2 Inspector Node Search
1810         https://bugs.webkit.org/show_bug.cgi?id=134279
1811
1812         Reviewed by Benjamin Poulain.
1813
1814         * UIProcess/ios/WKInspectorNodeSearchGestureRecognizer.h: Added.
1815         * UIProcess/ios/WKInspectorNodeSearchGestureRecognizer.mm: Added.
1816         (-[WKInspectorNodeSearchGestureRecognizer locationInView:]):
1817         (-[WKInspectorNodeSearchGestureRecognizer _processTouches:state:]):
1818         (-[WKInspectorNodeSearchGestureRecognizer touchesBegan:withEvent:]):
1819         (-[WKInspectorNodeSearchGestureRecognizer touchesMoved:withEvent:]):
1820         (-[WKInspectorNodeSearchGestureRecognizer touchesEnded:withEvent:]):
1821         (-[WKInspectorNodeSearchGestureRecognizer touchesCancelled:withEvent:]):
1822         (-[WKInspectorNodeSearchGestureRecognizer reset]):
1823         Gesture recognizer that tracks a single touch, updates as that touch
1824         moves, and ends when that touch is cancelled or ends. The location
1825         of the gesture recognizer is the location of the touch it was tracking.
1826
1827         * UIProcess/ios/WKContentViewInteraction.h:
1828         * UIProcess/ios/WKContentViewInteraction.mm:
1829         (-[WKContentView cleanupInteraction]):
1830         Handle the inspector node search gesture recognizer if needed.
1831
1832         (-[WKContentView _removeDefaultGestureRecognizers]):
1833         (-[WKContentView _addDefaultGestureRecognizers]):
1834         Helpers to add and remove the default gestures.
1835
1836         (-[WKContentView _enableInspectorNodeSearch]):
1837         (-[WKContentView _disableInspectorNodeSearch]):
1838         When node search is enabled, remove all gesture recognizers and
1839         replace with a single inspector node search gesture recognizer.
1840         Likewise, inverse that when disabled.
1841
1842         (-[WKContentView _inspectorNodeSearchRecognized:]):
1843         Notify the WebProcess of new touch positions during node search.
1844
1845         (-[WKContentView hasSelectablePositionAtPoint:]):
1846         When inspector node search is enabled, disable selection.
1847
1848         * WebProcess/WebPage/ios/WebPageIOS.mm:
1849         (WebKit::WebPage::inspectorNodeSearchMovedToPosition):
1850         Send a mouse move to the new location. WebCore will update the highlight.
1851
1852         (WebKit::WebPage::inspectorNodeSearchEndedAtPosition):
1853         Inspect the node at the location.
1854
1855         * UIProcess/API/Cocoa/WKWebView.mm:
1856         (-[WKWebView _enableInspectorNodeSearch]):
1857         (-[WKWebView _disableInspectorNodeSearch]):
1858         * UIProcess/API/Cocoa/WKWebViewInternal.h:
1859         * UIProcess/PageClient.h:
1860         * UIProcess/WebPageProxy.h:
1861         * UIProcess/WebPageProxy.messages.in:
1862         * UIProcess/ios/PageClientImplIOS.h:
1863         * UIProcess/ios/PageClientImplIOS.mm:
1864         (WebKit::PageClientImpl::enableInspectorNodeSearch):
1865         (WebKit::PageClientImpl::disableInspectorNodeSearch):
1866         * UIProcess/ios/WebPageProxyIOS.mm:
1867         (WebKit::WebPageProxy::inspectorNodeSearchMovedToPosition):
1868         (WebKit::WebPageProxy::inspectorNodeSearchEndedAtPosition):
1869         (WebKit::WebPageProxy::enableInspectorNodeSearch):
1870         (WebKit::WebPageProxy::disableInspectorNodeSearch):
1871         * WebKit2.xcodeproj/project.pbxproj:
1872         * WebProcess/WebCoreSupport/WebInspectorClient.cpp:
1873         (WebKit::WebInspectorClient::didSetSearchingForNode):
1874         * WebProcess/WebCoreSupport/WebInspectorClient.h:
1875         * WebProcess/WebPage/WebPage.h:
1876         * WebProcess/WebPage/WebPage.messages.in:
1877         * WebProcess/WebPage/ios/WebPageIOS.mm:
1878         (WebKit::WebPage::enableInspectorNodeSearch):
1879         (WebKit::WebPage::disableInspectorNodeSearch):
1880         Pass the inspector node search state up from the WebProcess
1881         to the WKContentView in the UIProcess. Likewise some messages
1882         in the reverse direction.
1883
1884 2014-06-25  Dana Burkart  <dburkart@apple.com>
1885
1886         Add support for 5-tuple versioning.
1887
1888         Reviewed by David Farler.
1889
1890         * Configurations/Version.xcconfig:
1891
1892 2014-06-25  Dan Bernstein  <mitz@apple.com>
1893
1894         <rdar://problem/17448049> REGRESSION (r170254): Input methods don’t work
1895         https://bugs.webkit.org/show_bug.cgi?id=134311
1896
1897         Reviewed by Tim Horton.
1898
1899         * UIProcess/WebPageProxy.cpp:
1900         (WebKit::WebPageProxy::getSelectedRangeAsync): Removed code that accidentally put the
1901         callback function into a throwaway EditingRangeCallback.
1902
1903 2014-06-25  Timothy Horton  <timothy_horton@apple.com>
1904
1905         [iOS][WK2] Rotating a zoomed PDF leads to weird scrolling behavior
1906         https://bugs.webkit.org/show_bug.cgi?id=134286
1907
1908         Reviewed by Benjamin Poulain.
1909
1910         * UIProcess/ios/WKPDFView.mm:
1911         (-[WKPDFView _computePageAndDocumentFrames]):
1912         The WKPDFView frame and scroll view content size need to be scaled.
1913
1914         (-[WKPDFView web_setScrollView:]): Deleted.
1915
1916         (-[WKPDFView web_initWithFrame:webView:]):
1917         Get rid of _documentFrame, and don't set it at initWithFrame: time (it's not useful yet).
1918
1919 2014-06-25  Laszlo Gombos  <l.gombos@samsung.com>
1920
1921         Remove build guard for progress element
1922         https://bugs.webkit.org/show_bug.cgi?id=134292
1923
1924         Reviewed by Benjamin Poulain.
1925
1926         * Configurations/FeatureDefines.xcconfig:
1927
1928 2014-06-24  Carlos Garcia Campos  <cgarcia@igalia.com>
1929
1930         [GTK] Windowed plugins visibility doesn't work
1931         https://bugs.webkit.org/show_bug.cgi?id=131487
1932
1933         Reviewed by Anders Carlsson.
1934
1935         Implement plugins visibility changes and add a new message to
1936         notify the UI process when a windowed plugin is shown/hidden to
1937         show/hide the plugin widget.
1938
1939         * PluginProcess/PluginControllerProxy.cpp:
1940         (WebKit::PluginControllerProxy::visibilityDidChange): Add
1941         implementation to notify the plugin about visibility change.
1942         (WebKit::PluginControllerProxy::windowedPluginVisibilityDidChange):
1943         Send WindowedPluginVisibilityDidChange to the plugin proxy.
1944         * PluginProcess/PluginControllerProxy.h:
1945         * PluginProcess/PluginControllerProxy.messages.in: Add VisibilityDidChange message.
1946         * UIProcess/WebPageProxy.h: Add windowedPluginVisibilityDidChange
1947         to handle WindowedPluginVisibilityDidChange message.
1948         * UIProcess/WebPageProxy.messages.in: Add WindowedPluginVisibilityDidChange message.
1949         * UIProcess/efl/WebPageProxyEfl.cpp:
1950         (WebKit::WebPageProxy::windowedPluginVisibilityDidChange):
1951         * UIProcess/gtk/WebPageProxyGtk.cpp:
1952         (WebKit::WebPageProxy::createPluginContainer): Do not show the
1953         plugins by default.
1954         (WebKit::WebPageProxy::windowedPluginVisibilityDidChange): Show or hide the plugin widget.
1955         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
1956         (WebKit::NetscapePlugin::NetscapePlugin): Initialize m_isVisible.
1957         (WebKit::NetscapePlugin::visibilityDidChange): Add visible parameter and save it in m_isVisible
1958         member, calling platformVisibilityDidChange() only when it has actually changed.
1959         * WebProcess/Plugins/Netscape/NetscapePlugin.h:
1960         * WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp:
1961         (WebKit::NetscapePlugin::platformVisibilityDidChange): Notify the controller about visibility change.
1962         * WebProcess/Plugins/PDF/PDFPlugin.h:
1963         * WebProcess/Plugins/Plugin.h:
1964         * WebProcess/Plugins/PluginController.h:
1965         * WebProcess/Plugins/PluginProxy.cpp:
1966         (WebKit::PluginProxy::visibilityDidChange): Send VisibilityDidChange message to the plugin controller proxy.
1967         (WebKit::PluginProxy::windowedPluginVisibilityDidChange): Notify the controller about visibility change.
1968         * WebProcess/Plugins/PluginProxy.h:
1969         * WebProcess/Plugins/PluginProxy.messages.in: Add WindowedPluginVisibilityDidChange message.
1970         * WebProcess/Plugins/PluginView.cpp:
1971         (WebKit::PluginView::didInitializePlugin): Also call viewVisibilityDidChange() when the plugin is initialized.
1972         (WebKit::PluginView::setParentVisible): Override this Widget method to update the plugin visibility when parent
1973         widget is shown/hidden.
1974         (WebKit::PluginView::viewVisibilityDidChange): Pass visible parameter to visibilityDidChange().
1975         (WebKit::PluginView::windowedPluginVisibilityDidChange): Send WindowedPluginVisibilityDidChange message to the UI process.
1976         * WebProcess/Plugins/PluginView.h:
1977
1978 2014-06-24  Benjamin Poulain  <bpoulain@apple.com>
1979
1980         [iOS][WK2] We should not start potential tap activation unless the tap gesture recognizer succeed
1981         https://bugs.webkit.org/show_bug.cgi?id=134277
1982         <rdar://problem/17439973>
1983
1984         Reviewed by Anders Carlsson.
1985
1986         * UIProcess/ios/WKSyntheticClickTapGestureRecognizer.m:
1987         (-[WKSyntheticClickTapGestureRecognizer setState:]):
1988         We were calling the _gestureRecognizedAction even for failure states. The potential activation work
1989         is not light on the Web Process, we should not start if we don't care about the result.
1990
1991 2014-06-24  Benjamin Poulain  <bpoulain@apple.com>
1992
1993         [iOS][WK2] Adopt the C API of UIWebTouchEventsGestureRecognizer for touch event mapping
1994         https://bugs.webkit.org/show_bug.cgi?id=134234
1995
1996         Reviewed by Tim Horton.
1997
1998         The C API is more efficient and expose properties we will need for other patches. This patch moves from
1999         getting each value independently on UIWebTouchEventsGestureRecognizer to the single structure exposed
2000         by _UIWebTouchEvent.
2001
2002         * Shared/NativeWebTouchEvent.h:
2003         * Shared/ios/NativeWebTouchEventIOS.mm:
2004         (WebKit::convertTouchPhase):
2005         (WebKit::extractWebTouchPoint):
2006         (WebKit::NativeWebTouchEvent::NativeWebTouchEvent):
2007         * UIProcess/ios/WKContentViewInteraction.mm:
2008         (-[WKContentView _webTouchEventsRecognized:]):
2009
2010 2014-06-24  Joseph Pecoraro  <pecoraro@apple.com>
2011
2012         [iOS]: WK2 Inspector Node Highlighting
2013         https://bugs.webkit.org/show_bug.cgi?id=134257
2014
2015         Reviewed by Timothy Hatcher.
2016
2017         * Scripts/webkit2/messages.py:
2018         (struct_or_class):
2019         (headers_for_type):
2020         * Shared/WebCoreArgumentCoders.h:
2021         * Shared/WebCoreArgumentCoders.cpp:
2022         (IPC::ArgumentCoder<Highlight>::encode):
2023         (IPC::ArgumentCoder<Highlight>::decode):
2024         Add a way to encode a WebCore::Highlight struct.
2025
2026         * UIProcess/API/Cocoa/WKWebViewInternal.h:
2027         * UIProcess/API/Cocoa/WKWebView.mm:
2028         (-[WKWebView _showInspectorHighlight:WebCore::]):
2029         (-[WKWebView _hideInspectorHighlight]):
2030         * UIProcess/PageClient.h:
2031         * UIProcess/WebPageProxy.h:
2032         * UIProcess/WebPageProxy.messages.in:
2033         * UIProcess/ios/PageClientImplIOS.h:
2034         * UIProcess/ios/PageClientImplIOS.mm:
2035         (WebKit::PageClientImpl::showInspectorHighlight):
2036         (WebKit::PageClientImpl::hideInspectorHighlight):
2037         * UIProcess/ios/WebPageProxyIOS.mm:
2038         (WebKit::WebPageProxy::showInspectorHighlight):
2039         (WebKit::WebPageProxy::hideInspectorHighlight):
2040         * WebProcess/WebCoreSupport/WebInspectorClient.cpp:
2041         (WebKit::WebInspectorClient::highlight):
2042         (WebKit::WebInspectorClient::hideHighlight):
2043         * WebProcess/WebPage/WebPage.h:
2044         * WebProcess/WebPage/ios/WebPageIOS.mm:
2045         (WebKit::WebPage::showInspectorHighlight):
2046         (WebKit::WebPage::hideInspectorHighlight):
2047         Send web process highlight / hideHighlight messages up to
2048         the UIProcess so it can highlight in the WKContentView.
2049         Pass up a WebCore::Highlight in Document coordinates.
2050
2051         * UIProcess/ios/WKContentView.h:
2052         * UIProcess/ios/WKContentView.mm:
2053         (-[WKInspectorHighlightView initWithFrame:]):
2054         (-[WKInspectorHighlightView dealloc]):
2055         (-[WKInspectorHighlightView _removeAllLayers]):
2056         (-[WKInspectorHighlightView _createLayers:]):
2057         (findIntersectionOnLineBetweenPoints):
2058         (quadIntersection):
2059         (layerPathWithHole):
2060         (layerPath):
2061         (-[WKInspectorHighlightView _layoutForNodeHighlight:]):
2062         (-[WKInspectorHighlightView _layoutForRectsHighlight:]):
2063         (-[WKInspectorHighlightView update:]):
2064         Reuse the WebKit1 code to turn highlight float quads into CAShapeLayers.
2065
2066         (-[WKContentView _showInspectorHighlight:WebCore::]):
2067         (-[WKContentView _hideInspectorHighlight]):
2068         Show and hide the highlight view with the respective WebCore::Highlight.
2069
2070 2014-06-24  Anders Carlsson  <andersca@apple.com>
2071
2072         Simplify decodeLegacySessionState
2073         https://bugs.webkit.org/show_bug.cgi?id=134280
2074
2075         Reviewed by Andreas Kling.
2076
2077         There's no need to use a LegacySessionStateDecoder object with a single member,
2078         just make all functions static and only export a single entry point; decodeLegacySessionState.
2079
2080         No functionality change, just moving code around.
2081
2082         * UIProcess/API/C/WKSessionStateRef.cpp:
2083         (WKSessionStateCreateFromData):
2084         * UIProcess/mac/LegacySessionStateCoding.cpp:
2085         (WebKit::decodeSessionHistoryEntryData):
2086         (WebKit::decodeSessionHistoryEntry):
2087         (WebKit::decodeSessionHistoryEntries):
2088         (WebKit::decodeV0SessionHistory):
2089         (WebKit::decodeV1SessionHistory):
2090         (WebKit::decodeSessionHistory):
2091         (WebKit::decodeLegacySessionState):
2092         (WebKit::LegacySessionStateDecoder::LegacySessionStateDecoder): Deleted.
2093         (WebKit::LegacySessionStateDecoder::~LegacySessionStateDecoder): Deleted.
2094         (WebKit::LegacySessionStateDecoder::decodeSessionState): Deleted.
2095         (WebKit::LegacySessionStateDecoder::decodeSessionHistory): Deleted.
2096         (WebKit::LegacySessionStateDecoder::decodeV0SessionHistory): Deleted.
2097         (WebKit::LegacySessionStateDecoder::decodeV1SessionHistory): Deleted.
2098         (WebKit::LegacySessionStateDecoder::decodeSessionHistoryEntries): Deleted.
2099         (WebKit::LegacySessionStateDecoder::decodeSessionHistoryEntry): Deleted.
2100         (WebKit::LegacySessionStateDecoder::decodeSessionHistoryEntryData): Deleted.
2101         * UIProcess/mac/LegacySessionStateCoding.h:
2102
2103 2014-06-24  Brady Eidson  <beidson@apple.com>
2104
2105         Enable GAMEPAD in the Mac build, but disabled at runtime.
2106         https://bugs.webkit.org/show_bug.cgi?id=134255
2107
2108         Reviewed by Dean Jackson.
2109
2110         * Configurations/FeatureDefines.xcconfig:
2111
2112         * Shared/WebPreferencesDefinitions.h:
2113         * UIProcess/API/C/WKPreferences.cpp:
2114         (WKPreferencesSetGamepadsEnabled):
2115         (WKPreferencesGetGamepadsEnabled):
2116         * UIProcess/API/C/WKPreferencesRefPrivate.h:
2117
2118         * WebProcess/WebPage/WebPage.cpp:
2119         (WebKit::WebPage::updatePreferences):
2120
2121 2014-06-24  Anders Carlsson  <andersca@apple.com>
2122
2123         Add support for v0 legacy decoding
2124         https://bugs.webkit.org/show_bug.cgi?id=134275
2125
2126         Reviewed by Andreas Kling.
2127
2128         * Shared/SessionState.h:
2129         * UIProcess/mac/LegacySessionStateCoding.cpp:
2130         (WebKit::LegacySessionStateDecoder::decodeV0SessionHistory):
2131         (WebKit::LegacySessionStateDecoder::decodeV1SessionHistory):
2132
2133 2014-06-24  Anders Carlsson  <andersca@apple.com>
2134
2135         Add SPI for clearing an entire back-forward list
2136         https://bugs.webkit.org/show_bug.cgi?id=134274
2137
2138         Reviewed by Dan Bernstein.
2139
2140         Add -[WKBackForwardList _clear] which only clears the back-forward items, and
2141         change -[WKBackForwardList _removeAllItems] to remove all items including the current one.
2142
2143         * UIProcess/API/Cocoa/WKBackForwardList.mm:
2144         (-[WKBackForwardList _removeAllItems]):
2145         (-[WKBackForwardList _clear]):
2146         * UIProcess/API/Cocoa/WKBackForwardListPrivate.h:
2147         * UIProcess/WebBackForwardList.cpp:
2148         (WebKit::WebBackForwardList::removeAllItems):
2149         * UIProcess/WebBackForwardList.h:
2150
2151 2014-06-24  Anders Carlsson  <andersca@apple.com>
2152
2153         Add iOS specific frame state member variables
2154         https://bugs.webkit.org/show_bug.cgi?id=134268
2155
2156         Reviewed by Andreas Kling.
2157
2158         * Shared/SessionState.cpp:
2159         (WebKit::FrameState::encode):
2160         (WebKit::FrameState::decode):
2161         * Shared/SessionState.h:
2162         * UIProcess/mac/LegacySessionStateCoding.cpp:
2163         (WebKit::HistoryEntryDataDecoder::operator>>):
2164         (WebKit::decodeBackForwardTreeNode):
2165         * WebProcess/WebCoreSupport/SessionStateConversion.cpp:
2166         (WebKit::toFrameState):
2167         (WebKit::applyFrameState):
2168
2169 2014-06-24  Enrica Casucci  <enrica@apple.com>
2170
2171         iOS WebKit2: block selection tends to prefer block to single words even when the page is zoomed.
2172         https://bugs.webkit.org/show_bug.cgi?id=134267
2173         <rdar://problem/17138059>
2174
2175         Reviewed by Benjamin Poulain.
2176
2177         When trying to find the best selection match for the position where the tap occurs,
2178         we need to take into account the page scale. This patch applies the scale factor
2179         to the selection rect before comparing it with the desired size.
2180
2181         * WebProcess/WebPage/ios/WebPageIOS.mm:
2182         (WebKit::WebPage::rangeForWebSelectionAtPosition):
2183
2184 2014-06-24  Anders Carlsson  <andersca@apple.com>
2185
2186         Add code to convert HistoryItem to PageState
2187         https://bugs.webkit.org/show_bug.cgi?id=134263
2188
2189         Reviewed by Andreas Kling.
2190
2191         * WebProcess/WebCoreSupport/SessionStateConversion.cpp:
2192         (WebKit::toHTTPBody):
2193         (WebKit::toFrameState):
2194         (WebKit::toPageState):
2195         * WebProcess/WebCoreSupport/SessionStateConversion.h:
2196
2197 2014-06-24  Andreas Kling  <akling@apple.com>
2198
2199         [iOS WebKit2] Disable screen font substitution by default.
2200         <https://webkit.org/b/134266>
2201         <rdar://problem/17427740>
2202
2203         Just like OS X >= 10.9, screen font substitution should be disabled
2204         by default in WebKit2 for iOS.
2205
2206         Reviewed by Anders Carlsson.
2207
2208         * Shared/WebPreferencesDefinitions.h:
2209
2210 2014-06-24  Anders Carlsson  <andersca@apple.com>
2211
2212         Add PageState to HistoryItem conversion code
2213         https://bugs.webkit.org/show_bug.cgi?id=134259
2214
2215         Reviewed by Andreas Kling.
2216
2217         * Shared/SessionState.h:
2218         * UIProcess/mac/LegacySessionStateCoding.cpp:
2219         (WebKit::decodeBackForwardTreeNode):
2220         * WebKit2.xcodeproj/project.pbxproj:
2221         * WebProcess/WebCoreSupport/SessionStateConversion.cpp: Added.
2222         (WebKit::toFormData):
2223         (WebKit::applyFrameState):
2224         (WebKit::toHistoryItem):
2225         * WebProcess/WebCoreSupport/SessionStateConversion.h: Added.
2226
2227 2014-06-24  Antti Koivisto  <antti@apple.com>
2228
2229         Only flush layers when the exposed rect actually changes
2230         https://bugs.webkit.org/show_bug.cgi?id=134248
2231
2232         Reviewed by Anders Carlsson.
2233
2234         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
2235         (WebKit::RemoteLayerTreeDrawingArea::setExposedContentRect):
2236
2237 2014-06-24  Martin Hock  <mhock@apple.com>
2238
2239         [iOS] DOMWindow::outerWidth and outerHeight don't return useful values, so return 0.
2240         Also, revert r169281.
2241         https://bugs.webkit.org/show_bug.cgi?id=134233
2242         <rdar://problem/17060183>
2243
2244         Reviewed by Benjamin Poulain.
2245
2246         * UIProcess/Cocoa/UIDelegate.h:
2247         * UIProcess/Cocoa/UIDelegate.mm:
2248         (WebKit::UIDelegate::UIClient::windowFrame): Deleted.
2249         * UIProcess/ios/PageClientImplIOS.mm:
2250         (WebKit::PageClientImpl::convertToUserSpace):
2251
2252 2014-06-24  Jeremy Jones  <jeremyj@apple.com>
2253
2254         Initialize WKWebViewConfiguration properties to their default values.
2255         https://bugs.webkit.org/show_bug.cgi?id=134216
2256
2257         Reviewed by Anders Carlsson.
2258
2259         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
2260         (-[WKWebViewConfiguration init]):
2261         add -init method to initialize _mediaPlaybackRequiresUserAction and _mediaPlaybackAllowsAirPlay.
2262
2263 2014-06-24  Anders Carlsson  <andersca@apple.com>
2264
2265         Add missing semicolon.
2266
2267         * UIProcess/API/Cocoa/WKWebView.mm:
2268         (-[WKWebView _updateVisibleContentRects]):
2269
2270 2014-06-24  Eva Balazsfalvi  <evab.u-szeged@partner.samsung.com>
2271
2272         Fix unused parameter warnings if inspector is disabled
2273         https://bugs.webkit.org/show_bug.cgi?id=134244
2274
2275         Reviewed by Zalan Bujtas.
2276
2277         * WebProcess/InjectedBundle/API/c/WKBundleInspector.cpp:
2278         (WKBundleInspectorShow):
2279         (WKBundleInspectorClose):
2280         (WKBundleInspectorEvaluateScriptForTest):
2281         (WKBundleInspectorSetPageProfilingEnabled):
2282
2283 2014-06-24  Anders Carlsson  <andersca@apple.com>
2284
2285         WKWebView doesn't respect -[UIScrollView contentInset]
2286         https://bugs.webkit.org/show_bug.cgi?id=134230
2287         <rdar://problem/17429107>
2288
2289         Reviewed by Tim Horton.
2290
2291         * UIProcess/API/Cocoa/WKWebView.mm:
2292         (-[WKWebView _setHasCustomContentView:loadedMIMEType:WTF::]):
2293         Call initWithFrame and pass the WKWebView along.
2294
2295         (-[WKWebView _adjustedContentOffset:]):
2296         New helper method that takes a content offset as a CGPoint and offsets it by the computed content inset.
2297
2298         (-[WKWebView _computedContentInset]):
2299         New helper method that returns the _obscuredInsets, or if it's zero, the scroll view's content inset.
2300
2301         (-[WKWebView _processDidExit]):
2302         Use _computedContentInset.
2303
2304         (-[WKWebView _didCommitLayerTree:WebKit::]):
2305         use _computedContentInset.
2306
2307         (-[WKWebView _dynamicViewportUpdateChangedTargetToScale:position:]):
2308         Use _computedContentInset.
2309
2310         (-[WKWebView _scrollToContentOffset:WebCore::]):
2311         Use _computedContentInset.
2312
2313         (-[WKWebView _updateVisibleContentRects]):
2314         If we have a custom content view, call web_computedContentInsetDidChange.
2315
2316         (-[WKWebView _setObscuredInsets:]):
2317         Don't call web_setObscuredInsets: if we have a custom content view.
2318
2319         * UIProcess/API/Cocoa/WKWebViewInternal.h:
2320         Add new methods.
2321
2322         * UIProcess/Cocoa/WKWebViewContentProvider.h:
2323         Add new methods.
2324
2325         * UIProcess/ios/WKPDFView.mm:
2326         (-[WKPDFView web_initWithFrame:webView:]):
2327         Set the _webView and _scrollView ivars.
2328
2329         (-[WKPDFView _offsetForPageNumberIndicator]):
2330         Get the computed content offset from the WKWebView.
2331
2332         (-[WKPDFView web_computedContentInsetDidChange]):
2333         Update the page indicator.
2334         
2335         (-[WKPDFView initWithFrame:]): Deleted.
2336         (-[WKPDFView web_setObscuredInsets:]): Deleted.
2337
2338         * UIProcess/ios/WKScrollView.mm:
2339         (-[WKScrollView setContentInset:]):
2340         Call _updateVisibleContentRects.
2341
2342 2014-06-23  Jaehun Lim  <ljaehun.lim@samsung.com>
2343
2344         Unreviewed, fix build warning.
2345
2346         Source/WebKit2/WebProcess/WebPage/DrawingArea.h:117:18: warning: unused parameter ‘wantsDidUpdateViewState’ [-Wunused-parameter]
2347
2348         * WebProcess/WebPage/DrawingArea.h:
2349         (WebKit::DrawingArea::viewStateDidChange):
2350
2351 2014-06-23  Ryuan Choi  <ryuan.choi@samsung.com>
2352
2353         [EFL] Replace RefPtr<Evas_Object> with UniquePtrEfl
2354         https://bugs.webkit.org/show_bug.cgi?id=134236
2355
2356         Reviewed by Gyuyoung Kim.
2357
2358         * PlatformEfl.cmake:
2359         * UIProcess/API/efl/EwkView.cpp:
2360         (EwkView::updateCursor):
2361         * UIProcess/API/efl/EwkView.h:
2362         * UIProcess/API/efl/SnapshotImageGL.cpp:
2363         * UIProcess/API/efl/ewk_favicon_database.cpp:
2364         (ewk_favicon_database_icon_get):
2365         * UIProcess/API/efl/tests/test_ewk2_refptr_evas_object.cpp: Removed.
2366
2367 2014-06-23  Daniel Bates  <dabates@apple.com>
2368
2369         [iOS][WK2] REGRESSION (r169324): Page jumps to top when you type into a text field
2370         https://bugs.webkit.org/show_bug.cgi?id=134219
2371         <rdar://problem/17279113>
2372
2373         Reviewed by Benjamin Poulain.
2374
2375         Fixes an issue where typing into a text field may cause a noticeable jump to the top of
2376         the page.
2377
2378         Currently when updating the visual content rectangles we always constrain the scroll offset
2379         (s_x, s_y) such that 0 <= s_x <= "content width" - "visible width" and 0 <= s_y <= "content height" - "visible height".
2380         However the UIProcess may want to scroll the page by an offset outside of this range to
2381         create a visually pleasing result. In particular, on iOS we may scroll the page slightly
2382         outside of this range (e.g. s_y > 0 = "content height" - "visible height") when a form
2383         control is focused so as to be consistent with platform convention.
2384
2385         * WebProcess/WebPage/ios/WebPageIOS.mm:
2386         (WebKit::WebPage::updateVisibleContentRects): Temporarily disable content edge constraint when
2387         updating scroll offset.
2388
2389 2014-06-23  Dan Bernstein  <mitz@apple.com>
2390
2391         <rdar://problem/17413374> [iOS] Application cache size per origin is not limited
2392         https://bugs.webkit.org/show_bug.cgi?id=134229
2393
2394         Reviewed by Anders Carlsson.
2395
2396         * UIProcess/WebContext.cpp:
2397         (WebKit::WebContext::createNewWebProcess): Set the default quota per origin to the same
2398         value it is set in Legacy WebKit.
2399
2400 2014-06-23  Ryuan Choi  <ryuan.choi@samsung.com>
2401
2402         Unreviewed, EFL build fix after r170330.
2403
2404         * WebProcess/WebPage/WebPage.cpp: Guard WKStringCF.h with PLATFORM(COCOA) macro.
2405
2406 2014-06-23  Timothy Horton  <timothy_horton@apple.com>
2407
2408         [WK2] Use the page background color instead of white when swipe snapshots were purged (134218)
2409         https://bugs.webkit.org/show_bug.cgi?id=134218
2410         <rdar://problem/17426454>
2411
2412         Reviewed by Benjamin Poulain.
2413
2414         * UIProcess/API/Cocoa/WKWebView.mm:
2415         (-[WKWebView _updateScrollViewBackground]):
2416         (-[WKWebView WebKit::]):
2417         * UIProcess/API/mac/WKView.mm:
2418         (-[WKView _takeViewSnapshot]):
2419         * UIProcess/ios/ViewGestureControllerIOS.mm:
2420         (WebKit::ViewGestureController::beginSwipeGesture):
2421         * UIProcess/mac/ViewGestureControllerMac.mm:
2422         (WebKit::ViewGestureController::shouldUseSnapshotForSize):
2423         (WebKit::ViewGestureController::beginSwipeGesture):
2424         (WebKit::ViewGestureController::retrieveSnapshotForItem): Deleted.
2425         * UIProcess/mac/ViewSnapshotStore.h:
2426         Store a color along with each snapshot.
2427         Set the background color of the swipe snapshot layer accordingly.
2428
2429 2014-06-23  Anders Carlsson  <andersca@apple.com>
2430
2431         Add -[WKBackForwardList _removeAllItems]
2432         https://bugs.webkit.org/show_bug.cgi?id=134227
2433         <rdar://problem/17291623>
2434
2435         Reviewed by Tim Horton.
2436
2437         * UIProcess/API/Cocoa/WKBackForwardList.mm:
2438         (-[WKBackForwardList _removeAllItems]):
2439         * UIProcess/API/Cocoa/WKBackForwardListPrivate.h: Added.
2440         * WebKit2.xcodeproj/project.pbxproj:
2441
2442 2014-06-23  Dan Bernstein  <mitz@apple.com>
2443
2444         <rdar://problem/17413498> [Cocoa] Expose WebPreferences::offlineWebApplicationCacheEnabled
2445         https://bugs.webkit.org/show_bug.cgi?id=134217
2446
2447         Reviewed by Anders Carlsson.
2448
2449         * UIProcess/API/Cocoa/WKPreferences.mm:
2450         (-[WKPreferences _offlineApplicationCacheIsEnabled]):
2451         (-[WKPreferences _setOfflineApplicationCacheIsEnabled:]):
2452         * UIProcess/API/Cocoa/WKPreferencesPrivate.h: Added _offlineWebApplicationCacheIsEnabled
2453         property.
2454
2455 2014-06-23  Grant Kennell  <gkennell@apple.com>
2456
2457         Add SPI for Injected Bundle to provide user agent for a given URL.
2458         https://bugs.webkit.org/show_bug.cgi?id=133562
2459
2460         Reviewed by Sam Weinig.
2461
2462         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInLoadDelegate.h: 
2463           Added delegate method to WebProcess PluIn protocol to provide UserAgent per URL.
2464         * WebProcess/InjectedBundle/API/c/WKBundlePageLoaderClient.h:
2465           Added new typedef for function pointer for this new delegate call.
2466           Added new version (V8) of bundle loader client struct containing
2467           a function pointer of that new type.
2468         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
2469         (userAgentForURL): Makes delegate call with the new method.
2470         (setUpPageLoaderClient): Sets the struct's new function pointer to the new method.
2471         * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp:
2472         (WebKit::InjectedBundlePageLoaderClient::userAgentForURL):
2473         * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.h:
2474         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2475         (WebKit::WebFrameLoaderClient::userAgent):
2476         * WebProcess/WebPage/WebPage.cpp:
2477         (WebKit::WebPage::userAgent): Began using the new API to ask for user agent
2478           instead of simply returning what had been stored.
2479         * WebProcess/WebPage/WebPage.h:
2480         (WebKit::WebPage::userAgent): Deleted.
2481
2482 2014-06-23  Commit Queue  <commit-queue@webkit.org>
2483
2484         Unreviewed, rolling out r170324.
2485         https://bugs.webkit.org/show_bug.cgi?id=134223
2486
2487         lots of build breakage (Requested by bradeeoh on #webkit).
2488
2489         Reverted changeset:
2490
2491         "Unreviewed, revert an unintentional change committed with
2492         r170323."
2493         http://trac.webkit.org/changeset/170324
2494
2495 2014-06-23  Timothy Horton  <timothy_horton@apple.com>
2496
2497         [iOS][wk2] Don't use view snapshots if the destination layer is a different size
2498         https://bugs.webkit.org/show_bug.cgi?id=134210
2499         <rdar://problem/17369463>
2500
2501         Reviewed by Benjamin Poulain.
2502
2503         * UIProcess/ios/ViewGestureControllerIOS.mm:
2504         (WebKit::ViewGestureController::beginSwipeGesture):
2505         Only use the view snapshot if the snapshot is the same (in device space) size
2506         as the layer it's going to be put into, and only if the device scale factor is
2507         the same as it was when the snapshot was taken.
2508
2509 2014-06-23  Benjamin Poulain  <bpoulain@apple.com>
2510
2511         [iOS][WK2] Make the state restore from HistoryItem more precise and reliable
2512         https://bugs.webkit.org/show_bug.cgi?id=134150
2513
2514         Reviewed by Tim Horton.
2515
2516         This patch make several little improvements to improve how we restore the visible content rect and scale
2517         from the HistoryItem.
2518
2519         The biggest architectural change is that the exposed rect is now restored on the UIProcess instead of the WebProcess,
2520         this ensure we restore the same position regardless of any modification of obscured areas.
2521
2522         * Shared/VisibleContentRectUpdateInfo.cpp:
2523         (WebKit::VisibleContentRectUpdateInfo::encode):
2524         (WebKit::VisibleContentRectUpdateInfo::decode):
2525         * Shared/VisibleContentRectUpdateInfo.h:
2526         (WebKit::VisibleContentRectUpdateInfo::VisibleContentRectUpdateInfo):
2527         (WebKit::VisibleContentRectUpdateInfo::lastLayerTreeTransactionId):
2528         (WebKit::WebPage::updateVisibleContentRects):
2529         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
2530         A race between the UIProcess and the WebProcess could cause the viewport of the next page to be influenced by updates
2531         of the previous page. To avoid that, VisibleContentRectUpdateInfo keeps track of the last transaction seen at the time
2532         of the update.
2533
2534         The WebProcess updates the size and scale of the content through layer tree updates. If an update was generated for a layer tree
2535         update of the old page, none of the information is valid for the current content. Since the UIProcess drives the state in case of conflicts,
2536         the WebProcess was updating the scale of the current page based on incorrect information.
2537
2538         To avoid the problems, we save the layer tree transaction ID when we commit a new page. Only updates after that transaction are useful
2539         for the current page.
2540
2541         * UIProcess/API/Cocoa/WKWebView.mm:
2542         (-[WKWebView _processDidExit]):
2543         (withinEpsilon):
2544         (changeContentOffsetBoundedInValidRange):
2545         (-[WKWebView _didCommitLayerTree:WebKit::]):
2546         (-[WKWebView _restorePageStateToExposedRect:WebCore::scale:]):
2547         (-[WKWebView _restorePageStateToUnobscuredCenter:WebCore::scale:]):
2548         * UIProcess/API/Cocoa/WKWebViewInternal.h:
2549         * UIProcess/PageClient.h:
2550         * UIProcess/WebPageProxy.h:
2551         * UIProcess/WebPageProxy.messages.in:
2552         * UIProcess/ios/PageClientImplIOS.h:
2553         * UIProcess/ios/PageClientImplIOS.mm:
2554         (WebKit::PageClientImpl::restorePageState):
2555         (WebKit::PageClientImpl::restorePageCenterAndScale):
2556         Restoring the state is now done by WKWebView. The state is only updated on the next layer tree commit,
2557         this is done to avoid any jumping if the page has scrolled since we tried to restore its state.
2558
2559         Both update path end up calling _updateVisibleContentRects. This is because the update on the WebProcess
2560         never sets the ScrollPosition (because it does not know the current state of the obscured insets). Pushing
2561         a new VisibleContentRect will nicely udpates the exposed rect, scroll position, fixed elements, etc.
2562
2563         * UIProcess/ios/WKContentView.mm:
2564         (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:]):
2565         * UIProcess/ios/WebPageProxyIOS.mm:
2566         (WebKit::WebPageProxy::restorePageState):
2567         (WebKit::WebPageProxy::restorePageCenterAndScale):
2568         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h:
2569         (WebKit::RemoteLayerTreeDrawingAreaProxy::lastCommittedLayerTreeTransactionID):
2570         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
2571         (WebKit::RemoteLayerTreeDrawingAreaProxy::RemoteLayerTreeDrawingAreaProxy):
2572         * WebProcess/WebCoreSupport/ios/WebFrameLoaderClientIOS.mm:
2573         (WebKit::WebFrameLoaderClient::saveViewStateToItem):
2574         (WebKit::WebFrameLoaderClient::restoreViewState):
2575         * WebProcess/WebPage/WebPage.cpp:
2576         (WebKit::WebPage::WebPage):
2577         (WebKit::WebPage::didCommitLoad):
2578         * WebProcess/WebPage/WebPage.h:
2579         Get rid of m_obscuredTopInset. It was a bad idea. The UIProcess updates the obscured insets a lot during
2580         page load, the value we used to restore the scroll position was frequently stale.
2581
2582         (WebKit::WebPage::userHasChangedPageScaleFactor): Deleted.
2583         * WebProcess/WebPage/ios/WebPageIOS.mm:
2584         (WebKit::WebPage::savePageState):
2585         (WebKit::scaleAfterViewportWidthChange):
2586         (WebKit::relativeCenterAfterContentSizeChange):
2587         (WebKit::adjustExposedRectForNewScale):
2588         Extract this out of dynamicViewportSizeUpdate(). It is useful to adjust the exposed rect when restoring a HistoryItem
2589         to a ViewportConfiguration that is different from when it was saved.
2590
2591         (WebKit::WebPage::restorePageState):
2592         There are two variations of restorePage:
2593         1) If the viewport configuration is compatible, restore the exact scale and position of the page.
2594         2) Otherwise, restore the scale and position similarily to dynamicViewportSizeUpdate().
2595
2596         (WebKit::WebPage::dynamicViewportSizeUpdate):
2597         (WebKit::WebPage::viewportConfigurationChanged):
2598         (WebKit::adjustExposedRectForBoundedScale):
2599         (WebKit::RemoteLayerTreeDrawingArea::currentTransactionID):
2600         Expose the transactionID for the race issue on VisibleRectUpdate.
2601
2602         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
2603         (WebKit::RemoteLayerTreeDrawingArea::setExposedContentRect):
2604         Store the exposed rect in floating point coordinates. This makes it possible to restore that exact
2605         position when needed.
2606
2607 2014-06-23  Eric Carlson  <eric.carlson@apple.com>
2608
2609         Unreviewed, revert an unintentional change committed with r170323.
2610
2611         * UIProcess/API/Cocoa/WKBackForwardList.mm:
2612
2613 2014-06-23  Anders Carlsson  <andersca@apple.com>
2614
2615         Policy delegate methods should use CompletionHandlerCallChecker
2616         https://bugs.webkit.org/show_bug.cgi?id=134215
2617
2618         Reviewed by Dan Bernstein.
2619
2620         * UIProcess/Cocoa/NavigationState.mm:
2621         (WebKit::NavigationState::PolicyClient::decidePolicyForNavigationAction):
2622         (WebKit::NavigationState::PolicyClient::decidePolicyForResponse):
2623
2624 2014-06-23  Anders Carlsson  <andersca@apple.com>
2625
2626         Don't use the WK prefix for internal C++ types
2627         https://bugs.webkit.org/show_bug.cgi?id=134214
2628
2629         Reviewed by Dan Bernstein.
2630
2631         * Shared/AssistedNodeInformation.cpp:
2632         (WebKit::OptionItem::encode):
2633         (WebKit::OptionItem::decode):
2634         (WebKit::WKOptionItem::encode): Deleted.
2635         (WebKit::WKOptionItem::decode): Deleted.
2636         * Shared/AssistedNodeInformation.h:
2637         (WebKit::OptionItem::OptionItem):
2638         (WebKit::AssistedNodeInformation::AssistedNodeInformation):
2639         (WebKit::WKOptionItem::WKOptionItem): Deleted.
2640         * UIProcess/ios/WKContentViewInteraction.h:
2641         * UIProcess/ios/WKContentViewInteraction.mm:
2642         (-[WKContentView _requiresKeyboardWhenFirstResponder]):
2643         (-[WKContentView inputView]):
2644         (-[WKContentView requiresAccessoryView]):
2645         (-[WKContentView _updateAccessory]):
2646         (-[WKContentView textInputTraits]):
2647         (-[WKContentView assistedNodeSelectOptions]):
2648         (-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:userObject:]):
2649         (-[WKContentView _stopAssistingNode]):
2650         * UIProcess/ios/forms/WKFormInputControl.mm:
2651         (-[WKDateTimePicker initWithView:datePickerMode:]):
2652         (-[WKFormInputControl initWithView:]):
2653         * UIProcess/ios/forms/WKFormSelectControl.h:
2654         * UIProcess/ios/forms/WKFormSelectControl.mm:
2655         (adjustedFontSize):
2656         * UIProcess/ios/forms/WKFormSelectPicker.mm:
2657         (-[WKOptionPickerCell initWithOptionItem:]):
2658         (-[WKOptionGroupPickerCell initWithOptionItem:]):
2659         (-[WKMultipleSelectPicker initWithView:]):
2660         (-[WKMultipleSelectPicker pickerView:viewForRow:forComponent:reusingView:]):
2661         (-[WKMultipleSelectPicker pickerView:row:column:checked:]):
2662         (-[WKSelectSinglePicker pickerView:attributedTitleForRow:forComponent:]):
2663         (-[WKSelectSinglePicker pickerView:didSelectRow:inComponent:]):
2664         * UIProcess/ios/forms/WKFormSelectPopover.mm:
2665         (-[WKSelectTableViewController initWithView:hasGroups:]):
2666         (-[WKSelectTableViewController tableView:numberOfRowsInSection:]):
2667         (-[WKSelectTableViewController tableView:titleForHeaderInSection:]):
2668         (-[WKSelectTableViewController populateCell:withItem:]):
2669         (-[WKSelectTableViewController findItemIndexAt:]):
2670         (-[WKSelectTableViewController findItemAt:]):
2671         (-[WKSelectTableViewController tableView:cellForRowAtIndexPath:]):
2672         (-[WKSelectTableViewController tableView:didSelectRowAtIndexPath:]):
2673         * WebProcess/WebPage/ios/WebPageIOS.mm:
2674         (WebKit::WebPage::getAssistedNodeInformation):
2675
2676 2014-06-23  Dan Bernstein  <mitz@apple.com>
2677
2678         [Cocoa] No way to grant storage quotas for web application cache
2679         https://bugs.webkit.org/show_bug.cgi?id=134213
2680
2681         Reviewed by Anders Carlsson.
2682
2683         * UIProcess/API/APIUIClient.h:
2684         (API::UIClient::reachedApplicationCacheOriginQuota): Added this new client function, with
2685         a default implementation that calls the completion handler with the current quota.
2686
2687         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: Declared a new delegate method.
2688
2689         * UIProcess/API/Cocoa/_WKSecurityOrigin.mm:
2690         (-[_WKSecurityOrigin _initWithSecurityOrigin:WebCore::]): Changed the parameter into a const
2691         reference, since we copy it.
2692         * UIProcess/API/Cocoa/_WKSecurityOriginInternal.h:
2693
2694         * UIProcess/Cocoa/UIDelegate.h: Override API::UIClient::reachedApplicationCacheOriginQuota.
2695         Added flag to m_delegateMethods struct for new delegate method.
2696         * UIProcess/Cocoa/UIDelegate.mm:
2697         (WebKit::UIDelegate::setDelegate): Set new flag in m_delegateMethods struct.
2698         (WebKit::UIDelegate::UIClient::exceededDatabaseQuota): Updated for change in
2699         _WKSecurityOrigin initializer.
2700         (WebKit::UIDelegate::UIClient::reachedApplicationCacheOriginQuota): Added. Calls the new
2701         delegate method.
2702
2703         * UIProcess/WebPageProxy.cpp:
2704         (WebKit::WebPageProxy::reachedApplicationCacheOriginQuota): Added. Forwards the message to
2705         the UI client.
2706         * UIProcess/WebPageProxy.h:
2707
2708         * UIProcess/WebPageProxy.messages.in: Added ReachedApplicationCacheOriginQuota message.
2709
2710         * WebProcess/InjectedBundle/API/APIInjectedBundlePageUIClient.h:
2711         (API::InjectedBundle::PageUIClient::didReachApplicationCacheOriginQuota): Changed the return
2712         type to bool, indicating whether the client handled the callback.
2713
2714         * WebProcess/InjectedBundle/InjectedBundlePageUIClient.cpp:
2715         (WebKit::InjectedBundlePageUIClient::didReachApplicationCacheOriginQuota): Return the
2716         appropriate value.
2717         * WebProcess/InjectedBundle/InjectedBundlePageUIClient.h:
2718
2719         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2720         (WebKit::WebChromeClient::reachedApplicationCacheOriginQuota): If the bundle client didn’t
2721         handle the callback, send a message the the UI process, and update the quota with the reply.
2722
2723 2014-06-23  Tim Horton  <timothy_horton@apple.com>
2724
2725         [wk2] Synchronously wait a short time for a layer tree update after bringing a web view in-window
2726         https://bugs.webkit.org/show_bug.cgi?id=134189
2727
2728         Reviewed by Simon Fraser.
2729
2730         Make the old behavior of -[WKView endDeferringViewInWindowChangesSync] the default; synchronously wait
2731         for a fraction of a second when a page that was previously in-window but currently isn't comes back in-window,
2732         until new content is painted (or we hit a timeout).
2733         
2734         * UIProcess/DrawingAreaProxy.h:
2735         (WebKit::DrawingAreaProxy::waitForDidUpdateViewState):
2736         * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.h:
2737         * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm:
2738         (WebKit::TiledCoreAnimationDrawingAreaProxy::waitForDidUpdateViewState):
2739         Delegate waitForDidUpdateViewState to the DrawingAreaProxys, because behavior is very dependent on them.
2740
2741         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h:
2742         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
2743         (WebKit::RemoteLayerTreeDrawingAreaProxy::coreAnimationDidCommitLayers):
2744         (WebKit::RemoteLayerTreeDrawingAreaProxy::waitForDidUpdateViewState):
2745         Implement waitForDidUpdateViewState for the RemoteLayerTree; it waits for CommitLayerTree.
2746
2747         * UIProcess/WebPageProxy.cpp:
2748         (WebKit::WebPageProxy::WebPageProxy):
2749         (WebKit::WebPageProxy::updateViewState):
2750         (WebKit::WebPageProxy::viewStateDidChange):
2751         (WebKit::WebPageProxy::dispatchViewStateChange):
2752         (WebKit::WebPageProxy::waitForDidUpdateViewState):
2753         (WebKit::WebPageProxy::resetStateAfterProcessExited):
2754         (WebKit::WebPageProxy::viewSize): Deleted.
2755         * UIProcess/WebPageProxy.h:
2756         (WebKit::WebPageProxy::didUpdateViewState):
2757         * UIProcess/API/mac/WKView.mm:
2758         (-[WKView endDeferringViewInWindowChangesSync]):
2759         Always waitForDidUpdateViewState when a page that was previously in-window but currently isn't comes back in-window.
2760
2761         * WebProcess/WebPage/DrawingArea.h:
2762         (WebKit::DrawingArea::viewStateDidChange):
2763         * WebProcess/WebPage/WebPage.cpp:
2764         (WebKit::WebPage::WebPage):
2765         (WebKit::WebPage::setViewState):
2766         (WebKit::WebPage::didUpdateViewStateTimerFired): Deleted.
2767         * WebProcess/WebPage/WebPage.h:
2768         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
2769         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
2770         (WebKit::RemoteLayerTreeDrawingArea::flushLayers):
2771         (WebKit::RemoteLayerTreeDrawingArea::viewStateDidChange):
2772         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
2773         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
2774         (WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea):
2775         (WebKit::TiledCoreAnimationDrawingArea::viewStateDidChange):
2776         (WebKit::TiledCoreAnimationDrawingArea::didUpdateViewStateTimerFired):
2777         * WebProcess/WebPage/mac/WebPageMac.mm:
2778         (WebKit::WebPage::didUpdateViewStateTimerFired): Deleted.
2779         Delegate sending of didUpdateViewState to the DrawingAreas (RemoteLayerTreeDrawingArea won't send it,
2780             because the UI process waits for CommitLayerTree instead).
2781
2782 2014-06-23  Timothy Horton  <timothy_horton@apple.com>
2783
2784         [iOS][wk2] Ensure that layers are marked volatile before allowing the process to suspend
2785         https://bugs.webkit.org/show_bug.cgi?id=134004
2786         <rdar://problem/17186342>
2787
2788         Reviewed by Simon Fraser.
2789
2790         WebKit tries to make layers volatile when unparented, but sometimes isn't given
2791         a chance to do so before the process gets suspended, so we end up with lots of
2792         non-volatile surfaces that should really be volatile.
2793
2794         * Shared/mac/RemoteLayerBackingStoreCollection.h:
2795         * Shared/mac/RemoteLayerBackingStoreCollection.mm:
2796         (WebKit::RemoteLayerBackingStoreCollection::markBackingStoreVolatileImmediately):
2797         (WebKit::RemoteLayerBackingStoreCollection::markAllBackingStoreVolatileImmediatelyIfPossible):
2798         Add markAllBackingStoreVolatileImmediatelyIfPossible, which tries to mark *all*
2799         buffers of *all* backing store, (live and unreachable), (front, back, and secondary),
2800         volatile right away. It returns false if any buffer isn't marked volatile (because it was in-use).
2801
2802         * UIProcess/ios/ProcessThrottler.h:
2803         * UIProcess/ios/ProcessThrottler.mm:
2804         (WebKit::ProcessThrottler::updateAssertion):
2805         (WebKit::ProcessThrottler::processReadyToSuspend):
2806         (WebKit::ProcessThrottler::didCancelProcessSuspension):
2807         * UIProcess/ios/WebProcessProxyIOS.mm:
2808         (WebKit::WebProcessProxy::sendCancelProcessWillSuspend):
2809         (WebKit::WebProcessProxy::didCancelProcessSuspension):
2810         * UIProcess/WebProcessProxy.h:
2811         * UIProcess/WebProcessProxy.messages.in:
2812         * WebProcess/WebProcess.h:
2813         * WebProcess/WebProcess.messages.in:
2814         If the UI process is waiting for the Web process to confirm that it can suspend
2815         and something happens (the view is reparented) that cancels the suspension, inform
2816         the Web process that this happened, so that it can cancel any cleanup that might still be taking place.
2817
2818         * UIProcess/WebPageProxy.cpp:
2819         (WebKit::WebPageProxy::viewStateDidChange):
2820         If a view goes in-window, dispatch the view state change immediately without delay,
2821         to minimize the latency between coming in-window and being ready to go.
2822
2823         * WebProcess/WebPage/DrawingArea.h:
2824         (WebKit::DrawingArea::markLayersVolatileImmediatelyIfPossible):
2825         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
2826         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
2827         (WebKit::RemoteLayerTreeDrawingArea::setRootCompositingLayer):
2828         Schedule a flush when we change the root layer; otherwise, we can end up
2829         detaching the root layer but changing nothing else, and never committing that change.
2830
2831         (WebKit::RemoteLayerTreeDrawingArea::markLayersVolatileImmediatelyIfPossible):
2832
2833         * WebProcess/WebProcess.cpp:
2834         (WebKit::WebProcess::WebProcess):
2835         (WebKit::WebProcess::processWillSuspend):
2836         (WebKit::WebProcess::cancelProcessWillSuspend):
2837         (WebKit::WebProcess::markAllLayersVolatileIfPossible):
2838         (WebKit::WebProcess::processSuspensionCleanupTimerFired):
2839         When the UI process is going to suspend the process, it sends us ProcessWillSuspend,
2840         and defers the suspension until we send a ProcessReadyToSuspend back.
2841         Delay ProcessReadyToSuspend until all layers in our process have been marked volatile.
2842         We'll keep trying every 20ms until they're all volatile. For safety, the UI process will eventually
2843         stop waiting for us, but the volatility change is usually applied successfully within the first
2844         or second timer callback.
2845
2846 2014-06-23  Oliver Hunt  <oliver@apple.com>
2847
2848         Ensure that we always use symlink free paths when specifying cache directories
2849         https://bugs.webkit.org/show_bug.cgi?id=134206
2850
2851         Reviewed by Anders Carlsson.
2852
2853         Sandboxing will deny symlink based paths, so we use realpath to create extensions.
2854         This leaves us in the position of an extension using a visually different path
2855         from other parts of the process code.  This patch simply makes sure that we always
2856         use the realpath for cache directories, so making debugging easier and also ensuring
2857         that we don't ever accidentally try to use a path with symlinks that will thus get
2858         denied.
2859
2860         * Shared/SandboxExtension.h:
2861         (WebKit::stringByResolvingSymlinksInPath):
2862         * Shared/mac/SandboxExtensionMac.mm:
2863         (WebKit::stringByResolvingSymlinksInPath):
2864         * UIProcess/WebContext.cpp:
2865         (WebKit::WebContext::ensureNetworkProcess):
2866         * UIProcess/mac/WebContextMac.mm:
2867         (WebKit::WebContext::platformDefaultApplicationCacheDirectory):
2868         (WebKit::WebContext::platformDefaultDiskCacheDirectory):
2869         (WebKit::WebContext::platformDefaultWebSQLDatabaseDirectory):
2870         (WebKit::WebContext::platformDefaultIconDatabasePath):
2871         (WebKit::WebContext::platformDefaultLocalStorageDirectory):
2872
2873 2014-06-23  Roger Fong  <roger_fong@apple.com>
2874
2875         Unregister notification observer registered in r170156.
2876         https://bugs.webkit.org/show_bug.cgi?id=134204.
2877
2878         Reviewed by Tim Horton.
2879
2880         * UIProcess/API/mac/WKView.mm:
2881         (-[WKView dealloc]):
2882
2883 2014-06-23  Dan Bernstein  <mitz@apple.com>
2884
2885         [Cocoa] No way to grant storage quotas for WebSQL
2886         https://bugs.webkit.org/show_bug.cgi?id=134175
2887
2888         Reviewed by Anders Carlsson.
2889
2890         * Shared/WebSecurityOrigin.h:
2891         (WebKit::WebSecurityOrigin::securityOrigin): Changed to return a non-const reference.
2892
2893         * UIProcess/API/APIUIClient.h:
2894         (API::UIClient::exceededDatabaseQuota): Added a completion handler parameter than takes the
2895         new quota, and changed the return type to void.
2896
2897         * UIProcess/API/C/WKPage.cpp:
2898         (WKPageSetPageUIClient): Changed the override of exceededDatabaseQuota to call the
2899         completion handler with the new quota, or with the existing quota if the client doesn’t
2900         implement the callback.
2901
2902         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: Declared new delegate method.
2903
2904         * UIProcess/API/Cocoa/_WKSecurityOrigin.h: Added.
2905         * UIProcess/API/Cocoa/_WKSecurityOrigin.mm: Added.
2906         (-[_WKSecurityOrigin _initWithSecurityOrigin:WebCore::]): Store the origin in an ivar.
2907         (-[_WKSecurityOrigin protocol]): Added this accessor.
2908         (-[_WKSecurityOrigin host]): Ditto.
2909         (-[_WKSecurityOrigin port]): Ditto.
2910         * UIProcess/API/Cocoa/_WKSecurityOriginInternal.h: Added.
2911
2912         * UIProcess/Cocoa/UIDelegate.h: Override API::UIClient::exceededDatabaseQuota. Added flag
2913         to m_delegateMethods struct for new delegate method.
2914         * UIProcess/Cocoa/UIDelegate.mm:
2915         (WebKit::UIDelegate::setDelegate): Set new flag in m_delegateMethods struct.
2916         (WebKit::UIDelegate::UIClient::exceededDatabaseQuota): Added. Calls the new delegate method.
2917
2918         * UIProcess/WebPageProxy.cpp:
2919         (WebKit::WebPageProxy::exceededDatabaseQuota): Updated for the new client interface: now
2920         passing a completion handler that replies with the new quota.
2921
2922         * WebKit2.xcodeproj/project.pbxproj: Added references to new files, sorted a group.
2923
2924 2014-06-23  Simon Fraser  <simon.fraser@apple.com>
2925
2926         More build fixing after r170295.
2927
2928         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
2929         (InitWebCoreSystemInterface):
2930
2931 2014-06-23  Anders Carlsson  <andersca@apple.com>
2932
2933         Give read-only properties proper ownership attributes
2934         https://bugs.webkit.org/show_bug.cgi?id=134197
2935         <rdar://problem/16830117>
2936
2937         Reviewed by Dan Bernstein.
2938
2939         Also, make WKFrameInfo conform to NSCopying since it's a data-only object and thus intended to be copied.
2940
2941         * UIProcess/API/Cocoa/WKBackForwardList.h:
2942         * UIProcess/API/Cocoa/WKBackForwardListItem.h:
2943         * UIProcess/API/Cocoa/WKFrameInfo.h:
2944         * UIProcess/API/Cocoa/WKFrameInfo.mm:
2945         (-[WKFrameInfo copyWithZone:]):
2946         (-[WKFrameInfo setRequest:]): Deleted.
2947         * UIProcess/API/Cocoa/WKNavigation.h:
2948         * UIProcess/API/Cocoa/WKNavigationAction.h:
2949         * UIProcess/API/Cocoa/WKNavigationAction.mm:
2950         (-[WKNavigationAction setSourceFrame:]):
2951         (-[WKNavigationAction setTargetFrame:]):
2952         * UIProcess/API/Cocoa/WKNavigationActionInternal.h:
2953         * UIProcess/API/Cocoa/WKNavigationResponse.h:
2954         * UIProcess/API/Cocoa/WKScriptMessage.h:
2955         * UIProcess/API/Cocoa/WKUserContentController.h:
2956         * UIProcess/API/Cocoa/WKUserScript.h:
2957         * UIProcess/API/Cocoa/WKWebView.h:
2958
2959 2014-06-23  Gwang Yoon Hwang  <yoon@igalia.com>
2960
2961         Unreviewed, GTK build fix after r170274.
2962
2963         * WebProcess/WebPage/DrawingAreaImpl.cpp:
2964         Drawing::m_webPage changed to reference.
2965
2966         (WebKit::DrawingAreaImpl::DrawingAreaImpl):
2967         (WebKit::DrawingAreaImpl::setNeedsDisplay):
2968         (WebKit::DrawingAreaImpl::setNeedsDisplayInRect):
2969         (WebKit::DrawingAreaImpl::forceRepaint):
2970         (WebKit::DrawingAreaImpl::updatePreferences):
2971         (WebKit::DrawingAreaImpl::layerHostDidFlushLayers):
2972         (WebKit::DrawingAreaImpl::updateBackingStoreState):
2973         (WebKit::DrawingAreaImpl::sendDidUpdateBackingStoreState):
2974         (WebKit::DrawingAreaImpl::enterAcceleratedCompositingMode):
2975         (WebKit::DrawingAreaImpl::exitAcceleratedCompositingMode):
2976         (WebKit::DrawingAreaImpl::display):
2977         * WebProcess/WebPage/DrawingAreaImpl.h:
2978
2979 2014-06-22  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
2980
2981         REGRESSION(r170163): It made everything crash on EFL
2982         https://bugs.webkit.org/show_bug.cgi?id=134097
2983
2984         Unreviewed EFL layout test and perforamcne crash fix.
2985
2986         * WebProcess/WebPage/WebPage.cpp: Add a null check for m_mainFrame.
2987         (WebKit::WebPage::didCompletePageTransition):
2988
2989 2014-06-22  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
2990
2991         Unreviewed EFL build fix since r170274. Use reference for m_webPage member variable.
2992
2993         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedDrawingArea.cpp:
2994         (WebKit::CoordinatedDrawingArea::CoordinatedDrawingArea):
2995         (WebKit::CoordinatedDrawingArea::setNeedsDisplay):
2996         (WebKit::CoordinatedDrawingArea::setNeedsDisplayInRect):
2997         (WebKit::CoordinatedDrawingArea::forceRepaint):
2998         (WebKit::CoordinatedDrawingArea::updatePreferences):
2999         (WebKit::CoordinatedDrawingArea::mainFrameContentSizeChanged):
3000         (WebKit::CoordinatedDrawingArea::layerHostDidFlushLayers):
3001         (WebKit::CoordinatedDrawingArea::updateBackingStoreState):
3002         (WebKit::CoordinatedDrawingArea::sendDidUpdateBackingStoreState):
3003         (WebKit::CoordinatedDrawingArea::suspendPainting):
3004         (WebKit::CoordinatedDrawingArea::resumePainting):
3005         (WebKit::CoordinatedDrawingArea::enterAcceleratedCompositingMode):
3006         (WebKit::CoordinatedDrawingArea::display):
3007         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedDrawingArea.h:
3008
3009 2014-06-22  Tim Horton  <timothy_horton@apple.com>
3010
3011         [iOS][wk2] Swiping back sometimes results in a missing (not blank) swipe snapshot
3012         https://bugs.webkit.org/show_bug.cgi?id=134181
3013
3014         Reviewed by Benjamin Poulain.
3015
3016         * UIProcess/ios/ViewGestureControllerIOS.mm:
3017         (WebKit::ViewGestureController::ViewGestureController):
3018         (WebKit::ViewGestureController::endSwipeGesture):
3019         (WebKit::ViewGestureController::setRenderTreeSize):
3020         (WebKit::ViewGestureController::removeSwipeSnapshot):
3021         * UIProcess/mac/ViewGestureController.h:
3022         Make it explicit that we should only remove the swipe snapshot when a
3023         big-enough render tree size arrives *after the swipe ends*.
3024
3025 2014-06-22  Tim Horton  <timothy_horton@apple.com>
3026
3027         Thread some references through the remote layer tree code
3028         https://bugs.webkit.org/show_bug.cgi?id=134177
3029
3030         Reviewed by Zalan Bujtas.
3031
3032         A first pass at references for never-null things (first pass because I didn't touch the collections).
3033         Things that aren't straightforward reference-threading:
3034
3035         * Shared/mac/RemoteLayerBackingStoreCollection.h:
3036         * Shared/mac/RemoteLayerBackingStoreCollection.mm:
3037         Remove the unimplemented/nonexistant RemoteLayerBackingStoreCollection::create.
3038         Make RemoteLayerBackingStoreCollection constructor not take a context, because m_context is never used.
3039
3040         * WebProcess/WebPage/mac/RemoteLayerTreeContext.h:
3041         * WebProcess/WebPage/mac/RemoteLayerTreeContext.mm:
3042         Factor out grabbing the PlatformLayerID in a few places.
3043
3044         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
3045         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
3046         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
3047         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
3048         Use WebPage::mainFrameView() instead of WebPage::corePage()->mainFrame().view().
3049
3050         * Shared/mac/RemoteLayerTreeTransaction.h:
3051         * Shared/mac/RemoteLayerTreeTransaction.mm:
3052         * WebProcess/WebPage/DrawingArea.cpp:
3053         * WebProcess/WebPage/DrawingArea.h:
3054         * WebProcess/WebPage/WebPage.cpp:
3055         * WebProcess/WebPage/mac/GraphicsLayerCARemote.h:
3056         * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
3057         * WebProcess/WebPage/mac/PlatformCALayerRemote.h:
3058         * WebProcess/WebPage/mac/PlatformCALayerRemoteCustom.h:
3059         * WebProcess/WebPage/mac/PlatformCALayerRemoteCustom.mm:om):
3060         * WebProcess/WebPage/mac/PlatformCALayerRemoteTiledBacking.cpp:
3061         * WebProcess/WebPage/mac/PlatformCALayerRemoteTiledBacking.h:
3062         * Shared/mac/RemoteLayerBackingStore.mm:
3063         References.
3064         
3065 2014-06-22  Anders Carlsson  <andersca@apple.com>
3066
3067         Replace a couple of uses of bind with lambdas
3068         https://bugs.webkit.org/show_bug.cgi?id=134172
3069
3070         Reviewed by Sam Weinig.
3071
3072         * Platform/IPC/Connection.cpp:
3073         (IPC::Connection::postConnectionDidCloseOnConnectionWorkQueue):
3074         (IPC::Connection::connectionDidClose):
3075         (IPC::Connection::dispatchMessage):
3076         (IPC::Connection::dispatchConnectionDidClose): Deleted.
3077         * Platform/IPC/Connection.h:
3078         * Shared/Plugins/NPObjectProxy.cpp:
3079         (WebKit::NPObjectProxy::NP_Deallocate):
3080         * UIProcess/Storage/LocalStorageDatabase.cpp:
3081         (WebKit::LocalStorageDatabase::scheduleDatabaseUpdate):
3082         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
3083         (WebKit::NetscapePlugin::pluginThreadAsyncCall):
3084         (WebKit::NetscapePlugin::handlePluginThreadAsyncCall): Deleted.
3085         * WebProcess/Plugins/Netscape/NetscapePlugin.h:
3086         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
3087         (WebKit::TiledCoreAnimationDrawingArea::forceRepaintAsync):
3088         (WebKit::TiledCoreAnimationDrawingArea::dispatchAfterEnsuringUpdatedScrollPosition):
3089
3090 2014-06-20  Simon Fraser  <simon.fraser@apple.com>
3091
3092         Have scrollingTreeAsText() dump the non-fast-scrollable region
3093         https://bugs.webkit.org/show_bug.cgi?id=134149
3094
3095         Reviewed by Sam Weinig.
3096
3097         Dump the non-fast-scrollable region (as an array of rects).
3098
3099         * Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp:
3100         (WebKit::RemoteScrollingTreeTextStream::dump):
3101
3102 2014-06-22  Anders Carlsson  <andersca@apple.com>
3103
3104         Add IPC decoding support to BackForwardListState
3105         https://bugs.webkit.org/show_bug.cgi?id=134171
3106
3107         Reviewed by Dan Bernstein.
3108
3109         * Shared/SessionState.cpp:
3110         (WebKit::isValidEnum):
3111         (WebKit::HTTPBody::Element::decode):
3112         (WebKit::HTTPBody::decode):
3113         (WebKit::FrameState::decode):
3114         (WebKit::PageState::decode):
3115         (WebKit::BackForwardListState::decode):
3116         * Shared/SessionState.h:
3117
3118 2014-06-22  Anders Carlsson  <andersca@apple.com>
3119
3120         Address a review comment.
3121
3122         * UIProcess/mac/LegacySessionStateCoding.cpp:
3123         (WebKit::HistoryEntryDataDecoder::markInvalid):
3124         (WebKit::decodeFormDataElement):
3125
3126 2014-06-21  Anders Carlsson  <andersca@apple.com>
3127
3128         Implement the rest of back forward tree decoding
3129         https://bugs.webkit.org/show_bug.cgi?id=134166
3130
3131         Reviewed by Sam Weinig.
3132
3133         * UIProcess/mac/LegacySessionStateCoding.cpp:
3134         (WebKit::HistoryEntryDataDecoder::operator>>):
3135         (WebKit::decodeFormDataElement):
3136         (WebKit::decodeFormData):
3137         (WebKit::decodeBackForwardTreeNode):
3138
3139 2014-06-22  Dan Bernstein  <mitz@apple.com>
3140
3141         [iOS] WKWebViewConfiguration.allowsInlineMediaPlayback has no effect
3142         https://bugs.webkit.org/show_bug.cgi?id=134170
3143
3144         Reviewed by Anders Carlsson.
3145
3146         * UIProcess/API/Cocoa/WKWebView.mm:
3147         (-[WKWebView initWithFrame:configuration:]): Fixed a typo.
3148
3149 2014-06-21  Zan Dobersek  <zdobersek@igalia.com>
3150
3151         Unreviewed. Fixing the GTK+ build after r170253.
3152
3153         * UIProcess/API/gtk/WebKitSettings.cpp:
3154         (_WebKitSettingsPrivate::_WebKitSettingsPrivate): WebPreferences::create()
3155         now takes an additional String argument.
3156
3157 2014-06-21  Dan Bernstein  <mitz@apple.com>
3158
3159         CallbackMap::put should be able to take an unwrapped function
3160         https://bugs.webkit.org/show_bug.cgi?id=134104
3161
3162         Reviewed by Anders Carlsson.
3163
3164         * UIProcess/GenericCallback.h:
3165         (WebKit::CallbackMap::put): Added an overload that takes a function and creates and puts a
3166         callback. Changed both overloads of put() to return the callback ID.
3167
3168         * UIProcess/WebPageProxy.cpp:
3169         (WebKit::WebPageProxy::validateCommand):
3170         (WebKit::WebPageProxy::runJavaScriptInMainFrame):
3171         (WebKit::WebPageProxy::getRenderTreeExternalRepresentation):
3172         (WebKit::WebPageProxy::getSourceForFrame):
3173         (WebKit::WebPageProxy::getContentsAsString):
3174         (WebKit::WebPageProxy::getBytecodeProfile):
3175         (WebKit::WebPageProxy::getContentsAsMHTMLData):
3176         (WebKit::WebPageProxy::getSelectionOrContentsAsString):
3177         (WebKit::WebPageProxy::getSelectionAsWebArchiveData):
3178         (WebKit::WebPageProxy::getMainResourceDataOfFrame):
3179         (WebKit::WebPageProxy::getResourceDataFromFrame):
3180         (WebKit::WebPageProxy::getWebArchiveOfFrame):
3181         (WebKit::WebPageProxy::getMarkedRangeAsync):
3182         (WebKit::WebPageProxy::getSelectedRangeAsync):
3183         (WebKit::WebPageProxy::characterIndexForPointAsync):
3184         (WebKit::WebPageProxy::firstRectForCharacterRangeAsync):
3185         (WebKit::WebPageProxy::takeSnapshot):
3186
3187 2014-06-21  Anders Carlsson  <andersca@apple.com>
3188
3189         Make it possible to override debug preferences on a per-identifier basis as well as globally
3190         https://bugs.webkit.org/show_bug.cgi?id=134164
3191
3192         Reviewed by Dan Bernstein.
3193
3194         * Shared/WebPreferencesDefinitions.h:
3195         * Shared/WebPreferencesKeys.cpp:
3196         * Shared/WebPreferencesKeys.h:
3197         * Shared/WebPreferencesStore.cpp:
3198         (WebKit::defaults):
3199         * UIProcess/API/C/WKPreferences.cpp:
3200         (WKPreferencesCreate):
3201         (WKPreferencesCreateWithIdentifier):
3202         * UIProcess/API/Cocoa/WKPreferences.mm:
3203         (-[WKPreferences init]):
3204         * UIProcess/WebPageGroup.cpp:
3205         (WebKit::WebPageGroup::WebPageGroup):
3206         * UIProcess/WebPreferences.cpp:
3207         (WebKit::WebPreferences::create):
3208         (WebKit::WebPreferences::createWithLegacyDefaults):
3209         (WebKit::WebPreferences::WebPreferences):
3210         * UIProcess/WebPreferences.h:
3211         * UIProcess/mac/WebPreferencesMac.mm:
3212         (WebKit::makeKey):
3213         (WebKit::debugUserDefaultsValue):
3214         (WebKit::setDebugBoolValueIfInUserDefaults):
3215         (WebKit::WebPreferences::platformInitializeStore):
3216
3217 2014-06-21  Anders Carlsson  <andersca@apple.com>
3218
3219         Begin work on decoding form data
3220         https://bugs.webkit.org/show_bug.cgi?id=134163
3221
3222         Reviewed by Sam Weinig.
3223
3224         * UIProcess/mac/LegacySessionStateCoding.cpp:
3225         (WebKit::HistoryEntryDataDecoder::operator>>):
3226         (WebKit::HistoryEntryDataDecoder::isValid):
3227         (WebKit::isValidEnum):
3228         (WebKit::decodeFormDataElement):
3229         (WebKit::decodeFormData):
3230         (WebKit::decodeBackForwardTreeNode):
3231
3232 2014-06-21  Anders Carlsson  <andersca@apple.com>
3233
3234         Only initialize WebPreferences from NSUserDefaults if there's an identifier
3235         https://bugs.webkit.org/show_bug.cgi?id=134162
3236
3237         Reviewed by Sam Weinig.
3238
3239         We don't want to allow changing preferences by registering user defaults.
3240
3241         * UIProcess/mac/WebPreferencesMac.mm:
3242         (WebKit::makeKey):
3243         (WebKit::WebPreferences::platformInitializeStore):
3244
3245 2014-06-21  Anders Carlsson  <andersca@apple.com>
3246
3247         Begin work on decoding the back/forward tree
3248         https://bugs.webkit.org/show_bug.cgi?id=134161
3249
3250         Reviewed by Sam Weinig.
3251
3252         * UIProcess/mac/LegacySessionStateCoding.cpp:
3253         (WebKit::LegacySessionStateDecoder::decodeSessionHistoryEntries):
3254         (WebKit::HistoryEntryDataDecoder::operator>>):
3255         (WebKit::HistoryEntryDataDecoder::decodeArithmeticType):
3256         (WebKit::HistoryEntryDataDecoder::bufferIsLargeEnoughToContain):
3257         (WebKit::decodeBackForwardTreeNode):
3258         (WebKit::LegacySessionStateDecoder::decodeSessionHistoryEntryData):
3259         (WebKit::HistoryEntryDataDecoder::decode): Deleted.
3260
3261 2014-06-21  Brady Eidson  <beidson@apple.com>
3262
3263         Gamepad API - Deprecate the existing implementation
3264         https://bugs.webkit.org/show_bug.cgi?id=134108
3265
3266         Reviewed by Timothy Hatcher.
3267
3268         -Add new "GAMEPAD_DEPRECATED" build flag, moving the existing implementation to use it
3269         -Move some implementation files into a "deprecated" subdirectory.
3270
3271         * Configurations/FeatureDefines.xcconfig:
3272
3273 2014-06-20  Anders Carlsson  <andersca@apple.com>
3274
3275         Implement more of HistoryEntryDataDecoder
3276         https://bugs.webkit.org/show_bug.cgi?id=134146
3277
3278         Reviewed by Sam Weinig.
3279
3280         * UIProcess/mac/LegacySessionStateCoding.cpp:
3281         (WebKit::HistoryEntryDataDecoder::HistoryEntryDataDecoder):
3282         (WebKit::HistoryEntryDataDecoder::operator>>):
3283         (WebKit::HistoryEntryDataDecoder::decode):
3284         (WebKit::HistoryEntryDataDecoder::decodeFixedLengthData):
3285         (WebKit::HistoryEntryDataDecoder::alignBufferPosition):
3286         (WebKit::HistoryEntryDataDecoder::alignedBuffer):
3287         (WebKit::HistoryEntryDataDecoder::alignedBufferIsLargeEnoughToContain):
3288         (WebKit::HistoryEntryDataDecoder::markInvalid):
3289         (WebKit::LegacySessionStateDecoder::decodeSessionHistoryEntryData):
3290
3291 2014-06-21  Commit Queue  <commit-queue@webkit.org>
3292
3293         Unreviewed, rolling out r170244.
3294         https://bugs.webkit.org/show_bug.cgi?id=134157
3295
3296         GTK/EFL bindings generator works differently, making this
3297         patch not work there.  Will fix entire patch after a rollout.
3298         (Requested by bradee-oh on #webkit).
3299
3300         Reverted changeset:
3301
3302         "Gamepad API - Deprecate the existing implementation"
3303         https://bugs.webkit.org/show_bug.cgi?id=134108
3304         http://trac.webkit.org/changeset/170244
3305
3306 2014-06-21  Brady Eidson  <beidson@apple.com>
3307
3308         Gamepad API - Deprecate the existing implementation
3309         https://bugs.webkit.org/show_bug.cgi?id=134108
3310
3311         Reviewed by Timothy Hatcher.
3312
3313         -Add new "GAMEPAD_DEPRECATED" build flag, moving the existing implementation to use it
3314         -Add the "Deprecated" suffix to some implementation files
3315
3316         * Configurations/FeatureDefines.xcconfig:
3317
3318 2014-06-21  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
3319
3320         [CoordinatedGraphics][WK2][EFL] Page is moved to (0,0) position before rendering content
3321         https://bugs.webkit.org/show_bug.cgi?id=133300
3322
3323         Reviewed by Csaba Osztrogonác.
3324
3325         When new page is loaded, PageViewportController::didCommitLoad() calls PageViewportController::syncVisibleContents()
3326         with initial position via applyPositionAfterRenderingContents() before starting to render
3327         new page by PageViewportController::didRenderFrame(). This call flow causes that webview shows
3328         incomplete tiles to the user during a few milliseconds. To fix showing incomplete tiles during
3329         the page loading, this patch adds a flag so that we don't show the incomplete tiles until showing
3330         new page.
3331
3332         * UIProcess/API/efl/EwkView.cpp:
3333         (EwkView::EwkView):
3334         * UIProcess/API/efl/EwkView.h:
3335         (EwkView::setWaitingForNewPage):
3336         (EwkView::waitingForNewPage):
3337         * UIProcess/efl/PageLoadClientEfl.cpp:
3338         (WebKit::PageLoadClientEfl::didCommitLoadForFrame):
3339         * UIProcess/efl/PageViewportControllerClientEfl.cpp:
3340         (WebKit::PageViewportControllerClientEfl::didChangeVisibleContents):
3341         * UIProcess/efl/ViewClientEfl.cpp:
3342         (WebKit::ViewClientEfl::didRenderFrame):
3343         (WebKit::ViewClientEfl::didCompletePageTransition):
3344
3345 2014-06-21  Ryosuke Niwa  <rniwa@webkit.org>
3346
3347         Commit queue has been failing due to a build failure in WKFoundation.h
3348         https://bugs.webkit.org/show_bug.cgi?id=134152
3349
3350         Reviewed by Csaba Osztrogonác.
3351         Landed by Brady Eidson.
3352
3353         The build failure was caused by WKFoundation.h erroneously redefining
3354         NSURLSessionAuthChallengeDisposition even when building with 10.9 SDK.
3355
3356         The availability of this type depends on the version of SDK,
3357         not the target operating system.
3358
3359         * Shared/API/Cocoa/WKFoundation.h:
3360
3361 2014-06-21  Eva Balazsfalvi  <evab.u-szeged@partner.samsung.com>
3362
3363         Removing PAGE_VISIBILITY_API compile guard.
3364         https://bugs.webkit.org/show_bug.cgi?id=133844
3365
3366         Reviewed by Gavin Barraclough.
3367
3368         * Configurations/FeatureDefines.xcconfig:
3369         * WebProcess/WebPage/WebPage.cpp:
3370         (WebKit::WebPage::updatePreferences):
3371
3372 2014-06-20  Anders Carlsson  <andersca@apple.com>
3373
3374         Implement more of LegacySessionStateDecoder
3375         https://bugs.webkit.org/show_bug.cgi?id=134145
3376
3377         Reviewed by Sam Weinig.
3378
3379         * Shared/SessionState.h:
3380         * UIProcess/mac/LegacySessionStateCoding.cpp:
3381         (WebKit::LegacySessionStateDecoder::decodeSessionHistoryEntry):
3382         (WebKit::HistoryEntryDataDecoder::HistoryEntryDataDecoder):
3383         (WebKit::HistoryEntryDataDecoder::finishDecoding):
3384         (WebKit::LegacySessionStateDecoder::decodeSessionHistoryEntryData):
3385         * UIProcess/mac/LegacySessionStateCoding.h:
3386
3387 2014-06-20  Anders Carlsson  <andersca@apple.com>
3388
3389         Implement more of LegacySessionStateDecoder
3390         https://bugs.webkit.org/show_bug.cgi?id=134144
3391
3392         Reviewed by Sam Weinig.
3393
3394         * Shared/SessionState.cpp:
3395         (WebKit::BackForwardListState::encode):
3396         (WebKit::SessionState::encode): Deleted.
3397         * Shared/SessionState.h:
3398         * UIProcess/mac/LegacySessionStateCoding.cpp:
3399         (WebKit::LegacySessionStateDecoder::decodeSessionState):
3400         (WebKit::LegacySessionStateDecoder::decodeSessionHistory):
3401         (WebKit::LegacySessionStateDecoder::decodeV0SessionHistory):
3402         (WebKit::LegacySessionStateDecoder::decodeV1SessionHistory):
3403         (WebKit::LegacySessionStateDecoder::decodeSessionHistoryEntries):
3404         (WebKit::LegacySessionStateDecoder::decodeSessionHistoryEntry):
3405         * UIProcess/mac/LegacySessionStateCoding.h:
3406
3407 2014-06-20  Ryuan Choi  <ryuan.choi@samsung.com>
3408
3409         Unreviewed. build fix for the cmake based ports since r170188
3410
3411         * CMakeLists.txt: Added LegacySessionState.cpp in source list.
3412
3413 2014-06-20  Dan Bernstein  <mitz@apple.com>
3414
3415         [Cocoa] No way to get the main frame’s main resource’s data
3416         https://bugs.webkit.org/show_bug.cgi?id=134113
3417
3418         Reviewed by Sam Weinig.
3419
3420         * UIProcess/API/Cocoa/WKWebView.mm:
3421         (-[WKWebView _getMainResourceDataWithCompletionHandler:]): Added. Calls
3422         WebPageProxy::getMainResourceDataOfFrame and invokes the completion handler form the
3423         callback.
3424         * UIProcess/API/Cocoa/WKWebViewPrivate.h: Declared new method.
3425
3426         * UIProcess/WebPageProxy.cpp:
3427         (WebKit::WebPageProxy::getMainResourceDataOfFrame): Made it safe to pass a NULL frame into
3428         this function.
3429
3430 2014-06-20  Anders Carlsson  <andersca@apple.com>
3431
3432         Introduce a WKSessionStateRef object
3433         https://bugs.webkit.org/show_bug.cgi?id=134136
3434
3435         Reviewed by Tim Horton.
3436
3437         WKSessionStateRef is going to hold session state, making it possible to migrate state from one 
3438         webpage to another without having to do any serialization/deserialization.
3439
3440         * Shared/API/c/WKBase.h:
3441         * Shared/APIObject.h:
3442         * Shared/SessionState.cpp:
3443         (WebKit::SessionState::encode):
3444         * Shared/SessionState.h:
3445         * UIProcess/API/APISessionState.cpp: Added.
3446         (API::SessionState::create):
3447         (API::SessionState::SessionState):
3448         (API::SessionState::~SessionState):
3449         * UIProcess/API/APISessionState.h:
3450         * UIProcess/API/C/WKAPICast.h:
3451         * UIProcess/API/C/WKSessionStateRef.cpp:
3452         (WKSessionStateCreateFromData):
3453         * UIProcess/API/C/WKSessionStateRef.h:
3454         * UIProcess/mac/LegacySessionStateCoding.cpp:
3455         (WebKit::LegacySessionStateDecoder::LegacySessionStateDecoder):
3456         (WebKit::LegacySessionStateDecoder::~LegacySessionStateDecoder):
3457         (WebKit::LegacySessionStateDecoder::decodeSessionState):
3458         * UIProcess/