Attempt to fix the EFL and GTK builds after <http://trac.webkit.org/changeset/169711>
[WebKit-https.git] / Source / WebKit2 / ChangeLog
1 2014-06-09  Daniel Bates  <dabates@apple.com>
2
3         Attempt to fix the EFL and GTK builds after <http://trac.webkit.org/changeset/169711>
4         (https://bugs.webkit.org/show_bug.cgi?id=133657)
5
6         Rename Shared/API/c/WKError.cpp to Shared/API/c/WKErrorRef.cpp.
7
8         * CMakeLists.txt:
9
10 2014-06-09  Anders Carlsson  <andersca@apple.com>
11
12         Address review feedback.
13
14         * UIProcess/API/Cocoa/WKWebView.h:
15
16 2014-06-09  Anders Carlsson  <andersca@apple.com>
17
18         Add a WKError.h header and rename the existing WKError.h to WKErrorRef.h
19         https://bugs.webkit.org/show_bug.cgi?id=133657
20
21         Reviewed by Dan Bernstein.
22
23         * Shared/API/Cocoa/WebKit.h:
24         * Shared/API/c/WKErrorRef.cpp: Renamed from Source/WebKit2/Shared/API/c/WKError.cpp.
25         (WKErrorGetTypeID):
26         (WKErrorCopyWKErrorDomain):
27         (WKErrorCopyDomain):
28         (WKErrorGetErrorCode):
29         (WKErrorCopyFailingURL):
30         (WKErrorCopyLocalizedDescription):
31         * Shared/API/c/WKErrorRef.h: Renamed from Source/WebKit2/Shared/API/c/WKError.h.
32         * UIProcess/API/C/WKPage.h:
33         * UIProcess/API/C/WKPageLoaderClient.h:
34         * UIProcess/API/C/WebKit2_C.h:
35         * UIProcess/API/Cocoa/WKError.h: Copied from Source/WebKit2/Shared/API/Cocoa/WebKit.h.
36         * UIProcess/API/Cocoa/WKError.mm: Copied from Source/WebKit2/Shared/API/Cocoa/WebKit.h.
37         * WebKit2.xcodeproj/project.pbxproj:
38         * WebProcess/WebCoreSupport/mac/WebErrorsMac.mm:
39
40 2014-06-09  Brady Eidson  <beidson@apple.com>
41
42         Use different AppKit API for all services menus
43         <rdar://problem/16874403> and https://bugs.webkit.org/show_bug.cgi?id=133649
44
45         Reviewed by Tim Horton.
46
47         * UIProcess/mac/WebContextMenuProxyMac.mm:
48         (WebKit::WebContextMenuProxyMac::showContextMenu):
49
50 2014-06-09  Anders Carlsson  <andersca@apple.com>
51
52         Add WKWindowFeatures.h to the umbrella header.
53
54         Reviewed by Dan Bernstein.
55
56         * Shared/API/Cocoa/WebKit.h:
57
58 2014-06-09  Anders Carlsson  <andersca@apple.com>
59
60         Add -[WKWebView loadHTMLString:baseURL:]
61         https://bugs.webkit.org/show_bug.cgi?id=133645
62         <rdar://problem/17170649>
63
64         Reviewed by Sam Weinig.
65
66         * UIProcess/API/Cocoa/WKWebView.h:
67         * UIProcess/API/Cocoa/WKWebView.mm:
68         (-[WKWebView loadHTMLString:baseURL:]):
69         * UIProcess/Cocoa/NavigationState.h:
70         * UIProcess/Cocoa/NavigationState.mm:
71         (WebKit::NavigationState::createLoadDataNavigation):
72         * UIProcess/WebPageProxy.cpp:
73         (WebKit::WebPageProxy::loadHTMLString):
74         * UIProcess/WebPageProxy.h:
75         * WebProcess/WebPage/WebPage.cpp:
76         (WebKit::WebPage::loadDataImpl):
77         (WebKit::WebPage::loadString):
78         (WebKit::WebPage::loadData):
79         (WebKit::WebPage::loadHTMLString):
80         (WebKit::WebPage::loadAlternateHTMLString):
81         (WebKit::WebPage::loadPlainTextString):
82         (WebKit::WebPage::loadWebArchiveData):
83         * WebProcess/WebPage/WebPage.h:
84         * WebProcess/WebPage/WebPage.messages.in:
85
86 2014-06-09  Simon Fraser  <simon.fraser@apple.com>
87
88         Fix more latched scrolling test flakiness and slowness
89         https://bugs.webkit.org/show_bug.cgi?id=133601
90
91         Reviewed by Brent Fulgham.
92
93         Latched scrolling tests were flakey for two reasons. First, the EventSender
94         wheel events were async from the web to the UI process, and the resulting
95         synthetic events also async from the UI to the web process. Make them sync
96         for testing.
97         
98         Secondly, the timer-based scrolling tree commit could result in the scrolling
99         tree (specifically the frame node's notion of the scrollable area and content
100         size) not being updated before the scrolling thread starts getting wheel events.
101         Fix by having WebPage::wheelEventSyncForTesting() commit if necessary.
102         
103         Finally remove all the now-unnecessary timeouts from the tests.
104
105         * WebProcess/WebPage/WebPage.cpp:
106         (WebKit::WebPage::wheelEventSyncForTesting):
107
108 2014-06-09  Andrzej Badowski  <a.badowski@samsung.com>
109
110         [EFL] Add parameter to MiniBrowser to disable web security
111         https://bugs.webkit.org/show_bug.cgi?id=121095
112
113         Reviewed by Gyuyoung Kim.
114
115         -w (--web-security) commandline allows to disable/enable web security (enabled by default).
116         The reason for this is to test and debug (using, for example, MiniBrowser) scripts accessing
117         resources from other domains (cross-domain requests) such as access map location on another server.
118         Another possibility is to launch in a webkit browser local file tests that will refer to the links
119         in the http website loaded in an iframe. It will not be possible without deactivation of web security.
120
121         * UIProcess/API/efl/ewk_settings.cpp:
122         (ewk_settings_web_security_enabled_set):
123         (ewk_settings_web_security_enabled_get):
124         * UIProcess/API/efl/ewk_settings.h:
125         * UIProcess/API/efl/tests/test_ewk2_settings.cpp:
126         (TEST_F):
127
128 2014-06-08  Sam Weinig  <sam@webkit.org>
129
130         [Cocoa] WKScriptMessage should include the frame the message is from
131         <rdar://problem/17210226>
132         https://bugs.webkit.org/show_bug.cgi?id=133623
133
134         Reviewed by Dan Bernstein.
135
136         * UIProcess/API/Cocoa/WKScriptMessage.h:
137         Add WKFrameInfo property.
138
139         * UIProcess/API/Cocoa/WKScriptMessage.mm:
140         (-[WKScriptMessage _initWithBody:webView:frameInfo:name:]):
141         Add WKFrameInfo to the initializer.
142
143         (-[WKScriptMessage frameInfo]):
144         Implement frameInfo accessor.
145
146         * UIProcess/API/Cocoa/WKScriptMessageInternal.h:
147         Add WKFrameInfo to the initializer.
148
149         * UIProcess/API/Cocoa/WKUserContentController.mm:
150         Pass the WKFrameInfo to the WKScriptMessage initializer.
151
152 2014-06-08  Dan Bernstein  <mitz@apple.com>
153
154         [Cococa] WKWindowFeatures.h is missing from WebKit.framework
155         https://bugs.webkit.org/show_bug.cgi?id=133622
156
157         Reviewed by Sam Weinig.
158
159         * WebKit2.xcodeproj/project.pbxproj: Promoted WKWindowFeatures.h to Public.
160
161 2014-06-08  Dan Bernstein  <mitz@apple.com>
162
163         <rdar://problem/17208234> [Mac] Client-certificate authentication isn’t working when using the modern API
164         https://bugs.webkit.org/show_bug.cgi?id=133617
165
166         Reviewed by Sam Weinig.
167
168         * Shared/WebCoreArgumentCoders.cpp:
169         (IPC::ArgumentCoder<Credential>::encode): Encode certificate credentials on Mac as well.
170         (IPC::ArgumentCoder<Credential>::decode): Decode certificate credentials on Mac as well.
171
172         * Shared/cf/ArgumentCodersCF.cpp:
173         (IPC::encode): Use OS X API for getting a persistent reference to a key.
174         (IPC::decode): Use OS X API for getting a key from a persistent reference.
175
176         * Shared/cf/ArgumentCodersCF.h: Make identity coding available on Mac as well.
177
178 2014-06-07  Anders Carlsson  <andersca@apple.com>
179
180         Get rid of _WKScriptWorld
181         https://bugs.webkit.org/show_bug.cgi?id=133610
182
183         Reviewed by Dan Bernstein.
184
185         * Shared/API/Cocoa/WebKitPrivate.h:
186         * UIProcess/API/Cocoa/_WKScriptWorld.h: Removed.
187         * UIProcess/API/Cocoa/_WKScriptWorld.mm: Removed.
188         * WebKit2.xcodeproj/project.pbxproj:
189
190 2014-05-29  Anders Carlsson  <andersca@apple.com>
191
192         HTTPHeaderMap should not derive from HashMap
193         https://bugs.webkit.org/show_bug.cgi?id=133392
194
195         Reviewed by Darin Adler.
196
197         * Shared/WebCoreArgumentCoders.cpp:
198         (IPC::ArgumentCoder<HTTPHeaderMap>::encode):
199         (IPC::ArgumentCoder<HTTPHeaderMap>::decode):
200
201 2014-06-07  Alexey Proskuryakov  <ap@apple.com>
202
203         [iOS] Fix a path used for sandbox profiles
204         https://bugs.webkit.org/show_bug.cgi?id=133602
205         <rdar://problem/17212011>
206
207         Reviewed by David Kilzer.
208
209         * WebKit2.xcodeproj/project.pbxproj:
210
211 2014-06-06  Enrica Casucci  <enrica@apple.com>
212
213         REGRESSION (iOS WebKit2): backspace key does not repeat beyond a single word.
214         https://bugs.webkit.org/show_bug.cgi?id=133593
215         <rdar://problem/16352228>
216
217         Reviewed by Benjamin Poulain.
218
219         We need to provide a way for the keyboard layer to select from
220         the current position to the beginning of the word moving backwards
221         and implement the method to know when we have reached the beginning of the document.
222
223         * UIProcess/WebPageProxy.h:
224         * UIProcess/ios/WKContentViewInteraction.mm:
225         (-[WKContentView selectWordBackward]):
226         (-[WKContentView _selectionAtDocumentStart]):
227         * UIProcess/ios/WebPageProxyIOS.mm:
228         (WebKit::WebPageProxy::selectWordBackward):
229         * WebProcess/WebPage/WebPage.h:
230         * WebProcess/WebPage/WebPage.messages.in:
231         * WebProcess/WebPage/ios/WebPageIOS.mm:
232         (WebKit::WebPage::selectWordBackward):
233
234 2014-06-06  Enrica Casucci  <enrica@apple.com>
235
236         Adopt the new UIAlertController API to replace UIActionSheet.
237         https://bugs.webkit.org/show_bug.cgi?id=133582
238         <rdar://problem/16845223>
239
240         Reviewed by Joseph Pecoraro.
241
242         UIActionSheet is deprecated. We need to move out action sheets
243         implementation to UIAlertView.
244
245         * UIProcess/API/Cocoa/_WKElementAction.h:
246         * UIProcess/API/Cocoa/_WKElementAction.mm:
247         * UIProcess/ios/WKActionSheet.h:
248         * UIProcess/ios/WKActionSheet.mm:
249         (-[WKActionSheet presentSheetFromRect:]):
250         (-[WKActionSheet doneWithSheet]):
251         (-[WKActionSheet willRotate]):
252         (-[WKActionSheet updateSheetPosition]):
253         (-[WKActionSheet _didRotateAndLayout]):
254         (-[WKActionSheet didRotate]):
255         * UIProcess/ios/WKActionSheetAssistant.h:
256         * UIProcess/ios/WKActionSheetAssistant.mm:
257         (-[WKActionSheetAssistant _createSheetWithElementActions:showLinkTitle:]):
258         (-[WKActionSheetAssistant showImageSheet]):
259         (-[WKActionSheetAssistant showLinkSheet]):
260         (-[WKActionSheetAssistant showDataDetectorsSheet]):
261         (-[WKActionSheetAssistant cleanupSheet]):
262         (-[WKActionSheetAssistant actionSheet:clickedButtonAtIndex:]): Deleted.
263         * UIProcess/ios/WKContentViewInteraction.mm:
264         (-[WKContentView _longPressRecognized:]):
265
266 2014-06-06  Gavin Barraclough  <baraclough@apple.com>
267
268         Should boost ChildProcesses on iOS
269         https://bugs.webkit.org/show_bug.cgi?id=133583
270
271         Reviewed by Sam Weinig.
272
273         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
274         (WebKit::connectToService):
275             - boost all child processes on iOS.
276
277 2014-06-06  Alexey Proskuryakov  <ap@apple.com>
278
279         Build fix after <http://trac.webkit.org/changeset/169655>.
280
281         The SPIs used do not exist on Mac, limit the code to iOS.
282
283         * Shared/Authentication/mac/AuthenticationManager.mac.mm:
284         * Shared/WebCoreArgumentCoders.cpp:
285         (IPC::ArgumentCoder<Credential>::encode):
286         (IPC::ArgumentCoder<Credential>::decode):
287         * Shared/cf/ArgumentCodersCF.cpp:
288         (IPC::typeFromCFTypeRef):
289         (IPC::encode):
290         (IPC::decode):
291         * Shared/cf/ArgumentCodersCF.h:
292
293 2014-06-06  Dan Bernstein  <mitz@apple.com>
294
295         <rdar://problem/17095692> [iOS] Client-certificate authentication isn’t working
296         https://bugs.webkit.org/show_bug.cgi?id=133527
297
298         Reviewed by Darin Adler.
299
300         * Configurations/Network-iOS.entitlements: Enabled the Network process to access the keys
301         needed to create identities to authenticate with.
302
303         * Shared/WebCoreArgumentCoders.cpp:
304         (IPC::ArgumentCoder<Credential>::encode): Encode the credential type, and if it is a client
305         certificate, encode the identity and the certificates.
306         (IPC::ArgumentCoder<Credential>::decode): Decode the credential type. If it is a client
307         certificate, decode the identity and the certificates and use the proper Credential
308         constructor.
309
310         * Shared/cf/ArgumentCodersCF.cpp:
311         (IPC::typeFromCFTypeRef): Handle SecIdentityRef.
312         (IPC::encode): Encode an identity by encoding its certificate and a persistent reference to
313         its key.
314         (IPC::decode): Decode a certificate and a persistent reference to a key, find the key, and
315         create an identity.
316         * Shared/cf/ArgumentCodersCF.h:
317
318 2014-06-05  Benjamin Poulain  <bpoulain@apple.com>
319
320         [iOS][WK2] WebPage sometimes forces two resize events on animated resize
321         https://bugs.webkit.org/show_bug.cgi?id=133534
322
323         Reviewed by Enrica Casucci.
324
325         When I updated the patch for resize events (r168556) to use the unobscured rect in scrollview coordinates,
326         I forgot to update a snippet of code in dynamicViewportSizeUpdate(). Since that code was still using
327         the scaled unobscured rect, there was sometimes a difference of 1 pixel between the size set by that
328         call site and the others.
329
330         This path nukes the bad code and use the unobscured rect in scrollview coordinates given by the UIProcess.
331
332         * WebProcess/WebPage/ios/WebPageIOS.mm:
333         (WebKit::WebPage::dynamicViewportSizeUpdate):
334
335 2014-06-05  Benjamin Poulain  <bpoulain@apple.com>
336
337         [iOS][WK2] Add device orientation
338         https://bugs.webkit.org/show_bug.cgi?id=133530
339         <rdar://problem/16680041>
340
341         Reviewed by Tim Horton.
342
343         Add device orientation for WebKit2.
344
345         For the public API, WKWebView get the updates through the notification UIWindowDidRotateNotification.
346         We do not have any control over how the API is used, but we can expect the size will be updated before
347         the end of rotation in most cases and the events should be sent in the right order.
348
349         For Safari, we use an override to support animated resize (and some tabs corner cases).
350
351         On the WebProcess side, we just get the new orientation directly or on DynamicViewportSizeUpdate.
352
353         * UIProcess/API/Cocoa/WKWebView.mm:
354         (deviceOrientationForUIInterfaceOrientation):
355         (deviceOrientation):
356         (-[WKWebView initWithFrame:configuration:]):
357         (-[WKWebView _windowDidRotate:]):
358         (-[WKWebView _setInterfaceOrientationOverride:]):
359         (-[WKWebView _interfaceOrientationOverride]):
360         (-[WKWebView _beginAnimatedResizeWithUpdates:]):
361         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
362         * UIProcess/WebPageProxy.cpp:
363         (WebKit::WebPageProxy::WebPageProxy):
364         * UIProcess/WebPageProxy.h:
365         (WebKit::WebPageProxy::deviceOrientation):
366         * UIProcess/ios/WebPageProxyIOS.mm:
367         (WebKit::WebPageProxy::dynamicViewportSizeUpdate):
368         (WebKit::WebPageProxy::setDeviceOrientation):
369         * WebProcess/WebCoreSupport/WebChromeClient.h:
370         * WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm:
371         (WebKit::WebChromeClient::deviceOrientation):
372         * WebProcess/WebPage/WebPage.cpp:
373         (WebKit::WebPage::WebPage):
374         * WebProcess/WebPage/WebPage.h:
375         (WebKit::WebPage::deviceOrientation):
376         * WebProcess/WebPage/WebPage.messages.in:
377         * WebProcess/WebPage/ios/WebPageIOS.mm:
378         (WebKit::WebPage::setDeviceOrientation):
379         (WebKit::WebPage::dynamicViewportSizeUpdate):
380
381 2014-06-05  Oliver Hunt  <oliver@apple.com>
382
383         Enable SANDBOX_EXTENSIONS build flag universally on cocoa
384         https://bugs.webkit.org/show_bug.cgi?id=133556
385
386         Reviewed by Alexey Proskuryakov.
387
388         Remove unnecessary iOS exception.
389
390         * WebKit2Prefix.h:
391
392 2014-06-05  Alexey Proskuryakov  <ap@apple.com>
393
394         [Mac] Tweak plug-in sandbox profiles
395         https://bugs.webkit.org/show_bug.cgi?id=133549
396
397         Fix <rdar://problem/17068055> and <rdar://problem/17148837>.
398
399         Reviewed by Sam Weinig and Simon Cooper.
400
401         * Resources/PlugInSandboxProfiles/com.apple.ist.ds.appleconnect.webplugin.sb:
402         * Resources/PlugInSandboxProfiles/com.microsoft.SilverlightPlugin.sb:
403
404 2014-06-05  Tanay C  <tanay.c@samsung.com>
405
406         Resolve compiler error (call of overloaded 'schedule' function is ambiguous) 
407         https://bugs.webkit.org/show_bug.cgi?id=133467
408
409         Reviewed by Carlos Garcia Campos.
410
411         * Shared/Downloads/soup/DownloadSoup.cpp:
412         (WebKit::DownloadClient::handleResponseLater): Explicitly casting second parameter to std::function<void()>
413
414 2014-06-04  Benjamin Poulain  <bpoulain@apple.com>
415
416         [iOS][WK2] Restore the visual scroll position instead of the dom scroll position when restoring states from the history
417         https://bugs.webkit.org/show_bug.cgi?id=133490
418
419         Reviewed by Tim Horton.
420
421         Instead of restoring the scroll position, restore the visual position. This makes pages appear at the same position
422         on screen ignoring changes in the obscured top inset.
423
424         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
425         * WebProcess/WebCoreSupport/ios/WebFrameLoaderClientIOS.mm:
426         (WebKit::WebFrameLoaderClient::saveViewStateToItem):
427         (WebKit::WebFrameLoaderClient::restoreViewState):
428         Save and restore userHasChangedPageScaleFactor to handle rescaling correctly.
429         Limit the scale into valid viewport limits in case the viewport meta tag has changed or the device has rotated.
430
431         * WebProcess/WebPage/WebPage.cpp:
432         (WebKit::WebPage::WebPage):
433         * WebProcess/WebPage/WebPage.h:
434         (WebKit::WebPage::userHasChangedPageScaleFactor):
435         * WebProcess/WebPage/ios/WebPageIOS.mm:
436         (WebKit::WebPage::restorePageState):
437         (WebKit::WebPage::updateVisibleContentRects):
438         In updateVisibleContentRects, we keep track or the current difference between the exposed rect and the unobscured rect.
439         When restoring the page position, we use the current top inset and the saved exposed rect to restore the visual
440         scroll position.
441
442         It is not very robust as it does not resolve races between the two processes, but that is not worse than what we is there now.
443
444 2014-06-03  Timothy Horton  <timothy_horton@apple.com>
445
446         WebKit2 View Gestures (Zoom): Can show unpainted regions when zoom-pinching-out
447         https://bugs.webkit.org/show_bug.cgi?id=133472
448         <rdar://problem/15686848>
449
450         Reviewed by Simon Fraser.
451
452         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
453         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
454         (WebKit::TiledCoreAnimationDrawingArea::flushLayers):
455         (WebKit::TiledCoreAnimationDrawingArea::applyTransientZoomToLayers):
456         (WebKit::TiledCoreAnimationDrawingArea::adjustTransientZoom):
457         Use prepopulateRect() when zooming out to ensure that we have tiles for the current exposed area.
458
459         Factor applyTransientZoomToLayers out of adjustTransientZoom, so that
460         flushLayers can call applyTransientZoomToLayers without ending up calling prepopulateRect()
461         during layer flushing, which causes trouble.
462
463         It is OK to populate layers at the current scale even when zooming out, because the overdraw
464         already covers most of the zoomed out area, and we're only adding a few more tiles at worst.
465
466 2014-06-03  Benjamin Poulain  <bpoulain@apple.com>
467
468         [iOS][WK2] Align the highlight rects with device pixels
469         https://bugs.webkit.org/show_bug.cgi?id=133464
470         <rdar://problem/16708861>
471
472         Reviewed by Enrica Casucci.
473
474         * UIProcess/ios/WKContentViewInteraction.mm:
475         (-[WKContentView _showTapHighlightWithColor:WebCore::quads:WebCore::topLeftRadius:WebCore::topRightRadius:WebCore::bottomLeftRadius:WebCore::bottomRightRadius:WebCore::]):
476
477 2014-06-02  Enrica Casucci  <enrica@apple.com>
478
479         REGRESSION (iOS WebKit2): Single tap in pages with focus on load will clear the selection after the keyboard appears.
480         https://bugs.webkit.org/show_bug.cgi?id=133465
481         <rdar://problem/17059189>
482
483         Reviewed by Benjamin Poulain.
484
485         If a page focuses an input field on load we don't bring the keyboard on screen
486         since the keyboard is only shown when the user interacts with the page with gestures.
487         Still the WebProcess sets the focus and the selection according to the rules.
488         We need to make sure the UI process doesn't accidentally clear this selection
489         when the user starts the interaction with the page.
490         This patch also improves the function that retrieves the autocorrection data
491         to be returned to the keyboard, making sure that we always send back a reply
492         even when we don't have a valid selection.
493
494         * UIProcess/ios/WKContentViewInteraction.mm:
495         (-[WKContentView _singleTapCommited:]):
496         * WebProcess/WebPage/ios/WebPageIOS.mm:
497         (WebKit::WebPage::requestAutocorrectionData):
498
499 2014-05-31  Anders Carlsson  <andersca@apple.com>
500
501         Change DeferrableOneShotTimer to use std::function instead of being a class template
502         https://bugs.webkit.org/show_bug.cgi?id=133423
503
504         Reviewed by Antti Koivisto.
505
506         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
507         (WebKit::NetworkProcess::platformSetCacheModel):
508         * Shared/CacheModel.cpp:
509         (WebKit::calculateCacheSizes):
510         * Shared/CacheModel.h:
511         * WebProcess/Plugins/PluginView.cpp:
512         (WebKit::PluginView::pluginSnapshotTimerFired):
513         * WebProcess/Plugins/PluginView.h:
514         * WebProcess/cocoa/WebProcessCocoa.mm:
515         (WebKit::WebProcess::platformSetCacheModel):
516
517 2014-06-02  Benjamin Poulain  <bpoulain@apple.com>
518
519         [iOS][WK2] Round the UIScrollView content size to device pixel
520         https://bugs.webkit.org/show_bug.cgi?id=133417
521         <rdar://problem/15922440>
522
523         Reviewed by Simon Fraser.
524
525         We should really have the scaled content size floored to device pixels, but that will be for another
526         time.
527         This patch ensure the content size as seen by the API is rounded to device pixels. The value is floored
528         to avoid showing partial pixels when the content is stable.
529
530         * UIProcess/API/Cocoa/WKWebView.mm:
531         (floorFloatToPixels):
532         (roundScrollViewCountentSize):
533         (-[WKWebView _setHasCustomContentView:loadedMIMEType:WTF::]):
534         (-[WKWebView _didCommitLayerTree:WebKit::]):
535         (-[WKWebView scrollView:contentSizeForZoomScale:withProposedSize:]):
536         (-[WKWebView _beginAnimatedResizeWithUpdates:]):
537         (-[WKWebView _endAnimatedResize]):
538
539 2014-06-02  Oliver Hunt  <oliver@apple.com>
540
541         Move ifdef to the right place.
542
543         RS=Enrica
544
545         * WebProcess/cocoa/WebProcessCocoa.mm:
546         (WebKit::WebProcess::initializeSandbox):
547
548 2014-06-02  Gavin Barraclough  <barraclough@apple.com>
549
550         Set default voucher for XPC client processes
551         https://bugs.webkit.org/show_bug.cgi?id=133458
552
553         Reviewed by Geoff Garen.
554
555         * Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.h:
556         (WebKit::XPCServiceInitializer):
557             - add voucher_replace_default_voucher.
558         * config.h:
559             - add HAVE_VOUCHERS.
560
561 2014-06-02  Jeremy Jones  <jeremyj@apple.com>
562
563         Send external playback properties to fullscreen.
564         https://bugs.webkit.org/show_bug.cgi?id=133366
565
566         Reviewed by Simon Fraser.
567
568         Forward setExternalPlayback.
569
570         * UIProcess/ios/WebVideoFullscreenManagerProxy.messages.in: add setExternalPlaybackProperties
571         * WebProcess/ios/WebVideoFullscreenManager.h: add setExternalPlaybackProperties
572         * WebProcess/ios/WebVideoFullscreenManager.mm: add setExternalPlaybackProperties
573         (WebKit::WebVideoFullscreenManager::setExternalPlaybackProperties): added
574
575 2014-06-02  Enrica Casucci  <enrica@apple.com>
576
577         Remove unintentional changes to WKContentViewInteraction.mm
578         introduced in r169500.
579
580         Unreviewed.
581
582         * UIProcess/ios/WKContentViewInteraction.mm:
583         (+[WKAutocorrectionContext autocorrectionContextWithData:markedText:selectedText:afterText:selectedRangeInMarkedText:]):
584
585 2014-06-02  Geoffrey Garen  <ggaren@apple.com>
586
587         Address some review comments on bug 133408
588         https://bugs.webkit.org/show_bug.cgi?id=133410
589
590         Reviewed by Anders Carlsson.
591
592         * UIProcess/API/Cocoa/WKBackForwardListItem.h:
593         * UIProcess/API/Cocoa/WKUIDelegate.h:
594
595 2014-06-02  Dan Bernstein  <mitz@apple.com>
596
597         [Cocoa] -[WKWebView activeURL] is unused
598         https://bugs.webkit.org/show_bug.cgi?id=133440
599
600         Reviewed by Mark Rowe.
601
602         * UIProcess/API/Cocoa/WKWebView.mm:
603         (-[WKWebView activeURL]): Deleted.
604         * UIProcess/API/Cocoa/WKWebViewPrivate.h: Removed the property declaration.
605
606 2014-05-31  Oliver Hunt  <oliver@apple.com>
607
608         Restructure initial distinct sandbox profiles
609         https://bugs.webkit.org/show_bug.cgi?id=133415
610
611         Reviewed by Alexey Proskuryakov.
612
613         Add support for manually instantiating the network and
614         content process sandboxes, and add initial profiles.
615         These profiles are completely generic so we can make sure
616         nothing is broken by enabling them.
617
618         This also adds a target to the WebKit2 project to correctly
619         process the profiles.
620
621         * DatabaseProcess/ios/DatabaseProcessIOS.mm:
622         (WebKit::DatabaseProcess::initializeSandbox):
623         * DatabaseProcess/ios/com.apple.WebKit.DatabasesIOS.sb: Removed.
624         * NetworkProcess/ios/NetworkProcessIOS.mm:
625         (WebKit::NetworkProcess::initializeSandbox):
626         * Resources/SandboxProfiles/ios/com.apple.WebKit.Databases.sb: Added.
627         * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb: Added.
628         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: Added.
629         * WebKit2.xcodeproj/project.pbxproj:
630         * WebProcess/cocoa/WebProcessCocoa.mm:
631         (WebKit::WebProcess::initializeSandbox):
632
633 2014-06-01  Sam Weinig  <sam@webkit.org>
634
635         [Cocoa] Add SPI to get a WebArchive of the WKWebView
636         <rdar://problem/16748120>
637         https://bugs.webkit.org/show_bug.cgi?id=133439
638
639         Reviewed by Anders Carlsson.
640
641         * UIProcess/API/Cocoa/WKWebView.mm:
642         (-[WKWebView _getWebArchiveDataWithCompletionHandler:]):
643         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
644
645 2014-05-31  Anders Carlsson  <andersca@apple.com>
646
647         Add a LazyNeverDestroyed class template and use it
648         https://bugs.webkit.org/show_bug.cgi?id=133425
649
650         Reviewed by Darin Adler.
651
652         * Shared/mac/SecItemShim.cpp:
653         (WebKit::responseMap):
654
655 2014-05-31  Timothy Horton  <timothy_horton@apple.com>
656
657         View snapshots are sometimes taken at the wrong scale
658         https://bugs.webkit.org/show_bug.cgi?id=133419
659         <rdar://problem/17087497>
660
661         Reviewed by Sam Weinig.
662
663         * UIProcess/API/mac/WKView.mm:
664         (-[WKView _takeViewSnapshot]):
665         Work around <rdar://problem/17084993> by re-requesting the snapshot at
666         kCGWindowImageNominalResolution if it was captured at the wrong scale.
667
668 2014-05-31  Dan Bernstein  <mitz@apple.com>
669
670         [iOS] WebKit2.framework is unused
671         https://bugs.webkit.org/show_bug.cgi?id=133424
672
673         Reviewed by Anders Carlsson.
674
675         * Configurations/WebKit2.xcconfig: Set SKIP_INSTALL to YES when targeting iOS.
676
677 2014-05-30  Benjamin Poulain  <bpoulain@apple.com>
678
679         [iOS][WK2] When a page does not finish rotation before the end of the animation, synchronize explicitely
680         https://bugs.webkit.org/show_bug.cgi?id=133364
681         <rdar://problem/17026333>
682
683         Reviewed by Sam Weinig.
684
685         When a page that does layout on rotation does not respond before the end of the animation, we end up with
686         a completely inconsistent state on the UIProcess (because it is unware of the new states).
687
688         The perfect way to fix this would be to make animated resize transactional and have the WebProcess resolve
689         conflicts. That is very complicated and the issue is uncommon, so this patch does not do that.
690
691         This patch force the synchronization whenever we finish the animation before we heard back
692         from the WebProcess.
693
694         * UIProcess/API/Cocoa/WKWebView.mm:
695         (-[WKWebView _endAnimatedResize]):
696         * UIProcess/WebPageProxy.cpp:
697         (WebKit::WebPageProxy::WebPageProxy):
698         (WebKit::WebPageProxy::resetState):
699         * UIProcess/WebPageProxy.h:
700         * UIProcess/ios/WebPageProxyIOS.mm:
701         (WebKit::WebPageProxy::dynamicViewportSizeUpdate):
702         (WebKit::WebPageProxy::synchronizeDynamicViewportUpdate):
703         (WebKit::WebPageProxy::dynamicViewportUpdateChangedTarget):
704         * WebProcess/WebPage/WebPage.h:
705         * WebProcess/WebPage/WebPage.messages.in:
706         * WebProcess/WebPage/ios/WebPageIOS.mm:
707         (WebKit::WebPage::dynamicViewportSizeUpdate):
708         (WebKit::WebPage::synchronizeDynamicViewportUpdate):
709
710 2014-05-30  Enrica Casucci  <enrica@apple.com>
711
712         REGRESSION (WebKit2): space space to insert period doesn't work in web forms.
713         https://bugs.webkit.org/show_bug.cgi?id=133413
714         <rdar://problem/16948333>
715
716         Reviewed by Benjamin Poulain.
717
718         iOS TextInput needs to know about content surrounding the
719         current position while editing. Since we don't want to
720         query this information synchronously when asked, we cache it
721         as part of the EditorState. EditorState now contains a vector of
722         three characters representing the content after, before and two
723         position before the caret position.
724         The patch also replaces all calls to plainText with plainTextReplacingNoBreakSpace
725         to work well with iOS text input.
726
727         * Shared/EditorState.cpp:
728         (WebKit::EditorState::encode):
729         (WebKit::EditorState::decode):
730         * Shared/EditorState.h:
731         (WebKit::EditorState::EditorState):
732         * UIProcess/ios/WKContentViewInteraction.mm:
733         (-[WKContentView _characterInRelationToCaretSelection:]):
734         (+[WKAutocorrectionContext autocorrectionContextWithData:markedText:selectedText:afterText:selectedRangeInMarkedText:]):
735         * WebProcess/WebPage/WebPage.cpp:
736         (WebKit::WebPage::editorState):
737         * WebProcess/WebPage/ios/WebPageIOS.mm:
738         (WebKit::WebPage::requestDictationContext):
739         (WebKit::WebPage::replaceSelectedText):
740         (WebKit::WebPage::replaceDictatedText):
741         (WebKit::WebPage::requestAutocorrectionData):
742         (WebKit::WebPage::syncApplyAutocorrection):
743         (WebKit::computeAutocorrectionContext):
744
745 2014-05-30  Geoffrey Garen  <ggaren@apple.com>
746
747         Fixed the build by adding back a declaration I deleted by accident :(.
748
749         Unreviewed.
750
751         * UIProcess/API/Cocoa/WKWebView.h:
752
753 2014-05-30  Geoffrey Garen  <ggaren@apple.com>
754
755         Unreviewed, rolling in r169490.
756
757         I changed a non-ASCII apostrophe to ASCII.
758
759         Restored changeset:
760
761         "Some more copy-editing of the Modern WebKit headerdoc"
762         https://bugs.webkit.org/show_bug.cgi?id=133408
763         http://trac.webkit.org/changeset/169490
764
765         * UIProcess/API/Cocoa/WKBackForwardList.h:
766         * UIProcess/API/Cocoa/WKBackForwardListItem.h:
767         * UIProcess/API/Cocoa/WKFrameInfo.h:
768         * UIProcess/API/Cocoa/WKNavigation.h:
769         * UIProcess/API/Cocoa/WKNavigationAction.h:
770         (NS_ENUM):
771         * UIProcess/API/Cocoa/WKNavigationDelegate.h:
772         (NS_ENUM):
773         * UIProcess/API/Cocoa/WKNavigationResponse.h:
774         * UIProcess/API/Cocoa/WKPreferences.h:
775         * UIProcess/API/Cocoa/WKProcessPool.h:
776         * UIProcess/API/Cocoa/WKScriptMessage.h:
777         * UIProcess/API/Cocoa/WKScriptMessageHandler.h:
778         * UIProcess/API/Cocoa/WKUIDelegate.h:
779         * UIProcess/API/Cocoa/WKUserContentController.h:
780         * UIProcess/API/Cocoa/WKWebView.h:
781         * UIProcess/API/Cocoa/WKWebViewConfiguration.h:
782
783 2014-05-30  Geoffrey Garen  <ggaren@apple.com>
784
785         Unreviewed, rolling out r169490.
786
787         It broke the build with a mysterious warning about ASCII.
788
789         Reverted changeset:
790
791         "Some more copy-editing of the Modern WebKit headerdoc"
792         https://bugs.webkit.org/show_bug.cgi?id=133408
793         http://trac.webkit.org/changeset/169490
794
795 2014-05-30  Geoffrey Garen  <ggaren@apple.com>
796
797         Some more copy-editing of the Modern WebKit headerdoc
798         https://bugs.webkit.org/show_bug.cgi?id=133408
799
800         Reviewed by Beth Dakin.
801
802         A copy-editor suggested some edits to the headerdoc for clarity,
803         style, and formatting.
804
805         I reviewed the edits and accepted about 80% of them.
806
807         * UIProcess/API/Cocoa/WKBackForwardList.h:
808         * UIProcess/API/Cocoa/WKBackForwardListItem.h:
809         * UIProcess/API/Cocoa/WKFrameInfo.h:
810         * UIProcess/API/Cocoa/WKNavigation.h:
811         * UIProcess/API/Cocoa/WKNavigationAction.h:
812         (NS_ENUM):
813         * UIProcess/API/Cocoa/WKNavigationDelegate.h:
814         (NS_ENUM):
815         * UIProcess/API/Cocoa/WKNavigationResponse.h:
816         * UIProcess/API/Cocoa/WKPreferences.h:
817         * UIProcess/API/Cocoa/WKProcessPool.h:
818         * UIProcess/API/Cocoa/WKScriptMessage.h:
819         * UIProcess/API/Cocoa/WKScriptMessageHandler.h:
820         * UIProcess/API/Cocoa/WKUIDelegate.h:
821         * UIProcess/API/Cocoa/WKUserContentController.h:
822         * UIProcess/API/Cocoa/WKWebView.h:
823         * UIProcess/API/Cocoa/WKWebViewConfiguration.h:
824
825 2014-05-30  Timothy Horton  <timothy_horton@apple.com>
826
827         Crash loading skydrive.com (assertion under RemoteLayerTreeDisplayRefreshMonitor)
828         https://bugs.webkit.org/show_bug.cgi?id=133370
829         <rdar://problem/17061361>
830
831         Reviewed by Darin Adler.
832
833         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
834         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
835         (WebKit::RemoteLayerTreeDrawingArea::RemoteLayerTreeDrawingArea):
836         (WebKit::RemoteLayerTreeDrawingArea::willDestroyDisplayRefreshMonitor):
837         (WebKit::RemoteLayerTreeDrawingArea::didUpdate):
838         Post-landing review comments from Darin noted that checking if the
839         DrawingArea's m_displayRefreshMonitors contains the monitor in the
840         list to notify is insufficient, because a new one could have been
841         added with the same address. Instead, copy the HashSet, removing
842         at random from it and firing didUpdateLayers, but *also* removing
843         from it in the willDestroyDisplayRefreshMonitor callback.
844         This is very similar to what DisplayRefreshMonitor itself does internally
845         (we don't have to duplicate its code to avoid re-entry because it is
846         already impossible to re-enter didUpdate).
847
848 2014-05-29  Anders Carlsson  <andersca@apple.com>
849
850         -[WKProcessPoolConfiguration setCachePartitionedURLSchemes:] should do a deep copy
851         https://bugs.webkit.org/show_bug.cgi?id=133393
852
853         Reviewed by Dan Bernstein.
854
855         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
856         (-[_WKProcessPoolConfiguration setCachePartitionedURLSchemes:]):
857
858 2014-05-29  Mark Lam  <mark.lam@apple.com>
859
860         Restoring FloatingPointEnvironment initialization that was accidentally rolled out by r169176.
861         <https://webkit.org/b/133389>
862
863         Rubber stamped by Oliver Hunt.
864
865         * Shared/ios/ChildProcessIOS.mm:
866         (WebKit::ChildProcess::platformInitialize):
867
868 2014-05-29  Enrica Casucci  <enrica@apple.com>
869
870         Need to notify the keyboard about every KeyDown event.
871         https://bugs.webkit.org/show_bug.cgi?id=133383
872         <rdar://problem/16633975>
873
874         Reviewed by Benjamin Poulain.
875         
876         A key down will generate most of the time a call to the keyboard to add input or delete.
877         But the event could be handled by JavaScript and its default prevented.
878         We need to notify the keyboard in every case to allow updating its internal state about what has been typed.
879
880         * UIProcess/ios/PageClientImplIOS.mm:
881         (WebKit::PageClientImpl::doneWithKeyEvent):
882         * UIProcess/ios/WKContentViewInteraction.h:
883         * UIProcess/ios/WKContentViewInteraction.mm:
884         (-[WKContentView _didHandleKeyEvent:]):
885
886 2014-05-29  Matthew Hanson  <matthew_hanson@apple.com>
887
888         Roll out r169439. <rdar://problem/17069364>
889
890     2014-05-28  Gavin Barraclough  <baraclough@apple.com> 
891
892             viewStateDidChange should always fully update ViewState
893             https://bugs.webkit.org/show_bug.cgi?id=133159
894
895             Reviewed by Anders Carlson.
896
897             Currently WebPageProxy::viewStateDidChange is passed a mask of bits to update.
898
899             This has the following negative consequences:
900              – WKWebView implicitly requires more detailed knowledge of the internal implementation of the PageClient.
901              – Updates may unnecessarily be split over multiple IPC messages.
902              – In order to support partial updates we make multiple virtual function calls to PageClient, which then makes duplicate objc calls. 
903
904             Better to just always update the entire ViewState. 
905
906             * UIProcess/API/Cocoa/WKWebView.mm:
907             (-[WKWebView didMoveToWindow]):
908                 - removed argument to viewStateDidChange.
909             * UIProcess/API/gtk/PageClientImpl.cpp:
910             (WebKit::PageClientImpl::viewState):
911             (WebKit::PageClientImpl::isViewWindowActive): Deleted.
912             (WebKit::PageClientImpl::isViewFocused): Deleted.
913             (WebKit::PageClientImpl::isViewVisible): Deleted.
914             (WebKit::PageClientImpl::isViewInWindow): Deleted.
915             * UIProcess/API/gtk/PageClientImpl.h:
916                 - merged isViewWindowActive/isViewFocused/isViewVisible/isViewInWindow to viewState.
917             * UIProcess/API/mac/WKView.mm:
918             (-[WKView becomeFirstResponder]):
919             (-[WKView resignFirstResponder]):
920             (-[WKView viewDidMoveToWindow]):
921             (-[WKView _windowDidBecomeKey:]):
922             (-[WKView _windowDidResignKey:]):
923             (-[WKView _windowDidMiniaturize:]):
924             (-[WKView _windowDidDeminiaturize:]):
925             (-[WKView _windowDidOrderOffScreen:]):
926             (-[WKView _windowDidOrderOnScreen:]):
927             (-[WKView _windowDidChangeOcclusionState:]):
928             (-[WKView viewDidHide]):
929             (-[WKView viewDidUnhide]):
930             (-[WKView _activeSpaceDidChange:]):
931             (-[WKView _setThumbnailView:]):
932             (-[WKView endDeferringViewInWindowChanges]):
933             (-[WKView endDeferringViewInWindowChangesSync]):
934                 - removed argument to viewStateDidChange.
935             * UIProcess/CoordinatedGraphics/WebView.cpp:
936             (WebKit::WebView::viewState):
937             (WebKit::WebView::isViewWindowActive): Deleted.
938             (WebKit::WebView::isViewFocused): Deleted.
939             (WebKit::WebView::isViewVisible): Deleted.
940             (WebKit::WebView::isViewInWindow): Deleted.
941             * UIProcess/CoordinatedGraphics/WebView.h:
942                 - merged isViewWindowActive/isViewFocused/isViewVisible/isViewInWindow to viewState.
943             * UIProcess/PageClient.h:
944             (WebKit::PageClient::isViewVisibleOrOccluded): Deleted.
945             (WebKit::PageClient::isVisuallyIdle): Deleted.
946                 - merged isViewVisibleOrOccluded/isVisuallyIdle to subclass viewState methods.
947             * UIProcess/WebPageProxy.cpp:
948             (WebKit::WebPageProxy::WebPageProxy):
949             (WebKit::WebPageProxy::reattachToWebProcess):
950                 - updateViewState -> PageClient::viewState
951             (WebKit::WebPageProxy::viewStateDidChange):
952                 - argument removed; updateViewState -> PageClient::viewState.
953             (WebKit::WebPageProxy::setCursor):
954                 - call isViewWindowActive on WebPageProxy, rather than PageClient.
955             (WebKit::WebPageProxy::updateBackingStoreDiscardableState):
956                 - call isViewWindowActive on WebPageProxy, rather than PageClient.
957             (WebKit::WebPageProxy::updateViewState): Deleted.
958                 - removed - viewState method moved to PageClient.
959             * UIProcess/WebPageProxy.h:
960             (WebKit::WebPageProxy::isViewWindowActive):
961                 - added missing implementation.
962             (WebKit::WebPageProxy::isViewVisible):
963                 - removed argument to viewStateDidChange.
964             * UIProcess/WebProcessProxy.cpp:
965             (WebKit::WebProcessProxy::windowServerConnectionStateChanged):
966                 - removed argument to viewStateDidChange.
967             * UIProcess/ios/PageClientImplIOS.h:
968             * UIProcess/ios/PageClientImplIOS.mm:
969             (WebKit::PageClientImpl::viewState):
970             (WebKit::PageClientImpl::isViewWindowActive): Deleted.
971             (WebKit::PageClientImpl::isViewFocused): Deleted.
972             (WebKit::PageClientImpl::isViewVisible): Deleted.
973             (WebKit::PageClientImpl::isViewInWindow): Deleted.
974             (WebKit::PageClientImpl::isViewVisibleOrOccluded): Deleted.
975             (WebKit::PageClientImpl::isVisuallyIdle): Deleted.
976                 - merged isViewWindowActive/isViewFocused/isViewVisible/isViewInWindow to viewState.
977             * UIProcess/ios/WKContentView.mm:
978             (-[WKContentView didMoveToWindow]):
979             (-[WKContentView _applicationDidEnterBackground:]):
980             (-[WKContentView _applicationWillEnterForeground:]):
981                 - removed argument to viewStateDidChange.
982             * UIProcess/mac/PageClientImpl.h:
983             * UIProcess/mac/PageClientImpl.mm:
984             (WebKit::PageClientImpl::viewState):
985             (WebKit::PageClientImpl::showCorrectionPanel):
986             (WebKit::PageClientImpl::showDictationAlternativeUI):
987             (WebKit::PageClientImpl::isViewWindowActive): Deleted.
988             (WebKit::PageClientImpl::isViewFocused): Deleted.
989             (WebKit::PageClientImpl::isViewVisibleOrOccluded): Deleted.
990             (WebKit::PageClientImpl::isVisuallyIdle): Deleted.
991                 - merged isViewWindowActive/isViewFocused/isViewVisible/isViewInWindow to viewState.
992
993 2014-05-29  Dan Bernstein  <mitz@apple.com>
994
995         [Cocoa] Can’t recover from subframe load errors
996         https://bugs.webkit.org/show_bug.cgi?id=133385
997
998         Reviewed by Anders Carlsson.
999
1000         * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h: Declared new delegate method.
1001         * UIProcess/Cocoa/NavigationState.h: Added flag in m_navigationDelegateMethods struct.
1002         * UIProcess/Cocoa/NavigationState.mm:
1003         (WebKit::NavigationState::setNavigationDelegate): Initialize
1004         webViewNavigationDidFailProvisionalLoadInSubframeWithError flag in the delegate methods
1005         struct.
1006         (WebKit::NavigationState::LoaderClient::didFailProvisionalLoadWithErrorForFrame): If the
1007         error occurred in a subframe, invoke the new delegate method.
1008
1009 2014-05-29  Geoffrey Garen  <ggaren@apple.com>
1010
1011         Added a missing @result to WKPreferences headerdoc
1012         https://bugs.webkit.org/show_bug.cgi?id=133381
1013
1014         Reviewed by Dan Bernstein.
1015
1016         * UIProcess/API/Cocoa/WKPreferences.h:
1017
1018 2014-05-29  Alexey Proskuryakov  <ap@apple.com>
1019
1020         [Mac] Always use plug-in sandbox with sandboxed clients
1021         https://bugs.webkit.org/show_bug.cgi?id=133358
1022         <rdar://problem/15637695>
1023
1024         Reviewed by Anders Carlsson.
1025
1026         * PluginProcess/mac/PluginProcessMac.mm: (WebKit::PluginProcess::initializeSandbox):
1027         Refuse to start if parent process is sandboxed, and plug-in process is not going to be.
1028         None of this should run in normal case, because there are also checks on UI process side.
1029         
1030         * Shared/Plugins/PluginModuleInfo.h:
1031         * Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm:
1032         (WebKit::NetscapePluginModule::getPluginInfo):
1033         Added a member to PluginModuleInfo, telling whether the plug-in has a sandbox profile.
1034
1035         * Shared/Plugins/Netscape/mac/PluginInformationMac.mm:
1036         (WebKit::getPlatformPluginModuleInformation): Use the new PluginModuleInfo member,
1037         we no longer need to check the file system here.
1038
1039         * WebKit2.xcodeproj/project.pbxproj:
1040         * Shared/mac/SandboxUtilities.h: Added.
1041         * Shared/mac/SandboxUtilities.cpp: Added. (WebKit::processIsSandboxed):
1042         This code is simple, but include magic is not. Moved it to a separate file to
1043         avoid repeating.
1044
1045         * UIProcess/API/C/mac/WKContextPrivateMac.mm: Removed an unused include.
1046
1047         * UIProcess/Plugins/mac/PluginInfoStoreMac.mm:
1048         (WebKit::PluginInfoStore::shouldUsePlugin): Don't use unsandboxed plug-ins in
1049         sandboxed applications.
1050
1051         * UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
1052         (WebKit::PluginProcessProxy::platformGetLaunchOptions): Don't ever pass disable-sandbox
1053         from sandboxed processes.
1054
1055         * Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.mm:
1056         (WebKit::XPCServiceInitializerDelegate::isClientSandboxed):
1057         Use the new shared code in SandboxUtilities.h.
1058
1059 2014-05-29  Timothy Horton  <timothy_horton@apple.com>
1060
1061         Crash loading skydrive.com (assertion under RemoteLayerTreeDisplayRefreshMonitor)
1062         https://bugs.webkit.org/show_bug.cgi?id=133370
1063         <rdar://problem/17061361>
1064
1065         Reviewed by Anders Carlsson.
1066
1067         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
1068         (WebKit::RemoteLayerTreeDrawingArea::didUpdate):
1069         Copy the set of refresh monitors so that we don't try to mutate the list we're iterating,
1070         and don't try to fire refresh monitors that were removed in a previous iteration of the loop.
1071
1072 2014-05-29  Timothy Horton  <timothy_horton@apple.com>
1073
1074         REGRESSION (iOS WebKit2): Find-in-Page doesn't work in subframes
1075         https://bugs.webkit.org/show_bug.cgi?id=133372
1076         <rdar://problem/17045070>
1077
1078         Reviewed by Simon Fraser.
1079
1080         * WebProcess/WebPage/ios/FindControllerIOS.mm:
1081         (WebKit::FindController::willFindString):
1082         (WebKit::FindController::didFailToFindString):
1083         (WebKit::FindController::didHideFindIndicator):
1084         Flip ignoreCompositionSelectionChange and updateAppearanceEnabled on all
1085         frames, not just the main frame, because the found string can be in a subframe.
1086         Ideally we would flip it on/off for each frame as we move the selection between them,
1087         but would require a lot of work (and the overhead of touching each frame shouldn't be significant).
1088
1089 2014-05-29  Dan Bernstein  <mitz@apple.com>
1090
1091         WKBundleActivateMacFontAscentHack is unused
1092         https://bugs.webkit.org/show_bug.cgi?id=133379
1093
1094         Reviewed by Anders Carlsson.
1095
1096         * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
1097         (WKBundleActivateMacFontAscentHack): Deleted.
1098         * WebProcess/InjectedBundle/API/c/WKBundlePrivate.h:
1099         * WebProcess/InjectedBundle/InjectedBundle.h:
1100         * WebProcess/InjectedBundle/efl/InjectedBundleEfl.cpp:
1101         (WebKit::InjectedBundle::activateMacFontAscentHack): Deleted.
1102         * WebProcess/InjectedBundle/gtk/InjectedBundleGtk.cpp:
1103         (WebKit::InjectedBundle::activateMacFontAscentHack): Deleted.
1104         * WebProcess/InjectedBundle/mac/InjectedBundleMac.mm:
1105         (WebKit::InjectedBundle::activateMacFontAscentHack): Deleted.
1106
1107 2014-05-29  Alexey Proskuryakov  <ap@apple.com>
1108
1109         Add a sandbox profile for com.apple.appstore.CodeRedeemerNetscapePlugin
1110         https://bugs.webkit.org/show_bug.cgi?id=133360
1111
1112         Reviewed by Sam Weinig.
1113
1114         * Resources/PlugInSandboxProfiles/com.apple.WebKit.plugin-common.sb: Looks like
1115         anyone using camera would need access to CoreMedia preferences.
1116
1117         * Resources/PlugInSandboxProfiles/com.apple.appstore.CodeRedeemerNetscapePlugin.sb: Added.
1118
1119         * WebKit2.xcodeproj/project.pbxproj: Added the profile.
1120
1121 2014-05-29  Carlos Garcia Campos  <cgarcia@igalia.com>
1122
1123         [GTK] Add support for HiDPI icons
1124         https://bugs.webkit.org/show_bug.cgi?id=133377
1125
1126         Reviewed by Martin Robinson.
1127
1128         * PlatformGTK.cmake: Compile also the @2x versions for the builtin icons.
1129
1130 2014-05-29  Owen Taylor  <otaylor@redhat.com>
1131
1132         [GTK] Add HighDPI support for non-accelerated compositing contents
1133         https://bugs.webkit.org/show_bug.cgi?id=131562
1134
1135         Reviewed by Anders Carlsson.
1136
1137         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
1138         (deviceScaleFactorChanged): Added this callback to pass scale changes to the page proxy.
1139         (webkitWebViewBaseCreateWebPage): Attach the callback to the notify signal.
1140         * UIProcess/WebPageProxy.cpp:
1141         * UIProcess/cairo/BackingStoreCairo.cpp:
1142         (WebKit::WebPageProxy::setCustomDeviceScaleFactor): Do not set a
1143         custom device scale factor for cairo when it's not supported.
1144         (WebKit::createBackingStoreForGTK): Pass the scale factor to the WebCore backing store.
1145         (WebKit::BackingStore::incorporateUpdate): Ditto.
1146
1147 2014-05-28  Carlos Garcia Campos  <cgarcia@igalia.com>
1148
1149         [GTK] Use GMainLoopSource for idle and timeout sources in WebKit2
1150         https://bugs.webkit.org/show_bug.cgi?id=130081
1151
1152         Reviewed by Martin Robinson.
1153
1154         * Platform/WorkQueue.h:
1155         * Platform/gtk/WorkQueueGtk.cpp:
1156         (WorkQueue::registerSocketEventHandler): Stop pretending it's
1157         possible to register a socket event handler for more than one
1158         descriptor.
1159         (WorkQueue::unregisterSocketEventHandler):
1160         (WorkQueue::dispatch):
1161         (WorkQueue::dispatchAfter):
1162         * Shared/Downloads/soup/DownloadSoup.cpp:
1163         (WebKit::DownloadClient::DownloadClient):
1164         (WebKit::DownloadClient::~DownloadClient):
1165         (WebKit::DownloadClient::didReceiveData):
1166         (WebKit::DownloadClient::handleResponse):
1167         (WebKit::DownloadClient::handleResponseLater):
1168         * UIProcess/Plugins/gtk/PluginInfoCache.cpp:
1169         (WebKit::PluginInfoCache::PluginInfoCache):
1170         (WebKit::PluginInfoCache::~PluginInfoCache):
1171         (WebKit::PluginInfoCache::saveToFile):
1172         (WebKit::PluginInfoCache::updatePluginInfo):
1173         * UIProcess/Plugins/gtk/PluginInfoCache.h:
1174         * WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp:
1175         (WebKit::LayerTreeHostGtk::LayerTreeHostGtk):
1176         (WebKit::LayerTreeHostGtk::layerFlushTimerFired):
1177         (WebKit::LayerTreeHostGtk::scheduleLayerFlush):
1178         (WebKit::LayerTreeHostGtk::cancelPendingLayerFlush):
1179         * WebProcess/WebPage/gtk/LayerTreeHostGtk.h:
1180
1181 2014-05-28  Gavin Barraclough  <baraclough@apple.com>
1182
1183         viewStateDidChange should always fully update ViewState
1184         https://bugs.webkit.org/show_bug.cgi?id=133159
1185
1186         Reviewed by Anders Carlson.
1187
1188         Currently WebPageProxy::viewStateDidChange is passed a mask of bits to update.
1189
1190         This has the following negative consequences:
1191          – WKWebView implicitly requires more detailed knowledge of the internal implementation of the PageClient.
1192          – Updates may unnecessarily be split over multiple IPC messages.
1193          – In order to support partial updates we make multiple virtual function calls to PageClient, which then makes duplicate objc calls.
1194
1195         Better to just always update the entire ViewState.
1196
1197         * UIProcess/API/Cocoa/WKWebView.mm:
1198         (-[WKWebView didMoveToWindow]):
1199             - removed argument to viewStateDidChange.
1200         * UIProcess/API/gtk/PageClientImpl.cpp:
1201         (WebKit::PageClientImpl::viewState):
1202         (WebKit::PageClientImpl::isViewWindowActive): Deleted.
1203         (WebKit::PageClientImpl::isViewFocused): Deleted.
1204         (WebKit::PageClientImpl::isViewVisible): Deleted.
1205         (WebKit::PageClientImpl::isViewInWindow): Deleted.
1206         * UIProcess/API/gtk/PageClientImpl.h:
1207             - merged isViewWindowActive/isViewFocused/isViewVisible/isViewInWindow to viewState.
1208         * UIProcess/API/mac/WKView.mm:
1209         (-[WKView becomeFirstResponder]):
1210         (-[WKView resignFirstResponder]):
1211         (-[WKView viewDidMoveToWindow]):
1212         (-[WKView _windowDidBecomeKey:]):
1213         (-[WKView _windowDidResignKey:]):
1214         (-[WKView _windowDidMiniaturize:]):
1215         (-[WKView _windowDidDeminiaturize:]):
1216         (-[WKView _windowDidOrderOffScreen:]):
1217         (-[WKView _windowDidOrderOnScreen:]):
1218         (-[WKView _windowDidChangeOcclusionState:]):
1219         (-[WKView viewDidHide]):
1220         (-[WKView viewDidUnhide]):
1221         (-[WKView _activeSpaceDidChange:]):
1222         (-[WKView _setThumbnailView:]):
1223         (-[WKView endDeferringViewInWindowChanges]):
1224         (-[WKView endDeferringViewInWindowChangesSync]):
1225             - removed argument to viewStateDidChange.
1226         * UIProcess/CoordinatedGraphics/WebView.cpp:
1227         (WebKit::WebView::viewState):
1228         (WebKit::WebView::isViewWindowActive): Deleted.
1229         (WebKit::WebView::isViewFocused): Deleted.
1230         (WebKit::WebView::isViewVisible): Deleted.
1231         (WebKit::WebView::isViewInWindow): Deleted.
1232         * UIProcess/CoordinatedGraphics/WebView.h:
1233             - merged isViewWindowActive/isViewFocused/isViewVisible/isViewInWindow to viewState.
1234         * UIProcess/PageClient.h:
1235         (WebKit::PageClient::isViewVisibleOrOccluded): Deleted.
1236         (WebKit::PageClient::isVisuallyIdle): Deleted.
1237             - merged isViewVisibleOrOccluded/isVisuallyIdle to subclass viewState methods.
1238         * UIProcess/WebPageProxy.cpp:
1239         (WebKit::WebPageProxy::WebPageProxy):
1240         (WebKit::WebPageProxy::reattachToWebProcess):
1241             - updateViewState -> PageClient::viewState
1242         (WebKit::WebPageProxy::viewStateDidChange):
1243             - argument removed; updateViewState -> PageClient::viewState.
1244         (WebKit::WebPageProxy::setCursor):
1245             - call isViewWindowActive on WebPageProxy, rather than PageClient.
1246         (WebKit::WebPageProxy::updateBackingStoreDiscardableState):
1247             - call isViewWindowActive on WebPageProxy, rather than PageClient.
1248         (WebKit::WebPageProxy::updateViewState): Deleted.
1249             - removed - viewState method moved to PageClient.
1250         * UIProcess/WebPageProxy.h:
1251         (WebKit::WebPageProxy::isViewWindowActive):
1252             - added missing implementation.
1253         (WebKit::WebPageProxy::isViewVisible):
1254             - removed argument to viewStateDidChange.
1255         * UIProcess/WebProcessProxy.cpp:
1256         (WebKit::WebProcessProxy::windowServerConnectionStateChanged):
1257             - removed argument to viewStateDidChange.
1258         * UIProcess/ios/PageClientImplIOS.h:
1259         * UIProcess/ios/PageClientImplIOS.mm:
1260         (WebKit::PageClientImpl::viewState):
1261         (WebKit::PageClientImpl::isViewWindowActive): Deleted.
1262         (WebKit::PageClientImpl::isViewFocused): Deleted.
1263         (WebKit::PageClientImpl::isViewVisible): Deleted.
1264         (WebKit::PageClientImpl::isViewInWindow): Deleted.
1265         (WebKit::PageClientImpl::isViewVisibleOrOccluded): Deleted.
1266         (WebKit::PageClientImpl::isVisuallyIdle): Deleted.
1267             - merged isViewWindowActive/isViewFocused/isViewVisible/isViewInWindow to viewState.
1268         * UIProcess/ios/WKContentView.mm:
1269         (-[WKContentView didMoveToWindow]):
1270         (-[WKContentView _applicationDidEnterBackground:]):
1271         (-[WKContentView _applicationWillEnterForeground:]):
1272             - removed argument to viewStateDidChange.
1273         * UIProcess/mac/PageClientImpl.h:
1274         * UIProcess/mac/PageClientImpl.mm:
1275         (WebKit::PageClientImpl::viewState):
1276         (WebKit::PageClientImpl::showCorrectionPanel):
1277         (WebKit::PageClientImpl::showDictationAlternativeUI):
1278         (WebKit::PageClientImpl::isViewWindowActive): Deleted.
1279         (WebKit::PageClientImpl::isViewFocused): Deleted.
1280         (WebKit::PageClientImpl::isViewVisibleOrOccluded): Deleted.
1281         (WebKit::PageClientImpl::isVisuallyIdle): Deleted.
1282             - merged isViewWindowActive/isViewFocused/isViewVisible/isViewInWindow to viewState.
1283
1284 2014-05-28  Jeffrey Pfau  <jpfau@apple.com>
1285
1286         Add Obj-C API for cache partitioned URL schemes
1287         https://bugs.webkit.org/show_bug.cgi?id=133361
1288         <rdar://problem/17035415>
1289
1290         Reviewed by Anders Carlsson.
1291
1292         * UIProcess/API/Cocoa/WKProcessPool.mm:
1293         (-[WKProcessPool _initWithConfiguration:]):
1294         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
1295         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
1296         (-[_WKProcessPoolConfiguration cachePartitionedURLSchemes]):
1297         (-[_WKProcessPoolConfiguration setCachePartitionedURLSchemes:]):
1298         (-[_WKProcessPoolConfiguration copyWithZone:]):
1299
1300 2014-05-28  Sam Weinig  <sam@webkit.org>
1301
1302         [iOS WebKit2] Sometimes Safari gets into a limbo state after web process crash
1303         <rdar://problem/17029526>
1304         https://bugs.webkit.org/show_bug.cgi?id=133362
1305
1306         Reviewed by Dan Bernstein.
1307
1308         * UIProcess/WebPageProxy.cpp:
1309         (WebKit::WebPageProxy::WebPageProxy):
1310         Remove unnecessary initialization of a unique_ptr.
1311
1312         (WebKit::WebPageProxy::reattachToWebProcess):
1313         Move calls to update the view state and activity tokens to after we have swapped in the new process.
1314
1315         (WebKit::WebPageProxy::resetStateAfterProcessExited):
1316         Clear the activity token on process exit.
1317
1318 2014-05-28  Timothy Horton  <timothy_horton@apple.com>
1319
1320         Add WKWebView SPI to forcefully kill the associated Web process
1321         https://bugs.webkit.org/show_bug.cgi?id=133357
1322
1323         Reviewed by Anders Carlsson.
1324
1325         * UIProcess/API/Cocoa/WKWebView.mm:
1326         (-[WKWebView _killWebContentProcess]):
1327         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1328
1329 2014-05-28  Dan Bernstein  <mitz@apple.com>
1330
1331         [Cocoa] Crash when trying to decode an instance of a class inheriting from WKObject
1332         https://bugs.webkit.org/show_bug.cgi?id=133355
1333
1334         Reviewed by Anders Carlsson.
1335
1336         * Shared/Cocoa/WKObject.mm:
1337         (-[WKObject classForCoder]): Override this NSObject method to forward to the
1338         target object.
1339         (-[WKObject classForKeyedArchiver]): Ditto.
1340
1341 2014-05-28  Simon Fraser  <simon.fraser@apple.com>
1342
1343         [iOS WK2] Improve behavior of position:fixed inside accelerated overflow-scroll
1344         https://bugs.webkit.org/show_bug.cgi?id=133352
1345
1346         Reviewed by Tim Horton.
1347
1348         Pass the correct delta down to descendant nodes.
1349
1350         * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:
1351         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::updateChildNodesAfterScroll):
1352
1353 2014-05-28  Andy Estes  <aestes@apple.com>
1354
1355         [iOS] REGRESSION (r168388): DidNotHandleTapAsClick not sent when commitPotentialTap() fails
1356         https://bugs.webkit.org/show_bug.cgi?id=133349
1357
1358         Reviewed by Benjamin Poulain.
1359
1360         WebPage::commitPotentialTap() fails when a recognized single tap cannot be sent as a synthetic click event.
1361         We should send WebPageProxy::DidNotHandleTapAsClick in these cases.
1362
1363         * WebProcess/WebPage/WebPage.h:
1364         * WebProcess/WebPage/ios/WebPageIOS.mm:
1365         (WebKit::WebPage::commitPotentialTap):
1366         (WebKit::WebPage::commitPotentialTapFailed):
1367
1368 2014-05-28  Commit Queue  <commit-queue@webkit.org>
1369
1370         Unreviewed, rolling out r169423.
1371         https://bugs.webkit.org/show_bug.cgi?id=133348
1372
1373         It makes a lot of tests crash in assert (Requested by KaL on
1374         #webkit).
1375
1376         Reverted changeset:
1377
1378         "[GTK] Use GMainLoopSource for idle and timeout sources in
1379         WebKit2"
1380         https://bugs.webkit.org/show_bug.cgi?id=130081
1381         http://trac.webkit.org/changeset/169423
1382
1383 2014-05-28  Carlos Garcia Campos  <cgarcia@igalia.com>
1384
1385         [GTK] Use GMainLoopSource for idle and timeout sources in WebKit2
1386         https://bugs.webkit.org/show_bug.cgi?id=130081
1387
1388         Reviewed by Martin Robinson.
1389
1390         * Platform/WorkQueue.h:
1391         * Platform/gtk/WorkQueueGtk.cpp:
1392         (WorkQueue::registerSocketEventHandler): Stop pretending it's
1393         possible to register a socket event handler for more than one
1394         descriptor.
1395         (WorkQueue::unregisterSocketEventHandler):
1396         (WorkQueue::dispatch):
1397         (WorkQueue::dispatchAfter):
1398         * Shared/Downloads/soup/DownloadSoup.cpp:
1399         (WebKit::DownloadClient::DownloadClient):
1400         (WebKit::DownloadClient::~DownloadClient):
1401         (WebKit::DownloadClient::didReceiveData):
1402         (WebKit::DownloadClient::handleResponse):
1403         (WebKit::DownloadClient::handleResponseLater):
1404         * UIProcess/Plugins/gtk/PluginInfoCache.cpp:
1405         (WebKit::PluginInfoCache::PluginInfoCache):
1406         (WebKit::PluginInfoCache::~PluginInfoCache):
1407         (WebKit::PluginInfoCache::saveToFile):
1408         (WebKit::PluginInfoCache::updatePluginInfo):
1409         * UIProcess/Plugins/gtk/PluginInfoCache.h:
1410         * WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp:
1411         (WebKit::LayerTreeHostGtk::LayerTreeHostGtk):
1412         (WebKit::LayerTreeHostGtk::layerFlushTimerFired):
1413         (WebKit::LayerTreeHostGtk::scheduleLayerFlush):
1414         (WebKit::LayerTreeHostGtk::cancelPendingLayerFlush):
1415         * WebProcess/WebPage/gtk/LayerTreeHostGtk.h:
1416
1417 2014-05-28  Dan Bernstein  <mitz@apple.com>
1418
1419         [Cocoa] Can't use bundle-defined classes for bundle parameters
1420         https://bugs.webkit.org/show_bug.cgi?id=133339
1421
1422         Reviewed by Anders Carlsson.
1423
1424         Ensure that bundle parameters are decoded only after the injected bundle is loaded.
1425
1426         * WebProcess/InjectedBundle/InjectedBundle.cpp:
1427         (WebKit::InjectedBundle::create): Moved the definition from the header to here, added the
1428         lagacy initializationUserData as a parameter, and made this function set the sandbox
1429         extension and load the bundle.
1430         (WebKit::InjectedBundle::InjectedBundle): Removed call to platformInitialize.
1431         * WebProcess/InjectedBundle/InjectedBundle.h:
1432         (WebKit::InjectedBundle::setSandboxExtension): Deleted.
1433         * WebProcess/InjectedBundle/mac/InjectedBundleMac.mm:
1434         (WebKit::InjectedBundle::initialize): Renamed the load function to this, and added the
1435         creation parameters as a parameter. Moved code to initialize the bundle paramters from
1436         platformInitialize to here. Changed the class passed to -decodeObjectOfClass:forKey: to
1437         NSObject, to allow arbitrary types in the values, and added an assertion that the
1438         top-level object is a dictionary.
1439         (WebKit::InjectedBundle::platformInitialize): Deleted.
1440         * WebProcess/WebProcess.cpp:
1441         (WebKit::WebProcess::initializeWebProcess): Changed to pass the legacy initialization user
1442         data to InjectedBundle::create() and removed code to separately set the sandbox extension
1443         and load the bundle, which is now done by create().
1444
1445 2014-05-28  Alberto Garcia  <berto@igalia.com>
1446
1447         Unreviewed. Fix warning: unused parameter 'frame'
1448
1449         * WebProcess/WebPage/WebPage.cpp:
1450         (WebKit::WebPage::didFinishDocumentLoad):
1451
1452 2014-05-27  Simon Fraser  <simon.fraser@apple.com>
1453
1454         [iOS WK2] Fix behavior of position:sticky inside accelerated overflow-scroll
1455         https://bugs.webkit.org/show_bug.cgi?id=133334
1456         <rdar://problem/16462535>
1457
1458         Reviewed by Tim Horton.
1459
1460         When the scroll position changes in an accelerated overflow-scroll element, we have
1461         to update child nodes in the scrolling tree for position:sticky. That requires a
1462         more generic ability to update the scrolling tree after some arbitrary zoom or
1463         scroll. To do this, we need to know the current fixed position rect, rather than
1464         having it passed in.
1465         
1466         So make the fixed position rect available from ScrollingTree, and make it possible
1467         to get the current scrollPosition() from any ScrollingTreeScrollingNode.
1468         
1469         Also, implement updateLayersAfterDelegatedScroll() in ScrollingTreeOverflowScrollingNodeIOS,
1470         and have it update descendant layers.
1471         
1472         Finally, fix ScrollingTreeOverflowScrollingNode to use the correct rectangle for its
1473         constraints math, using the scroll position of the parent node if appropriate.
1474
1475         * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h:
1476         * UIProcess/Scrolling/RemoteScrollingTree.cpp:
1477         (WebKit::RemoteScrollingTree::fixedPositionRect):
1478         * UIProcess/Scrolling/RemoteScrollingTree.h:
1479         * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.h:
1480         * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:
1481         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::updateLayersAfterDelegatedScroll):
1482         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::updateChildNodesAfterScroll):
1483         * UIProcess/ios/RemoteScrollingCoordinatorProxyIOS.mm:
1484         (WebKit::RemoteScrollingCoordinatorProxy::customFixedPositionRect):
1485
1486 2014-05-27  Simon Fraser  <simon.fraser@apple.com>
1487
1488         Do some renaming in the scrolling tree
1489         https://bugs.webkit.org/show_bug.cgi?id=133333
1490
1491         Reviewed by Tim Horton.
1492         
1493         Rename ScrollingTreeNode::parentScrollPositionDidChange() to updateLayersAfterAncestorChange()
1494         since this goes deep and to indicate that it's about layer updating.
1495         
1496         Also rename the "viewportRect" parameter to "fixedPositionRect", since on iOS
1497         this is the custom fixed-position rect that changes on zooming.
1498
1499         * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp:
1500         (WebKit::RemoteScrollingCoordinatorProxy::viewportChangedViaDelegatedScrolling):
1501         * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h:
1502         * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.h:
1503         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::updateLayersAfterViewportChange):
1504
1505 2014-05-27  Geoffrey Garen  <ggaren@apple.com>
1506
1507         Some proof-reading of the WebKit2 API headerdoc
1508         https://bugs.webkit.org/show_bug.cgi?id=133328
1509
1510         Reviewed by Anders Carlsson.
1511
1512         Consistently say "item" to reference back-forward list items.
1513
1514         Consistently say "webpage" instead of "page" or "web page".
1515
1516         Consistently say "navigation" instead of "load".
1517
1518         Plus a few fix-ups for run-on sentences, mismatched verb tense, and
1519         mismatched singular vs plural.
1520
1521         * UIProcess/API/Cocoa/WKBackForwardList.h:
1522         * UIProcess/API/Cocoa/WKBackForwardListItem.h:
1523         * UIProcess/API/Cocoa/WKBrowsingContextController.h:
1524         * UIProcess/API/Cocoa/WKBrowsingContextGroup.h:
1525         * UIProcess/API/Cocoa/WKFrameInfo.h:
1526         * UIProcess/API/Cocoa/WKNavigation.h:
1527         * UIProcess/API/Cocoa/WKNavigationAction.h:
1528         * UIProcess/API/Cocoa/WKNavigationDelegate.h:
1529         * UIProcess/API/Cocoa/WKProcessPool.h:
1530         * UIProcess/API/Cocoa/WKUIDelegate.h:
1531         * UIProcess/API/Cocoa/WKWebView.h:
1532
1533 2014-05-27  Timothy Horton  <timothy_horton@apple.com>
1534
1535         [wk2] PDFPlugin snapshots are misplaced
1536         https://bugs.webkit.org/show_bug.cgi?id=133323
1537
1538         Reviewed by Simon Fraser.
1539
1540         * WebProcess/Plugins/PDF/PDFPlugin.mm:
1541         (WebKit::PDFPlugin::paintControlForLayerInContext):
1542         (WebKit::PDFPlugin::snapshot):
1543         Include the scroll offset in the snapshot translation,
1544         and use the whole document size instead of just the view size.
1545
1546 2014-05-27  Sam Weinig  <sam@webkit.org>
1547
1548         [WebKit2] Move WebPreferences macro definitions and key names into their own files
1549         https://bugs.webkit.org/show_bug.cgi?id=133315
1550
1551         Reviewed by Anders Carlsson.
1552
1553         * CMakeLists.txt:
1554         * Shared/WebPreferencesDefinitions.h: Copied from Source/WebKit2/Shared/WebPreferencesStore.h.
1555         * Shared/WebPreferencesKeys.cpp: Copied from Source/WebKit2/Shared/WebPreferencesStore.cpp.
1556         * Shared/WebPreferencesKeys.h: Copied from Source/WebKit2/Shared/WebPreferencesStore.h.
1557         * Shared/WebPreferencesStore.cpp:
1558         * Shared/WebPreferencesStore.h:
1559         * UIProcess/WebPreferences.cpp:
1560         * UIProcess/WebPreferences.h:
1561         * UIProcess/mac/WebContextMac.mm:
1562         * UIProcess/mac/WebPreferencesMac.mm:
1563         * UIProcess/mac/WebProcessProxyMac.mm:
1564         * WebKit2.xcodeproj/project.pbxproj:
1565         * WebProcess/InjectedBundle/InjectedBundle.cpp:
1566         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1567         * WebProcess/WebPage/WebPage.cpp:
1568         * WebProcess/WebProcess.cpp:
1569
1570 2014-05-27  Gavin Barraclough  <baraclough@apple.com>
1571
1572         Add UI process watchdog on iOS to ensure WebProcess connections close
1573         https://bugs.webkit.org/show_bug.cgi?id=133200
1574         <rdar://problem/16997983>
1575
1576         Mountain Lion build fix
1577
1578         * Platform/IPC/mac/ConnectionMac.mm:
1579         (IPC::ConnectionTerminationWatchdog::watchdogTimerFired):
1580
1581 2014-05-27  Gavin Barraclough  <baraclough@apple.com>
1582
1583         importance_assertion -> denap_assertion
1584         https://bugs.webkit.org/show_bug.cgi?id=133294
1585
1586         iOS build fix
1587
1588         * Platform/IPC/mac/ConnectionMac.mm:
1589         (IPC::Connection::open):
1590
1591 2014-05-27  Gavin Barraclough  <baraclough@apple.com>
1592
1593         Add UI process watchdog on iOS to ensure WebProcess connections close
1594         https://bugs.webkit.org/show_bug.cgi?id=133200
1595         <rdar://problem/16997983>
1596
1597         Reviewed by Darin Adler.
1598
1599         When the WebProcessProxy wants to disconnect from a WebContent process it just drops the connection,
1600         and hopes the connection closes. There is a watchdog thread in the ChildProcess to try to ensure this
1601         happens.
1602
1603         On iOS the process may not be runnable at the time, preventing termination. Instead add a watchdog in
1604         the UI process to make the process runnable, and to terminate if it doesn't quit in a timely fashion.
1605
1606         * Platform/IPC/Connection.h:
1607             - added terminateSoon.
1608         * Platform/IPC/mac/ConnectionMac.mm:
1609         (IPC::ConnectionTerminationWatchdog::ConnectionTerminationWatchdog):
1610             - take an assertion to make the process runnable, and start a watchdog timer.
1611         (IPC::ConnectionTerminationWatchdog::watchdogTimerFired):
1612             - if the process hasn't quit by the timer the watchdog fires, kill it.
1613         (IPC::Connection::terminateSoon):
1614             - create a ConnectionTerminationWatchdog.
1615         * UIProcess/WebProcessProxy.cpp:
1616         (WebKit::WebProcessProxy::removeWebPage):
1617             - when disconnecting from a process, first tell it to terminateSoon.
1618
1619 2014-05-26  Gavin Barraclough  <barraclough@apple.com>
1620
1621         importance_assertion -> denap_assertion
1622         https://bugs.webkit.org/show_bug.cgi?id=133294
1623
1624         Reviewed by Sam Weinig.
1625
1626         Update in accordance with API change. The importance assertion is used on
1627         Mavericks & newer to ensure the WebContent process wakes from AppNap.
1628
1629         * Platform/IPC/mac/ConnectionMac.mm:
1630         (IPC::Connection::open):
1631             - MACH_PORT_IMPORTANCE_RECEIVER -> MACH_PORT_DENAP_RECEIVER
1632         * Platform/IPC/mac/ImportanceAssertion.h:
1633         (IPC::ImportanceAssertion::ImportanceAssertion):
1634         (IPC::ImportanceAssertion::~ImportanceAssertion):
1635             - proc_importance_assertion -> proc_denap_assertion
1636
1637 2014-05-27  Jessie Berlin  <jberlin@apple.com>
1638
1639         Revert r169362 since it broke the ML build.
1640
1641         * Platform/IPC/Connection.h:
1642         * Platform/IPC/mac/ConnectionMac.mm:
1643         (IPC::ConnectionTerminationWatchdog::createConnectionTerminationWatchdog): Deleted.
1644         (IPC::ConnectionTerminationWatchdog::ConnectionTerminationWatchdog): Deleted.
1645         (IPC::ConnectionTerminationWatchdog::watchdogTimerFired): Deleted.
1646         (IPC::Connection::terminateSoon): Deleted.
1647         * UIProcess/WebProcessProxy.cpp:
1648         (WebKit::WebProcessProxy::removeWebPage):
1649
1650 2014-05-27  Jon Lee  <jonlee@apple.com>
1651
1652         Update ENABLE(MEDIA_SOURCE) on Mac
1653         https://bugs.webkit.org/show_bug.cgi?id=133141
1654
1655         Reviewed by Darin Adler.
1656
1657         * Configurations/FeatureDefines.xcconfig:
1658
1659 2014-05-27  Tibor Meszaros  <tmeszaros.u-szeged@partner.samsung.com>
1660
1661         Remove BLOB guards
1662         https://bugs.webkit.org/show_bug.cgi?id=132863
1663
1664         Reviewed by Csaba Osztrogonác.
1665
1666         * Configurations/FeatureDefines.xcconfig:
1667         * NetworkProcess/FileAPI/NetworkBlobRegistry.cpp:
1668         * NetworkProcess/FileAPI/NetworkBlobRegistry.h:
1669         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1670         (WebKit::NetworkConnectionToWebProcess::didClose):
1671         (WebKit::NetworkConnectionToWebProcess::blobSize):
1672         * NetworkProcess/NetworkConnectionToWebProcess.h:
1673         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
1674         * NetworkProcess/NetworkProcessPlatformStrategies.cpp:
1675         * NetworkProcess/NetworkProcessPlatformStrategies.h:
1676         * NetworkProcess/NetworkResourceLoader.cpp:
1677         (WebKit::NetworkResourceLoader::NetworkResourceLoader):
1678         * WebProcess/FileAPI/BlobRegistryProxy.cpp:
1679         * WebProcess/FileAPI/BlobRegistryProxy.h:
1680         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
1681         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
1682         * WebProcess/WebPage/WebPage.cpp:
1683         (WebKit::WebPage::canHandleRequest):
1684
1685 2014-05-26  Tim Horton  <timothy_horton@apple.com>
1686
1687         [wk2] RemoteLayerBackingStore front buffers should be purgeable when unparented
1688         https://bugs.webkit.org/show_bug.cgi?id=133020
1689         <rdar://problem/16521736>
1690
1691         Reviewed by Simon Fraser.
1692
1693         * Shared/mac/RemoteLayerBackingStore.mm:
1694         (WebKit::RemoteLayerBackingStore::display):
1695         Let the context know whenever a RemoteLayerBackingStore is displayed, so that
1696         RemoteLayerBackingStoreCollection can (if needed) note that the backing store
1697         is active once again (because we only display parented backing store).
1698
1699         (WebKit::RemoteLayerBackingStore::setBufferVolatility):
1700         Ensure that we never have live contexts attached to any buffers when
1701         marking them volatile, because checking isInUse() with live contexts is futile.
1702
1703         * Shared/mac/RemoteLayerBackingStoreCollection.h:
1704         * Shared/mac/RemoteLayerBackingStoreCollection.mm:
1705         (WebKit::RemoteLayerBackingStoreCollection::RemoteLayerBackingStoreCollection):
1706         (WebKit::RemoteLayerBackingStoreCollection::willFlushLayers):
1707         (WebKit::RemoteLayerBackingStoreCollection::willCommitLayerTree):
1708         (WebKit::RemoteLayerBackingStoreCollection::didFlushLayers):
1709         (WebKit::RemoteLayerBackingStoreCollection::backingStoreWillBeDestroyed):
1710         (WebKit::RemoteLayerBackingStoreCollection::backingStoreWillBeDisplayed):
1711         (WebKit::RemoteLayerBackingStoreCollection::markBackingStoreVolatileImmediately):
1712         (WebKit::RemoteLayerBackingStoreCollection::markBackingStoreVolatile):
1713         (WebKit::RemoteLayerBackingStoreCollection::backingStoreBecameUnreachable):
1714         (WebKit::RemoteLayerBackingStoreCollection::volatilityTimerFired):
1715         (WebKit::RemoteLayerBackingStoreCollection::scheduleVolatilityTimer):
1716         (WebKit::RemoteLayerBackingStoreCollection::purgeabilityTimerFired): Deleted.
1717         (WebKit::RemoteLayerBackingStoreCollection::schedulePurgeabilityTimer): Deleted.
1718         Rename purgeable->volatile for accuracy.
1719         Keep track of two sets of backing store: those which are active/parented, and
1720         those which are not. Backing store is moved to the inactive set after building
1721         the transaction in which its owning layer is unparented.
1722         When backing store is unparented, try to mark it volatile immediately. Also,
1723         mark the backing store property as dirty on the owning layer so that when
1724         said layer is reparented, we encode the backing store in the commit that reparents it,
1725         as the UI process will throw away its reference to the backing store when
1726         the layer is unparented. Mark the front buffers of unparented layers as volatile,
1727         in addition to the others.
1728
1729         * Shared/mac/RemoteLayerTreeTransaction.h:
1730         (WebKit::RemoteLayerTreeTransaction::layerIDsWithNewlyUnreachableBackingStore):
1731         * Shared/mac/RemoteLayerTreeTransaction.mm:
1732         (WebKit::RemoteLayerTreeTransaction::encode):
1733         (WebKit::RemoteLayerTreeTransaction::decode):
1734         (WebKit::RemoteLayerTreeTransaction::setLayerIDsWithNewlyUnreachableBackingStore):
1735         Include the list of layers (by ID) with backing store which just became unreachable in the transaction.
1736
1737         * UIProcess/mac/RemoteLayerTreeHost.mm:
1738         (WebKit::RemoteLayerTreeHost::updateLayerTree):
1739         Clear the contents of layers which now have unreachable backing store.
1740         Otherwise, the UI process would hold a 'use' on the IOSurface, and prevent
1741         the Web process from marking it volatile.
1742
1743         * WebProcess/WebPage/mac/RemoteLayerTreeContext.h:
1744         * WebProcess/WebPage/mac/RemoteLayerTreeContext.mm:
1745         (WebKit::RemoteLayerTreeContext::backingStoreWillBeDisplayed):
1746         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
1747         (WebKit::RemoteLayerTreeDrawingArea::flushLayers):
1748         Give RemoteLayerBackingStoreCollection a shot at the RemoteLayerTreeTransaction,
1749         so that it can fill in layerIDsWithNewlyUnreachableBackingStore.
1750         Also, let it know when the flush begins and ends, so that it can keep track
1751         of which layers were reached in the flush.
1752
1753 2014-05-26  Shivakumar JM  <shiva.jm@samsung.com>
1754
1755         [EFL][WK2] Fix EWK2BackForwardListTest test fails.
1756         https://bugs.webkit.org/show_bug.cgi?id=133171
1757
1758         Reviewed by Gyuyoung Kim.
1759
1760         Use local test html pages instead of EWK2UnitTestServer, call ewk_view_url_set() to load test html pages.
1761         Since even after setting no_proxy="localhost,127.0.0.1", still test server was unable to load the test 
1762         html pages for ewk2_back_forward_list tests, so changed to use local html pages.
1763
1764         * UIProcess/API/efl/tests/test_ewk2_back_forward_list.cpp:
1765         (TEST_F):
1766
1767 2014-05-26  Shivakumar JM  <shiva.jm@samsung.com>
1768
1769         [EFL][WK2] Fix code style check errors in EFL API tests.
1770         https://bugs.webkit.org/show_bug.cgi?id=133170
1771
1772         Reviewed by Gyuyoung Kim.
1773
1774         Omit int when using unsigned modifier, as per coding style rules.
1775
1776         * UIProcess/API/efl/tests/UnitTestUtils/EWK2UnitTestBase.cpp:
1777         (EWK2UnitTest::EWK2UnitTestBase::SetUp):
1778         * UIProcess/API/efl/tests/UnitTestUtils/EWK2UnitTestEnvironment.h:
1779         (EWK2UnitTest::EWK2UnitTestEnvironment::defaultWidth):
1780         (EWK2UnitTest::EWK2UnitTestEnvironment::defaultHeight):
1781
1782 2014-05-22  Gavin Barraclough  <baraclough@apple.com>
1783
1784         Add UI process watchdog on iOS to ensure WebProcess connections close
1785         https://bugs.webkit.org/show_bug.cgi?id=133200
1786         <rdar://problem/16997983>
1787
1788         Reviewed by Darin Adler.
1789
1790         When the WebProcessProxy wants to disconnect from a WebContent process it just drops the connection,
1791         and hopes the connection closes. There is a watchdog thread in the ChildProcess to try to ensure this
1792         happens.
1793
1794         On iOS the process may not be runnable at the time, preventing termination. Instead add a watchdog in
1795         the UI process to make the process runnable, and to terminate if it doesn't quit in a timely fashion.
1796
1797         * Platform/IPC/Connection.h:
1798             - added terminateSoon.
1799         * Platform/IPC/mac/ConnectionMac.mm:
1800         (IPC::ConnectionTerminationWatchdog::ConnectionTerminationWatchdog):
1801             - take an assertion to make the process runnable, and start a watchdog timer.
1802         (IPC::ConnectionTerminationWatchdog::watchdogTimerFired):
1803             - if the process hasn't quit by the timer the watchdog fires, kill it.
1804         (IPC::Connection::terminateSoon):
1805             - create a ConnectionTerminationWatchdog.
1806         * UIProcess/WebProcessProxy.cpp:
1807         (WebKit::WebProcessProxy::removeWebPage):
1808             - when disconnecting from a process, first tell it to terminateSoon.
1809
1810 2014-05-26  Sam Weinig  <sam@webkit.org>
1811
1812         [WebKit2] Add better default preferences while keeping backward compatibility for the C-SPI
1813         https://bugs.webkit.org/show_bug.cgi?id=133289
1814
1815         Reviewed by Anders Carlsson.
1816
1817         * Shared/WebPreferencesStore.h:
1818         Change a few defaults:
1819         - PluginsEnabled -> false
1820         - JavaEnabled -> false
1821         - JavaEnabledForLocalFiles -> false
1822         - StorageBlockingPolicy -> BlockThirdPartyStorage
1823
1824         * UIProcess/API/C/WKPreferences.cpp:
1825         (WKPreferencesCreate):
1826         (WKPreferencesCreateWithIdentifier):
1827         * UIProcess/WebPageGroup.cpp:
1828         (WebKit::WebPageGroup::WebPageGroup):
1829         Switch to using WebPreferences::createWithLegacyDefaults().
1830
1831         * UIProcess/WebPreferences.cpp:
1832         (WebKit::WebPreferences::create):
1833         (WebKit::WebPreferences::createWithLegacyDefaults):
1834         * UIProcess/WebPreferences.h:
1835         Move create functions to the cpp file and add createWithLegacyDefaults() which keeps
1836         the old defaults;
1837
1838         * UIProcess/API/C/WKPreferencesRef.h:
1839         Fix the comment.
1840
1841         * UIProcess/API/Cocoa/WKPreferences.h:
1842         Update the comment to reflect the new defaults.
1843
1844         * WebProcess/WebPage/WebPage.cpp:
1845         (WebKit::WebPage::updatePreferences):
1846         Unconditionally set setShouldDispatchJavaScriptWindowOnErrorEvents() to true. This setting only
1847         exists for legacy WebKit.
1848
1849 2014-05-26  Dan Bernstein  <mitz@apple.com>
1850
1851         [Cocoa] Rewrite WK_DESIGNATED_INITIALIZER in installed headers
1852         https://bugs.webkit.org/show_bug.cgi?id=133290
1853
1854         Reviewed by Anders Carlsson.
1855
1856         * Shared/API/Cocoa/WKFoundation.h: When WK_API_AVAILABILITY_ENABLED is defined, don’t
1857         provide definitions of WK_DESIGNATED_INITIALIZER and WK_UNAVAILABLE, since those macros will
1858         be rewritten out of the headers. When WK_API_AVAILABILITY_ENABLED isn’t defined, provide
1859         definitions of the other two macros as appropriate for the target OS.
1860         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h: Removed WK_DESIGNATED_INITIALIZER from a
1861         category method declaration.
1862         * UIProcess/API/Cocoa/WKWebView.h: Mark the superclass designated initializer
1863         -initWithCoder: as unavailable.
1864         * UIProcess/API/Cocoa/WKWebView.mm:
1865         (-[WKWebView initWithCoder:]): Override this designated initializer of the superclass by
1866         returning nil.
1867         * mac/rewrite-availability-macros.sh: Rewrite WK_DESIGNATED_INITIALIZER to
1868         NS_DESIGNATED_INITIALIZER and WK_UNAVAILABLE to NS_UNAVAILABLE. Also make sure to process
1869         all headers if the script has changed since the last time it was run.
1870
1871 2014-05-26  Commit Queue  <commit-queue@webkit.org>
1872
1873         Unreviewed, rolling out r169122.
1874         https://bugs.webkit.org/show_bug.cgi?id=133288
1875
1876         Broke CJK font fallback (Requested by ap on #webkit).
1877
1878         Reverted changeset:
1879
1880         "[Mac] WebProcess doesn't follow localization of UI process
1881         when run as a service"
1882         https://bugs.webkit.org/show_bug.cgi?id=133126
1883         http://trac.webkit.org/changeset/169122
1884
1885 2014-05-26  Anders Carlsson  <andersca@apple.com>
1886
1887         Convert a couple of loops over to range-based for
1888         https://bugs.webkit.org/show_bug.cgi?id=133287
1889
1890         Reviewed by Simon Fraser.
1891
1892         * UIProcess/Plugins/PluginInfoStore.cpp:
1893         (WebKit::PluginInfoStore::findPluginForMIMEType):
1894         (WebKit::PluginInfoStore::findPluginForExtension):
1895         (WebKit::PluginInfoStore::infoForPluginWithPath):
1896         * UIProcess/Plugins/mac/PluginProcessManagerMac.mm:
1897         (WebKit::PluginProcessManager::setProcessSuppressionEnabled):
1898
1899 2014-05-26  Carlos Garcia Campos  <cgarcia@igalia.com>
1900
1901         [GTK] WebProcess leaked when closing pages with network process enabled
1902         https://bugs.webkit.org/show_bug.cgi?id=129684
1903
1904         Reviewed by Anders Carlsson.
1905
1906         The problem is that the web process is not notified when the UI
1907         process closes the connection, because when close() is called on
1908         the socket by the UI process, the socket is shared by another web
1909         process launched later, preventing the connection from being
1910         shut down. We need to set the CLOEXEC flag on the sockets file
1911         descriptor to make sure they are not exposed to other processes.
1912
1913         * Platform/IPC/Connection.h: Add ConnectionOptions parameter to
1914         createPlatformConnection() with a default value compatible with
1915         existing callers.
1916         * Platform/IPC/unix/ConnectionUnix.cpp:
1917         (IPC::Connection::createPlatformConnection): Set the CLOEXEC flag
1918         on the client and server socket file descriptors depending on the
1919         options passed.
1920         * UIProcess/Launcher/gtk/ProcessLauncherGtk.cpp:
1921         (WebKit::ProcessLauncher::launchProcess): Use
1922         IPC::Connection::createPlatformConnection() instead of
1923         socketpair() directly, setting the CLOEXEC flag on the server
1924         before spawning the new process and on the client right after
1925         spawning the new process.
1926
1927 2014-05-25  Anders Carlsson  <andersca@apple.com>
1928
1929         Initialize WKWebViewConfiguration ivars lazily
1930         https://bugs.webkit.org/show_bug.cgi?id=133270
1931         <rdar://problem/17027606>
1932
1933         Reviewed by Sam Weinig.
1934
1935         Create a LazyInitialized class template and use it to lazily initialize WKWebViewConfiguration properties.
1936
1937         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
1938         (LazyInitialized::get):
1939         Initialize m_value with the given function if it hasn't been initialized already.
1940
1941         (LazyInitialized::set):
1942         Update m_value and set m_isInitialized to true.
1943
1944         (LazyInitialized::peek):
1945         Return m_value without initializing it.
1946
1947         (-[WKWebViewConfiguration description]):
1948         Use getters so we'll initialize variables if needed.
1949
1950         (-[WKWebViewConfiguration copyWithZone:]):
1951         Ditto.
1952
1953         (-[WKWebViewConfiguration processPool]):
1954         (-[WKWebViewConfiguration setProcessPool:]):
1955         (-[WKWebViewConfiguration preferences]):
1956         (-[WKWebViewConfiguration setPreferences:]):
1957         (-[WKWebViewConfiguration userContentController]):
1958         (-[WKWebViewConfiguration setUserContentController:]):
1959         (-[WKWebViewConfiguration _visitedLinkProvider]):
1960         (-[WKWebViewConfiguration _setVisitedLinkProvider:]):
1961         (-[WKWebViewConfiguration _websiteDataStore]):
1962         (-[WKWebViewConfiguration _setWebsiteDataStore:]):
1963         (-[WKWebViewConfiguration _contentProviderRegistry]):
1964         (-[WKWebViewConfiguration _setContentProviderRegistry:]):
1965         Pass initialization code to all getters.
1966
1967         (-[WKWebViewConfiguration _validate]):
1968         Use getters.
1969
1970         (-[WKWebViewConfiguration init]): Deleted.
1971
1972 2014-05-26  Martin Hodovan  <mhodovan.u-szeged@partner.samsung.com>
1973
1974         Remove WebKit2 framework from generate-forwarding-headers.pl
1975         https://bugs.webkit.org/show_bug.cgi?id=133214
1976
1977         Since renaming WebKit2.framework to WebKit.framework is done and all WebKit2/*.h includes
1978         were renamed to WebKit/*.h, generating forwarding headers for WebKit2/*.h framework style
1979         headers is not necessary anymore.
1980
1981         Reviewed by Darin Adler.
1982
1983         * Scripts/generate-forwarding-headers.pl:
1984
1985 2014-05-26  Zan Dobersek  <zdobersek@igalia.com>
1986
1987         WebPage::setComposition(), WebPageProxy::didFindStringMatches() should take Vector parameters by const reference
1988         https://bugs.webkit.org/show_bug.cgi?id=133264
1989
1990         Reviewed by Darin Adler.
1991
1992         Taking the Vector parameters in the two methods (invoked through the IPC message handling)
1993         by value causes unnecessary copies. The methods don't modify the objects and don't want
1994         or need fresh copies, hence they should take in const references to Vector objects.
1995
1996         * UIProcess/WebPageProxy.cpp:
1997         (WebKit::WebPageProxy::didFindStringMatches):
1998         * UIProcess/WebPageProxy.h:
1999         * WebProcess/WebPage/WebPage.cpp:
2000         (WebKit::WebPage::setComposition):
2001         * WebProcess/WebPage/WebPage.h:
2002
2003 2014-05-25  Benjamin Poulain  <benjamin@webkit.org>
2004
2005         [iOS][WK2] Fix some state reset on crash on the WKWebView
2006         https://bugs.webkit.org/show_bug.cgi?id=133039
2007
2008         Reviewed by Sam Weinig.
2009
2010         This is in no way complete, but this should reduce the undefined states on crash.
2011
2012         * UIProcess/API/Cocoa/WKWebView.mm:
2013         (-[WKWebView _processDidExit]):
2014         If the view is animating, nuke the resize animation. That should be invisible to the user
2015         because the background color is reset to white below.
2016
2017         Reset the contentView frame and scrollview state.
2018
2019         Reset the runtime states. We do not strictly need to reset _needsResetViewStateAfterCommitLoadForMainFrame,
2020         _delayUpdateVisibleContentRects and _hadDelayedUpdateVisibleContentRects but it seems better to have
2021         a clean slate.
2022
2023         (-[WKWebView _beginAnimatedResizeWithUpdates:]):
2024         (-[WKWebView _endAnimatedResize]):
2025         We could have crashes during rotation. To simplify the reset code, the animated resize code
2026         no longer change any state when WKWebView is using a custom content view.
2027
2028         * UIProcess/API/Cocoa/WKWebViewInternal.h:
2029         * UIProcess/ios/PageClientImplIOS.mm:
2030         (WebKit::PageClientImpl::processDidExit):
2031         Send a _processDidExit on the WKWebView too.
2032
2033 2014-05-25  Anders Carlsson  <andersca@apple.com>
2034
2035         Use the right paths for website data
2036         https://bugs.webkit.org/show_bug.cgi?id=133267
2037         <rdar://problem/17027698>
2038
2039         Reviewed by Sam Weinig.
2040
2041         * UIProcess/API/Cocoa/WKProcessPool.mm:
2042         (-[WKProcessPool _initWithConfiguration:]):
2043         Get the path of the absolute URL.
2044
2045         * UIProcess/Storage/LocalStorageDatabaseTracker.cpp:
2046         (WebKit::LocalStorageDatabaseTracker::databasePath):
2047         Fix spelling error.
2048
2049         * WebProcess/Network/NetworkProcessConnection.cpp:
2050         (WebKit::NetworkProcessConnection::didCacheResource):
2051         Ditto.
2052
2053 2014-05-25  Benjamin Poulain  <bpoulain@apple.com>
2054
2055         [iOS][WK2] Use ScrollView's scrollOffset as the unobscuredContentRect
2056         https://bugs.webkit.org/show_bug.cgi?id=133262
2057
2058         Reviewed by Simon Fraser.
2059
2060         * WebProcess/WebPage/ios/WebPageIOS.mm:
2061         (WebKit::WebPage::dynamicViewportSizeUpdate):
2062         (WebKit::WebPage::viewportConfigurationChanged):
2063         (WebKit::WebPage::updateVisibleContentRects):
2064
2065 2014-05-25  Sam Weinig  <sam@webkit.org>
2066
2067         Build fix 2.
2068
2069         * UIProcess/API/Cocoa/WKPreferences.h:
2070
2071 2014-05-25  Sam Weinig  <sam@webkit.org>
2072
2073         Fix build.
2074
2075         * UIProcess/API/Cocoa/WKPreferences.h:
2076
2077 2014-05-24  Sam Weinig  <sam@webkit.org>
2078
2079         [WebKit2] Rework WebPreferencesStore to allow easier overriding of defaults
2080         https://bugs.webkit.org/show_bug.cgi?id=133258
2081
2082         Reviewed by Anders Carlsson.
2083
2084         To support changing default values of preferences based on which API you are using (either
2085         the legacy C-SPI or the Objective-C API), overhaul the WebPreferencesStore to use a single
2086         HashMap of String -> Value (where Value is new type that can be a String, bool, uint32_t or double)
2087         instead of four HashMaps.  This allows us to use two of these new HashMaps, one for the actual
2088         set values, and one for overridden defaults. This new Value class will also allow easier incremental
2089         updating of preferences in the future.
2090         
2091         Other notable changes:
2092         - Removed Float kind of preferences. There were none.
2093         - Move StorageBlockingPolicy preference to the correct group, it's a uint32_t, not bool.
2094
2095         * Shared/WebPreferencesStore.cpp:
2096         * Shared/WebPreferencesStore.h:
2097
2098 2014-05-25  David Kilzer  <ddkilzer@apple.com>
2099
2100         Add type-checked casts for TransformOperations
2101         <http://webkit.org/b/133217>
2102
2103         Reviewed by Simon Fraser.
2104
2105         * Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.cpp:
2106         (IPC::ArgumentCoder<TransformOperations>::encode):
2107         - Switch to type-checked casts.
2108
2109 2014-05-25  David Kilzer  <ddkilzer@apple.com>
2110
2111         Use type-checking FilterOperation casts in CoordinatedGraphicsArgumentCoders.cpp
2112         <http://webkit.org/b/133203>
2113
2114         Reviewed by Simon Fraser.
2115
2116         * Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.cpp:
2117         (IPC::ArgumentCoder<WebCore::FilterOperations>::encode):
2118         - Replace static_cast<>() operators with type-checking
2119           FilterOperation casts.
2120         - Replace 'default' statement with 'case' statements so new
2121           filters added later require an explicit decision to be made.
2122         (IPC::ArgumentCoder<WebCore::FilterOperations>::decode):
2123         - Replace 'default' statement with 'case' statements so new
2124           filters added later require an explicit decision to be made.
2125
2126 2014-05-24  Jon Honeycutt  <jhoneycutt@apple.com>
2127
2128         Potential null dereference in
2129         WebFrameLoaderClient::dispatchDidFailProvisionalLoad()
2130         <https://bugs.webkit.org/show_bug.cgi?id=133193>
2131
2132         WebFrameLoaderClient::dispatchDidFailProvisionalLoad() calls the
2133         InjectedBundleLoaderClient's didFailProvisionalLoadWithErrorForFrame()
2134         before sending a message to the UI process that a provisional load has
2135         failed. It's possible for the provisional document loader to become
2136         null while calling into the InjectedBundleLoaderClient (as is the case
2137         with the WebKitTestRunner's injected bundle), leading to a null
2138         dereference when trying to send the DidFailProvisionalLoadForFrame
2139         message.
2140
2141         Reviewed by Darin Adler.
2142
2143         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2144         (WebKit::WebFrameLoaderClient::dispatchDidFailProvisionalLoad):
2145         Get the navigation ID before calling into the injected bundle.
2146
2147 2014-05-23  Simon Fraser  <simon.fraser@apple.com>
2148
2149         Rename ScrollingTreeScrollingNode's m_scrollPosition to make it clear that it's the value committed from the state tree
2150         https://bugs.webkit.org/show_bug.cgi?id=133254
2151
2152         Reviewed by Tim Horton.
2153         
2154         Override scrollPosition() on ScrollingTreeOverflowScrollingNodeIOS.
2155
2156         * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.h:
2157         * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:
2158         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::scrollPosition):
2159
2160 2014-05-24  Chris Fleizach  <cfleizach@apple.com>
2161
2162         AX: fix coordinate mapping for iOS accessibility
2163         https://bugs.webkit.org/show_bug.cgi?id=133188
2164
2165         Reviewed by Sam Weinig.
2166
2167         Add in accessibility conversion methods that will check if the methods are present 
2168         (if accessibility is not on, they won't be)
2169         and use those to convert points into the right coordinate space that VoiceOver is expecting.
2170
2171         * UIProcess/PageClient.h:
2172         * UIProcess/WebPageProxy.cpp:
2173         (WebKit::WebPageProxy::accessibilityScreenToRootView):
2174         (WebKit::WebPageProxy::rootViewToAccessibilityScreen):
2175         * UIProcess/WebPageProxy.h:
2176         * UIProcess/WebPageProxy.messages.in:
2177         * UIProcess/ios/PageClientImplIOS.h:
2178         * UIProcess/ios/PageClientImplIOS.mm:
2179         (WebKit::PageClientImpl::accessibilityScreenToRootView):
2180         (WebKit::PageClientImpl::rootViewToAccessibilityScreen):
2181         * UIProcess/mac/PageClientImpl.h:
2182         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2183         (WebKit::WebChromeClient::accessibilityScreenToRootView):
2184         (WebKit::WebChromeClient::rootViewToAccessibilityScreen):
2185         * WebProcess/WebCoreSupport/WebChromeClient.h:
2186         * WebProcess/WebPage/WKAccessibilityWebPageObjectIOS.mm:
2187         (-[WKAccessibilityWebPageObject accessibilityHitTest:]):
2188         * WebProcess/WebPage/WebPage.cpp:
2189         (WebKit::WebPage::accessibilityScreenToRootView):
2190         (WebKit::WebPage::rootViewToAccessibilityScreen):
2191         * WebProcess/WebPage/WebPage.h:
2192
2193 2014-05-24  Carlos Garcia Campos  <cgarcia@igalia.com>
2194
2195         REGRESSION(r165841): Messages sent before the child process is launched are never sent after r165841
2196         https://bugs.webkit.org/show_bug.cgi?id=131675
2197
2198         Reviewed by Anders Carlsson.
2199
2200         Since r165841 the connection is opened after the pending messages
2201         are sent, because connectionWillOpen might send messages that we
2202         want to happen after the ones already pending. The problem is that
2203         Connection::canSendOutgoingMessages() returns false when
2204         connection hasn't been opened. We should ensure no messages are
2205         sent by connectionWillOpen.
2206
2207         * Shared/ChildProcessProxy.cpp:
2208         (WebKit::ChildProcessProxy::didFinishLaunching): Open the
2209         connection before sending pending messages.
2210         * UIProcess/WebPageProxy.cpp:
2211         (WebKit::WebPageProxy::connectionWillOpen): Do not call
2212         VisitedLinkProvider::addProcess() here because it tries to send a
2213         message to the web process, but the connection hasn't be opened yet.
2214         (WebKit::WebPageProxy::processDidFinishLaunching): Call
2215         VisitedLinkProvider::addProcess() here instead.
2216         * UIProcess/WebPageProxy.h:
2217         * UIProcess/WebProcessProxy.cpp:
2218         (WebKit::WebProcessProxy::didFinishLaunching): Call
2219         WebPageProxy::processDidFinishLaunching() for every web page.
2220
2221 2014-05-23  Ian Henderson  <ianh@apple.com>
2222
2223         REGRESSION: Rubberbanding out jumps to top left corner on google.com
2224         https://bugs.webkit.org/show_bug.cgi?id=133253
2225         <rdar://problem/17025664>
2226
2227         Reviewed by Benjamin Poulain.
2228
2229         * UIProcess/API/Cocoa/WKWebView.mm:
2230         (-[WKWebView scrollViewWillEndDragging:withVelocity:targetContentOffset:]):
2231         Avoid deceleration during zooming to work around a UIKit bug.
2232
2233 2014-05-23  Benjamin Poulain  <bpoulain@apple.com>
2234
2235         [iOS][WK2] Avoid updating the view from the viewport configuration unnecessarily
2236         https://bugs.webkit.org/show_bug.cgi?id=133255
2237         <rdar://problem/16890926>
2238
2239         Reviewed by Simon Fraser.
2240
2241         All the updates were mostly harmless since they are pretty cheap, but they can be
2242         very annoying for debugging.
2243
2244         This patch skips viewportUpdates in the trivial cases.
2245
2246         * UIProcess/API/Cocoa/WKWebView.mm:
2247         (-[WKWebView _setMinimumLayoutSizeOverride:]):
2248         (-[WKWebView _setMinimumLayoutSizeOverrideForMinimalUI:]):
2249         * WebProcess/WebPage/WebPage.cpp:
2250         (WebKit::WebPage::mainFrameDidLayout):
2251         * WebProcess/WebPage/ios/WebPageIOS.mm:
2252         (WebKit::WebPage::viewportPropertiesDidChange):
2253
2254 2014-05-23  Benjamin Poulain  <bpoulain@apple.com>
2255
2256         [iOS][WK2] The page scale factor randomly resets to initial scale when editing
2257         https://bugs.webkit.org/show_bug.cgi?id=133244
2258
2259         Reviewed by Enrica Casucci.
2260
2261         We were never telling the WebProcess that zoom is used triggered. As a result, the ViewportConfiguration was free
2262         to reset the scale whenever it felt like it. The fix is to call willStartUserTriggeredZoom before changing the scale.
2263
2264         This patch also split _willStartUserTriggeredScrollingOrZooming from willStartUserTriggeredZoom
2265         and rename it to willStartPanOrPinchGesture. This is just a tiny cleanup since the only thing left in _willStartUserTriggeredScrollingOrZooming
2266         was gesture related.
2267
2268         * UIProcess/API/Cocoa/WKWebView.mm:
2269         (-[WKWebView _zoomToFocusRect:WebCore::selectionRect:WebCore::fontSize:minimumScale:maximumScale:allowScaling:forceScroll:]):
2270         (-[WKWebView scrollViewWillBeginZooming:withView:]):
2271         (-[WKWebView scrollViewWillBeginDragging:]):
2272         * UIProcess/API/Cocoa/WKWebViewInternal.h:
2273         * UIProcess/API/ios/WKViewIOS.mm:
2274         (-[WKView scrollViewWillBeginDragging:]):
2275         * UIProcess/ios/WKContentView.h:
2276         * UIProcess/ios/WKContentView.mm:
2277         (-[WKContentView willStartUserTriggeredZoom]):
2278         (-[WKContentView willStartUserTriggeredScroll]): Deleted.
2279         * UIProcess/ios/WKContentViewInteraction.h:
2280         * UIProcess/ios/WKContentViewInteraction.mm:
2281         (-[WKContentView willStartPanOrPinchGesture]):
2282         (-[WKContentView _willStartUserTriggeredScrollingOrZooming]): Deleted.
2283
2284 2014-05-23  Tim Horton  <timothy_horton@apple.com>
2285
2286         REGRESSION (iOS WebKit2): requestAnimationFrame fires more than once between layer tree commits
2287         https://bugs.webkit.org/show_bug.cgi?id=132794
2288         <rdar://problem/16877909>
2289
2290         Reviewed by Simon Fraser.
2291
2292         * WebKit2.xcodeproj/project.pbxproj:
2293         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2294         (WebKit::WebChromeClient::createDisplayRefreshMonitor):
2295         * WebProcess/WebCoreSupport/WebChromeClient.h:
2296         * WebProcess/WebPage/DrawingArea.h:
2297         (WebKit::DrawingArea::graphicsLayerFactory):
2298         (WebKit::DrawingArea::createDisplayRefreshMonitor):
2299         Plumb the DisplayRefreshMonitor request through to the DrawingArea.
2300         RemoteLayerTreeDrawingArea will implement and return a RemoteLayerTreeDisplayRefreshMonitor.
2301
2302         * WebProcess/WebPage/Cocoa/RemoteLayerTreeDisplayRefreshMonitor.h: Added.
2303         (WebKit::RemoteLayerTreeDisplayRefreshMonitor::create):
2304         * WebProcess/WebPage/Cocoa/RemoteLayerTreeDisplayRefreshMonitor.mm: Added.
2305         (WebKit::RemoteLayerTreeDisplayRefreshMonitor::RemoteLayerTreeDisplayRefreshMonitor):
2306         (WebKit::RemoteLayerTreeDisplayRefreshMonitor::~RemoteLayerTreeDisplayRefreshMonitor):
2307         (WebKit::RemoteLayerTreeDisplayRefreshMonitor::requestRefreshCallback):
2308         When requesting a display refresh callback, schedule a layer commit.
2309         It may end up being empty, but will still call us back with a didUpdate,
2310         upon which we'll fire the callback.
2311
2312         (WebKit::RemoteLayerTreeDisplayRefreshMonitor::didUpdateLayers):
2313
2314         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
2315         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
2316         (WebKit::RemoteLayerTreeDrawingArea::createDisplayRefreshMonitor):
2317         (WebKit::RemoteLayerTreeDrawingArea::willDestroyDisplayRefreshMonitor):
2318         Keep track of the set of DisplayRefreshMonitors.
2319
2320         (WebKit::RemoteLayerTreeDrawingArea::didUpdate):
2321         Fire requestAnimationFrame callbacks once the UI process commits the new layer tree.
2322
2323 2014-05-23  Jeremy Jones  <jeremyj@apple.com>
2324
2325         Hide fullscreen immediately when switching tabs.
2326         https://bugs.webkit.org/show_bug.cgi?id=133239
2327
2328         Reviewed by Eric Carlson.
2329
2330         Renamed a function to better describe it's new functionality.
2331
2332         * UIProcess/WebPageProxy.cpp:
2333         (WebKit::WebPageProxy::viewStateDidChange):
2334         now calls: requestHideAndExitFullscreen
2335
2336 2014-05-23  Enrica Casucci  <enrica@apple.com>
2337
2338         REGRESSION (WebKit2): Keyboard disappears/appears automatically between text boxes.
2339         https://bugs.webkit.org/show_bug.cgi?id=133243
2340         <rdar://problem/16761913>
2341
2342         Reviewed by Benjamin Poulain.
2343
2344         We need to ensure that when an element loses focus and another one gets it,
2345         this is handled in one single message in the UI process to avoid seeing
2346         the keyboard animating in and out.
2347         This is accomplished by always postponing the blur notification until all events
2348         have been processed.
2349         If a new node is focused before the delayed blur notification is sent to the UI
2350         process, the message we send includes both blur and focus notification. In this case,
2351         the postponed blur notification is not sent.
2352
2353         * UIProcess/PageClient.h:
2354         * UIProcess/WebPageProxy.h:
2355         * UIProcess/WebPageProxy.messages.in:
2356         * UIProcess/ios/PageClientImplIOS.h:
2357         * UIProcess/ios/PageClientImplIOS.mm:
2358         (WebKit::PageClientImpl::startAssistingNode):
2359         * UIProcess/ios/WKContentViewInteraction.h:
2360         * UIProcess/ios/WKContentViewInteraction.mm:
2361         (-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:userObject:]):
2362         (-[WKContentView _startAssistingNode:userIsInteracting:userObject:]): Deleted.
2363         * UIProcess/ios/WebPageProxyIOS.mm:
2364         (WebKit::WebPageProxy::startAssistingNode):
2365         * WebProcess/WebPage/WebPage.cpp:
2366         (WebKit::WebPage::WebPage):
2367         * WebProcess/WebPage/WebPage.h:
2368         * WebProcess/WebPage/ios/WebPageIOS.mm:
2369         (WebKit::WebPage::elementDidFocus):
2370         (WebKit::WebPage::elementDidBlur):
2371
2372 2014-05-23  Anders Carlsson  <andersca@apple.com>
2373
2374         Remove an assertion.
2375
2376         * WebProcess/WebPage/WebPage.cpp:
2377         (WebKit::WebPage::loadRequest):
2378
2379 2014-05-23  Tim Horton  <timothy_horton@apple.com>
2380
2381         [iOS] WKPDFView should have a page indicator
2382         https://bugs.webkit.org/show_bug.cgi?id=133109
2383         <rdar://problem/16383003>
2384
2385         Reviewed by Anders Carlsson.
2386
2387         * UIProcess/API/Cocoa/WKWebView.mm:
2388         (-[WKWebView _setHasCustomContentView:loadedMIMEType:WTF::]):
2389         (-[WKWebView _setObscuredInsets:]):
2390         Forward obscured insets changes to the custom content view.
2391
2392         (-[WKWebView _updateScrollViewBackground]):
2393         If we have a custom content view, use its background instead of the
2394         (likely nonexistent) page's when updaing the scroll view's background color.
2395
2396         * UIProcess/API/Cocoa/WKWebViewInternal.h:
2397         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2398         * UIProcess/Cocoa/WKWebViewContentProvider.h:
2399         * UIProcess/Cocoa/WKWebViewContentProviderDelegate.h: Added.
2400         * UIProcess/API/Cocoa/WKWebView.mm:
2401         (-[WKWebView _setInsetForOverlaidAccessoryViews:]):
2402         Add SPI for clients to inform us about potential overlaid accessory views
2403         which should be taken into account e.g. for positioning the page indicator.
2404
2405         Add a view that sits fixed on top of the WKWebView, ignores interaction,
2406         but provides the WKWebViewContentProvider a place to install views
2407         that don't scroll along with the content.
2408
2409         * UIProcess/ios/WKPDFPageNumberIndicator.h: Added.
2410         * UIProcess/ios/WKPDFPageNumberIndicator.mm: Added.
2411         (-[WKPDFPageNumberIndicator initWithFrame:]):
2412         (-[WKPDFPageNumberIndicator dealloc]):
2413         (-[WKPDFPageNumberIndicator setCurrentPageNumber:]):
2414         (-[WKPDFPageNumberIndicator setPageCount:]):
2415         (-[WKPDFPageNumberIndicator show]):
2416         (-[WKPDFPageNumberIndicator hide:]):
2417         (-[WKPDFPageNumberIndicator moveToPoint:animated:]):
2418         (-[WKPDFPageNumberIndicator sizeThatFits:]):
2419         (-[WKPDFPageNumberIndicator _updateLabel]):
2420         (-[WKPDFPageNumberIndicator _makeRoundedCorners]):
2421         Add a page number indicator.
2422
2423         * UIProcess/ios/WKPDFView.mm:
2424         (-[WKPDFView dealloc]):
2425         (-[WKPDFView web_setScrollView:]):
2426         (-[WKPDFView _revalidateViews]):
2427         (-[WKPDFView _offsetForPageNumberIndicator]):
2428         (-[WKPDFView _updatePageNumberIndicator]):
2429         (-[WKPDFView web_setObscuredInsets:]):
2430         (-[WKPDFView web_setInsetForOverlaidAccessoryViews:]):
2431         (-[WKPDFView web_setFixedOverlayView:]):
2432         (-[WKPDFView _computePageAndDocumentFrames]):
2433         Update the page number indicator when the topmost visible page changes.
2434         Move the page number indicator around when the obscured insets change.
2435
2436         * WebKit2.xcodeproj/project.pbxproj:
2437
2438 2014-05-23  Anders Carlsson  <andersca@apple.com>
2439
2440         Fix test failures on the bot.
2441
2442         * UIProcess/API/Cocoa/WKProcessPool.mm:
2443         (websiteDataDirectoryURL):
2444         If we have no bundle identifier, use the process name.
2445
2446 2014-05-23  Enrica Casucci  <enrica@apple.com>
2447
2448         REGRESSION (iOS WebKit2): Autocorrection is not accurate when changing selection.
2449         https://bugs.webkit.org/show_bug.cgi?id=133237
2450         <rdar://problem/16655776>
2451
2452         Reviewed by Ryosuke Niwa.
2453
2454         * UIProcess/ios/WKContentViewInteraction.mm:
2455         (-[WKContentView beginSelectionChange]):
2456         (-[WKContentView endSelectionChange]):
2457
2458         When the selection is changed with a gesture in an editable element,
2459         we must notify the keyboard to make sure the autocorrection engine 
2460         updates its typing context. WKContentView must implement
2461         beginSelectionChange and endSelectionChange to call into
2462         the keyboard layer.
2463
2464 2014-05-22  Brent Fulgham  <bfulgham@apple.com>
2465
2466         [iOS] WK2: Provide implementation for windowFrame
2467         https://bugs.webkit.org/show_bug.cgi?id=133205
2468         <rdar://problem/16894890>
2469
2470         Reviewed by Benjamin Poulain.
2471
2472         * UIProcess/Cocoa/UIDelegate.h:
2473         * UIProcess/Cocoa/UIDelegate.mm:
2474         (WebKit::UIDelegate::UIClient::windowFrame): Added.
2475         * UIProcess/ios/PageClientImplIOS.mm:
2476         (WebKit::PageClientImpl::convertToUserSpace): Added.
2477
2478 2014-05-20  Anders Carlsson  <andersca@apple.com>
2479
2480         Use a per app directory structure for website data
2481         https://bugs.webkit.org/show_bug.cgi?id=133125
2482         <rdar://problem/16830143>
2483
2484         Reviewed by Dan Bernstein, Sam Weinig and Tim Horton.
2485
2486         Put website data in subdirectories of ~/Library/WebKit/<bundle ID>/WebsiteData.
2487         We use "LocalStorage", "WebSQL", and "IndexedDB" subdirectories.
2488
2489         * UIProcess/API/Cocoa/WKProcessPool.mm:
2490         (websiteDataDirectoryURL):
2491         (-[WKProcessPool _initWithConfiguration:]):
2492
2493 2014-05-23  Dan Bernstein  <mitz@apple.com>
2494
2495         [Cocoa] WKNavigationResponsePrivate.h is internal
2496         https://bugs.webkit.org/show_bug.cgi?id=133218
2497
2498         Reviewed by Dean Jackson.
2499
2500         * WebKit2.xcodeproj/project.pbxproj: Promote WKNavigationResponsePrivate.h to private.
2501
2502 2014-05-23  Carlos Garcia Campos  <cgarcia@igalia.com>
2503
2504         [UNIX] Reorganize and cleanup main functions of GTK and EFL ports
2505         https://bugs.webkit.org/show_bug.cgi?id=131024
2506
2507         Reviewed by Gustavo Noronha Silva.
2508
2509         Move main function implementation files to <process-dir>/EntryPoint/unix/<ProcessName>Main.cpp
2510         files that are now shared by GTK and EFL ports. These files call a
2511         main method that wraps a new method ChildProcessMain that contains
2512         the common code and uses a helper class for the platform specific
2513         code. GTK+ and EFL ports implement that helper class for every process type.
2514
2515         * NetworkProcess/EntryPoint/unix/NetworkProcessMain.cpp: Renamed from Source/WebKit2/efl/MainEfl.cpp.
2516         (main):
2517         * NetworkProcess/efl/NetworkProcessMainEfl.cpp: Renamed from Source/WebKit2/unix/NetworkMainUnix.cpp.
2518         (WebKit::NetworkProcessMainUnix):
2519         * NetworkProcess/gtk/NetworkProcessMainGtk.cpp: Renamed from Source/WebKit2/NetworkProcess/unix/NetworkProcessMainUnix.cpp.
2520         (WebKit::NetworkProcessMainUnix):
2521         * NetworkProcess/unix/NetworkProcessMainUnix.h:
2522         * PlatformEfl.cmake:
2523         * PlatformGTK.cmake:
2524         * PluginProcess/EntryPoint/unix/PluginProcessMain.cpp: Renamed from Source/WebKit2/unix/PluginMainUnix.cpp.
2525         (main):
2526         * PluginProcess/unix/PluginProcessMainUnix.cpp:
2527         (WebKit::webkitXError):
2528         (WebKit::PluginProcessMainUnix):
2529         * PluginProcess/unix/PluginProcessMainUnix.h:
2530         * Shared/unix/ChildProcessMain.cpp: Copied from Source/WebKit2/WebProcess/efl/WebProcessMainEfl.h.
2531         (WebKit::ChildProcessMainBase::parseCommandLine):
2532         * Shared/unix/ChildProcessMain.h: Renamed from Source/WebKit2/WebProcess/gtk/WebProcessMainGtk.h.
2533         (WebKit::ChildProcessMainBase::platformInitialize):
2534         (WebKit::ChildProcessMainBase::platformFinalize):
2535         (WebKit::ChildProcessMainBase::initializationParameters):
2536         (WebKit::ChildProcessMain):
2537         * WebProcess/EntryPoint/unix/WebProcessMain.cpp: Renamed from Source/WebKit2/gtk/MainGtk.cpp.
2538         (main):
2539         * WebProcess/efl/WebProcessMainEfl.cpp:
2540         (WebKit::WebProcessMainUnix):
2541         (dummyExtensionErrorHandler): Deleted.
2542         * WebProcess/gtk/WebProcessMainGtk.cpp:
2543         (WebKit::WebProcessMainUnix):
2544         * WebProcess/unix/WebProcessMainUnix.h: Renamed from Source/WebKit2/WebProcess/efl/WebProcessMainEfl.h.
2545
2546 2014-05-22  Zan Dobersek  <zdobersek@igalia.com>
2547
2548         Have the decoded element in VectorArgumentCoder::decode() moved into Vector::append()
2549         https://bugs.webkit.org/show_bug.cgi?id=133082
2550
2551         Reviewed by Andreas Kling.
2552
2553         * Platform/IPC/ArgumentCoders.h: Move the decoded element into the Vector::append() call.
2554         This enforces a move instead of a copy if the decoded element's type is move-constructible.
2555
2556 2014-05-22  Zan Dobersek  <zdobersek@igalia.com>
2557
2558         Move the passed-in Vector<Attachment> in MessageDecoder constructor down into ArgumentDecoder
2559         https://bugs.webkit.org/show_bug.cgi?id=133080
2560
2561         Reviewed by Andreas Kling.
2562
2563         * Platform/IPC/MessageDecoder.cpp:
2564         (IPC::MessageDecoder::MessageDecoder): The Vector<Attachment> object was passed in by value.
2565         Move it into the ArgumentDecoder constructor as it is not used elsewhere in this constructor
2566         and produces a copy otherwise.
2567
2568 2014-05-22  Benjamin Poulain  <bpoulain@apple.com>
2569
2570         [iOS][WK2] Add support for minimal-ui viewports
2571         https://bugs.webkit.org/show_bug.cgi?id=133162
2572
2573         Reviewed by Simon Fraser.
2574
2575         In the WebKit2 layers, we have two parts to minimal-ui.
2576         -In WebPage, we need to get the values from the UIProcess and setup the ViewportConfiguration.
2577          Another part is freezing the state on page load.
2578         -In the UIProcess, we need to get the right information for layout and styling, and we need to tell
2579          the UI clients about minimal-ui changes.
2580
2581         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
2582         * UIProcess/API/Cocoa/WKWebView.mm:
2583         (-[WKWebView _setUsesMinimalUI:]):
2584         (-[WKWebView _usesMinimalUI]):
2585         (-[WKWebView _didCommitLayerTree:WebKit::]):
2586         (-[WKWebView _frameOrBoundsChanged]):
2587         (-[WKWebView _minimumLayoutSizeOverride]):
2588         (-[WKWebView _setMinimumLayoutSizeOverride:]):
2589         (-[WKWebView _minimumLayoutSizeOverrideForMinimalUI]):
2590         (-[WKWebView _setMinimumLayoutSizeOverrideForMinimalUI:]):
2591         (-[WKWebView _largestUnobscuredSizeOverride]):
2592         (-[WKWebView _setMaximumUnobscuredSizeOverride:]):
2593         (-[WKWebView _beginAnimatedResizeWithUpdates:]):
2594         (setViewportConfigurationMinimumLayoutSize): Deleted.
2595         * UIProcess/API/Cocoa/WKWebViewInternal.h:
2596         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2597         * UIProcess/PageClient.h:
2598         * UIProcess/WebPageProxy.h:
2599         * UIProcess/WebPageProxy.messages.in:
2600         * UIProcess/ios/PageClientImplIOS.h:
2601         * UIProcess/ios/PageClientImplIOS.mm:
2602         (WebKit::PageClientImpl::setUsesMinimalUI):
2603         * UIProcess/ios/WebPageProxyIOS.mm:
2604         (WebKit::WebPageProxy::dynamicViewportSizeUpdate):
2605         (WebKit::WebPageProxy::setViewportConfigurationMinimumLayoutSizeForMinimalUI):
2606         (WebKit::WebPageProxy::setMaximumUnobscuredSize):
2607         (WebKit::WebPageProxy::setUsesMinimalUI):
2608         (WebKit::WebPageProxy::setMinimumLayoutSizeForMinimalUI): Deleted.
2609         * WebProcess/WebPage/WebPage.cpp:
2610         (WebKit::WebPage::WebPage):
2611         (WebKit::WebPage::didCommitLoad):
2612         * WebProcess/WebPage/WebPage.h:
2613         * WebProcess/WebPage/WebPage.messages.in:
2614         * WebProcess/WebPage/ios/WebPageIOS.mm:
2615         (WebKit::WebPage::setViewportConfigurationMinimumLayoutSizeForMinimalUI):
2616         (WebKit::WebPage::setMaximumUnobscuredSize):
2617         (WebKit::WebPage::willFlushLayers):
2618         (WebKit::WebPage::dynamicViewportSizeUpdate):
2619         (WebKit::WebPage::viewportConfigurationChanged):
2620         (WebKit::WebPage::updateViewportSizeForCSSViewportUnits):
2621         (WebKit::WebPage::setMinimumLayoutSizeForMinimalUI): Deleted.
2622         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
2623         (WebKit::RemoteLayerTreeDrawingArea::flushLayers):
2624
2625 2014-05-22  Benjamin Poulain  <bpoulain@apple.com>
2626
2627         [iOS][WK2] Reset the special action-target of WKSyntheticClickTapGestureRecognizer on destruction
2628         https://bugs.webkit.org/show_bug.cgi?id=133165
2629         <rdar://problem/16283914>
2630
2631         Reviewed by Andy Estes.
2632
2633         It is unclear why, but the WKSyntheticClickTapGestureRecognizer sometimes survives its own view
2634         and is reset after WKContentView was destructed.
2635         This patch cleans up the target-action on destruction to avoid accessing a destructed object.
2636
2637         * UIProcess/ios/WKContentViewInteraction.mm:
2638         (-[WKContentView cleanupInteraction]):
2639
2640 2014-05-22  Benjamin Poulain  <bpoulain@apple.com>
2641
2642         Do not force a layout when changing the FixedLayoutSize in WebPage
2643         https://bugs.webkit.org/show_bug.cgi?id=133167
2644
2645         Reviewed by Andreas Kling.
2646
2647         WebPage::setFixedLayoutSize was forcing a layout immediately after changing the layout size on FrameView.
2648         This is forcing plenty of extra layouts since the fixed layout size is one of many properties updated on the FrameView.
2649
2650         FrameView marks that layout is needed. It is not clear why a layout was performed immediately.
2651
2652         * WebProcess/WebPage/WebPage.cpp:
2653         (WebKit::WebPage::setFixedLayoutSize):
2654
2655 2014-05-22  Andreas Kling  <akling@apple.com>
2656
2657         [iOS WebKit2] Web process should try to shrink its memory footprint when going into background.
2658         <https://webkit.org/b/133197>
2659         <rdar://problem/17011561>
2660
2661         Try to free up as much memory as possible before going into background.
2662
2663         Reviewed by Gavin Barraclough.
2664
2665         * WebProcess/WebProcess.cpp:
2666         (WebKit::WebProcess::processWillSuspend):
2667
2668 2014-05-22  Andreas Kling  <akling@apple.com>
2669
2670         Hook up a setting for showing detailed logging during memory pressure relief.
2671         <https://webkit.org/b/133194>
2672
2673         Plumb through the same setting that we used for detailed logging in WK1.
2674
2675         Reviewed by Gavin Barraclough.
2676
2677         * Shared/WebProcessCreationParameters.cpp:
2678         (WebKit::WebProcessCreationParameters::WebProcessCreationParameters):
2679         (WebKit::WebProcessCreationParameters::encode):
2680         (WebKit::WebProcessCreationParameters::decode):
2681         * Shared/WebProcessCreationParameters.h:
2682         * UIProcess/mac/WebContextMac.mm:
2683         (WebKit::WebContext::platformInitializeWebProcess):
2684         * WebProcess/cocoa/WebProcessCocoa.mm:
2685         (WebKit::WebProcess::platformInitializeWebProcess):
2686
2687 2014-05-22  Andy Estes  <aestes@apple.com>
2688
2689         [iOS] Send shareable resources to QuickLook if enabled
2690         https://bugs.webkit.org/show_bug.cgi?id=133189
2691         <rdar://problem/17003995>
2692
2693         Reviewed by Brady Eidson.
2694
2695         Like we do for didReceiveData(), we need to pass an incoming ShareableResource to QuickLook if a QuickLook
2696         handle exists.
2697
2698         * Shared/ShareableResource.cpp:
2699         (WebKit::ShareableResource::Handle::tryWrapInCFData): Return the shared resource in a CFDataRef.
2700         (WebKit::ShareableResource::Handle::tryWrapInSharedBuffer): Implemented in terms of tryWrapInCFData().
2701         * Shared/ShareableResource.h:
2702         * WebProcess/Network/WebResourceLoader.cpp:
2703         (WebKit::WebResourceLoader::didReceiveResource): If a QuickLook handle exists, send the shareable resource to
2704         it via a CFDataRef.
2705
2706 2014-05-22  Martin Hock  <mhock@apple.com>
2707
2708         [iOS] Enable -apple-system- styled elements to respond to system font size changes.
2709         https://bugs.webkit.org/show_bug.cgi?id=133186
2710         <rdar://problem/16583782>
2711
2712         Reviewed by Enrica Casucci.
2713
2714         * UIProcess/API/Cocoa/WKWebView.mm:
2715         (-[WKWebView initWithFrame:configuration:]):
2716         (-[WKWebView _contentSizeCategoryDidChange:]):
2717         (-[WKWebView _contentSizeCategory]):
2718         * UIProcess/WebPageProxy.h:
2719         * UIProcess/ios/WebPageProxyIOS.mm:
2720         (WebKit::WebPageProxy::contentSizeCategoryDidChange):
2721         * WebProcess/WebPage/WebPage.h:
2722         * WebProcess/WebPage/WebPage.messages.in:
2723         * WebProcess/WebPage/ios/WebPageIOS.mm:
2724         (WebKit::WebPage::contentSizeCategoryDidChange):
2725
2726 2014-05-22  Alexey Proskuryakov  <ap@apple.com>
2727
2728         [iOS] Add CFBundleAllowMixedLocalizations to WebContentService
2729         https://bugs.webkit.org/show_bug.cgi?id=133187
2730         <rdar://problem/16561084>
2731
2732         Reviewed by Tim Horton.
2733
2734         * WebProcess/EntryPoint/mac/XPCService/WebContentService/Info-iOS.plist:
2735         We already had it in WebContentService.Development, just not here.
2736
2737 2014-05-22  Alexey Proskuryakov  <ap@apple.com>
2738
2739         [iOS][WK2] Application cache is broken
2740         https://bugs.webkit.org/show_bug.cgi?id=133172
2741         <rdar://problem/16994593>
2742
2743         Reviewed by Andy Estes.
2744
2745         * UIProcess/mac/WebContextMac.mm:
2746         (WebKit::WebContext::platformDefaultApplicationCacheDirectory): Use a proper
2747         path for application cache database (same as WebKit1).
2748
2749 2014-05-22  Enrica Casucci  <enrica@apple.com>
2750
2751         REGRESSION (WebKit2): Keyboard should have Search button in duckduckgo.com.
2752         https://bugs.webkit.org/show_bug.cgi?id=133183
2753         <rdar://problem/17004207>
2754
2755         Reviewed by Geoff Garen.
2756
2757         The keyboard type should be search if the input type is search
2758         or if it is text and it is inside a form with an action and either
2759         name, id or title contain the word search. This matches the
2760         heuristics we have in WK1 for iOS.
2761
2762         * WebProcess/WebPage/ios/WebPageIOS.mm:
2763         (WebKit::WebPage::getAssistedNodeInformation):
2764
2765 2014-05-21  Oliver Hunt  <oliver@apple.com>
2766
2767         Only enable sandbox extensions on mac.
2768
2769         RS = Alexey.
2770
2771         * WebKit2Prefix.h:
2772
2773 2014-05-21  Oliver Hunt  <oliver@apple.com>
2774
2775         [iOS] Enable sandboxing for the database process
2776         https://bugs.webkit.org/show_bug.cgi?id=132963
2777
2778         Reviewed by Alexey Proskuryakov.
2779
2780         Simply ensure that the database process is running in a tight
2781         sandbox. As part of this i've separated out ChildProcessIOS
2782         and ensures that the database process loads a custom sandbox.
2783
2784         * Configurations/WebKit.xcconfig:
2785         * DatabaseProcess/ios/DatabaseProcessIOS.mm:
2786         (WebKit::DatabaseProcess::initializeSandbox):
2787         * DatabaseProcess/ios/com.apple.WebKit.DatabasesIOS.sb: Added.
2788         * Shared/ios/ChildProcessIOS.mm: Added.
2789         Essentially cloned from the Mac version, only all the OSX
2790         specific logic has been stripped.
2791         (WebKit::ChildProcess::setApplicationIsDaemon):
2792         (WebKit::ChildProcess::platformInitialize):
2793         (WebKit::ChildProcess::initializeSandbox):
2794         (WebKit::ChildProcess::setQOS):
2795         * Shared/mac/ChildProcessMac.mm:
2796         Remove all the IOS ifdefs.
2797         (WebKit::ChildProcess::setApplicationIsDaemon):
2798         (WebKit::ChildProcess::platformInitialize):
2799         (WebKit::ChildProcess::initializeSandbox):
2800         (WebKit::ChildProcess::setQOS):
2801         * WebKit2.xcodeproj/project.pbxproj:
2802
2803 2014-05-21  Andy Estes  <aestes@apple.com>
2804
2805         [iOS] Create a UIPrintFormatter for WKWebView
2806         https://bugs.webkit.org/show_bug.cgi?id=133005
2807
2808         Reviewed by Tim Horton.
2809
2810         Implemented a UIPrintFormatter subclass to support printing WKWebViews using UIPrintInteractionController.
2811         Overrode -_recalcPageCount: to synchronously ask the web process to lay out for printing and return the number
2812         of page rects. The web process returns the page rects immediately and then starts rendering the page to a PDF,
2813         returning the PDF data to the UI process asynchronously. When UIPrintInteractionController later calls our
2814         overridden -drawInRect:forPageAtIndex:, we block and wait for the PDF data to be returned. Since
2815         UIPrintInteractionController draws each page after a delay, it's possible that the web process has already
2816         returned the PDF data to us by the time we print the first page.
2817
2818         * Shared/WebPreferencesStore.h: Correctly initialized shouldPrintBackgrounds for iOS.
2819         * UIProcess/API/Cocoa/WKWebView.mm:
2820         (-[WKWebView _dataForDisplayedPDF]): Now that WKPDFView vends its CGPDFDocument directly, extract its data here.
2821         (-[WKWebView _printFormatterClass]): Tell UIView which UIPrintFormatter to alloc.
2822         (-[WKWebView _computePageCountAndStartDrawingToPDFWithPrintInfo:WebKit::firstPage:computedTotalScaleFactor:]):
2823         If we're displaying a PDF, return its page count directly. Otherwise, synchronously ask the web process to
2824         compute page rects for printing and then return the number of rects.
2825         (-[WKWebView _endPrinting]): Cleared state and sent the WebPage::EndPrinting message to the web process.
2826         (-[WKWebView _printedDocument]): If we're displaying a PDF, return its data directly. Otherwise, if we haven't
2827         received PDF data from the web process yet, wait for it indefinitely (there's no sensible timeout to use here
2828         since failing to receive the data results in printing some number of blank pages).
2829         (-[WKWebView _setPrintedDocument:]): Set the CGPDFDocument received from the web process.
2830         * UIProcess/API/Cocoa/WKWebViewInternal.h: Declared methods called by WKWebViewPrintFormatter.
2831         * UIProcess/PageClient.h: Declared didFinishDrawingPagesToPDF.
2832         * UIProcess/WKWebViewPrintFormatter.h: Added.
2833         * UIProcess/WKWebViewPrintFormatter.mm: Added.
2834         (-[WKWebViewPrintFormatter dealloc]): Cleared state and called -[WKWebView _endPrinting].
2835         (-[WKWebViewPrintFormatter webView]): Returned the WKWebView for this print formatter.
2836         (-[WKWebViewPrintFormatter _recalcPageCount]): Set up a PrintInfo object given the formatter's content rect
2837         and called -_computePageCountAndStartDrawingToPDFWithPrintInfo:...
2838         (-[WKWebViewPrintFormatter rectForPageAtIndex:]): Called -_recalcIfNecessary and then returned the rect from
2839         -_pageContentRect.
2840         (-[WKWebViewPrintFormatter drawInRect:forPageAtIndex:]): Taught to draw the given page of the printed PDF
2841         document into the given rect and context provided to us.
2842         * UIProcess/WebPageProxy.h: Declared didFinishDrawingPagesToPDF.
2843         * UIProcess/WebPageProxy.messages.in: Added DidFinishDrawingPagesToPDF. Made this a delayed syncrhonous message
2844         so that additoinal work could be performed after sending the response.
2845         * UIProcess/ios/PageClientImplIOS.h:
2846         * UIProcess/ios/PageClientImplIOS.mm:
2847         (WebKit::PageClientImpl::didFinishDrawingPagesToPDF): Created a CGPDFDocument from the data sent to us by the
2848         web process and called -[WKWebView _setPrintedDocument:].
2849         * UIProcess/ios/WKPDFView.h:
2850         * UIProcess/ios/WKPDFView.mm:
2851         (-[WKPDFView pdfDocument]): Returned the underlying CGPDFDocument.
2852         (-[WKPDFView documentData]): Deleted.
2853         * UIProcess/ios/WebPageProxyIOS.mm:
2854         (WebKit::WebPageProxy::didFinishDrawingPagesToPDF):
2855         * WebKit2.xcodeproj/project.pbxproj:
2856         * WebProcess/WebPage/WebPage.cpp:
2857         (WebKit::WebPage::computePagesForPrinting): Changed to call computePagesForPrintingImpl.
2858         (WebKit::WebPage::computePagesForPrintingImpl): Moved the common logic of computePagesForPrinting to here so it
2859         could be called by computePagesForPrintingAndStartDrawingToPDF.
2860         (WebKit::WebPage::drawPagesToPDF): Changed to call drawPagesToPDFImpl
2861         (WebKit::WebPage::drawPagesToPDFImpl): Moved the common logic of drawPagesToPDF to here so it could be called
2862         by computePagesForPrintingAndStartDrawingToPDF.
2863         * WebProcess/WebPage/WebPage.h:
2864         * WebProcess/WebPage/WebPage.messages.in:
2865         * WebProcess/WebPage/ios/WebPageIOS.mm:
2866         (WebKit::WebPage::computePagesForPrintingAndStartDrawingToPDF): Computed page rects and returned them as a
2867         synchronous response. Afterwards called drawPagesToPDFImpl() and returned the PDF data by sending
2868         WebPageProxy::DidFinishDrawingPagesToPDF.
2869
2870 2014-05-21  Michał Pakuła vel Rutka  <m.pakula@samsung.com>
2871
2872         [EFL] Turn on ENABLE_CSS_FILTERS
2873         https://bugs.webkit.org/show_bug.cgi?id=133153
2874
2875         Reviewed by Gyuyoung Kim.
2876
2877         Make WebKit2 compile after r166741 when CSS_FILTERS are enabled.
2878
2879         * Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.cpp:
2880         (IPC::ArgumentCoder<WebCore::FilterOperations>::decode):
2881
2882 2014-05-21  Brady Eidson  <beidson@apple.com>
2883
2884         Special handling of telephone number detection menu.
2885         <rdar://problem/16967971> and https://bugs.webkit.org/show_bug.cgi?id=133143
2886
2887         Reviewed by Geoff Garen.
2888
2889         Add a bool to ContextMenuContextData to represent telephone number menus:
2890         * Shared/ContextMenuContextData.cpp:
2891         (WebKit::ContextMenuContextData::ContextMenuContextData):
2892         (WebKit::ContextMenuContextData::operator=):
2893         (WebKit::ContextMenuContextData::encode):
2894         (WebKit::ContextMenuContextData::decode):
2895         * Shared/ContextMenuContextData.h:
2896         (WebKit::ContextMenuContextData::ContextMenuContextData):
2897         (WebKit::ContextMenuContextData::isTelephoneNumberContext):
2898
2899         * UIProcess/mac/WebContextMenuProxyMac.mm:
2900         (WebKit::WebContextMenuProxyMac::showContextMenu): If the menu is a telephone
2901           number menu then display it using a specific AppKit API.
2902
2903         * UIProcess/mac/WebPageProxyMac.mm:
2904         (WebKit::WebPageProxy::showTelephoneNumberMenu): Filter the array of menu items
2905           through a new WKSI call, and then show it using a telephone number context.
2906
2907 2014-05-21  Alexey Proskuryakov  <ap@apple.com>
2908
2909         [Mac] REGRESSION (Async text input): Asian text input doesn't work in Flash
2910         https://bugs.webkit.org/show_bug.cgi?id=133128
2911         <rdar://problem/16890920>
2912
2913         Reviewed by Anders Carlsson.
2914
2915         * UIProcess/API/mac/WKView.mm:
2916         (-[WKView _interpretKeyEvent:completionHandler:]): Added a separate code path for
2917         plug-in input. Before async text input, we used to provide a nil input context due
2918         to having _data->_interpretKeyEventsParameters while this function was executing,
2919         and thus took a shortcut. The new behavior is different from pre-async in that
2920         we don't collect commands at all, but I couldn't find any case where that mattered.
2921         (-[WKView inputContext]): The _collectedKeypressCommands check was not a correct
2922         replacement for _interpretKeyEventsParameters one, because this variable is not
2923         always set within -_interpretKeyEvent:completionHandler:.
2924
2925         * UIProcess/mac/WKTextInputWindowController.mm:
2926         (-[WKTextInputPanel _interpretKeyEvent:usingLegacyCocoaTextInput:string:]):
2927         While at it, fixed a separate issue with Cangjie predictive input. We shouldn't
2928         keep prediction pop-up on screen after hiding the bottom input window.
2929
2930 2014-05-16  Martin Robinson  <mrobinson@igalia.com>
2931
2932         [CMake] Improve handling of LIB_INSTALL_DIR, EXEC_INSTALL_DIR, and LIBEXEC_INSTALL_DIR
2933         https://bugs.webkit.org/show_bug.cgi?id=132819
2934
2935         Reviewed by Carlos Garcia Campos.
2936
2937         * PlatformEfl.cmake: No need to prefix EXEC_INSTALL_DIR with the prefix any longer.
2938         * PlatformGtk.cmake: No longer use CMAKE_INSTALL_FULL_FOO variables, instead using the WebKit-specific ones.
2939         * efl/EWebKit2Config.cmake.in: Ditto.
2940         * efl/ewebkit2.pc.in: Instead of hard-coding the path to the library installation directory use LIB_INSTALL_DIR.
2941         * webkit2gtk-web-extension.pc.in: No longer use the pkg-config only variables. Instead use
2942         the common CMake ones.
2943         * webkit2gtk.pc.in: Ditto.
2944
2945 2014-05-21  Carlos Garcia Campos  <cgarcia@igalia.com>
2946
2947         REGRESSION(r168625): [GTK] Assertion failure in LocalStorageDatabaseTracker
2948         https://bugs.webkit.org/show_bug.cgi?id=133118
2949
2950         Reviewed by Philippe Normand.
2951
2952         Call WebContext::applyPlatformSpecificConfigurationDefaults() to
2953         initialize the WebContextConfiguration before creating the default WebContext.
2954
2955         * UIProcess/API/gtk/WebKitWebContext.cpp:
2956         (createDefaultWebContext):
2957
2958 2014-05-21  Shivakumar JM  <shiva.jm@samsung.com>
2959
2960         [WebKit2] Cleanup the build from unused variable in WebProcess module
2961         https://bugs.webkit.org/show_bug.cgi?id=133062
2962
2963         Reviewed by Csaba Osztrogonác.
2964
2965         Fix unused parameter by using UNUSED_PARAM macro
2966
2967         * WebProcess/UserContent/WebUserContentController.cpp:
2968         (WebKit::WebUserContentController::addUserScriptMessageHandlers):
2969         (WebKit::WebUserContentController::removeUserScriptMessageHandler):
2970
2971 2014-05-20  Enrica Casucci  <enrica@apple.com>
2972
2973         REGRESSION (WK2): Tapping on the input field in duckduckgo.com shows the keyboard but not the caret.
2974         https://bugs.webkit.org/show_bug.cgi?id=133140
2975         <rdar://problem/16980898>
2976
2977         Reviewed by Benjamin Poulain.
2978
2979         When a page focuses a field on load, we receive the call to startAssistingNode
2980         but we don't create a text interaction assistant if the focus is not originated
2981         by a user action. Upon receiving the selection change notification we don't
2982         call the text interaction assistant, since we don't have one, but we do call
2983         the web selection assistant. We don't have any valid rects for web selection
2984         and we clear the selection on the page, causing the caret not to appear and
2985         the typing to have no effect.
2986
2987         * UIProcess/ios/WKContentViewInteraction.mm:
2988         (-[WKContentView _updateChangedSelection]):
2989
2990 2014-05-20  Dean Jackson  <dino@apple.com>
2991
2992         [Mac] Allow popup menus to override default appearance
2993         https://bugs.webkit.org/show_bug.cgi?id=133129
2994
2995         Reviewed by Tim Horton.
2996
2997         Add an extra "hideArrows" flag to PlatformPopupMenuData
2998         and replace the call to WKPopupMenuWithSize with WKPopupMenu.
2999
3000         * Shared/PlatformPopupMenuData.cpp: Encode and decode the new data value.
3001         (WebKit::PlatformPopupMenuData::encode):
3002         (WebKit::PlatformPopupMenuData::decode):
3003         * Shared/PlatformPopupMenuData.h: Add hideArrows boolean.
3004         * UIProcess/mac/WebPopupMenuProxyMac.mm:
3005         (WebKit::WebPopupMenuProxyMac::showPopupMenu):
3006         * WebProcess/WebCoreSupport/mac/WebPopupMenuMac.mm:
3007         (WebKit::WebPopupMenu::setUpPlatformData): The hideArrows flag is
3008         true if we don't have the default appearance.
3009
3010 2014-05-20  Eric Carlson  <eric.carlson@apple.com>
3011
3012         [Mac] do not deactivate an audio session that has running I/O
3013         https://bugs.webkit.org/show_bug.cgi?id=133127
3014
3015         Reviewed by Jer Noble.
3016
3017         * WebProcess/WebPage/WebPage.cpp:
3018         (WebKit::WebPage::WebPage): Settings::setShouldManageAudioSession renamed to 
3019             setShouldManageAudioSessionCategory, deal with it.
3020
3021 2014-05-19  Simon Fraser  <simon.fraser@apple.com>
3022
3023         REGRESSION (r169063) Fixed and sticky nodes misplaced on scrolling sometimes
3024         https://bugs.webkit.org/show_bug.cgi?id=133106
3025         <rdar://problem/16967648>
3026
3027         Reviewed by Sam Weinig.
3028
3029         Fix regression from r169063. That commit removed scrolledContentsLayers from 
3030         frame scrolling nodes, but they do actually use them.
3031         
3032         So put them back; not in the base class, because they have a somewhat different
3033         meaning for overflow scrolling and frame scrolling.
3034
3035         * Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp:
3036         (ArgumentCoder<ScrollingStateFrameScrollingNode>::encode):
3037         (ArgumentCoder<ScrollingStateFrameScrollingNode>::decode):
3038         (WebKit::RemoteScrollingTreeTextStream::dump):
3039         * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp:
3040         (WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers):
3041
3042 2014-05-20  Alexey Proskuryakov  <ap@apple.com>
3043
3044         [Mac] WebProcess doesn't follow localization of UI process when run as a service
3045         https://bugs.webkit.org/show_bug.cgi?id=133126
3046         <rdar://problem/13396515>
3047         <rdar://problem/16561084>
3048
3049         Reviewed by Sam Weinig and Tim Horton.
3050
3051         * Shared/EntryPointUtilities/mac/XPCService/XPCServiceMain.Development.mm:
3052         (WebKit::handleXPCBootstrap):
3053         (main):
3054         * Shared/EntryPointUtilities/mac/XPCService/XPCServiceMain.mm:
3055         (WebKit::handleXPCBootstrap):
3056         (main):
3057         Set localization very early in process lifetime (in development builds, that's
3058         even before WebKit framework is loaded).
3059
3060         * UIProcess/Launcher/mac/ProcessLauncherMac.mm: (WebKit::connectToService):
3061         Pass UI process localization to the service, computing it in the same way we do
3062         for child processes.
3063
3064 2014-05-20  Anders Carlsson  <andersca@apple.com>
3065
3066         Fix a header comment
3067         https://bugs.webkit.org/show_bug.cgi?id=133123
3068         <rdar://problem/16973783>
3069
3070         Reviewed by Geoffrey Garen.
3071
3072         * UIProcess/API/Cocoa/WKUserContentController.h:
3073
3074 2014-05-20  Carlos Garcia Campos  <cgarcia@igalia.com>
3075
3076         [GTK] WebKitWebPage::send-request always pass a valid pointer for redirected response
3077         https://bugs.webkit.org/show_bug.cgi?id=133119
3078
3079         Reviewed by Sergio Villar Senin.
3080
3081         The problem is that we were checking whether the passed in
3082         WKURLResponseRef is NULL or not, but it's always a valid object
3083         that can contain a NULL WebCore::ResourceResponse.
3084
3085         * WebProcess/InjectedBundle/API/gtk/WebKitWebPage.cpp:
3086         (willSendRequestForFrame): Pass NULL as redirect-response
3087         parameter of WebKitWebPage::send-request signal when the
3088         WebCore::ResourceResponse of the passed in WKURLResponseRef is NULL.
3089
3090 2014-05-20  Antti Koivisto  <antti@apple.com>
3091
3092         Double-tap zoom does not take obscuring insets into account
3093         https://bugs.webkit.org/show_bug.cgi?id=133116
3094         <rdar://problem/16765604>
3095
3096         Reviewed by Anders Carlsson.
3097
3098         * UIProcess/API/Cocoa/WKWebView.mm:
3099         (-[WKWebView _zoomToRect:WebCore::atScale:origin:WebCore::]):
3100         
3101             Compute the zoom target taking insets into account.
3102
3103 2014-05-19  Gavin Barraclough  <baraclough@apple.com>
3104
3105         WebKit2/iOS: parented view should be considered hidden if app is backgrounded
3106         https://bugs.webkit.org/show_bug.cgi?id=133099
3107         radar://16942183
3108
3109         Reviewed by Simon Fraser.
3110
3111         * UIProcess/ios/PageClientImplIOS.mm:
3112         (WebKit::PageClientImpl::isViewWindowActive):
3113             - implemented in terms of isViewVisible.
3114             - FIXME: https://bugs.webkit.org/show_bug.cgi?id=133098
3115         (WebKit::PageClientImpl::isViewFocused):
3116             - implemented in terms of isViewWindowActive.
3117             - FIXME: https://bugs.webkit.org/show_bug.cgi?id=133098
3118         (WebKit::PageClientImpl::isViewVisible):
3119             - take UIApplication applicationState into account in determining visibility.
3120         (WebKit::PageClientImpl::isViewVisibleOrOccluded):
3121             - implemented in terms of isViewVisible.
3122         (WebKit::PageClientImpl::isVisuallyIdle):
3123             - implemented in terms of isViewVisible.
3124         * UIProcess/ios/WKContentView.mm:
3125         (-[WKContentView initWithFrame:context:WebKit::configuration:WebKit::webView:]):
3126             - register for UIApplicationDidEnterBackgroundNotification.
3127         (-[WKContentView _applicationDidEnterBackground:]):
3128         (-[WKContentView _applicationWillEnterForeground:]):
3129             - when the application state changes all flags except IsInWindow may be affected.
3130
3131 2014-05-19  Enrica Casucci  <enrica@apple.com>
3132
3133         WK2 iOS: Pressing the form navigation button causes the keyboard to be dismissed.
3134         https://bugs.webkit.org/show_bug.cgi?id=133100
3135         <rdar://problem/16808673>
3136
3137         Reviewed by Benjamin Poulain.
3138
3139         The call to focusNextAssistedNode is the result of a user action, since
3140         it is called when the user pressed the form navigation buttons.
3141         Therefore we must set m_userIsInteracting to true before changing the focus
3142         to make sure the focus change is honored.
3143
3144         * WebProcess/WebPage/ios/WebPageIOS.mm:
3145         (WebKit::WebPage::focusNextAssistedNode):
3146
3147 2014-05-19  Beth Dakin  <bdakin@apple.com>
3148
3149         TelephoneNumberOverlayController should use a modern loop for text quad bounding 
3150         boxes
3151         https://bugs.webkit.org/show_bug.cgi?id=133096
3152
3153         Reviewed by Anders Carlsson.
3154
3155         * WebProcess/WebPage/mac/TelephoneNumberOverlayControllerMac.mm:
3156         (WebKit::textQuadsToBoundingRectForRange):
3157
3158 2014-05-19  Jeremy Jones  <jeremyj@apple.com>
3159
3160         PlatformCALayerRemoteCustom properties aren't initialized to match the PlatformLayer
3161         https://bugs.webkit.org/show_bug.cgi?id=133025
3162
3163         Reviewed by Simon Fraser.
3164
3165         * WebProcess/WebPage/mac/PlatformCALayerRemoteCustom.mm:
3166         (WebKit::PlatformCALayerRemoteCustom::PlatformCALayerRemoteCustom):
3167         Initialize PlatformCALayerRemote properties from the PlatformLayer.
3168
3169 2014-05-19  Benjamin Poulain  <bpoulain@apple.com>
3170
3171         [iOS][WK2] When a page relayout on dynamic resize, keep the same relative width in view
3172         https://bugs.webkit.org/show_bug.cgi?id=133026
3173         <rdar://problem/16833971>
3174
3175         Reviewed by Simon Fraser.
3176
3177         When a page does not relayout, we keep the same width in view.
3178         When a page relayout, we should keep the same relative width in view.
3179
3180         * WebProcess/WebPage/ios/WebPageIOS.mm:
3181         (WebKit::isResponsiveDesignWithContentLargerThanLayout):
3182         (WebKit::WebPage::dynamicViewportSizeUpdate):
3183
3184 2014-05-19  Benjamin Poulain  <benjamin@webkit.org>
3185
3186         [WK2] Add some missing state reset on crash
3187         https://bugs.webkit.org/show_bug.cgi?id=133036
3188
3189         Reviewed by Sam Weinig.
3190
3191         * UIProcess/WebPageProxy.cpp:
3192         (WebKit::WebPageProxy::resetState):
3193         The missing reset for m_isTrackingTouchEvents would cause the WebPageProxy to send
3194         touch events when it shouldn't. That would only be for an active touch sequence.
3195
3196         The missing reset m_lastVisibleContentRectUpdate would prevent pushing the new UI state
3197         to the new page on reload, that is very bad.
3198
3199         Also moved m_videoFullscreenManager to be in the same order as initialization, and invalidate
3200         the callbacks for dictation.
3201
3202 2014-05-19  Benjamin Poulain  <bpoulain@apple.com>
3203
3204         [iOS][WK2] Move scale noise filtering to the WebProcess
3205         https://bugs.webkit.org/show_bug.cgi?id=133021
3206
3207         Reviewed by Darin Adler.
3208
3209         Filtering in the UIProcess was stupid. It forces to handle a third kind of scale just for updates.
3210
3211         The WebProcess already adjusts the input scale based on the viewport. Changing the input scale at that level
3212         is already supported. It is a better place to have the filtering.
3213
3214         * UIProcess/ios/WKContentView.mm:
3215         (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:]):
3216         * WebProcess/WebPage/ios/WebPageIOS.mm:
3217         (WebKit::WebPage::updateVisibleContentRects):
3218
3219 2014-05-19  Simon Fraser  <simon.fraser@apple.com>
3220
3221         Split scrolling tree ScrollingNodes into FrameScrollingNodes and OverflowScrollingNodes
3222         https://bugs.webkit.org/show_bug.cgi?id=133022
3223
3224         Reviewed by Sam Weinig.
3225         
3226         In both the scrolling state tree and the scrolling tree, split the "scrolling nodes"
3227         into FrameScrolling and OverflowScrolling nodes.
3228         
3229         Move what was the "viewportSize" property onto the base class for the scrolling
3230         nodes, calling it "scrollableAreaSize".
3231         
3232         Make minimum/maximumScrollPosition() virtual so we can share more code (and there
3233         is more code sharing to be done in future).
3234
3235         * Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp:
3236         (ArgumentCoder<ScrollingStateScrollingNode>::encode):
3237         (ArgumentCoder<ScrollingStateFrameScrollingNode>::encode):
3238         (ArgumentCoder<ScrollingStateOverflowScrollingNode>::encode):
3239         (ArgumentCoder<ScrollingStateScrollingNode>::decode):
3240         (ArgumentCoder<ScrollingStateFrameScrollingNode>::decode):
3241         (ArgumentCoder<ScrollingStateOverflowScrollingNode>::decode):
3242         (WebKit::encodeNodeAndDescendants):
3243         (WebKit::RemoteScrollingCoordinatorTransaction::decode):
3244         (WebKit::RemoteScrollingTreeTextStream::dump):
3245         * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp:
3246         (WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers):
3247         * UIProcess/Scrolling/RemoteScrollingTree.cpp:
3248         (WebKit::RemoteScrollingTree::createNode):
3249         * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.h:
3250         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::scrollLayer):
3251         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::updateLayersAfterViewportChange):
3252         * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:
3253         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::ScrollingTreeOverflowScrollingNodeIOS):
3254         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::updateBeforeChildren):
3255         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::updateAfterChildren):
3256         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::setScrollLayerPosition):
3257         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::updateChildNodesAfterScroll):
3258         * UIProcess/ios/RemoteScrollingCoordinatorProxyIOS.mm:
3259         (WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers):
3260
3261 2014-05-19  Alexey Proskuryakov  <ap@apple.com>
3262
3263         [Mac] Fix a typo in plug-in sandbox
3264         https://bugs.webkit.org/show_bug.cgi?id=133074
3265
3266         Reviewed by Anders Carlsson.
3267
3268         * Resources/PlugInSandboxProfiles/com.apple.WebKit.plugin-common.sb:
3269
3270 2014-05-16  Andy Estes  <aestes@apple.com>
3271
3272         [WebKit2] Wake up threads blocked in waitForAndDispatchImmediately() if we lose our connection
3273         https://bugs.webkit.org/show_bug.cgi?id=133010
3274
3275         Reviewed by Geoffrey Garen.
3276
3277         If a thread is blocked on m_waitForMessageCondition and we lose our connection, treat that like we do a timeout.
3278
3279         * Platform/IPC/Connection.cpp:
3280         (IPC::Connection::Connection):
3281         (IPC::Connection::waitForMessage):
3282         (IPC::Connection::connectionDidClose):
3283         * Platform/IPC/Connection.h:
3284
3285 2014-05-19  Mark Rowe  <mrowe@apple.com>
3286
3287         Build fix after r169023.
3288
3289         * Shared/API/Cocoa/WebKitPrivate.h: Stop including headers that no longer exist.
3290         I hope for weinig's sake that no-one was relying on them.
3291
3292 2014-05-18  Anders Carlsson  <andersca@apple.com>
3293
3294         Relax an assertion when creating document loaders
3295         https://bugs.webkit.org/show_bug.cgi?id=133058
3296
3297         Reviewed by Sam Weinig.
3298
3299         When navigating back/forward items recursively, createDocumentLoader will be called
3300         for subframes before main frames so only associate the navigation with main frames.
3301
3302         * WebProcess/WebPage/WebPage.cpp:
3303         (WebKit::WebPage::createDocumentLoader):
3304
3305 2014-05-18  Zsolt Borbely  <zsborbely.u-szeged@partner.samsung.com>
3306
3307         CMake Buildfix after r169023.
3308
3309         Reviewed by Csaba Osztrogonác.
3310
3311         * CMakeLists.txt: Add new files after r168994.
3312
3313 2014-05-18  Sam Weinig  <sam@webkit.org>
3314
3315         [WebKit2] Implement ScriptMessageHandlers
3316         https://bugs.webkit.org/show_bug.cgi?id=133053
3317
3318         Reviewed by Anders Carlsson.
3319
3320         * DerivedSources.make:
3321         * Scripts/webkit2/messages.py:
3322         (struct_or_class):
3323         (argument_coder_headers_for_type):
3324         (headers_for_type):
3325         * UIProcess/API/Cocoa/WKScriptMessage.mm:
3326         (-[WKScriptMessage _initWithBody:webView:name:]):
3327         (-[WKScriptMessage body]):
3328         (-[WKScriptMessage webView]):
3329         (-[WKScriptMessage name]):
3330         (-[WKScriptMessage _scriptWorld]): Deleted.
3331         * UIProcess/API/Cocoa/WKScriptMessageInternal.h: Copied from Source/WebKit2/UIProcess/API/Cocoa/WKScriptMessagePrivate.h.
3332         * UIProcess/API/Cocoa/WKScriptMessagePrivate.h: Removed.
3333         * UIProcess/API/Cocoa/WKUserContentController.mm:
3334         (-[WKUserContentController addScriptMessageHandler:name:]):
3335         (-[WKUserContentController removeScriptMessageHandlerForName:]):
3336         (-[WKUserContentController _addScriptMessageHandler:name:world:]): Deleted.
3337         (-[WKUserContentController _removeScriptMessageHandlerForName:world:]): Deleted.
3338         * UIProcess/API/Cocoa/WKUserContentControllerInternal.h:
3339         * UIProcess/API/Cocoa/WKUserContentControllerPrivate.h: Removed.
3340         * UIProcess/API/Cocoa/WKWebView.mm:
3341         (pageToViewMap):
3342         (fromWebPageProxy):
3343         (-[WKWebView initWithFrame:configuration:]):
3344         (-[WKWebView dealloc]):
3345         * UIProcess/API/Cocoa/WKWebViewInternal.h:
3346         * UIProcess/UserContent/WebScriptMessageHandler.cpp: Added.
3347         (WebKit::WebScriptMessageHandlerHandle::encode):
3348         (WebKit::WebScriptMessageHandlerHandle::decode):
3349         (WebKit::generateIdentifier):
3350         (WebKit::WebScriptMessageHandler::create):
3351         (WebKit::WebScriptMessageHandler::WebScriptMessageHandler):
3352         (WebKit::WebScriptMessageHandler::~WebScriptMessageHandler):
3353         * UIProcess/UserContent/WebScriptMessageHandler.h: Added.
3354         (WebKit::WebScriptMessageHandler::Client::~Client):
3355         (WebKit::WebScriptMessageHandler::handle):
3356         (WebKit::WebScriptMessageHandler::identifier):
3357         (WebKit::WebScriptMessageHandler::name):
3358         (WebKit::WebScriptMessageHandler::client):
3359         * UIProcess/UserContent/WebUserContentControllerProxy.cpp:
3360         (WebKit::WebUserContentControllerProxy::addProcess):
3361         (WebKit::WebUserContentControllerProxy::removeProcess):
3362         (WebKit::WebUserContentControllerProxy::addUserScriptMessageHandler):
3363         (WebKit::WebUserContentControllerProxy::removeUserMessageHandlerForName):
3364         (WebKit::WebUserContentControllerProxy::didPostMessage):
3365         * UIProcess/UserContent/WebUserContentControllerProxy.h:
3366         * UIProcess/UserContent/WebUserContentControllerProxy.messages.in: Added.
3367         * WebKit2.xcodeproj/project.pbxproj:
3368         * WebProcess/UserContent/WebUserContentController.cpp:
3369         (WebKit::WebUserMessageHandlerDescriptorProxy::create):
3370         (WebKit::WebUserMessageHandlerDescriptorProxy::~WebUserMessageHandlerDescriptorProxy):
3371         (WebKit::WebUserMessageHandlerDescriptorProxy::didPostMessage):
3372         (WebKit::WebUserMessageHandlerDescriptorProxy::descriptor):
3373         (WebKit::WebUserMessageHandlerDescriptorProxy::identifier):
3374         (WebKit::WebUserMessageHandlerDescriptorProxy::WebUserMessageHandlerDescriptorProxy):
3375         (WebKit::WebUserContentController::addUserScriptMessageHandlers):
3376         (WebKit::WebUserContentController::removeUserScriptMessageHandler):
3377         * WebProcess/UserContent/WebUserContentController.h:
3378         * WebProcess/UserContent/WebUserContentController.messages.in:
3379
3380 2014-05-18  Rik Cabanier  <cabanier@adobe.com>
3381
3382         support for navigator.hardwareConcurrency
3383         https://bugs.webkit.org/show_bug.cgi?id=132588
3384
3385         Reviewed by Filip Pizlo.
3386
3387         * Configurations/FeatureDefines.xcconfig:
3388
3389 2014-05-18  Anders Carlsson  <andersca@apple.com>
3390
3391         Implement Navigations for all methods declared returning one
3392         https://bugs.webkit.org/show_bug.cgi?id=133048
3393         <rdar://problem/16830064>
3394
3395         Reviewed by Sam Weinig.
3396
3397         * UIProcess/API/Cocoa/WKWebView.mm:
3398         (-[WKWebView goToBackForwardListItem:]):
3399         (-[WKWebView goBack]):
3400         (-[WKWebView goForward]):
3401         (-[WKWebView reload]):
3402         (-[WKWebView reloadFromOrigin]):
3403         Create and return navigations.
3404
3405         (-[WKWebView _reload]):
3406         Call -[WKWebView reload].
3407
3408         * UIProcess/Cocoa/NavigationState.h:
3409         * UIProcess/Cocoa/NavigationState.mm:
3410         (WebKit::NavigationState::createBackForwardNavigation):
3411         Create a back/forward navigation.
3412
3413         (WebKit::NavigationState::createReloadNavigation):
3414         Create a reload navigation.
3415
3416         * UIProcess/WebPageProxy.cpp:
3417         (WebKit::WebPageProxy::reattachToWebProcessWithItem):
3418         Generate a navigation ID and send it with the GoToBackForwardItem message.
3419
3420         (WebKit::WebPageProxy::reload):
3421         Return a navigation ID.
3422
3423         (WebKit::WebPageProxy::goForward):
3424         Generate a navigation ID and send it with the GoForward message.
3425         
3426         (WebKit::WebPageProxy::goBack):
3427         Generate a navigation ID and send it with the GoBack message.
3428
3429         (WebKit::WebPageProxy::goToBackForwardItem):
3430         Generate a navigation ID and send it with the GoToBackForwardItem message.
3431
3432         * UIProcess/WebPageProxy.h:
3433         Return navigation IDs where appropriate.
3434
3435         * UIProcess/cf/WebPageProxyCF.cpp:
3436         (WebKit::WebPageProxy::restoreFromSessionStateData):
3437         Generate a navigation ID and send it with the RestoreSessionAndNavigateToCurrentItem message.
3438         
3439         * WebProcess/WebPage/WebPage.cpp:
3440         (WebKit::WebPage::goForward):
3441         (WebKit::WebPage::goBack):
3442         (WebKit::WebPage::goToBackForwardItem):
3443         Set up the pending navigation ID.
3444
3445         (WebKit::WebPage::restoreSessionAndNavigateToCurrentItem):
3446         Call goToBackForwardItem with a navigation ID.
3447