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