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