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