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