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