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