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