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