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