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