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