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