12413fbb5391501ef5b8d41d31c0973c92763176
[WebKit-https.git] / Source / WebKit2 / ChangeLog
1 2014-02-26  Martin Robinson  <mrobinson@igalia.com>
2
3         [GTK] generate-gtkdoc can fail with WebKit1 or WebKit2 only builds
4         https://bugs.webkit.org/show_bug.cgi?id=129319
5
6         Reviewed by Carlos Garcia Campos.
7
8         * GNUmakefile.am: Do not generate the documentation configuration file if the port
9         is disabled.
10
11 2014-02-25  Benjamin Poulain  <bpoulain@apple.com>
12
13         [iOS][WK2] Split the rects/scale updates in 3 internally consistent groups
14         https://bugs.webkit.org/show_bug.cgi?id=129354
15
16         Reviewed by Sam Weinig.
17
18         During scaling, the scale and rect of UIScrollView, WebPageProxy, DrawingAreaProxy,
19         DrawingArea and WebPage were in completely inconsistent states.
20
21         Some of those disconnect were temporary (like when setting the rect and scale in two different
22         messages), some were lasting the time of a tile update (like the UIProcess view of the scale).
23         This was causing various visual glitches.
24
25         To fix this, all the updates from the UIProcess are funneled through a single path and the values
26         are split into 3 different groups/types.
27         When updating the scale/rects, the UIProcess sends the new information to the WebProcess on a queue
28         through ViewUpdateDispatcher. There, the updates are accumulated until the MainThread is available.
29         Once the main thread is "unblocked" from the previous frame, all the data are updated at once from
30         the last known state in ViewUpdateDispatcher. The new tiles are created for the new converage information
31         and they are sent to the UIProcess.
32
33         At any point, there are 3 types of scale and rects used for different purpose:
34         -In the UIProcess, there is the UIScrollView scale and rects which represent the "true" state or what
35          is currently on screen.
36          That information is mirrored into WebPageProxy for the other classes needing it like DrawingAreaProxy.
37         -In the WebProcess, there is the last known state. That state is always lagging a little behind the "true"
38          state.
39         -Back in the UIProcess, we have the tile states that is attached to RemoteLayerTreeTransaction. It is used
40          to setup the rendering.
41
42         With this change, there are two paths for updating the page scale factor:
43         -The UI drives the change, the updates goes WKWebView->WKContentView->WebPageProxy->ViewUpdateDispatcher
44          ->WebPage->RemoteLayerTreeDrawingArea->RemoteLayerTreeDrawingAreaProxy->WKContentView->WKWebView.
45         -If changes in the content force scaling parameters, the updates goes: WebPage->RemoteLayerTreeDrawingArea
46          ->RemoteLayerTreeDrawingAreaProxy->WKContentView->WKWebView.
47         The two kind of updates frequently conflicts during loading. We differentiate those through the flag
48         scaleWasSetByUIProcess passed with the updates. In cases of conflicts, the user always wins.
49
50         * DerivedSources.make:
51         * Scripts/webkit2/messages.py:
52         (struct_or_class):
53         * Shared/VisibleContentRectUpdateInfo.cpp: Added.
54         (WebKit::VisibleContentRectUpdateInfo::encode):
55         (WebKit::VisibleContentRectUpdateInfo::decode):
56         * Shared/VisibleContentRectUpdateInfo.h: Added.
57         (WebKit::VisibleContentRectUpdateInfo::VisibleContentRectUpdateInfo):
58         (WebKit::VisibleContentRectUpdateInfo::exposedRect):
59         (WebKit::VisibleContentRectUpdateInfo::unobscuredRect):
60         (WebKit::VisibleContentRectUpdateInfo::scale):
61         (WebKit::operator==):
62         * Shared/mac/RemoteLayerTreeTransaction.h:
63         (WebKit::RemoteLayerTreeTransaction::scaleWasSetByUIProcess):
64         (WebKit::RemoteLayerTreeTransaction::setScaleWasSetByUIProcess):
65         * Shared/mac/RemoteLayerTreeTransaction.mm:
66         (WebKit::RemoteLayerTreeTransaction::encode):
67         (WebKit::RemoteLayerTreeTransaction::decode):
68         * UIProcess/API/Cocoa/WKWebView.mm:
69         (-[WKWebView contentView:didCommitLayerTree:WebKit::]):
70         (-[WKWebView _didFinishScrolling]):
71         (-[WKWebView scrollViewDidScroll:]):
72         (-[WKWebView scrollViewDidZoom:]):
73         (-[WKWebView scrollViewDidEndZooming:withView:atScale:]):
74         (-[WKWebView _frameOrBoundsChanged]):
75         (-[WKWebView _updateVisibleContentRectsWithStableState:]):
76         (-[WKWebView _setObscuredInsets:]):
77         (-[WKWebView _endInteractiveObscuredInsetsChange]):
78         * UIProcess/API/ios/WKViewIOS.mm:
79         (-[WKView _updateVisibleContentRects]):
80         * UIProcess/DrawingAreaProxy.cpp:
81         (WebKit::DrawingAreaProxy::DrawingAreaProxy):
82         (WebKit::DrawingAreaProxy::setCustomFixedPositionRect):
83         * UIProcess/DrawingAreaProxy.h:
84         (WebKit::DrawingAreaProxy::updateDebugIndicator):
85         * UIProcess/WebPageProxy.h:
86         (WebKit::WebPageProxy::displayedContentScale):
87         (WebKit::WebPageProxy::exposedContentRect):
88         (WebKit::WebPageProxy::unobscuredContentRect):
89         * UIProcess/ios/WKContentView.h:
90         * UIProcess/ios/WKContentView.mm:
91         (-[WKContentView didUpdateVisibleRect:unobscuredRect:scale:inStableState:]):
92         (-[WKContentView didFinishScrolling]):
93         (-[WKContentView didZoomToScale:]):
94         * UIProcess/ios/WebPageProxyIOS.mm:
95         (WebKit::WebPageProxy::updateVisibleContentRects):
96         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h:
97         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
98         (WebKit::RemoteLayerTreeDrawingAreaProxy::scaledExposedRect):
99         (WebKit::RemoteLayerTreeDrawingAreaProxy::indicatorLocation):
100         (WebKit::RemoteLayerTreeDrawingAreaProxy::indicatorScale):
101         (WebKit::RemoteLayerTreeDrawingAreaProxy::updateDebugIndicator):
102         * WebKit2.xcodeproj/project.pbxproj:
103         * WebProcess/WebPage/ViewUpdateDispatcher.cpp: Added.
104         (WebKit::ViewUpdateDispatcher::create):
105         (WebKit::ViewUpdateDispatcher::ViewUpdateDispatcher):
106         (WebKit::ViewUpdateDispatcher::~ViewUpdateDispatcher):
107         (WebKit::ViewUpdateDispatcher::initializeConnection):
108         (WebKit::ViewUpdateDispatcher::visibleContentRectUpdate):
109         (WebKit::ViewUpdateDispatcher::dispatchVisibleContentRectUpdate):
110         * WebProcess/WebPage/ViewUpdateDispatcher.h: Added.
111         * WebProcess/WebPage/ViewUpdateDispatcher.messages.in: Added.
112         * WebProcess/WebPage/WebPage.cpp:
113         (WebKit::WebPage::WebPage):
114         (WebKit::WebPage::scalePage):
115         * WebProcess/WebPage/WebPage.h:
116         (WebKit::WebPage::scaleWasSetByUIProcess):
117         * WebProcess/WebPage/WebPage.messages.in:
118         * WebProcess/WebPage/ios/WebPageIOS.mm:
119         (WebKit::WebPage::tapHighlightAtPosition):
120         (WebKit::WebPage::updateVisibleContentRects):
121         (WebKit::WebPage::willStartUserTriggeredZooming):
122         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
123         (WebKit::RemoteLayerTreeDrawingArea::flushLayers):
124         * WebProcess/WebProcess.cpp:
125         (WebKit::WebProcess::WebProcess):
126         (WebKit::WebProcess::initializeConnection):
127         * WebProcess/WebProcess.h:
128
129 2014-02-25  Anders Carlsson  <andersca@apple.com>
130
131         Rename WebCore::VisitedLinkProvider to WebCore::VisitedLinkStore
132         https://bugs.webkit.org/show_bug.cgi?id=129357
133
134         Reviewed by Sam Weinig.
135
136         * WebProcess/WebPage/WebPage.cpp:
137         (WebKit::WebPage::WebPage):
138         * WebProcess/WebPage/WebVisitedLinkProvider.h:
139
140 2014-02-25  Enrica Casucci  <enrica@apple.com>
141
142         [WebKit2] Form controls handling.
143         https://bugs.webkit.org/show_bug.cgi?id=129344
144         <rdar://problem/16053643>
145
146         Reviewed by Simon Fraser and Joseph Pecoraro.
147
148         This is the step toward adding support for
149         form controls iOS style. It adds the logic to
150         select the appropriate keyboard type based on the
151         element type and introduces the AssistedNodeInformation
152         structure used currently for the keyboard type selection
153         and that will be used to populate pickers and popovers.
154         It also provides information to enable/disable next/previous
155         buttons in the accessory view.
156
157         * Scripts/webkit2/messages.py:
158         (struct_or_class):
159         * Shared/AssistedNodeInformation.cpp: Added.
160         (WebKit::AssistedNodeInformation::encode):
161         (WebKit::AssistedNodeInformation::decode):
162         * Shared/AssistedNodeInformation.h: Added.
163         (WebKit::AssistedNodeInformation::AssistedNodeInformation):
164         * UIProcess/PageClient.h:
165         * UIProcess/WebPageProxy.h:
166         * UIProcess/WebPageProxy.messages.in:
167         * UIProcess/ios/PageClientImplIOS.h:
168         * UIProcess/ios/PageClientImplIOS.mm:
169         (WebKit::PageClientImpl::startAssistingNode):
170         * UIProcess/ios/WKContentViewInteraction.h:
171         * UIProcess/ios/WKContentViewInteraction.mm:
172         (-[WKContentView _requiresKeyboardWhenFirstResponder]):
173         (-[WKContentView _updateAccessory]):
174         (toUITextAutocapitalize):
175         (-[WKContentView textInputTraits]):
176         (-[WKContentView assistedNodeInformation]):
177         (-[WKContentView _startAssistingNode:]):
178         (-[WKContentView _stopAssistingNode]):
179         * UIProcess/ios/WebPageProxyIOS.mm:
180         (WebKit::WebPageProxy::startAssistingNode):
181         * WebKit2.xcodeproj/project.pbxproj:
182         * WebProcess/WebPage/WebPage.h:
183         * WebProcess/WebPage/ios/WebPageIOS.mm:
184         (WebKit::isAssistableNode):
185         (WebKit::hasFocusableNode):
186         (WebKit::WebPage::getAssistedNodeInformation):
187         (WebKit::WebPage::elementDidFocus):
188
189 2014-02-25  Anders Carlsson  <andersca@apple.com>
190
191         VisitedLinkProvider should be refcounted
192         https://bugs.webkit.org/show_bug.cgi?id=129351
193
194         Reviewed by Sam Weinig.
195
196         * UIProcess/VisitedLinkProvider.cpp:
197         (WebKit::VisitedLinkProvider::create):
198         (WebKit::VisitedLinkProvider::~VisitedLinkProvider):
199         * UIProcess/VisitedLinkProvider.h:
200         * UIProcess/WebContext.cpp:
201         (WebKit::WebContext::WebContext):
202         (WebKit::WebContext::processDidFinishLaunching):
203         (WebKit::WebContext::disconnectProcess):
204         (WebKit::WebContext::addVisitedLinkHash):
205         * UIProcess/WebContext.h:
206
207 2014-02-25  Anders Carlsson  <andersca@apple.com>
208
209         Make WebContext handle populating visited links
210         https://bugs.webkit.org/show_bug.cgi?id=129348
211
212         Reviewed by Tim Horton.
213
214         This makes it possible to decouple VisitedLinkProvider from WebContext.
215
216         * UIProcess/VisitedLinkProvider.cpp:
217         (WebKit::VisitedLinkProvider::VisitedLinkProvider):
218         (WebKit::VisitedLinkProvider::processDidFinishLaunching):
219         * UIProcess/VisitedLinkProvider.h:
220         * UIProcess/WebContext.cpp:
221         (WebKit::WebContext::WebContext):
222         (WebKit::WebContext::processDidFinishLaunching):
223         * UIProcess/WebContext.h:
224
225 2014-02-25  Anders Carlsson  <andersca@apple.com>
226
227         DrawingAreaProxy is using WebCore's Timer
228         https://bugs.webkit.org/show_bug.cgi?id=129347
229         <rdar://problem/16078133>
230
231         Reviewed by Tim Horton.
232
233         Use a RunLoop::Timer instead.
234
235         * UIProcess/DrawingAreaProxy.cpp:
236         (WebKit::DrawingAreaProxy::DrawingAreaProxy):
237         (WebKit::DrawingAreaProxy::exposedRectChangedTimerFired):
238         * UIProcess/DrawingAreaProxy.h:
239
240 2014-02-25  Anders Carlsson  <andersca@apple.com>
241
242         Add WKVisitedLinkProvider
243         https://bugs.webkit.org/show_bug.cgi?id=129343
244
245         Reviewed by Sam Weinig.
246
247         * UIProcess/API/Cocoa/WKVisitedLinkProvider.h: Copied from Source/WebKit2/UIProcess/API/Cocoa/WKWebViewConfiguration.h.
248         * UIProcess/API/Cocoa/WKVisitedLinkProvider.mm: Copied from Source/WebKit2/UIProcess/API/Cocoa/WKWebViewConfiguration.h.
249         * UIProcess/API/Cocoa/WKVisitedLinkProviderInternal.h: Copied from Source/WebKit2/UIProcess/API/Cocoa/WKWebViewConfiguration.h.
250         * UIProcess/API/Cocoa/WKVisitedLinkProviderPrivate.h: Copied from Source/WebKit2/UIProcess/API/Cocoa/WKWebViewConfiguration.h.
251         * UIProcess/API/Cocoa/WKWebView.mm:
252         (-[WKWebView initWithFrame:configuration:]):
253         * UIProcess/API/Cocoa/WKWebViewConfiguration.h:
254         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
255         (-[WKWebViewConfiguration visitedLinkProvider]):
256         (-[WKWebViewConfiguration setVisitedLinkProvider:]):
257         * WebKit2.xcodeproj/project.pbxproj:
258
259 2014-02-25  Anders Carlsson  <andersca@apple.com>
260
261         Simplify visited link style invalidation
262         https://bugs.webkit.org/show_bug.cgi?id=129340
263
264         Reviewed by Dan Bernstein.
265
266         * UIProcess/VisitedLinkProvider.cpp:
267         (WebKit::VisitedLinkProvider::addVisitedLink):
268         * WebProcess/WebProcess.cpp:
269         (WebKit::WebProcess::visitedLinkStateChanged):
270         (WebKit::WebProcess::allVisitedLinkStateChanged):
271
272 2014-02-25  Anders Carlsson  <andersca@apple.com>
273
274         Fix build.
275
276         Remove VisitedLinkStrategy.
277
278         * NetworkProcess/NetworkProcessPlatformStrategies.cpp:
279         * NetworkProcess/NetworkProcessPlatformStrategies.h:
280         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
281         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
282
283 2014-02-25  Alexey Proskuryakov  <ap@apple.com>
284
285         Rolling out http://trac.webkit.org/changeset/164611, because it broke
286         WebKit2.PrivateBrowsingPushStateNoHistoryCallback API test
287
288         The change was for:
289
290         https://bugs.webkit.org/show_bug.cgi?id=129141
291         Create SessionID class
292
293 2014-02-25  Dan Bernstein  <mitz@apple.com>
294
295         [Cocoa] Add delegate method for customizing actions on activated elements
296         https://bugs.webkit.org/show_bug.cgi?id=129290
297
298         Reviewed by Anders Carlsson.
299
300         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: Added. Declared new delegate method.
301
302         * UIProcess/API/Cocoa/_WKActivatedElementInfo.h:
303         (_WKActivatedElementType): Defined enum of element types.
304         * UIProcess/API/Cocoa/_WKActivatedElementInfo.mm:
305         (-[_WKActivatedElementInfo _initWithType:URL:location:title:rect:]): Added type parameter
306         to the initializer, used to set the new type property.
307         * UIProcess/API/Cocoa/_WKActivatedElementInfoInternal.h:
308
309         * UIProcess/Cocoa/UIClient.h:
310         * UIProcess/Cocoa/UIClient.mm:
311         (WebKit::UIClient::setDelegate): Initialize webViewActionsForElementDefaultActions member
312         of m_delegateMethods.
313         (WebKit::UIClient::actionsForElement): Added. Calls out to the new delegate method if
314         implemented. Otherwise returns the default actions.
315
316         * UIProcess/ios/WKActionSheetAssistant.mm:
317         (-[WKActionSheetAssistant actionSheet:clickedButtonAtIndex:]): Use new _elementInfo ivar
318         instead of creating element info here.
319         (-[WKActionSheetAssistant showImageSheet]): Create element info here and assign it to
320         _elementInfo ivar if presenting a sheet. Call the UI client to get custom actions.
321         (-[WKActionSheetAssistant showLinkSheet]): Ditto.
322         (-[WKActionSheetAssistant cleanupSheet]): Clear _elementInfo ivar.
323         * WebKit2.xcodeproj/project.pbxproj: Added reference to WKUIDelegatePrivate.h.
324
325 2014-02-25  Michał Pakuła vel Rutka  <m.pakula@samsung.com>
326
327         Unreviewed EFL build fix attempt after r164562
328
329         * CMakeLists.txt: Added WebVisitedLinkProvider.cpp.
330
331 2014-02-25  Sergio Villar Senin  <svillar@igalia.com>
332
333         [CSS Grid Layout] Add ENABLE flag
334         https://bugs.webkit.org/show_bug.cgi?id=129153
335
336         Reviewed by Simon Fraser.
337
338         Added ENABLE_CSS_GRID_LAYOUT feature flag.
339
340         * Configurations/FeatureDefines.xcconfig:
341         * WebProcess/WebPage/WebPage.cpp:
342         (WebKit::WebPage::updatePreferences):
343
344 2014-02-25  Zan Dobersek  <zdobersek@igalia.com>
345
346         Unreviewed GTK build fix after r164652.
347
348         * GNUmakefile.list.am: Add WebVisitedLinkProvider build targets.
349
350 2014-02-24  Anders Carlsson  <andersca@apple.com>
351
352         Make it possible to set the visited link provider on a per page basis
353         https://bugs.webkit.org/show_bug.cgi?id=129288
354
355         Reviewed by Andreas Kling.
356
357         Add WebVisitedLinkProvider which just calls the web process.
358
359         * WebKit2.xcodeproj/project.pbxproj:
360         * WebProcess/WebPage/WebPage.cpp:
361         (WebKit::WebPage::WebPage):
362         * WebProcess/WebPage/WebVisitedLinkProvider.cpp: Added.
363         (WebKit::WebVisitedLinkProvider::create):
364         (WebKit::WebVisitedLinkProvider::WebVisitedLinkProvider):
365         (WebKit::WebVisitedLinkProvider::~WebVisitedLinkProvider):
366         (WebKit::WebVisitedLinkProvider::isLinkVisited):
367         (WebKit::WebVisitedLinkProvider::addVisitedLink):
368         * WebProcess/WebPage/WebVisitedLinkProvider.h: Added.
369
370 2014-02-25  Dan Bernstein  <mitz@apple.com>
371
372         Build fix for case-sensitive filesystems.
373
374         * WebProcess/ios/WebVideoFullscreenManager.cpp:
375
376 2014-02-24  Carlos Garcia Campos  <cgarcia@igalia.com>
377
378         [GTK] Mark view source mode methods as deprecated
379         https://bugs.webkit.org/show_bug.cgi?id=128920
380
381         Reviewed by Martin Robinson.
382
383         Mark WEBKIT_VIEW_MODE_SOURCE as deprecated in documentation and
384         only show warnings when set_view_mode is used with WEBKIT_VIEW_MODE_SOURCE.
385
386         * UIProcess/API/gtk/WebKitWebView.cpp:
387         (webkit_web_view_set_view_mode):
388         (webkit_web_view_get_view_mode):
389         * UIProcess/API/gtk/WebKitWebView.h:
390
391 2014-02-24  Alexey Proskuryakov  <ap@apple.com>
392
393         [Mac] Stop looking for plug-in profiles in /S/L/Sandbox/Profiles
394         https://bugs.webkit.org/show_bug.cgi?id=129262
395         <rdar://problem/16149420>
396
397         Reviewed by Sam Weinig.
398
399         Remove unused code.
400
401         * Shared/Plugins/mac/PluginSandboxProfile.mm:
402         (WebKit::pluginSandboxProfileDirectory):
403         (WebKit::pluginSandboxCommonProfile):
404         (WebKit::pluginSandboxProfile):
405         (WebKit::pluginHasSandboxProfile):
406
407 2014-02-24  Martin Robinson  <mrobinson@igalia.com>
408
409         [GTK] generate-gtkdoc should not generate documentation for source files for unbuilt source files
410         https://bugs.webkit.org/show_bug.cgi?id=128417
411
412         Reviewed by Carlos Garcia Campos.
413
414         * GNUmakefile.am: Generate a config file for generate-gtkdoc.
415         * PlatformGTK.cmake: Ditto.
416
417 2014-02-24  Dan Bernstein  <mitz@apple.com>
418
419         32-bit build fix.
420
421         * UIProcess/API/Cocoa/_WKElementAction.mm:
422         (+[_WKElementAction elementActionWithType:customTitle:]):
423
424 2014-02-24  Dan Bernstein  <mitz@apple.com>
425
426         [Cocoa] Start adding API for customizing actions on activated elements
427         https://bugs.webkit.org/show_bug.cgi?id=129284
428
429         Reviewed by Anders Carlsson.
430
431         * UIProcess/API/Cocoa/_WKActivatedElementInfo.h: Added. Includes the public interface of what
432         was WKElementActionInfo.
433         * UIProcess/API/Cocoa/_WKActivatedElementInfo.m: Added.
434         (-[_WKActivatedElementInfo _initWithURL:location:title:rect:]): Moved and renamed internal
435         initializer from WKElementActionInfo.
436         (-[_WKActivatedElementInfo dealloc]): Moved from WKElementActionInfo.
437         (-[_WKActivatedElementInfo _boundingRect]): Added private accessor.
438         (-[_WKActivatedElementInfo _interactionLocation]): Ditto.
439         * UIProcess/API/Cocoa/_WKActivatedElementInfoInternal.h: Added.
440
441         * UIProcess/API/Cocoa/_WKElementAction.h: Added.
442         (_WKElementActionType): Moved from WKActionSheet.h and turned into a proper NS_ENUM.
443         * UIProcess/API/Cocoa/_WKElementAction.mm: Added.
444         (-[_WKElementAction _initWithTitle:actionHandler:type:]): Moved and renamed internal
445         initializer from WKActionSheet.mm.
446         (-[_WKElementAction dealloc]): Moved from WKActionSheet.mm.
447         (+[_WKElementAction elementActionWithTitle:actionHandler:]): Moved and renamed.
448         (copyElement): Moved from WKActionSheet.mm.
449         (saveImage): Ditto.
450         (addToReadingList): Ditto.
451         (+[_WKElementAction elementActionWithType:customTitle:]): Moved and renamed.
452         (+[_WKElementAction elementActionWithType:]): Ditto.
453         (-[_WKElementAction _runActionWithElementInfo:view:]): Moved from WKActionSheet.mm.
454         * UIProcess/API/Cocoa/WKElementActionInternal.h: Added.
455
456         * UIProcess/ios/WKActionSheet.h: Removed declarations that were moved elsewhere.
457         * UIProcess/ios/WKActionSheet.mm: Removed code that was moved elsewhere.
458         * UIProcess/ios/WKActionSheetAssistant.mm:
459         (-[WKActionSheetAssistant actionSheet:clickedButtonAtIndex:]):
460         (-[WKActionSheetAssistant showImageSheet]):
461         (-[WKActionSheetAssistant showLinkSheet]):
462         (-[WKActionSheetAssistant showDataDetectorsSheet]):
463
464         * WebKit2.xcodeproj/project.pbxproj: Added references to new files. Changed the Objective-C
465         class name check to allow _WK as a class name prefix.
466
467 2014-02-24  Simon Fraser  <simon.fraser@apple.com>
468
469         Use RetainPtrs for two WKContentView data members
470         https://bugs.webkit.org/show_bug.cgi?id=129276
471
472         Reviewed by Benjamin Poulain.
473         
474         The UITextInputTraits were leaked. Fix with RetainPtr goodness.
475         
476         Rename the obscure _accessory to _formAccessoryView and
477         make it a RetainPtr.
478         
479         Rearrange the data members of the WKContentView class extension
480         for better packing and readability.
481
482         * UIProcess/ios/WKContentView.h:
483         * UIProcess/ios/WKContentViewInteraction.h:
484         * UIProcess/ios/WKContentViewInteraction.mm:
485         (-[WKContentView cleanupInteraction]):
486         (-[WKContentView inputAccessoryView]):
487         (-[WKContentView _updateAccessory]):
488         (-[WKContentView textInputTraits]):
489
490 2014-02-24  Simon Fraser  <simon.fraser@apple.com>
491
492         Remove WKInteractionView, move code into WKContentView
493         https://bugs.webkit.org/show_bug.cgi?id=129275
494
495         Reviewed by Benjamin Poulain.
496         
497         WKInteractionView as an interim solution as WebKit2 on iOS was being
498         brought up, and should be removed.
499         
500         Move its code into a category on WKContentView, mostly unchanged. The
501         WKContentView (WKInteraction) categroy now implements the various protocols
502         that WKInteractionView implemented.
503         
504         WKContentView is not an API class, so no longer has WK_API_CLASS, and can
505         have implementation-related data members. WKContentViewInternal.h is removed.
506         
507         WKContentView now exposes a WebPageProxy* rather than a WKPageRef.
508         
509         Other changes: WKActionSheetAssistant no longer stores a WebPageProxy,
510         getting it from the WKContentView instead.
511         
512         WKAutoCorrectionData and InteractionInformationAtPosition are stored via unique_ptr
513         to reduce class size, and avoid having to expose their details in the header.
514
515         * Configurations/WebKit2.xcconfig:
516         * UIProcess/API/Cocoa/WKWebViewInternal.h:
517         * UIProcess/API/ios/WKViewIOS.mm:
518         (-[WKView setAllowsBackForwardNavigationGestures:]):
519         (-[WKView pageRef]):
520         (-[WKView _pageExtendedBackgroundColor]):
521         (-[WKView _setBackgroundExtendsBeyondPage:]):
522         (-[WKView _backgroundExtendsBeyondPage]):
523         * UIProcess/ios/PageClientImplIOS.mm:
524         * UIProcess/ios/WKActionSheet.h:
525         * UIProcess/ios/WKActionSheet.mm:
526         (-[WKActionSheet initWithView:]):
527         (+[WKElementAction customElementActionWithTitle:actionHandler:]):
528         (copyElement):
529         (saveImage):
530         (+[WKElementAction standardElementActionWithType:customTitle:]):
531         (-[WKElementAction runActionWithElementInfo:view:]):
532         * UIProcess/ios/WKActionSheetAssistant.h:
533         * UIProcess/ios/WKActionSheetAssistant.mm:
534         (-[WKActionSheetAssistant initWithView:]):
535         (-[WKActionSheetAssistant dealloc]):
536         (-[WKActionSheetAssistant initialPresentationRectInHostViewForSheet]):
537         (-[WKActionSheetAssistant presentationRectInHostViewForSheet]):
538         (-[WKActionSheetAssistant actionSheet:clickedButtonAtIndex:]):
539         (-[WKActionSheetAssistant _createSheetWithElementActions:showLinkTitle:]):
540         (-[WKActionSheetAssistant showImageSheet]):
541         (-[WKActionSheetAssistant showLinkSheet]):
542         (-[WKActionSheetAssistant showDataDetectorsSheet]):
543         (-[WKActionSheetAssistant cleanupSheet]):
544         * UIProcess/ios/WKContentView.h:
545         * UIProcess/ios/WKContentView.mm:
546         (-[WKContentView initWithFrame:context:WebKit::configuration:WebKit::]):
547         (-[WKContentView dealloc]):
548         (-[WKContentView page]):
549         (-[WKContentView isAssistingNode]):
550         (-[WKContentView didFinishScrolling]):
551         (-[WKContentView willStartZoomOrScroll]):
552         (-[WKContentView willStartUserTriggeredScroll]):
553         (-[WKContentView willStartUserTriggeredZoom]):
554         (-[WKContentView didZoomToScale:]):
555         (-[WKContentView _didCommitLoadForMainFrame]):
556         (-[WKContentView _didCommitLayerTree:WebKit::]):
557         * UIProcess/ios/WKContentViewInteraction.h: Renamed from Source/WebKit2/UIProcess/ios/WKInteractionView.h.
558         * UIProcess/ios/WKContentViewInteraction.mm: Renamed from Source/WebKit2/UIProcess/ios/WKInteractionView.mm.
559         (-[WKContentView setupInteraction]):
560         (-[WKContentView cleanupInteraction]):
561         (-[WKContentView positionInformation]):
562         (-[WKContentView setInputDelegate:]):
563         (-[WKContentView inputDelegate]):
564         (-[WKContentView isEditable]):
565         (-[WKContentView canBecomeFirstResponder]):
566         (-[WKContentView resignFirstResponder]):
567         (-[WKContentView _webTouchEventsRecognized:]):
568         (inflateQuad):
569         (-[WKContentView _webTouchEvent:WebKit::preventsNativeGestures:]):
570         (-[WKContentView _didGetTapHighlightForRequest:color:WebCore::quads:WebCore::topLeftRadius:WebCore::topRightRadius:WebCore::bottomLeftRadius:WebCore::bottomRightRadius:WebCore::]):
571         (-[WKContentView _cancelLongPressGestureRecognizer]):
572         (-[WKContentView _didScroll]):
573         (-[WKContentView _requiresKeyboardResetOnReload]):
574         (-[WKContentView gestureRecognizer:canPreventGestureRecognizer:]):
575         (-[WKContentView gestureRecognizer:canBePreventedByGestureRecognizer:]):
576         (isSamePair):
577         (-[WKContentView gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:]):
578         (-[WKContentView _showImageSheet]):
579         (-[WKContentView _showLinkSheet]):
580         (-[WKContentView _showDataDetectorsSheet]):
581         (-[WKContentView _actionForLongPress]):
582         (-[WKContentView ensurePositionInformationIsUpToDate:]):
583         (-[WKContentView _updatePositionInformation]):
584         (-[WKContentView gestureRecognizerShouldBegin:]):
585         (-[WKContentView _cancelInteraction]):
586         (-[WKContentView hasSelectablePositionAtPoint:]):
587         (-[WKContentView pointIsInAssistedNode:]):
588         (-[WKContentView webSelectionRects]):
589         (-[WKContentView _highlightLongPressRecognized:]):
590         (-[WKContentView _longPressRecognized:]):
591         (-[WKContentView _singleTapRecognized:]):
592         (-[WKContentView _doubleTapRecognized:]):
593         (-[WKContentView _twoFingerDoubleTapRecognized:]):
594         (-[WKContentView _twoFingerPanRecognized:]):
595         (-[WKContentView _attemptClickAtLocation:]):
596         (-[WKContentView useSelectionAssistantWithMode:]):
597         (-[WKContentView clearSelection]):
598         (-[WKContentView _positionInformationDidChange:]):
599         (-[WKContentView _willStartScrollingOrZooming]):
600         (-[WKContentView _willStartUserTriggeredScrollingOrZooming]):
601         (-[WKContentView _didEndScrollingOrZooming]):
602         (-[WKContentView inputAccessoryView]):
603         (-[WKContentView supportedPasteboardTypesForCurrentSelection]):
604         (-[WKContentView _addShortcut:]):
605         (-[WKContentView _promptForReplace:]):
606         (-[WKContentView replace:]):
607         (-[WKContentView canPerformAction:withSender:]):
608         (-[WKContentView _resetShowingTextStyle:]):
609         (-[WKContentView _performAction:]):
610         (-[WKContentView copy:]):
611         (-[WKContentView cut:]):
612         (-[WKContentView paste:]):
613         (-[WKContentView select:]):
614         (-[WKContentView selectAll:]):
615         (-[WKContentView toggleBoldface:]):
616         (-[WKContentView toggleItalics:]):
617         (-[WKContentView toggleUnderline:]):
618         (-[WKContentView _showTextStyleOptions:]):
619         (-[WKContentView _showDictionary:]):
620         (-[WKContentView _define:]):
621         (toWKGestureType):
622         (toUIWKGestureType):
623         (toWKSelectionTouch):
624         (toUIWKSelectionTouch):
625         (toWKGestureRecognizerState):
626         (toUIGestureRecognizerState):
627         (toUIWKSelectionFlags):
628         (toWKHandlePosition):
629         (selectionChangedWithGesture):
630         (selectionChangedWithTouch):
631         (-[WKContentView _didUpdateBlockSelectionWithTouch:WebKit::withFlags:WebKit::growThreshold:shrinkThreshold:]):
632         (-[WKContentView changeSelectionWithGestureAt:withGesture:withState:]):
633         (-[WKContentView changeSelectionWithTouchAt:withSelectionTouch:baseIsStart:]):
634         (-[WKContentView changeSelectionWithTouchesFrom:to:withGesture:withState:]):
635         (-[WKContentView changeBlockSelectionWithTouchAt:withSelectionTouch:forHandle:]):
636         (-[WKContentView autocorrectionData]):
637         (-[WKContentView requestAutocorrectionRectsForString:withCompletionHandler:]):
638         (-[WKContentView textFirstRect]):
639         (-[WKContentView textLastRect]):
640         (-[WKContentView applyAutocorrection:toString:withCompletionHandler:]):
641         (-[WKContentView requestAutocorrectionContextWithCompletionHandler:]):
642         (-[WKContentView accessoryDone]):
643         (-[WKContentView accessoryTab:]):
644         (-[WKContentView accessoryAutoFill]):
645         (-[WKContentView accessoryClear]):
646         (-[WKContentView _updateAccessory]):
647         (-[WKContentView textInRange:]):
648         (-[WKContentView replaceRange:withText:]):
649         (-[WKContentView selectedTextRange]):
650         (-[WKContentView caretRectForPosition:]):
651         (-[WKContentView selectionRectsForRange:]):
652         (-[WKContentView setSelectedTextRange:]):
653         (-[WKContentView hasMarkedText]):
654         (-[WKContentView markedText]):
655         (-[WKContentView markedTextRange]):
656         (-[WKContentView markedTextStyle]):
657         (-[WKContentView setMarkedTextStyle:]):
658         (-[WKContentView setMarkedText:selectedRange:]):
659         (-[WKContentView unmarkText]):
660         (-[WKContentView beginningOfDocument]):
661         (-[WKContentView endOfDocument]):
662         (-[WKContentView textRangeFromPosition:toPosition:]):
663         (-[WKContentView positionFromPosition:offset:]):
664         (-[WKContentView positionFromPosition:inDirection:offset:]):
665         (-[WKContentView comparePosition:toPosition:]):
666         (-[WKContentView offsetFromPosition:toPosition:]):
667         (-[WKContentView tokenizer]):
668         (-[WKContentView positionWithinRange:farthestInDirection:]):
669         (-[WKContentView characterRangeByExtendingPosition:inDirection:]):
670         (-[WKContentView baseWritingDirectionForPosition:inDirection:]):
671         (-[WKContentView setBaseWritingDirection:forRange:]):
672         (-[WKContentView firstRectForRange:]):
673         (-[WKContentView closestPositionToPoint:]):
674         (-[WKContentView closestPositionToPoint:withinRange:]):
675         (-[WKContentView characterRangeAtPoint:]):
676         (-[WKContentView deleteBackward]):
677         (-[WKContentView insertText:]):
678         (-[WKContentView hasText]):
679         (-[WKContentView textInputTraits]):
680         (-[WKContentView interactionAssistant]):
681         (-[WKContentView webSelectionAssistant]):
682         (-[WKContentView selectionRange]):
683         (-[WKContentView rectForNSRange:]):
684         (-[WKContentView _markedTextNSRange]):
685         (-[WKContentView selectedDOMRange]):
686         (-[WKContentView setSelectedDOMRange:affinityDownstream:]):
687         (-[WKContentView replaceRangeWithTextWithoutClosingTyping:replacementText:]):
688         (-[WKContentView rectContainingCaretSelection]):
689         (-[WKContentView requiresKeyEvents]):
690         (-[WKContentView handleKeyWebEvent:]):
691         (-[WKContentView _interpretKeyEvent:isCharEvent:]):
692         (-[WKContentView setBottomBufferHeight:]):
693         (-[WKContentView automaticallySelectedOverlay]):
694         (-[WKContentView selectionGranularity]):
695         (-[WKContentView insertDictationResult:withCorrectionIdentifier:]):
696         (-[WKContentView metadataDictionariesForDictationResults]):
697         (-[WKContentView previousUnperturbedDictationResultBoundaryFromPosition:]):
698         (-[WKContentView nextUnperturbedDictationResultBoundaryFromPosition:]):
699         (-[WKContentView moveBackward:]):
700         (-[WKContentView moveForward:]):
701         (-[WKContentView characterBeforeCaretSelection]):
702         (-[WKContentView wordContainingCaretSelection]):
703         (-[WKContentView wordRangeContainingCaretSelection]):
704         (-[WKContentView setMarkedText:]):
705         (-[WKContentView hasContent]):
706         (-[WKContentView selectAll]):
707         (-[WKContentView textColorForCaretSelection]):
708         (-[WKContentView fontForCaretSelection]):
709         (-[WKContentView hasSelection]):
710         (-[WKContentView isPosition:atBoundary:inDirection:]):
711         (-[WKContentView positionFromPosition:toBoundary:inDirection:]):
712         (-[WKContentView isPosition:withinTextUnit:inDirection:]):
713         (-[WKContentView rangeEnclosingPosition:withGranularity:inDirection:]):
714         (-[WKContentView takeTraitsFrom:]):
715         (-[WKContentView _startAssistingKeyboard]):
716         (-[WKContentView _stopAssistingKeyboard]):
717         (-[WKContentView _startAssistingNode]):
718         (-[WKContentView _stopAssistingNode]):
719         (-[WKContentView _selectionChanged]):
720         (-[WKContentView shouldIgnoreWebTouch]):
721         (-[WKContentView isAnyTouchOverActiveArea:]):
722         (-[WKTextRange _isCaret]):
723         (-[WKTextRange _isRanged]):
724         (+[WKTextRange textRangeWithState:isRange:isEditable:startRect:endRect:selectionRects:selectedTextLength:]):
725         (-[WKTextRange dealloc]):
726         (-[WKTextRange description]):
727         (-[WKTextRange start]):
728         (-[WKTextRange end]):
729         (-[WKTextRange isEmpty]):
730         (-[WKTextRange isEqual:]):
731         (+[WKTextPosition textPositionWithRect:]):
732         (-[WKTextPosition isEqual:]):
733         (-[WKTextPosition description]):
734         (-[WKTextSelectionRect initWithWebRect:]):
735         (-[WKTextSelectionRect dealloc]):
736         (+[WKTextSelectionRect textSelectionRectsWithWebRects:]):
737         (-[WKTextSelectionRect rect]):
738         (-[WKTextSelectionRect writingDirection]):
739         (-[WKTextSelectionRect range]):
740         (-[WKTextSelectionRect containsStart]):
741         (-[WKTextSelectionRect containsEnd]):
742         (-[WKTextSelectionRect isVertical]):
743         (+[WKAutocorrectionRects autocorrectionRectsWithRects:lastRect:]):
744         (+[WKAutocorrectionContext autocorrectionContextWithData:markedText:selectedText:afterText:selectedRangeInMarkedText:]):
745         (-[WKAutocorrectionContext dealloc]):
746         * UIProcess/ios/WKContentViewInternal.h: Removed.
747         * WebKit2.xcodeproj/project.pbxproj:
748
749 2014-02-24  Anders Carlsson  <andersca@apple.com>
750
751         WKProcessPool should use secondary processes + network process
752         https://bugs.webkit.org/show_bug.cgi?id=129282
753
754         Reviewed by Simon Fraser.
755
756         * UIProcess/API/Cocoa/WKProcessPool.mm:
757         (-[WKProcessPool initWithConfiguration:]):
758
759 2014-02-24  Jeremy Jones  <jeremyj@apple.com>
760
761         WK2 AVKit fullscreen doesn't display video.
762         https://bugs.webkit.org/show_bug.cgi?id=128564
763
764         Reviewed by Simon Fraser.
765
766         * Shared/mac/RemoteLayerTreeTransaction.h:
767         Add a property to track video layer pending fullscreen.
768
769         (WebKit::RemoteLayerTreeTransaction::isVideoLayerIDPendingFullscreen):
770         (WebKit::RemoteLayerTreeTransaction::addVideoLayerIDPendingFullscreen):
771         Add a property to track video layer pending fullscreen.
772
773         * Shared/mac/RemoteLayerTreeTransaction.mm:
774         (WebKit::RemoteLayerTreeTransaction::encode):
775         (WebKit::RemoteLayerTreeTransaction::decode):
776         Encode and decode m_videoLayerIDsPendingFullscreen.
777
778         * UIProcess/ios/WebPageProxyIOS.mm:
779         (WebKit::WebPageProxy::didCommitLayerTree):
780         Let WebVideoFullscreenManagerProxy see the RemoteLayerTreeTransaction.
781
782         * UIProcess/ios/WebVideoFullscreenManagerProxy.cpp:
783         (WebKit::WebVideoFullscreenManagerProxy::didCommitLayerTree):
784         Look for video layer pending fullscreen on the transaction to initiate
785         fullscreen.
786
787         (WebKit::WebVideoFullscreenManagerProxy::setVideoLayerID):
788         Start looking for the video layer pending fullscreen in the transaction.
789
790         (WebKit::WebVideoFullscreenManagerProxy::enterFullscreen):
791         Override to prevent fullscreen from happening before the layer
792         is pending fullscreen.
793
794         * UIProcess/ios/WebVideoFullscreenManagerProxy.h:
795         * UIProcess/ios/WebVideoFullscreenManagerProxy.messages.in:
796         Pass a more specific videoLayerID in SetVideoLayerID,
797         i.e. WebCore::GraphicsLayer::PlatformLayerID.
798
799         * WebProcess/WebPage/WebPage.cpp:
800         (WebKit::WebPage::willCommitLayerTree):
801         Move webPage specific transaction building here, including,
802         giving WebVideoFullscreenManager a chance to modify the transaction.
803
804         * WebProcess/WebPage/WebPage.h:
805         Add willCommitLayerTree();
806
807         * WebProcess/WebPage/mac/PlatformCALayerRemoteCustom.mm:
808         (PlatformCALayerRemoteCustom::PlatformCALayerRemoteCustom):
809         (PlatformCALayerRemoteCustom::~PlatformCALayerRemoteCustom):
810         Make and break the connection from CALayer to PlatformCALayerRemoteCustom,
811         the same way it is done for PlatformCALayerMac.
812
813         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
814         (WebKit::RemoteLayerTreeDrawingArea::flushLayers):
815         Move WebPage specific transaction building into WebPage::willCommitLayerTree.
816
817         * WebProcess/ios/WebVideoFullscreenManager.cpp:
818         (WebKit::WebVideoFullscreenManager::willCommitLayerTree):
819         addVideoLayerIDPendingFullscreen on RemoteLayerTreeTransaction when needed.
820
821         (WebKit::WebVideoFullscreenManager::setVideoLayer):
822         Pass along the video layerID.
823
824         * WebProcess/ios/WebVideoFullscreenManager.h:
825         Add willCommitLayerTree() and remove setVideoLayerID().
826         Add a member to retain the unparented PlatformCALayer.
827
828 2014-02-24  Martin Hock  <mhock@apple.com>
829
830         Create SessionID value-style class for session IDs.
831         https://bugs.webkit.org/show_bug.cgi?id=129141
832
833         The below changes deal solely with mechanical changes to use the SessionID value class instead of uint64_t except where noted.
834
835         Reviewed by Brady Eidson.
836
837         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
838         (WebKit::storageSession):
839         (WebKit::NetworkConnectionToWebProcess::startDownload):
840         (WebKit::NetworkConnectionToWebProcess::cookiesForDOM):
841         (WebKit::NetworkConnectionToWebProcess::setCookiesFromDOM):
842         (WebKit::NetworkConnectionToWebProcess::cookiesEnabled):
843         (WebKit::NetworkConnectionToWebProcess::cookieRequestHeaderFieldValue):
844         (WebKit::NetworkConnectionToWebProcess::getRawCookies):
845         (WebKit::NetworkConnectionToWebProcess::deleteCookie):
846         * NetworkProcess/NetworkConnectionToWebProcess.h:
847         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
848         * NetworkProcess/NetworkProcess.cpp:
849         (WebKit::NetworkProcess::initializeNetworkProcess):
850         (WebKit::NetworkProcess::ensurePrivateBrowsingSession):
851         (WebKit::NetworkProcess::destroyPrivateBrowsingSession):
852         * NetworkProcess/NetworkProcess.h:
853         * NetworkProcess/NetworkProcess.messages.in:
854         * NetworkProcess/NetworkResourceLoader.h:
855         * NetworkProcess/RemoteNetworkingContext.h:
856         * NetworkProcess/mac/RemoteNetworkingContext.mm:
857         (WebKit::RemoteNetworkingContext::ensurePrivateBrowsingSession):
858         * NetworkProcess/soup/RemoteNetworkingContextSoup.cpp:
859         (WebKit::RemoteNetworkingContext::ensurePrivateBrowsingSession):
860         * Shared/Network/NetworkResourceLoadParameters.cpp:
861         (WebKit::NetworkResourceLoadParameters::NetworkResourceLoadParameters):
862         * Shared/Network/NetworkResourceLoadParameters.h:
863         * Shared/SessionTracker.cpp:
864         (WebKit::staticSessionMap):
865         (WebKit::storageSessionToID):
866         (WebKit::SessionTracker::sessionMap):
867         (WebKit::SessionTracker::session):
868         (WebKit::SessionTracker::sessionID):
869         (WebKit::SessionTracker::setSession):
870         (WebKit::SessionTracker::destroySession):
871         * Shared/SessionTracker.h: Move code to SessionID class.
872         * Shared/WebCoreArgumentCoders.cpp: Add encode and decode for SessionID.
873         (IPC::ArgumentCoder<SessionID>::encode):
874         (IPC::ArgumentCoder<SessionID>::decode):
875         * Shared/WebCoreArgumentCoders.h:
876         * Shared/mac/CookieStorageShim.mm:
877         (WebKit::webKitCookieStorageCopyRequestHeaderFieldsForURL):
878         * UIProcess/APISession.cpp:
879         (API::generateID):
880         (API::Session::defaultSession):
881         (API::Session::legacyPrivateSession):
882         (API::Session::Session):
883         (API::Session::isEphemeral):
884         (API::Session::getID):
885         * UIProcess/APISession.h:
886         * UIProcess/WebContext.cpp:
887         (WebKit::WebContext::setAnyPageGroupMightHavePrivateBrowsingEnabled):
888         (WebKit::WebContext::createNewWebProcess):
889         * UIProcess/WebContext.h:
890         * UIProcess/WebPageProxy.h:
891         (WebKit::WebPageProxy::sessionID):
892         * WebProcess/InjectedBundle/InjectedBundle.cpp:
893         (WebKit::InjectedBundle::setPrivateBrowsingEnabled):
894         * WebProcess/Network/WebResourceLoadScheduler.cpp:
895         (WebKit::WebResourceLoadScheduler::scheduleLoad):
896         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
897         (WebKit::WebPlatformStrategies::loadResourceSynchronously):
898         * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.h:
899         * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm:
900         (WebKit::WebFrameNetworkingContext::ensurePrivateBrowsingSession):
901         (WebKit::WebFrameNetworkingContext::storageSession):
902         * WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.cpp:
903         (WebKit::WebFrameNetworkingContext::ensurePrivateBrowsingSession):
904         (WebKit::WebFrameNetworkingContext::storageSession):
905         * WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.h:
906         * WebProcess/WebPage/WebPage.cpp: Move sessionID to Page to allow WebCore to access it.
907         (WebKit::WebPage::WebPage):
908         (WebKit::WebPage::sessionID):
909         (WebKit::WebPage::isUsingEphemeralSession):
910         (WebKit::WebPage::setSessionID):
911         (WebKit::WebPage::updatePreferences):
912         * WebProcess/WebPage/WebPage.h:
913         * WebProcess/WebPage/WebPage.messages.in:
914         * WebProcess/WebProcess.cpp:
915         (WebKit::WebProcess::ensurePrivateBrowsingSession):
916         (WebKit::WebProcess::destroyPrivateBrowsingSession):
917         * WebProcess/WebProcess.h:
918         * WebProcess/WebProcess.messages.in:
919
920 2014-02-24  Simon Fraser  <simon.fraser@apple.com>
921
922         Remove PDFViewController.*, which is unused
923         https://bugs.webkit.org/show_bug.cgi?id=129270
924
925         Reviewed by Tim Horton.
926
927         * UIProcess/mac/PDFViewController.h: Removed.
928         * UIProcess/mac/PDFViewController.mm: Removed.
929
930 2014-02-24  Anders Carlsson  <andersca@apple.com>
931
932         Rename WKProcessClass to WKProcessPool
933         https://bugs.webkit.org/show_bug.cgi?id=129268
934
935         Reviewed by Dan Bernstein.
936
937         Stage this rename by adding back WKProcessClass and WKProcessClassConfiguration as subclasses of the renamed classes.
938
939         * Shared/Cocoa/APIObject.mm:
940         (API::Object::newObject):
941         * UIProcess/API/Cocoa/WKProcessClass.h:
942         * UIProcess/API/Cocoa/WKProcessClass.mm:
943         * UIProcess/API/Cocoa/WKProcessClassConfiguration.h:
944         * UIProcess/API/Cocoa/WKProcessClassConfiguration.mm:
945         * UIProcess/API/Cocoa/WKProcessClassConfigurationPrivate.h:
946         * UIProcess/API/Cocoa/WKProcessClassPrivate.h:
947         * UIProcess/API/Cocoa/WKProcessPool.h: Copied from Source/WebKit2/UIProcess/API/Cocoa/WKProcessClass.h.
948         * UIProcess/API/Cocoa/WKProcessPool.mm: Copied from Source/WebKit2/UIProcess/API/Cocoa/WKProcessClass.mm.
949         (-[WKProcessPool init]):
950         (-[WKProcessPool initWithConfiguration:]):
951         (-[WKProcessPool dealloc]):
952         (-[WKProcessPool description]):
953         (-[WKProcessPool configuration]):
954         (-[WKProcessPool API::]):
955         (-[WKProcessPool _setAllowsSpecificHTTPSCertificate:forHost:]):
956         * UIProcess/API/Cocoa/WKProcessPoolConfiguration.h: Copied from Source/WebKit2/UIProcess/API/Cocoa/WKProcessClassConfiguration.h.
957         * UIProcess/API/Cocoa/WKProcessPoolConfiguration.mm: Copied from Source/WebKit2/UIProcess/API/Cocoa/WKProcessClassConfiguration.mm.
958         (-[WKProcessPoolConfiguration _injectedBundleURL]):
959         (-[WKProcessPoolConfiguration _setInjectedBundleURL:]):
960         (-[WKProcessPoolConfiguration description]):
961         (-[WKProcessPoolConfiguration copyWithZone:]):
962         * UIProcess/API/Cocoa/WKProcessPoolConfigurationPrivate.h: Copied from Source/WebKit2/UIProcess/API/Cocoa/WKProcessClassConfigurationPrivate.h.
963         * UIProcess/API/Cocoa/WKProcessPoolInternal.h: Renamed from Source/WebKit2/UIProcess/API/Cocoa/WKProcessClassInternal.h.
964         (WebKit::wrapper):
965         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h: Copied from Source/WebKit2/UIProcess/API/Cocoa/WKProcessClassPrivate.h.
966         * UIProcess/API/Cocoa/WKWebView.mm:
967         (-[WKWebView initWithFrame:configuration:]):
968         * UIProcess/API/Cocoa/WKWebViewConfiguration.h:
969         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
970         (-[WKWebViewConfiguration description]):
971         (-[WKWebViewConfiguration copyWithZone:]):
972         (-[WKWebViewConfiguration processPool]):
973         (-[WKWebViewConfiguration setProcessPool:]):
974         * UIProcess/API/Cocoa/WKWebViewConfigurationToBeRemoved.mm: Copied from Source/WebKit2/UIProcess/API/Cocoa/WKProcessClassPrivate.h.
975         (-[WKWebViewConfiguration setProcessClass:]):
976         (-[WKWebViewConfiguration processClass]):
977         * UIProcess/API/mac/WKView.mm:
978         * UIProcess/ios/WKContentView.mm:
979         (-[WKContentView _decidePolicyForGeolocationRequestFromOrigin:frame:request:]):
980         * WebKit2.xcodeproj/project.pbxproj:
981
982 2014-02-24  Simon Fraser  <simon.fraser@apple.com>
983
984         Move non-API files out of WebKit2/UIProcess/API/mac
985         https://bugs.webkit.org/show_bug.cgi?id=129267
986
987         Reviewed by Anders Carlsson.
988
989         * UIProcess/mac/FindIndicatorWindow.h: Renamed from Source/WebKit2/UIProcess/API/mac/FindIndicatorWindow.h.
990         * UIProcess/mac/FindIndicatorWindow.mm: Renamed from Source/WebKit2/UIProcess/API/mac/FindIndicatorWindow.mm.
991         * UIProcess/mac/PDFViewController.h: Renamed from Source/WebKit2/UIProcess/API/mac/PDFViewController.h.
992         * UIProcess/mac/PDFViewController.mm: Renamed from Source/WebKit2/UIProcess/API/mac/PDFViewController.mm.
993         * UIProcess/mac/WKPrintingView.h: Renamed from Source/WebKit2/UIProcess/API/mac/WKPrintingView.h.
994         * UIProcess/mac/WKPrintingView.mm: Renamed from Source/WebKit2/UIProcess/API/mac/WKPrintingView.mm.
995         * UIProcess/mac/WKTextInputWindowController.h: Renamed from Source/WebKit2/UIProcess/API/mac/WKTextInputWindowController.h.
996         * UIProcess/mac/WKTextInputWindowController.mm: Renamed from Source/WebKit2/UIProcess/API/mac/WKTextInputWindowController.mm.
997         * WebKit2.xcodeproj/project.pbxproj:
998
999 2014-02-24  Simon Fraser  <simon.fraser@apple.com>
1000
1001         Move non-API files in the API/ios directory out to UIProcess/ios
1002         https://bugs.webkit.org/show_bug.cgi?id=129264
1003
1004         Reviewed by Anders Carlsson.
1005
1006         * UIProcess/ios/PageClientImplIOS.h: Renamed from Source/WebKit2/UIProcess/API/ios/PageClientImplIOS.h.
1007         * UIProcess/ios/PageClientImplIOS.mm: Renamed from Source/WebKit2/UIProcess/API/ios/PageClientImplIOS.mm.
1008         * UIProcess/ios/WKActionSheet.h: Renamed from Source/WebKit2/UIProcess/API/ios/WKActionSheet.h.
1009         * UIProcess/ios/WKActionSheet.mm: Renamed from Source/WebKit2/UIProcess/API/ios/WKActionSheet.mm.
1010         * UIProcess/ios/WKContentViewInternal.h: Renamed from Source/WebKit2/UIProcess/API/ios/WKContentViewInternal.h.
1011         * UIProcess/ios/WKGeolocationProviderIOS.h: Renamed from Source/WebKit2/UIProcess/API/ios/WKGeolocationProviderIOS.h.
1012         * UIProcess/ios/WKGeolocationProviderIOS.mm: Renamed from Source/WebKit2/UIProcess/API/ios/WKGeolocationProviderIOS.mm.
1013         * UIProcess/ios/WKInteractionView.h: Renamed from Source/WebKit2/UIProcess/API/ios/WKInteractionView.h.
1014         * UIProcess/ios/WKInteractionView.mm: Renamed from Source/WebKit2/UIProcess/API/ios/WKInteractionView.mm.
1015         * UIProcess/ios/WKScrollView.h: Renamed from Source/WebKit2/UIProcess/API/ios/WKScrollView.h.
1016         * UIProcess/ios/WKScrollView.mm: Renamed from Source/WebKit2/UIProcess/API/ios/WKScrollView.mm.
1017         * WebKit2.xcodeproj/project.pbxproj:
1018
1019 2014-02-24  Simon Fraser  <simon.fraser@apple.com>
1020
1021         Rename PageClientImplIOS::m_view to m_contentView
1022         https://bugs.webkit.org/show_bug.cgi?id=129124
1023
1024         Reviewed by Benjamin Poulain.
1025         
1026         Simple rename of m_view to m_contentView in preparation for
1027         also holding onto the WKView.
1028
1029         * UIProcess/API/ios/PageClientImplIOS.h:
1030         * UIProcess/API/ios/PageClientImplIOS.mm:
1031         (WebKit::PageClientImpl::PageClientImpl):
1032         (WebKit::PageClientImpl::createDrawingAreaProxy):
1033         (WebKit::PageClientImpl::viewSize):
1034         (WebKit::PageClientImpl::isViewInWindow):
1035         (WebKit::PageClientImpl::processDidExit):
1036         (WebKit::PageClientImpl::didRelaunchProcess):
1037         (WebKit::PageClientImpl::decidePolicyForGeolocationPermissionRequest):
1038         (WebKit::PageClientImpl::didCommitLoadForMainFrame):
1039         (WebKit::PageClientImpl::interpretKeyEvent):
1040         (WebKit::PageClientImpl::positionInformationDidChange):
1041         (WebKit::PageClientImpl::selectionDidChange):
1042         (WebKit::PageClientImpl::screenToRootView):
1043         (WebKit::PageClientImpl::rootViewToScreen):
1044         (WebKit::PageClientImpl::setAcceleratedCompositingRootLayer):
1045         (WebKit::PageClientImpl::takeViewSnapshot):
1046         (WebKit::PageClientImpl::didGetTapHighlightGeometries):
1047         (WebKit::PageClientImpl::didCommitLayerTree):
1048         (WebKit::PageClientImpl::startAssistingNode):
1049         (WebKit::PageClientImpl::stopAssistingNode):
1050
1051 2014-02-24  Enrique Ocaña González  <eocanha@igalia.com>
1052
1053         REGRESSION(r164438): [GTK] Tests /webkit2/WebKitWebView/tls-errors-policy and /webkit2/WebKitWebContext/uri-scheme fail
1054         https://bugs.webkit.org/show_bug.cgi?id=129252
1055
1056         Reviewed by Carlos Garcia Campos.
1057
1058         * UIProcess/API/gtk/WebKitPrivate.cpp: Manage error values generated by the user application and not present in WebCore
1059         (toWebKitError):
1060         (toWebCoreError):
1061
1062 2014-02-24  Alexey Proskuryakov  <ap@apple.com>
1063
1064         <rdar://problem/16059894> Update AppleConnect sandbox profile for XPC process names.
1065
1066         Patch by Ivan Krstić, reviewed and landed by me.
1067
1068         * Resources/PlugInSandboxProfiles/com.apple.ist.ds.appleconnect.webplugin.sb:
1069
1070 2014-02-24  Tamas Gergely  <tgergely.u-szeged@partner.samsung.com>
1071
1072         Code cleanup: remove leftover ENABLE(WORKERS) macros and support.
1073         https://bugs.webkit.org/show_bug.cgi?id=129255
1074
1075         Reviewed by Csaba Osztrogonác.
1076
1077         ENABLE_WORKERS macro was removed in r159679.
1078         Support is now also removed from xcconfig files.
1079
1080         * Configurations/FeatureDefines.xcconfig:
1081
1082 2014-02-24  Iago Toral Quiroga  <itoral@igalia.com>
1083
1084         [GTK] Wrong active context when destroying GL objects.
1085         https://bugs.webkit.org/show_bug.cgi?id=129244
1086
1087         Reviewed by Martin Robinson.
1088
1089         * WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp:
1090         (WebKit::LayerTreeHostGtk::invalidate): make context current before destroying GL objects.
1091
1092 2014-02-24  Koop Mast <kwm@FreeBSD.org>
1093
1094         Remove unused error.h header.
1095         https://bugs.webkit.org/show_bug.cgi?id=126774
1096
1097         Reviewed by Anders Carlsson.
1098
1099         This header doesn't exists on FreeBSD. According to
1100         https://www.gnu.org/software/gnulib/manual/html_node/error_002eh.html
1101         the function that this header implements are not present in the file.
1102         So there isn't any need for this header.
1103
1104         * NetworkProcess/unix/NetworkProcessMainUnix.cpp:
1105
1106 2014-02-24  David Kilzer  <ddkilzer@apple.com>
1107
1108         Remove redundant setting in FeatureDefines.xcconfig
1109
1110         * Configurations/FeatureDefines.xcconfig:
1111
1112 2014-02-24  Carlos Garcia Campos  <cgarcia@igalia.com>
1113
1114         [GTK] Remove unneeded method webkitWebViewBaseRequestExitFullScreen
1115         https://bugs.webkit.org/show_bug.cgi?id=129245
1116
1117         Reviewed by Sergio Villar Senin.
1118
1119         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
1120         (webkitWebViewBaseKeyPressEvent): Call FullscreenManager::requestExitFullScreen() directly.
1121         * UIProcess/API/gtk/WebKitWebViewBasePrivate.h:
1122
1123 2014-02-23  Dan Bernstein  <mitz@apple.com>
1124
1125         <rdar://problem/16144508> [iOS] Some definitions of INSTALL_PATH don’t account for INSTALL_PATH_PREFIX
1126         https://bugs.webkit.org/show_bug.cgi?id=129241
1127
1128         Reviewed by Mark Rowe.
1129
1130         * Configurations/Base.xcconfig: Define INSTALL_PATH here in terms of INSTALL_PATH_ACTUAL.
1131         * Configurations/BaseLegacyProcess.xcconfig: Define only INSTALL_PATH_ACTUAL.
1132         * Configurations/BaseTarget.xcconfig: Simplify the definition of
1133         NORMAL_WEBKIT2_FRAMEWORKS_DIR, now that it shouldn’t include SDKROOT for the Simulator.
1134         * Configurations/BaseXPCService.xcconfig: Define only INSTALL_PATH_ACTUAL.
1135         * Configurations/WebKit2.xcconfig: Ditto.
1136
1137 2014-02-23  Sam Weinig  <sam@webkit.org>
1138
1139         Update FeatureDefines.xcconfig
1140
1141         Rubber-stamped by Anders Carlsson.
1142
1143         * Configurations/FeatureDefines.xcconfig:
1144
1145 2014-02-23  Sam Weinig  <sam@webkit.org>
1146
1147         [WebKit2] Add C-SPI to enable/disable telephone number detection
1148         https://bugs.webkit.org/show_bug.cgi?id=129239
1149
1150         Reviewed by Dean Jackson.
1151
1152         * UIProcess/API/C/WKPreferences.cpp:
1153         (WKPreferencesSetTelephoneNumberParsingEnabled):
1154         (WKPreferencesGetTelephoneNumberParsingEnabled):
1155         * UIProcess/API/C/WKPreferencesPrivate.h:
1156
1157 2014-02-23  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
1158
1159         Change a url parameter type with URL in NavigatorContentUtils
1160         https://bugs.webkit.org/show_bug.cgi?id=129202
1161
1162         Reviewed by Sam Weinig.
1163
1164         It would be good if we use *URL* for url parameters instead of using String.
1165
1166         Merge from blink. https://src.chromium.org/viewvc/blink?view=rev&revision=165458.
1167
1168         * WebProcess/WebCoreSupport/WebNavigatorContentUtilsClient.h:
1169         (WebKit::WebNavigatorContentUtilsClient::isProtocolHandlerRegistered):
1170         (WebKit::WebNavigatorContentUtilsClient::unregisterProtocolHandler):
1171
1172 2014-02-23  Sam Weinig  <sam@webkit.org>
1173
1174         Move telephone number detection behind its own ENABLE macro
1175         https://bugs.webkit.org/show_bug.cgi?id=129236
1176
1177         Reviewed by Dean Jackson.
1178
1179         * Configurations/FeatureDefines.xcconfig:
1180         Add ENABLE_TELEPHONE_NUMBER_DETECTION.
1181
1182 2014-02-23  Diego Pino García  <dpino@igalia.com>
1183
1184         [GTK] Fix build after Web Inspector code reorganization (r164543)
1185         https://bugs.webkit.org/show_bug.cgi?id=129231
1186
1187         Reviewed by Dean Jackson.
1188
1189         * PlatformGTK.cmake:
1190         Modify paths to Web Inspector code.
1191
1192 2014-02-22  Joseph Pecoraro  <pecoraro@apple.com>
1193
1194         Remove some unreachable code (-Wunreachable-code)
1195         https://bugs.webkit.org/show_bug.cgi?id=129220
1196
1197         Reviewed by Eric Carlson.
1198
1199         * WebProcess/InjectedBundle/API/c/WKBundleAPICast.h:
1200         (WebKit::toAPI):
1201
1202 2014-02-22  Dan Bernstein  <mitz@apple.com>
1203
1204         [Cocoa] WKUIDelegate.h is a project header
1205         https://bugs.webkit.org/show_bug.cgi?id=129215
1206
1207         Reviewed by Anders Carlsson.
1208
1209         * WebKit2.xcodeproj/project.pbxproj: Make it a public header.
1210
1211 2014-02-22  Dan Bernstein  <mitz@apple.com>
1212
1213         <rdar://problem/12500358> [Cocoa] Development variants of XPC services should not be installed in WebKit2.framework/XPCServices
1214         https://bugs.webkit.org/show_bug.cgi?id=129197
1215
1216         Reviewed by Sam Weinig.
1217
1218         * Configurations/BaseXPCService.xcconfig: Made INSTALL_PATH vary based on
1219         WK_XPC_SERVICE_VARIANT. For the Development variant, use an install path outside the
1220         framework. Note that engineering builds using the build action continue to have the
1221         Development variants copied into the framework by a script build phase.
1222         * Configurations/DatabaseService.Development.xcconfig: Set WK_XPC_SERVICE_VARIANT.
1223         * Configurations/DatabaseService.xcconfig: Ditto.
1224         * Configurations/NetworkService.Development.xcconfig: Ditto.
1225         * Configurations/NetworkService.xcconfig: Ditto.
1226         * Configurations/PluginService.32.xcconfig: Ditto.
1227         * Configurations/PluginService.64.xcconfig: Ditto.
1228         * Configurations/PluginService.Development.xcconfig: Ditto.
1229         * Configurations/WebContentService.Development.xcconfig: Ditto.
1230         * Configurations/WebContentService.xcconfig: Ditto.
1231
1232 2014-02-21  Brent Fulgham  <bfulgham@apple.com>
1233
1234         Extend media support for WebVTT sources
1235         https://bugs.webkit.org/show_bug.cgi?id=129156
1236
1237         Reviewed by Eric Carlson.
1238
1239         * Configurations/FeatureDefines.xcconfig: Add new feature define for AVF_CAPTIONS
1240
1241 2014-02-21  Enrica Casucci  <enrica@apple.com>
1242
1243         [iOS WebKit2] Keyboard appears every time a link is tapped after searching Google
1244         <rdar://problem/16072563>.
1245
1246         Reviewed by Benjamin Poulain.
1247
1248         We need to stop assisting the node if we have
1249         navigated to a different page.
1250
1251         * UIProcess/API/ios/WKContentView.mm:
1252         (-[WKContentView _didCommitLoadForMainFrame]):
1253
1254 2014-02-21  Dan Bernstein  <mitz@apple.com>
1255
1256         Made WKWebView implement all WKContentViewDelegate methods.
1257
1258         Reviewed by Anders Carlsson.
1259
1260         * UIProcess/API/Cocoa/WKWebView.mm:
1261         (-[WKWebView takeViewSnapshotForContentView:]): Moved from WKViewIOS.mm.
1262         * UIProcess/API/ios/WKContentView.h: Made all protocol methods required.
1263         * UIProcess/API/ios/WKViewIOS.mm:
1264         (-[WKView _commonInitializationWithContextRef:pageGroupRef:relatedToPage:]): Removed code
1265         to set self as the delegate on the content view.
1266
1267 2014-02-21  Sam Weinig  <sam@webkit.org>
1268
1269         <rdar://problem/16073882> Please add _AbandonCoalition key to plugin XPC service Info.plist
1270
1271         Reviewed by Anders Carlsson.
1272
1273         * PluginProcess/EntryPoint/mac/XPCService/PluginService.32-64.Info.plist:
1274         * PluginProcess/EntryPoint/mac/XPCService/PluginService.Development/Info.plist:
1275
1276 2014-02-21  Jeffrey Pfau  <jpfau@apple.com>
1277
1278         [Mac] Cache callbacks for cache partitioning may be passed null
1279         https://bugs.webkit.org/show_bug.cgi?id=129175
1280
1281         Reviewed by Brady Eidson.
1282
1283         * WebProcess/ResourceCache/cf/WebResourceCacheManagerCFNet.cpp:
1284         (WebKit::WebResourceCacheManager::cfURLCacheHostNamesWithCallback):
1285
1286 2014-02-21  Benjamin Poulain  <bpoulain@apple.com>
1287
1288         [iOS][WK2] Update the visible content rects on zoom
1289         https://bugs.webkit.org/show_bug.cgi?id=129174
1290
1291         Reviewed by Simon Fraser.
1292
1293         Generalize _updateVisibleContentRects to also act during the zoom and not only at the end.
1294
1295         * UIProcess/API/Cocoa/WKWebView.mm:
1296         (-[WKWebView scrollViewDidZoom:]):
1297         * UIProcess/API/ios/WKViewIOS.mm:
1298         (-[WKView scrollViewDidZoom:]):
1299
1300 2014-02-21  Benjamin Poulain  <benjamin@webkit.org>
1301
1302         jsDocumentPrototypeFunctionGetElementById should not create an AtomicString for the function argument
1303         https://bugs.webkit.org/show_bug.cgi?id=128893
1304
1305         Reviewed by Darin Adler.
1306
1307         * WebProcess/InjectedBundle/InjectedBundle.cpp:
1308         (WebKit::InjectedBundle::pageNumberForElementById): Remove the explicit conversion to use the right overload.
1309
1310 2014-02-21  Enrica Casucci  <enrica@apple.com>
1311
1312         Support WebSelections in WK2 on iOS.
1313         https://bugs.webkit.org/show_bug.cgi?id=127015
1314         <rdar://problem/15211964>
1315
1316         Reviewed by Benjamin Poulain.
1317
1318         This is the remaining work on block selections for iOS in WK2.
1319         Once a block selection has been created with a long press gesture
1320         on a selectable area, we can interact with it by touching the four
1321         handles at the top, right, bottom and left side of the selection box.
1322         Expanding or shrinking a block selection requires finding the next/previous
1323         block in the direction of the movement, depending on the handle we
1324         are interacting with.
1325         Every time a new block is selected, we compute the thresholds required
1326         to trigger another block change. The thresholds are sent back to the
1327         UIProcess that will use this information to decide when to activate
1328         the new selection, either bigger or smaller.
1329         This patch also fixes a bug in selectWithTwoTouches where the points
1330         were not mapped to the active frame.
1331
1332         * Shared/ios/WKGestureTypes.h:
1333         * UIProcess/API/ios/PageClientImplIOS.h:
1334         * UIProcess/API/ios/PageClientImplIOS.mm:
1335         (WebKit::PageClientImpl::didUpdateBlockSelectionWithTouches):
1336         * UIProcess/API/ios/WKContentView.mm:
1337         (-[WKContentView _didUpdateBlockSelectionWithTouches:withFlags:growThreshold:shrinkThreshold:]):
1338         * UIProcess/API/ios/WKContentViewInternal.h:
1339         * UIProcess/API/ios/WKInteractionView.h:
1340         * UIProcess/API/ios/WKInteractionView.mm:
1341         (-[WKInteractionView hasSelectablePositionAtPoint:]):
1342         (-[WKInteractionView clearSelection]):
1343         (toWKHandlePosition):
1344         (-[WKInteractionView _didUpdateBlockSelectionWithTouches:WebKit::withFlags:WebKit::growThreshold:shrinkThreshold:]):
1345         (-[WKInteractionView changeBlockSelectionWithTouchAt:withSelectionTouch:forHandle:]):
1346         * UIProcess/PageClient.h:
1347         * UIProcess/WebPageProxy.h:
1348         * UIProcess/WebPageProxy.messages.in:
1349         * UIProcess/ios/WebPageProxyIOS.mm:
1350         (WebKit::WebPageProxy::updateBlockSelectionWithTouches):
1351         (WebKit::WebPageProxy::didUpdateBlockSelectionWithTouches):
1352         * WebProcess/WebPage/WebPage.cpp:
1353         * WebProcess/WebPage/WebPage.h:
1354         * WebProcess/WebPage/WebPage.messages.in:
1355         * WebProcess/WebPage/ios/WebPageIOS.mm:
1356         (WebKit::WebPage::rangeForWebSelectionAtPosition):
1357         (WebKit::WebPage::rangeForBlockAtPoint):
1358         (WebKit::WebPage::selectWithGesture):
1359         (WebKit::distanceBetweenRectsForPosition):
1360         (WebKit::rectsEssentiallyTheSame):
1361         (WebKit::containsRange):
1362         (WebKit::unionDOMRanges):
1363         (WebKit::computeEdgeCenter):
1364         (WebKit::WebPage::expandedRangeFromHandle):
1365         (WebKit::WebPage::contractedRangeFromHandle):
1366         (WebKit::WebPage::computeExpandAndShrinkThresholdsForHandle):
1367         (WebKit::shouldExpand):
1368         (WebKit::WebPage::changeBlockSelection):
1369         (WebKit::WebPage::updateBlockSelectionWithTouches):
1370         (WebKit::WebPage::clearSelection):
1371         (WebKit::WebPage::selectWithTwoTouches):
1372         (WebKit::WebPage::getPositionInformation):
1373
1374 2014-02-21  Anders Carlsson  <andersca@apple.com>
1375
1376         Make sure to invoke the completion handler for JS alerts
1377         https://bugs.webkit.org/show_bug.cgi?id=129158
1378
1379         Reviewed by Alexey Proskuryakov.
1380
1381         * UIProcess/API/C/WKPage.cpp:
1382         (WKPageSetPageUIClient):
1383
1384 2014-02-20  Zalan Bujtas  <zalan@apple.com>
1385
1386         Remove redundant deviceScaleFactor() functions and make callers use Document::deviceScaleFactor() when accessible.
1387         https://bugs.webkit.org/show_bug.cgi?id=129137
1388
1389         Reviewed by Simon Fraser.
1390
1391         No change in behavior.
1392
1393         * WebProcess/WebPage/FindController.cpp:
1394         (WebKit::FindController::getFindIndicatorBitmapAndRect):
1395
1396 2014-02-20  Benjamin Poulain  <bpoulain@apple.com>
1397
1398         Add a missing piece of r164469
1399
1400         * UIProcess/API/Cocoa/WKWebView.mm:
1401         (-[WKWebView scrollViewWillBeginDragging:]):
1402         I forgot to duplicate the change from WKViewIOS in r164469.
1403
1404 2014-02-20  Benjamin Poulain  <bpoulain@apple.com>
1405
1406         WKInteractionView always blocks the main thread when sending touch events
1407         https://bugs.webkit.org/show_bug.cgi?id=129059
1408
1409         Reviewed by Enrica Casucci.
1410
1411         Add the asynchronous dispatching to WebKit2.
1412
1413         * Shared/NativeWebTouchEvent.h:
1414         (WebKit::NativeWebTouchEvent::uniqueId):
1415         * Shared/ios/NativeWebTouchEventIOS.mm:
1416         (WebKit::NativeWebTouchEvent::NativeWebTouchEvent):
1417         * UIProcess/API/ios/PageClientImplIOS.mm:
1418         (WebKit::PageClientImpl::doneWithTouchEvent):
1419         * UIProcess/API/ios/WKContentView.h:
1420         * UIProcess/API/ios/WKContentView.mm:
1421         (-[WKContentView willStartUserTriggeredScroll]):
1422         (-[WKContentView willStartUserTriggeredZoom]):
1423         (-[WKContentView _webTouchEvent:WebKit::preventsNativeGestures:]):
1424         * UIProcess/API/ios/WKContentViewInternal.h:
1425         * UIProcess/API/ios/WKInteractionView.h:
1426         * UIProcess/API/ios/WKInteractionView.mm:
1427         (-[WKInteractionView _webTouchEventsRecognized:]):
1428         (-[WKInteractionView _webTouchEvent:WebKit::preventsNativeGestures:]):
1429         (-[WKInteractionView _willStartUserTriggeredScrollingOrZooming]):
1430         * UIProcess/API/ios/WKViewIOS.mm:
1431         (-[WKView scrollViewWillBeginDragging:]):
1432         * WebKit2.xcodeproj/project.pbxproj:
1433
1434 2014-02-20  Benjamin Poulain  <bpoulain@apple.com>
1435
1436         Start fixing the view states driven by the WKScrollView
1437         https://bugs.webkit.org/show_bug.cgi?id=129140
1438
1439         Reviewed by Tim Horton and Simon Fraser.
1440
1441         WKScrollView creates a "window" over WKContentView with an area that is exposed,
1442         an area that is unobcured and with a certain scale.
1443
1444         Instead of having 3 loosely related paths for updating WKContentView
1445         when the content "window" change, everything is consolidated behind the
1446         single API -[WKContentView didUpdateVisibleRect:unobscuredRect:scale:].
1447
1448         This patch only fixes the content updates from the UI process side to keep things simple.
1449
1450         * UIProcess/API/Cocoa/WKWebView.mm:
1451         (-[WKWebView _didFinishScrolling]):
1452         (-[WKWebView scrollViewDidEndDragging:willDecelerate:]):
1453         (-[WKWebView scrollViewDidEndDecelerating:]):
1454         (-[WKWebView scrollViewDidScrollToTop:]):
1455         (-[WKWebView scrollViewDidScroll:]):
1456         (-[WKWebView scrollViewDidEndZooming:withView:atScale:]):
1457         (-[WKWebView _frameOrBoundsChanged]):
1458         (-[WKWebView _updateContentWindow]):
1459         (-[WKWebView _setObscuredInsets:]):
1460         * UIProcess/API/ios/WKContentView.h:
1461         * UIProcess/API/ios/WKContentView.mm:
1462         (-[WKContentView didUpdateVisibleRect:unobscuredRect:scale:]):
1463         (-[WKContentView _updateFixedPositionRect]):
1464         (-[WKContentView didFinishScrolling]):
1465         (-[WKContentView didZoomToScale:]):
1466         * UIProcess/API/ios/WKViewIOS.mm:
1467         (-[WKView contentView:didCommitLayerTree:]):
1468         (-[WKView _didFinishScrolling]):
1469         (-[WKView scrollViewDidEndDragging:willDecelerate:]):
1470         (-[WKView scrollViewDidEndDecelerating:]):
1471         (-[WKView scrollViewDidScrollToTop:]):
1472         (-[WKView scrollViewDidScroll:]):
1473         (-[WKView scrollViewDidEndZooming:withView:atScale:]):
1474         Scrolling is modified to take into account the view position and the obcured content.
1475         Instead of driving the scrolling position from the UIScrollView delegate callbacks,
1476         we use changes in unobscured rect to find changes in "content visible scroll position".
1477
1478         WebPageProxy::didFinishScrolling() is removed. All the scrollOffset updates now go through
1479         the ScrollingCoordinator.
1480
1481         (-[WKView _frameOrBoundsChanged]):
1482         (-[WKView _updateContentWindow]):
1483         (-[WKView _setObscuredInsets:]):
1484         * UIProcess/WebPageProxy.h:
1485         * UIProcess/ios/WebPageProxyIOS.mm:
1486         (WebKit::WebPageProxy::unobscuredContentRect):
1487         (WebKit::WebPageProxy::setUnobscuredContentRect):
1488         * WebProcess/WebPage/WebPage.messages.in:
1489         * WebProcess/WebPage/ios/WebPageIOS.mm:
1490
1491 2014-02-20  Tim Horton  <timothy_horton@apple.com>
1492
1493         Fix a build warning by moving some WKWebView methods from the private category to WKWebView itself.
1494
1495         Reviewed by Anders Carlsson.
1496
1497         * UIProcess/API/Cocoa/WKWebView.mm:
1498         (-[WKWebView setAllowsBackForwardNavigationGestures:]):
1499         (-[WKWebView allowsBackForwardNavigationGestures]):
1500
1501 2014-02-20  Enrica Casucci  <enrica@apple.com>
1502
1503         ASSERT on touches callbacks after r164409 on iOS.
1504         https://bugs.webkit.org/show_bug.cgi?id=129135
1505
1506         Reviewed by Alexey Proskuryakov.
1507
1508         The change used incorrecly true and false in TouchesCallbacks and
1509         ImageCallback. It also reintroduced isMainThread() which doesn't work
1510         for iOS.
1511
1512         * UIProcess/GenericCallback.h:
1513         (WebKit::CallbackBase::generateCallbackID):
1514         (WebKit::ImageCallback::performCallbackWithReturnValue):
1515         (WebKit::ImageCallback::invalidate):
1516         * UIProcess/WebPageProxy.h:
1517         (WebKit::TouchesCallback::performCallbackWithReturnValue):
1518         (WebKit::TouchesCallback::invalidate):
1519
1520 2014-02-20  Anders Carlsson  <andersca@apple.com>
1521
1522         We need something like WKPageUIClient in the Obj-C API
1523         https://bugs.webkit.org/show_bug.cgi?id=129123
1524         <rdar://problem/15338439>
1525
1526         Reviewed by Sam Weinig.
1527
1528         * UIProcess/API/APIUIClient.h:
1529         * UIProcess/API/Cocoa/WKUIDelegate.h: Added.
1530         * UIProcess/API/Cocoa/WKWebView.h:
1531         * UIProcess/API/Cocoa/WKWebView.mm:
1532         (-[WKWebView initWithFrame:configuration:]):
1533         (-[WKWebView UIDelegate]):
1534         (-[WKWebView setUIDelegate:]):
1535         * UIProcess/Cocoa/UIClient.h: Added.
1536         * UIProcess/Cocoa/UIClient.mm: Added.
1537         (WebKit::UIClient::UIClient):
1538         (WebKit::UIClient::~UIClient):
1539         (WebKit::UIClient::delegate):
1540         (WebKit::UIClient::setDelegate):
1541         (WebKit::UIClient::runJavaScriptAlert):
1542         (WebKit::UIClient::runJavaScriptConfirm):
1543         (WebKit::UIClient::runJavaScriptPrompt):
1544         * UIProcess/WebPageProxy.h:
1545         (WebKit::WebPageProxy::uiClient):
1546         * WebKit2.xcodeproj/project.pbxproj:
1547
1548 2014-02-20  Brady Eidson  <beidson@apple.com>
1549
1550         Add very basic image control rendering
1551         https://bugs.webkit.org/show_bug.cgi?id=129080
1552
1553         Reviewed by Tim Horton.
1554
1555         * WebProcess/InjectedBundle/InjectedBundle.cpp:
1556         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner): Expose the 
1557           imageControlsEnabled setting to WKTR.
1558
1559 2014-02-20  Tim Horton  <timothy_horton@apple.com>
1560
1561         Add magnification and swiping properties to WKWebView
1562         https://bugs.webkit.org/show_bug.cgi?id=129117
1563
1564         Reviewed by Dan Bernstein.
1565
1566         * UIProcess/API/Cocoa/WKViewPrivate.h:
1567         Move allowsBackForwardNavigationGestures out of a Mac-only block.
1568
1569         * UIProcess/API/Cocoa/WKWebView.h:
1570         Add allowsBackForwardNavigationGestures to WKWebView for both platforms.
1571         Add magnification properties to WKWebView for Mac.
1572
1573         * UIProcess/API/Cocoa/WKWebView.mm:
1574         (-[WKWebView contentView:didCommitLayerTree:WebKit::]):
1575         (-[WKWebView setAllowsBackForwardNavigationGestures:]):
1576         (-[WKWebView allowsBackForwardNavigationGestures]):
1577         (-[WKWebView setAllowsMagnification:]):
1578         (-[WKWebView allowsMagnification]):
1579         (-[WKWebView setMagnification:]):
1580         (-[WKWebView magnification]):
1581         (-[WKWebView setMagnification:centeredAtPoint:]):
1582         For iOS, copy implementations from WKViewIOS.
1583         For Mac, forward to the inner WKView.
1584
1585         * UIProcess/API/ios/WKViewIOS.mm:
1586         (-[WKView setAllowsBackForwardNavigationGestures:]):
1587         Fix the logic to tear down the ViewGestureController.
1588
1589         * UIProcess/API/mac/WKView.mm:
1590         (-[WKView setMagnification:centeredAtPoint:]):
1591         (-[WKView setMagnification:]):
1592         (-[WKView magnification]):
1593         Use CG types for API.
1594
1595 == Rolled over to ChangeLog-2014-02-20 ==