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