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