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