Fix iOS build.
[WebKit-https.git] / Source / WebKit2 / ChangeLog
1 2014-03-25  Anders Carlsson  <andersca@apple.com>
2
3         Fix iOS build.
4
5         * UIProcess/API/Cocoa/WKWebView.h:
6         * UIProcess/API/Cocoa/WKWebView.mm:
7         Make WKIBActions OS X only for now.
8
9 2014-03-25  Anders Carlsson  <andersca@apple.com>
10
11         Begin stubbing out a WKWindowFeatures class
12         https://bugs.webkit.org/show_bug.cgi?id=130733
13
14         Reviewed by Dan Bernstein.
15
16         * UIProcess/API/Cocoa/WKWindowFeatures.h: Added.
17         * UIProcess/API/Cocoa/WKWindowFeatures.mm: Added.
18         (-[WKWindowFeatures _initWithWindowFeatures:WebCore::]):
19         (-[WKWindowFeatures x]):
20         (-[WKWindowFeatures y]):
21         (-[WKWindowFeatures width]):
22         (-[WKWindowFeatures height]):
23         * UIProcess/API/Cocoa/WKWindowFeaturesInternal.h: Added.
24         * WebKit2.xcodeproj/project.pbxproj:
25
26 2014-03-25  Anders Carlsson  <andersca@apple.com>
27
28         Add goBack: and goForward: IBActions and move stopLoading: to a new WKIBActions category on WKWebView
29         https://bugs.webkit.org/show_bug.cgi?id=130732
30
31         Reviewed by Tim Horton.
32
33         * UIProcess/API/Cocoa/WKWebView.h:
34         * UIProcess/API/Cocoa/WKWebView.mm:
35         (-[WKWebView goBack]):
36         (-[WKWebView goForward]):
37         (-[WKWebView validateUserInterfaceItem:]):
38         (-[WKWebView goBack:]):
39         (-[WKWebView goForward:]):
40         (-[WKWebView stopLoading:]):
41
42 2014-03-25  Martin Robinson  <mrobinson@igalia.com>
43
44         [GTK] Remove the autotools build
45         https://bugs.webkit.org/show_bug.cgi?id=130717
46
47         Reviewed by Anders Carlsson.
48
49         * GNUmakefile.am: Removed.
50         * WebKit2Prefix.h: Removed references to the autotools configure file.
51         * config.h: Ditto.
52
53 2014-03-25  Michał Pakuła vel Rutka  <m.pakula@samsung.com>
54
55         [EFL][WK2] Add NETWORK_PROCESS build option
56         https://bugs.webkit.org/show_bug.cgi?id=130131
57
58         Reviewed by Gyuyoung Kim.
59
60         * PlatformEfl.cmake: Add file needed to build with NETWORK_PROCESS enabled.
61
62 2014-03-24 Michał Pakuła vel Rutka  <m.pakula@samsung.com>
63
64         [EFL][WK2] Add an API to set process model
65         https://bugs.webkit.org/show_bug.cgi?id=130133
66
67         Reviewed by Gyuyoung Kim.
68
69         Implement an API to set and get process model in ewk_context.
70         By default process model enum value is set to EWK_PROCESS_MODEL_SHARED_SECONDARY
71         which keeps current behaviour. Setting EWK_PROCESS_MODEL_MULTIPLE_SECONDARY
72         will make each web view use separate web process, also enables network process.
73
74         * UIProcess/API/efl/ewk_context.cpp:
75         (toWKProcessModel):
76         (EwkContext::setProcessModel):
77         (toEwkProcessModel):
78         (EwkContext::processModel):
79         (ewk_context_process_model_set):
80         (ewk_context_process_model_get):
81         * UIProcess/API/efl/ewk_context.h:
82         * UIProcess/API/efl/ewk_context_private.h:
83         * UIProcess/API/efl/tests/test_ewk2_context.cpp:
84         (TEST_F):
85
86 2014-03-24  Chris Fleizach  <cfleizach@apple.com>
87
88         AX: hit-testing doesn't always work correctly with WK2
89         https://bugs.webkit.org/show_bug.cgi?id=130706
90
91         Reviewed by Simon Fraser.
92
93         Accessibility code was trying to do screenToRootView itself, and in 
94         some cases with embedded WK2 views that did not work.
95
96         * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm:
97         (-[WKAccessibilityWebPageObject accessibilityHitTest:]):
98
99 2014-03-24  Benjamin Poulain  <bpoulain@apple.com>
100
101         [WK2] SpinLock are not initialized by default, ViewUpdateDispatcher is missing an initializer
102         https://bugs.webkit.org/show_bug.cgi?id=130705
103
104         Reviewed by Simon Fraser.
105
106         * WebProcess/WebPage/ViewUpdateDispatcher.cpp:
107         (WebKit::ViewUpdateDispatcher::ViewUpdateDispatcher):
108
109 2014-03-24  Enrica Casucci  <enrica@apple.com>
110
111         [iOS WebKit2] Dictation support.
112         https://bugs.webkit.org/show_bug.cgi?id=130622
113         <rdar://problem/15337316>
114
115         Reviewed by Benjamin Poulain.
116
117         Adding support for dictation on iOS. There are two main types of interactions
118         with the dictation system:
119         - initial request for context, which consists in retrieving the selected text
120         and 5 words before the selection and 5 words after, if available.
121         - insertion of recognized chunks of text, providing the text
122         to replace.
123     
124         * UIProcess/AutoCorrectionCallback.h:
125         (WebKit::DictationContextCallback::create):
126         (WebKit::DictationContextCallback::~DictationContextCallback):
127         (WebKit::DictationContextCallback::performCallbackWithReturnValue):
128         (WebKit::DictationContextCallback::invalidate):
129         (WebKit::DictationContextCallback::DictationContextCallback):
130         * UIProcess/WebPageProxy.h:
131         * UIProcess/WebPageProxy.messages.in:
132         * UIProcess/ios/WKContentViewInteraction.h:
133         * UIProcess/ios/WKContentViewInteraction.mm:
134         (-[WKContentView replaceDictatedText:withText:]):
135         (-[WKContentView requestDictationContext:]):
136         * UIProcess/ios/WebPageProxyIOS.mm:
137         (WebKit::WebPageProxy::dictationContextCallback):
138         (WebKit::WebPageProxy::replaceDictatedText):
139         (WebKit::WebPageProxy::requestDictationContext):
140         * WebProcess/WebPage/WebPage.h:
141         * WebProcess/WebPage/WebPage.messages.in:
142         * WebProcess/WebPage/ios/WebPageIOS.mm:
143         (WebKit::WebPage::requestDictationContext):
144         (WebKit::WebPage::replaceDictatedText):
145
146 2014-03-24  Andy Estes  <aestes@apple.com>
147
148         Yet another iOS build fix, for the 32-bit build this time.
149
150         * Shared/Downloads/ios/DownloadIOS.mm:
151         (WebKit::setUpDownloadClient):
152
153 2014-03-24  Tim Horton  <timothy_horton@apple.com>
154
155         REGRESSION (r165872): Double-applying device scale to snapshots
156         https://bugs.webkit.org/show_bug.cgi?id=130697
157         <rdar://problem/16396629>
158
159         Reviewed by Simon Fraser.
160
161         * WebProcess/WebPage/WebPage.cpp:
162         (WebKit::WebPage::scaledSnapshotWithOptions):
163         Drive-by, make scaledSnapshotWithOptions respect SnapshotOptionsExcludeDeviceScaleFactor.
164
165         (WebKit::WebPage::snapshotAtSize):
166         Divide the device scale out of the scale factor
167
168         * WebProcess/WebPage/WebPage.h:
169         Rename the scale argument to scaledSnapshotWithOptions to clarify
170         that it is an additional scale on top of the device scale.
171
172 2014-03-24  Brent Fulgham  <bfulgham@apple.com>
173
174         Activate WebVTT Tests Once Merging is Complete
175         https://bugs.webkit.org/show_bug.cgi?id=130420
176
177         Reviewed by Eric Carlson.
178
179         * Configurations/FeatureDefines.xcconfig: Turn on ENABLE(WEBVTT_REGIONS)
180
181 2014-03-24  Andy Estes  <aestes@apple.com>
182
183         Fix the iOS build.
184
185         * Shared/Downloads/ios/DownloadIOS.mm:
186         (WebKit::setUpDownloadClient):
187         * UIProcess/Cocoa/DownloadClient.mm:
188
189 2014-03-24  Mark Rowe  <mrowe@apple.com>
190
191         Build fix after r166186.
192
193         * UIProcess/Cocoa/DownloadClient.mm:
194
195 2014-03-24  Benjamin Poulain  <bpoulain@apple.com>
196
197         [WK2] Make updates on ViewUpdateDispatcher less heavy
198         https://bugs.webkit.org/show_bug.cgi?id=130626
199
200         Reviewed by Darin Adler.
201
202         * WebProcess/WebPage/ViewUpdateDispatcher.cpp:
203         (WebKit::ViewUpdateDispatcher::visibleContentRectUpdate):
204         (WebKit::ViewUpdateDispatcher::dispatchVisibleContentRectUpdate):
205         * WebProcess/WebPage/ViewUpdateDispatcher.h:
206
207 2014-03-24  Benjamin Poulain  <bpoulain@apple.com>
208
209         [iOS][WK2] Micro-optimize view state updates on the UIProcess side
210         https://bugs.webkit.org/show_bug.cgi?id=130631
211
212         Reviewed by Darin Adler.
213
214         * UIProcess/API/Cocoa/WKWebView.mm:
215         (contentZoomScale):
216         [UIScrollView zoomScale] is not fast enough for -[WKWebView _updateVisibleContentRects]. Since we know what the zoom view is,
217         make a fast version hardcoding that.
218
219         (-[WKWebView _updateScrollViewBackground]):
220         (-[WKWebView _zoomToPoint:WebCore::atScale:]):
221         (-[WKWebView _scrollToRect:WebCore::origin:WebCore::minimumScrollDistance:]):
222         (-[WKWebView _zoomToRect:WebCore::withOrigin:WebCore::fitEntireRect:minimumScale:maximumScale:minimumScrollDistance:]):
223         (-[WKWebView _updateVisibleContentRects]):
224         * UIProcess/ios/WKContentView.mm:
225         (fixedPositionRectFromExposedRect):
226         (-[WKContentView didUpdateVisibleRect:unobscuredRect:scale:inStableState:]):
227
228 2014-03-24  Dean Jackson  <dino@apple.com>
229
230         Remove WebGL asset entitlement
231         https://bugs.webkit.org/show_bug.cgi?id=130685
232
233         Reviewed by Simon Fraser.
234
235         No longer necessary on iOS.
236
237         * Configurations/WebContent-iOS.entitlements:
238
239 2014-03-24  Andy Estes  <aestes@apple.com>
240
241         [iOS] Download support by CFURLDownloadRef under USE(CFNETWORK).
242         https://bugs.webkit.org/show_bug.cgi?id=129322
243
244         Reviewed by Anders Carlsson.
245
246         Based on an original patch by Yongjun Zhang  <yongjun_zhang@apple.com>.
247
248         * Shared/Cocoa/APIObject.mm:
249         (API::Object::newObject):
250         * Shared/Downloads/ios/DownloadIOS.mm:
251         (WebKit::dispatchOnMainThread):
252         (WebKit::toDownload):
253         (WebKit::setUpDownloadClient):
254         (WebKit::Download::startWithHandle):
255         * UIProcess/API/APIDownloadClient.h:
256         (API::DownloadClient::~DownloadClient):
257         * UIProcess/API/C/WKContext.cpp:
258         (WKContextSetDownloadClient):
259         * UIProcess/API/Cocoa/WKProcessPool.mm:
260         (-[WKProcessPool _downloadDelegate]):
261         (-[WKProcessPool _setDownloadDelegate:]):
262         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
263         * UIProcess/API/Cocoa/_WKDownload.h: Added.
264         * UIProcess/API/Cocoa/_WKDownload.mm: Added.
265         (WebKit::wrapper):
266         (WebKit::createAPIDownloadClient):
267         (-[_WKDownload dealloc]):
268         (-[_WKDownload API::]):
269         * UIProcess/API/Cocoa/_WKDownloadDelegate.h: Added.
270         * UIProcess/API/Cocoa/_WKDownloadInternal.h: Added.
271         * UIProcess/Cocoa/DownloadClient.h: Added.
272         * UIProcess/Cocoa/DownloadClient.mm: Added.
273         * WebKit2.xcodeproj/project.pbxproj:
274
275 2014-03-24  Dániel Bátyai  <dbatyai.u-szeged@partner.samsung.com>
276
277         [EFL][WK2] Buildfix after r166159.
278
279         Reviewed by Csaba Osztrogonác.
280
281         * UIProcess/API/efl/ewk_settings.cpp:
282         (ewk_settings_file_access_from_file_urls_allowed_set):
283         (ewk_settings_file_access_from_file_urls_allowed_get):
284
285 2014-03-24  Jinwoo Song  <jinwoo7.song@samsung.com>
286
287         [EFL][WK2] Use C API inside ewk_settings
288         https://bugs.webkit.org/show_bug.cgi?id=107820
289
290         Reviewed by Gyuyoung Kim.
291
292         Use C API inside ewk_settings instead of accessing directly
293         internal C++ classes, to avoid violating API layering.
294
295         Original-author: Christophe Dumez <ch.dumez@sisa.samsung.com>
296
297         * UIProcess/API/efl/EwkView.cpp:
298         (EwkView::EwkView):
299         * UIProcess/API/efl/ewk_settings.cpp:
300         (ewk_settings_fullscreen_enabled_set):
301         (ewk_settings_fullscreen_enabled_get):
302         (ewk_settings_javascript_enabled_set):
303         (ewk_settings_javascript_enabled_get):
304         (ewk_settings_loads_images_automatically_set):
305         (ewk_settings_loads_images_automatically_get):
306         (ewk_settings_developer_extras_enabled_set):
307         (ewk_settings_developer_extras_enabled_get):
308         (ewk_settings_file_access_from_file_urls_allowed_set):
309         (ewk_settings_file_access_from_file_urls_allowed_get):
310         (ewk_settings_frame_flattening_enabled_set):
311         (ewk_settings_frame_flattening_enabled_get):
312         (ewk_settings_dns_prefetching_enabled_set):
313         (ewk_settings_dns_prefetching_enabled_get):
314         (ewk_settings_encoding_detector_enabled_set):
315         (ewk_settings_encoding_detector_enabled_get):
316         (ewk_settings_preferred_minimum_contents_width_set):
317         (ewk_settings_preferred_minimum_contents_width_get):
318         (ewk_settings_offline_web_application_cache_enabled_set):
319         (ewk_settings_offline_web_application_cache_enabled_get):
320         (ewk_settings_scripts_can_open_windows_set):
321         (ewk_settings_scripts_can_open_windows_get):
322         (ewk_settings_local_storage_enabled_set):
323         (ewk_settings_local_storage_enabled_get):
324         (ewk_settings_plugins_enabled_set):
325         (ewk_settings_plugins_enabled_get):
326         (ewk_settings_default_font_size_set):
327         (ewk_settings_default_font_size_get):
328         (ewk_settings_private_browsing_enabled_set):
329         (ewk_settings_private_browsing_enabled_get):
330         (ewk_settings_text_autosizing_enabled_set):
331         (ewk_settings_text_autosizing_enabled_get):
332         (ewk_settings_spatial_navigation_enabled_set):
333         (ewk_settings_spatial_navigation_enabled_get):
334         (EwkSettings::setDefaultTextEncodingName):
335         * UIProcess/API/efl/ewk_settings_private.h:
336         (EwkSettings::EwkSettings):
337         (EwkSettings::preferences):
338
339 2014-03-24  Zan Dobersek  <zdobersek@igalia.com>
340
341         [GTK][WK2] Guard NetscapePluginModule methods used in PluginInfoCache that are specific to X11 architecture
342         https://bugs.webkit.org/show_bug.cgi?id=130663
343
344         Reviewed by Carlos Garcia Campos.
345
346         The two used methods are specific to the X11 plugin architecture and are not declared when building for a
347         Wayland-only configuration. Guarding them prevents build failures, but does not ensure proper functionality
348         which isn't a problem anyway since there's no support yet for Netscape plugins on Wayland.
349
350         * UIProcess/Plugins/gtk/PluginInfoCache.cpp:
351         (WebKit::PluginInfoCache::getPluginInfo): Guard NetscapePluginModule::parseMIMEDescription with PLUGIN_ARCHITECTURE(X11).
352         (WebKit::PluginInfoCache::updatePluginInfo): Ditto for NetscapePluginModule::buildMIMEDescription.
353
354 2014-03-24  Ryuan Choi  <ryuan.choi@samsung.com>
355
356         [EFL][WK2] Convert some more OwnPtr/PassOwnPtr to std::unique_ptr
357         https://bugs.webkit.org/show_bug.cgi?id=130662
358
359         Reviewed by Gyuyoung Kim.
360
361         Replace uses of PassOwnPtr/OwnPtr with std::unique_ptr in remained WebKit2/Efl specific code.
362
363         * UIProcess/API/efl/EwkView.h:
364         * UIProcess/API/efl/ewk_cookie_manager.cpp:
365         * UIProcess/API/efl/ewk_database_manager.cpp:
366         (getDatabaseOriginsCallback):
367         * UIProcess/API/efl/ewk_error_private.h:
368         * UIProcess/efl/DownloadManagerEfl.cpp:
369         (WebKit::DownloadManagerEfl::didFail):
370         * UIProcess/efl/InputMethodContextEfl.h:
371         (WebKit::InputMethodContextEfl::create):
372         * UIProcess/efl/PageLoadClientEfl.cpp:
373         (WebKit::PageLoadClientEfl::didFailLoadWithErrorForFrame):
374         (WebKit::PageLoadClientEfl::didFailProvisionalLoadWithErrorForFrame):
375
376 2014-03-23  Hyowon Kim  <hw1008.kim@samsung.com>
377
378         Move all EFL typedefs into EflTypedefs.h.
379         https://bugs.webkit.org/show_bug.cgi?id=130511
380
381         Reviewed by Gyuyoung Kim.
382
383         * Shared/API/c/efl/WKArrayEfl.h: Remove EFL typedefs.
384         * UIProcess/API/efl/EwkView.h: Ditto.
385
386 2014-03-23  Jinwoo Song  <jinwoo7.song@samsung.com>
387
388         [WK2] Refine WebKit2 BatteryStatus code
389         https://bugs.webkit.org/show_bug.cgi?id=130573
390
391         Reviewed by Anders Carlsson.
392
393         Refinements
394          - Return PassRef instead of PassRefPtr in create methods
395          - Use auto instead of iterator
396
397         * UIProcess/WebBatteryManagerProxy.cpp:
398         (WebKit::WebBatteryManagerProxy::create):
399         * UIProcess/WebBatteryManagerProxy.h:
400         * UIProcess/efl/BatteryProvider.cpp:
401         (BatteryProvider::create):
402         * UIProcess/efl/BatteryProvider.h:
403         * WebProcess/Battery/WebBatteryManager.cpp:
404         (WebKit::WebBatteryManager::didChangeBatteryStatus):
405         (WebKit::WebBatteryManager::updateBatteryStatus):
406
407 2014-03-23  Sam Weinig  <sam@webkit.org>
408
409         Simplify the HTMLConverter interface (Part 2)
410         https://bugs.webkit.org/show_bug.cgi?id=130654
411
412         Reviewed by Darin Adler.
413
414         * WebProcess/WebPage/WebPage.h:
415         * WebProcess/WebPage/ios/WebPageIOS.mm:
416         (WebKit::WebPage::performDictionaryLookupForRange):
417         * WebProcess/WebPage/mac/WebPageMac.mm:
418         (WebKit::WebPage::getAttributedSubstringFromRange):
419         (WebKit::WebPage::attributedSubstringForCharacterRangeAsync):
420         (WebKit::WebPage::performDictionaryLookupAtLocation):
421         (WebKit::WebPage::performDictionaryLookupForSelection):
422         (WebKit::WebPage::performDictionaryLookupForRange):
423
424 2014-03-23  David Kilzer  <ddkilzer@apple.com>
425
426         WebKit::resistanceForDelta() truncates 'scaleDistance' to integer value using abs()
427         <http://webkit.org/b/130651>
428
429         Reviewed by Darin Adler.
430
431         Fixes the following build failure with trunk clang:
432
433             WebKit2/UIProcess/mac/ViewGestureControllerMac.mm:112:28: error: using integer absolute value function 'abs' when argument is of floating point type [-Werror,-Wabsolute-value]
434                 double scaleDistance = abs(limit - currentScale);
435                                        ^
436             WebKit2/UIProcess/mac/ViewGestureControllerMac.mm:112:28: note: use function 'fabs' instead
437                 double scaleDistance = abs(limit - currentScale);
438                                        ^~~
439                                        fabs
440
441         * UIProcess/mac/ViewGestureControllerMac.mm:
442         (WebKit::resistanceForDelta): Use fabs() instead of abs().
443
444 2014-03-23  Simon Fraser  <simon.fraser@apple.com>
445
446         Clean up #includes by geometry classes
447         https://bugs.webkit.org/show_bug.cgi?id=130645
448
449         Reviewed by Andreas Kling.
450
451         Pulling in <wtf/Vector.h> and <wtf/PrintStream.h> in the simple geometry
452         classes brings in a lot of additional headers. Fix by adding a new
453         GeometryUtilities file so that the basic files don't need Vector,
454         and including GeometryUtilities.h where necessary.
455         
456         Also forward declare PrintStream.h and only bring in the header
457         in implementation files.
458
459         * Shared/UpdateInfo.h:
460         * UIProcess/BackingStore.h:
461         * UIProcess/CoordinatedGraphics/PageViewportController.h:
462         * UIProcess/FindIndicator.cpp:
463         * UIProcess/mac/WKPrintingView.h:
464
465 2014-03-23  Simon Fraser  <simon.fraser@apple.com>
466
467         Clean up #includes by geometry classes
468         https://bugs.webkit.org/show_bug.cgi?id=130645
469
470         Reviewed by Andreas Kling.
471
472         Pulling in <wtf/Vector.h> and <wtf/PrintStream.h> in the simple geometry
473         classes brings in a lot of additional headers. Fix by adding a new
474         GeometryUtilities file so that the basic files don't need Vector,
475         and including GeometryUtilities.h where necessary.
476         
477         Also forward declare PrintStream.h and only bring in the header
478         in implementation files.
479
480         * UIProcess/BackingStore.h:
481         * UIProcess/FindIndicator.cpp:
482         * UIProcess/mac/WKPrintingView.h:
483
484 2014-03-22  Alexey Proskuryakov  <ap@apple.com>
485
486         Assertions in WebPage::rangeFromEditingRange when requested range location is NSNotFound
487         https://bugs.webkit.org/show_bug.cgi?id=130633
488         <rdar://problem/16397583>
489
490         Reviewed by Darin Adler.
491
492         * UIProcess/API/mac/WKView.mm:
493         (-[WKView firstRectForCharacterRange:completionHandler:]):
494         (-[WKView firstRectForCharacterRange:actualRange:]):
495         Return NSZeroRect, like NSTextView does for any locations that are out of bounds.
496         There is no need for a round trip to WebProcess in this case.
497
498 2014-03-21  Benjamin Poulain  <bpoulain@apple.com>
499
500         [iOS][WK2] Reduce the tiling coverage to the current rect and 1 tile size ahead
501         https://bugs.webkit.org/show_bug.cgi?id=130555
502
503         Reviewed by Simon Fraser.
504
505         * Shared/VisibleContentRectUpdateInfo.cpp:
506         (WebKit::VisibleContentRectUpdateInfo::encode):
507         (WebKit::VisibleContentRectUpdateInfo::decode):
508         * Shared/VisibleContentRectUpdateInfo.h:
509         (WebKit::VisibleContentRectUpdateInfo::VisibleContentRectUpdateInfo):
510         (WebKit::operator==):
511         * UIProcess/ios/WKContentView.mm:
512         (WebKit::HistoricalKinematicData::HistoricalKinematicData):
513         (WebKit::HistoricalKinematicData::velocityForNewData):
514         (WebKit::HistoricalKinematicData::clear):
515         (WebKit::HistoricalKinematicData::append):
516         (-[WKContentView didUpdateVisibleRect:unobscuredRect:scale:inStableState:]):
517         * WebProcess/WebPage/ViewUpdateDispatcher.cpp:
518         (WebKit::ViewUpdateDispatcher::visibleContentRectUpdate):
519         * WebProcess/WebPage/ios/WebPageIOS.mm:
520         (WebKit::WebPage::updateVisibleContentRects):
521
522 2014-03-21  Alexey Proskuryakov  <ap@apple.com>
523
524         REGRESSION (r165356): Predictive Chinese input is broken
525         https://bugs.webkit.org/show_bug.cgi?id=130619
526
527         Reviewed by Enrica Casucci.
528
529         * UIProcess/mac/WebPageProxyMac.mm: (WebKit::WebPageProxy::executeKeypressCommands):
530         Like after insertText, we are no longer in an intermediate state after executeKeypressCommands.
531         Make sure that we don't call -discardMarkedText the next time we get a non-intermediate
532         state with closed composition.
533
534 2014-03-21  Sam Weinig  <sam@webkit.org>
535
536         [WebKit2] Implement NetworkingContext::sourceApplicationAuditData() for WebKit2
537         https://bugs.webkit.org/show_bug.cgi?id=130528
538
539         Reviewed by Tim Horton.
540
541         * Platform/IPC/Connection.h:
542         * Platform/IPC/mac/ConnectionMac.cpp:
543         (IPC::Connection::getAuditToken):
544         Expose the audit data if available. 
545
546         * NetworkProcess/mac/RemoteNetworkingContext.mm:
547         (WebKit::RemoteNetworkingContext::sourceApplicationAuditData):
548         * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm:
549         (WebKit::WebFrameNetworkingContext::sourceApplicationAuditData):
550         Pass the audit data corresponding to the UIProcess.
551
552         * Configurations/Network-iOS.entitlements: Copied from Configurations/WebContent-iOS.entitlements.
553         * Configurations/NetworkProcess.xcconfig:
554         * Configurations/NetworkService.Development.xcconfig:
555         * Configurations/NetworkService.xcconfig:
556         * Configurations/WebContent-iOS.entitlements:
557         Add entitlement allowing the audit data to be used.
558
559 2014-03-21  Tim Horton  <timothy_horton@apple.com>
560
561         Always retrieve the screen scale factor from WKSI
562         <rdar://problem/16329679>
563
564         Reviewed by Sam Weinig.
565
566         * UIProcess/ios/WKContentView.mm:
567         (-[WKContentView initWithFrame:context:WebKit::configuration:WebKit::webView:]):
568         (-[WKContentView _updateForScreen:]):
569         Use WKGetScreenScaleFactor/WKGetScaleFactorForScreen.
570
571 2014-03-21  Yongjun Zhang  <yongjun_zhang@apple.com>
572
573         [Webkit2] Add APIDownloadClient for download support.
574         https://bugs.webkit.org/show_bug.cgi?id=130484
575
576         Add API::DownloadClient to WebContext and get rid of WebDownloadClient.
577
578         Reviewed by Anders Carlsson.
579
580         * UIProcess/API/APIDownloadClient.h: Added.
581         (API::DownloadClient::~DownloadClient):
582         (API::DownloadClient::didStart):
583         (API::DownloadClient::didReceiveAuthenticationChallenge):
584         (API::DownloadClient::didReceiveResponse):
585         (API::DownloadClient::didReceiveData):
586         (API::DownloadClient::shouldDecodeSourceDataOfMIMEType):
587         (API::DownloadClient::decideDestinationWithSuggestedFilename):
588         (API::DownloadClient::didCreateDestination):
589         (API::DownloadClient::didFinish):
590         (API::DownloadClient::didFail):
591         (API::DownloadClient::didCancel):
592         (API::DownloadClient::processDidCrash):
593         * UIProcess/API/C/WKContext.cpp:
594         (WKContextSetDownloadClient): Move the original WebDownloadClient methods to a local class
595             DownloadClient and set up the downloadClient for WebContext.
596         * UIProcess/Downloads/DownloadProxy.cpp:
597         * UIProcess/WebContext.cpp:
598         (WebKit::WebContext::setDownloadClient):
599         * UIProcess/WebContext.h:
600         (WebKit::WebContext::downloadClient):
601         * UIProcess/WebDownloadClient.cpp: Removed.
602         * UIProcess/WebDownloadClient.h: Removed.
603         * WebKit2.xcodeproj/project.pbxproj:
604
605 2014-03-21  Alexey Proskuryakov  <ap@apple.com>
606
607         ASSERTION FAILED: event == [NSApp currentEvent] hitting Command-+
608         https://bugs.webkit.org/show_bug.cgi?id=130526
609         <rdar://problem/16371612> 
610
611         This was fixed yesterday for sync code path, landing the same this for async one.
612
613         * UIProcess/API/mac/WKView.mm: (-[WKView performKeyEquivalent:]):
614
615 2014-03-21  Pratik Solanki  <psolanki@apple.com>
616
617         Add callbacks in WebKit2 Cocoa API for page load testing
618         https://bugs.webkit.org/show_bug.cgi?id=130569
619
620         Reviewed by Anders Carlsson.
621
622         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInLoadDelegate.h:
623         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
624         (didFirstVisuallyNonEmptyLayoutForFrame):
625         (didHandleOnloadEventsForFrame):
626         (setUpPageLoaderClient):
627         (willSendRequestForFrame):
628         (didInitiateLoadForResource):
629         (didFinishLoadForResource):
630         (didFailLoadForResource):
631         (setUpResourceLoadClient):
632
633 2014-03-21  Ryuan Choi  <ryuan.choi@samsung.com>
634
635         [EFL][WK2] Remove Ewk_Error parameter from some async callbacks
636         https://bugs.webkit.org/show_bug.cgi?id=130567
637
638         Reviewed by Gyuyoung Kim.
639
640         WebKit2 internally uses GenericCallbacks for several APIs such as WKKeyValueStorageManagerGetKeyValueStorageOrigins.
641         But only few callbacks really return errors.
642
643         This patch removes Ewk_Error parameters from these callbacks not to make
644         the confusion for application developers.
645
646         * UIProcess/API/efl/ewk_cookie_manager.cpp:
647         (getAcceptPolicyCallback):
648         (getHostnamesWithCookiesCallback):
649         * UIProcess/API/efl/ewk_cookie_manager.h:
650         * UIProcess/API/efl/ewk_database_manager.cpp:
651         (getDatabaseOriginsCallback):
652         * UIProcess/API/efl/ewk_database_manager.h:
653         * UIProcess/API/efl/ewk_storage_manager.cpp:
654         (getStorageOriginsCallback):
655         * UIProcess/API/efl/ewk_storage_manager.h:
656         * UIProcess/API/efl/tests/test_ewk2_cookie_manager.cpp:
657         (EWK2CookieManagerTest::getAcceptPolicyCallback):
658         (EWK2CookieManagerTest::getHostnamesWithCookiesCallback):
659         * UIProcess/API/efl/tests/test_ewk2_database_manager.cpp:
660         (EWK2DatabaseManagerTest::databaseOriginsCallback):
661         * UIProcess/API/efl/tests/test_ewk2_storage_manager.cpp:
662         (EWK2StorageManagerTest::getStorageOriginsCallback):
663
664 2014-03-21  Darin Adler  <darin@apple.com>
665
666         Improve idiom used for string building in a few places
667         https://bugs.webkit.org/show_bug.cgi?id=130561
668
669         Reviewed by Andreas Kling.
670
671         * Shared/mac/ChildProcessMac.mm:
672         (WebKit::ChildProcess::initializeSandbox): Use a more efficient idiom for string
673         concatenation.
674
675         * UIProcess/WebInspectorProxy.cpp:
676         (WebKit::WebInspectorProxy::createInspectorPage): Use a StringBuilder.
677
678 2014-03-20  Hyowon Kim  <hw1008.kim@samsung.com>
679
680         Move to using std::unique_ptr for EFL objects.
681         https://bugs.webkit.org/show_bug.cgi?id=129853
682
683         Reviewed by Gyuyoung Kim.
684
685         EflUniquePtr is a template alias of std::unique_ptr
686         with a custom deleter for each Efl Objects, which is motivated by GUniquePtr.
687         This patch replaces uses of OwnPtr and PassOwnPtr for Efl objects with EflUniquePtr.
688
689         * Platform/Module.h:
690         * Platform/efl/ModuleEfl.cpp:
691         (WebKit::Module::load):
692         * UIProcess/API/efl/EwkView.cpp:
693         (EwkView::EwkView):
694         * UIProcess/API/efl/EwkView.h:
695         * UIProcess/efl/InputMethodContextEfl.cpp:
696         (WebKit::InputMethodContextEfl::InputMethodContextEfl):
697         (WebKit::InputMethodContextEfl::createIMFContext):
698         * UIProcess/efl/InputMethodContextEfl.h:
699         (WebKit::InputMethodContextEfl::create):
700
701 2014-03-20  Thiago de Barros Lacerda  <thiago.lacerda@openbossa.org>
702
703         [EFL][GTK] Get CMake to find Freetype2 properly
704         https://bugs.webkit.org/show_bug.cgi?id=130150
705
706         Reviewed by Martin Robinson.
707
708         Newer versions of CMake are not able to find Freetype2 correctly.
709         FindFreetype2.cmake checks for the version number in freetype.h header, since it seems that bug exists in
710         freetype2 repo, because a completely different version number is found in freetype2.pc.
711
712         * PlatformEfl.cmake:
713
714 2014-03-20  Martin Robinson  <mrobinson@igalia.com>
715
716         [GTK] Suppress errors about using gdk_threads_enter gdk_threads_leave
717         https://bugs.webkit.org/show_bug.cgi?id=130517
718
719         Reviewed by Sergio Villar Senin.
720
721         * UIProcess/API/gtk/WebKitWebView.cpp: Use GCC suppression to suppress errors about deprecations.
722         * UIProcess/gtk/WebPopupMenuProxyGtk.cpp: Ditto.
723
724 2014-03-20  Ryuan Choi  <ryuan.choi@samsung.com>
725
726         [EFL][WK2] tests of test_ewk2_cookie_manager are flaky
727         https://bugs.webkit.org/show_bug.cgi?id=130498
728
729         Reviewed by Gyuyoung Kim.
730
731         Loaded web page before calling getAcceptPolicy() to guarantee that webprocess
732         or networkprocess was launched and registered WebCookieManager.
733
734         * UIProcess/API/efl/tests/test_ewk2_cookie_manager.cpp:
735         (TEST_F):
736
737 2014-03-20  Commit Queue  <commit-queue@webkit.org>
738
739         Unreviewed, rolling out r165985.
740         https://bugs.webkit.org/show_bug.cgi?id=130551
741
742         broke page loading on all cocoa platforms (Requested by
743         thorton on #webkit).
744
745         Reverted changeset:
746
747         "[WebKit2] Implement
748         NetworkingContext::sourceApplicationAuditData() for WebKit2"
749         https://bugs.webkit.org/show_bug.cgi?id=130528
750         http://trac.webkit.org/changeset/165985
751
752 2014-03-20  Alexey Proskuryakov  <ap@apple.com>
753
754         Fix a long-standing typo that's now breaking USE(ASYNC_NSTEXTINPUTCLIENT) build.
755
756         Rubber-stamped by Tim Horton.
757
758         * UIProcess/mac/WebPageProxyMac.mm: (WebKit::WebPageProxy::cancelComposition):
759         Use a correct type for reply (it's really the same type, but ConfirmComposition
760         is behind an ifdef, and not available).
761
762 2014-03-20  Enrica Casucci  <enrica@apple.com>
763
764         [iOS WebKit2] typing and deleting text lags behind the caret movement on google.com.
765         https://bugs.webkit.org/show_bug.cgi?id=130544
766         <rdar://problem/16380296>
767
768         Reviewed by Tim Horton.
769
770         On iOS the selection is drawn in the UIProcess. If the WebProcess is
771         processing multiple requests within the same runloop, the caret could be
772         updated in the UIProcess before the WebProcess has had a chance to paint.
773         This change synchronizes the selection drawing with the tile update.
774
775         * UIProcess/WebPageProxy.h:
776         * UIProcess/ios/WKContentView.mm:
777         (-[WKContentView _didCommitLayerTree:WebKit::]):
778         * UIProcess/ios/WKContentViewInteraction.h:
779         * UIProcess/ios/WKContentViewInteraction.mm:
780         (-[WKContentView _selectionChanged]):
781         (-[WKContentView _updateChangedSelection]):
782         * WebProcess/WebPage/WebPage.cpp:
783         (WebKit::WebPage::didChangeSelection):
784
785 2014-03-20  Alexey Proskuryakov  <ap@apple.com>
786
787         Generalize WebInspector check in maybeInitializeSandboxExtensionHandle().
788         https://bugs.webkit.org/show_bug.cgi?id=130079
789         <rdar://problem/16286683>
790
791         Reviewed by Anders Carlsson.
792
793         * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::maybeInitializeSandboxExtensionHandle):
794         Perform an early return for all paths that don't need a sandbox extension due to
795         access being assumed, not only for WebInspector pages.
796
797         * UIProcess/WebProcessProxy.cpp:
798         (WebKit::WebProcessProxy::hasAssumedReadAccessToURL):
799         (WebKit::WebProcessProxy::checkURLReceivedFromWebProcess):
800         * UIProcess/WebProcessProxy.h:
801         Factored out m_localPathsWithAssumedReadAccess iteration to a public function.
802
803 2014-03-20  Csaba Osztrogonác  <ossy@webkit.org>
804
805         Unreviewed buildfix after r165983 for non Cocoa platforms.
806
807         * UIProcess/API/C/WKAPICast.h:
808         * UIProcess/API/C/WKPreferences.cpp:
809         * UIProcess/efl/WebInspectorProxyEfl.cpp:
810
811 2014-03-20  Beth Dakin  <bdakin@apple.com>
812
813         Implement contentInset for Mac WebKit2
814         https://bugs.webkit.org/show_bug.cgi?id=130273
815
816         Reviewed by Simon Fraser.
817
818         This patch adds WKView API for setting a topContentInset(). All of this work gets 
819         that number plumbed down to WebCore.
820
821         * Shared/WebPageCreationParameters.cpp:
822         (WebKit::WebPageCreationParameters::encode):
823         (WebKit::WebPageCreationParameters::decode):
824         * Shared/WebPageCreationParameters.h:
825         * UIProcess/API/Cocoa/WKViewPrivate.h:
826         * UIProcess/API/Cocoa/WKWebView.mm:
827         (-[WKWebView _setTopContentInset:]):
828         (-[WKWebView _topContentInset]):
829         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
830         * UIProcess/API/mac/WKView.mm:
831         (-[WKView _setTopContentInset:]):
832         (-[WKView _topContentInset]):
833         * UIProcess/WebPageProxy.cpp:
834         (WebKit::WebPageProxy::WebPageProxy):
835         (WebKit::WebPageProxy::setTopContentInset):
836         (WebKit::WebPageProxy::creationParameters):
837         * UIProcess/WebPageProxy.h:
838         (WebKit::WebPageProxy::topContentInset):
839         * WebProcess/WebPage/WebPage.cpp:
840         (WebKit::WebPage::WebPage):
841         (WebKit::WebPage::setTopContentInset):
842         * WebProcess/WebPage/WebPage.h:
843         * WebProcess/WebPage/WebPage.messages.in:
844
845 2014-03-20  Anders Carlsson  <andersca@apple.com>
846
847         Fix 32-bit build.
848
849         * UIProcess/API/Cocoa/WKProcessPoolConfiguration.mm:
850
851 2014-03-20  Anders Carlsson  <andersca@apple.com>
852
853         Make WKProcessPoolConfiguration SPI
854         https://bugs.webkit.org/show_bug.cgi?id=130537
855
856         Reviewed by Tim Horton.
857
858         * UIProcess/API/Cocoa/WKProcessPool.h:
859         * UIProcess/API/Cocoa/WKProcessPool.mm:
860         (-[WKProcessPool init]):
861         (-[WKProcessPool dealloc]):
862         (-[WKProcessPool description]):
863         (-[WKProcessPool _configuration]):
864         (-[WKProcessPool API::]):
865         (-[WKProcessPool _initWithConfiguration:]):
866         * UIProcess/API/Cocoa/WKProcessPoolConfiguration.h:
867         * UIProcess/API/Cocoa/WKProcessPoolConfiguration.mm:
868         (-[WKProcessPoolConfiguration _injectedBundleURL]):
869         (-[WKProcessPoolConfiguration _setInjectedBundleURL:]):
870         * UIProcess/API/Cocoa/WKProcessPoolConfigurationPrivate.h:
871         * UIProcess/API/Cocoa/WKProcessPoolInternal.h:
872         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
873         * UIProcess/API/Cocoa/WKProcessPoolToBeRemoved.mm: Copied from Source/WebKit2/UIProcess/API/Cocoa/WKProcessPoolPrivate.h.
874         (-[WKProcessPool initWithConfiguration:]):
875         (-[WKProcessPool configuration]):
876         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h: Copied from Source/WebKit2/UIProcess/API/Cocoa/WKProcessPoolConfigurationPrivate.h.
877         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm: Copied from Source/WebKit2/UIProcess/API/Cocoa/WKProcessPoolConfiguration.mm.
878         (-[_WKProcessPoolConfiguration injectedBundleURL]):
879         (-[_WKProcessPoolConfiguration setInjectedBundleURL:]):
880         (-[_WKProcessPoolConfiguration description]):
881         (-[_WKProcessPoolConfiguration copyWithZone:]):
882         * WebKit2.xcodeproj/project.pbxproj:
883
884 2014-03-20  Tim Horton  <timothy_horton@apple.com>
885
886         Add WebCore::IOSurface wrapper
887         https://bugs.webkit.org/show_bug.cgi?id=130529
888
889         Reviewed by Simon Fraser.
890
891         * Shared/mac/RemoteLayerBackingStore.h:
892         * Shared/mac/RemoteLayerBackingStore.mm:
893         (RemoteLayerBackingStore::encode):
894         (RemoteLayerBackingStore::decode):
895         (RemoteLayerBackingStore::display):
896         (RemoteLayerBackingStore::applyBackingStoreToLayer):
897         * UIProcess/ios/ViewGestureControllerIOS.mm:
898         (WebKit::ViewGestureController::beginSwipeGesture):
899         (WebKit::ViewGestureController::removeSwipeSnapshot):
900         * UIProcess/mac/ViewGestureController.h:
901         * UIProcess/mac/ViewGestureControllerMac.mm:
902         (WebKit::ViewGestureController::beginSwipeGesture):
903         (WebKit::ViewGestureController::removeSwipeSnapshot):
904         * UIProcess/mac/ViewSnapshotStore.h:
905         * UIProcess/mac/ViewSnapshotStore.mm:
906         (WebKit::createIOSurfaceFromImage):
907         (WebKit::ViewSnapshotStore::recordSnapshot):
908         Adopt WebCore::IOSurface.
909
910 2014-03-20  Alexey Proskuryakov  <ap@apple.com>
911
912         Update iOS input method code to use new cross-platform async functions
913         https://bugs.webkit.org/show_bug.cgi?id=130530
914
915         Reviewed by Enrica Casucci.
916
917         Merge identical iOS and cross-platform functions.
918
919         Also tightened up ifdefs, and removed stub iOS implementations of sync methods,
920         which hopefully won't be ever needed. The only tricky case is sync cancelComposition,
921         will I'll investigate separately.
922
923         * UIProcess/WebPageProxy.h:
924         * UIProcess/ios/WKContentViewInteraction.mm:
925         (-[WKContentView setMarkedText:selectedRange:]):
926         (-[WKContentView unmarkText]):
927         (-[WKContentView insertText:]):
928         * UIProcess/ios/WebPageProxyIOS.mm:
929         (WebKit::WebPageProxy::cancelComposition):
930         * UIProcess/mac/WebPageProxyMac.mm:
931         (WebKit::WebPageProxy::cancelComposition):
932         (WebKit::WebPageProxy::insertDictatedTextAsync):
933         (WebKit::WebPageProxy::attributedSubstringForCharacterRangeAsync):
934         (WebKit::WebPageProxy::attributedStringForCharacterRangeCallback):
935         * WebProcess/WebPage/WebPage.h:
936         * WebProcess/WebPage/WebPage.messages.in:
937         * WebProcess/WebPage/ios/WebPageIOS.mm:
938         * WebProcess/WebPage/mac/WebPageMac.mm:
939         (WebKit::WebPage::cancelComposition):
940         (WebKit::WebPage::insertDictatedTextAsync):
941         (WebKit::WebPage::attributedSubstringForCharacterRangeAsync):
942
943 2014-03-20  Alexey Proskuryakov  <ap@apple.com>
944
945         ASSERTION FAILED: event == [NSApp currentEvent] hitting Command-+
946         https://bugs.webkit.org/show_bug.cgi?id=130526
947         <rdar://problem/16371612>
948
949         Reviewed by Anders Carlsson.
950
951         * UIProcess/API/mac/WKView.mm: (-[WKView performKeyEquivalent:]): Cut custom
952         processing short whenever we are redispatching an event, not just when the event
953         we are handling is the one being redispatched. There shouldn't be any other unrelated
954         events here, just the one being redispatched and synthetic ones generated from it by AppKit.
955
956 2014-03-20  Anders Carlsson  <andersca@apple.com>
957
958         Fix build.
959
960         Rename WKPreferencesPrivate.h to WKPreferencesRefPrivate.h.
961
962         * UIProcess/API/C/WKPreferencesRefPrivate.h: Renamed from Source/WebKit2/UIProcess/API/C/WKPreferencesPrivate.h.
963         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
964         * WebKit2.xcodeproj/project.pbxproj:
965
966 2014-03-20  Gavin Barraclough  <barraclough@apple.com>
967
968         Merge AtomicString, Identifier
969         https://bugs.webkit.org/show_bug.cgi?id=128624
970
971         Unreviewed build fix following r165982.
972
973         * WebProcess/Plugins/Netscape/NPJSObject.cpp:
974             - update includes.
975
976 2014-03-20  Sam Weinig  <sam@webkit.org>
977
978         [WebKit2] Implement NetworkingContext::sourceApplicationAuditData() for WebKit2
979         https://bugs.webkit.org/show_bug.cgi?id=130528
980
981         Reviewed by Anders Carlsson.
982
983         * Platform/IPC/Connection.h:
984         * Platform/IPC/mac/ConnectionMac.cpp:
985         (IPC::Connection::getAuditToken):
986         Expose the audit data if available. 
987
988         * NetworkProcess/mac/RemoteNetworkingContext.mm:
989         (WebKit::RemoteNetworkingContext::sourceApplicationAuditData):
990         * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm:
991         (WebKit::WebFrameNetworkingContext::sourceApplicationAuditData):
992         Pass the audit data corresponding to the UIProcess.
993
994 2014-03-20  Sam Weinig  <sam@webkit.org>
995
996         [Cocoa] Expose preference to enable telephone number detection
997         https://bugs.webkit.org/show_bug.cgi?id=130524
998
999         Reviewed by Anders Carlsson.
1000
1001         * UIProcess/API/Cocoa/WKPreferences.mm:
1002         (-[WKPreferences _telephoneNumberDetectionIsEnabled]):
1003         (-[WKPreferences _setTelephoneNumberDetectionIsEnabled:]):
1004         * UIProcess/API/Cocoa/WKPreferencesInternal.h:
1005         * UIProcess/API/Cocoa/WKPreferencesPrivate.h: Added.
1006         * WebKit2.xcodeproj/project.pbxproj:
1007
1008 2014-03-19  Alexey Proskuryakov  <ap@apple.com>
1009
1010         [Mac] Support asynchronous NSTextInputClient
1011         https://bugs.webkit.org/show_bug.cgi?id=130479
1012
1013         Reviewed by Anders Carlsson.
1014
1015         The implementation is currently disabled, pending lower level support.
1016         Most of the code is not under compile time guard however, to facilitate cross-platform
1017         reuse, or at least under a PLATFORM(COCOA) guard to share the code with iOS.
1018
1019         * UIProcess/API/mac/WKView.mm: Added a compile time branch for USE(ASYNC_NSTEXTINPUTCLIENT).
1020         We still implement sync NSTextInputClient here, in order to get assertions when
1021         its methods are unexpectedly called.
1022         The new code first sends an event to input method asynchronously, handling any callbacks
1023         that may arrive. During this time, we no longer care about WKViewInterpretKeyEventsParameters
1024         at all. Once done, we interpret key bindings synchronously, collecting them into
1025         a vector.
1026
1027         * UIProcess/API/mac/WKViewInternal.h: We no longer expose _interpretKeyEvent outside
1028         WKView.
1029
1030         * UIProcess/WebPageProxy.cpp:
1031         * UIProcess/WebPageProxy.h:
1032         Added async calls and callbacks. Removed unnecessary and slightly harmful .get() when moving
1033         a callback pointer into map. Moved insertDictatedText() and getAttributedSubstringFromRange()
1034         from PLATFORM(COCOA) to PLATFORM(MAC), because they are unused and unimplemented on
1035         iOS, and unlikely to be needed any time soon. Changed USE(APPKIT) to PLATFORM(MAC),
1036         because that's more accurate in this case (nothing depends on AppKit, it's just code
1037         that we only need on Mac).
1038
1039         * UIProcess/WebPageProxy.messages.in: Added messages for new async IM responses.
1040
1041         * UIProcess/ios/WebPageProxyIOS.mm: Removed insertDictatedText() and getAttributedSubstringFromRange().
1042
1043         * UIProcess/mac/WebPageProxyMac.mm:
1044         (WebKit::WebPageProxy::insertDictatedTextAsync):
1045         (WebKit::WebPageProxy::attributedSubstringForCharacterRangeAsync):
1046         (WebKit::WebPageProxy::attributedStringForCharacterRangeCallback):
1047         Added async calls and callbacks that are Mac only.
1048
1049         * WebProcess/WebPage/WebPage.cpp:
1050         * WebProcess/WebPage/WebPage.h:
1051         * WebProcess/WebPage/mac/WebPageMac.mm:
1052         Added async implementations (which are essentially the same as sync ones, sadly).
1053
1054         * WebProcess/WebPage/WebPage.messages.in: Added async messages, moved some messages
1055         under PLATFORM(MAC).
1056
1057         * WebProcess/WebPage/ios/WebPageIOS.mm: More of deleting functions that are Mac only,
1058         and cannot be easily implemented in WebPage.cpp with shared code.
1059
1060 2014-03-20  Martin Robinson  <mrobinson@igalia.com>
1061
1062         Remove remaining GTK+ unused parameter warnings from WebKit2
1063         https://bugs.webkit.org/show_bug.cgi?id=130518
1064
1065         Reviewed by Sergio Villar Senin.
1066
1067         Fix almost all unused parameter warnings in the WebKit2GTK+ build.
1068
1069 2014-03-20  Commit Queue  <commit-queue@webkit.org>
1070
1071         Unreviewed, rolling out r165962.
1072         https://bugs.webkit.org/show_bug.cgi?id=130512
1073
1074         It broke the build (Requested by Ossy on #webkit).
1075
1076         Reverted changeset:
1077
1078         "[EFL][GTK] Get CMake to find Freetype2 properly"
1079         https://bugs.webkit.org/show_bug.cgi?id=130150
1080         http://trac.webkit.org/changeset/165962
1081
1082 2014-03-20  Thiago de Barros Lacerda  <thiago.lacerda@openbossa.org>
1083
1084         [EFL][GTK] Get CMake to find Freetype2 properly
1085         https://bugs.webkit.org/show_bug.cgi?id=130150
1086
1087         Reviewed by Csaba Osztrogonác.
1088
1089         Newer versions of CMake are not able to find Freetype2 correctly.
1090         FindFreetype2.cmake checks for the version number in freetype.h header, since it seems that bug exists in
1091         freetype2 repo, because a completely different version number is found in freetype2.pc.
1092
1093         * PlatformEfl.cmake:
1094
1095 2014-03-20  Ryuan Choi  <ryuan.choi@samsung.com>
1096
1097         [EFL][WK2] test_ewk2_application_cache_manager is flaky
1098         https://bugs.webkit.org/show_bug.cgi?id=130501
1099
1100         Reviewed by Gyuyoung Kim.
1101
1102         * UIProcess/API/efl/tests/test_ewk2_application_cache_manager.cpp:
1103         (timerCallback): Return ECORE_CALLBACK_CANCEL to clear the timer.
1104
1105 2014-03-19  Tim Horton  <timothy_horton@apple.com>
1106
1107         Address late review comment and style nit after r165934.
1108
1109         * UIProcess/ios/ViewGestureControllerIOS.mm:
1110         (WebKit::ViewGestureController::beginSwipeGesture):
1111
1112 2014-03-19  Tim Horton  <timothy_horton@apple.com>
1113
1114         [iOS][WebKit2] Back-forward swipe doesn't always complete with fingers down
1115         https://bugs.webkit.org/show_bug.cgi?id=130489
1116         <rdar://problem/16027007>
1117
1118         Reviewed by Simon Fraser.
1119
1120         * UIProcess/ios/ViewGestureControllerIOS.mm:
1121         (WebKit::ViewGestureController::beginSwipeGesture):
1122         In order to have fingers-down swipe completion work correctly, we need
1123         to give UIKit an empty interactive update block.
1124
1125 2014-03-19  Anders Carlsson  <andersca@apple.com>
1126
1127         Get rid of two IPC::Connection functions by folding them into lambdas
1128         https://bugs.webkit.org/show_bug.cgi?id=130482
1129
1130         Reviewed by Tim Horton.
1131
1132         * Platform/IPC/Connection.cpp:
1133         (IPC::Connection::addWorkQueueMessageReceiver):
1134         (IPC::Connection::removeWorkQueueMessageReceiver):
1135         * Platform/IPC/Connection.h:
1136
1137 2014-03-19  Simon Fraser  <simon.fraser@apple.com>
1138
1139         Expose text and page zoom in WK2 SPI, and hook them up in MiniBrowser
1140         https://bugs.webkit.org/show_bug.cgi?id=130476
1141
1142         Reviewed by Anders Carlsson.
1143         
1144         Expose page and text zoom as SPI.
1145
1146         * UIProcess/API/Cocoa/WKWebView.mm:
1147         (-[WKWebView _supportsTextZoom]):
1148         (-[WKWebView _textZoomFactor]):
1149         (-[WKWebView _setTextZoomFactor:]):
1150         (-[WKWebView _pageZoomFactor]):
1151         (-[WKWebView _setPageZoomFactor:]):
1152         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1153
1154 2014-03-19  Benjamin Poulain  <bpoulain@apple.com>
1155
1156         [iOS][WK2] Reduce the extended background's opacity when WKContentView is smaller than its WKWebView
1157         https://bugs.webkit.org/show_bug.cgi?id=130436
1158
1159         Reviewed by Beth Dakin.
1160
1161         * UIProcess/API/Cocoa/WKWebView.mm:
1162         (-[WKWebView _updateScrollViewBackground]):
1163
1164 2014-03-19  Benjamin Poulain  <bpoulain@apple.com>
1165
1166         [iOS][WebKit2] <rdar://problem/16330387> Do not use the keyboard rect for computing the general unobscuredRect, only use it for centering
1167         https://bugs.webkit.org/show_bug.cgi?id=130382
1168
1169         Reviewed by Simon Fraser.
1170
1171         Always accumulating the keyboard rect out of the exposedRect caused some issues (see <rdar://problem/16330387>).
1172         This patch split the rect in two: unobscured rect for WebCore, and unobscuredContentRectIncludingKeyboard for centering
1173         UI Elements in view.
1174
1175         * UIProcess/API/Cocoa/WKWebView.mm:
1176         (-[WKWebView _zoomToRect:WebCore::atScale:origin:WebCore::]):
1177         (-[WKWebView _scrollToRect:WebCore::origin:WebCore::minimumScrollDistance:]):
1178         (-[WKWebView _zoomToRect:WebCore::withOrigin:WebCore::fitEntireRect:minimumScale:maximumScale:minimumScrollDistance:]):
1179         (-[WKWebView _contentRectForUserInteraction]):
1180         (-[WKWebView _updateVisibleContentRects]):
1181
1182 2014-03-19  Anders Carlsson  <andersca@apple.com>
1183
1184         Get rid of WKProcessClass
1185         https://bugs.webkit.org/show_bug.cgi?id=130478
1186
1187         Reviewed by Dan Bernstein.
1188
1189         * UIProcess/API/Cocoa/WKProcessClass.h: Removed.
1190         * UIProcess/API/Cocoa/WKProcessClass.mm: Removed.
1191         * UIProcess/API/Cocoa/WKProcessClassConfiguration.h: Removed.
1192         * UIProcess/API/Cocoa/WKProcessClassConfiguration.mm: Removed.
1193         * UIProcess/API/Cocoa/WKProcessClassConfigurationPrivate.h: Removed.
1194         * UIProcess/API/Cocoa/WKProcessClassPrivate.h: Removed.
1195         * UIProcess/API/Cocoa/WKWebViewConfigurationToBeRemoved.mm: Removed.
1196         * WebKit2.xcodeproj/project.pbxproj:
1197
1198 2014-03-19  Jer Noble  <jer.noble@apple.com>
1199
1200         [Mac][EME] Query whether decoder support exists before creating a new MediaKeys object.
1201         https://bugs.webkit.org/show_bug.cgi?id=130459
1202
1203         Reviewed by Eric Carlson.
1204
1205         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
1206         (InitWebCoreSystemInterface): Initialize the new WCSI method.
1207
1208 2014-03-19  Brady Eidson  <beidson@apple.com>
1209
1210         Filter out editable services from image menu for non-contenteditable images
1211         <rdar://problem/16319645> and https://bugs.webkit.org/show_bug.cgi?id=130437
1212
1213         Reviewed by Tim Horton.
1214
1215         * UIProcess/mac/WebContextMenuProxyMac.h:
1216         * UIProcess/mac/WebContextMenuProxyMac.mm:
1217         (-[WKSharingServicePickerDelegate setIncludeEditorServices:]):
1218         (-[WKSharingServicePickerDelegate sharingServicePicker:sharingServicesForItems:mask:proposedSharingServices:]):
1219           Filter out editing services based on the includeEditorServices flag.
1220         (WebKit::WebContextMenuProxyMac::setupImageServicesMenu):
1221         (WebKit::WebContextMenuProxyMac::populate):
1222
1223 2014-03-19  Yongjun Zhang  <yongjun_zhang@apple.com>
1224
1225         [iOS] WebKit2 Quicklook.
1226         https://bugs.webkit.org/show_bug.cgi?id=130360
1227
1228         For WebKit2 resource loads, if we detect a quicklook content that QLConverter is able to
1229         convert, handle the response data to QLConverter and use its delegate WKWebResourceQuickLookDelegate
1230         to rounte the converted results (HTML) back into WebCore.  Thie similiar logic has been in place
1231         for WebKit1.
1232
1233         Reviewed by Tim Horton.
1234
1235         * WebKit2.xcodeproj/project.pbxproj: Add WebResourceLoaderIOS.mm to the project.
1236         * WebProcess/Network/WebResourceLoadScheduler.cpp:
1237         * WebProcess/ios/WebResourceLoaderIOS.mm: Added.
1238         (-[WKWebResourceQuickLookDelegate initWithWebResourceLoader:WebKit::]): WKWebResourceQuickLookDelegate holds
1239             the original WebResourceLoader so that we could send converted result to WebCore.
1240         (-[WKWebResourceQuickLookDelegate connection:didReceiveDataArray:]):
1241         (-[WKWebResourceQuickLookDelegate connection:didReceiveData:lengthReceived:]):
1242         (-[WKWebResourceQuickLookDelegate connectionDidFinishLoading:]):
1243         (-[WKWebResourceQuickLookDelegate connection:didFailWithError:]):
1244         (-[WKWebResourceQuickLookDelegate clearHandle]):
1245         (WebKit::WebResourceLoader::setUpQuickLookHandleIfNeeded):
1246
1247 2014-03-19  Tim Horton  <timothy_horton@apple.com>
1248
1249         WebKit2 View Gestures: Swipe gesture can track vertical movement instead of horizontal movement
1250         https://bugs.webkit.org/show_bug.cgi?id=130441
1251         <rdar://problem/16337279>
1252
1253         Reviewed by Simon Fraser.
1254
1255         * UIProcess/mac/ViewGestureControllerMac.mm:
1256         (WebKit::scrollEventCanBecomeSwipe):
1257         Factor logic that determines if a scroll event can become a swipe
1258         out into scrollEventCanBecomeSwipe.
1259         Use <= instead of < when comparing the axes, because we don't want
1260         to start a swipe on a completely diagonal scroll either (because AppKit
1261         can start tracking a vertical swipe in that case).
1262
1263         (WebKit::ViewGestureController::handleScrollWheelEvent):
1264         (WebKit::ViewGestureController::wheelEventWasNotHandledByWebCore):
1265         Make use of scrollEventCanBecomeSwipe.
1266
1267 2014-03-18  Anders Carlsson  <andersca@apple.com>
1268
1269         Add new functionality that will be required by the history item decoding
1270         https://bugs.webkit.org/show_bug.cgi?id=130433
1271
1272         Reviewed by Sam Weinig.
1273
1274         * Shared/cf/KeyedDecoder.cpp:
1275         (WebKit::KeyedDecoder::decodeUInt32):
1276         (WebKit::KeyedDecoder::decodeInt32):
1277         (WebKit::KeyedDecoder::decodeFloat):
1278         * Shared/cf/KeyedDecoder.h:
1279
1280 2014-03-19  Tim Horton  <timothy_horton@apple.com>
1281
1282         [iOS] WebPDFViewPlaceholder divides-by-zero with an empty document
1283         https://bugs.webkit.org/show_bug.cgi?id=130444
1284         <rdar://problem/15580682>
1285
1286         Reviewed by Sam Weinig.
1287
1288         * UIProcess/ios/WKPDFView.mm:
1289         (-[WKPDFView web_setContentProviderData:]):
1290         Don't make UIPDFPageViews for null pages.
1291
1292 2014-03-18  Tim Horton  <timothy_horton@apple.com>
1293
1294         [iOS][WebKit2] Provide generic software-snapshotting API
1295         https://bugs.webkit.org/show_bug.cgi?id=130385
1296         <rdar://problem/16005957>
1297
1298         Reviewed by Sam Weinig.
1299
1300         * UIProcess/API/Cocoa/WKWebView.mm:
1301         (-[WKWebView _didCommitLayerTree:WebKit::]):
1302         (-[WKWebView _snapshotRect:intoImageOfWidth:completionHandler:]):
1303         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1304         * UIProcess/API/Cocoa/_WKThumbnailView.mm:
1305         (-[_WKThumbnailView initWithFrame:fromWKView:]):
1306         (-[_WKThumbnailView _requestSnapshotIfNeeded]):
1307         * UIProcess/WebPageProxy.cpp:
1308         (WebKit::WebPageProxy::internalShowContextMenu):
1309         * UIProcess/WebPageProxy.h:
1310         * WebProcess/WebPage/WebPage.cpp:
1311         (WebKit::WebPage::takeSnapshot):
1312         (WebKit::WebPage::scaledSnapshotWithOptions):
1313         (WebKit::WebPage::snapshotAtSize):
1314         * WebProcess/WebPage/WebPage.h:
1315         * WebProcess/WebPage/WebPage.messages.in:
1316         Rename TakeThumbnailSnapshot message to TakeSnapshot.
1317
1318         Fill the snapshot image with the FrameView's background color, to avoid
1319         half-pixel alpha around the edges.
1320
1321         Factor snapshotAtSize out of scaledSnapshotWithOptions.
1322
1323         Don't apply both the custom and device scale factor to the base CTM,
1324         only the device scale factor. Custom scale factor should only be
1325         applied to the user CTM.
1326
1327         * Shared/ImageOptions.h:
1328         Add a snapshot option, RespectDrawingAreaTransform, that maps
1329         the rect through the drawing area's root layer transform.
1330         Use this in place of the thumbnail-specific code in TakeThumbnailSnapshot.
1331         Add a snapshot option, ExcludeDeviceScaleFactor, which means that
1332         snapshotting will not factor the device scale in (useful for drawing
1333         to a bitmap at an exact requested size).
1334
1335 2014-03-18  Samuel White  <samuel_white@apple.com>
1336
1337         AX: Not able to use arrow keys to read text with VoiceOver before selection is set someplace (anyplace).
1338         https://bugs.webkit.org/show_bug.cgi?id=130250
1339
1340         Reviewed by Chris Fleizach.
1341
1342         Added ability to toggle enhanced accessibility on and off to support tests that require it.
1343
1344         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
1345         (WKAccessibilityEnableEnhancedAccessibility):
1346         (WKAccessibilityEnhancedAccessibilityEnabled):
1347         * WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h:
1348
1349 2014-03-18  Ryuan Choi  <ryuan.choi@samsung.com>
1350
1351         [EFL][WK2] Rename async APIs for better consistency with EFL
1352         https://bugs.webkit.org/show_bug.cgi?id=130319
1353
1354         Reviewed by Gyuyoung Kim.
1355
1356         There are inconsistency with async keyword in several ewebkit2 APIs.
1357         This patch rename them to {module/feature}_async_{verb} for better consistency with EFL.
1358         In addition, added Async keyword into their callback name.
1359
1360         * UIProcess/API/efl/ewk_application_cache_manager.cpp:
1361         (EwkApplicationCacheOriginsAsyncData::EwkApplicationCacheOriginsAsyncData):
1362         (getApplicationCacheOriginsCallback):
1363         (ewk_application_cache_manager_origins_async_get):
1364         * UIProcess/API/efl/ewk_application_cache_manager.h:
1365         * UIProcess/API/efl/ewk_cookie_manager.cpp:
1366         (EwkCookiePolicyAsyncData::EwkCookiePolicyAsyncData):
1367         (getAcceptPolicyCallback):
1368         (ewk_cookie_manager_accept_policy_async_get):
1369         (EwkCookieHostnamesAsyncData::EwkCookieHostnamesAsyncData):
1370         (getHostnamesWithCookiesCallback):
1371         (ewk_cookie_manager_hostnames_with_cookies_async_get):
1372         * UIProcess/API/efl/ewk_cookie_manager.h:
1373         * UIProcess/API/efl/ewk_database_manager.cpp:
1374         (EwkDatabaseOriginsAsyncData::EwkDatabaseOriginsAsyncData):
1375         (getDatabaseOriginsCallback):
1376         (ewk_database_manager_origins_async_get):
1377         * UIProcess/API/efl/ewk_database_manager.h:
1378         * UIProcess/API/efl/ewk_storage_manager.cpp:
1379         (EwkStorageOriginsAsyncData::EwkStorageOriginsAsyncData):
1380         (getStorageOriginsCallback):
1381         (ewk_storage_manager_origins_async_get):
1382         * UIProcess/API/efl/ewk_storage_manager.h:
1383         * UIProcess/API/efl/tests/test_ewk2_application_cache_manager.cpp:
1384         (timerCallback):
1385         * UIProcess/API/efl/tests/test_ewk2_cookie_manager.cpp:
1386         (EWK2CookieManagerTest::getAcceptPolicy):
1387         (EWK2CookieManagerTest::getHostnamesWithCookies):
1388         * UIProcess/API/efl/tests/test_ewk2_database_manager.cpp:
1389         (EWK2DatabaseManagerTest::timerCallback):
1390         (TEST_F):
1391         * UIProcess/API/efl/tests/test_ewk2_storage_manager.cpp:
1392         (EWK2StorageManagerTest::timerCallback):
1393         (TEST_F):
1394
1395 2014-03-18  Tim Horton  <timothy_horton@apple.com>
1396
1397         [iOS][WebKit2] Mark layer contents as being opaque if they are
1398         https://bugs.webkit.org/show_bug.cgi?id=130427
1399         <rdar://problem/15540434>
1400
1401         Reviewed by Simon Fraser.
1402
1403         * Shared/mac/RemoteLayerBackingStore.h:
1404         (WebKit::RemoteLayerBackingStore::isOpaque):
1405         * Shared/mac/RemoteLayerBackingStore.mm:
1406         (RemoteLayerBackingStore::RemoteLayerBackingStore):
1407         (RemoteLayerBackingStore::ensureBackingStore):
1408         (RemoteLayerBackingStore::encode):
1409         (RemoteLayerBackingStore::decode):
1410         (RemoteLayerBackingStore::display):
1411         (RemoteLayerBackingStore::applyBackingStoreToLayer):
1412         Move the code to set a RemoteLayerBackingStore as a CALayer's contents
1413         from RemoteLayerTreePropertyApplier to RemoteLayerBackingStore (mostly
1414         as a way to keep the USE(IOSURFACE) #ifs in one place).
1415         Remove the surface() getter, because it's no longer needed, and make
1416         image() private as it can be now (and rename it to createImageForFrontBuffer
1417         for clarity's sake).
1418
1419         Add an isOpaque argument to ensureBackingStore, encode/decode it, and
1420         add a getter. If isOpaque is true when applying backing store to the
1421         CALayer on the UI process side, set CALayer.contentsOpaque to let CA know.
1422
1423         Make opaque bitmaps if not using accelerated drawing. For the IOSurface
1424         case, we can't make opaque IOSurfaces, but telling CA that we have filled
1425         the whole bitmap still enables similar optimizations.
1426
1427         * Shared/mac/RemoteLayerTreePropertyApplier.mm:
1428         (WebKit::applyPropertiesToLayer):
1429         Reset contentsOpaque if the layer loses its backing store.
1430
1431         * Shared/mac/RemoteLayerTreeTransaction.mm:
1432         (WebKit::RemoteLayerTreeTextStream::operator<<):
1433         (WebKit::dumpChangedLayers):
1434         Add a bit more logging about RemoteLayerBackingStore's opaqueness
1435         and acceleratedness.
1436
1437         * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
1438         (PlatformCALayerRemote::updateBackingStore):
1439         (PlatformCALayerRemote::setOpaque):
1440         Invalidate the RemoteLayerBackingStore if layer opaqueness changes.
1441
1442 2014-03-18  Brady Eidson  <beidson@apple.com>
1443
1444         Make image controls menu work in WK2
1445         <rdar://problem/16294412> and https://bugs.webkit.org/show_bug.cgi?id=130424
1446
1447         Reviewed by Tim Horton.
1448
1449         * Platform/SharedMemory.h:
1450         * Platform/mac/SharedMemoryMac.cpp:
1451         (WebKit::SharedMemory::Handle::~Handle):
1452         (WebKit::SharedMemory::Handle::clear):
1453
1454         * Platform/unix/SharedMemoryUnix.cpp:
1455         (WebKit::SharedMemory::Handle::~Handle):
1456         (WebKit::SharedMemory::Handle::clear):
1457
1458         * Shared/ContextMenuContextData.cpp:
1459         (WebKit::ContextMenuContextData::ContextMenuContextData):
1460         (WebKit::ContextMenuContextData::operator=):
1461         (WebKit::ContextMenuContextData::encode):
1462         (WebKit::ContextMenuContextData::decode):
1463         * Shared/ContextMenuContextData.h:
1464         (WebKit::ContextMenuContextData::controlledImageHandle):
1465
1466         * Shared/ShareableBitmap.cpp:
1467         (WebKit::ShareableBitmap::Handle::clear):
1468         * Shared/ShareableBitmap.h:
1469         * UIProcess/WebContextMenuProxy.h:
1470
1471         * UIProcess/WebPageProxy.cpp:
1472         (WebKit::WebPageProxy::internalShowContextMenu):
1473         (WebKit::WebPageProxy::replaceControlledImage):
1474         * UIProcess/WebPageProxy.h:
1475
1476         * UIProcess/efl/WebContextMenuProxyEfl.cpp:
1477         (WebKit::WebContextMenuProxyEfl::showContextMenu):
1478         * UIProcess/efl/WebContextMenuProxyEfl.h:
1479
1480         * UIProcess/gtk/WebContextMenuProxyGtk.cpp:
1481         (WebKit::WebContextMenuProxyGtk::showContextMenu):
1482         * UIProcess/gtk/WebContextMenuProxyGtk.h:
1483
1484         Add a sharing service context menu that lives side-by-side with the normal one:
1485         * UIProcess/mac/WebContextMenuProxyMac.h:
1486         * UIProcess/mac/WebContextMenuProxyMac.mm:
1487         (+[WKSharingServicePickerDelegate sharedSharingServicePickerDelegate]):
1488         (-[WKSharingServicePickerDelegate setMenuProxy:WebKit::]):
1489         (-[WKSharingServicePickerDelegate setPicker:]):
1490         (-[WKSharingServicePickerDelegate sharingServicePicker:delegateForSharingService:]):
1491         (-[WKSharingServicePickerDelegate sharingService:willShareItems:]):
1492         (-[WKSharingServicePickerDelegate sharingService:didShareItems:]):
1493         (-[WKSharingServicePickerDelegate sharingService:sourceFrameOnScreenForShareItem:]):
1494         (-[WKSharingServicePickerDelegate sharingService:transitionImageForShareItem:contentRect:]):
1495         (-[WKSharingServicePickerDelegate sharingService:sourceWindowForShareItems:sharingContentScope:]):
1496         (WebKit::WebContextMenuProxyMac::contextMenuItemSelected):
1497         (WebKit::WebContextMenuProxyMac::setupImageServicesMenu):
1498         (WebKit::WebContextMenuProxyMac::clearImageServicesMenu):
1499         (WebKit::WebContextMenuProxyMac::populate):
1500         (WebKit::WebContextMenuProxyMac::showContextMenu):
1501         (WebKit::WebContextMenuProxyMac::window):
1502         (WebKit::WebContextMenuProxyMac::replaceControlledImage):
1503
1504         * WebProcess/WebPage/WebContextMenu.cpp:
1505         (WebKit::WebContextMenu::show):
1506         (WebKit::WebContextMenu::replaceControlledImage):
1507         * WebProcess/WebPage/WebContextMenu.h:
1508
1509         Teach the WebProcess how to accept the replaced image.
1510         * WebProcess/WebPage/WebPage.cpp:
1511         (WebKit::WebPage::replaceControlledImage):
1512         * WebProcess/WebPage/WebPage.h:
1513         * WebProcess/WebPage/WebPage.messages.in:
1514
1515 2014-03-18  Anders Carlsson  <andersca@apple.com>
1516
1517         Begin cleaning up KeyedDecoder and KeyedEncoder
1518         https://bugs.webkit.org/show_bug.cgi?id=130431
1519
1520         Reviewed by Tim Horton.
1521
1522         * Shared/cf/KeyedDecoder.cpp:
1523         (WebKit::KeyedDecoder::KeyedDecoder):
1524         If we can't parse the property list data, just add an empty dictionary to the stack.
1525
1526         (WebKit::KeyedDecoder::decodeBool):
1527         Remove unneeded m_dictionaryStack.last() null check. m_dictionaryStack would either be empty
1528         or at least have a root element; it would never have a null element.
1529         
1530         (WebKit::KeyedDecoder::decodeDouble):
1531         Remove the same check as above and remove the CFNumberGetType checks since CFNumberGetValue will
1532         do the type conversion for us and return false if it's lossy.
1533
1534         (WebKit::KeyedDecoder::decodeInt64):
1535         Remove the m_dictionaryStack.last() check.
1536
1537         (WebKit::KeyedDecoder::decodeUInt32):
1538         Ditto.
1539
1540         (WebKit::KeyedDecoder::decodeString):
1541         Ditto.
1542
1543         (WebKit::KeyedDecoder::beginObject):
1544         Ditto.
1545
1546         (WebKit::KeyedDecoder::beginArray):
1547         Ditto.
1548
1549         (WebKit::KeyedDecoder::beginArrayElement):
1550         Ditto.
1551
1552         * Shared/cf/KeyedDecoder.h:
1553         Sort functions to be in the same logical order as the base class.
1554
1555         * Shared/cf/KeyedEncoder.cpp:
1556         (WebKit::KeyedEncoder::finishEncoding):
1557         Don't check for a non-null CFErrorRef here (which we incidentally never released on error). Instead,
1558         just null check the returned CFDataRef object.
1559
1560 2014-03-18  Joseph Pecoraro  <pecoraro@apple.com>
1561
1562         Unreviewed typo build fix for r165846.
1563
1564         * Shared/WebPageCreationParameters.cpp:
1565         (WebKit::WebPageCreationParameters::decode):
1566
1567 2014-03-18  Joseph Pecoraro  <pecoraro@apple.com>
1568
1569         WebKit2 SPI to disable remote inspection on a WKWebView / WKPage
1570         https://bugs.webkit.org/show_bug.cgi?id=130371
1571
1572         Reviewed by Dan Bernstein.
1573
1574         * Shared/WebPageCreationParameters.h:
1575         * Shared/WebPageCreationParameters.cpp:
1576         (WebKit::WebPageCreationParameters::encode):
1577         (WebKit::WebPageCreationParameters::decode):
1578         Add allowsRemoteInspection bool.
1579
1580         * UIProcess/API/C/WKPagePrivate.h:
1581         * UIProcess/API/C/WKPage.cpp:
1582         (WKPageGetAllowsRemoteInspection):
1583         (WKPageSetAllowsRemoteInspection):
1584         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1585         * UIProcess/API/Cocoa/WKWebView.mm:
1586         (-[WKWebView _allowsRemoteInspection]):
1587         (-[WKWebView _setAllowsRemoteInspection:]):
1588         Getter and setter for allowing remote inspection state.
1589
1590         * UIProcess/WebPageProxy.h:
1591         (WebKit::WebPageProxy::allowsRemoteInspection):
1592         * UIProcess/WebPageProxy.cpp:
1593         (WebKit::WebPageProxy::WebPageProxy):
1594         (WebKit::WebPageProxy::setAllowsRemoteInspection):
1595         (WebKit::WebPageProxy::creationParameters):
1596         Cached allows remote inspection state, with getter and setter.
1597
1598         * WebProcess/WebPage/WebPage.h:
1599         * WebProcess/WebPage/WebPage.messages.in:
1600         * WebProcess/WebPage/WebPage.cpp:
1601         (WebKit::WebPage::setAllowsRemoteInspection):
1602         When setting, call into WebCore to adjust the Page's setting.
1603
1604 2014-03-18  Anders Carlsson  <andersca@apple.com>
1605
1606         REGRESSION: Visited link coloring seems to be completely broken in tip of tree
1607         https://bugs.webkit.org/show_bug.cgi?id=130419
1608         <rdar://problem/16337850>
1609
1610         Reviewed by Dan Bernstein.
1611
1612         Make sure to send any queued up messages before calling connectionWillOpen so we'll ensure
1613         FIFO ordering if any messages are sent from within connectionWillOpen.
1614
1615         * Shared/ChildProcessProxy.cpp:
1616         (WebKit::ChildProcessProxy::didFinishLaunching):
1617
1618 2014-03-18  Joseph Pecoraro  <pecoraro@apple.com>
1619
1620         WebPageCreationParameters colorSpace should be MAC not COCOA
1621         https://bugs.webkit.org/show_bug.cgi?id=130414
1622
1623         Reviewed by Dan Bernstein.
1624
1625         The colorSpace param was only set and used on Mac, not iOS.
1626
1627         * Shared/WebPageCreationParameters.h:
1628         * Shared/WebPageCreationParameters.cpp:
1629         (WebKit::WebPageCreationParameters::encode):
1630         (WebKit::WebPageCreationParameters::decode):
1631
1632 2014-03-18  Simon Fraser  <simon.fraser@apple.com>
1633
1634         Dan says that options should be unsigned, and enums should be signed.
1635         
1636         Reviewed by Dan Bernstein.
1637
1638         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1639         (NS_ENUM):
1640
1641 2014-03-17  Alexey Proskuryakov  <ap@apple.com>
1642
1643         [WK2] Pass ranges over IPC in a cross-platform manner
1644         https://bugs.webkit.org/show_bug.cgi?id=130376
1645
1646         Reviewed by Anders Carlsson.
1647
1648         Added an EditingRange class for IPC, which automatically converts to and from
1649         NSRanges, knowing the difference between notFound and NSNotFound.
1650
1651         Manually applied the same fix to characterIndexForPoint.
1652
1653         * Scripts/webkit2/messages.py:
1654         (struct_or_class):
1655         * Shared/EditingRange.h: Added.
1656         (WebKit::EditingRange::EditingRange):
1657         (WebKit::EditingRange::isValid):
1658         (WebKit::EditingRange::operator NSRange):
1659         * UIProcess/API/mac/WKView.mm:
1660         (-[WKView insertText:replacementRange:]):
1661         (-[WKView selectedRange]):
1662         (-[WKView hasMarkedText]):
1663         (-[WKView setMarkedText:selectedRange:replacementRange:]):
1664         (-[WKView markedRange]):
1665         (-[WKView attributedSubstringForProposedRange:actualRange:]):
1666         (-[WKView characterIndexForPoint:]):
1667         (-[WKView firstRectForCharacterRange:actualRange:]):
1668         * UIProcess/WebPageProxy.h:
1669         * UIProcess/ios/WKContentViewInteraction.mm:
1670         (-[WKContentView setMarkedText:selectedRange:]):
1671         (-[WKContentView insertText:]):
1672         * UIProcess/ios/WebPageProxyIOS.mm:
1673         (WebKit::WebPageProxy::setComposition):
1674         (WebKit::WebPageProxy::insertText):
1675         (WebKit::WebPageProxy::insertDictatedText):
1676         (WebKit::WebPageProxy::getMarkedRange):
1677         (WebKit::WebPageProxy::getSelectedRange):
1678         (WebKit::WebPageProxy::getAttributedSubstringFromRange):
1679         (WebKit::WebPageProxy::firstRectForCharacterRange):
1680         * UIProcess/mac/WebPageProxyMac.mm:
1681         (WebKit::WebPageProxy::setComposition):
1682         (WebKit::WebPageProxy::insertText):
1683         (WebKit::WebPageProxy::insertDictatedText):
1684         (WebKit::WebPageProxy::getMarkedRange):
1685         (WebKit::WebPageProxy::getSelectedRange):
1686         (WebKit::WebPageProxy::getAttributedSubstringFromRange):
1687         (WebKit::WebPageProxy::firstRectForCharacterRange):
1688         * WebKit2.xcodeproj/project.pbxproj:
1689         * WebProcess/WebPage/WebPage.cpp:
1690         (WebKit::WebPage::rangeFromEditingRange):
1691         * WebProcess/WebPage/WebPage.h:
1692         * WebProcess/WebPage/WebPage.messages.in:
1693         * WebProcess/WebPage/ios/WebPageIOS.mm:
1694         (WebKit::WebPage::setComposition):
1695         (WebKit::WebPage::insertText):
1696         (WebKit::WebPage::insertDictatedText):
1697         (WebKit::WebPage::getMarkedRange):
1698         (WebKit::WebPage::getSelectedRange):
1699         (WebKit::WebPage::getAttributedSubstringFromRange):
1700         (WebKit::WebPage::firstRectForCharacterRange):
1701         * WebProcess/WebPage/mac/WebPageMac.mm:
1702         (WebKit::WebPage::setComposition):
1703         (WebKit::WebPage::insertText):
1704         (WebKit::WebPage::insertDictatedText):
1705         (WebKit::WebPage::getMarkedRange):
1706         (WebKit::WebPage::getSelectedRange):
1707         (WebKit::WebPage::getAttributedSubstringFromRange):
1708         (WebKit::WebPage::characterIndexForPoint):
1709         (WebKit::WebPage::firstRectForCharacterRange):
1710
1711 2014-03-17  Filip Pizlo  <fpizlo@apple.com>
1712
1713         More FTL enabling.
1714
1715         Rubber stamped by Dan Bernstein.
1716
1717         * Configurations/FeatureDefines.xcconfig:
1718
1719 2014-03-17  Simon Fraser  <simon.fraser@apple.com>
1720
1721         Renable pagination mode in WK2 MiniBrowser
1722         https://bugs.webkit.org/show_bug.cgi?id=130374
1723
1724         Reviewed by Anders Carlsson.
1725         
1726         Add SPI for pagination mode.
1727
1728         * UIProcess/API/Cocoa/WKWebView.mm:
1729         (-[WKWebView _paginationMode]):
1730         (-[WKWebView _setPaginationMode:]):
1731         (-[WKWebView _paginationBehavesLikeColumns]):
1732         (-[WKWebView _setPaginationBehavesLikeColumns:]):
1733         (-[WKWebView _pageLength]):
1734         (-[WKWebView _setPageLength:]):
1735         (-[WKWebView _gapBetweenPages]):
1736         (-[WKWebView _setGapBetweenPages:]):
1737         (-[WKWebView _pageCount]):
1738         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1739         (NS_ENUM):
1740
1741 2014-03-18  Ryuan Choi  <ryuan.choi@samsung.com>
1742
1743         [CMAKE][WK2]Move CoordinatedGraphics related files out of WebKit2/CMakeLists.txt
1744         https://bugs.webkit.org/show_bug.cgi?id=130390
1745
1746         Reviewed by Martin Robinson.
1747
1748         Now, only EFL port use CoordinatedGraphics among CMake based ports.
1749
1750         * CMakeLists.txt:
1751         * PlatformEfl.cmake:
1752         * PlatformGTK.cmake: Removed CoordinatedGraphics related files.
1753
1754 2014-03-18  Carlos Garcia Campos  <cgarcia@igalia.com>
1755
1756         [GTK] Race condition when the socket event source is cancelled
1757         https://bugs.webkit.org/show_bug.cgi?id=130395
1758
1759         Reviewed by Martin Robinson.
1760
1761         In some cases when the socket event source is cancelled the socket
1762         event source callback is called with the condition of the previous
1763         poll instead of 0. This can happen sometimes when the source is
1764         cancelled from the socket event source callback. Once the socket
1765         event source is cancelled, it's dispatched by glib without
1766         polling, so the condition is never reset again and the callback is
1767         called again and again with the previous condition. When the
1768         condition is G_IO_IN, the source is re-scheduled entering into an
1769         infinite loop. We should always check if the source has been
1770         cancelled at the beginning of the callback to destroy the source
1771         instead of relying on the condition being 0.
1772
1773         * Platform/gtk/WorkQueueGtk.cpp:
1774         (WorkQueue::SocketEventSource::isCancelled):
1775         (WorkQueue::SocketEventSource::eventCallback):
1776
1777 2014-03-18  Csaba Osztrogonác  <ossy@webkit.org>
1778
1779         [GTK] URTFB after r165789. Stub function added.
1780
1781         * WebProcess/InjectedBundle/gtk/InjectedBundleGtk.cpp:
1782         (WebKit::InjectedBundle::setBundleParameter):
1783
1784 2014-03-17  Jaehun Lim  <ljaehun.lim@samsung.com>
1785
1786         Unreviewed, EFL build fix after r165789
1787
1788         * WebProcess/InjectedBundle/efl/InjectedBundleEfl.cpp:
1789         (WebKit::InjectedBundle::setBundleParameter): Implemented.
1790
1791 2014-03-17  Jae Hyun Park  <jaepark@webkit.org>
1792
1793         [GTK] Build fix for debug build
1794
1795         Unreviewed.
1796
1797         finalizedListItem was actually used in ASSERT.  So, use ASSERT_UNUSED
1798         instead of ASSERT.
1799
1800         * UIProcess/API/gtk/WebKitBackForwardListItem.cpp:
1801         (webkitBackForwardListItemFinalized):
1802
1803 2014-03-17  Thiago de Barros Lacerda  <thiago.lacerda@openbossa.org>
1804
1805         [WK2] Getting rid of compilation warnings
1806         https://bugs.webkit.org/show_bug.cgi?id=130348
1807
1808         Reviewed by Benjamin Poulain.
1809
1810         * UIProcess/API/APIHistoryClient.h:
1811         (API::HistoryClient::didPerformClientRedirect):
1812         (API::HistoryClient::didPerformServerRedirect):
1813         (API::HistoryClient::didUpdateHistoryTitle):
1814         * UIProcess/API/APILoaderClient.h:
1815         (API::LoaderClient::didStartProvisionalLoadForFrame):
1816         (API::LoaderClient::didReceiveServerRedirectForProvisionalLoadForFrame):
1817         (API::LoaderClient::didFailProvisionalLoadWithErrorForFrame):
1818         (API::LoaderClient::didCommitLoadForFrame):
1819         (API::LoaderClient::didFinishLoadForFrame):
1820         (API::LoaderClient::didFailLoadWithErrorForFrame):
1821         (API::LoaderClient::didChangeBackForwardList):
1822         * UIProcess/API/APIPolicyClient.h:
1823         (API::PolicyClient::decidePolicyForNavigationAction):
1824         (API::PolicyClient::decidePolicyForNewWindowAction):
1825         (API::PolicyClient::decidePolicyForResponse):
1826         (API::PolicyClient::unableToImplementPolicy):
1827         * UIProcess/API/APIUIClient.h:
1828         (API::UIClient::exceededDatabaseQuota):
1829         (API::UIClient::saveDataToFileInDownloadsFolder):
1830         * UIProcess/API/C/WKPage.cpp:
1831         (WKPageSetPageLoaderClient):
1832         * UIProcess/APISession.cpp:
1833         (API::generateID):
1834         * WebProcess/Plugins/PluginView.cpp:
1835         (WebKit::PluginView::viewStateDidChange):
1836
1837 2014-03-17  Anders Carlsson  <andersca@apple.com>
1838
1839         Update the bundle parameters dictionary and send out KVO notifications
1840         https://bugs.webkit.org/show_bug.cgi?id=130379
1841         <rdar://problem/16213914>
1842
1843         Reviewed by Dan Bernstein.
1844
1845         * UIProcess/API/Cocoa/WKProcessPool.mm:
1846         (-[WKProcessPool _setObject:forBundleParameter:]):
1847         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessBundleParameters.h:
1848         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessBundleParameters.mm:
1849         (-[WKWebProcessBundleParameters setParameter:forKey:]):
1850         * WebProcess/InjectedBundle/InjectedBundle.h:
1851         * WebProcess/InjectedBundle/mac/InjectedBundleMac.mm:
1852         (WebKit::InjectedBundle::setBundleParameter):
1853         * WebProcess/WebProcess.cpp:
1854         (WebKit::WebProcess::setInjectedBundleParameter):
1855         * WebProcess/WebProcess.h:
1856         * WebProcess/WebProcess.messages.in:
1857
1858 2014-03-17  Tim Horton  <timothy_horton@apple.com>
1859
1860         Address some style nits.
1861
1862         * UIProcess/API/Cocoa/_WKThumbnailViewInternal.h:
1863
1864 2014-03-17  Simon Fraser  <simon.fraser@apple.com>
1865
1866         Address some style nits.
1867
1868         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1869
1870 2014-03-17  Simon Fraser  <simon.fraser@apple.com>
1871
1872         Add transparent window support back into MiniBrowser
1873         https://bugs.webkit.org/show_bug.cgi?id=130363
1874
1875         Reviewed by Anders Carlsson.
1876         
1877         Expose SPI for transparent window support.
1878
1879         * UIProcess/API/Cocoa/WKWebView.mm:
1880         (-[WKWebView _drawsTransparentBackground]):
1881         (-[WKWebView _setDrawsTransparentBackground:]):
1882         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1883
1884 2014-03-17  Alexey Proskuryakov  <ap@apple.com>
1885
1886         Undo some accidental Gtk changes from http://trac.webkit.org/changeset/165759
1887
1888         * UIProcess/WebPageProxy.cpp:
1889         * WebProcess/WebPage/WebPage.messages.in:
1890
1891 2014-03-17  Csaba Osztrogonác  <ossy@webkit.org>
1892
1893         [WK2] URTBF after r165755 for non Apple platforms, stub functions added.
1894
1895         * WebProcess/InjectedBundle/efl/InjectedBundleEfl.cpp:
1896         (WebKit::InjectedBundle::platformInitialize):
1897         * WebProcess/InjectedBundle/gtk/InjectedBundleGtk.cpp:
1898         (WebKit::InjectedBundle::platformInitialize):
1899
1900 2014-03-17  Alexey Proskuryakov  <ap@apple.com>
1901
1902         Move convertToRange() helper to cross-platform WebPage.cpp
1903         https://bugs.webkit.org/show_bug.cgi?id=130365
1904
1905         Reviewed by Tim Horton.
1906
1907         Also renamed it to rangeFromEditingLocationAndLength().
1908
1909         * WebProcess/WebPage/WebPage.cpp:
1910         (WebKit::WebPage::rangeFromEditingLocationAndLength):
1911         * WebProcess/WebPage/WebPage.h:
1912         * WebProcess/WebPage/ios/WebPageIOS.mm:
1913         (WebKit::WebPage::insertText):
1914         * WebProcess/WebPage/mac/WebPageMac.mm:
1915         (WebKit::WebPage::setComposition):
1916         (WebKit::WebPage::insertText):
1917         (WebKit::WebPage::insertDictatedText):
1918         (WebKit::WebPage::getAttributedSubstringFromRange):
1919         (WebKit::WebPage::characterIndexForPoint):
1920         (WebKit::WebPage::firstRectForCharacterRange):
1921
1922 2014-03-17  Anders Carlsson  <andersca@apple.com>
1923
1924         Follow-up fix.
1925
1926         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessBundleParameters.h:
1927
1928 2014-03-17  Enrica Casucci  <enrica@apple.com>
1929
1930         WK2: support data detectors driven action sheet..
1931         https://bugs.webkit.org/show_bug.cgi?id=130362
1932         <rdar://problem/16319711>
1933
1934         Reviewed by Benjamin Poulain.
1935
1936         * UIProcess/ios/WKActionSheetAssistant.mm:
1937         (-[WKActionSheetAssistant showDataDetectorsSheet]):
1938
1939 2014-03-17  Anders Carlsson  <andersca@apple.com>
1940
1941         Fix 32-bit OS X build.
1942
1943         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessBundleParameters.h:
1944         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessBundleParameters.mm:
1945         * WebProcess/InjectedBundle/InjectedBundle.h:
1946         * WebProcess/InjectedBundle/mac/InjectedBundleMac.mm:
1947         (WebKit::InjectedBundle::platformInitialize):
1948
1949 2014-03-17  Jae Hyun Park  <jaepark@webkit.org>
1950
1951         [GTK][CMake] Fix WebKit2 unused parameter warnings
1952         https://bugs.webkit.org/show_bug.cgi?id=130316
1953
1954         Reviewed by Martin Robinson.
1955
1956         * Platform/gtk/WorkQueueGtk.cpp: Fix unused parameter warnings.
1957         * UIProcess/API/gtk/PageClientImpl.cpp: Ditto.
1958         * UIProcess/API/gtk/WebKitBackForwardListItem.cpp: Ditto.
1959         * UIProcess/API/gtk/WebKitContextMenuClient.cpp: Ditto.
1960         * UIProcess/API/gtk/WebKitContextMenuItem.cpp: Ditto.
1961         * UIProcess/API/gtk/WebKitDownloadClient.cpp: Ditto.
1962         * UIProcess/API/gtk/WebKitFaviconDatabase.cpp: Ditto.
1963         * UIProcess/API/gtk/WebKitFindController.cpp: Ditto.
1964         * UIProcess/API/gtk/WebKitFormClient.cpp: Ditto.
1965         * UIProcess/API/gtk/WebKitGeolocationProvider.cpp: Ditto.
1966         * UIProcess/API/gtk/WebKitLoaderClient.cpp: Ditto.
1967         * UIProcess/API/gtk/WebKitPlugin.cpp: Ditto.
1968         * UIProcess/API/gtk/WebKitPolicyClient.cpp: Ditto.
1969         * UIProcess/API/gtk/WebKitRequestManagerClient.cpp: Ditto.
1970         * UIProcess/API/gtk/WebKitTextChecker.cpp: Ditto.
1971         * UIProcess/API/gtk/WebKitUIClient.cpp: Ditto.
1972         * UIProcess/API/gtk/WebKitURISchemeRequest.cpp: Ditto.
1973         * UIProcess/API/gtk/WebKitWebContext.cpp: Ditto.
1974         * UIProcess/API/gtk/WebKitWebInspector.cpp: Ditto.
1975         * UIProcess/API/gtk/WebKitWebView.cpp: Ditto.
1976         * UIProcess/API/gtk/WebKitWebViewBase.cpp: Ditto.
1977         * UIProcess/API/gtk/WebKitWebViewBaseAccessible.cpp: Ditto.
1978         * UIProcess/API/gtk/WebViewBaseInputMethodFilter.cpp: Ditto.
1979         * UIProcess/gtk/TextCheckerGtk.cpp: Ditto.
1980         * UIProcess/gtk/WebContextMenuProxyGtk.cpp: Ditto.
1981         * UIProcess/gtk/WebPopupMenuProxyGtk.cpp: Ditto.
1982         * WebProcess/InjectedBundle/API/gtk/WebKitFrame.cpp: Ditto.
1983         * WebProcess/InjectedBundle/API/gtk/WebKitWebExtension.cpp: Ditto.
1984         * WebProcess/InjectedBundle/API/gtk/WebKitWebPage.cpp: Ditto.
1985         * WebProcess/WebCoreSupport/gtk/WebEditorClientGtk.cpp: Ditto.
1986         * WebProcess/WebPage/gtk/WebPrintOperationGtk.cpp: Ditto.
1987
1988 2014-03-17  Alexey Proskuryakov  <ap@apple.com>
1989
1990         [Mac] Standardize on start/length in text input IPC methods
1991         https://bugs.webkit.org/show_bug.cgi?id=130359
1992
1993         Reviewed by Anders Carlsson.
1994
1995         Some IPC methods used start/length, and others use start/end. This was confusing.
1996
1997         While here, changed WebPageMac.mm to not use NSMakeRange where we don't need it
1998         (I want to move this code to WebPage.cpp, where it could be shared with iOS and
1999         other platforms, as it doesn't depend on Foundation much).
2000
2001         * UIProcess/API/mac/WKView.mm:
2002         (-[WKView insertText:replacementRange:]):
2003         (-[WKView setMarkedText:selectedRange:replacementRange:]):
2004         (-[WKView attributedSubstringForProposedRange:actualRange:]):
2005         * UIProcess/WebPageProxy.cpp:
2006         (WebKit::WebPageProxy::internalShowContextMenu):
2007         * UIProcess/WebPageProxy.h:
2008         * UIProcess/ios/WebPageProxyIOS.mm:
2009         (WebKit::WebPageProxy::setComposition):
2010         (WebKit::WebPageProxy::insertText):
2011         * UIProcess/mac/WebPageProxyMac.mm:
2012         (WebKit::WebPageProxy::setComposition):
2013         (WebKit::WebPageProxy::insertText):
2014         (WebKit::WebPageProxy::insertDictatedText):
2015         (WebKit::WebPageProxy::getAttributedSubstringFromRange):
2016         * WebProcess/WebPage/WebPage.cpp:
2017         (WebKit::WebPage::setComposition):
2018         * WebProcess/WebPage/WebPage.h:
2019         * WebProcess/WebPage/WebPage.messages.in:
2020         * WebProcess/WebPage/ios/WebPageIOS.mm:
2021         (WebKit::WebPage::setComposition):
2022         (WebKit::WebPage::insertText):
2023         * WebProcess/WebPage/mac/WebPageMac.mm:
2024         (WebKit::WebPage::setComposition):
2025         (WebKit::WebPage::insertText):
2026         (WebKit::WebPage::insertDictatedText):
2027         (WebKit::WebPage::getAttributedSubstringFromRange):
2028         (WebKit::convertToRange):
2029         (WebKit::WebPage::firstRectForCharacterRange):
2030
2031 2014-03-17  Tim Horton  <timothy_horton@apple.com>
2032
2033         Rename WKThumbnailView to _WKThumbnailView
2034         https://bugs.webkit.org/show_bug.cgi?id=130361
2035
2036         Reviewed by Anders Carlsson.
2037
2038         * UIProcess/API/Cocoa/_WKThumbnailView.h: Renamed from Source/WebKit2/UIProcess/API/Cocoa/WKThumbnailView.h.
2039         * UIProcess/API/Cocoa/_WKThumbnailView.mm: Renamed from Source/WebKit2/UIProcess/API/Cocoa/WKThumbnailView.mm.
2040         (-[_WKThumbnailView initWithFrame:fromWKView:]):
2041         (-[_WKThumbnailView _viewWasUnparented]):
2042         (-[_WKThumbnailView _viewWasParented]):
2043         (-[_WKThumbnailView _requestSnapshotIfNeeded]):
2044         (-[_WKThumbnailView _didTakeSnapshot:]):
2045         (-[_WKThumbnailView viewDidMoveToWindow]):
2046         (-[_WKThumbnailView setScale:]):
2047         (-[_WKThumbnailView setUsesSnapshot:]):
2048         (-[_WKThumbnailView _setThumbnailLayer:]):
2049         (-[_WKThumbnailView _thumbnailLayer]):
2050         * UIProcess/API/Cocoa/_WKThumbnailViewInternal.h: Renamed from Source/WebKit2/UIProcess/API/Cocoa/WKThumbnailViewInternal.h.
2051         * UIProcess/API/mac/WKView.mm:
2052         (-[WKView _setThumbnailView:]):
2053         (-[WKView _thumbnailView]):
2054         (-[WKView _updateThumbnailViewLayer]):
2055         * UIProcess/API/mac/WKViewInternal.h:
2056         * UIProcess/mac/PageClientImpl.mm:
2057         * WebKit2.xcodeproj/project.pbxproj:
2058
2059 2014-03-17  Anders Carlsson  <andersca@apple.com>
2060
2061         Add SPI for getting bundle parameters from the injected bundle
2062         https://bugs.webkit.org/show_bug.cgi?id=130355
2063
2064         Reviewed by Dan Bernstein.
2065
2066         * UIProcess/mac/WebContextMac.mm:
2067         (WebKit::WebContext::platformInitializeWebProcess):
2068         * WebKit2.xcodeproj/project.pbxproj:
2069         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessBundleParameters.h: Copied from Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKWebProcessPlugIn.h.
2070         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessBundleParameters.mm: Copied from Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKWebProcessPlugIn.h.
2071         (-[WKWebProcessBundleParameters initWithDictionary:]):
2072         (-[WKWebProcessBundleParameters valueForKey:]):
2073         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugIn.h:
2074         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugIn.mm:
2075         (-[WKWebProcessPlugInController parameters]):
2076         * WebProcess/InjectedBundle/InjectedBundle.cpp:
2077         (WebKit::InjectedBundle::InjectedBundle):
2078         * WebProcess/InjectedBundle/InjectedBundle.h:
2079         (WebKit::InjectedBundle::create):
2080         * WebProcess/InjectedBundle/mac/InjectedBundleMac.mm:
2081         (WebKit::InjectedBundle::bundleParameters):
2082         (WebKit::InjectedBundle::platformInitialize):
2083         * WebProcess/WebProcess.cpp:
2084         (WebKit::WebProcess::initializeWebProcess):
2085
2086 2014-03-17  Brent Fulgham  <bfulgham@apple.com>
2087
2088         Provide preference to enable additional AVFoundation options
2089         https://bugs.webkit.org/show_bug.cgi?id=130275
2090
2091         Reviewed by Eric Carlson.
2092
2093         * Shared/WebPreferencesStore.h: Added new preference.
2094         * UIProcess/API/C/WKPreferences.cpp:
2095         (WKPreferencesSetEnableInheritURIQueryComponent): Added.
2096         (WKPreferencesGetEnableInheritURIQueryComponent): Added.
2097         * UIProcess/API/C/WKPreferencesPrivate.h:
2098         * WebProcess/WebPage/WebPage.cpp:
2099         (WebKit::WebPage::updatePreferences): Handle new preference.
2100
2101 2014-03-17  Alexey Proskuryakov  <ap@apple.com>
2102
2103         [Mac] getAttributedSubstringFromRange arguments are incorrectly named
2104         https://bugs.webkit.org/show_bug.cgi?id=130349
2105
2106         Reviewed by Tim Horton.
2107
2108         There is a mess of start/end and start/length pairs in IPC. One day we'll fix them
2109         all, but now, let's at least name them correctly.
2110
2111         No behavior change.
2112
2113         * UIProcess/WebPageProxy.h:
2114         * UIProcess/mac/WebPageProxyMac.mm:
2115         (WebKit::WebPageProxy::getAttributedSubstringFromRange):
2116         * WebProcess/WebPage/WebPage.h:
2117         * WebProcess/WebPage/WebPage.messages.in:
2118         * WebProcess/WebPage/mac/WebPageMac.mm:
2119         (WebKit::WebPage::getAttributedSubstringFromRange):
2120
2121 2014-03-17  Tim Horton  <timothy_horton@apple.com>
2122
2123         WKThumbnailView should support snapshots
2124         https://bugs.webkit.org/show_bug.cgi?id=130335
2125         <rdar://problem/16255139>
2126
2127         Reviewed by Simon Fraser.
2128
2129         Add a mode where WKThumbnailView takes a software snapshot of the web content,
2130         replacing the live layer tree with said snapshot once it returns from the
2131         web process. This may improve animation performance in cases where the
2132         layer tree would otherwise be very complex.
2133
2134         * UIProcess/API/Cocoa/WKThumbnailView.h:
2135         Add a property, usesSnapshot, which determines whether the thumbnail view
2136         should use the live layer tree or a snapshot of the content.
2137
2138         * UIProcess/API/Cocoa/WKThumbnailView.mm:
2139         (-[WKThumbnailView initWithFrame:fromWKView:]):
2140         (-[WKThumbnailView _viewWasUnparented]):
2141         Clear the snapshot when unparented.
2142
2143         (-[WKThumbnailView _viewWasParented]):
2144         Take a snapshot of the web content when parented, if needed.
2145
2146         (-[WKThumbnailView _requestSnapshotIfNeeded]):
2147         If we're using snapshots, and haven't already dispatched an async snapshot request,
2148         and don't already have a snapshot, request a snapshot from the web process.
2149
2150         When it returns, use it as the contents of the WKThumbnailView layer, and
2151         unparent the live layer tree.
2152
2153         (-[WKThumbnailView setScale:]):
2154         (-[WKThumbnailView setUsesSnapshot:]):
2155         (-[WKThumbnailView _setThumbnailLayer:]):
2156         (-[WKThumbnailView _thumbnailLayer]):
2157         * UIProcess/API/Cocoa/WKThumbnailViewInternal.h:
2158
2159         * UIProcess/API/mac/WKView.mm:
2160         (-[WKView _setAcceleratedCompositingModeRootLayer:]):
2161         (-[WKView _acceleratedCompositingModeRootLayer]):
2162         WKView should always keep track of the current root layer, instead of totally
2163         handing control over to WKThumbnailView when it is used.
2164
2165         (-[WKView _setThumbnailView:]):
2166         (-[WKView _updateThumbnailViewLayer]):
2167         (-[WKView _reparentLayerTreeInThumbnailView]):
2168         If needed (either we're not using snapshots, or still waiting for the snapshot to be painted),
2169         push the WKView's live layer tree into the thumbnail view.
2170
2171         * UIProcess/API/mac/WKViewInternal.h:
2172         * UIProcess/WebPageProxy.cpp:
2173         (WebKit::WebPageProxy::internalShowContextMenu):
2174         * UIProcess/WebPageProxy.h:
2175         * WebProcess/WebPage/WebPage.h:
2176         * WebProcess/WebPage/WebPage.messages.in:
2177         * WebProcess/WebPage/WebPage.cpp:
2178         (WebKit::WebPage::takeThumbnailSnapshot):
2179         Add a message that asynchronously returns a snapshot that respects the
2180         current thumbnail scale and position.
2181
2182         (WebKit::WebPage::scaledSnapshotWithOptions):
2183         Use some nullptr.
2184
2185         * WebProcess/WebPage/DrawingArea.cpp:
2186         (WebKit::DrawingArea::transform):
2187         * WebProcess/WebPage/DrawingArea.h:
2188         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
2189         Add a getter for the DrawingArea's transform.
2190         Rename it to rootLayerTransform.
2191
2192 2014-03-17  Zan Dobersek  <zdobersek@igalia.com>
2193
2194         Use RunLoop objects through references instead of pointers
2195         https://bugs.webkit.org/show_bug.cgi?id=130313
2196
2197         Reviewed by Andreas Kling.
2198
2199         Adjust the code accordingly now that RunLoop::current() and RunLoop::main()
2200         return RunLoop reference instead of a pointer.
2201
2202         * DatabaseProcess/DatabaseProcess.cpp:
2203         (WebKit::DatabaseProcess::didClose):
2204         (WebKit::DatabaseProcess::didReceiveInvalidMessage):
2205         * DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp:
2206         (WebKit::UniqueIDBDatabase::postMainThreadTask):
2207         * NetworkProcess/NetworkProcess.cpp:
2208         (WebKit::NetworkProcess::didClose):
2209         (WebKit::NetworkProcess::didReceiveInvalidMessage):
2210         * NetworkProcess/NetworkResourceLoader.cpp:
2211         (WebKit::NetworkResourceLoader::continueWillSendRequest):
2212         * Platform/IPC/Connection.cpp:
2213         (IPC::Connection::SyncMessageState::getOrCreate):
2214         (IPC::Connection::SyncMessageState::SyncMessageState):
2215         (IPC::Connection::SyncMessageState::~SyncMessageState):
2216         (IPC::Connection::SyncMessageState::processIncomingMessage):
2217         (IPC::Connection::SyncMessageState::dispatchMessages):
2218         (IPC::Connection::createServerConnection):
2219         (IPC::Connection::createClientConnection):
2220         (IPC::Connection::Connection):
2221         (IPC::Connection::addWorkQueueMessageReceiver):
2222         (IPC::Connection::removeWorkQueueMessageReceiver):
2223         (IPC::Connection::sendSyncMessage):
2224         (IPC::Connection::sendSyncMessageFromSecondaryThread):
2225         (IPC::Connection::waitForSyncReply):
2226         (IPC::Connection::processIncomingMessage):
2227         (IPC::Connection::connectionDidClose):
2228         (IPC::Connection::dispatchDidReceiveInvalidMessage):
2229         (IPC::Connection::enqueueIncomingMessage):
2230         (IPC::Connection::wakeUpRunLoop):
2231         * Platform/IPC/Connection.h:
2232         * Platform/IPC/mac/ConnectionMac.cpp:
2233         (IPC::Connection::receiveSourceEventHandler):
2234         * Shared/ChildProcess.cpp:
2235         (WebKit::ChildProcess::stopRunLoop):
2236         * Shared/Plugins/NPObjectProxy.cpp:
2237         (WebKit::NPObjectProxy::NP_Deallocate):
2238         * UIProcess/Launcher/efl/ProcessLauncherEfl.cpp:
2239         (WebKit::ProcessLauncher::launchProcess):
2240         * UIProcess/Launcher/gtk/ProcessLauncherGtk.cpp:
2241         (WebKit::ProcessLauncher::launchProcess):
2242         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
2243         (WebKit::connectToService):
2244         (WebKit::tryPreexistingProcess):
2245         (WebKit::createProcess):
2246         * UIProcess/Storage/StorageManager.cpp:
2247         (WebKit::StorageManager::getOrigins):
2248         (WebKit::StorageManager::getStorageDetailsByOrigin):
2249         * UIProcess/Storage/StorageManager.h:
2250         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
2251         (WebKit::NetscapePlugin::pluginThreadAsyncCall):
2252         * WebProcess/Plugins/PluginView.cpp:
2253         (WebKit::PluginView::unprotectPluginFromDestruction):
2254         * WebProcess/WebPage/EventDispatcher.cpp:
2255         (WebKit::EventDispatcher::wheelEvent):
2256         * WebProcess/WebPage/ViewUpdateDispatcher.cpp:
2257         (WebKit::ViewUpdateDispatcher::visibleContentRectUpdate):
2258         * WebProcess/WebPage/WebPage.cpp:
2259         (WebKit::WebPage::close):
2260
2261 2014-03-17  Giovanni Campagna  <gcampagna@src.gnome.org>
2262
2263         [GTK] Don't busy loop when the socket is full
2264         https://bugs.webkit.org/show_bug.cgi?id=129802
2265
2266         Reviewed by Carlos Garcia Campos.
2267
2268         When the socket is full and we see EAGAIN or EWOULDBLOCK
2269         (because the socket is non blocking), don't busy loop by
2270         tring to write again, instead poll() until the socket
2271         becomes writable.
2272
2273         * Platform/IPC/unix/ConnectionUnix.cpp:
2274         (IPC::Connection::sendOutgoingMessage):
2275
2276 2014-03-17  Martin Robinson  <mrobinson@igalia.com>
2277
2278         [GTK][CMake] Ensure that HAVE_GTK_UNIX_PRINTING is defined when appropriate
2279         https://bugs.webkit.org/show_bug.cgi?id=130155
2280
2281         Reviewed by Philippe Normand.
2282
2283         * PlatformGTK.cmake: Add GTK_UNIX_PRINT flags to the build.
2284
2285 2014-03-17  Ryuan Choi  <ryuan.choi@samsung.com>
2286
2287         [EFL][WK2] Restore cursor when moving mouse into webview
2288         https://bugs.webkit.org/show_bug.cgi?id=130182
2289
2290         Reviewed by Gyuyoung Kim.
2291
2292         We changed mouse cursor when the type of cursor is changed.
2293         But once mouse is moved out of webview, ewebkit will not know whether cursor
2294         is changed or not.
2295
2296         So, this patch added a logic to restore the last applied type of cursor when
2297         mouse is moved into webview again.
2298
2299         * UIProcess/API/efl/EwkView.cpp:
2300         (EwkViewEventHandler<EVAS_CALLBACK_MOUSE_IN>::handleEvent):
2301         Call updateCursor to restore the last applied type of cursor.
2302         (EwkView::EwkView):
2303         (EwkView::updateCursor): Extracted from setCursor.
2304         (EwkView::setCursor):
2305         (EwkView::handleEvasObjectAdd):
2306         * UIProcess/API/efl/EwkView.h:
2307
2308 2014-03-16  Ryuan Choi  <ryuan.choi@samsung.com>
2309
2310         [EFL][WK2] Add ewk_application_cache_manager APIs
2311         https://bugs.webkit.org/show_bug.cgi?id=102853
2312
2313         Reviewed by Gyuyoung Kim.
2314
2315         Implemented application cache manager to get list of origins which stores
2316         application cache and remove specified origin or all.
2317
2318         * PlatformEfl.cmake: Added newly added files.
2319         * UIProcess/API/efl/ewk_application_cache_manager.cpp: Added.
2320         (EwkApplicationCacheManager::EwkApplicationCacheManager):
2321         (EwkApplicationCacheManager::~EwkApplicationCacheManager):
2322         (Get_Origins_Data::Get_Origins_Data):
2323         (getApplicationCacheOriginsCallback):
2324         (ewk_application_cache_manager_origins_get):
2325         (ewk_application_cache_origins_free):
2326         (ewk_application_cache_manager_delete_all):
2327         (ewk_application_cache_manager_delete):
2328         * UIProcess/API/efl/ewk_application_cache_manager.h: Added.
2329         * UIProcess/API/efl/ewk_application_cache_manager_private.h: Added.
2330         (EwkApplicationCacheManager::impl):
2331         * UIProcess/API/efl/ewk_context.cpp:
2332         (EwkContext::applicationCacheManager):
2333         (ewk_context_application_cache_manager_get):
2334         * UIProcess/API/efl/ewk_context.h:
2335         * UIProcess/API/efl/ewk_context_private.h:
2336         * UIProcess/API/efl/ewk_security_origin_private.h:
2337         (EwkSecurityOrigin::wkSecurityOrigin):
2338         * UIProcess/API/efl/tests/UnitTestUtils/EWK2UnitTestServer.cpp:
2339         (EWK2UnitTestServer::port):
2340         * UIProcess/API/efl/tests/UnitTestUtils/EWK2UnitTestServer.h:
2341         * UIProcess/API/efl/tests/test_ewk2_application_cache_manager.cpp:
2342         Added to test application_cache_manager.
2343         (serverCallback):
2344         (getOriginsCallback):
2345         (timerCallback):
2346         (TEST_F):
2347         * UIProcess/API/efl/tests/test_ewk2_context.cpp:
2348         Added test case to test getter of application_cache_manager.
2349         (TEST_F):
2350
2351 2014-03-16  Zan Dobersek  <zdobersek@igalia.com>
2352
2353         Move GTK WebKit2 code to std::unique_ptr
2354         https://bugs.webkit.org/show_bug.cgi?id=129672
2355
2356         Reviewed by Anders Carlsson.
2357
2358         Repace uses of OwnPtr and PassOwnPtr in GTK-specific WebKit2 code with std::unique_ptr.
2359
2360         * Shared/Downloads/Download.h:
2361         * Shared/Downloads/soup/DownloadSoup.cpp:
2362         (WebKit::Download::start):
2363         (WebKit::Download::startWithHandle):
2364         (WebKit::Download::platformInvalidate):
2365         * UIProcess/API/gtk/PageClientImpl.cpp:
2366         * UIProcess/API/gtk/PageClientImpl.h:
2367         * UIProcess/API/gtk/WebKitContextMenuItem.cpp:
2368         (webkitContextMenuItemCreate):
2369         (webkitContextMenuItemCreateForGtkItem):
2370         (webkit_context_menu_item_new):
2371         (webkit_context_menu_item_new_from_stock_action):
2372         (webkit_context_menu_item_new_from_stock_action_with_label):
2373         (webkit_context_menu_item_new_with_submenu):
2374         (webkit_context_menu_item_new_separator):
2375         * UIProcess/API/gtk/WebKitTextChecker.h:
2376         * UIProcess/API/gtk/WebKitWebContext.cpp:
2377         (createDefaultWebContext):
2378         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
2379         (webkitWebViewBaseConstructed):
2380         * WebProcess/WebPage/gtk/WebPrintOperationGtk.cpp:
2381         (WebKit::WebPrintOperationGtk::print):
2382         * WebProcess/gtk/WebGtkExtensionManager.cpp:
2383         (WebKit::WebGtkExtensionManager::initialize):
2384         * WebProcess/soup/WebKitSoupRequestInputStream.cpp:
2385         (webkitSoupRequestInputStreamPendingReadAsyncComplete):
2386         (webkitSoupRequestInputStreamReadAsync):
2387         * WebProcess/soup/WebSoupRequestManager.cpp:
2388         (WebKit::WebSoupRequestManager::send):
2389         * WebProcess/soup/WebSoupRequestManager.h:
2390
2391 2014-03-16  Brian Burg  <bburg@apple.com>
2392
2393         Web Inspector: vended backend commands file should be generated as part of the build
2394         https://bugs.webkit.org/show_bug.cgi?id=130110
2395
2396         Reviewed by Timothy Hatcher.
2397
2398         * PlatformGTK.cmake: Copy over generated inspector backend commands files.
2399
2400 2014-03-16  Darin Adler  <darin@apple.com>
2401
2402         Try to fix 32-bit Mac build.
2403
2404         * WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm: Add missing include.
2405
2406 2014-03-16  Philippe Normand  <pnormand@igalia.com>
2407
2408         Unreviewed, GTK build fix after r165692.
2409
2410         * UIProcess/gtk/TextCheckerGtk.cpp:
2411         (WebKit::TextChecker::checkSpellingOfString):
2412         (WebKit::TextChecker::checkGrammarOfString):
2413
2414 2014-03-15  Darin Adler  <darin@apple.com>
2415
2416         Remove all uses of deprecatedCharacters from WebKit2
2417         https://bugs.webkit.org/show_bug.cgi?id=130197
2418
2419         Reviewed by Andreas Kling.
2420
2421         * Shared/APIString.h: Rewrote getCharacters to use StringView,
2422         substring, and getCharactersWithUpconvert. Added an 8-bit case
2423         to getUTF8CString.
2424
2425         * Shared/Plugins/Netscape/x11/NetscapePluginModuleX11.cpp:
2426         (WebKit::writeByte): Added.
2427         (WebKit::writeCharacter): Added.
2428         (WebKit::writeLine): Added. Uses operator[] instead of characters16 to get
2429         the UTF-16 characters out of the string.
2430         (WebKit::NetscapePluginModule::scanPlugin): Replaced code that writes out
2431         text to stdout with much simpler version using the functions above.
2432
2433         * UIProcess/TextChecker.h: Changed text arguments to use StringView instead
2434         of UChar/int pairs.
2435
2436         * UIProcess/WebPageProxy.cpp:
2437         (WebKit::WebPageProxy::internalShowContextMenu): Updated to pass StringView.
2438
2439         * UIProcess/efl/TextCheckerEfl.cpp:
2440         (WebKit::nextWordOffset): Changed function to use StringView and unsigned.
2441         (WebKit::TextChecker::checkTextOfParagraph): Changed to use StringView and
2442         substring.
2443         (WebKit::TextChecker::checkSpellingOfString): Ditto.
2444         (WebKit::TextChecker::checkGrammarOfString): Ditto.
2445         (WebKit::TextChecker::requestCheckingOfString): Pass in a StringView, so no
2446         need to call deprecatedCharacters.
2447
2448         * UIProcess/ios/TextCheckerIOS.mm:
2449         (WebKit::TextChecker::checkTextOfParagraph): Changed to take StringView.
2450         (WebKit::TextChecker::checkSpellingOfString): Ditto.
2451         (WebKit::TextChecker::checkGrammarOfString): Ditto.
2452
2453         * UIProcess/mac/TextCheckerMac.mm:
2454         (WebKit::TextChecker::checkTextOfParagraph): Changed to take StringView and
2455         use StringView::createNSStringWithoutCopying.
2456         (WebKit::TextChecker::checkSpellingOfString): CHanged to take StringView.
2457         (WebKit::TextChecker::checkGrammarOfString): Ditto.
2458
2459         * WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm:
2460         (WebKit::convertStringToKeyCodes): Changed to take StringView and use
2461         upconvertedCharacters instead of deprecatedCharacters. Also use move instead
2462         of swap.
2463         (WebKit::NetscapePlugin::sendComplexTextInput): Updated to new style for loop.
2464
2465         * WebProcess/WebPage/EncoderAdapter.cpp:
2466         (WebKit::EncoderAdapter::encodeString): Use StringView::upconvertedCharacters
2467         instead of String::deprecatedCharacters.
2468
2469 2014-03-15  David Kilzer  <ddkilzer@apple.com>
2470
2471         [iOS] Define SYSTEM_VERSION_PREFIX consistently
2472         <http://webkit.org/b/130293>
2473         <rdar://problem/15926359>
2474
2475         Reviewed by Dan Bernstein.
2476
2477         * Configurations/Version.xcconfig:
2478         (SYSTEM_VERSION_PREFIX): Sync with
2479         Source/WebKit/mac/Version.xcconfig.
2480
2481 2014-03-14  Alexey Proskuryakov  <ap@apple.com>
2482
2483         [Mac] Sync extended attribute related rules with AppSandbox profile
2484         https://bugs.webkit.org/show_bug.cgi?id=130263
2485         <rdar://problem/16318965>
2486
2487         Reviewed by Sam Weinig.
2488
2489         Update the fix to use a different syntax in some OS versions.
2490
2491         * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
2492         * Resources/PlugInSandboxProfiles/com.apple.WebKit.plugin-common.sb:
2493         * WebProcess/com.apple.WebProcess.sb.in:
2494
2495 2014-03-14  Ryosuke Niwa  <rniwa@webkit.org>
2496
2497         Revert erroneous changes made to UIProcess/API/Cocoa in r165676.
2498
2499         * UIProcess/API/Cocoa/WKBackForwardList.h:
2500         * UIProcess/API/Cocoa/WKBackForwardListItem.h: Copied from Source/WebKit2/UIProcess/API/Cocoa/WKBackForwardListItem.h.
2501         * UIProcess/API/Cocoa/WKNavigation.h:
2502         * UIProcess/API/Cocoa/WKNavigationAction.h: Copied from Source/WebKit2/UIProcess/API/Cocoa/WKNavigationAction.h.
2503         * UIProcess/API/Cocoa/WKNavigationDelegate.h:
2504         (NS_ENUM):
2505         * UIProcess/API/Cocoa/WKNavigationResponse.h: Copied from Source/WebKit2/UIProcess/API/Cocoa/WKNavigationResponse.h.
2506         * UIProcess/API/Cocoa/WKNavigationTrigger.h: Removed.
2507         * UIProcess/API/Cocoa/WKWebView.h:
2508
2509 2014-03-14  Mark Rowe  <mrowe@apple.com>
2510
2511         Fix the production build.
2512
2513         Don't rely on USE_INTERNAL_SDK being set for the Production configuration since UseInternalSDK.xcconfig won't
2514         be at the expected relative path when working from installed source.
2515
2516         * Configurations/Base.xcconfig:
2517
2518 2014-03-14  Maciej Stachowiak  <mjs@apple.com>
2519
2520         Replace "Apple Computer, Inc." with "Apple Inc." in copyright headers
2521         https://bugs.webkit.org/show_bug.cgi?id=130276
2522         <rdar://problem/16266927>
2523         
2524         Reviewed by Simon Fraser.
2525
2526         * Shared/AsyncRequest.cpp:
2527         * Shared/AsyncRequest.h:
2528         * Shared/ContextMenuContextData.cpp:
2529         * Shared/ContextMenuContextData.h:
2530         * Shared/Databases/DatabaseProcessCreationParameters.h:
2531         * Shared/Databases/IndexedDB/IDBUtilities.cpp:
2532         * Shared/Databases/IndexedDB/IDBUtilities.h:
2533         * Shared/mac/RemoteLayerBackingStore.h:
2534         * Shared/mac/RemoteLayerBackingStore.mm:
2535         * UIProcess/API/Cocoa/WKBackForwardList.h:
2536         * UIProcess/API/Cocoa/WKBackForwardListItem.h: Removed.
2537         * UIProcess/API/Cocoa/WKNavigation.h:
2538         * UIProcess/API/Cocoa/WKNavigationAction.h: Removed.
2539         * UIProcess/API/Cocoa/WKNavigationDelegate.h:
2540         * UIProcess/API/Cocoa/WKNavigationResponse.h: Removed.
2541         * UIProcess/API/Cocoa/WKNavigationTrigger.h: Added.
2542         (NS_ENUM):
2543         * UIProcess/API/Cocoa/WKWebView.h:
2544         * UIProcess/API/CoordinatedGraphics/WKCoordinatedScene.cpp:
2545         * UIProcess/API/CoordinatedGraphics/WKCoordinatedScene.h:
2546         * UIProcess/CoordinatedGraphics/WKCoordinatedSceneAPICast.h:
2547         * WebProcess/Databases/IndexedDB/WebIDBFactoryBackend.cpp:
2548         * WebProcess/Databases/IndexedDB/WebIDBFactoryBackend.h:
2549         * WebProcess/Databases/IndexedDB/WebIDBServerConnection.cpp:
2550         * WebProcess/Databases/IndexedDB/WebIDBServerConnection.h:
2551         * WebProcess/Databases/WebToDatabaseProcessConnection.cpp:
2552         * WebProcess/Databases/WebToDatabaseProcessConnection.h:
2553         * WebProcess/WebCoreSupport/WebAlternativeTextClient.h:
2554         * WebProcess/WebCoreSupport/mac/WebAlternativeTextClient.cpp:
2555         * WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm:
2556         * WebProcess/WebPage/mac/GraphicsLayerCARemote.cpp:
2557         * WebProcess/WebPage/mac/GraphicsLayerCARemote.h:
2558         * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
2559         * WebProcess/WebPage/mac/PlatformCALayerRemote.h:
2560         * WebProcess/WebPage/mac/PlatformCALayerRemoteCustom.h:
2561         * WebProcess/WebPage/mac/PlatformCALayerRemoteCustom.mm:
2562         * WebProcess/WebPage/mac/PlatformCALayerRemoteTiledBacking.cpp:
2563         * WebProcess/WebPage/mac/PlatformCALayerRemoteTiledBacking.h:
2564
2565 2014-03-14  Simon Fraser  <simon.fraser@apple.com>
2566
2567         [iOS WK2] background-attachment: fixed renders oddly, moves around
2568         https://bugs.webkit.org/show_bug.cgi?id=130277
2569         <rdar://problem/16332883>
2570
2571         Reviewed by Tim Horton.
2572         
2573         Actually send scrolling and counter-scrolling layers to the UI process!
2574
2575         * Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp:
2576         (ArgumentCoder<ScrollingStateScrollingNode>::encode):
2577         (ArgumentCoder<ScrollingStateScrollingNode>::decode):
2578
2579 2014-03-14  Anders Carlsson  <andersca@apple.com>
2580
2581         Try to fix the iOS build.
2582
2583         * UIProcess/mac/WebContextMac.mm:
2584
2585 2014-03-14  Anders Carlsson  <andersca@apple.com>
2586
2587         Begin work on the bundle parameter API
2588         https://bugs.webkit.org/show_bug.cgi?id=130267
2589
2590         Reviewed by Dan Bernstein.
2591
2592         * Shared/WebProcessCreationParameters.cpp:
2593         (WebKit::WebProcessCreationParameters::encode):
2594         (WebKit::WebProcessCreationParameters::decode):
2595         * Shared/WebProcessCreationParameters.h:
2596         * UIProcess/API/Cocoa/WKProcessPool.mm:
2597         (-[WKProcessPool _objectForBundleParameter:]):
2598         (-[WKProcessPool _setObject:forBundleParameter:]):
2599         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
2600         * UIProcess/WebContext.h:
2601         (WebKit::WebContext::bundleParameters):
2602         * UIProcess/mac/WebContextMac.mm:
2603         (WebKit::WebContext::ensureBundleParameters):
2604         (WebKit::WebContext::platformInitializeWebProcess):
2605
2606 2014-03-14  Alexey Proskuryakov  <ap@apple.com>
2607
2608         [Mac] Sync extended attribute related rules with AppSandbox profile
2609         https://bugs.webkit.org/show_bug.cgi?id=130263
2610         <rdar://problem/16318965>
2611
2612         Reviewed by Sam Weinig.
2613
2614         * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
2615         * Resources/PlugInSandboxProfiles/com.apple.QuickTime Plugin.plugin.sb:
2616         * Resources/PlugInSandboxProfiles/com.apple.WebKit.plugin-common.sb:
2617         * Resources/PlugInSandboxProfiles/com.apple.ist.ds.appleconnect.webplugin.sb:
2618         * Resources/PlugInSandboxProfiles/com.macromedia.Flash Player.plugin.sb:
2619         * Resources/PlugInSandboxProfiles/com.microsoft.SilverlightPlugin.sb:
2620         * Resources/PlugInSandboxProfiles/com.oracle.java.JavaAppletPlugin.sb:
2621         * WebProcess/com.apple.WebProcess.sb.in:
2622
2623 2014-03-14  Simon Fraser  <simon.fraser@apple.com>
2624
2625         [iOS WK2] Improve behavior of fixed elments on zooming
2626         https://bugs.webkit.org/show_bug.cgi?id=130253
2627
2628         Reviewed by Beth Dakin.
2629
2630         Correctly reposition right- and bottom-relative position:fixed
2631         elements on zooming in WK2 iOS by telling the scrolling tree
2632         about zoom-related viewport changes.
2633
2634         * Shared/mac/RemoteLayerTreeTransaction.h:
2635         (WebKit::RemoteLayerTreeTransaction::LayerProperties::notePropertiesChanged):
2636         Drive-by cleanup; typedef the flags field to an unsigned, to avoid ugly casting.
2637         * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp:
2638         (WebKit::RemoteScrollingCoordinatorProxy::updateScrollingTree): Pass out a flag to say
2639         if the update contained a new fixed or sticky layer.
2640         (WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers):
2641         (WebKit::RemoteScrollingCoordinatorProxy::viewportChangedViaDelegatedScrolling):
2642         Call into the new ScrolingTree::viewportChangedViaDelegatedScrolling().
2643         * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h:
2644         * UIProcess/ios/RemoteScrollingCoordinatorProxyIOS.mm: If we got a new fixed
2645         or sticky layer, set fixedOrStickyLayerChanged to true.
2646         (WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers): Ditto.
2647         * UIProcess/ios/WKContentView.mm:
2648         (-[WKContentView didUpdateVisibleRect:unobscuredRect:scale:inStableState:]):
2649         Remember both the old zoomScale and the filteredScale, since the fixed position rect
2650         should be computed using the unfiltered scale.
2651         Some FloatRect -> CGRect changes.
2652         Now call viewportChangedViaDelegatedScrolling() on the scrolling coordinator.
2653         (-[WKContentView fixedPositionRectFromExposedRect:scale:]): Call the
2654         FrameView function to compute the iOS fixed position rect.
2655         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
2656         (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree): If the update
2657         got a new fixed or sticky layer, run the scrolling tree logic to make sure
2658         it gets into the right place.
2659         * UIProcess/mac/RemoteLayerTreeHost.mm:
2660         (WebKit::RemoteLayerTreeHost::updateLayerTree): If we logged here,
2661         we'd log twice if the tiled scrolling indicator was enabled, so 
2662         hoisted the logging out into the caller.
2663
2664 2014-03-14  Landry Breuil  <landry@openbsd.org>
2665
2666         Use the correct type in webkitSoupRequestInputStreamNew()'s declaration.
2667         Nhttps://bugs.webkit.org/show_bug.cgi?id=129974
2668
2669         Reviewed by Andreas Kling.
2670
2671         * WebProcess/soup/WebKitSoupRequestInputStream.h:
2672
2673 2014-03-14  Anders Carlsson  <andersca@apple.com>
2674
2675         Fix crash when resizing the visited link table
2676         https://bugs.webkit.org/show_bug.cgi?id=130257
2677         <rdar://problem/16328177>
2678
2679         Reviewed by Dan Bernstein.
2680
2681         We're iterating over the old table, so use currentTableSize in the loop termination condition.
2682
2683         * UIProcess/VisitedLinkProvider.cpp:
2684         (WebKit::VisitedLinkProvider::resizeTable):
2685
2686 2014-03-14  Dan Bernstein  <mitz@apple.com>
2687
2688         [Cocoa] Expose a way to set the cookie accept policy
2689         https://bugs.webkit.org/show_bug.cgi?id=130251
2690
2691         Reviewed by Anders Carlsson.
2692
2693         * UIProcess/API/Cocoa/WKProcessPool.mm:
2694         (toHTTPCookieAcceptPolicy): Added a helper function that maps from NSHTTPCookieAcceptPolicy
2695         values to WebKit::HTTPCookieAcceptPolicy values.
2696         (-[WKProcessPool _setCookieAcceptPolicy:]): Added. Calls
2697         WebCookieManagerProxy::setHTTPCookieAcceptPolicy. 
2698         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h: Declared new method.
2699
2700 2014-03-14  Carlos Garcia Campos  <cgarcia@igalia.com>
2701
2702         [GTK] WebKit2WebExtension GIR can't be used in vala
2703         https://bugs.webkit.org/show_bug.cgi?id=127179
2704
2705         Reviewed by Martin Robinson.
2706
2707         Do not include all WebKit2 gir symbols from WebKit2WebExtension gir
2708         file.
2709
2710         * GNUmakefile.am:
2711         * PlatformGTK.cmake:
2712
2713 2014-03-14  Csaba Osztrogonác  <ossy@webkit.org>
2714
2715         [CMake] URTBF after r165619.
2716
2717         * CMakeLists.txt: Add new files.
2718
2719 2014-03-14  Anders Carlsson  <andersca@apple.com>
2720
2721         Remove WebContext::addVisitedLink
2722         https://bugs.webkit.org/show_bug.cgi?id=130242
2723
2724         Reviewed by Dan Bernstein.
2725
2726         Fold the function into WKContextAddVisitedLink instead.
2727
2728         * UIProcess/API/C/WKContext.cpp:
2729         (WKContextAddVisitedLink):
2730         * UIProcess/WebContext.cpp:
2731         * UIProcess/WebContext.h:
2732         (WebKit::WebContext::visitedLinkProvider):
2733
2734 2014-03-13  Anders Carlsson  <andersca@apple.com>
2735
2736         Move visited link handling to VisitedLinkTableController and VisitedLinkProvider
2737         https://bugs.webkit.org/show_bug.cgi?id=130223
2738         <rdar://problem/16315792>
2739
2740         Reviewed by Dan Bernstein.
2741
2742         * DerivedSources.make:
2743         Generate messages for VisitedLinkProvider and VisitedLinkTableController.
2744         
2745         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
2746         (-[WKWebViewConfiguration copyWithZone:]):
2747         Set the visited link provider.
2748
2749         * UIProcess/API/Cocoa/_WKVisitedLinkProvider.h:
2750         Add addVisitedLinkWithURL: method.
2751
2752         * UIProcess/API/Cocoa/_WKVisitedLinkProvider.mm:
2753         (-[_WKVisitedLinkProvider addVisitedLinkWithURL:]):
2754         Compute a link hash from the absolute URL string and pass it to the underlying VisitedLinkProvider object.
2755
2756         * UIProcess/VisitedLinkProvider.cpp:
2757         (WebKit::VisitedLinkProvider::addProcess):
2758         Add the process to the m_processes HashCountedSet. If it's the first time we're adding the process, 
2759         add the VisitedLinkProvider object as a message receiver and send the visited link table to the process.
2760
2761         (WebKit::VisitedLinkProvider::removeProcess):
2762         Remove the process from the m_processes HashCountedSet. If we're removing the last reference to the process,
2763         remove ourselves as a  message receiver.
2764
2765         (WebKit::VisitedLinkProvider::addVisitedLinkHash):
2766         Rename this from addVisitedLink to better indicate what it's doing.
2767
2768         (WebKit::tableSizeForKeyCount):
2769         Update for constant rename.
2770
2771         (WebKit::VisitedLinkProvider::pendingVisitedLinksTimerFired):
2772         Compute the new pending visited links table size. If it's bigger than our current table, resize the table
2773         by calling resizeTable. Otherwise, simply try to add the pending hashes to our shared hash table. If successful,
2774         add the link hash to the addedVisitedLinks table and eventually send it to all processes associated with the visited link provider.
2775
2776         (WebKit::VisitedLinkProvider::resizeTable):
2777         Create a new shared memory segment, Set it as the table backing store and add all visited links from the old table. Finally,
2778         add our pending visited link hashes and send the new table memory to all processes associated with the visited link provider.
2779
2780         (WebKit::VisitedLinkProvider::sendTable):
2781         Helper function that creates a shared memory handle and sends it to a given web process.
2782
2783         * UIProcess/VisitedLinkProvider.h:
2784         Add new members.
2785
2786         * UIProcess/VisitedLinkProvider.messages.in:
2787         Add messages.
2788
2789         * UIProcess/WebContext.cpp:
2790         (WebKit::WebContext::processDidFinishLaunching):
2791         (WebKit::WebContext::disconnectProcess):
2792         The WebContext no longer needs to inform the visited link provider about the processes coming and going, that's already handled
2793         by the WebPageProxy objects.
2794
2795         (WebKit::WebContext::addVisitedLink):
2796         Call addVisitedLinkHash on the visited link provider.
2797
2798         * UIProcess/WebContext.h:
2799         * UIProcess/WebContext.messages.in:
2800         Remove a message that is now implemented by the visited link provider.
2801
2802         * WebKit2.xcodeproj/project.pbxproj:
2803         Add new files.
2804
2805         * WebProcess/WebPage/VisitedLinkTableController.cpp:
2806         (WebKit::VisitedLinkTableController::VisitedLinkTableController):
2807         Add the table controller as a message receiver.
2808
2809         (WebKit::VisitedLinkTableController::~VisitedLinkTableController):
2810         Remove the table controller as a message receiver.
2811
2812         (WebKit::VisitedLinkTableController::isLinkVisited):
2813         Check if the link is visited according to the visited link table.
2814
2815         (WebKit::VisitedLinkTableController::addVisitedLink):
2816         Send the link hash to the UI process if it's not already visited.
2817
2818         (WebKit::VisitedLinkTableController::setVisitedLinkTable):
2819         Set the backing store memory and invalidate all styles.
2820
2821         (WebKit::VisitedLinkTableController::visitedLinkStateChanged):
2822         Invalidate the styles for the given links.
2823
2824         (WebKit::VisitedLinkTableController::allVisitedLinkStateChanged):
2825         Invalidate the styles for all links.
2826
2827         * WebProcess/WebPage/VisitedLinkTableController.h:
2828         Add new members.
2829
2830         * WebProcess/WebPage/VisitedLinkTableController.messages.in:
2831         Add new messages.
2832
2833         * WebProcess/WebProcess.cpp:
2834         Remove unused functions; these are handled by VisitedLinkTableController now.
2835
2836         * WebProcess/WebProcess.h:
2837         (WebKit::WebProcess::shouldTrackVisitedLinks):
2838         Add getter.
2839
2840         * WebProcess/WebProcess.messages.in:
2841         Remove messages.
2842
2843 2014-03-12  Sergio Villar Senin  <svillar@igalia.com>
2844
2845         Rename DEFINE_STATIC_LOCAL to DEPRECATED_DEFINE_STATIC_LOCAL
2846         https://bugs.webkit.org/show_bug.cgi?id=129612
2847
2848         Reviewed by Darin Adler.
2849
2850         For new code use static NeverDestroyed<T> instead.
2851
2852         * DatabaseProcess/IndexedDB/sqlite/SQLiteIDBCursor.cpp:
2853         (WebKit::getIndexStatement):
2854         (WebKit::getObjectStoreStatement):
2855         * Shared/linux/SeccompFilters/SeccompBroker.cpp:
2856         (WebKit::SeccompBrokerClient::shared):
2857         * UIProcess/InspectorServer/WebInspectorServer.cpp:
2858         (WebKit::WebInspectorServer::didReceiveWebSocketUpgradeHTTPRequest):
2859
2860 2014-03-14  Dan Bernstein  <mitz@apple.com>
2861
2862         <rdar://problem/16319722> [Cocoa] WKHistoryDelegate is being called for subframes
2863         https://bugs.webkit.org/show_bug.cgi?id=130228
2864
2865         Reviewed by Mark Rowe.
2866
2867         * UIProcess/Cocoa/HistoryClient.mm:
2868         (WebKit::HistoryClient::didNavigateWithNavigationData): Bail out if the frame is not the
2869         main frame.
2870         (WebKit::HistoryClient::didPerformClientRedirect): Ditto.
2871         (WebKit::HistoryClient::didPerformServerRedirect): Ditto.
2872         (WebKit::HistoryClient::didUpdateHistoryTitle): Ditto.
2873
2874 2014-03-13  Jinwoo Jeong  <jw00.jeong@samsung.com>
2875
2876         Refactor Vibration algorithm to use only one timer.
2877         https://bugs.webkit.org/show_bug.cgi?id=130059
2878
2879         Reviewed by Darin Adler.
2880
2881         This patch adds a vibration unit test regression after r161257.
2882         It consists of two short term requests to check
2883         that Vibration could work properly by sequential requests.
2884
2885         Indeed this patch tightens condition of existing tests.
2886
2887         * UIProcess/API/efl/tests/test_ewk2_view.cpp:
2888         (TEST_F):
2889
2890 2014-03-13  Paul Hankes Drielsma  <phd@apple.com>
2891
2892         Add SPI to set a custom user agent on WKWebView
2893         https://bugs.webkit.org/show_bug.cgi?id=130164
2894
2895         Reviewed by Dan Bernstein.
2896
2897         * UIProcess/API/Cocoa/WKWebView.mm:
2898         (-[WKWebView _customUserAgent]):
2899         (-[WKWebView _setCustomUserAgent:]):
2900         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2901
2902 2014-03-13  Paul Hankes Drielsma  <phd@apple.com>
2903
2904         Add SPI to run javascript in main frame on WKWebView
2905         https://bugs.webkit.org/show_bug.cgi?id=130047
2906
2907         Reviewed by Anders Carlsson.
2908
2909         * UIProcess/API/Cocoa/WKWebView.mm:
2910         (-[WKWebView _runJavaScriptInMainFrame:]):
2911
2912 2014-03-13  Benjamin Poulain  <bpoulain@apple.com>
2913
2914         The viewport code should not depend on WebKitSystemInterface
2915         https://bugs.webkit.org/show_bug.cgi?id=130218
2916
2917         Reviewed by Tim Horton.
2918
2919         Get the viewport size from the UIProcess when creating a new WebProcess.
2920         From there, the value is stored in WebPage and used whenever we need to update
2921         the viewport parameters.
2922
2923         * Shared/WebPageCreationParameters.cpp:
2924         (WebKit::WebPageCreationParameters::encode):
2925         (WebKit::WebPageCreationParameters::decode):
2926         * Shared/WebPageCreationParameters.h:
2927         * UIProcess/WebPageProxy.cpp:
2928         (WebKit::WebPageProxy::internalShowContextMenu):
2929         * UIProcess/WebPageProxy.h:
2930         * UIProcess/ios/WebPageProxyIOS.mm:
2931         (WebKit::WebPageProxy::viewportScreenSize):
2932         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2933         (WebKit::WebChromeClient::viewportScreenSize):
2934         * WebProcess/WebCoreSupport/WebChromeClient.h:
2935         * WebProcess/WebPage/WebPage.cpp:
2936         (WebKit::WebPage::WebPage):
2937         * WebProcess/WebPage/WebPage.h:
2938         * WebProcess/WebPage/ios/WebPageIOS.mm:
2939         (WebKit::WebPage::viewportScreenSize):
2940
2941 2014-03-13  Beth Dakin  <bdakin@apple.com>
2942
2943         Do not show extended background during a pinch gesture on iOS
2944         https://bugs.webkit.org/show_bug.cgi?id=130152
2945         -and corresponding-
2946         <rdar://problem/16303819>
2947
2948         Reviewed by Simon Fraser.
2949
2950         This patch refactors the backgroundColor-setting logic into its own method so that 
2951         it can be called from both _didCommitLayerTree and scrollViewDidZoom.
2952
2953         Only set the UIScrollView’s background color when the zoomScale is greater than or 
2954         equal to the minimumZoomScale. Also do not set it during the zoom bounce 
2955         animation. Otherwise, clear the background color by setting it to nil.
2956         * UIProcess/API/Cocoa/WKWebView.mm:
2957         (-[WKWebView updateScrollViewBackground]):
2958         (-[WKWebView _didCommitLayerTree:WebKit::]):
2959         (-[WKWebView scrollViewDidZoom:]):
2960
2961 2014-03-13  Enrica Casucci  <enrica@apple.com>
2962
2963         [iOS WebKit2] block selection should avoid large blocks.
2964         https://bugs.webkit.org/show_bug.cgi?id=130208
2965         <rdar://problem/16251785>
2966
2967         Reviewed by Benjamin Poulain.
2968
2969         When creating a block selection, we should discard blocks that
2970         are larger than most of the visible portion of the document.
2971         This prevents the accidental selection the entire document, which
2972         is fairly common when tapping over empty areas.
2973
2974         * Shared/InteractionInformationAtPosition.cpp:
2975         (WebKit::InteractionInformationAtPosition::encode):
2976         (WebKit::InteractionInformationAtPosition::decode):
2977         * Shared/InteractionInformationAtPosition.h: Removed selectionRects that was not really needed and
2978         added isSelectable to indicate whether the selection can start.
2979         (WebKit::InteractionInformationAtPosition::InteractionInformationAtPosition):
2980         * UIProcess/ios/WKContentViewInteraction.mm:
2981         (-[WKContentView hasSelectablePositionAtPoint:]): Now uses isSelectable.
2982         * WebProcess/WebPage/ios/WebPageIOS.mm:
2983         (WebKit::WebPage::getPositionInformation): Takes into account the userSelect property
2984         to figure out if the element can be selected and discards blocks that are
2985         larger than 97% of the visible area of the document.
2986
2987 2014-03-13  Anders Carlsson  <andersca@apple.com>
2988
2989         Rename WKVisitedLinkProvider to _WKVisitedLinkProvider and make it private
2990         https://bugs.webkit.org/show_bug.cgi?id=130207
2991
2992         Reviewed by Dan Bernstein.
2993
2994         * UIProcess/API/Cocoa/WKVisitedLinkProviderPrivate.h: Removed.
2995         * UIProcess/API/Cocoa/WKWebView.mm:
2996         (-[WKWebView initWithFrame:configuration:]):
2997         * UIProcess/API/Cocoa/WKWebViewConfiguration.h:
2998         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
2999         (-[WKWebViewConfiguration _visitedLinkProvider]):
3000         (-[WKWebViewConfiguration _setVisitedLinkProvider:]):
3001         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
3002         * UIProcess/API/Cocoa/_WKVisitedLinkProvider.h: Renamed from Source/WebKit2/UIProcess/API/Cocoa/WKVisitedLinkProvider.h.
3003         * UIProcess/API/Cocoa/_WKVisitedLinkProvider.mm: Renamed from Source/WebKit2/UIProcess/API/Cocoa/WKVisitedLinkProvider.mm.
3004         (-[_WKVisitedLinkProvider init]):
3005         * UIProcess/API/Cocoa/_WKVisitedLinkProviderInternal.h: Renamed from Source/WebKit2/UIProcess/API/Cocoa/WKVisitedLinkProviderInternal.h.
3006         * WebKit2.xcodeproj/project.pbxproj:
3007
3008 2014-03-13  Anders Carlsson  <andersca@apple.com>
3009
3010         Remove a commented out member function
3011         https://bugs.webkit.org/show_bug.cgi?id=130204
3012
3013         Reviewed by Tim Horton.
3014
3015         * Shared/ChildProcessProxy.h:
3016         (WebKit::ChildProcessProxy::canSendMessage):
3017
3018 2014-03-13  Enrica Casucci  <enrica@apple.com>
3019
3020         [iOS WebKit2] Crash on iPad when displaying a select element with options.
3021         https://bugs.webkit.org/show_bug.cgi?id=130200
3022         <rdar://problem/16316187>
3023
3024         Reviewed by Simon Fraser.
3025
3026         _singleSelectionIndex should be initialized to NSNotFound for multiSelect elements.
3027
3028         * UIProcess/ios/forms/WKFormSelectPopover.mm:
3029         (-[WKSelectTableViewController initWithView:hasGroups:]):
3030
3031 2014-03-13  Carlos Garcia Campos  <cgarcia@igalia.com>
3032
3033         [GTK] Close the connection when we fail to read from the socket for any unhandled error
3034         https://bugs.webkit.org/show_bug.cgi?id=130191
3035
3036         Reviewed by Martin Robinson.
3037
3038         We currently show an error message, but we should close the
3039         connection avoid entering an infinite loop. Also provide more
3040         information in the error message to help when debugging the issue.
3041
3042         * Platform/IPC/unix/ConnectionUnix.cpp:
3043         (IPC::Connection::readyReadHandler):
3044
3045 2014-03-13  Radu Stavila  <stavila@adobe.com>
3046
3047         Webkit not building on XCode 5.1 due to garbage collection no longer being supported
3048         https://bugs.webkit.org/show_bug.cgi?id=130087
3049
3050         Reviewed by Mark Rowe.
3051
3052         Disable garbage collection on macosx when not using internal SDK.
3053
3054         * Configurations/Base.xcconfig:
3055
3056 2014-03-10  Darin Adler  <darin@apple.com>
3057
3058         Avoid copy-prone idiom "for (auto item : collection)"
3059         https://bugs.webkit.org/show_bug.cgi?id=129990
3060
3061         Reviewed by Geoffrey Garen.
3062
3063         * Shared/mac/RemoteLayerTreePropertyApplier.mm:
3064         (WebKit::RemoteLayerTreePropertyApplier::applyProperties): Use auto&.
3065
3066         * Shared/mac/RemoteLayerTreeTransaction.mm:
3067         (WebKit::RemoteLayerTreeTransaction::LayerProperties::decode): Use auto&
3068         even though the type is a scalar. This does no harm and makes it easier
3069         to spot uses that trigger unnecessary copying with grep.
3070         (WebKit::RemoteLayerTreeTransaction::decode): Ditto.
3071         (WebKit::dumpChangedLayers): Ditto.
3072         * UIProcess/mac/RemoteLayerTreeHost.mm:
3073         (WebKit::RemoteLayerTreeHost::updateLayerTree): Ditto.
3074         * WebProcess/WebProcess.cpp:
3075         (WebKit::WebProcess::visitedLinkStateChanged): Ditto.
3076
3077 2014-03-12  Brian Burg  <bburg@apple.com>
3078
3079         Web Inspector: Remove unused callId parameter from evaluateInWebInspector
3080         https://bugs.webkit.org/show_bug.cgi?id=129744
3081
3082         Reviewed by Timothy Hatcher.
3083
3084         * WebProcess/InjectedBundle/API/c/WKBundleInspector.cpp:
3085         (WKBundleInspectorEvaluateScriptForTest):
3086         * WebProcess/InjectedBundle/API/c/WKBundleInspector.h:
3087         * WebProcess/WebPage/WebInspector.cpp:
3088         (WebKit::WebInspector::evaluateScriptForTest):
3089         * WebProcess/WebPage/WebInspector.h:
3090
3091 2014-03-13  Laszlo Vidacs  <lvidacs.u-szeged@partner.samsung.com>
3092
3093         Fix the !ENABLE(SQL_DATABASE) build
3094         https://bugs.webkit.org/show_bug.cgi?id=130130
3095
3096         Reviewed by Csaba Osztrogonác.
3097
3098         Add missing #ifdef guard to typedef.
3099
3100         * UIProcess/API/C/WKDatabaseManager.cpp:
3101
3102 2014-03-12  Dean Jackson  <dino@apple.com>
3103
3104         [WebGL] WebKit1 + WebKit2 iOS clients should check load policy
3105         https://bugs.webkit.org/show_bug.cgi?id=130162
3106
3107         Reviewed by Simon Fraser.
3108
3109         Implement webGLPolicyForURL() methods for iOS.
3110
3111         * Configurations/WebContent-iOS.entitlements: Add the MobileAsset asset type.
3112         * Configurations/WebKit2.xcconfig: Add MobileAsset to iOS link list.
3113         * WebProcess/WebPage/WebPage.cpp: Exclude iOS.
3114         * WebProcess/WebPage/ios/WebPageIOS.mm:
3115         (WebKit::WebPage::webGLPolicyForURL): Call into WKSI.
3116         (WebKit::WebPage::resolveWebGLPolicyForURL):
3117
3118 2014-03-12  Joseph Pecoraro  <pecoraro@apple.com>
3119
3120         Web Inspector: Disable REMOTE_INSPECTOR in earlier OS X releases
3121         https://bugs.webkit.org/show_bug.cgi?id=130118
3122
3123         Reviewed by Timothy Hatcher.
3124
3125         * Configurations/FeatureDefines.xcconfig:
3126
3127 2014-03-12  Enrica Casucci  <enrica@apple.com>
3128
3129         [iOS WebKit2] Crash when trying to select inside a video element with longpress..
3130         https://bugs.webkit.org/show_bug.cgi?id=130095
3131         <rdar://problem/16294534>
3132
3133         Reviewed by Benjamin Poulain.
3134
3135         We only need to set the assisted node for nodes that will receive an
3136         input peripheral (keyboard, picker, popover, etc.).
3137
3138         * WebProcess/WebPage/ios/WebPageIOS.mm:
3139         (WebKit::WebPage::rangeForWebSelectionAtPosition):
3140         (WebKit::WebPage::elementDidFocus):
3141
3142 2014-03-12  Simon Fraser  <simon.fraser@apple.com>
3143
3144         Have the scrolling tree track the viewport size, not the viewport rect
3145         https://bugs.webkit.org/show_bug.cgi?id=130141
3146
3147         Reviewed by Beth Dakin.
3148
3149         The scrolling tree only needs to know the size of the viewport, not its
3150         origin, since the origin is deduced from the updated scroll position.
3151
3152         * Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp:
3153         (ArgumentCoder<ScrollingStateScrollingNode>::encode):
3154         (ArgumentCoder<ScrollingStateScrollingNode>::decode):
3155
3156 2014-03-12  Commit Queue  <commit-queue@webkit.org>
3157
3158         Unreviewed, rolling out r165481.
3159         https://bugs.webkit.org/show_bug.cgi?id=130151
3160
3161         That didn't go well. (Requested by kling on #webkit).
3162
3163         Reverted changeset:
3164
3165         https://bugs.webkit.org/show_bug.cgi?id=130140
3166         http://trac.webkit.org/changeset/165481
3167
3168 2014-03-12  Carlos Garcia Campos  <cgarcia@igalia.com>
3169
3170         [GTK] Runtime error when page is closed while print operation is in progress
3171         https://bugs.webkit.org/show_bug.cgi?id=129869
3172
3173         Reviewed by Anders Carlsson.
3174
3175         Sometimes when the page is closed right after printing the web
3176         process aborts with the runtime message "pure virtual method
3177         called terminate called without an active exception".
3178         This happens because the page is closed when the pages have been
3179         printed, but print job is still ongoing sending the data to the
3180         printer. When print job finishes, we try to notify the UI process
3181         sending the print callback message using WebPage::send(), but the
3182         web page object has been destroyed. The virtual method it complains
3183         about is probably MessageSender::messageSenderDestinationID() used
3184         by send(). Since our print operation is always asynchronous, we
3185         need a way to notify the web page when the print operation has
3186         actually finished to clean it up, but also notify the print
3187         operation when the page has been closed to not try to notify the
3188         UI process in that case.
3189
3190         * WebProcess/WebPage/WebPage.cpp:
3191         (WebKit::WebPage::close): Call disconnectFromPage to notify the
3192         print operation in case there's an ongoing print job.
3193         (WebKit::WebPage::endPrinting): Do not cleanup the print operation
3194         here, since the print opertation might not have finished yet.
3195         (WebKit::WebPage::didFinishPrintOperation): Send
3196         PrintFinishedCallback message to the Ui process and cleanup the
3197         print operation.
3198         * WebProcess/WebPage/WebPage.h:
3199         * WebProcess/WebPage/gtk/WebPrintOperationGtk.cpp:
3200         (WebKit::WebPrintOperationGtk::disconnectFromPage): Set m_webPage
3201         to nullptr.
3202         (WebKit::WebPrintOperationGtk::printDone): Call
3203         didFinishPrintOperation() is the web page hasn't been closed.
3204         * WebProcess/WebPage/gtk/WebPrintOperationGtk.h:
3205
3206 2014-03-12  Andreas Kling  <akling@apple.com>
3207
3208         BundlePageDiagnosticLoggingClient leaks every string passing through it.
3209         <https://webkit.org/b/130140>
3210         <rdar://problem/15416838>
3211
3212         Use toAPI() instead of toCopiedAPI() so the receiving end doesn't need
3213         to worry about adopting the WKStringRef.
3214
3215         Reviewed by Anders Carlsson.
3216
3217         * WebProcess/InjectedBundle/InjectedBundlePageDiagnosticLoggingClient.cpp:
3218         (WebKit::InjectedBundlePageDiagnosticLoggingClient::logDiagnosticMessage):
3219
3220 2014-03-12  Tim Horton  <timothy_horton@apple.com>
3221
3222         Hook up image controls for WebKit1
3223         https://bugs.webkit.org/show_bug.cgi?id=130062
3224         <rdar://problem/15964809>
3225
3226         Reviewed by Brady Eidson.
3227
3228         * Shared/ContextMenuContextData.cpp:
3229         (WebKit::ContextMenuContextData::ContextMenuContextData):
3230
3231 2014-03-11  Alexey Proskuryakov  <ap@apple.com>
3232
3233         REGRESSION (r165356): [Mac] Multi-part key bindings don't work
3234         https://bugs.webkit.org/show_bug.cgi?id=130100
3235
3236         Reviewed by Darin Adler.
3237
3238         Restore the previous behavior, where we only interpreted keydowns (including those
3239         coming through performKeyEquivalent).
3240
3241         In the future, we might send all events to input methods, but not to key bindings.
3242
3243         * UIProcess/API/mac/WKView.mm:
3244         (-[WKView keyUp:]):
3245         (-[WKView flagsChanged:]):
3246
3247 2014-03-11  Beth Dakin  <bdakin@apple.com>
3248
3249         _pageExtendedBackgroundColor should not be exposed on WKWebView
3250         https://bugs.webkit.org/show_bug.cgi?id=130093
3251
3252         Reviewed by Simon Fraser.
3253
3254         Added comment indicating that _pageExtendedBackgroundColor is deprecated.
3255         * UIProcess/API/Cocoa/WKViewPrivate.h:
3256
3257         _pageExtendedBackgroundColor now returns nil, but the conversation functionality 
3258         is maintained with a convenience method pageExtendedBackgroundColor.
3259         * UIProcess/API/Cocoa/WKWebView.mm:
3260         (-[WKWebView pageExtendedBackgroundColor]):
3261         (-[WKWebView _didCommitLayerTree:WebKit::]):
3262         (-[WKWebView _pageExtendedBackgroundColor]):
3263
3264         Added comment indicating that _pageExtendedBackgroundColor is deprecated.
3265         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
3266
3267         Return nil.
3268         * UIProcess/API/ios/WKViewIOS.mm:
3269         (-[WKView _pageExtendedBackgroundColor]):
3270
3271 2014-03-11  Jae Hyun Park  <jaepark@webkit.org>
3272
3273         [GTK][CMake] Add HARFBUZZ_INCLUDE_DIRS to WebKit and WebKit2
3274         https://bugs.webkit.org/show_bug.cgi?id=130070
3275
3276         Reviewed by Martin Robinson.
3277
3278         * PlatformGTK.cmake:
3279
3280 2014-03-10  Dan Bernstein  <mitz@apple.com>
3281
3282         [Cocoa] Expose WebPageProxy::close
3283         https://bugs.webkit.org/show_bug.cgi?id=130068
3284
3285         Reviewed by Adele Peterson.
3286
3287         * UIProcess/API/Cocoa/WKWebView.mm:
3288         (-[WKWebView _close]):
3289         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
3290
3291 2014-03-10  Benjamin Poulain  <bpoulain@apple.com>
3292
3293         [iOS][WebKit 2] Wire the unobscured rect in the WebProcess
3294         https://bugs.webkit.org/show_bug.cgi?id=130058
3295
3296         Reviewed by Simon Fraser.
3297
3298         * WebProcess/WebPage/ios/WebPageIOS.mm:
3299         (WebKit::WebPage::updateVisibleContentRects):
3300
3301 2014-03-10  Simon Fraser  <simon.fraser@apple.com>
3302
3303         Fix three leaks
3304         https://bugs.webkit.org/show_bug.cgi?id=130048
3305
3306         Reviewed by Anders Carlsson.
3307
3308         * Shared/API/Cocoa/WKRemoteObjectCoder.mm:
3309         (decodeObject): Code is simpler and less leaky without the RetainPtr.
3310         * UIProcess/API/Cocoa/WKNavigationAction.mm: Fix _originalURL leak
3311         by making it a RetainPtr and implementing the getter and setter.
3312         (-[WKNavigationAction _setOriginalURL:]):
3313         (-[WKNavigationAction _originalURL]):
3314
3315 2014-03-10  Beth Dakin  <bdakin@apple.com>
3316
3317         Set background color of WK2's UIScrollView to the pageExtendedBackgroundColor
3318         https://bugs.webkit.org/show_bug.cgi?id=129919
3319
3320         Reviewed by Benjamin Poulain.
3321
3322         Make the pageExtendedBackgroundColor part of a RemoteLayerTreeTransaction.
3323         * Shared/mac/RemoteLayerTreeTransaction.h:
3324         (WebKit::RemoteLayerTreeTransaction::pageExtendedBackgroundColor):
3325         (WebKit::RemoteLayerTreeTransaction::setPageExtendedBackgroundColor):
3326         * Shared/mac/RemoteLayerTreeTransaction.mm:
3327         (WebKit::RemoteLayerTreeTransaction::encode):
3328         (WebKit::RemoteLayerTreeTransaction::decode):
3329
3330         Set the background color of the UIScrollView based on the 
3331         pageExtendedBackgroundColor.
3332         * UIProcess/API/Cocoa/WKWebView.mm:
3333         (-[WKWebView _didCommitLayerTree:WebKit::]):
3334
3335         For the sake of PLATFORM(MAC), continue to support the fact that this color can be 
3336         set via a message from the WebProcess or the new RemoteLayerTreeTransaction.
3337         * UIProcess/WebPageProxy.h:
3338
3339         Cache the pageExtendedBackgroundColor as provided by the 
3340         RemoteLayerTreeTransaction.
3341         * UIProcess/ios/WebPageProxyIOS.mm:
3342         (WebKit::WebPageProxy::didCommitLayerTree):
3343
3344         It’s not necessary to do anything here in non-Mac platforms anymore.
3345         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
3346         (WebKit::WebChromeClient::pageExtendedBackgroundColorDidChange):
3347
3348         Include the pageExtendedBackgroundColor in the RemoteLayerTreeTransaction.
3349         * WebProcess/WebPage/WebPage.cpp:
3350         (WebKit::WebPage::willCommitLayerTree):
3351
3352 2014-03-10  Benjamin Poulain  <bpoulain@apple.com>
3353
3354         Generalize unobscured rect to all ports
3355         https://bugs.webkit.org/show_bug.cgi?id=130036
3356
3357         Reviewed by Simon Fraser.
3358
3359         * WebProcess/WebPage/ViewGestureGeometryCollector.cpp:
3360         (WebKit::ViewGestureGeometryCollector::collectGeometryForSmartMagnificationGesture):
3361         (WebKit::ViewGestureGeometryCollector::collectGeometryForMagnificationGesture):
3362         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
3363         (WebKit::TiledCoreAnimationDrawingArea::applyTransientZoomToPage):
3364
3365 2014-03-10  Dan Bernstein  <mitz@apple.com>
3366
3367         <rdar://problem/16278716> [Cocoa] Allow setting a custom group identifier on a WKWebView
3368         https://bugs.webkit.org/show_bug.cgi?id=130033
3369
3370         Reviewed by Tim Horton.
3371
3372         * UIProcess/API/Cocoa/WKWebView.mm:
3373         (-[WKWebView initWithFrame:configuration:]): Create a page group with the group identifier
3374         from the configuration, if it’s non-empty.
3375         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
3376         (-[WKWebViewConfiguration _groupIdentifier]): Added this accessor.
3377         (-[WKWebViewConfiguration _setGroupIdentifier:]): Ditto.
3378         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h: Declared _groupIdentifier property.
3379
3380 2014-03-10  Enrica Casucci  <enrica@apple.com>
3381
3382         WebKit2: Crash in WebPage::getPositionInformation.
3383         https://bugs.webkit.org/show_bug.cgi?id=129936
3384         <rdar://problem/16264550>
3385  
3386         Reviewed by Eric Carlson.
3387  
3388         Missing null check on the node renderer in one code path.
3389         If the page body is smaller than the document, hit testing
3390         will return HTMLHtmlElement that has no renderer.
3391
3392         * WebProcess/WebPage/ios/WebPageIOS.mm:
3393         (WebKit::WebPage::getPositionInformation):
3394
3395 2014-03-10  Martin Robinson  <mrobinson@igalia.com>
3396
3397         [GTK] [CMake] Clean up library linking
3398         https://bugs.webkit.org/show_bug.cgi?id=129782
3399
3400         Reviewed by Philippe Normand.
3401
3402         * PlatformGTK.cmake: Use the new macro.
3403
3404 2014-03-10  Carlos Garcia Campos  <cgarcia@igalia.com>
3405
3406         [GTK] The web process can finish while a print operation is still ongoing
3407         https://bugs.webkit.org/show_bug.cgi?id=129871
3408
3409         Reviewed by Martin Robinson.
3410
3411         This can happen when the last page is closed while the print job
3412         is sending data to the printer.
3413
3414         * WebProcess/WebPage/gtk/WebPrintOperationGtk.cpp: Disable web
3415         process termination when the print job is sending data to the
3416         printer and enable it again when job finishes.
3417
3418 2014-03-09  Jeong Yong-uk  <yong@company100.com>
3419
3420         Update comment in NetworkResourceLoader
3421         https://bugs.webkit.org/show_bug.cgi?id=129997
3422
3423         Reviewed by Andreas Kling.
3424
3425         NetworkResourceLoader::resourceHandleStopped() has been renamed to
3426         NetworkResourceLoader::cleanup() but the comment is not updated.
3427
3428         * NetworkProcess/NetworkResourceLoader.cpp:
3429         (WebKit::NetworkResourceLoader::start):
3430
3431 2014-03-09  Alexey Proskuryakov  <ap@apple.com>
3432
3433         iOS build fix.
3434
3435         * WebProcess/WebPage/ios/WebPageIOS.mm: Include WebCore/KeyboardEvent.h.
3436
3437 2014-03-06  Alexey Proskuryakov  <ap@apple.com>
3438
3439         [Mac] Don't perform a round-trip through WebProcess before interpreting key events
3440         https://bugs.webkit.org/show_bug.cgi?id=129812
3441
3442         Reviewed by Darin Adler.
3443
3444         * Shared/NativeWebKeyboardEvent.h:
3445         * Shared/WebEvent.h:
3446         (WebKit::WebKeyboardEvent::handledByInputMethod):
3447         (WebKit::WebKeyboardEvent::commands):
3448         * Shared/WebEventConversion.cpp:
3449         (WebKit::WebKit2PlatformKeyboardEvent::WebKit2PlatformKeyboardEvent):
3450         * Shared/WebKeyboardEvent.cpp:
3451         (WebKit::WebKeyboardEvent::WebKeyboardEvent):
3452         (WebKit::WebKeyboardEvent::~WebKeyboardEvent):
3453         (WebKit::WebKeyboardEvent::encode):
3454         (WebKit::WebKeyboardEvent::decode):
3455         * Shared/mac/NativeWebKeyboardEventMac.mm:
3456         (WebKit::NativeWebKeyboardEvent::NativeWebKeyboardEvent):
3457         * Shared/mac/WebEventFactory.h:
3458         * Shared/mac/WebEventFactory.mm:
3459         (WebKit::WebEventFactory::createWebKeyboardEvent):
3460         Keyboard events now carry results of interpretation with them.
3461         Ideally, mouse events should also have a handledByInputMethod member, because IMs
3462         can handle events, but that can wait until we have actual bugs caused by not diabling
3463         default processing for these.
3464
3465         * UIProcess/API/mac/WKView.mm:
3466         (-[WKView becomeFirstResponder]): Updated for new NativeWebKeyboardEvent contructor
3467         signature. We don't interpret the event in this code path.
3468         (-[WKView doCommandBySelector:]): Added logging.
3469         (-[WKView performKeyEquivalent:]): Reimplemented Esc and Cmd+period handling to avoid
3470         infinite loops and re-entrancy. These two work in a unique way in AppKit.
3471         Interpret key event before sending it down to WebProcess.
3472         (-[WKView keyUp:]): Interpret key event before sending it down to WebProcess.
3473         We need to tell IMs about the event, but key binding processing is moot, all commands
3474         are executed on keydown.
3475         (-[WKView keyDown:]): Interpret the event.
3476         (-[WKView flagsChanged:]): Ditto.
3477         (-[WKView _interpretKeyEvent:savingCommandsTo:WebCore::]): Added an assertion in
3478         consumedByIM code path.
3479         (-[WKView _executeSavedCommandBySelector:]): Added logging.
3480
3481         * UIProcess/PageClient.h:
3482         * UIProcess/ios/PageClientImplIOS.h:
3483         * UIProcess/ios/PageClientImplIOS.mm:
3484         * UIProcess/mac/PageClientImpl.h:
3485         * UIProcess/mac/PageClientImpl.mm:
3486         * UIProcess/WebPageProxy.h:
3487         * UIProcess/WebPageProxy.messages.in:
3488         * UIProcess/ios/WebPageProxyIOS.mm:
3489         * UIProcess/mac/WebPageProxyMac.mm:
3490         Removed interpretQueuedKeyEvent/interpretKeyEvent, WebProcess no longer asks UIProcess to do this.
3491
3492         * WebProcess/WebCoreSupport/ios/WebEditorClientIOS.mm:
3493         (WebKit::WebEditorClient::handleKeyboardEvent):
3494         * WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm:
3495         (WebKit::WebEditorClient::handleKeyboardEvent):
3496         (WebKit::WebEditorClient::handleInputMethodKeydown):
3497         WebPage::handleEditingKeyboardEvent is now one function instead of two with a boolean
3498         switch between two behaviors.
3499
3500         * WebProcess/WebPage/WebPage.cpp:(WebKit::WebPage::WebPage):
3501         * WebProcess/WebPage/WebPage.h:
3502         Removed m_keyboardEventBeingInterpreted, as we no longer send the event for interpretation.
3503         This means that we sometimes have to pass a null event down to WebCore, but I wasn't
3504         able to find any behavior differences from us doing so.
3505
3506         * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::handleEditingKeyboardEvent):
3507         Added a FIXME.
3508
3509         * WebProcess/WebPage/mac/WebPageMac.mm:
3510         (WebKit::WebPage::executeKeypressCommandsInternal): When we don't have an event,
3511         use current frame as a target, just like input method messages do.
3512         (WebKit::WebPage::handleEditingKeyboardEvent): This function no longer saves commands,
3513         it only interprets them.
3514         Added a check for Esc, as we don't want to handle it in keydown event handler.
3515         (WebKit::WebPage::insertText): Pass 0 instead of m_keyboardEventBeingInterpreted.
3516         (WebKit::WebPage::insertDictatedText): Ditto.
3517         (WebKit::WebPage::executeKeypressCommands): Ditto.