[iOS][WK2] WKWebView sends invalid content offsets at the end of animated resize
[WebKit-https.git] / Source / WebKit2 / ChangeLog
1 2014-05-15  Benjamin Poulain  <bpoulain@apple.com>
2
3         [iOS][WK2] WKWebView sends invalid content offsets at the end of animated resize
4         https://bugs.webkit.org/show_bug.cgi?id=132941
5         <rdar://problem/16921557>
6
7         Reviewed by Tim Horton.
8
9         Since we cannot change the scale and content inset simultaneously while accounting for the obscured insets,
10         we end up with invalid contentOffsets.
11
12         To work around the problem, change the content scale outside of UIScrollView to ensure none of the side effect
13         happens.
14
15         * UIProcess/API/Cocoa/WKWebView.mm:
16         (-[WKWebView _endAnimatedResize]):
17
18 2014-05-15  Tim Horton  <timothy_horton@apple.com>
19
20         WebKit2 View Gestures (Zoom): Document size changes during zoom gesture cause erratic scrolling
21         https://bugs.webkit.org/show_bug.cgi?id=132944
22         <rdar://problem/15769454>
23
24         Reviewed by Simon Fraser.
25
26         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
27         (WebKit::TiledCoreAnimationDrawingArea::flushLayers):
28         If a layer flush occurs and we have an active transient zoom,
29         re-apply the transient zoom to the relevant platform layers, because
30         WebCore might have overwritten the relevant layer properties.
31
32         (WebKit::TiledCoreAnimationDrawingArea::applyTransientZoomToPage):
33         Reset m_transientZoomScale before flushLayers() so that we don't
34         re-apply the transient zoom when we're actually trying to commit it.
35
36 2014-05-15  Alex Christensen  <achristensen@webkit.org>
37
38         Add pointer lock to features without enabling it.
39         https://bugs.webkit.org/show_bug.cgi?id=132961
40
41         Reviewed by Sam Weinig.
42
43         * Configurations/FeatureDefines.xcconfig:
44         Added ENABLE_POINTER_LOCK to list of features.
45
46 2014-05-15  Simon Fraser  <simon.fraser@apple.com>
47
48         [UI-side compositing] Fix copying animations between layers, and pausing them
49         https://bugs.webkit.org/show_bug.cgi?id=132943
50         <rdar://problem/16906369&16906541>
51
52         Reviewed by Tim Horton.
53         
54         Fix PlatformCAAnimationRemote to support animation copying, and to record
55         the beginTime for implicitly started animations. This fixes animation pausing,
56         and copying of animations between layers when they go between tiled and non-tiled.
57         
58         This requires sending the animation key back through animationDidStart() so that
59         we can record this beginTime on the PlatformCAAnimationRemote in the web process.
60         This path doesn't set the "hasExplicitBeginTime" flag.
61         
62         PlatformCAAnimationRemote also now stores a hash of active animations, so that
63         it can implement animationForKey(), and record the beginTime.
64
65         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h:
66         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
67         (WebKit::RemoteLayerTreeDrawingAreaProxy::acceleratedAnimationDidStart):
68         * UIProcess/mac/RemoteLayerTreeHost.h:
69         * UIProcess/mac/RemoteLayerTreeHost.mm:
70         (WebKit::RemoteLayerTreeHost::animationDidStart): Grovel for the key for this
71         animation; sadly CA doesn't give us an easier way.
72         * WebProcess/WebPage/DrawingArea.h:
73         (WebKit::DrawingArea::acceleratedAnimationDidStart):
74         * WebProcess/WebPage/DrawingArea.messages.in:
75         * WebProcess/WebPage/mac/PlatformCAAnimationRemote.h:
76         * WebProcess/WebPage/mac/PlatformCAAnimationRemote.mm:
77         (-[WKAnimationDelegate animationDidStart:]):
78         (WebKit::PlatformCAAnimationRemote::copy):
79         (WebKit::PlatformCAAnimationRemote::copyTimingFunctionFrom):
80         (WebKit::PlatformCAAnimationRemote::copyFromValueFrom):
81         (WebKit::PlatformCAAnimationRemote::copyToValueFrom):
82         (WebKit::PlatformCAAnimationRemote::copyValuesFrom):
83         (WebKit::PlatformCAAnimationRemote::copyKeyTimesFrom):
84         (WebKit::PlatformCAAnimationRemote::copyTimingFunctionsFrom):
85         (WebKit::addAnimationToLayer):
86         * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
87         (WebKit::PlatformCALayerRemote::addAnimationForKey):
88         (WebKit::PlatformCALayerRemote::removeAnimationForKey):
89         (WebKit::PlatformCALayerRemote::animationForKey):
90         (WebKit::PlatformCALayerRemote::animationStarted):
91         * WebProcess/WebPage/mac/PlatformCALayerRemote.h:
92         * WebProcess/WebPage/mac/RemoteLayerTreeContext.h:
93         * WebProcess/WebPage/mac/RemoteLayerTreeContext.mm:
94         (WebKit::RemoteLayerTreeContext::animationDidStart):
95         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
96         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
97         (WebKit::RemoteLayerTreeDrawingArea::acceleratedAnimationDidStart):
98
99 2014-05-14  Simon Fraser  <simon.fraser@apple.com>
100
101         Clean up "has non-zero begin time" terminology in animations
102         https://bugs.webkit.org/show_bug.cgi?id=132942
103
104         Reviewed by Tim Horton.
105
106         Change the "non-zero beginTime" terminology in the platform CA animations
107         code to "explicit beginTime": this flag really means that we explicitly set
108         the beginTime of the animation, rather than let CA set the beginTime when
109         committing the animation. This flag is used for animations with negative
110         delay, and when pausing.
111
112         * Shared/mac/RemoteLayerTreeTransaction.mm:
113         (WebKit::RemoteLayerTreeTextStream::operator<<):
114         * WebProcess/WebPage/mac/PlatformCAAnimationRemote.h:
115         * WebProcess/WebPage/mac/PlatformCAAnimationRemote.mm:
116         (-[WKAnimationDelegate animationDidStart:]):
117         (WebKit::PlatformCAAnimationRemote::Properties::encode):
118         (WebKit::PlatformCAAnimationRemote::Properties::decode):
119         (WebKit::PlatformCAAnimationRemote::setBeginTime):
120         (WebKit::addAnimationToLayer):
121
122 2014-05-15  Tim Horton  <timothy_horton@apple.com>
123
124         [iOS] Incremental updates during scroll-to-top shouldn’t count as “stable” updates
125         https://bugs.webkit.org/show_bug.cgi?id=132934
126
127         Reviewed by Simon Fraser.
128
129         * UIProcess/API/Cocoa/WKWebView.mm:
130         (-[WKWebView _updateVisibleContentRects]):
131         If we're in a scroll-to-top programmatic scroll, the update is not stable.
132         The last event comes in with _isScrollingToTop false, so we do our stable update.
133
134 2014-05-15  Carlos Garcia Campos  <cgarcia@igalia.com>
135
136         [GTK] Compile all installed resources as GResources
137         https://bugs.webkit.org/show_bug.cgi?id=131099
138
139         Reviewed by Philippe Normand.
140
141         It avoids conflicts with old WebKit versions, and resources are
142         always found even without installing or using environment variables.
143
144         * PlatformGTK.cmake: Add rules to write the xml file with the
145         resources depending on the configure options and to generate and
146         build the GResources file.
147
148 2014-05-14  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
149
150         [EFL][WK2] Fix an unit test of ewk_context_url_scheme_register()
151         https://bugs.webkit.org/show_bug.cgi?id=132902
152
153         Reviewed by Anders Carlsson.
154
155         This test can be run when CUSTOM_PROTOCOL is enabled. Besides the test needs 
156         to check if registered callback function works well.
157
158         * UIProcess/API/efl/tests/test_ewk2_context.cpp:
159         (EWK2ContextTest::schemeRequestCallback):
160         (TEST_F):
161
162 2014-05-14  Ryuan Choi  <ryuan.choi@samsung.com>
163
164         [EFL][WK2] Use default context for ewk_view_add
165         https://bugs.webkit.org/show_bug.cgi?id=132936
166
167         Reviewed by Gyuyoung Kim.
168
169         Since r146265, ewk_view_add created new context and it's regression.
170         This patch restores the behavior of ewk_view_add to original one.
171
172         * UIProcess/API/efl/ewk_view.cpp:
173         (ewk_view_add):
174         * UIProcess/API/efl/tests/test_ewk2_view.cpp:
175         (TEST_F):
176
177 2014-05-14  Maciej Stachowiak  <mjs@apple.com>
178
179         Database Process crashes after loading html5test.com
180         https://bugs.webkit.org/show_bug.cgi?id=132938
181         <rdar://problem/16241419>
182
183         Reviewed by Ryosuke Niwa.
184
185         * DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.cpp:
186         (WebKit::DatabaseProcessIDBConnection::disconnectedFromWebProcess): Expand comment
187         about the null check.
188         (WebKit::DatabaseProcessIDBConnection::deleteDatabase): Call disconnectedFromWebProcess
189         to pick up its null check and to avoid duplicating code.
190
191 2014-05-14  Benjamin Poulain  <bpoulain@apple.com>
192
193         [iOS][WK2] The top/bottom edges should not be sticky when restoring the scroll position from the dynamic size update history
194         https://bugs.webkit.org/show_bug.cgi?id=132931
195
196         Reviewed by Sam Weinig.
197
198         The goal of dynamicSizeUpdateHistory is to make dynamic resize completely reversible.
199         Because of the stick-to-edges heuristics, this was not true near the top and bottom edges.
200
201         For example, start in landscape, scroll the page a bit, then rotate to portrait. Now you have
202         a lot more vertical space, and the top edge of the document is at the edge of the scrollview.
203         Rotate back to landscape: the position is restored  correct, but it is then overriden by
204         the stick-to-edges branch.
205
206         When we restore the position from history, we should only put it back in the valid bounds, skipping
207         stick-to-edges entirely.
208
209         * WebProcess/WebPage/ios/WebPageIOS.mm:
210         (WebKit::WebPage::dynamicViewportSizeUpdate):
211
212 2014-05-14  Tim Horton  <timothy_horton@apple.com>
213
214         Enable IOSurface view snapshots for 10.9+
215         https://bugs.webkit.org/show_bug.cgi?id=132932
216         <rdar://problem/16900619>
217
218         Reviewed by Dean Jackson.
219
220         * UIProcess/mac/ViewSnapshotStore.h:
221         r166005 unintentionally worked around <rdar://problem/16734031>.
222         r168689 fixed another bug that caused sometimes randomly white snapshots.
223         It's safe to turn on IOSurface view snapshots where purgeability is supported.
224
225 2014-05-14  Alexey Proskuryakov  <ap@apple.com>
226
227         Use the correct client in WebPageProxy::unwrapCryptoKey
228         https://bugs.webkit.org/show_bug.cgi?id=132924
229
230         Reviewed by Darin Adler.
231
232         * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::unwrapCryptoKey): Match what
233         we now do in wrapCryptoKey().
234
235 2014-05-14  Zalan Bujtas  <zalan@apple.com>
236
237         Subpixel layout: Change Element.offset* client* scroll* return type to double.
238         https://bugs.webkit.org/show_bug.cgi?id=132895
239
240         Reviewed by Simon Fraser.
241
242         This patch changes Element.offset*, Element.client* and Element.scroll* APIs return
243         type from long to double to match the latest CSSOM View Module spec[1].
244         Element.offset* and Element.client* do return subpixel values from now on.
245         Element.scroll* still return integral values as the scrolling code hasn't adopted to subpixel rendering yet.
246
247         subpixelCSSOMElementMetricsEnabled setting is added to be able to turn this feature on/off
248         from WK2 preferences. It toggles the return value from subpixel to floored integral.
249         It does not change layout/rendering behavior.
250
251         Reference list of what other browsers do:
252         IE: http://blogs.msdn.com/b/ie/archive/2012/02/17/sub-pixel-rendering-and-the-css-object-model.aspx
253         Blink: http://www.chromestatus.com/features/5497402177880064
254         Firefox: https://bugzilla.mozilla.org/show_bug.cgi?id=825607
255
256         [1] http://www.w3.org/TR/2013/WD-cssom-view-20131217/
257
258         * Shared/WebPreferencesStore.h:
259         * UIProcess/API/C/WKPreferences.cpp:
260         (WKPreferencesSetSubpixelCSSOMElementMetricsEnabled):
261         (WKPreferencesGetSubpixelCSSOMElementMetricsEnabled):
262         * UIProcess/API/C/WKPreferencesRefPrivate.h:
263         * WebProcess/WebPage/WebPage.cpp:
264         (WebKit::WebPage::updatePreferences):
265
266 2014-05-14  Benjamin Poulain  <bpoulain@apple.com>
267
268         [iOS][WK2] Expose the viewport meta tag width on the UIProcess
269         https://bugs.webkit.org/show_bug.cgi?id=132926
270         <rdar://problem/16892115>
271
272         Reviewed by Sam Weinig.
273
274         Safari requires the viewport meta tag width for legacy stuff on WebApps. Just send it
275         over to the UIProcess when it changes.
276
277         * UIProcess/API/Cocoa/WKWebView.mm:
278         (-[WKWebView initWithFrame:configuration:]):
279         (-[WKWebView _setViewportMetaTagWidth:]):
280         (-[WKWebView _viewportMetaTagWidth]):
281         * UIProcess/API/Cocoa/WKWebViewInternal.h:
282         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
283         * UIProcess/PageClient.h:
284         * UIProcess/WebPageProxy.h:
285         * UIProcess/WebPageProxy.messages.in:
286         * UIProcess/ios/PageClientImplIOS.h:
287         * UIProcess/ios/PageClientImplIOS.mm:
288         (WebKit::PageClientImpl::didChangeViewportMetaTagWidth):
289         * UIProcess/ios/WebPageProxyIOS.mm:
290         (WebKit::WebPageProxy::viewportMetaTagWidthDidChange):
291         * WebProcess/WebPage/ios/WebPageIOS.mm:
292         (WebKit::WebPage::viewportPropertiesDidChange):
293
294 2014-05-13  Simon Fraser  <simon.fraser@apple.com>
295
296         [iOS WK2] Make view debugging easier
297         https://bugs.webkit.org/show_bug.cgi?id=132892
298
299         Reviewed by Tim Horton.
300         
301         Enhance -[WKCompositingView description] to show WebKit-related information
302         which is useful when dumping a window's UIView hierarchy.
303         
304         Also have WKTransformView and WKRemoteView inherit from WKCompositingView,
305         and thereby get the hitTest:withEvent: override for free, as well as better dumping.
306
307         * UIProcess/ios/RemoteLayerTreeHostIOS.mm:
308         (-[WKCompositingView description]):
309         (-[WKTransformView hitTest:withEvent:]): Deleted.
310         (-[WKRemoteView hitTest:withEvent:]): Deleted.
311
312 2014-05-14  Benjamin Poulain  <bpoulain@apple.com>
313
314         [iOS][WK2] Fixed positioned element must relayout correctly before sending resize events to the page
315         https://bugs.webkit.org/show_bug.cgi?id=132920
316         <rdar://problem/16836866>
317
318         Reviewed by Simon Fraser.
319
320         During the dynamic resize operation, we do not update the fixed position elements because
321         it is a very hard problem on the UI Process side.
322
323         When the animation finishes, the fixed positioned rect is recomputed on the UIProcess and pushed
324         to the WebProcess.
325
326         The problem is sending the rect after the animation is too late, the content can observe the fixed
327         elements layout through JavaScript and would get the old size.
328
329         This patch fixes the issue updating the CustomFixedPositionLayoutRect on the WebProcess before
330         notifying the content of the resize.
331         First, we layout the content to the new fixed layout size to get the new content size.
332         Then, we compute the new FixedPositionedLayoutRect with FrameView's viewportConstrainedObjectsRect(),
333         this use the real content size and our estimated unobscured content rect.
334
335         * WebProcess/WebPage/ios/WebPageIOS.mm:
336         (WebKit::WebPage::dynamicViewportSizeUpdate):
337
338 2014-05-14  Enrica Casucci  <enrica@apple.com>
339
340         REGRESSION(WK2): Many pages have very wrong text size after rotating.
341         https://bugs.webkit.org/show_bug.cgi?id=132893
342         <rdar://problem/16806958>
343
344         Reviewed by Benjamin Poulain.
345
346         Whenever our viewport width changes we must reset text autosizing
347         on the renderer.
348
349         * WebProcess/WebPage/WebPage.h:
350         * WebProcess/WebPage/ios/WebPageIOS.mm:
351         (WebKit::WebPage::setViewportConfigurationMinimumLayoutSize):
352         (WebKit::WebPage::setMinimumLayoutSizeForMinimalUI):
353         (WebKit::WebPage::resetTextAutosizingBeforeLayoutIfNeeded):
354         (WebKit::WebPage::dynamicViewportSizeUpdate):
355
356 2014-05-14  Alex Christensen  <achristensen@webkit.org>
357
358         Use references instead of pointers with ResourceLoadTiming.
359         https://bugs.webkit.org/show_bug.cgi?id=132846
360
361         Reviewed by Alexey Proskuryakov.
362
363         * Shared/WebCoreArgumentCoders.cpp:
364         (IPC::ArgumentCoder<ResourceResponse>::encode):
365         (IPC::ArgumentCoder<ResourceResponse>::decode):
366         Use references instead of pointers and null checks.
367
368 2014-05-14  Tibor Meszaros  <tmeszaros.u-szeged@partner.samsung.com>
369
370         Remove CSS_STICKY_POSITION guards
371         https://bugs.webkit.org/show_bug.cgi?id=132676
372
373         Reviewed by Simon Fraser.
374
375         * Configurations/FeatureDefines.xcconfig:
376
377 2014-05-13  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
378
379         [EFL][WK2] Add ewk_view_fixed_layout_size_set|get()
380         https://bugs.webkit.org/show_bug.cgi?id=132811
381
382         Reviewed by Christophe Dumez.
383
384         Some EFL applications need to set size of fixed layout when enabling fixed layout.
385         This APIs can pass ownership regarding the size of fixed layout to application side.
386
387         * UIProcess/API/efl/ewk_view.cpp:
388         (ewk_view_layout_fixed_size_set):
389         (ewk_view_layout_fixed_size_get):
390         * UIProcess/API/efl/ewk_view.h:
391         * UIProcess/API/efl/tests/test_ewk2_view.cpp:
392         (TEST_F):
393
394 2014-05-13  Simon Fraser  <simon.fraser@apple.com>
395
396         Fix "ASSERTION FAILED: m_representation == PlatformLayerRepresentation" with UI-side compositing
397         https://bugs.webkit.org/show_bug.cgi?id=132899
398
399         Reviewed by Beth Dakin.
400         
401         The new InsetClipLayer and ContentShadowLayer members on scrolling nodes
402         need to be correctly encoded/decoded for UI-side compositing, and dumped
403         correctly.
404
405         * Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp:
406         (ArgumentCoder<ScrollingStateScrollingNode>::encode):
407         (ArgumentCoder<ScrollingStateScrollingNode>::decode):
408         (WebKit::RemoteScrollingTreeTextStream::dump):
409         * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp:
410         (WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers):
411
412 2014-05-13  Anders Carlsson  <andersca@apple.com>
413
414         Another build fix.
415
416         Reviewed by Dan Bernstein.
417
418         * Shared/API/Cocoa/WKFoundation.h:
419         Make sure to include Availability.h
420
421 2014-05-13  Beth Dakin  <bdakin@apple.com>
422
423         REGRESSION (topContentInset): Searching through Facebook Messenger's chat causes 
424         scrolling in News Feed
425         https://bugs.webkit.org/show_bug.cgi?id=132889
426         -and corresponding-
427         <rdar://problem/16715716>
428
429         Reviewed by Simon Fraser.
430
431         Re-name scrollOffsetRelativeToDocument() to 
432         documentScrollPositionRelativeToViewOrigin().
433         * WebProcess/WebPage/FindController.cpp:
434         (WebKit::FindController::rectsForTextMatches):
435         * WebProcess/WebPage/WebPage.cpp:
436         (WebKit::WebPage::determinePrimarySnapshottedPlugIn):
437
438 2014-05-13  Dean Jackson  <dino@apple.com>
439
440         [iOS] Page scale update messages for media controls should only fire at the end of zooming
441         https://bugs.webkit.org/show_bug.cgi?id=132857
442         <rdar://problem/16631009>
443
444         Reviewed by Simon Fraser.
445
446         As the user was zooming, the media controls that responded
447         to the page scale (and resized themselves) would do so
448         slightly out of sync with the screen refreshes, and it looked
449         terrible.
450
451         We already know if a pageScale change is happening inside
452         a gesture using the inStableState property of the visibleContentRectUpdateInfo.
453         Simply pass this along to WebCore::Page.
454
455         * WebProcess/WebPage/ios/WebPageIOS.mm:
456         (WebKit::WebPage::updateVisibleContentRects): Pass inStableState onto the
457         WebCore::Page. Note that we have to send this message even if the
458         scale has not changed, since the last changing update might not have
459         been stable.
460
461 2014-05-13  Benjamin Poulain  <bpoulain@apple.com>
462
463         [iOS][WK2] When the secondary UIScrollView delegates respond to callbacks, delay the state change until both delegates have finished
464         https://bugs.webkit.org/show_bug.cgi?id=132849
465         <rdar://problem/16863716>
466
467         Reviewed by Anders Carlsson.
468
469         When there are two delegates responding to UIScrollView changes, there was often an intermediate invalid
470         state forwarded to the UIProcess.
471
472         For example, on scroll, WKWebView would update the state based on the current obscured insets in response to
473         delegate callbacks.
474         After that update, Safari would modify the insets, thus updating the state again.
475         The first state changed by WKWebView is incomplete, and should never have been set.
476
477         This patch works around the issue by delaying visible update rect in those cases.
478
479         When the two delegates of WKScrollView respond to the same selector, WKScrollView invokes 
480         [UIWebView _willInvokeUIScrollViewDelegateCallback] on entry, and
481         [UIWebView _didInvokeUIScrollViewDelegateCallback] on exit.
482
483         Between those two calls, WKWebView does not forward the new UI state to the WebProcess.
484
485         * UIProcess/API/Cocoa/WKWebView.mm:
486         (-[WKWebView _willInvokeUIScrollViewDelegateCallback]):
487         (-[WKWebView _didInvokeUIScrollViewDelegateCallback]):
488         (-[WKWebView _updateVisibleContentRects]):
489         * UIProcess/API/Cocoa/WKWebViewInternal.h:
490         * UIProcess/API/ios/WKViewIOS.mm:
491         (-[WKView _commonInitializationWithContextRef:pageGroupRef:relatedToPage:]):
492         * UIProcess/ios/WKScrollView.h:
493         * UIProcess/ios/WKScrollView.mm:
494         (-[WKScrollViewDelegateForwarder initWithInternalDelegate:externalDelegate:]):
495         (-[WKScrollViewDelegateForwarder forwardInvocation:]):
496         (-[WKScrollView setInternalDelegate:]):
497
498 2014-05-13  Benjamin Poulain  <bpoulain@apple.com>
499
500         [iOS][WK2] Remove the _extendedBackgroundExclusionInsets SPI
501         https://bugs.webkit.org/show_bug.cgi?id=132848
502         <rdar://problem/16875093>
503
504         Reviewed by Darin Adler.
505
506         The SPI is no longer needed by Safari.
507
508         * UIProcess/API/Cocoa/WKWebView.mm:
509         (-[WKWebView initWithFrame:configuration:]):
510         (-[WKWebView _updateScrollViewBackground]):
511         (-[WKWebView _frameOrBoundsChanged]):
512         (-[WKWebView _setObscuredInsets:]):
513         (-[WKWebView _endAnimatedResize]):
514         (updateTopAndBottomExtendedBackgroundExclusionIfNecessary): Deleted.
515         (-[WKWebView _setExtendedBackgroundExclusionInsets:]): Deleted.
516         (-[WKWebView _extendedBackgroundExclusionInsets]): Deleted.
517         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
518
519 2014-05-13  Samuel White  <samuel_white@apple.com>
520
521         AX: Hit testing not accounting for top content inset.
522         https://bugs.webkit.org/show_bug.cgi?id=132876
523
524         Reviewed by Chris Fleizach.
525
526         Updated accessibilityHitTest: to account for top content inset when converting from screen coords to WebKit coords.
527
528         * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm:
529         (-[WKAccessibilityWebPageObject accessibilityHitTest:]):
530
531 2014-05-13  Enrica Casucci  <enrica@apple.com>
532
533         REGRESSION (WebKit2): Zooming to text field leaves it partially hidden by the form assistant.
534         https://bugs.webkit.org/show_bug.cgi?id=132879
535         <rdar://problem/16318049>
536
537         Reviewed by Benjamin Poulain.
538
539         Adds the heuristics to zoom and scroll to ensure the element being focused
540         is fully visible and its text readable.
541
542         * Shared/AssistedNodeInformation.cpp:
543         (WebKit::AssistedNodeInformation::encode):
544         (WebKit::AssistedNodeInformation::decode):
545         * Shared/AssistedNodeInformation.h:
546         (WebKit::AssistedNodeInformation::AssistedNodeInformation):
547         * UIProcess/API/Cocoa/WKWebView.mm:
548         (-[WKWebView _zoomToFocusRect:WebCore::selectionRect:WebCore::fontSize:minimumScale:maximumScale:allowUserScaling:forceScroll:]):
549         (-[WKWebView _keyboardChangedWithInfo:adjustScrollView:]):
550         * UIProcess/API/Cocoa/WKWebViewInternal.h:
551         * UIProcess/ios/WKContentView.h:
552         * UIProcess/ios/WKContentView.mm:
553         (-[WKContentView _zoomToFocusRect:selectionRect:fontSize:minimumScale:maximumScale:allowUserScaling:forceScroll:]):
554         * UIProcess/ios/WKContentViewInteraction.mm:
555         (-[WKContentView _displayFormNodeInputView]):
556         (-[WKContentView _startAssistingNode:userIsInteracting:userObject:]):
557         * WebProcess/WebPage/ios/WebPageIOS.mm:
558         (WebKit::WebPage::getAssistedNodeInformation):
559
560 2014-05-13  Simon Fraser  <simon.fraser@apple.com>
561
562         Fix the iOS Simulator build.
563
564         * UIProcess/mac/ViewSnapshotStore.h:
565
566 2014-05-13  Tim Horton  <timothy_horton@apple.com>
567
568         Speculative build fix for iOS.
569
570         * UIProcess/ios/WebMemoryPressureHandlerIOS.cpp: Removed.
571         * UIProcess/ios/WebMemoryPressureHandlerIOS.mm: Added.
572         (WebKit::WebMemoryPressureHandler::shared):
573         (WebKit::WebMemoryPressureHandler::WebMemoryPressureHandler):
574         * WebKit2.xcodeproj/project.pbxproj:
575         Make WebMemoryPressureHandlerIOS Obj-C.
576
577 2014-05-13  Anders Carlsson  <andersca@apple.com>
578
579         Another follow-up build fix.
580
581         * Shared/API/Cocoa/WKFoundation.h:
582
583 2014-05-13  Anders Carlsson  <andersca@apple.com>
584
585         Another follow-up build fix.
586
587         * Shared/API/Cocoa/WKFoundation.h:
588
589 2014-05-13  Anders Carlsson  <andersca@apple.com>
590
591         Follow-up fix.
592
593         * UIProcess/API/Cocoa/WKNavigationAction.mm:
594         (-[WKNavigationAction _initWithNavigationActionData:WebKit::]):
595         (-[WKNavigationAction _isUserInitiated]):
596
597 2014-05-13  Anders Carlsson  <andersca@apple.com>
598
599         Add -[WKNavigationAction modifierFlags] and -[WKNavigationAction buttonNumber]
600         https://bugs.webkit.org/show_bug.cgi?id=132880
601         <rdar://problem/16901354>
602
603         Reviewed by Dan Bernstein.
604
605         * Shared/API/Cocoa/WKFoundation.h:
606         Add typedef for older systems.
607
608         * UIProcess/API/Cocoa/WKNavigationAction.h:
609         Add -[WKNavigationAction modifierFlags] and -[WKNavigationAction buttonNumber]
610
611         * UIProcess/API/Cocoa/WKNavigationAction.mm:
612         (toWKNavigationType):
613         This can be static now.
614
615         (toNSEventModifierFlags):
616         Helper to convert WebEvent::Modifiers to NSEventModifierFlags.
617
618         (toNSButtonNumber):
619         Helper to convert WebMouseEvent::Button to an AppKit button number.
620
621         (-[WKNavigationAction initWithNavigationActionData:WebKit::]):
622         New initializer that takes a NavigationActionData and fills in the relevant ivars from it.
623
624         (-[WKNavigationAction _isUserInitiated]):
625         Return the new ivar.
626
627         * UIProcess/API/Cocoa/WKNavigationActionInternal.h:
628         Remove readwrite overrides.
629
630         * UIProcess/Cocoa/NavigationState.mm:
631         (WebKit::NavigationState::PolicyClient::decidePolicyForNavigationAction):
632         Use initWithNavigationActionData:
633
634         * UIProcess/Cocoa/UIDelegate.mm:
635         (WebKit::UIDelegate::UIClient::createNewPage):
636         Use initWithNavigationActionData:
637
638 2014-05-13  Tim Horton  <timothy_horton@apple.com>
639
640         WebKit2 View Gestures (Swipe): Encode snapshots as JPEG on some platforms
641         https://bugs.webkit.org/show_bug.cgi?id=127788
642         <rdar://problem/15928241>
643
644         Reviewed by Anders Carlsson.
645
646         Allow JPEG snapshots. Compression is done asynchronously.
647         Enable JPEG snapshots (for now) on all PLATFORM(MAC).
648         We'll switch back to IOSurface snapshots on 10.9+ after <rdar://problem/16734031> is resolved.
649
650         * UIProcess/API/Cocoa/WKWebView.mm:
651         * UIProcess/API/mac/WKView.mm:
652         (-[WKView _takeViewSnapshot]):
653         Store the image size on the ViewSnapshot.
654         Move IOSurface-related code to ViewSnapshotStore.
655
656         * UIProcess/ios/ViewGestureControllerIOS.mm:
657         (WebKit::ViewGestureController::beginSwipeGesture):
658         Adopt asLayerContents().
659
660         * UIProcess/mac/ViewGestureController.h:
661         * UIProcess/mac/ViewGestureControllerMac.mm:
662         (WebKit::ViewGestureController::retrieveSnapshotForItem):
663         (WebKit::ViewGestureController::beginSwipeGesture):
664         (WebKit::ViewGestureController::removeSwipeSnapshot):
665         Adopt asLayerContents().
666         Put the snapshot on the right layer (the parent of the snapshot image layer);
667         if it's on the snapshot image layer itself, if there is no image, the shadow
668         is displayed on top of the white placeholder.
669         Only reset snapshot purgeability if we're using IOSurface snapshots.
670
671         * UIProcess/mac/ViewSnapshotStore.h:
672         Add a bunch of macros to allow us to switch the snapshot backing store implementation.
673
674         * UIProcess/mac/ViewSnapshotStore.mm:
675         (WebKit::ViewSnapshotStore::ViewSnapshotStore):
676         (WebKit::ViewSnapshotStore::~ViewSnapshotStore):
677         (WebKit::ViewSnapshotStore::recordSnapshot):
678         If takeViewSnapshot() fails, don't remove the existing snapshot.
679
680         (WebKit::createIOSurfaceFromImage):
681         (WebKit::compressImageAsJPEG):
682         (WebKit::ViewSnapshotStore::reduceSnapshotMemoryCost):
683         (WebKit::ViewSnapshotStore::didCompressSnapshot):
684         (WebKit::ViewSnapshot::clearImage):
685         (WebKit::ViewSnapshot::asLayerContents):
686         Asynchronously compress snapshots - if we're using JPEG snapshots - for a
687         very large memory win (~20-30x).
688
689 2014-05-12  Darin Adler  <darin@apple.com>
690
691         Make a few icon database improvements
692         https://bugs.webkit.org/show_bug.cgi?id=132812
693
694         Reviewed by Brady Eidson.
695
696         * UIProcess/API/C/WKIconDatabase.cpp:
697         (WKIconDatabaseCopyIconDataForPageURL): Moved the actual implementation of this
698         out of the bindings into the WebIconDatabase class.
699
700         * UIProcess/API/C/WKIconDatabase.h: Fixed argument names that were inconsistent.
701
702         * UIProcess/WebIconDatabase.cpp: Removed unneeded includes.
703         (WebKit::WebIconDatabase::create): Pass a reference instead of a pointer.
704         (WebKit::WebIconDatabase::WebIconDatabase): Take a reference instead of a pointer.
705         (WebKit::WebIconDatabase::invalidate): Use nullptr.
706         (WebKit::WebIconDatabase::setDatabasePath): Use make_unique.
707         (WebKit::WebIconDatabase::setIconDataForIconURL): Removed unneeded local variable.
708         (WebKit::WebIconDatabase::imageForPageURL): Use nullptr.
709         (WebKit::WebIconDatabase::nativeImageForPageURL): Ditto.
710         (WebKit::WebIconDatabase::didFinishURLImport): Use a modern for loop.
711         (WebKit::WebIconDatabase::iconDataForPageURL): Added. Moved this here from
712         WKIconDatabase.cpp, but also changed to use createWithoutCopying to avoid making
713         another copy of the data for each icon.
714
715         * UIProcess/WebIconDatabase.h: Removed unneeded includes. Derive from
716         IconDatabaseClient privately. Use nullptr. Added iconDataForPageURL member
717         function. Use a reference for the constructor argument. Use override for
718         virtual functions. Use unique_ptr instead of OwnPtr.
719
720 2014-05-12  Mark Lam  <mark.lam@apple.com>
721
722         WebKit2 on iOS needs to capture the main thread's floating point environment.
723         <https://webkit.org/b/132755>
724
725         Reviewed by Geoffrey Garen.
726
727         * Shared/mac/ChildProcessMac.mm:
728         (WebKit::ChildProcess::platformInitialize):
729         - Call FloatingPointEnv::enableNeededFloatingPointModes() to initialize
730           the ARMv7 FP env to support denormalized numbers.
731         - Call FloatingPointEnv::saveMainThreadEnvironment() to capture the main thread
732           fp env.
733
734 2014-05-12  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
735
736         [EFL][WK2] Fix ewk_view_navigation test in EWK2ViewTest 
737         https://bugs.webkit.org/show_bug.cgi?id=132817
738
739         Reviewed by Dirk Schulze.
740
741         To load test html pages, call ewk_view_uri_set() instead of EWK2UnitTestServer.
742         Besides this patch adds test html page for ewk_view_navigation unit test.
743
744         * UIProcess/API/efl/tests/resources/Page1.html: Added.
745         * UIProcess/API/efl/tests/resources/Page2.html: Added.
746         * UIProcess/API/efl/tests/resources/Page3.html: Added.
747         * UIProcess/API/efl/tests/test_ewk2_view.cpp:
748         (TEST_F):
749
750 2014-05-12  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
751
752         Unreviewed, EFL build fix since r168625.
753
754         * UIProcess/efl/WebContextEfl.cpp:
755         (WebKit::WebContext::platformDefaultLocalStorageDirectory): Remove const keyword.
756
757 2014-05-12  Simon Fraser  <simon.fraser@apple.com>
758
759         [iOS WK2] Fuzzy tiles on some sites on loading
760         https://bugs.webkit.org/show_bug.cgi?id=132847
761         <rdar://problem/16816178>
762
763         Reviewed by Benjamin Poulain.
764         
765         PlatformCALayerRemoteTiledBacking overrode setContentsScale() but not contentsScale(),
766         causing us to early-return from GraphicsLayerCA::updateContentsScale() and leave the
767         scale wrong. Fix by overriding contentsScale() also.
768
769         * WebProcess/WebPage/mac/PlatformCALayerRemoteTiledBacking.cpp:
770         (WebKit::PlatformCALayerRemoteTiledBacking::contentsScale):
771         * WebProcess/WebPage/mac/PlatformCALayerRemoteTiledBacking.h:
772
773 2014-05-12  Tim Horton  <timothy_horton@apple.com>
774
775         Triple-buffer RemoteLayerBackingStore
776         https://bugs.webkit.org/show_bug.cgi?id=132786
777         <rdar://problem/16877498>
778
779         Reviewed by Simon Fraser.
780
781         We need three buffers because we're currently unable to synchronize
782         with the render server to swap when they're not in use, so we were
783         throwing surfaces away far too frequently.
784
785         This hugely reduces time spent in IOSurface::create on various repaint benchmarks.
786
787         * Shared/mac/RemoteLayerBackingStore.h:
788         (WebKit::RemoteLayerBackingStore::hasFrontBuffer):
789         (WebKit::RemoteLayerBackingStore::volatility): Deleted.
790         * Shared/mac/RemoteLayerBackingStore.mm:
791         (WebKit::RemoteLayerBackingStore::RemoteLayerBackingStore):
792         (WebKit::RemoteLayerBackingStore::clearBackingStore):
793         (WebKit::RemoteLayerBackingStore::encode):
794         (WebKit::RemoteLayerBackingStore::decode):
795         (WebKit::RemoteLayerBackingStore::swapToValidFrontBuffer):
796         (WebKit::RemoteLayerBackingStore::display):
797         (WebKit::RemoteLayerBackingStore::applyBackingStoreToLayer):
798         (WebKit::RemoteLayerBackingStore::setBufferVolatility):
799         (WebKit::RemoteLayerBackingStore::Buffer::discard):
800         (WebKit::RemoteLayerBackingStore::setVolatility): Deleted.
801         * Shared/mac/RemoteLayerBackingStoreCollection.mm:
802         (WebKit::RemoteLayerBackingStoreCollection::purgeabilityTimerFired):
803         Put the ShareableBitmap/IOSurface and a volatility bit in a Buffer struct.
804         Also factor out "throw away this buffer and put it in the pool" into Buffer::discard().
805         We keep a volatility bit because querying IOSurface purgeability is expensive,
806         and we have a guarantee that any changes will happen in the Web process
807         and go through this class (the lack of this guarantee in most cases is why I'm not
808         putting this bit in WebCore::IOSurface itself).
809
810         Make it so that each buffer's volatility can be adjusted individually
811         by setBufferVolatility(), and adopt in RemoteLayerBackingStoreCollection.
812
813         Add a third buffer, m_secondaryBackBuffer, which will swap with the back buffer
814         before swapping front and back if the back buffer (soon to be the front buffer)
815         is still in use by the render server. This means that we will almost never
816         have to throw away a surface because it's in use (and conversely never need
817         to make a new surface).
818
819         Adjust RemoteLayerBackingStoreCollection to make secondary back surfaces purgeable
820         more aggressively than others.
821
822 2014-05-12  Alexey Proskuryakov  <ap@apple.com>
823
824         REGRESSION (r165972): Can't type into text fields in Flash
825         https://bugs.webkit.org/show_bug.cgi?id=132840
826         <rdar://problem/16671969>
827
828         Reviewed by Anders Carlsson.
829
830         * UIProcess/API/mac/WKView.mm: (-[WKView inputContext]): Restore a function that
831         got accidentally lost when adding async text input code.
832
833 2014-05-12  Chris Fleizach  <cfleizach@apple.com>
834
835         AX: .js dialogs shown in unload while AX is running crash WebKit.
836         https://bugs.webkit.org/show_bug.cgi?id=123828
837
838         Reviewed by Anders Carlsson.
839
840         Utilize platform API to inform AX clients when the WebProcess will suspend and resume.
841         This allows us to avoid having special behavior for accessibility when the WebProcess needs
842         to wait on a reply.
843
844         * Platform/IPC/Connection.cpp:
845         (IPC::Connection::waitForSyncReply):
846         * Platform/IPC/Connection.h:
847         * Platform/IPC/mac/ConnectionMac.cpp:
848         (IPC::Connection::willSendSyncMessage):
849         (IPC::Connection::didReceiveSyncReply):
850         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
851         (WebKit::WebChromeClient::runBeforeUnloadConfirmPanel):
852         (WebKit::WebChromeClient::runJavaScriptAlert):
853         (WebKit::WebChromeClient::runJavaScriptConfirm):
854         (WebKit::WebChromeClient::runJavaScriptPrompt):
855         (WebKit::WebChromeClient::print):
856         (WebKit::WebChromeClient::exceededDatabaseQuota):
857         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
858         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):
859
860 2014-05-12  Alex Christensen  <achristensen@webkit.org>
861
862         Progress on web timing.
863         https://bugs.webkit.org/show_bug.cgi?id=132574
864
865         Reviewed by Alexey Proskuryakov.
866
867         * Shared/WebCoreArgumentCoders.cpp:
868         (IPC::ArgumentCoder<ResourceResponse>::encode):
869         (IPC::ArgumentCoder<ResourceResponse>::decode):
870         Transfer ResourceLoadTiming values if they exist.
871
872 2014-05-12  Dan Bernstein  <mitz@apple.com>
873
874         [Cocoa] Expose WebPage::usesEphemeralSession to the bundle
875         https://bugs.webkit.org/show_bug.cgi?id=132836
876
877         Reviewed by Anders Carlsson.
878
879         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
880         (-[WKWebProcessPlugInBrowserContextController _usesNonPersistentWebsiteDataStore]):
881         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextControllerPrivate.h:
882
883 2014-05-12  Carlos Alberto Lopez Perez  <clopez@igalia.com>
884
885         REGRESSION(168625): [GTK] build broken due to WKContextSetLocalStorageDirectory
886         https://bugs.webkit.org/show_bug.cgi?id=132831
887
888         Unreviewed GTK build fix.
889
890         * UIProcess/gtk/WebContextGtk.cpp:
891         (WebKit::WebContext::platformDefaultLocalStorageDirectory):
892         This is now a static member function.
893
894 2014-05-12  Anders Carlsson  <andersca@apple.com>
895
896         WKWebViewConfiguration should fill in the blanks
897         https://bugs.webkit.org/show_bug.cgi?id=132832
898         <rdar://problem/16886408>
899
900         Reviewed by Dan Bernstein.
901
902         * UIProcess/API/Cocoa/WKWebView.mm:
903         (-[WKWebView initWithFrame:configuration:]):
904         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
905         (-[WKWebViewConfiguration init]):
906         (-[WKWebViewConfiguration _validate]):
907         * UIProcess/API/Cocoa/WKWebViewConfigurationInternal.h:
908
909 2014-05-12  Anders Carlsson  <andersca@apple.com>
910
911         WKWebView should default to _backgroundExtendsBeyondPage = YES
912         https://bugs.webkit.org/show_bug.cgi?id=132829
913         <rdar://problem/16886364>
914
915         Reviewed by Beth Dakin.
916
917         * UIProcess/API/Cocoa/WKWebView.mm:
918         (-[WKWebView initWithFrame:configuration:]):
919
920 2014-05-12  Anders Carlsson  <andersca@apple.com>
921
922         Pass local storage directory to StorageManager::create
923         https://bugs.webkit.org/show_bug.cgi?id=132827
924
925         Reviewed by Tim Horton.
926
927         Since we know the local storage directory at creation time and we know it never changes,
928         we can get rid of setLocalStorageDirectory and just pass the local storage directory at creation time.
929
930         * UIProcess/Storage/LocalStorageDatabaseTracker.cpp:
931         (WebKit::LocalStorageDatabaseTracker::create):
932         (WebKit::LocalStorageDatabaseTracker::LocalStorageDatabaseTracker):
933         (WebKit::LocalStorageDatabaseTracker::~LocalStorageDatabaseTracker):
934         (WebKit::LocalStorageDatabaseTracker::setLocalStorageDirectory): Deleted.
935         (WebKit::LocalStorageDatabaseTracker::setLocalStorageDirectoryInternal): Deleted.
936         * UIProcess/Storage/LocalStorageDatabaseTracker.h:
937         * UIProcess/Storage/StorageManager.cpp:
938         (WebKit::StorageManager::create):
939         (WebKit::StorageManager::StorageManager):
940         (WebKit::StorageManager::setLocalStorageDirectory): Deleted.
941         * UIProcess/Storage/StorageManager.h:
942         * UIProcess/WebContext.cpp:
943         (WebKit::WebContext::WebContext):
944
945 2014-05-11  Anders Carlsson  <andersca@apple.com>
946
947         Replace WKContextSetLocalStorageDirectory with a context configuration getter/setter
948         https://bugs.webkit.org/show_bug.cgi?id=132809
949
950         Reviewed by Dan Bernstein.
951
952         * UIProcess/API/C/WKContext.cpp:
953         (WKContextSetLocalStorageDirectory): Deleted.
954
955         * UIProcess/API/C/WKContextConfigurationRef.cpp:
956         (WKContextConfigurationCopyLocalStorageDirectory):
957         (WKContextConfigurationSetLocalStorageDirectory):
958         * UIProcess/API/C/WKContextConfigurationRef.h:
959         Add getters and setters for the local storage directory.
960
961         * UIProcess/API/C/WKContextPrivate.h:
962         Remove WKContextSetLocalStorageDirectory.
963
964         * UIProcess/API/Cocoa/WKProcessGroup.mm:
965         (-[WKProcessGroup initWithInjectedBundleURL:]):
966         Call WebContext::applyPlatformSpecificConfigurationDefaults.
967
968         * UIProcess/API/Cocoa/WKProcessPool.mm:
969         (-[WKProcessPool _initWithConfiguration:]):
970         Call WebContext::applyPlatformSpecificConfigurationDefaults (for now).
971
972         * UIProcess/APIContextConfiguration.cpp:
973         (API::ContextConfiguration::webContextConfiguration):
974         Set the local storage. Also, call WebContext::applyPlatformSpecificConfigurationDefaults.
975
976         * UIProcess/APIContextConfiguration.h:
977         (API::ContextConfiguration::injectedBundlePath):
978         This should be const.
979
980         (API::ContextConfiguration::localStorageDirectory):
981         (API::ContextConfiguration::setLocalStorageDirectory):
982         Add getter and setter.
983
984         * UIProcess/Storage/StorageManager.cpp:
985         (WebKit::StorageManager::setLocalStorageDirectory):
986         ASSERT that the path isn't null.
987
988         * UIProcess/WebContext.cpp:
989         (WebKit::WebContext::applyPlatformSpecificConfigurationDefaults):
990         New helper function that will fill in platform specific defaults for empty parameters.
991
992         (WebKit::WebContext::WebContext):
993         Get the local storage directory from the configuration.
994
995         (WebKit::WebContext::setLocalStorageDirectory): Deleted.
996         (WebKit::WebContext::localStorageDirectory): Deleted.
997         These are no longer needed.
998
999         * UIProcess/mac/WebContextMac.mm:
1000         (WebKit::WebContext::platformDefaultLocalStorageDirectory):
1001         This should be a static member function.
1002
1003 2014-05-12  Martin Hodovan  <mhodovan.u-szeged@partner.samsung.com>
1004
1005         Typo fix in generate-forwarding-headers
1006         https://bugs.webkit.org/show_bug.cgi?id=132820
1007
1008         Reviewed by Anders Carlsson.
1009
1010         * Scripts/generate-forwarding-headers.pl:
1011         (collectFrameworkHeaderPaths):
1012         
1013 2014-05-12  Peter Molnar  <pmolnar.u-szeged@partner.samsung.com>
1014
1015         [EFL] TLSErrors do not cause page load to fail when not ignored
1016         https://bugs.webkit.org/show_bug.cgi?id=131104
1017
1018         Reviewed by Gyuyoung Kim.
1019
1020         Added EFL unit test for the bug https://bugs.webkit.org/show_bug.cgi?id=121548
1021
1022         * UIProcess/API/efl/tests/test_ewk2_ssl.cpp: Added new test: ewk_ssl_bad_cert_redirect_https_to_http
1023
1024 2014-05-11  Gordon Sheridan  <gordon_sheridan@apple.com>
1025
1026         Expose a function to copy favicon data without image conversion.
1027         https://bugs.webkit.org/show_bug.cgi?id=132805
1028
1029         Reviewed by Darin Adler.
1030
1031         * UIProcess/API/C/WKIconDatabase.cpp:
1032         (WKIconDatabaseCopyIconDataForPageURL):
1033         Add a function to copy the data from the image of a favicon for an associated page url.
1034
1035         * UIProcess/API/C/WKIconDatabase.h:
1036         Declare WKIconDatabaseCopyIconDataForPageURL.
1037
1038 2014-05-11  Seongjun Kim  <isAir@company100.com>
1039
1040         REGRESSION(r168603): [GTK] Build broken.
1041         https://bugs.webkit.org/show_bug.cgi?id=132810
1042
1043         Reviewed by Carlos Garcia Campos.
1044
1045         * UIProcess/API/gtk/WebKitWebContext.cpp:
1046         (createDefaultWebContext):
1047         Construct a WebContextConfiguration object and pass it to WebContext::create.
1048
1049 2014-05-11  Anders Carlsson  <andersca@apple.com>
1050
1051         Remove local storage directory and sandbox extension from WebProcessCreationParameters
1052         https://bugs.webkit.org/show_bug.cgi?id=132808
1053
1054         Reviewed by Beth Dakin.
1055
1056         * Shared/WebProcessCreationParameters.cpp:
1057         (WebKit::WebProcessCreationParameters::encode):
1058         (WebKit::WebProcessCreationParameters::decode):
1059         * Shared/WebProcessCreationParameters.h:
1060         * UIProcess/WebContext.cpp:
1061         (WebKit::WebContext::createNewWebProcess):
1062         * WebProcess/cocoa/WebProcessCocoa.mm:
1063         (WebKit::WebProcess::platformInitializeWebProcess):
1064
1065 2014-05-11  Jaehun Lim  <ljaehun.lim@samsung.com>
1066
1067         Unreviewed, CMake build fix after r168603
1068
1069         Add APIContextConfiguration.cpp and WKContextConfigurationRef.cpp to the source list.
1070
1071         * CMakeLists.txt:
1072
1073 2014-05-11  Anders Carlsson  <andersca@apple.com>
1074
1075         Add a WKContextConfigurationRef object and make the injected bundle path part of the configuration
1076         https://bugs.webkit.org/show_bug.cgi?id=132806
1077         <rdar://problem/16830143>
1078
1079         Reviewed by Beth Dakin.
1080
1081         Many setters on WKContextRef really only make sense to set early on, so move to a pattern where we create a
1082         configuration object, a WKContextConfiguration which WKContexts can be created from. Add the injected bundle path
1083         as a configuration property. More setters will follow.
1084
1085         * Shared/API/c/WKBase.h:
1086         Add WKContextConfigurationRef.
1087
1088         * Shared/APIObject.h:
1089         Add ContextConfiguration enum declaration.
1090
1091         * UIProcess/API/C/WKAPICast.h:
1092         Handle WKContextConfigurationRef.
1093
1094         * UIProcess/API/C/WKContext.cpp:
1095         (WKContextCreate):
1096         Create an empty WKContextConfigurationRef object and pass it to WKContextCreateWithConfiguration.
1097
1098         (WKContextCreateWithInjectedBundlePath):
1099         Create a WKContextConfigurationRef object, set its bundle path and pass the configuration to WKContextCreateWithConfiguration.
1100
1101         (WKContextCreateWithConfiguration):
1102         Convert the WKContextConfigurationRef object to a WebContextConfiguration and pass it to WebContext::create.
1103
1104         * UIProcess/API/C/WKContext.h:
1105         Add WKContextCreateWithConfiguration.
1106
1107         * UIProcess/API/C/WKContextConfigurationRef.cpp: Added.
1108         (WKContextConfigurationCreate):
1109         Create an API::ContextConfiguration object.
1110
1111         (WKContextConfigurationCopyInjectedBundlePath):
1112         Return the injected bundle path.
1113
1114         (WKContextConfigurationSetInjectedBundlePath):
1115         Set the injected bundle path.
1116
1117         * UIProcess/API/C/WKContextConfigurationRef.h: Added.
1118         New C SPI header.
1119         
1120         * UIProcess/API/Cocoa/WKProcessGroup.mm:
1121         (-[WKProcessGroup initWithInjectedBundleURL:]):
1122         Construct a WebContextConfiguration object and pass it to WebContext::Create.
1123     
1124         * UIProcess/API/Cocoa/WKProcessPool.mm:
1125         (-[WKProcessPool _initWithConfiguration:]):
1126         Construct a WebContextConfiguration object and pass it to WebContext::Create.
1127
1128         * UIProcess/APIContextConfiguration.cpp: Added.
1129         New API::ContextConfiguration object.
1130
1131         (API::ContextConfiguration::webContextConfiguration):
1132         Construct a WebContextConfiguration struct from our current configuration.
1133
1134         * UIProcess/APIContextConfiguration.h: Added.
1135         
1136         * UIProcess/WebContext.cpp:
1137         (WebKit::WebContext::create):
1138         Pass the WebContextConfiguration to the constructor.
1139
1140         (WebKit::WebContext::WebContext):
1141         Set the injected bundle path from the WebContextConfiguration object.
1142
1143         * UIProcess/WebContext.h:
1144         Change the WebContext constructor and create function to take a WebContextConfiguration object.
1145
1146         * WebKit2.xcodeproj/project.pbxproj:
1147         Add new files.
1148
1149 2014-05-10  Csaba Osztrogonác  <ossy@webkit.org>
1150
1151         [WK2] URTBF after r168585.
1152
1153         * Platform/IPC/Connection.h:
1154         * Shared/ChildProcessProxy.cpp:
1155         (WebKit::ChildProcessProxy::terminate):
1156
1157 2014-05-10  Tim Horton  <timothy_horton@apple.com>
1158
1159         [WKWebView _updateScrollViewBackground] churns UI-and-CGColors while repainting
1160         https://bugs.webkit.org/show_bug.cgi?id=132793
1161         <rdar://problem/16877870>
1162
1163         Reviewed by Dan Bernstein.
1164
1165         * UIProcess/API/Cocoa/WKWebView.mm:
1166         (-[WKWebView _updateScrollViewBackground]):
1167         Don't bypass the cache and make a copy of the CGColor just to set its alpha.
1168         Cache the last color and don't bother creating a UIColor nor updating the
1169         color on our views if it hasn't changed.
1170
1171 2014-05-10  Tim Horton  <timothy_horton@apple.com>
1172
1173         Implement -forwardingTargetForSelector on WKScrollViewDelegateForwarder
1174         https://bugs.webkit.org/show_bug.cgi?id=132790
1175         <rdar://problem/16877802>
1176
1177         Reviewed by Dan Bernstein.
1178
1179         * UIProcess/ios/WKScrollView.mm:
1180         (-[WKScrollViewDelegateForwarder forwardingTargetForSelector:]):
1181         If only one of the delegates will respond to a selector,
1182         we can return it from forwardingTargetForSelector: to avoid
1183         NSInvocation overhead.
1184
1185 2014-05-10  Dan Bernstein  <mitz@apple.com>
1186
1187         [Mac] Some targets that link or soft-link WebKit.framework don't depend on it
1188         https://bugs.webkit.org/show_bug.cgi?id=132776
1189
1190         Reviewed by Darin Adler.
1191
1192         * WebKit2.xcodeproj/project.pbxproj:
1193
1194 2014-05-10  Ryuan Choi  <ryuan.choi@samsung.com>
1195
1196         [EFL][WK2] Move the ownership of EwkSettings from EwkView to EwkPageGroup
1197         https://bugs.webkit.org/show_bug.cgi?id=132771
1198
1199         Reviewed by Gyuyoung Kim.
1200
1201         Moved ownership of EwkSettings from EwkView to EwkPageGroup.
1202
1203         * UIProcess/API/efl/EwkView.cpp:
1204         (EwkView::EwkView):
1205         * UIProcess/API/efl/EwkView.h:
1206         (EwkView::settings): Deleted.
1207         * UIProcess/API/efl/ewk_page_group.cpp:
1208         (EwkPageGroup::EwkPageGroup):
1209         * UIProcess/API/efl/ewk_page_group_private.h:
1210         (EwkPageGroup::settings):
1211         * UIProcess/API/efl/ewk_settings_private.h:
1212         * UIProcess/API/efl/ewk_view.cpp:
1213         (ewk_view_settings_get):
1214
1215 2014-05-10  Tim Horton  <timothy_horton@apple.com>
1216
1217         [iOS WebKit2] REGRESSION (r168493): Canvasmark 2013 benchmark always hits the RELEASE_ASSERT in RemoteLayerTreeDrawingArea::flushLayers()
1218         https://bugs.webkit.org/show_bug.cgi?id=132783
1219         <rdar://problem/16877326>
1220
1221         Reviewed by Anders Carlsson.
1222
1223         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
1224         (WebKit::RemoteLayerTreeDrawingArea::BackingStoreFlusher::flush):
1225         There's a race window between the BackingStoreFlusher sending the new
1226         layer tree to the UI process and updating m_hasFlushed where we can
1227         get a reply back in (on the Web process main thread) from the UI process
1228         that we committed the new layer tree (didUpdate).
1229         This will cause the RELEASE_ASSERT in flushLayers() to fire incorrectly.
1230         Since the RELEASE_ASSERT is there only to avoid painting garbage, move
1231         our code to set m_hasFlushed=true to after we finish calling CGContextFlush
1232         on all of the contexts, instead of after we send the layer tree commit message,
1233         which will remove the race entirely.
1234
1235 2014-05-10  Anders Carlsson  <andersca@apple.com>
1236
1237         ASSERTION FAILED: !m_connection under RunJavaScriptAlert
1238         https://bugs.webkit.org/show_bug.cgi?id=132792
1239         <rdar://problem/16691138>
1240
1241         Reviewed by Dan Bernstein.
1242
1243         Detect if someone implementing a UI delegate method with a completion handler never calls the completion
1244         handler and raise an exception instead of asserting.
1245
1246         * UIProcess/Cocoa/UIDelegate.mm:
1247         (WebKit::CompletionHandlerCallChecker::create):
1248         (WebKit::CompletionHandlerCallChecker::~CompletionHandlerCallChecker):
1249         (WebKit::CompletionHandlerCallChecker::didCallCompletionHandler):
1250         (WebKit::CompletionHandlerCallChecker::CompletionHandlerCallChecker):
1251         (WebKit::CompletionHandlerCallChecker::classImplementingDelegateMethod):
1252         (WebKit::UIDelegate::UIClient::runJavaScriptAlert):
1253         (WebKit::UIDelegate::UIClient::runJavaScriptConfirm):
1254         (WebKit::UIDelegate::UIClient::runJavaScriptPrompt):
1255
1256 2014-05-10  Anders Carlsson  <andersca@apple.com>
1257
1258         Use xpc_connection_kill for killing child processes where appropriate
1259         https://bugs.webkit.org/show_bug.cgi?id=132788
1260         <rdar://problem/16664185>
1261
1262         Reviewed by Sam Weinig.
1263
1264         * Platform/IPC/Connection.h:
1265         * Platform/IPC/mac/ConnectionMac.mm:
1266         (IPC::Connection::kill):
1267         * Platform/IPC/mac/XPCPtr.h:
1268         (IPC::XPCPtr::operator bool):
1269         * Shared/ChildProcessProxy.cpp:
1270         (WebKit::ChildProcessProxy::terminate):
1271
1272 2014-05-10  Anders Carlsson  <andersca@apple.com>
1273
1274         WebKit2 is leaking an xpc_connection per web process it creates
1275         https://bugs.webkit.org/show_bug.cgi?id=132785
1276         <rdar://problem/14912160>
1277
1278         Reviewed by Sam Weinig.
1279
1280         Introduce an IPC::XPCPtr smart pointer class and use it for XPC connections inside Connection::Identifier and Connection itself.
1281
1282         Make sure we always adopt any connections that are created.
1283
1284         * DatabaseProcess/EntryPoint/mac/XPCService/DatabaseServiceEntryPoint.mm:
1285         (DatabaseServiceInitializer):
1286         * NetworkProcess/EntryPoint/mac/XPCService/NetworkServiceEntryPoint.mm:
1287         (WebKit::NetworkServiceInitializerDelegate::NetworkServiceInitializerDelegate):
1288         (NetworkServiceInitializer):
1289         * Platform/IPC/Connection.h:
1290         (IPC::Connection::Identifier::Identifier):
1291         (IPC::Connection::xpcConnection):
1292         * Platform/IPC/mac/ConnectionMac.mm:
1293         (IPC::Connection::platformInvalidate):
1294         (IPC::Connection::platformInitialize):
1295         (IPC::Connection::getAuditToken):
1296         * Platform/IPC/mac/XPCPtr.h: Added.
1297         (IPC::XPCPtr::XPCPtr):
1298         (IPC::XPCPtr::~XPCPtr):
1299         (IPC::XPCPtr::get):
1300         (IPC::XPCPtr::operator!):
1301         (IPC::XPCPtr::operator=):
1302         (IPC::adoptXPC):
1303         * PluginProcess/EntryPoint/mac/XPCService/PluginServiceEntryPoint.mm:
1304         (WebKit::PluginServiceInitializerDelegate::PluginServiceInitializerDelegate):
1305         (PluginServiceInitializer):
1306         * Shared/EntryPointUtilities/mac/LegacyProcess/ChildProcessMain.mm:
1307         (WebKit::BootstrapMain):
1308         * Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.h:
1309         (WebKit::XPCServiceInitializerDelegate::XPCServiceInitializerDelegate):
1310         (WebKit::XPCServiceInitializer):
1311         * Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.mm:
1312         (WebKit::XPCServiceInitializerDelegate::hasEntitlement):
1313         (WebKit::XPCServiceInitializerDelegate::isClientSandboxed):
1314         * Shared/EntryPointUtilities/mac/XPCService/XPCServiceMain.Development.mm:
1315         (WebKit::XPCServiceEventHandler):
1316         * Shared/EntryPointUtilities/mac/XPCService/XPCServiceMain.mm:
1317         (WebKit::XPCServiceEventHandler):
1318         * UIProcess/Launcher/ProcessLauncher.cpp:
1319         (WebKit::ProcessLauncher::didFinishLaunchingProcess):
1320         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
1321         (WebKit::connectToService):
1322         * WebKit2.xcodeproj/project.pbxproj:
1323         * WebProcess/EntryPoint/mac/XPCService/WebContentServiceEntryPoint.mm:
1324         (WebContentServiceInitializer):
1325
1326 2014-05-10  Anders Carlsson  <andersca@apple.com>
1327
1328         Simplify createDataAvailableSource
1329         https://bugs.webkit.org/show_bug.cgi?id=132782
1330         <rdar://problem/16815202>
1331
1332         Reviewed by Sam Weinig.
1333
1334         * Platform/IPC/mac/ConnectionMac.mm: Renamed from Source/WebKit2/Platform/IPC/mac/ConnectionMac.cpp.
1335         Rename to make this Objective-C++ so we get the lambda-to-block conversion.
1336
1337         (IPC::createDataAvailableSource):
1338         Make this a function template and just pass the function directly to dispatch_source_set_event_handler.
1339
1340         (IPC::Connection::open):
1341         Use lambdas instead of WTF::bind, so we'll make sure the connection is kept alive.
1342
1343         * WebKit2.xcodeproj/project.pbxproj:
1344         Update for ConnectionMac.cpp to ConnectionMac.mm rename.
1345
1346 2014-05-10  Anders Carlsson  <andersca@apple.com>
1347
1348         Follow-up fix.
1349
1350         Reviewed by Darin Adler.
1351
1352         * UIProcess/API/Cocoa/WKNavigationResponse.h:
1353         * UIProcess/API/Cocoa/WKNavigationResponse.mm:
1354         (-[WKNavigationResponse isForMainFrame]):
1355         Use a slightly better name.
1356
1357 2014-05-10  Anders Carlsson  <andersca@apple.com>
1358
1359         Make -[WKNavigationResponse frame] SPI and only expose -[WKNavigationResponse isMainFrame]
1360         https://bugs.webkit.org/show_bug.cgi?id=132781
1361         <rdar://problem/16868319>
1362
1363         Reviewed by Darin Adler.
1364
1365         * UIProcess/API/Cocoa/WKNavigationResponse.h:
1366         * UIProcess/API/Cocoa/WKNavigationResponse.mm:
1367         (-[WKNavigationResponse description]):
1368         (-[WKNavigationResponse isMainFrameNavigation]):
1369         (-[WKNavigationResponse _frame]):
1370         (-[WKNavigationResponse frame]): Deleted.
1371         (-[WKNavigationResponse setFrame:]): Deleted.
1372         * UIProcess/API/Cocoa/WKNavigationResponseInternal.h:
1373         * UIProcess/API/Cocoa/WKNavigationResponsePrivate.h: Added.
1374         * UIProcess/Cocoa/NavigationState.mm:
1375         (WebKit::NavigationState::PolicyClient::decidePolicyForResponse):
1376         * WebKit2.xcodeproj/project.pbxproj:
1377
1378 2014-05-09  Dan Bernstein  <mitz@apple.com>
1379
1380         [Cocoa] Remove a deprecated bundle form delegate method now that no one implements it
1381         https://bugs.webkit.org/show_bug.cgi?id=132769
1382
1383         Reviewed by Sam Weinig.
1384
1385         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
1386         (-[WKWebProcessPlugInBrowserContextController _setFormDelegate:]):
1387
1388 2014-05-09  Benjamin Poulain  <bpoulain@apple.com>
1389
1390         [iOS][WK2] Fix bugs exposed by r168556
1391         https://bugs.webkit.org/show_bug.cgi?id=132768
1392
1393         Reviewed by Ryosuke Niwa.
1394
1395         Fix two bugs exposed by r168556.
1396         1) We were only changing the page scale factor when the scale was not adjusted by live
1397            resize. The idea was that the scale would either be the same (responsive content)
1398            or that it would be defined by the next viewContentRectUpdate.
1399
1400            Now that we also send resize and scroll events, we must always update the scale since
1401            it affects some APIs observable from JavaScript (like scrolling bounds).
1402
1403         2) Internally, Page's scaleFactor is stored as a float and not double. The rounding error
1404            were causing us to send DynamicViewportUpdateChangedTarget() in cases were there is no change
1405            of target.
1406
1407         * WebProcess/WebPage/ios/WebPageIOS.mm:
1408         (WebKit::withinEpsilon):
1409         (WebKit::WebPage::dynamicViewportSizeUpdate):
1410
1411 2014-05-09  Ryuan Choi  <ryuan.choi@samsung.com>
1412
1413         [EFL][WK2] Close icondatabase when EwkFaviconDatabase is destroyed
1414         https://bugs.webkit.org/show_bug.cgi?id=132767
1415
1416         Reviewed by Gyuyoung Kim.
1417
1418         IconDatabase should be closed explicitly.
1419
1420         * UIProcess/API/efl/ewk_favicon_database.cpp:
1421         (EwkFaviconDatabase::~EwkFaviconDatabase):
1422
1423 2014-05-09  Anders Carlsson  <andersca@apple.com>
1424
1425         Another build fix.
1426
1427         * mac/MigrateHeadersToWebKit2.make:
1428         Don't migrate the WKPreferences.h header, WebKit2 provides its own header.
1429
1430 2014-05-09  Benjamin Poulain  <benjamin@webkit.org>
1431
1432         [iOS][WK2] Reset the scroll position on the first frame after didCommitLoad
1433         https://bugs.webkit.org/show_bug.cgi?id=132765
1434
1435         Reviewed by Tim Horton.
1436
1437         Since WebCore does not update our scroll view on load, we need to do that ourself.
1438
1439         In case where we need to restore the state from the history, RemoteLayerTreeDrawingAreaProxy
1440         will always invoke the scrolling after didCommitLayerTree() (since r167916).
1441         Consequently, it is now safe again to reset the scroll position ourself on the first frame.
1442
1443         * UIProcess/API/Cocoa/WKWebView.mm:
1444         (-[WKWebView _didCommitLoadForMainFrame]):
1445         (-[WKWebView _didCommitLayerTree:WebKit::]):
1446         * UIProcess/API/Cocoa/WKWebViewInternal.h:
1447         * UIProcess/ios/WKContentView.mm:
1448         (-[WKContentView _didCommitLoadForMainFrame]):
1449
1450 2014-05-09  Anders Carlsson  <andersca@apple.com>
1451
1452         Update availability macros
1453         https://bugs.webkit.org/show_bug.cgi?id=132763
1454         <rdar://problem/15311800>
1455
1456         Reviewed by Dan Bernstein.
1457
1458         * Configurations/WebKit.xcconfig:
1459         * Shared/API/Cocoa/WKBrowsingContextHandle.h:
1460         * Shared/API/Cocoa/WKFoundation.h:
1461         * Shared/API/Cocoa/_WKFrameHandle.h:
1462         * Shared/API/Cocoa/_WKRemoteObjectInterface.h:
1463         * Shared/API/Cocoa/_WKRemoteObjectRegistry.h:
1464         * UIProcess/API/Cocoa/WKBackForwardList.h:
1465         * UIProcess/API/Cocoa/WKBackForwardListItem.h:
1466         * UIProcess/API/Cocoa/WKBackForwardListPrivate.h:
1467         * UIProcess/API/Cocoa/WKBrowsingContextController.h:
1468         * UIProcess/API/Cocoa/WKBrowsingContextGroup.h:
1469         * UIProcess/API/Cocoa/WKConnection.h:
1470         * UIProcess/API/Cocoa/WKFrameInfo.h:
1471         * UIProcess/API/Cocoa/WKNavigation.h:
1472         * UIProcess/API/Cocoa/WKNavigationAction.h:
1473         (NS_ENUM):
1474         * UIProcess/API/Cocoa/WKNavigationData.h:
1475         * UIProcess/API/Cocoa/WKNavigationDelegate.h:
1476         (NS_ENUM):
1477         * UIProcess/API/Cocoa/WKNavigationResponse.h:
1478         * UIProcess/API/Cocoa/WKPreferences.h:
1479         * UIProcess/API/Cocoa/WKProcessGroup.h:
1480         * UIProcess/API/Cocoa/WKProcessPool.h:
1481         * UIProcess/API/Cocoa/WKScriptMessage.h:
1482         * UIProcess/API/Cocoa/WKScriptMessageHandler.h:
1483         * UIProcess/API/Cocoa/WKTypeRefWrapper.h:
1484         * UIProcess/API/Cocoa/WKUIDelegate.h:
1485         * UIProcess/API/Cocoa/WKUserContentController.h:
1486         * UIProcess/API/Cocoa/WKWebView.h:
1487         * UIProcess/API/Cocoa/WKWebViewConfiguration.h:
1488         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1489         (NS_OPTIONS):
1490         (NS_ENUM):
1491         * UIProcess/API/Cocoa/WKWindowFeatures.h:
1492         * UIProcess/API/Cocoa/_WKActivatedElementInfo.h:
1493         (NS_ENUM):
1494         * UIProcess/API/Cocoa/_WKDownload.h:
1495         * UIProcess/API/Cocoa/_WKElementAction.h:
1496         (NS_ENUM):
1497         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
1498         * UIProcess/API/Cocoa/_WKScriptWorld.h:
1499         * UIProcess/API/Cocoa/_WKThumbnailView.h:
1500         * UIProcess/API/Cocoa/_WKVisitedLinkProvider.h:
1501         * UIProcess/API/Cocoa/_WKWebsiteDataStore.h:
1502         * WebKit2.xcodeproj/project.pbxproj:
1503         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFrame.h:
1504         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInHitTestResult.h:
1505         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.h:
1506         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInPageGroup.h:
1507         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInScriptWorld.h:
1508         * WebProcess/InjectedBundle/API/mac/WKDOMDocument.h:
1509         * WebProcess/InjectedBundle/API/mac/WKDOMElement.h:
1510         * WebProcess/InjectedBundle/API/mac/WKDOMNode.h:
1511         * WebProcess/InjectedBundle/API/mac/WKDOMRange.h:
1512         * WebProcess/InjectedBundle/API/mac/WKDOMText.h:
1513         * WebProcess/InjectedBundle/API/mac/WKDOMTextIterator.h:
1514         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugIn.h:
1515         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.h:
1516         * mac/rewrite-availability-macros.sh: Added.
1517
1518 2014-05-09  Joseph Pecoraro  <pecoraro@apple.com>
1519
1520         Web Inspector: Allow Remote Inspector to entitlement check UIProcess through WebProcess
1521         https://bugs.webkit.org/show_bug.cgi?id=132409
1522
1523         Reviewed by Timothy Hatcher.
1524
1525         * WebProcess/WebCoreSupport/WebInspectorClient.h:
1526         * WebProcess/WebCoreSupport/WebInspectorClient.cpp:
1527         (WebKit::WebInspectorClient::parentProcessIdentifier): Deleted.
1528         pid per debuggable is no longer needed.
1529
1530         * WebProcess/WebProcess.cpp:
1531         (WebKit::WebProcess::initializeWebProcess):
1532         Immediately pass the parent process pid and audit_token on
1533         to the RemoteInspector singleton when the process is created
1534         so that it can be sent to webinspectord.
1535
1536 2014-05-09  Enrica Casucci  <enrica@apple.com>
1537
1538         REGRESSION (WebKit2): Tapping in search field at wikipedia.org doesn’t bring up the keyboard.
1539         https://bugs.webkit.org/show_bug.cgi?id=132761
1540         <rdar://problem/16857491>
1541
1542         Reviewed by Benjamin Poulain.
1543
1544         The interactionAssistant accessor should never create an instance of
1545         UIWKTextInteractionAssistant, but simply return the value of _textInteractionAssistant.
1546         The text interaction assistant should only be created when needed so that the rest of
1547         the code could reliably check if we are interacting with text or not.
1548
1549         * UIProcess/ios/WKContentViewInteraction.mm:
1550         (-[WKContentView interactionAssistant]):
1551
1552 2014-05-09  Simon Fraser  <simon.fraser@apple.com>
1553
1554         Fix some issues with scrolling tree logging
1555         https://bugs.webkit.org/show_bug.cgi?id=132762
1556
1557         Reviewed by Tim Horton.
1558         
1559         Only dump viewport constraints when they change, and dump the primary layer on
1560         scrolling nodes.
1561         
1562         * Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp:
1563         (WebKit::RemoteScrollingTreeTextStream::dump): Dump the primary layer.
1564
1565 2014-05-09  Simon Fraser  <simon.fraser@apple.com>
1566
1567         [iOS WK2] Fixed elements can go outside the document on pinching
1568         https://bugs.webkit.org/show_bug.cgi?id=132759
1569         <rdar://problem/16870835>
1570
1571         Reviewed by Benjamin Poulain.
1572         
1573         Constrain the rect used to position fixed position objects when pinching (when
1574         the scale goes below the minimumScale). Do so in such a way that there's a smooth
1575         transition between rubber-banding and pinching.
1576
1577         * UIProcess/API/Cocoa/WKWebView.mm:
1578         (-[WKWebView _updateScrollViewBackground]): Use a nicer form for std::max<>.
1579         (-[WKWebView _updateVisibleContentRects]): Pass the minimum scale.
1580         * UIProcess/API/ios/WKViewIOS.mm:
1581         (-[WKView _updateVisibleContentRects]): Ditto.
1582         * UIProcess/ios/WKContentView.h:
1583         * UIProcess/ios/WKContentView.mm:
1584         (adjustedUnexposedEdge): Helper to adjust the left/top.
1585         (adjustedUnexposedMaxEdge): Helper to adjust the right/bottom.
1586         (fixedPositionRectFromExposedRect):
1587         (-[WKContentView didUpdateVisibleRect:unobscuredRect:scale:minimumScale:inStableState:]):
1588         (-[WKContentView didUpdateVisibleRect:unobscuredRect:scale:inStableState:]): Deleted.
1589
1590 2014-05-09  Zalan Bujtas  <zalan@apple.com>
1591
1592         Subpixel rendering[iOS]: Top bar on apple.com/support jiggles when the swoosh animates.
1593         https://bugs.webkit.org/show_bug.cgi?id=132750
1594         <rdar://problem/16803281>
1595
1596         Reviewed by Simon Fraser.
1597
1598         This patch ensures that GraphicsLayer and RemoteLayerBackingStore have the same dimensions.
1599         
1600         Remove integral enclosing when we set the size on RemoteLayerBackingStore. It makes the layer's size
1601         different from the backingstore when the passed value is fractional.
1602         We scale and integral round this value to size the shareable bitmap later. Rounding ensures that
1603         the final size value matches what we calculated at GraphicsLayerCA::updateGeometry()
1604
1605         Currently not testable.
1606
1607         * Shared/mac/RemoteLayerBackingStore.h:
1608         (WebKit::RemoteLayerBackingStore::size):
1609         * Shared/mac/RemoteLayerBackingStore.mm:
1610         (WebKit::RemoteLayerBackingStore::ensureBackingStore):
1611         (WebKit::RemoteLayerBackingStore::setNeedsDisplay): use enclosing here to ensure we cover the entire backing store.
1612         (WebKit::RemoteLayerBackingStore::display):
1613         (WebKit::RemoteLayerBackingStore::drawInContext):
1614         * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
1615         (WebKit::PlatformCALayerRemote::updateBackingStore):
1616
1617 2014-05-09  Benjamin Poulain  <bpoulain@apple.com>
1618
1619         [iOS][WK2] Set up the resize events
1620         https://bugs.webkit.org/show_bug.cgi?id=132726
1621
1622         Reviewed by Darin Adler and Simon Fraser.
1623
1624         Wire the UI Process updates to FrameView to send the resize events appropriately.
1625
1626         * Shared/VisibleContentRectUpdateInfo.cpp:
1627         (WebKit::VisibleContentRectUpdateInfo::encode):
1628         (WebKit::VisibleContentRectUpdateInfo::decode):
1629         * Shared/VisibleContentRectUpdateInfo.h:
1630         (WebKit::VisibleContentRectUpdateInfo::VisibleContentRectUpdateInfo):
1631         (WebKit::VisibleContentRectUpdateInfo::isChangingObscuredInsetsInteractively):
1632         * UIProcess/API/Cocoa/WKWebView.mm:
1633         (-[WKWebView _updateVisibleContentRects]):
1634         * UIProcess/ios/WKContentView.h:
1635         * UIProcess/ios/WKContentView.mm:
1636         (-[WKContentView didUpdateVisibleRect:unobscuredRect:scale:inStableState:isChangingObscuredInsetsInteractively:]):
1637         (-[WKContentView didUpdateVisibleRect:unobscuredRect:scale:inStableState:]): Deleted.
1638         Pass down the status of the content insets with the view update to main frame's FrameView
1639         when needed.
1640
1641         * WebProcess/WebPage/ios/WebPageIOS.mm:
1642         (WebKit::WebPage::dynamicViewportSizeUpdate):
1643         On live resize, send the resize event, then the scroll events (if needed).
1644
1645         Since JavaScript now gets two chances to change the content (resize event + scroll event),
1646         we query the actual scroll offset and scale for the DynamicViewportUpdateChangedTarget.
1647
1648         (WebKit::WebPage::viewportConfigurationChanged):
1649         Define the custom size on load before the app gets a chance to send different rects.
1650         If for some reason the app changes its mind about the insets, the content will be notified with a resize event.
1651
1652         (WebKit::WebPage::updateVisibleContentRects):
1653         Send the resize event when the insets are stable.
1654         Also move the scroll event after the resize event for consistency with live resize.
1655
1656 2014-05-09  Benjamin Poulain  <benjamin@webkit.org>
1657
1658         [iOS] Switch geolocation to an explicit authorization query model
1659         https://bugs.webkit.org/show_bug.cgi?id=132717
1660
1661         Reviewed by Sam Weinig.
1662
1663         Switch WKGeolocationProviderIOS to use the new API of WebGeolocationCoreLocationProvider.
1664
1665         On WebKit2, the whole logic to track requesters is in WebGeolocationManagerProxy.
1666
1667         Without the warmup sequence, WKGeolocationProviderIOS becomes really dumb: it just provides
1668         the two step authorization and forward the start/stop messages to the WebGeolocationCoreLocationProvider.
1669
1670         * UIProcess/ios/WKGeolocationProviderIOS.mm:
1671         (-[WKGeolocationProviderIOS _stopUpdating]):
1672         (-[WKGeolocationProviderIOS decidePolicyForGeolocationRequestFromOrigin:frame:request:window:]):
1673         (-[WKGeolocationProviderIOS geolocationAuthorizationGranted]):
1674         (-[WKGeolocationProviderIOS geolocationAuthorizationDenied]):
1675         (-[WKWebAllowDenyPolicyListener initWithPermissionRequestProxy:]):
1676         (-[WKWebAllowDenyPolicyListener deny]):
1677         (-[WKGeolocationProviderIOS _stopUpdatingIfPossible]): Deleted.
1678         (-[WKGeolocationProviderIOS geolocationDelegateStarted]): Deleted.
1679         (-[WKGeolocationProviderIOS geolocationDelegateUnableToStart]): Deleted.
1680         (-[WKGeolocationProviderIOS permissionDenied:]): Deleted.
1681         (-[WKWebAllowDenyPolicyListener initWithProvider:permissionRequestProxy:]): Deleted.
1682
1683 2014-05-09  Gordon Sheridan  <gordon_sheridan@apple.com>
1684
1685         Expose functions necessary for copying favicon between IconDatabases.
1686         https://bugs.webkit.org/show_bug.cgi?id=132709
1687
1688         Reviewed by Brady Eidson.
1689
1690         * UIProcess/API/C/WKIconDatabase.cpp:
1691         (WKIconDatabaseSetIconURLForPageURL):
1692         Add C API wrapper for WebIconDatabase::setIconURLForPageURL().
1693
1694         (WKIconDatabaseCopyIconURLForPageURL):
1695         Add C API wrapper for WebIconDatabase::synchronousIconURLForPageURL().
1696
1697         * UIProcess/API/C/WKIconDatabase.h:
1698         Added declarations for wrapper functions above.
1699
1700 2014-05-09  Tim Horton  <timothy_horton@apple.com>
1701
1702         Fix the iOS DRT build by including CG headers in WKPreferences.h, which uses CGFloat.
1703
1704         * UIProcess/API/Cocoa/WKPreferences.h:
1705
1706 2014-05-09  Brent Fulgham  <bfulgham@apple.com>
1707
1708         {TelephoneNumber, Selection}ControllerMac implementations dosn't handle tiled drawing properly.
1709         https://bugs.webkit.org/show_bug.cgi?id=132746
1710         <rdar://problem/16789588>
1711
1712         Reviewed by Tim Horton.
1713
1714         Don't try to draw the detector UI if no part of the selection bounds are inside
1715         the current tile. Don't limit the detector UI to the bounds of this tile, or else
1716         it will attempt to squeeze itself into the possibly small space available. Let it
1717         draw as if it had the whole screen, and rely on the context clip region to
1718         avoid overdrawing.
1719
1720         * WebProcess/WebPage/mac/TelephoneNumberOverlayControllerMac.mm:
1721         (WebKit::TelephoneNumberOverlayController::drawRect): Correct tiled drawing behavior.
1722         * WebProcess/WebPage/mac/SelectionOverlayControllerMac.mm:
1723         (WebKit::SelectionOverlayController::drawRect): Ditto.
1724
1725 2014-05-09  Anders Carlsson  <andersca@apple.com>
1726
1727         Production build fix.
1728
1729         Reviewed by Dan Bernstein.
1730
1731         * Configurations/BaseTarget.xcconfig:
1732         Add SDKROOT in front of UMBRELLA_FRAMEWORKS_DIR for OS X Production builds.
1733
1734 2014-05-09  Tim Horton  <timothy_horton@apple.com>
1735
1736         [iOS WebKit2] Flush RemoteLayerBackingStore contexts on a secondary queue
1737         https://bugs.webkit.org/show_bug.cgi?id=132667
1738         <rdar://problem/15349483>
1739
1740         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
1741         (WebKit::RemoteLayerTreeDrawingArea::BackingStoreFlusher::create):
1742         Address a missed review comment about a missing std::move.
1743
1744 2014-05-09  Anders Carlsson  <andersca@apple.com>
1745
1746         Rename WebKit2.framework to WebKit.framework
1747         https://bugs.webkit.org/show_bug.cgi?id=132743
1748         <rdar://problem/15920046>
1749
1750         Reviewed by Dan Bernstein.
1751
1752         * Configurations/BaseLegacyProcess.xcconfig:
1753         Change INSTALL_PATH to WebKit.framework.
1754
1755         * Configurations/BaseTarget.xcconfig:
1756         Change WEBKIT2_FRAMEWORKS_DIR to WEBKIT_FRAMEWORKS_DIR and add WEBKIT_LEGACY_PRIVATE_HEADERS_DIR.
1757
1758         * Configurations/BaseXPCService.xcconfig:
1759         Change WebKit2.framework to WebKit.framework.
1760
1761         * Configurations/WebKit.xcconfig: Copied from Source/WebKit2/Configurations/WebKit2.xcconfig.
1762         New configuration file for WebKit.framework. Re-export WebKitLegacy.framework.
1763
1764         * Configurations/WebKit2.xcconfig:
1765         New configuration file for the WebKit2 shim framework. Re-export WebKit.framework.
1766
1767         * NetworkProcess/EntryPoint/mac/XPCService/NetworkService/Info-OSX.plist:
1768         Update DYLD_INSERT_LIBRARIES to refer to WebKit.framework.
1769
1770         * PluginProcess/EntryPoint/mac/XPCService/PluginService.32-64.Info.plist:
1771         Update DYLD_INSERT_LIBRARIES to refer to WebKit.framework.
1772         
1773         * Shared/API/Cocoa/WKBrowsingContextHandle.h:
1774         * Shared/API/Cocoa/WKRenderingProgressEvents.h:
1775         Update header imports.
1776
1777         * Shared/API/Cocoa/WebKit.h: Renamed from Source/WebKit/mac/WebKitLegacy/WebKit.h.
1778         New umbrella header. Imports the modern WebKit API as well as the legacy API.
1779
1780         * Shared/API/Cocoa/WebKit.m: Renamed from Source/WebKit/mac/WebKitLegacy/WebKit.m.
1781         Export install name symbols on iOS.
1782
1783         * Shared/API/Cocoa/WebKitPrivate.h: Renamed from Source/WebKit/mac/WebKitLegacy/WebKitPrivate.h.
1784         New umbrella SPI header. Imports the modern WebKit SPI.
1785
1786         * Many headers:
1787         Change WebKit2 includes to WebKit includes.
1788
1789         * Shared/EntryPointUtilities/mac/XPCService/XPCServiceMain.Development.mm:
1790         (WebKit::XPCServiceEventHandler):
1791         Change bundle identifiers from com.apple.WebKit2 to com.apple.WebKit.
1792
1793         * Shared/EntryPointUtilities/mac/XPCService/XPCServiceMain.mm:
1794         (WebKit::XPCServiceEventHandler):
1795         Change bundle identifier from com.apple.WebKit2 to com.apple.WebKit.
1796         
1797         * UIProcess/API/Cocoa/WKPreferences.h:
1798         Stop including WKPreferencesRef.h, we have a WebKit2 header that handles this workaround for us now.
1799
1800         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
1801         (WebKit::addDYLDEnvironmentAdditions):
1802         (WebKit::connectToService):
1803         (WebKit::createProcess):
1804         (WebKit::ProcessLauncher::launchProcess):
1805         Change bundle identifiers from com.apple.WebKit2 to com.apple.WebKit.
1806
1807         * UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
1808         (WebKit::PluginProcessProxy::createPropertyListFile):
1809         Change bundle identifiers from com.apple.WebKit2 to com.apple.WebKit.
1810
1811         * UIProcess/mac/WebContextMac.mm:
1812         (WebKit::WebContext::platformDefaultDiskCacheDirectory):
1813         Change bundle identifier from com.apple.WebKit2 to com.apple.WebKit.
1814         
1815         * WebKit2.xcodeproj/project.pbxproj:
1816         Copy the python message scripts to the WebKit2 framework.
1817         Rename WebKit2.framework to WebKit.framework everywhere.
1818         Add a new WebKit2 target that builds the shim WebKit2 framework.
1819         Move the build script phase that migrates WebKitLegacy headers to WebKit.
1820         Add a new build script phase that adds forwarding headers from WebKit2 to WebKit.
1821
1822         * WebProcess/EntryPoint/mac/XPCService/WebContentService/Info-OSX.plist:
1823         Update DYLD_INSERT_LIBRARIES to refer to WebKit.framework.
1824
1825         * mac/MigrateHeadersFromWebKitLegacy.make: Renamed from Source/WebKit/mac/WebKitLegacy/MigrateHeadersFromWebKitLegacy.make.
1826         Move the makefile that migrates WebKitLegacy headers here. On OS X, it copies the header contents and on iOS it creates forarding headers.
1827
1828         * mac/MigrateHeadersToWebKit2.make:
1829         New makefile that creates forwarding headers for the WebKit2 shim framework.
1830
1831         * mac/WKPreferences.h: Added.
1832         Add WebKit2/WKPreferences.h header that imports WebKit2/WKPreferencesref.h.
1833
1834         * mac/WebKit2.m:
1835         Skeleton for the WebKit2 shim framework.
1836
1837         * mac/Info-WebKit2.plist: Added.
1838         New Info.plist file for the WebKit2 shim framework.
1839
1840 2014-05-09  Martin Hodovan  <mhodovan.u-szeged@partner.samsung.com>
1841
1842         [WK2] Make generate-forwarding-headers.pl work after WebKit2.framework -> WebKit.framework rename
1843         https://bugs.webkit.org/show_bug.cgi?id=132733
1844
1845         Reviewed by Csaba Osztrogonác.
1846
1847         Rewrite framework's directory name to WebKit2 if the framework is WebKit (former WebKit2)
1848         and then collect headers inside the fixed framework directory and generate forwarding
1849         headers point to the fixed directory.
1850
1851         Leave WebKit2 in @frameworks list during the transition. It can be removed
1852         once <WebKit2/foo.h> style includes were renamed to <WebKit/foo.h> everywhere.
1853
1854         * Scripts/generate-forwarding-headers.pl:
1855         (collectFameworkHeaderPaths):
1856         (createForwardingHeadersForFramework):
1857
1858 2014-05-08  Alexey Proskuryakov  <ap@apple.com>
1859
1860         Automatically zip document bundles used via File API
1861         https://bugs.webkit.org/show_bug.cgi?id=132713
1862         <rdar://problem/13397892>
1863
1864         Reviewed by Anders Carlsson.
1865
1866         * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in: NetworkProcess
1867         now uses FileCoordination (WebProcess already had this allowed).
1868
1869         * Shared/BlobDataFileReferenceWithSandboxExtension.h: Added final to the class.
1870
1871 2014-05-08  Simon Fraser  <simon.fraser@apple.com>
1872
1873         [iOS WK2] Bottom-relative position:fixed elements are misplaced on page load
1874         https://bugs.webkit.org/show_bug.cgi?id=132719
1875         <rdar://problem/16860837>
1876
1877         Reviewed by Benjamin Poulain.
1878         
1879         If we haven't received visible rects from the web process, compute the
1880         fixed position rect, but only after scale has been set.
1881
1882         * WebProcess/WebPage/ios/WebPageIOS.mm:
1883         (WebKit::WebPage::viewportConfigurationChanged):
1884
1885 2014-05-08  Jer Noble  <jer.noble@apple.com>
1886
1887         [Mac, iOS] Add source application accounting to AVURLAsset.
1888         https://bugs.webkit.org/show_bug.cgi?id=132637
1889
1890         Reviewed by Eric Carlson.
1891
1892         Add accessor for sourceApplicationIdentifier.
1893
1894         * NetworkProcess/RemoteNetworkingContext.h:
1895         * NetworkProcess/mac/RemoteNetworkingContext.mm:
1896         (WebKit::RemoteNetworkingContext::sourceApplicationIdentifier):
1897         * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.h:
1898         * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm:
1899         (WebKit::WebFrameNetworkingContext::sourceApplicationIdentifier):
1900
1901 2014-05-08  Tim Horton  <timothy_horton@apple.com>
1902
1903         [iOS WebKit2] Flush RemoteLayerBackingStore contexts on a secondary queue
1904         ​https://bugs.webkit.org/show_bug.cgi?id=132667
1905         <rdar://problem/16861454>
1906
1907         Rubber-stamped by Simon Fraser.
1908
1909         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
1910         (WebKit::RemoteLayerTreeDrawingArea::flushLayers):
1911         Add a null check to fix a crash on layers which lose backing store.
1912
1913 2014-05-08  Beth Dakin  <bdakin@apple.com>
1914
1915         REGRESSION (r168053): Phone number detection boxes are wrong when scrolled
1916         https://bugs.webkit.org/show_bug.cgi?id=132706
1917         -and corresponding-
1918         <rdar://problem/16787957>
1919
1920         Reviewed by Tim Horton.
1921
1922         We need to paint the boxes in Document coordinates. Range::boundingRect() was 
1923         giving us a point that took scroll position into account, and that’s not what we 
1924         want. Here we use Range::textQuads() instead so that we can get something in 
1925         Document coordinates, and then we need to convert that up to the main Document’s 
1926         coordinates.
1927         * WebProcess/WebPage/mac/TelephoneNumberOverlayControllerMac.mm:
1928         (WebKit::textQuadsToBoundingRectForRange):
1929         (WebKit::TelephoneNumberOverlayController::drawRect):
1930
1931         The telephone click function wants a point in Window coordinates.
1932         (WebKit::TelephoneNumberOverlayController::mouseEvent):
1933
1934 2014-05-08  Tim Horton  <timothy_horton@apple.com>
1935
1936         [iOS WebKit2] Flush RemoteLayerBackingStore contexts on a secondary queue
1937         https://bugs.webkit.org/show_bug.cgi?id=132667
1938         <rdar://problem/15349483>
1939
1940         Reviewed by Darin Adler.
1941
1942         * Shared/mac/RemoteLayerBackingStore.h:
1943         * Shared/mac/RemoteLayerBackingStore.mm:
1944         (WebKit::RemoteLayerBackingStore::takeFrontContextPendingFlush):
1945         (WebKit::RemoteLayerBackingStore::flush): Deleted.
1946         Add takeFrontContextPendingFlush, which returns the painted-but-not-yet-flushed front context,
1947         and drops our reference to it. This needs to be called on all backing store between paints.
1948
1949         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
1950         (WebKit::RemoteLayerTreeDrawingArea::BackingStoreFlusher::hasFlushed):
1951         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
1952         (WebKit::RemoteLayerTreeDrawingArea::RemoteLayerTreeDrawingArea):
1953         (WebKit::RemoteLayerTreeDrawingArea::~RemoteLayerTreeDrawingArea):
1954         (WebKit::RemoteLayerTreeDrawingArea::flushLayers):
1955         (WebKit::RemoteLayerTreeDrawingArea::BackingStoreFlusher::create):
1956         (WebKit::RemoteLayerTreeDrawingArea::BackingStoreFlusher::BackingStoreFlusher):
1957         (WebKit::RemoteLayerTreeDrawingArea::BackingStoreFlusher::flush):
1958         (WebKit::flushBackingStoreChangesInTransaction): Deleted.
1959         Flush backing store and send the layer tree commit to the UI process from a dispatch queue.
1960         We will only ever have a single commit in flight at a time, and there's a new
1961         RELEASE_ASSERT to ensure that is the case.
1962         We package up the commit on the main thread; the queue calls CGContextFlush
1963         on all of the newly painted contexts and then tosses the commit over to the UI process.
1964         This is a win in many cases because the Web process main thread can go ahead
1965         and do other non-painting tasks while the queue is blocked on painting.
1966
1967 2014-05-08  Tim Horton  <timothy_horton@apple.com>
1968
1969         [wk2] Don't use the XPC-based plugin process for Adobe Reader
1970         https://bugs.webkit.org/show_bug.cgi?id=132701
1971         <rdar://problem/16792692>
1972
1973         Reviewed by Anders Carlsson.
1974
1975         * UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
1976         (WebKit::shouldUseXPC):
1977         Rename the debugging default to a more modern and accurate name.
1978         Don't use XPC for Adobe Reader.
1979
1980         (WebKit::PluginProcessProxy::platformGetLaunchOptions):
1981         Move the check for plugins that need an executable heap into shouldUseXPC.
1982
1983 2014-05-08  Benjamin Poulain  <benjamin@webkit.org>
1984
1985         [iOS][WK2] Remove an incorrect assertion on asynchronous touch dispatch
1986         https://bugs.webkit.org/show_bug.cgi?id=132660
1987
1988         Reviewed by Enrica Casucci.
1989
1990         This assertion no longer make sense after r168393. Now the asynchronous behavior is maintained
1991         until the last finger leaves the screen.
1992
1993         * UIProcess/WebPageProxy.cpp:
1994         (WebKit::WebPageProxy::handleTouchEventAsynchronously):
1995
1996 2014-05-08  Alexey Proskuryakov  <ap@apple.com>
1997
1998         Make BlobDataFileReference manage its sandbox extension
1999         https://bugs.webkit.org/show_bug.cgi?id=132689
2000
2001         Reviewed by Anders Carlsson.
2002
2003         * CMakeLists.txt:
2004         * PlatformGTK.cmake:
2005         * WebKit2.xcodeproj/project.pbxproj:
2006         Added BlobDataFileReferenceWithSandboxExtension.
2007
2008         * NetworkProcess/FileAPI/NetworkBlobRegistry.cpp:
2009         (WebKit::NetworkBlobRegistry::registerFileBlobURL):
2010         (WebKit::NetworkBlobRegistry::registerBlobURL):
2011         (WebKit::NetworkBlobRegistry::registerBlobURLForSlice):
2012         (WebKit::NetworkBlobRegistry::unregisterBlobURL):
2013         (WebKit::NetworkBlobRegistry::connectionToWebProcessDidClose):
2014         (WebKit::NetworkBlobRegistry::filesInBlob):
2015         (WebKit::NetworkBlobRegistry::sandboxExtensions): Deleted.
2016         * NetworkProcess/FileAPI/NetworkBlobRegistry.h:
2017         We no longer track sandbox extensions here. Instead, provide a way to get files
2018         for a blob, which contain extensions and can allow access to themselves.
2019
2020         * NetworkProcess/NetworkResourceLoader.cpp:
2021         (WebKit::NetworkResourceLoader::NetworkResourceLoader):
2022         (WebKit::NetworkResourceLoader::consumeSandboxExtensions):
2023         (WebKit::NetworkResourceLoader::invalidateSandboxExtensions):
2024         * NetworkProcess/NetworkResourceLoader.h:
2025         Allow/revoke access to files in blob, just like we do for explicitly passed extensions.
2026
2027         * Shared/BlobDataFileReferenceWithSandboxExtension.cpp: Added.
2028         (WebKit::BlobDataFileReferenceWithSandboxExtension::BlobDataFileReferenceWithSandboxExtension):
2029         (WebKit::BlobDataFileReferenceWithSandboxExtension::~BlobDataFileReferenceWithSandboxExtension):
2030         (WebKit::BlobDataFileReferenceWithSandboxExtension::prepareForFileAccess):
2031         (WebKit::BlobDataFileReferenceWithSandboxExtension::revokeFileAccess):
2032         * Shared/BlobDataFileReferenceWithSandboxExtension.h: Added.
2033         (WebKit::BlobDataFileReferenceWithSandboxExtension::create):
2034         A subclass of BlobDataFileReference that also contains a sandbox extension. NetworkProcess
2035         always uses it in BlobRegistryImpl.
2036
2037         * WebProcess/FileAPI/BlobRegistryProxy.cpp: (WebKit::BlobRegistryProxy::registerFileBlobURL):
2038         * WebProcess/FileAPI/BlobRegistryProxy.h:
2039         Updated for BlobRegistry interface changes. BlobRegistryProxy doesn't really need
2040         a BlobDataFileReference here, as it only uses a path, but it needs to implement the same interface
2041         as BlobRegistryImpl.
2042
2043 2014-05-08  Brady Eidson  <beidson@apple.com>
2044
2045         "shouldKeepCurrentBackForwardListItemInList" API should pass clientInfo to the callback
2046         <rdar://problem/16855357> and https://bugs.webkit.org/show_bug.cgi?id=132692
2047
2048         Reviewed by Tim Horton.
2049
2050         * UIProcess/API/C/WKPage.cpp:
2051         (WKPageSetPageLoaderClient):
2052         * UIProcess/API/C/WKPageLoaderClient.h:
2053
2054 2014-05-08  Antti Koivisto  <antti@apple.com>
2055
2056         [iOS WebKit2] Can't activate text fields on Facebook
2057         https://bugs.webkit.org/show_bug.cgi?id=132682
2058
2059         Reviewed by Enrica Casucci.
2060
2061         * WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm:
2062         (WebKit::WebChromeClient::observedContentChange):
2063         
2064             Implement content change observer callback.
2065
2066         * WebProcess/WebPage/WebPage.h:
2067         * WebProcess/WebPage/ios/WebPageIOS.mm:
2068         (WebKit::WebPage::handleSyntheticClick):
2069         
2070             If the event gets canceled by a potential change (a started short-duration timer)
2071             save the position and node so we can continue later.
2072
2073         (WebKit::WebPage::completePendingSyntheticClickForContentChangeObserver):
2074         
2075             If it turns out the observed timer changed nothing continue the click event.
2076
2077         (WebKit::WebPage::completeSyntheticClick):
2078         
2079             Factored click event dispatch part of handleSyntheticClick here.
2080
2081 2014-05-07  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
2082
2083         [CoordinatedGraphics][WK2] Scale factor and scroll position is not being restored properly in a back/forward load
2084         https://bugs.webkit.org/show_bug.cgi?id=126022
2085
2086         Reviewed by Benjamin Poulain.
2087
2088         Original author : Thiago de Barros Lacerda, and finished by Gyuyoung Kim.
2089
2090         When user is navigating back/forward to a page that has been scrolled and/or scaled, that page must be shown
2091         with its last scroll position and scale factor. However, when fixed layout was enabled with CoordinatedGraphics
2092         and TILED_BACKING_STORE, Page::setPageScaleFactor() doesn't send previous scroll position since r165652 and r165913.
2093
2094         This patch allows the Page::setPageScaleFactor() send stored position to WK2 implementation.
2095
2096         * UIProcess/CoordinatedGraphics/WebView.cpp:
2097         (WebKit::WebView::didCommitLoadForMainFrame):
2098
2099 2014-05-07  Simon Fraser  <simon.fraser@apple.com>
2100
2101         Put a better version of the assertion back, and add one when we ensureBackingStore.
2102
2103         Reviewed by Tim Horton.
2104
2105         * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
2106         (WebKit::PlatformCALayerRemote::recursiveBuildTransaction):
2107         (WebKit::PlatformCALayerRemote::ensureBackingStore):
2108
2109 2014-05-07  Simon Fraser  <simon.fraser@apple.com>
2110
2111         This assertion was wrong and fired every time. Remove it.
2112
2113         * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
2114         (WebKit::PlatformCALayerRemote::recursiveBuildTransaction):
2115
2116 2014-05-07  Enrica Casucci  <enrica@apple.com>
2117
2118         WK2: Programatic scroll requests during scroll or zoom animation to reveal focused element are ignored.
2119         https://bugs.webkit.org/show_bug.cgi?id=132657
2120         <rdar://problem/16468462>
2121
2122         Reviewed by Benjamin Poulain.
2123
2124         With the scrolling model we use on iOS, a programatic scroll
2125         request can be received while we are still animating to reveal
2126         the focused input element. Changing the scroll offset while animating
2127         leads to unpredictable results. We now cancel the animation if
2128         a programatic scroll request is received.
2129
2130         * UIProcess/API/Cocoa/WKWebView.mm:
2131         (-[WKWebView _scrollToContentOffset:WebCore::]):
2132         * WebProcess/WebPage/ios/WebPageIOS.mm:
2133         (WebKit::WebPage::getAssistedNodeInformation):
2134
2135 2014-05-07  Simon Fraser  <simon.fraser@apple.com>
2136
2137         [iOS WK2] Speculative fix for crash in PlatformCALayerRemote::recursiveBuildTransaction
2138         https://bugs.webkit.org/show_bug.cgi?id=132666
2139
2140         Reviewed by Tim Horton.
2141         
2142         Crash reports suggest that owner() can be null. Assert and protect
2143         against this.
2144
2145         * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
2146         (WebKit::PlatformCALayerRemote::recursiveBuildTransaction):
2147
2148 2014-05-07  Dan Bernstein  <mitz@apple.com>
2149
2150         <rdar://problem/16831276> [iOS] Unparenting a WKWebView that’s loading pauses it
2151         https://bugs.webkit.org/show_bug.cgi?id=132659
2152
2153         Reviewed by Tim Horton.
2154
2155         * UIProcess/Cocoa/NavigationState.h: Added a member variable.
2156         * UIProcess/Cocoa/NavigationState.mm:
2157         (WebKit::NavigationState::didChangeIsLoading): When transitioning into loading state,
2158         acquire a background activity token. When transitioning out of loading state, dispose of
2159         the token.
2160
2161 2014-05-07  Jeremy Jones  <jeremyj@apple.com>
2162
2163         HTMLMediaElement should exitFullscreen when view is removed from the window.
2164         https://bugs.webkit.org/show_bug.cgi?id=132506
2165
2166         Reviewed by Tim Horton.
2167
2168         * UIProcess/WebPageProxy.cpp:
2169         (WebKit::WebPageProxy::viewStateDidChange):
2170         Request WebVideoFUllscreenManagerProxy to exitFullscreen when removed from the window.
2171         * UIProcess/ios/WebVideoFullscreenManagerProxy.h:
2172         Make requestExitFullscreen() public instead of private.
2173
2174 2014-05-07  Alexey Proskuryakov  <ap@apple.com>
2175
2176         Make blob size computation lazy
2177         https://bugs.webkit.org/show_bug.cgi?id=132653
2178
2179         Reviewed by Anders Carlsson.
2180
2181         * NetworkProcess/FileAPI/NetworkBlobRegistry.cpp:
2182         (WebKit::NetworkBlobRegistry::registerBlobURL):
2183         (WebKit::NetworkBlobRegistry::registerBlobURLForSlice):
2184         (WebKit::NetworkBlobRegistry::blobSize):
2185         * NetworkProcess/FileAPI/NetworkBlobRegistry.h:
2186         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
2187         (WebKit::NetworkConnectionToWebProcess::registerBlobURL):
2188         (WebKit::NetworkConnectionToWebProcess::registerBlobURLForSlice):
2189         (WebKit::NetworkConnectionToWebProcess::blobSize):
2190         * NetworkProcess/NetworkConnectionToWebProcess.h:
2191         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
2192         * WebProcess/FileAPI/BlobRegistryProxy.cpp:
2193         (WebKit::BlobRegistryProxy::registerBlobURL):
2194         (WebKit::BlobRegistryProxy::registerBlobURLForSlice):
2195         (WebKit::BlobRegistryProxy::blobSize):
2196         * WebProcess/FileAPI/BlobRegistryProxy.h:
2197
2198 2014-05-06  Simon Fraser  <simon.fraser@apple.com>
2199
2200         Add scrolling tree logging to RemoteLayerTree output
2201         https://bugs.webkit.org/show_bug.cgi?id=132640
2202
2203         Reviewed by Beth Dakin.
2204         
2205         Support scrolling tree logging in the RemoteLayerTree log channel
2206         output.
2207         
2208         Encode/decode ScrollingStateTree::hasChangedProperties() so we can use
2209         it to avoid logging. Log all the things.
2210
2211         * Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp:
2212         (WebKit::RemoteScrollingCoordinatorTransaction::encode):
2213         (WebKit::RemoteScrollingCoordinatorTransaction::decode):
2214         (WebKit::RemoteScrollingTreeTextStream::RemoteScrollingTreeTextStream):
2215         (WebKit::RemoteScrollingTreeTextStream::increaseIndent):
2216         (WebKit::RemoteScrollingTreeTextStream::decreaseIndent):
2217         (WebKit::RemoteScrollingTreeTextStream::writeIndent):
2218         (WebKit::dumpProperty):
2219         (WebKit::RemoteScrollingTreeTextStream::operator<<):
2220         (WebKit::RemoteScrollingTreeTextStream::dump):
2221         (WebKit::RemoteScrollingTreeTextStream::recursiveDumpNodes):
2222         (WebKit::RemoteScrollingCoordinatorTransaction::description):
2223         (WebKit::RemoteScrollingCoordinatorTransaction::dump):
2224         * Shared/Scrolling/RemoteScrollingCoordinatorTransaction.h:
2225         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
2226         (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
2227
2228 2014-05-07  Hyowon Kim  <hw1008.kim@samsung.com>
2229
2230         GraphicsLayer::client() should return a reference.
2231         https://bugs.webkit.org/show_bug.cgi?id=126372
2232
2233         Reviewed by Simon Fraser.
2234
2235         GraphicsLayers always have a GraphicsLayerClient attached,
2236         so make client() a reference and remove some unnecessary branches.
2237         The author of the changes in the mac port is Andreas Kling <akling@apple.com>.
2238
2239         * WebProcess/WebPage/PageOverlayController.cpp:
2240         (WebKit::PageOverlayController::initialize):
2241         (WebKit::PageOverlayController::installPageOverlay):
2242         * WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp:
2243         (WebKit::LayerTreeHostGtk::initialize):
2244         (WebKit::LayerTreeHostGtk::createPageOverlayLayer):
2245         * WebProcess/WebPage/mac/GraphicsLayerCARemote.h:
2246         * WebProcess/WebPage/mac/RemoteLayerTreeContext.h:
2247         * WebProcess/WebPage/mac/RemoteLayerTreeContext.mm:
2248         (WebKit::RemoteLayerTreeContext::createGraphicsLayer):
2249         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
2250         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
2251         (WebKit::RemoteLayerTreeDrawingArea::RemoteLayerTreeDrawingArea):
2252
2253 2014-05-07  Shivakumar JM  <shiva.jm@samsung.com>
2254
2255         Cleanup the build from unused parameter in UIProcess Module
2256         https://bugs.webkit.org/show_bug.cgi?id=131969
2257
2258         Reviewed by Csaba Osztrogonác.
2259
2260         Fixed unused parameter by omitting the parameter name
2261
2262         * UIProcess/API/C/WKPage.cpp:
2263         (WKPageSetPageFindClient):
2264         * UIProcess/WebFindClient.cpp:
2265         (WebKit::WebFindClient::didFindString):
2266
2267 2014-05-07  Manuel Rego Casasnovas  <rego@igalia.com>
2268
2269         [CSS Grid Layout] Remove runtime feature
2270         https://bugs.webkit.org/show_bug.cgi?id=132382
2271
2272         Reviewed by Benjamin Poulain.
2273
2274         Remove cssGridLayoutEnabled setting usage.
2275
2276         * Shared/WebPreferencesStore.h:
2277         * UIProcess/API/C/WKPreferences.cpp:
2278         (WKPreferencesSetCSSGridLayoutEnabled): Deleted.
2279         (WKPreferencesGetCSSGridLayoutEnabled): Deleted.
2280         * UIProcess/API/C/WKPreferencesRefPrivate.h:
2281         * UIProcess/API/gtk/WebKitSettings.cpp:
2282         (webKitSettingsConstructed):
2283         * UIProcess/gtk/ExperimentalFeatures.cpp:
2284         * UIProcess/gtk/ExperimentalFeatures.h:
2285         * WebProcess/InjectedBundle/InjectedBundle.cpp:
2286         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
2287         * WebProcess/WebPage/WebPage.cpp:
2288         (WebKit::WebPage::updatePreferences):
2289         * mac/WebKit2.order:
2290
2291 2014-05-07  Csaba Osztrogonác  <ossy@webkit.org>
2292
2293         URTBF after r168393 to fix !IOS builds.
2294
2295         * Shared/WebEvent.h:
2296
2297 2014-05-06  Brady Eidson  <beidson@apple.com>
2298
2299         Followup to "Add WK2 SPI to prevent the previous back/forward item from remaining in the list"
2300         <rdar://problem/16248710> and https://bugs.webkit.org/show_bug.cgi?id=132636
2301
2302         Reviewed by NOBODY (My mistake while addressing previous review feedback)
2303
2304         * UIProcess/API/C/WKPage.cpp:
2305         (WKPageSetPageLoaderClient): During review feedback, this client switched from default negative to default
2306           positve, so when the client isn't implemented...  return true instead of false.
2307
2308         * UIProcess/WebBackForwardList.cpp:
2309         (WebKit::WebBackForwardList::addItem): Fix nonsensical comments while I'm at it.
2310
2311 2014-05-06  Brady Eidson  <beidson@apple.com>
2312
2313         Add WK2 SPI to prevent the previous back/forward item from remaining in the list
2314         <rdar://problem/16248710> and https://bugs.webkit.org/show_bug.cgi?id=132636
2315
2316         Reviewed by Sam Weinig.
2317
2318         Add new PageLoaderClient SPI to keep the current back/forward item from remaining in the list:
2319         * UIProcess/API/APILoaderClient.h:
2320         (API::LoaderClient::shouldKeepCurrentBackForwardListItemInList):
2321         * UIProcess/API/C/WKPage.cpp:
2322         (WKPageSetPageLoaderClient):
2323         * UIProcess/API/C/WKPageLoaderClient.h:
2324         * UIProcess/WebPageProxy.cpp:
2325         (WebKit::WebPageProxy::shouldKeepCurrentBackForwardListItemInList):
2326         * UIProcess/WebPageProxy.h:
2327
2328         * UIProcess/WebBackForwardList.cpp:
2329         (WebKit::WebBackForwardList::addItem): Use that SPI to determine whether we should insert the new item after
2330         the previous item, or simply replace the previous item.
2331         (WebKit::WebBackForwardList::goToItem): Use that SPI to determine whether the previous item stays or goes.
2332
2333 2014-05-06  Dan Bernstein  <mitz@apple.com>
2334
2335         -[WKWebView isLoading] is NO immediately after -loadRequest: until the provisional load starts
2336         https://bugs.webkit.org/show_bug.cgi?id=132639
2337
2338         Reviewed by Darin Adler.
2339
2340         * UIProcess/PageLoadState.cpp:
2341         (WebKit::PageLoadState::commitChanges): Updated for change from isLoadingState to isLoading.
2342         (WebKit::PageLoadState::isLoading): Renamed from isLoadingState, changed to take Data and
2343         check whether there is a non-null pending API request URL. If so, return true.
2344         * UIProcess/PageLoadState.h:
2345
2346 2014-05-06  Dean Jackson  <dino@apple.com>
2347
2348         [Mac] Allow focus rings to redraw themselves if necessary
2349         https://bugs.webkit.org/show_bug.cgi?id=132593
2350
2351         Reviewed by Simon Fraser.
2352
2353         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
2354         (InitWebCoreSystemInterface): Add DrawFocusRingAtTime and DrawCellFocusRingWithFrameAtTime.
2355
2356 2014-05-06  Benjamin Poulain  <benjamin@webkit.org>
2357
2358         <rdar://problem/16833442> [iOS WebKit2]: Keep the order of contentView in _scrollView after rotation
2359         https://bugs.webkit.org/show_bug.cgi?id=132634
2360
2361         Reviewed by Enrica Casucci.
2362
2363         Nice idea of Yongjun.
2364
2365         * UIProcess/API/Cocoa/WKWebView.mm:
2366         (-[WKWebView _beginAnimatedResizeWithUpdates:]):
2367         (-[WKWebView _endAnimatedResize]):
2368
2369 2014-05-06  Timothy Hatcher  <timothy@apple.com>
2370
2371         Take WKView's topContentInset into account when docking Web Inspector to the right.
2372
2373         https://bugs.webkit.org/show_bug.cgi?id=132631
2374
2375         Reviewed by Joseph Pecoraro.
2376
2377         * UIProcess/mac/WebInspectorProxyMac.mm:
2378         (WebKit::WebInspectorProxy::inspectedViewFrameDidChange): Subtract topContentInset
2379         from the height of the frame for the Inspector.
2380
2381 2014-05-06  Benjamin Poulain  <bpoulain@apple.com>
2382
2383         [iOS][WK2] WebKit2 does not set CanPreventNativeGestures on the platform events
2384         https://bugs.webkit.org/show_bug.cgi?id=132594
2385
2386         Reviewed by Simon Fraser.
2387
2388         Set CanPreventNativeGestures on the plaform event.
2389         Change the tracking of WKContentView to be similar to WebPageProxy.
2390
2391         * Shared/WebEvent.h:
2392         (WebKit::WebTouchEvent::WebTouchEvent):
2393         (WebKit::WebTouchEvent::canPreventNativeGestures):
2394         (WebKit::WebTouchEvent::setCanPreventNativeGestures):
2395         * Shared/WebEventConversion.cpp:
2396         (WebKit::WebKit2PlatformTouchEvent::WebKit2PlatformTouchEvent):
2397         * Shared/ios/WebTouchEventIOS.cpp:
2398         (WebKit::WebTouchEvent::encode):
2399         (WebKit::WebTouchEvent::decode):
2400         * UIProcess/ios/WKContentViewInteraction.mm:
2401         (-[WKContentView _webTouchEventsRecognized:]):
2402
2403 2014-05-06  Benjamin Poulain  <bpoulain@apple.com>
2404
2405         [iOS][WK2] Add tap highlight on the simple UITapGestureRecognizer
2406         https://bugs.webkit.org/show_bug.cgi?id=132623
2407         <rdar://problem/16709507>
2408
2409         Reviewed by Enrica Casucci.
2410
2411         Add a low latency highlight for tap/click.
2412
2413         * UIProcess/PageClient.h:
2414         * UIProcess/WebPageProxy.h:
2415         * UIProcess/WebPageProxy.messages.in:
2416         * UIProcess/ios/PageClientImplIOS.h:
2417         * UIProcess/ios/PageClientImplIOS.mm:
2418         (WebKit::PageClientImpl::commitPotentialTapFailed):
2419         * UIProcess/ios/WKContentViewInteraction.h:
2420         * UIProcess/ios/WKContentViewInteraction.mm:
2421         (-[WKContentView setupInteraction]):
2422         (-[WKContentView _showTapHighlightWithColor:WebCore::quads:WebCore::topLeftRadius:WebCore::topRightRadius:WebCore::bottomLeftRadius:WebCore::bottomRightRadius:WebCore::]):
2423         (-[WKContentView _didGetTapHighlightForRequest:color:WebCore::quads:WebCore::topLeftRadius:WebCore::topRightRadius:WebCore::bottomLeftRadius:WebCore::bottomRightRadius:WebCore::]):
2424         (-[WKContentView _finishInteraction]):
2425         (-[WKContentView _highlightLongPressRecognized:]):
2426         (-[WKContentView _singleTapRecognized:]):
2427         (-[WKContentView _singleTapDidReset:]):
2428         (-[WKContentView _commitPotentialTapFailed]):
2429         (-[WKContentView _singleTapCommited:]):
2430         (-[WKContentView _attemptClickAtLocation:]):
2431         * UIProcess/ios/WKSyntheticClickTapGestureRecognizer.h: Added.
2432         * UIProcess/ios/WKSyntheticClickTapGestureRecognizer.m: Added.
2433         (-[WKSyntheticClickTapGestureRecognizer setGestureRecognizedTarget:action:]):
2434         (-[WKSyntheticClickTapGestureRecognizer setResetTarget:action:]):
2435         (-[WKSyntheticClickTapGestureRecognizer setState:]):
2436         (-[WKSyntheticClickTapGestureRecognizer reset]):
2437         * UIProcess/ios/WebPageProxyIOS.mm:
2438         (WebKit::WebPageProxy::potentialTapAtPosition):
2439         (WebKit::WebPageProxy::commitPotentialTap):
2440         (WebKit::WebPageProxy::cancelPotentialTap):
2441         (WebKit::WebPageProxy::tapHighlightAtPosition):
2442         (WebKit::WebPageProxy::commitPotentialTapFailed):
2443         * WebKit2.xcodeproj/project.pbxproj:
2444         * WebProcess/WebPage/WebPage.h:
2445         * WebProcess/WebPage/WebPage.messages.in:
2446         * WebProcess/WebPage/ios/WebPageIOS.mm:
2447         (WebKit::WebPage::handleSyntheticClick):
2448         (WebKit::WebPage::handleTap):
2449         (WebKit::WebPage::sendTapHighlightForNodeIfNecessary):
2450         (WebKit::WebPage::potentialTapAtPosition):
2451         (WebKit::WebPage::commitPotentialTap):
2452         (WebKit::WebPage::cancelPotentialTap):
2453         (WebKit::WebPage::tapHighlightAtPosition):
2454
2455 2014-05-06  Anders Carlsson  <andersca@apple.com>
2456
2457         Put WebArchive and WebArchiveResource in the API namespace.
2458
2459         Rubber-stamped by Dan Bernstein.
2460
2461         * Shared/API/c/WKSharedAPICast.h:
2462         * Shared/API/c/mac/WKWebArchive.cpp:
2463         (WKWebArchiveGetTypeID):
2464         (WKWebArchiveCreate):
2465         (WKWebArchiveCreateWithData):
2466         (WKWebArchiveCreateFromRange):
2467         (WKWebArchiveCopyMainResource):
2468         * Shared/API/c/mac/WKWebArchiveResource.cpp:
2469         (WKWebArchiveResourceGetTypeID):
2470         (WKWebArchiveResourceCreate):
2471         * Shared/APIWebArchive.cpp: Renamed from Source/WebKit2/Shared/WebArchive.cpp.
2472         (API::WebArchive::create):
2473         (API::WebArchive::WebArchive):
2474         (API::WebArchive::~WebArchive):
2475         (API::WebArchive::mainResource):
2476         (API::WebArchive::subresources):
2477         (API::WebArchive::subframeArchives):
2478         (API::releaseCFData):
2479         (API::WebArchive::data):
2480         (API::WebArchive::coreLegacyWebArchive):
2481         * Shared/APIWebArchive.h: Renamed from Source/WebKit2/Shared/WebArchive.h.
2482         * Shared/APIWebArchiveResource.cpp: Renamed from Source/WebKit2/Shared/WebArchiveResource.cpp.
2483         (API::WebArchiveResource::create):
2484         (API::WebArchiveResource::WebArchiveResource):
2485         (API::WebArchiveResource::~WebArchiveResource):
2486         (API::releaseCFData):
2487         (API::WebArchiveResource::data):
2488         (API::WebArchiveResource::URL):
2489         (API::WebArchiveResource::MIMEType):
2490         (API::WebArchiveResource::textEncoding):
2491         (API::WebArchiveResource::coreArchiveResource):
2492         * Shared/APIWebArchiveResource.h: Renamed from Source/WebKit2/Shared/WebArchiveResource.h.
2493         * WebKit2.xcodeproj/project.pbxproj:
2494
2495 2014-05-06  Alex Christensen  <achristensen@webkit.org>
2496
2497         Removed unnecessary notImplemented.h includes.
2498         https://bugs.webkit.org/show_bug.cgi?id=132587
2499
2500         Reviewed by Anders Carlsson.
2501
2502         * UIProcess/ios/WKContentViewInteraction.mm:
2503         * UIProcess/mac/WebContextMenuProxyMac.mm:
2504         * WebProcess/Databases/IndexedDB/WebIDBFactoryBackend.cpp:
2505         * WebProcess/WebCoreSupport/WebInspectorFrontendClient.cpp:
2506         Removed notImplemented from list of includes.
2507
2508 2014-05-05  Jeremy Jones  <jeremyj@apple.com>
2509
2510         Implement scan backward and forward in video fullscreen.
2511         https://bugs.webkit.org/show_bug.cgi?id=132517
2512
2513         Reviewed by Simon Fraser.
2514
2515         Plumb through scanning/seeking functions.
2516
2517         * UIProcess/ios/WebVideoFullscreenManagerProxy.h:
2518         * UIProcess/ios/WebVideoFullscreenManagerProxy.mm:
2519         (WebKit::WebVideoFullscreenManagerProxy::fastSeek):
2520         (WebKit::WebVideoFullscreenManagerProxy::beginScanningForward):
2521         (WebKit::WebVideoFullscreenManagerProxy::beginScanningBackward):
2522         (WebKit::WebVideoFullscreenManagerProxy::endScanning):
2523         * WebProcess/ios/WebVideoFullscreenManager.messages.in:
2524
2525 2014-05-05  Benjamin Poulain  <bpoulain@apple.com>
2526
2527         [iOS][WK2] Prefetch DNS hostnames on tap highlight
2528         https://bugs.webkit.org/show_bug.cgi?id=132509
2529
2530         Reviewed by Alexey Proskuryakov.
2531
2532         * WebProcess/WebPage/ios/WebPageIOS.mm:
2533         (WebKit::WebPage::tapHighlightAtPosition):
2534
2535 2014-05-05  Simon Fraser  <simon.fraser@apple.com>
2536
2537         [iOS WK2] Flickery scrolling inside overflow-scrolling: touch
2538         https://bugs.webkit.org/show_bug.cgi?id=132591
2539         <rdar://problem/16760466>
2540
2541         Reviewed by Tim Horton.
2542         
2543         Avoid triggering layer tree commits that touch the layer's boundsOrigin
2544         while the user is scrolling in the UI process.
2545         
2546         Fix the WKOverflowScrollViewDelegate to pass along an "inUserInteration"
2547         flag to the ScrollingTree to say that we're in the middle of a user interaction
2548         (and also to send a final non-interactive update). That gets passed along
2549         to the web process, and turned into "SyncScrollingLayerPosition" update.
2550         AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll() consults
2551         this, and uses it to set a flag on the ScrollableArea to say that the scroll
2552         is a user scroll.
2553         
2554         RenderLayerBacking then makes use of this (in existing code, shared with WK1)
2555         to avoid triggering layer bounds setting. Instead, it now just calls syncBoundsOrigin(),
2556         which updates the GraphicsLayer without touching platform layers. This is necessary
2557         so that GraphicsLayer geometry is up-to-date (used for tiled layer visibility
2558         computations).
2559         
2560         Finally, a hack in GraphicsLayerCA::computeVisibleRect() is conditionalized
2561         for WebKit1 by checking the type of platform layer.
2562
2563         * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp:
2564         (WebKit::RemoteScrollingCoordinatorProxy::rootScrollingNodeID):
2565         (WebKit::RemoteScrollingCoordinatorProxy::isPointInNonFastScrollableRegion):
2566         (WebKit::RemoteScrollingCoordinatorProxy::viewportChangedViaDelegatedScrolling):
2567         (WebKit::RemoteScrollingCoordinatorProxy::scrollingTreeNodeDidScroll):
2568         * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h:
2569         * UIProcess/Scrolling/RemoteScrollingTree.cpp:
2570         (WebKit::RemoteScrollingTree::scrollingTreeNodeDidScroll):
2571         * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.h:
2572         * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:
2573         (-[WKOverflowScrollViewDelegate scrollViewDidScroll:]):
2574         (-[WKOverflowScrollViewDelegate scrollViewDidEndDragging:willDecelerate:]):
2575         (-[WKOverflowScrollViewDelegate scrollViewDidEndDecelerating:]):
2576         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::scrollViewDidScroll):
2577         * WebProcess/Scrolling/RemoteScrollingCoordinator.h:
2578         * WebProcess/Scrolling/RemoteScrollingCoordinator.messages.in:
2579         * WebProcess/Scrolling/RemoteScrollingCoordinator.mm:
2580         (WebKit::RemoteScrollingCoordinator::scrollPositionChangedForNode):
2581
2582 2014-05-05  Alexey Proskuryakov  <ap@apple.com>
2583
2584         Stop using BlobData on client side
2585         https://bugs.webkit.org/show_bug.cgi?id=132582
2586
2587         Reviewed by Sam Weinig.
2588
2589         Update for WebCore changes.
2590
2591         * CMakeLists.txt:
2592         * NetworkProcess/FileAPI/NetworkBlobRegistry.cpp:
2593         (WebKit::NetworkBlobRegistry::registerFileBlobURL):
2594         (WebKit::NetworkBlobRegistry::registerBlobURL):
2595         * NetworkProcess/FileAPI/NetworkBlobRegistry.h:
2596         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
2597         (WebKit::NetworkConnectionToWebProcess::registerFileBlobURL):
2598         (WebKit::NetworkConnectionToWebProcess::registerBlobURL):
2599         * NetworkProcess/NetworkConnectionToWebProcess.h:
2600         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
2601         * Shared/FileAPI/BlobRegistrationData.cpp: Removed.
2602         * Shared/FileAPI/BlobRegistrationData.h: Removed.
2603         * Shared/WebCoreArgumentCoders.cpp:
2604         (IPC::ArgumentCoder<BlobPart>::encode):
2605         (IPC::ArgumentCoder<BlobPart>::decode):
2606         * Shared/WebCoreArgumentCoders.h:
2607         * WebKit2.xcodeproj/project.pbxproj:
2608         * WebProcess/FileAPI/BlobRegistryProxy.cpp:
2609         (WebKit::BlobRegistryProxy::registerFileBlobURL):
2610         (WebKit::BlobRegistryProxy::registerBlobURL):
2611         * WebProcess/FileAPI/BlobRegistryProxy.h:
2612
2613 2014-05-05  Beth Dakin  <bdakin@apple.com>
2614
2615         Need a delegate that informs the UI process when the page's pin state changes
2616         https://bugs.webkit.org/show_bug.cgi?id=132583
2617         -and corresponding-
2618         <rdar://problem/16806231>
2619
2620         Reviewed by Anders Carlsson.
2621
2622         New UIClient function pinnedStateDidChange. 
2623
2624         * UIProcess/API/APIUIClient.h:
2625         (API::UIClient::pinnedStateDidChange):
2626
2627         Create WKPageUIClientV3 to add this function.
2628         * UIProcess/API/C/WKPage.cpp:
2629         (WKPageSetPageUIClient):
2630         * UIProcess/API/C/WKPageUIClient.h:
2631
2632         Change default initialization to true instead of false, which makes more sense for 
2633         this API.
2634         * UIProcess/WebPageProxy.cpp:
2635         (WebKit::WebPageProxy::WebPageProxy):
2636         (WebKit::WebPageProxy::didCommitLoadForFrame):
2637         (WebKit::WebPageProxy::resetState):
2638         (WebKit::WebPageProxy::didChangeScrollOffsetPinningForMainFrame):
2639         * WebProcess/WebPage/WebPage.cpp:
2640         (WebKit::WebPage::WebPage):
2641
2642 2014-05-05  Anders Carlsson  <andersca@apple.com>
2643
2644         Add SPI to provide the WebCrypto master key
2645         https://bugs.webkit.org/show_bug.cgi?id=132586
2646         <rdar://problem/16091460>
2647
2648         Reviewed by Dan Bernstein.
2649
2650         * UIProcess/API/APILoaderClient.h:
2651         (API::LoaderClient::webCryptoMasterKey):
2652         * UIProcess/API/C/WKPage.cpp:
2653         (WKPageSetPageLoaderClient):
2654         * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
2655         * UIProcess/Cocoa/NavigationState.h:
2656         * UIProcess/Cocoa/NavigationState.mm:
2657         (WebKit::NavigationState::setNavigationDelegate):
2658         (WebKit::NavigationState::LoaderClient::webCryptoMasterKey):
2659         * UIProcess/WebPageProxy.cpp:
2660         (WebKit::WebPageProxy::wrapCryptoKey):
2661
2662 2014-05-05  Gavin Barraclough  <baraclough@apple.com>
2663
2664         https://bugs.webkit.org/show_bug.cgi?id=132522
2665         Clean up ProcessThrottler
2666
2667         Unreviewed: bad build fix. Will work out what the right include is asap.
2668
2669         * UIProcess/ios/WebProcessProxyIOS.mm:
2670
2671 2014-05-05  Sam Weinig  <sam@webkit.org>
2672
2673         [Cocoa WebKit2] Add SPI to clear all visited links in a VisitedLinkProvider
2674         https://bugs.webkit.org/show_bug.cgi?id=132573
2675
2676         Reviewed by Dan Bernstein.
2677
2678         * Shared/VisitedLinkTable.cpp:
2679         (WebKit::VisitedLinkTable::VisitedLinkTable):
2680         (WebKit::VisitedLinkTable::clear):
2681         * Shared/VisitedLinkTable.h:
2682         Add functions to clear the visited link table.
2683
2684         * UIProcess/API/Cocoa/_WKVisitedLinkProvider.h:
2685         * UIProcess/API/Cocoa/_WKVisitedLinkProvider.mm:
2686         (-[_WKVisitedLinkProvider removeAll]):
2687         Add SPI.
2688
2689         * UIProcess/VisitedLinkProvider.cpp:
2690         (WebKit::VisitedLinkProvider::removeAll):
2691         * UIProcess/VisitedLinkProvider.h:
2692         A remove all resets the provider and notifies all the attached processes.
2693
2694         * WebProcess/WebPage/VisitedLinkTableController.cpp:
2695         (WebKit::VisitedLinkTableController::removeAllVisitedLinks):
2696         * WebProcess/WebPage/VisitedLinkTableController.h:
2697         * WebProcess/WebPage/VisitedLinkTableController.messages.in:
2698         Add message to clear the visited links for a process.
2699
2700 2014-05-05  Benjamin Poulain  <benjamin@webkit.org>
2701
2702         [iOS][WK2] Special case ViewGestureGeometryCollector::collectGeometryForSmartMagnificationGesture() for image documents
2703         https://bugs.webkit.org/show_bug.cgi?id=132553
2704
2705         Reviewed by Tim Horton.
2706
2707         When collecting the geometry for the smart magnification gesture, always return the image of an image document
2708         on iOS. On iOS, it does not make much sense to return the whole document rect when the gesture is not over the image.
2709
2710         * WebProcess/WebPage/ViewGestureGeometryCollector.cpp:
2711         (WebKit::ViewGestureGeometryCollector::collectGeometryForSmartMagnificationGesture):
2712
2713 2014-05-02  Gavin Barraclough  <baraclough@apple.com>
2714
2715         https://bugs.webkit.org/show_bug.cgi?id=132522
2716         Clean up ProcessThrottler
2717
2718         Reviewed by Geoffrey Garen.
2719
2720         The initial implementation of ProcessThrottler relied on the reply from the
2721         SetViewState message to ensure the page visibility notifications have a chance
2722         to be delivered. This resulted in:
2723             - unnecessarily complicated interface to ProcessThrottler (in VisibilityState class)
2724             - complexity bleeding out into WebPageProxy (handling 'hiding' state).
2725             - for cases other than view hiding, no suspension notification in the WebContent.
2726
2727         To fix these issues add an explicit handshake from the ProcessThrottler to the WebPage.
2728         This gives us two things:
2729             - All previously posted messages (e.g. SetViewState) will be processed before suspension.
2730             - WebContent is always (bar timeout) notified before suspension.
2731
2732         Since this interlock ensures the SetViewState message will be processed, the WKContentView no
2733         longer needs to request a reply from SetViewState, and WebPageProxy can lose all the 'hiding'
2734         state tracking. In turn, we can simplify VisibilityToken to a couple of simpler types, without
2735         the interface to change state - just acquire/release to keep the process runnable or permit
2736         suspension.
2737
2738         * UIProcess/API/Cocoa/WKWebView.mm:
2739         (-[WKWebView _snapshotRect:intoImageOfWidth:completionHandler:]):
2740             - VisibilityToken -> BackgroundActivityToken
2741         * UIProcess/WebPageProxy.cpp:
2742         (WebKit::WebPageProxy::WebPageProxy):
2743             - m_visibilityToken -> m_activityToken, remove m_pendingViewStateUpdates
2744               updateVisibilityToken -> updateActivityToken
2745         (WebKit::WebPageProxy::reattachToWebProcess):
2746             - updateVisibilityToken -> updateActivityToken
2747         (WebKit::WebPageProxy::viewStateDidChange):
2748             - remove m_pendingViewStateUpdates, updateActivityToken after sending SetViewState
2749         (WebKit::WebPageProxy::updateActivityToken):
2750             - m_visibilityToken -> m_activityToken, no need to handle 'hiding' state.
2751         (WebKit::WebPageProxy::updateVisibilityToken): Deleted.
2752             - renamed to updateActivityToken
2753         (WebKit::WebPageProxy::didUpdateViewState): Deleted.
2754             - implementation moved back into header.
2755         * UIProcess/WebPageProxy.h:
2756         (WebKit::WebPageProxy::didUpdateViewState):
2757             - implementation moved back into header.
2758         * UIProcess/WebProcessProxy.cpp:
2759         (WebKit::WebProcessProxy::WebProcessProxy):
2760             - ProcessThrottler constructor now passed WebProcessProxy.
2761         * UIProcess/WebProcessProxy.h:
2762             - added ProcessWillSuspend/ProcessReadyToSuspend
2763         * UIProcess/WebProcessProxy.messages.in:
2764             - added ProcessWillSuspend/ProcessReadyToSuspend
2765         * UIProcess/ios/ProcessAssertion.h:
2766         (WebKit::ProcessAssertion::state):
2767             - accessor
2768         * UIProcess/ios/ProcessThrottler.h:
2769         (WebKit::ProcessThrottler::VisibilityToken::visibility): Deleted.
2770         (WebKit::ProcessThrottler::VisibilityToken::setVisibility): Deleted.
2771             - removed VisibilityToken class, replaced with ForegroundActivityToken/BackgroundActivityToken.
2772         (WebKit::ProcessThrottler::ProcessThrottler): Deleted.
2773         (WebKit::ProcessThrottler::visibilityToken): Deleted.
2774         (WebKit::ProcessThrottler::didConnnectToProcess): Deleted.
2775         (WebKit::ProcessThrottler::assertionState): Deleted.
2776         (WebKit::ProcessThrottler::updateAssertion): Deleted.
2777             - moved implementations to .mm.
2778         * UIProcess/ios/ProcessThrottler.mm:
2779         (WebKit::ProcessThrottler::ForegroundActivityToken::ForegroundActivityToken):
2780         (WebKit::ProcessThrottler::ForegroundActivityToken::~ForegroundActivityToken):
2781         (WebKit::ProcessThrottler::BackgroundActivityToken::BackgroundActivityToken):
2782         (WebKit::ProcessThrottler::BackgroundActivityToken::~BackgroundActivityToken):
2783             - new, simpler replacement for VisibilityToken. Instantiate to keep a processes running, release to suspend.
2784         (WebKit::ProcessThrottler::ProcessThrottler):
2785             - constructor, now initializes WebProcessProxy pointer & timer mechanism
2786         (WebKit::ProcessThrottler::assertionState):
2787             - select the appropriate AssertionState give current ActivityTokens.
2788         (WebKit::ProcessThrottler::updateAssertionNow):
2789             - update the current ProcessAssertion.
2790         (WebKit::ProcessThrottler::updateAssertion):
2791             - update the current ProcessAssertion, delay running->suspended transitions to give the process a chance to clean up.
2792         (WebKit::ProcessThrottler::didConnnectToProcess):
2793             - moved from header.
2794         (WebKit::ProcessThrottler::suspendTimerFired):
2795             - timeout to prevent processes from running in the background for too long.
2796         (WebKit::ProcessThrottler::processReadyToSuspend):
2797             - handshake from the WebContent process to acknowledge it is ready to suspend.
2798         (WebKit::ProcessThrottler::VisibilityToken::VisibilityToken): Deleted.
2799         (WebKit::ProcessThrottler::VisibilityToken::~VisibilityToken): Deleted.
2800         (WebKit::ProcessThrottler::VisibilityToken::hideTimerFired): Deleted.
2801         (WebKit::ProcessThrottler::VisibilityToken::setVisibilityInternal): Deleted.
2802             - removed VisibilityToken class, replaced with ForegroundActivityToken/BackgroundActivityToken.
2803         * UIProcess/ios/WKContentView.mm:
2804         (-[WKContentView didMoveToWindow]):
2805             - no longer necessary to request a response from SetViewState; this interlock is now managed by the ProcessThrottler.
2806         * UIProcess/ios/WebProcessProxyIOS.mm:
2807         (WebKit::WebProcessProxy::sendProcessWillSuspend):
2808         (WebKit::WebProcessProxy::processReadyToSuspend):
2809             - added ProcessWillSuspend/ProcessReadyToSuspend
2810         * WebProcess/WebProcess.cpp:
2811         (WebKit::WebProcess::processWillSuspend):
2812             - notification from the WebContent process that we will be suspended; for now just send back an ack.
2813         * WebProcess/WebProcess.h:
2814             - added ProcessWillSuspend/ProcessReadyToSuspend
2815         * WebProcess/WebProcess.messages.in:
2816             - added ProcessWillSuspend/ProcessReadyToSuspend
2817
2818 2014-05-05  Jeremy Jones  <jeremyj@apple.com>
2819
2820         Implement beginScrubbing and endScrubbing for video fullscreen.
2821         https://bugs.webkit.org/show_bug.cgi?id=132520
2822
2823         Reviewed by Eric Carlson.
2824
2825         Plumb through beginScrubbing and endScrubbing.
2826
2827         * UIProcess/ios/WebVideoFullscreenManagerProxy.h:
2828         * UIProcess/ios/WebVideoFullscreenManagerProxy.mm:
2829         (WebKit::WebVideoFullscreenManagerProxy::beginScrubbing):
2830         (WebKit::WebVideoFullscreenManagerProxy::endScrubbing):
2831         * WebProcess/ios/WebVideoFullscreenManager.messages.in:
2832
2833 2014-05-05  Tim Horton  <timothy_horton@apple.com>
2834
2835         Use a layer delegate instead of web_disableAllActions wherever possible
2836         https://bugs.webkit.org/show_bug.cgi?id=132560
2837         <rdar://problem/16459284>
2838
2839         Reviewed by Simon Fraser.
2840
2841         * UIProcess/API/mac/WKView.mm:
2842         (-[WKView _setAcceleratedCompositingModeRootLayer:]):
2843         * UIProcess/ios/RemoteLayerTreeHostIOS.mm:
2844         (WebKit::RemoteLayerTreeHost::createLayer):
2845         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
2846         (WebKit::RemoteLayerTreeDrawingAreaProxy::showDebugIndicator):
2847         * UIProcess/mac/RemoteLayerTreeHost.mm:
2848         (WebKit::RemoteLayerTreeHost::createLayer):
2849         * UIProcess/mac/ViewGestureControllerMac.mm:
2850         (WebKit::ViewGestureController::beginSwipeGesture):
2851         Make use of WebActionDisablingCALayerDelegate where possible.
2852         Also, UIKit disables actions for us, so don't bother doing anything on iOS.
2853
2854 2014-05-05  Martin Hock  <mhock@apple.com>
2855
2856         Session-aware plugin autostart data
2857         https://bugs.webkit.org/show_bug.cgi?id=131758
2858         <rdar://problem/15906540>
2859
2860         Reviewed by Alexey Proskuryakov.
2861
2862         * Shared/WebProcessCreationParameters.cpp:
2863         * Shared/WebProcessCreationParameters.h:
2864         * UIProcess/Plugins/PlugInAutoStartProvider.cpp:
2865         (WebKit::PlugInAutoStartProvider::PlugInAutoStartProvider):
2866         (WebKit::PlugInAutoStartProvider::addAutoStartOriginHash):
2867         (WebKit::PlugInAutoStartProvider::autoStartOriginHashesCopy):
2868         (WebKit::PlugInAutoStartProvider::autoStartOriginsTableCopy):
2869         (WebKit::PlugInAutoStartProvider::setAutoStartOriginsTableWithItemsPassingTest):
2870         (WebKit::PlugInAutoStartProvider::setAutoStartOriginsArray):
2871         (WebKit::PlugInAutoStartProvider::didReceiveUserInteraction):
2872         * UIProcess/Plugins/PlugInAutoStartProvider.h:
2873         * UIProcess/WebContext.cpp:
2874         (WebKit::WebContext::addPlugInAutoStartOriginHash):
2875         (WebKit::WebContext::plugInDidReceiveUserInteraction):
2876         * UIProcess/WebContext.h:
2877         * UIProcess/WebContext.messages.in:
2878         * WebProcess/Plugins/PluginView.cpp:
2879         (WebKit::PluginView::pluginDidReceiveUserInteraction):
2880         * WebProcess/WebCoreSupport/WebPlugInClient.cpp:
2881         (WebKit::WebPlugInClient::didStartFromOrigin):
2882         * WebProcess/WebCoreSupport/WebPlugInClient.h:
2883         * WebProcess/WebProcess.cpp:
2884         (WebKit::WebProcess::WebProcess):
2885         (WebKit::WebProcess::isPlugInAutoStartOriginHash):
2886         (WebKit::WebProcess::shouldPlugInAutoStartFromOrigin):
2887         (WebKit::WebProcess::plugInDidStartFromOrigin):
2888         (WebKit::WebProcess::didAddPlugInAutoStartOriginHash):
2889         (WebKit::WebProcess::resetPlugInAutoStartOriginDefaultHashes):
2890         (WebKit::WebProcess::resetPlugInAutoStartOriginHashes):
2891         (WebKit::WebProcess::plugInDidReceiveUserInteraction):
2892         * WebProcess/WebProcess.h:
2893         * WebProcess/WebProcess.messages.in:
2894
2895 2014-05-05  Andy Estes  <aestes@apple.com>
2896
2897         Another iOS build fix after r168260.
2898
2899         Removed an unnecessary 'using namespace WebCore'.
2900
2901         * UIProcess/ios/WebMemoryPressureHandlerIOS.cpp:
2902
2903 2014-05-05  Tim Horton  <timothy_horton@apple.com>
2904
2905         Fix the iOS build.
2906
2907         * UIProcess/API/Cocoa/WKWebView.mm:
2908
2909 2014-05-05  Ryuan Choi  <ryuan.choi@samsung.com>
2910
2911         [EFL][WK2] Refactor favicon database APIs
2912         https://bugs.webkit.org/show_bug.cgi?id=132519
2913
2914         Reviewed by Gyuyoung Kim.
2915
2916         ewebkit2 has two options to get favicon.
2917
2918         The first option is ewk_view_favicon_get with "favicon,changed" signal.
2919         It's simple to use but it always adds the callback to EwkView although applications does not use favicon.
2920
2921         The other option is ewk_favicon_database_icon_get with ewk_favicon_database_icon_change_callback_add API.
2922         But the callback doesn't have information about Ewk_Favicon_Database to call ewk_favicon_database_icon_get.
2923
2924         This patch removed ewk_view_favicon_get and "favicon,changed" signal.
2925         In addition, improved ewk_favicon_database_icon_change_callback.
2926
2927         * UIProcess/API/efl/EwkView.cpp: Remove ewk_favicon_database related code.
2928         (EwkView::EwkView):
2929         (EwkView::~EwkView):
2930         (EwkView::informURLChange):
2931         (EwkView::handleFaviconChanged):
2932         (EwkView::createFavicon): Deleted.
2933         * UIProcess/API/efl/EwkViewCallbacks.h:
2934         * UIProcess/API/efl/ewk_favicon_database.cpp:
2935         (EwkFaviconDatabase::iconDataReadyForPageURL):
2936         (EwkFaviconDatabase::didChangeIconForPageURL): Deleted. dead code.
2937         * UIProcess/API/efl/ewk_favicon_database.h:
2938         Refactor Ewk_Favicon_Database_Icon_Change_Cb and improve doxygen.
2939         * UIProcess/API/efl/ewk_favicon_database_private.h:
2940         * UIProcess/API/efl/ewk_view.cpp:
2941         (ewk_view_favicon_get): Deleted.
2942         * UIProcess/API/efl/ewk_view.h:
2943         * UIProcess/API/efl/tests/test_ewk2_favicon_database.cpp:
2944         (EWK2FaviconDatabaseTest::requestFaviconData):
2945         (TEST_F):
2946
2947 2014-05-05  Tim Horton  <timothy_horton@apple.com>
2948
2949         [iOS WebKit2] Swipe snapshots should be taken asynchronously
2950         https://bugs.webkit.org/show_bug.cgi?id=132417
2951         <rdar://problem/16535921>
2952
2953         Reviewed by Anders Carlsson.
2954
2955         Reorganize takeViewSnapshot to return a ViewSnaphot with the image
2956         filled in (the other properties are filled in by ViewSnapshotStore).
2957
2958         Make ViewSnapshotStore use a fixed size instead of count for the snapshot cache.
2959         iOS doesn't use purgeable snapshots, so make the cache much smaller there.
2960
2961         Use CARenderServerCaptureLayerWithTransform to achieve async snapshotting.
2962
2963         Rename WebKit::ViewSnapshotStore::Snapshot to WebKit::ViewSnapshot so that
2964         it can be forward-declared in a bunch of places.
2965
2966         * UIProcess/API/Cocoa/WKWebView.mm:
2967         (-[WKWebView _takeViewSnapshot:]):
2968         Use CARenderServerCaptureLayerWithTransform.
2969
2970         * UIProcess/API/Cocoa/WKWebViewInternal.h:
2971         * UIProcess/API/mac/WKView.mm:
2972         (createIOSurfaceFromImage):
2973         (-[WKView _takeViewSnapshot:]):
2974         Adjust to the new push model.
2975
2976         * UIProcess/API/mac/WKViewInternal.h:
2977         * UIProcess/PageClient.h:
2978         * UIProcess/WebPageProxy.cpp:
2979         (WebKit::WebPageProxy::takeViewSnapshot):
2980         * UIProcess/WebPageProxy.h:
2981         * UIProcess/ios/PageClientImplIOS.h:
2982         * UIProcess/ios/PageClientImplIOS.mm:
2983         (WebKit::PageClientImpl::takeViewSnapshot):
2984         * UIProcess/mac/PageClientImpl.h:
2985         * UIProcess/mac/PageClientImpl.mm:
2986         (WebKit::PageClientImpl::takeViewSnapshot):
2987         Plumbing.
2988
2989         * UIProcess/ios/ViewGestureControllerIOS.mm:
2990         (WebKit::ViewGestureController::beginSwipeGesture):
2991         (WebKit::ViewGestureController::endSwipeGesture):
2992         Realize an object that can be used as the layer contents from the slot ID.
2993
2994         * UIProcess/ios/WebMemoryPressureHandlerIOS.cpp:
2995         (WebKit::WebMemoryPressureHandler::sharedHandler):
2996         (WebKit::WebMemoryPressureHandler::WebMemoryPressureHandler):
2997         * UIProcess/WebMemoryPressureHandlerIOS.h:
2998         Add a memory pressure handler for the UI process. This does not use
2999         WebCore's platform independent memory pressure handler because that
3000         mechanism only allows for one handler per process, and we don't want to
3001         stomp on any handlers installed by WebKit1 in a process where the WebKits coexist.
3002
3003         * UIProcess/ios/WKContentView.h:
3004         * UIProcess/ios/WKContentView.mm:
3005         (-[WKContentView _takeViewSnapshot]): Deleted.
3006         Get rid of an unnecessary bounce through WKContentView.
3007
3008         * UIProcess/mac/ViewGestureControllerMac.mm:
3009         (WebKit::ViewGestureController::retrieveSnapshotForItem):
3010         (WebKit::ViewGestureController::endSwipeGesture):
3011         Use the new name, ViewSnapshot.
3012
3013         * UIProcess/mac/ViewSnapshotStore.h:
3014         (WebKit::ViewSnapshot::ViewSnapshot):
3015         * UIProcess/mac/ViewSnapshotStore.mm:
3016         (WebKit::ViewSnapshotStore::ViewSnapshotStore):
3017         (WebKit::ViewSnapshotStore::~ViewSnapshotStore):
3018         (WebKit::ViewSnapshotStore::snapshottingContext):
3019         Use a custom CAContext for snapshotting so that snapshots don't
3020         disappear when the main context is destroyed on hibernation.
3021
3022         (WebKit::ViewSnapshotStore::removeSnapshotImage):
3023         (WebKit::ViewSnapshotStore::pruneSnapshots):
3024         (WebKit::ViewSnapshotStore::recordSnapshot):
3025         (WebKit::ViewSnapshotStore::getSnapshot):
3026         (WebKit::ViewSnapshotStore::discardSnapshots):
3027         (WebKit::ViewSnapshot::clearImage):
3028         (WebKit::ViewSnapshot::hasImage):
3029         (WebKit::createIOSurfaceFromImage): Deleted.
3030         (WebKit::ViewSnapshotStore::Snapshot::clearImage): Deleted.
3031         (WebKit::ViewSnapshotStore::Snapshot::hasImage): Deleted.
3032         Cache by image size instead of counts.
3033
3034         * WebKit2.xcodeproj/project.pbxproj:
3035
3036 2014-05-04  Pratik Solanki  <psolanki@apple.com>
3037
3038         Reduce calls to CFURLCacheCopySharedURLCache
3039         https://bugs.webkit.org/show_bug.cgi?id=132464
3040         <rdar://problem/16806694>
3041
3042         Address review comments by collapsing multi-line code into a single ASSERT.
3043
3044         * NetworkProcess/mac/NetworkResourceLoaderMac.mm:
3045         (WebKit::NetworkResourceLoader::tryGetShareableHandleFromSharedBuffer):
3046
3047 2014-05-04  Pratik Solanki  <psolanki@apple.com>
3048
3049         Shortcircuit shouldUseCredentialStorage callback
3050         https://bugs.webkit.org/show_bug.cgi?id=132308
3051         <rdar://problem/16806708>
3052
3053         Reviewed by Alexey Proskuryakov.
3054
3055         If we are going to return true from the shouldUseCredentialStorage callback then we don't
3056         really need to have CFNetwork/Foundation call us. We can just disable the callback and
3057         CFNetwork will assume true. Add a separate subclass that implements this callback when we
3058         need to return false. We can also eliminate the corresponding async callbacks. This avoids
3059         pingponging between dispatch queue and main thread in the common case.
3060
3061         No new tests because no change in functionality.
3062
3063         * NetworkProcess/NetworkResourceLoader.cpp: Remove shouldUseCredentialStorageAsync() callbacks.
3064         * NetworkProcess/NetworkResourceLoader.h:
3065
3066 2014-05-04  Beth Dakin  <bdakin@apple.com>
3067
3068         Top content inset: Margin tiles should not display in the inset area when pinned 
3069         to the top of the page
3070         https://bugs.webkit.org/show_bug.cgi?id=132535
3071         -and corresponding-
3072         <rdar://problem/16613039>
3073
3074         Reviewed by Simon Fraser.
3075
3076         Encode and decode the ScrollingStateScrollingNode’s m_topContentInset even though 
3077         we don’t use it for anything yet. Since the headerLayer and footerLayer are not 
3078         encoded or decoded yet, I did not encode/decode the insetClipLayer yet, which, 
3079         like the header and footer layers, would not yet be used. 
3080         * Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp:
3081         (ArgumentCoder<ScrollingStateScrollingNode>::encode):
3082         (ArgumentCoder<ScrollingStateScrollingNode>::decode):
3083
3084 2014-05-03  Commit Queue  <commit-queue@webkit.org>
3085
3086         Unreviewed, rolling out r168232.
3087         https://bugs.webkit.org/show_bug.cgi?id=132543
3088
3089         broke ~15 tests on WK2 debug (Requested by kling on #webkit).
3090
3091         Reverted changeset:
3092
3093         "Shortcircuit shouldUseCredentialStorage callback"
3094         https://bugs.webkit.org/show_bug.cgi?id=132308
3095         http://trac.webkit.org/changeset/168232
3096
3097 2014-05-03  Tim Horton  <timothy_horton@apple.com>
3098
3099         [iOS] REGRESSION (WebKit2): Page isn't clipped properly during back/forward swipe
3100         https://bugs.webkit.org/show_bug.cgi?id=132538
3101         <rdar://problem/16266027>
3102
3103         Reviewed by Simon Fraser.
3104
3105         * UIProcess/ios/ViewGestureControllerIOS.mm:
3106         (WebKit::ViewGestureController::beginSwipeGesture):
3107         (WebKit::ViewGestureController::endSwipeGesture):
3108         * UIProcess/mac/ViewGestureController.h:
3109         Add a clipping layer above the live swipe layer, which explicitly clips to bounds.
3110
3111 2014-05-02  Pratik Solanki  <psolanki@apple.com>
3112
3113         Shortcircuit shouldUseCredentialStorage callback
3114         https://bugs.webkit.org/show_bug.cgi?id=132308
3115         <rdar://problem/16806708>
3116
3117         Reviewed by Alexey Proskuryakov.
3118
3119         If we are going to return true from the shouldUseCredentialStorage callback then we don't
3120         really need to have CFNetwork/Foundation call us. We can just disable the callback and
3121         CFNetwork will assume true. Add a separate subclass that implements this callback when we
3122         need to return false. We can also eliminate the corresponding async callbacks. This avoids
3123         pingponging between dispatch queue and main thread in the common case.
3124
3125         No new tests because no change in functionality.
3126
3127         * NetworkProcess/NetworkResourceLoader.cpp: Remove shouldUseCredentialStorageAsync() callbacks.
3128         * NetworkProcess/NetworkResourceLoader.h:
3129
3130 2014-05-02  Pratik Solanki  <psolanki@apple.com>
3131
3132         Reduce calls to CFURLCacheCopySharedURLCache
3133         https://bugs.webkit.org/show_bug.cgi?id=132464
3134         <rdar://problem/16806694>
3135
3136         Reviewed by Alexey Proskuryakov.
3137
3138         CFURLCacheCopySharedURLCache grabs a mutex and can sometimes block. Avoid that by stashing
3139         the cache reference in a static.
3140
3141         * NetworkProcess/NetworkResourceLoader.h: Coalesce ifdef'd code.
3142         * NetworkProcess/mac/NetworkResourceLoaderMac.mm:
3143         (WebKit::NetworkResourceLoader::tryGetShareableHandleFromSharedBuffer):
3144         (WebKit::NetworkResourceLoader::willCacheResponseAsync): Use more correct ifdef for
3145         Foundation based callback.
3146
3147 2014-05-03  Sam Weinig  <sam@webkit.org>
3148
3149         [Cocoa WebKit2] Add basic _WKWebsiteDataStore implementation
3150         https://bugs.webkit.org/show_bug.cgi?id=132526
3151
3152         Reviewed by Anders Carlsson.
3153
3154         - Renames WKSession to _WKWebsiteDataStore to better reflect its intended use (renaming
3155           the implementation object will come later).
3156         - Makes _WKWebsiteDataStore work as a wrapped Objective-C object.
3157         - Adds the ability to set a _WKWebsiteDataStore on the WKWebViewConfiguration.
3158
3159         * Shared/Cocoa/APIObject.mm:
3160         (API::Object::newObject):
3161         * UIProcess/API/Cocoa/WKSession.h:
3162         * UIProcess/API/Cocoa/WKSession.mm:
3163         (-[WKSession dealloc]): Deleted.
3164         (-[WKSession ephemeral]): Deleted.
3165         (-[WKSession API::]): Deleted.
3166         * UIProcess/API/Cocoa/WKSessionInternal.h:
3167         (WebKit::wrapper): Deleted.
3168         * UIProcess/API/Cocoa/WKWebView.mm:
3169         (-[WKWebView initWithFrame:configuration:]):
3170         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
3171         (-[WKWebViewConfiguration copyWithZone:]):
3172         (-[WKWebViewConfiguration _websiteDataStore]):
3173         (-[WKWebViewConfiguration _setWebsiteDataStore:]):
3174         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
3175         * UIProcess/API/Cocoa/_WKWebsiteDataStore.h: Copied from Source/WebKit2/UIProcess/API/Cocoa/WKSession.h.
3176         * UIProcess/API/Cocoa/_WKWebsiteDataStore.mm: Copied from Source/WebKit2/UIProcess/API/Cocoa/WKSession.mm.
3177         (+[_WKWebsiteDataStore nonPersistentDataStore]):
3178         (-[_WKWebsiteDataStore isNonPersistentDataStore]):
3179         (-[WKSession ephemeral]): Deleted.
3180         * UIProcess/API/Cocoa/_WKWebsiteDataStoreInternal.h: Copied from Source/WebKit2/UIProcess/API/Cocoa/WKSessionInternal.h.
3181         * WebKit2.xcodeproj/project.pbxproj:
3182
3183 2014-05-03  Simon Fraser  <simon.fraser@apple.com>
3184
3185         [UI-side compositing] Assertion in PlatformCAFilters::setFiltersOnLayer with animated reference filter
3186         https://bugs.webkit.org/show_bug.cgi?id=132528
3187         <rdar://problem/16671660>
3188
3189         Reviewed by Tim Horton.
3190         
3191         Allow PASSTHROUGH filters to be encoded and sent to the UI process; they can be set
3192         on layers as the result of a filter animation using a reference filter, and just get
3193         ignored anyway, but encoding them maintains consistency of the filters list.
3194
3195         * Shared/WebCoreArgumentCoders.cpp:
3196         (IPC::ArgumentCoder<FilterOperation>::encode): Assert during encoding if
3197         we try to encode a NONE or REFERENCE filter (to match the decoding assertions).
3198         (IPC::decodeFilterOperation): Allow decoding of PASSTHROUGH filters. Have
3199         trying to decode a NONE or REFERENCE filter mark the message as invalid.
3200         (IPC::ArgumentCoder<IDBKeyData>::decode): Mark the message invalid when receiving
3201         unexpected key types.
3202         * Shared/mac/RemoteLayerTreeTransaction.mm:
3203         (WebKit::RemoteLayerTreeTextStream::operator<<): Have the logging not crash if
3204         a filter is null (should never happen).
3205
3206 2014-05-02  Dan Bernstein  <mitz@apple.com>
3207
3208         [Cocoa] Remove unused WKErrorRecoveryAttempting
3209         https://bugs.webkit.org/show_bug.cgi?id=132503
3210
3211         Reviewed by Anders Carlsson.
3212
3213         * UIProcess/API/Cocoa/WKBrowsingContextController.mm:
3214         (didFailProvisionalLoadWithErrorForFrame):
3215         (didFailLoadWithErrorForFrame):
3216         (createErrorWithRecoveryAttempter): Deleted.
3217         (-[WKBrowsingContextController attemptRecoveryFromError:]): Deleted.
3218         * UIProcess/API/Cocoa/WKErrorRecoveryAttempting.m: Removed.
3219         * UIProcess/API/Cocoa/_WKFormDelegate.h:
3220         * WebKit2.xcodeproj/project.pbxproj:
3221
3222 2014-05-02  Enrica Casucci  <enrica@apple.com>
3223
3224         REGRESSION (WebKit2) Need to support reanalyze button for Chinese Traditional.
3225         https://bugs.webkit.org/show_bug.cgi?id=132504
3226         <rdar://problem/16778862>
3227
3228         Reviewed by Benjamin Poulain.
3229
3230         For traditional Chinese we support reanalyzing of the text to perform
3231         transformations on the text based on the selected language and keyboard.
3232         This is done by pressing the Reanalyze button on the system
3233         menu. This patch adds the necessary code to canPerformAction to enable
3234         the button when appropriate as well as the implementation of the action
3235         itself.
3236
3237         * UIProcess/ios/WKContentViewInteraction.mm:
3238         (-[WKContentView _reanalyze:]):
3239         (-[WKContentView canPerformAction:withSender:]):
3240
3241 2014-05-02  Enrica Casucci  <enrica@apple.com>
3242
3243         REGRESSION (WebKit2) Need to support transliterate chinese button (简⇄繁) for Traditional Chinese.
3244         https://bugs.webkit.org/show_bug.cgi?id=132500
3245         <rdar://problem/16778870>
3246
3247         Reviewed by Benjamin Poulain.
3248
3249         For traditional Chinese we support the transliterate to simplified Chinese.
3250         This is done by pressing the 简⇄繁 button on the system
3251         menu. This patch adds the necessary code to canPerformAction to enable
3252         the button when appropriate as well as the implementation of the action
3253         itself.
3254
3255         * UIProcess/ios/WKContentViewInteraction.mm:
3256         (-[WKContentView _transliterateChinese:]):
3257         (-[WKContentView canPerformAction:withSender:]):
3258
3259 2014-05-02  Jeremy Jones  <jeremyj@apple.com>
3260
3261         Fullscreen UI does not appear after WebProcess has crashed
3262         https://bugs.webkit.org/show_bug.cgi?id=132442
3263
3264         Reviewed by Darin Adler.
3265
3266         Cleanup WebVideoFullscreenManagerProxy after a WebProcess crash.
3267
3268         * UIProcess/WebPageProxy.cpp:
3269         (WebKit::WebPageProxy::reattachToWebProcess):
3270         recreate WebVideoFullscreenManagerProxy after a WebProcess crash.
3271
3272         (WebKit::WebPageProxy::resetState):
3273         invalidate and release WebVideoFullscreenManagerProxy on crash.
3274
3275         * UIProcess/ios/WebVideoFullscreenManagerProxy.h:
3276         * UIProcess/ios/WebVideoFullscreenManagerProxy.mm:
3277         (WebKit::WebVideoFullscreenManagerProxy::~WebVideoFullscreenManagerProxy):
3278         don't assume m_page is valid.
3279
3280         (WebKit::WebVideoFullscreenManagerProxy::invalidate):
3281         do cleanup invalidation in reponse to a WebProcess crash.
3282
3283 2014-05-02  Benjamin Poulain  <bpoulain@apple.com>
3284
3285         [iOS][WK2] More animation madness for when the extendedBackground is modified in an animation block
3286         https://bugs.webkit.org/show_bug.cgi?id=132497
3287
3288         Reviewed by Beth Dakin.
3289
3290         * UIProcess/API/Cocoa/WKWebView.mm:
3291         (updateTopAndBottomExtendedBackgroundExclusionIfNecessary):
3292         Do not early return when _extendedBackgroundExclusionInsets.left is empty. That way, if executed in an animation block,
3293         the top of bottom view will animate from their current size to an empty width.
3294
3295         When creating the layer, set up their height without animation. Otherwise it is possible to see the height animating
3296         while the left inset is animating.
3297
3298         (-[WKWebView _setExtendedBackgroundExclusionInsets:]):
3299         When replacing the scrollview, make sure the frame and color are not animated. Otherwise the transition between
3300         scrollView and _mainExtendedBackgroundView can be visible if _setExtendedBackgroundExclusionInsets: is invoked
3301         in an animation block.
3302
3303         (-[WKWebView _endAnimatedResize]):
3304         Nuke the top and bottom insets when possible. [WKWebView _endAnimatedResize] is unfrequent, so it is a good opportunity
3305         to free the memory.
3306
3307 2014-05-02  Alexey Proskuryakov  <ap@apple.com>
3308
3309         Remove Blob contentDisposition handling
3310         https://bugs.webkit.org/show_bug.cgi?id=132490
3311
3312         Reviewed by Sam Weinig.
3313
3314         * Shared/FileAPI/BlobRegistrationData.cpp:
3315         (WebKit::BlobRegistrationData::encode):
3316         (WebKit::BlobRegistrationData::decode):
3317
3318 2014-05-02  Benjamin Poulain  <benjamin@webkit.org>
3319
3320         [iOS][WK2] Adapt the rubberband constraints when the page get smaller than the scrollview - insets
3321         https://bugs.webkit.org/show_bug.cgi?id=132457
3322
3323         Reviewed by Enrica Casucci.
3324
3325         It is quite common for us to have a WKContentView that is scalled smaller than the WKWebView, content
3326         insets included.
3327
3328         In those cases, update the constraints to fit the content properly in the view.
3329
3330         * UIProcess/ios/WKScrollView.mm:
3331         (valuesAreWithinOnePixel):
3332         (-[WKScrollView _rubberBandOffsetForOffset:maxOffset:minOffset:range:outside:]):
3333
3334 2014-05-02  Mark Rowe  <mrowe@apple.com>
3335
3336         -[_WKThumbnailView _requestSnapshotIfNeeded] assumes that taking a snapshot will always succeed
3337         <https://webkit.org/b/132489> / <rdar://problem/16704660>
3338
3339         Reviewed by Tim Horton.
3340
3341         * UIProcess/API/Cocoa/_WKThumbnailView.mm:
3342         (-[_WKThumbnailView _requestSnapshotIfNeeded]): Don't attempt to create a CGImageRef if we failed
3343         to create a ShareableBitmap. This handles both the callback receiving a null Handle and a failure
3344         within ShareableBitmap::create.
3345
3346 2014-05-02  Anders Carlsson  <andersca@apple.com>
3347
3348         Clean up FormDataElement
3349         https://bugs.webkit.org/show_bug.cgi?id=132483
3350
3351         Reviewed by Sam Weinig.
3352
3353         * NetworkProcess/NetworkResourceLoader.cpp:
3354         (WebKit::NetworkResourceLoader::NetworkResourceLoader):
3355         * Shared/Network/NetworkResourceLoadParameters.cpp:
3356         (WebKit::NetworkResourceLoadParameters::encode):
3357
3358 2014-05-02  Anders Carlsson  <andersca@apple.com>
3359
3360         Add and implement KeyedDecoder::decodeBytes
3361         https://bugs.webkit.org/show_bug.cgi?id=132479
3362
3363         Reviewed by Tim Horton.
3364
3365         * Shared/cf/KeyedDecoder.cpp:
3366         (WebKit::KeyedDecoder::decodeBytes):
3367         * Shared/cf/KeyedDecoder.h:
3368
3369 2014-05-02  Joseph Pecoraro  <pecoraro@apple.com>
3370
3371         [iOS] WebKit2 File Upload Support
3372         https://bugs.webkit.org/show_bug.cgi?id=132024
3373
3374         Reviewed by Enrica Casucci.
3375
3376         * Configurations/WebKit2.xcconfig:
3377         Include MobileCoreServices on iOS for kUTTypeImage/kUTTypeMovie.
3378
3379         * WebKit2.xcodeproj/project.pbxproj:
3380         Add new files.
3381
3382         * UIProcess/WebOpenPanelResultListenerProxy.h:
3383         * UIProcess/WebOpenPanelResultListenerProxy.cpp:
3384         (WebKit::filePathsFromFileURLs):
3385         (WebKit::WebOpenPanelResultListenerProxy::chooseFiles):
3386         * UIProcess/WebPageProxy.h:
3387         * UIProcess/WebPageProxy.cpp:
3388         (WebKit::WebPageProxy::runOpenPanel):
3389         (WebKit::WebPageProxy::didChooseFilesForOpenPanelWithDisplayStringAndIcon):
3390         * WebProcess/WebPage/WebOpenPanelResultListener.h:
3391         * WebProcess/WebPage/WebOpenPanelResultListener.cpp:
3392         (WebKit::WebOpenPanelResultListener::didChooseFilesWithDisplayStringAndIcon):
3393         * WebProcess/WebPage/WebPage.h:
3394         * WebProcess/WebPage/WebPage.messages.in:
3395         * WebProcess/WebPage/WebPage.cpp:
3396         (WebKit::WebPage::didChooseFilesForOpenPanelWithDisplayStringAndIcon):
3397         Message forwarding for choosing files and providing a display string and icon,
3398         leading down to the existing WebCore FileChooser method.
3399
3400         * UIProcess/PageClient.h:
3401         * UIProcess/ios/PageClientImplIOS.h:
3402         * UIProcess/ios/PageClientImplIOS.mm:
3403         (WebKit::PageClientImpl::handleRunOpenPanel):
3404         Add a default handler for file open panel on iOS.
3405         Forwards to the content view.
3406
3407         * UIProcess/ios/WKContentViewInteraction.h:
3408         * UIProcess/ios/WKContentViewInteraction.mm:
3409         (-[WKContentView lastInteractionLocation]):
3410         (-[WKContentView _webTouchEventsRecognized:]):
3411         (-[WKContentView _highlightLongPressRecognized:]):
3412         (-[WKContentView _longPressRecognized:]):
3413         (-[WKContentView _singleTapRecognized:]):
3414         (-[WKContentView _doubleTapRecognized:]):
3415         (-[WKContentView _twoFingerDoubleTapRecognized:]):
3416         Keep track of the last interaction location. This matches previous behavior
3417         of showing the file upload popover where the user tapped, to handle
3418         cases where the <input> is hidden.
3419
3420         (-[WKContentView _showRunOpenPanel:resultListener:]):
3421         (-[WKContentView fileUploadPanelDidDismiss:]):
3422         Handle showing the cleaning up after the file upload panel.
3423
3424         * UIProcess/ios/forms/WKFileUploadPanel.h:
3425         * UIProcess/ios/forms/WKFileUploadPanel.mm: Added.
3426         (squareCropRectForSize):
3427         (squareImage):
3428         (thumbnailSizedImageForImage):
3429         (-[_WKFileUploadItem isVideo]):
3430         (-[_WKFileUploadItem fileURL]):
3431         (-[_WKFileUploadItem displayImage]):
3432         (-[_WKImageFileUploadItem initWithFilePath:originalImage:]):
3433         (-[_WKImageFileUploadItem isVideo]):
3434         (-[_WKImageFileUploadItem fileURL]):
3435         (-[_WKImageFileUploadItem displayImage]):
3436         (-[_WKVideoFileUploadItem initWithFilePath:mediaURL:]):
3437         (-[_WKVideoFileUploadItem isVideo]):
3438         (-[_WKVideoFileUploadItem fileURL]):
3439         (-[_WKVideoFileUploadItem displayImage]):
3440         Helper class for each image picker selection. Knows how to get
3441         a file URL and thumbnail display image for the item.
3442
3443         (-[WKFileUploadPanel initWithView:]):
3444         (-[WKFileUploadPanel dealloc]):
3445         (-[WKFileUploadPanel _dispatchDidDismiss]):
3446         (-[WKFileUploadPanel _cancel]):
3447         (-[WKFileUploadPanel _chooseFiles:displayString:iconImage:]):
3448         Lifetime of the upload panel requires that either cancel or choose
3449         must happen as we go through the file picking process.
3450
3451         (-[WKFileUploadPanel presentWithParameters:WebKit::resultListener:WebKit::]):
3452         (-[WKFileUploadPanel dismiss]):
3453         API to show or dismiss the panel.
3454
3455         (-[WKFileUploadPanel _dismissDisplayAnimated:]):
3456         Helper to clean up the UI as it progresses or completes no matter the device idiom.
3457
3458         (-[WKFileUploadPanel _presentPopoverWithContentViewController:animated:]):
3459         (-[WKFileUploadPanel _presentFullscreenViewController:animated:]):
3460         UI presentation for the appropriate idiom.
3461
3462         (-[WKFileUploadPanel _mediaTypesForPickerSourceType:]):
3463         (-[WKFileUploadPanel _showMediaSourceSelectionSheet]):
3464         (-[WKFileUploadPanel _showPhotoPickerWithSourceType:]):
3465         Showing the action sheet or image picker.
3466
3467         (-[WKFileUploadPanel popoverControllerDidDismissPopover:]):