DFGGraph::m_doubleConstantMap will not map 0 values correctly.
[WebKit-https.git] / Source / WebKit2 / ChangeLog
1 2014-06-18  Anders Carlsson  <andersca@apple.com>
2
3         Add CF type cast function templates and use them in KeyedDecoder in WebKit2
4         https://bugs.webkit.org/show_bug.cgi?id=134033
5
6         Reviewed by Sam Weinig.
7
8         * Shared/cf/KeyedDecoder.cpp:
9         (WebKit::KeyedDecoder::KeyedDecoder):
10         (WebKit::KeyedDecoder::decodeBytes):
11         (WebKit::KeyedDecoder::decodeBool):
12         (WebKit::KeyedDecoder::decodeInt32):
13         (WebKit::KeyedDecoder::decodeInt64):
14         (WebKit::KeyedDecoder::decodeFloat):
15         (WebKit::KeyedDecoder::decodeDouble):
16         (WebKit::KeyedDecoder::decodeString):
17         (WebKit::KeyedDecoder::beginObject):
18         (WebKit::KeyedDecoder::beginArray):
19         (WebKit::KeyedDecoder::beginArrayElement):
20
21 2014-06-18  Dan Bernstein  <mitz@apple.com>
22
23         Remove the unused _WKBackForwardListDidChangeNotification.
24
25         Reviewed by Anders Carlsson.
26
27         * UIProcess/API/Cocoa/WKBackForwardList.mm:
28         * UIProcess/API/Cocoa/WKBackForwardListInternal.h:
29         * UIProcess/API/Cocoa/WKBackForwardListPrivate.h: Removed.
30         * UIProcess/Cocoa/NavigationState.h:
31         * UIProcess/Cocoa/NavigationState.mm:
32         (WebKit::NavigationState::LoaderClient::didChangeBackForwardList): Deleted.
33         * WebKit2.xcodeproj/project.pbxproj:
34
35 2014-06-18  Andreas Kling  <akling@apple.com>
36
37         Set main thread QoS policies after IPC initialization.
38         <https://webkit.org/b/134014>
39
40         Something was flipping the QoS level back to "unspecified" after
41         setting it in the ChildProcess initialization code. Pending a better
42         understanding of what really happens, move the code to a later stage,
43         after IPC channels are up and running. Now the priority sticks.
44
45         Reviewed by Anders Carlsson.
46
47         * NetworkProcess/NetworkProcess.cpp:
48         (WebKit::NetworkProcess::initializeNetworkProcess):
49         * Shared/ChildProcess.cpp:
50         (WebKit::ChildProcess::initialize):
51         * WebProcess/WebProcess.cpp:
52         (WebKit::WebProcess::initializeWebProcess):
53
54 2014-06-17  Dan Bernstein  <mitz@apple.com>
55
56         [Cocoa] WKWebView's _privateBrowsingEnabled property is unused
57         https://bugs.webkit.org/show_bug.cgi?id=134013
58
59         Reviewed by Sam Weinig.
60
61         * UIProcess/API/Cocoa/WKWebView.mm:
62         (-[WKWebView _privateBrowsingEnabled]): Deleted.
63         (-[WKWebView _setPrivateBrowsingEnabled:]): Deleted.
64         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
65
66 2014-06-17  Tim Horton  <timothy_horton@apple.com>
67
68         [iOS][wk2] Use ImageDocument to display subframe PDFs
69         https://bugs.webkit.org/show_bug.cgi?id=133944
70         <rdar://problem/17205983>
71
72         Reviewed by Dan Bates.
73
74         * WebProcess/WebPage/WebPage.cpp:
75         (WebKit::WebPage::updatePreferences):
76         Always use ImageDocument for subframe PDFs in WebKit2 on iOS.
77
78 2014-06-17  Anders Carlsson  <andersca@apple.com>
79
80         Make it possible to use -[NSBundle classNamed:] to find WebKitLegacy classes
81         https://bugs.webkit.org/show_bug.cgi?id=134008
82         <rdar://problem/17037600>
83
84         Reviewed by Dan Bernstein.
85
86         * UIProcess/API/Cocoa/LegacyBundleForClass.mm: Added.
87         * WebKit2.xcodeproj/project.pbxproj:
88
89 2014-06-17  Anders Carlsson  <andersca@apple.com>
90
91         Expose the location of website data
92         https://bugs.webkit.org/show_bug.cgi?id=134000
93         <rdar://problem/17350498>
94
95         Reviewed by Dan Bernstein.
96
97         Also, remove the bundle ID from the website data path for containerized apps.
98
99         * Shared/mac/SandboxUtilities.cpp:
100         (WebKit::processIsAppSandboxed):
101         * Shared/mac/SandboxUtilities.h:
102         * UIProcess/API/Cocoa/WKProcessPool.mm:
103         (+[WKProcessPool _websiteDataURLForContainerWithURL:]):
104         (websiteDataDirectoryURL):
105         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
106
107 2014-06-17  Jeremy Jones  <jeremyj@apple.com>
108
109         Improve enter and exit fullscreen transition by using two step transition.
110         https://bugs.webkit.org/show_bug.cgi?id=133706
111
112         Reviewed by Simon Fraser.
113
114         Add setupFullscreen()/didSetupFullscreen() and cleanupFullscreen()/didCleanupFullscreen()
115         to the proxies. And refactor enter/exit fullscreen to do some of the work in setup/cleanup.
116
117         * UIProcess/ios/WebVideoFullscreenManagerProxy.h:
118         Add four methods mentioned above.
119         * UIProcess/ios/WebVideoFullscreenManagerProxy.messages.in:
120         Add Setup/Cleanup functions.
121         * UIProcess/ios/WebVideoFullscreenManagerProxy.mm:
122         (WebKit::WebVideoFullscreenManagerProxy::setupFullscreenWithID): does what enterFullscreen used to do.
123         (WebKit::WebVideoFullscreenManagerProxy::didCleanupFullscreen): forward IPC.
124         (WebKit::WebVideoFullscreenManagerProxy::didSetupFullscreen): forward IPC.
125         (WebKit::WebVideoFullscreenManagerProxy::enterFullscreenWithID): changed to enterFullscreen
126         * WebProcess/ios/WebVideoFullscreenManager.h: Add didSetup/didCleanup
127         * WebProcess/ios/WebVideoFullscreenManager.messages.in: Add didSetup/didCleanup
128         * WebProcess/ios/WebVideoFullscreenManager.mm: 
129         (WebKit::WebVideoFullscreenManager::enterFullscreenForNode): refactored,
130         some implementation moves to didSetupFullscreen.
131         (WebKit::WebVideoFullscreenManager::didSetupFullscreen):
132         Moves the video layer over to the hosted layer, and initiates fullscreen.
133         (WebKit::WebVideoFullscreenManager::didExitFullscreen): refactored,
134         some implementation moves to didCleanupFullscreen, and initiates cleanup.
135         (WebKit::WebVideoFullscreenManager::didCleanupFullscreen):
136         Final cleanup refactored from didExitFullscreen()
137
138 2014-06-17  Eric Carlson  <eric.carlson@apple.com>
139
140         [iOS] enable background audio in WK2
141         https://bugs.webkit.org/show_bug.cgi?id=133996
142
143         Reviewed by Jer Noble.
144
145         * WebProcess/EntryPoint/mac/XPCService/WebContentService.Development/Info-iOS.plist: Mark as
146             allowed to play audio when in the background.
147         * WebProcess/EntryPoint/mac/XPCService/WebContentService/Info-iOS.plist: Ditto.
148
149 2014-06-17  Simon Fraser  <simon.fraser@apple.com>
150
151         [UI-side compositing] fix reflections on composited layers
152         https://bugs.webkit.org/show_bug.cgi?id=133942
153
154         Reviewed by Tim Horton.
155         
156         Fix reflections on composited layers. There are two main set of changes.
157         
158         First, a PlatformCALayerRemote which is a clone has to track the layer
159         it is a clone of, so it knows where to grab the contents from in the UI process.
160         This layer may be told that its contents need updating out of order during
161         recursiveBuildTransaction(), so we need some small changes in RemoteLayerTreeContext
162         to allow a layer to add itself to the set of layers requiring commit.
163         
164         In the UI process, a new step is added to RemoteLayerTreeHost::updateLayerTree()
165         to go through clones, and copy their contents from the origin layer.
166         
167         The second set of changes makes platformCALayerLayerDidDisplay() work for
168         UI-side compositing by not taking a PlatformLayer*, but instead a PlatformCALayer*.
169         PlatformCALayer::setContentsChanged() changed to copyContentsFromLayer() so we know
170         what the origin layer is.
171
172         * Shared/mac/RemoteLayerBackingStore.mm:
173         (WebKit::RemoteLayerBackingStore::display): Remove the early return so we can always
174         call platformCALayerLayerDidDisplay().
175         * Shared/mac/RemoteLayerTreeTransaction.h:
176         * Shared/mac/RemoteLayerTreeTransaction.mm:
177         (WebKit::RemoteLayerTreeTransaction::LayerProperties::LayerProperties):
178         (WebKit::RemoteLayerTreeTransaction::LayerProperties::encode):
179         (WebKit::RemoteLayerTreeTransaction::LayerProperties::decode):
180         (WebKit::dumpChangedLayers):
181         * UIProcess/mac/RemoteLayerTreeHost.mm:
182         (WebKit::RemoteLayerTreeHost::updateLayerTree):
183         * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
184         (WebKit::PlatformCALayerRemote::clone):
185         (WebKit::PlatformCALayerRemote::recursiveBuildTransaction):
186         (WebKit::PlatformCALayerRemote::copyContentsFromLayer):
187         (WebKit::PlatformCALayerRemote::setClonedLayer):
188         (WebKit::PlatformCALayerRemote::setContentsChanged): Deleted.
189         * WebProcess/WebPage/mac/PlatformCALayerRemote.h:
190         (WebKit::PlatformCALayerRemote::properties):
191         (WebKit::PlatformCALayerRemote::context):
192
193 2014-06-17  Anders Carlsson  <andersca@apple.com>
194
195         Remove session state methods from WKBrowsingContextController
196         https://bugs.webkit.org/show_bug.cgi?id=133995
197
198         Reviewed by Dan Bernstein.
199
200         * UIProcess/API/Cocoa/WKBrowsingContextController.h:
201         * UIProcess/API/Cocoa/WKBrowsingContextController.mm:
202         (-[WKBrowsingContextController sessionState]): Deleted.
203         (-[WKBrowsingContextController restoreFromSessionState:]): Deleted.
204
205 2014-06-17  Brady Eidson  <beidson@apple.com>
206
207         Only show telephone number highlights if only one number is selected
208         <rdar://problem/16874568> and https://bugs.webkit.org/show_bug.cgi?id=133989
209
210         Reviewed by Tim Horton.
211
212         Add a flag to TelephoneNumberData to remember if it was hovered over:
213         * WebProcess/WebPage/TelephoneNumberOverlayController.h:
214         (WebKit::TelephoneNumberData::hovered):
215         (WebKit::TelephoneNumberData::setHovered):
216         (WebKit::TelephoneNumberData::TelephoneNumberData):
217
218         * WebProcess/WebPage/mac/TelephoneNumberOverlayControllerMac.mm:
219         (WebKit::TelephoneNumberOverlayController::drawRect): Only draw the highlight if one
220           phone number is selected.
221         (WebKit::TelephoneNumberOverlayController::mouseEvent): Update the hover state of the
222           current phone number, and setNeedsDisplay if the hover state changes.
223         (WebKit::TelephoneNumberOverlayController::clearHighlights):
224
225 2014-06-17  Tim Horton  <timothy_horton@apple.com>
226
227         Remove WKContentView _setFindIndicator:fadeOut:animate:
228         https://bugs.webkit.org/show_bug.cgi?id=133976
229
230         Reviewed by Anders Carlsson.
231
232         Find indicators are totally internal to FindController on iOS,
233         we don't need to push them to the content view via PageClient,
234         so this code was unused.
235
236         * UIProcess/ios/PageClientImplIOS.mm:
237         (WebKit::PageClientImpl::setFindIndicator):
238         * UIProcess/ios/WKContentView.h:
239         * UIProcess/ios/WKContentView.mm:
240         (-[WKContentView _setFindIndicator:WebKit::fadeOut:animate:]): Deleted.
241
242 2014-06-17  Andreas Kling  <akling@apple.com>
243
244         Web process main thread priority is lower than some network process threads.
245         <https://webkit.org/b/133987>
246         <rdar://problem/17330300>
247
248         Mark the main thread as "user initiated" in process entry.
249
250         Reviewed by Maciej Stachowiak.
251
252         * Shared/ChildProcess.cpp:
253         (WebKit::ChildProcess::initialize):
254
255 2014-06-17  Anders Carlsson  <andersca@apple.com>
256
257         Add SPI to get the NSURLRequest from a WKNavigationResponse
258         https://bugs.webkit.org/show_bug.cgi?id=133984
259         <rdar://problem/17006399>
260
261         Reviewed by Dan Bernstein.
262
263         * UIProcess/API/Cocoa/WKNavigationResponse.mm:
264         (-[WKNavigationResponse _request]):
265         * UIProcess/API/Cocoa/WKNavigationResponseInternal.h:
266         * UIProcess/API/Cocoa/WKNavigationResponsePrivate.h:
267         * UIProcess/Cocoa/NavigationState.mm:
268         (WebKit::NavigationState::PolicyClient::decidePolicyForResponse):
269
270 2014-06-17  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
271
272         [EFL][WK2] Skip failing EFL API tests
273         https://bugs.webkit.org/show_bug.cgi?id=133981
274
275         Reviewed by Csaba Osztrogonác.
276
277         UserMessage, WillLoad and test_ewk2_view have been failed since r169784.
278
279         * PlatformEfl.cmake:
280
281 2014-06-17  Zan Dobersek  <zdobersek@igalia.com>
282
283         Unreviewed build fix for the GTK+ port. Removing the *Callback::create() wrappings
284         for lambda callbacks that aren't required anymore after the changes in r170041.
285
286         * UIProcess/API/gtk/WebKitWebView.cpp:
287         (webkit_web_view_can_execute_editing_command):
288         (webkit_web_view_run_javascript):
289         (resourcesStreamReadCallback):
290         (webkit_web_view_save):
291         (webkit_web_view_save_to_file):
292
293 2014-06-16  Jaehun Lim  <ljaehun.lim@samsung.com>
294
295         Unreviewed build fix when MHTML is enabled after r170041
296
297         * UIProcess/API/C/WKPage.cpp:
298         (WKPageGetContentsAsMHTMLData):
299
300 2014-06-16  Dan Bernstein  <mitz@apple.com>
301
302         Part 2 of: Change GenericCallback<> function parameters into std::function<>
303         https://bugs.webkit.org/show_bug.cgi?id=133927
304
305         Reviewed by Sam Weinig.
306
307         * UIProcess/API/C/WKPage.cpp:
308         (WKPageRunJavaScriptInMainFrame):
309         (WKPageRenderTreeExternalRepresentation):
310         (WKPageGetSourceForFrame):
311         (WKPageGetContentsAsString):
312         (WKPageGetBytecodeProfile):
313         (WKPageGetSelectionAsWebArchiveData):
314         (WKPageValidateCommand):
315         * UIProcess/API/C/WKPluginSiteDataManager.cpp:
316         (WKPluginSiteDataManagerClearSiteData):
317         (WKPluginSiteDataManagerClearAllSiteData):
318         * UIProcess/API/Cocoa/WKWebView.mm:
319         (-[WKWebView evaluateJavaScript:completionHandler:]):
320         * UIProcess/API/mac/WKView.mm:
321         (-[WKView validateUserInterfaceItem:]):
322         (-[WKView startSpeaking:]):
323         (-[WKView selectedRangeWithCompletionHandler:]):
324         (-[WKView markedRangeWithCompletionHandler:]):
325         (-[WKView hasMarkedTextWithCompletionHandler:]):
326         (-[WKView firstRectForCharacterRange:completionHandler:]):
327         (-[WKView characterIndexForPoint:completionHandler:]):
328         * UIProcess/Plugins/WebPluginSiteDataManager.cpp:
329         (WebKit::WebPluginSiteDataManager::clearSiteData):
330         * UIProcess/Plugins/WebPluginSiteDataManager.h:
331         * UIProcess/WebPageProxy.cpp:
332         (WebKit::WebPageProxy::validateCommand):
333         (WebKit::WebPageProxy::runJavaScriptInMainFrame):
334         (WebKit::WebPageProxy::getRenderTreeExternalRepresentation):
335         (WebKit::WebPageProxy::getSourceForFrame):
336         (WebKit::WebPageProxy::getContentsAsString):
337         (WebKit::WebPageProxy::getBytecodeProfile):
338         (WebKit::WebPageProxy::getContentsAsMHTMLData):
339         (WebKit::WebPageProxy::getSelectionOrContentsAsString):
340         (WebKit::WebPageProxy::getSelectionAsWebArchiveData):
341         (WebKit::WebPageProxy::getMarkedRangeAsync):
342         (WebKit::WebPageProxy::getSelectedRangeAsync):
343         (WebKit::WebPageProxy::characterIndexForPointAsync):
344         (WebKit::WebPageProxy::firstRectForCharacterRangeAsync):
345         (WebKit::WebPageProxy::takeSnapshot):
346         * UIProcess/WebPageProxy.h:
347         * UIProcess/ios/WKContentViewInteraction.mm:
348         (-[WKContentView _define:]):
349         (-[WKContentView changeSelectionWithTouchAt:withSelectionTouch:baseIsStart:]):
350         (-[WKContentView requestAutocorrectionRectsForString:withCompletionHandler:]):
351         (-[WKContentView requestDictationContext:]):
352         (-[WKContentView applyAutocorrection:toString:withCompletionHandler:]):
353         (-[WKContentView requestAutocorrectionContextWithCompletionHandler:]):
354         * UIProcess/ios/WebPageProxyIOS.mm:
355         (WebKit::WebPageProxy::updateSelectionWithTouches):
356         (WebKit::WebPageProxy::requestAutocorrectionData):
357         (WebKit::WebPageProxy::applyAutocorrection):
358         (WebKit::WebPageProxy::requestDictationContext):
359         (WebKit::WebPageProxy::requestAutocorrectionContext):
360
361 2014-06-16  Jaehun Lim  <ljaehun.lim@samsung.com>
362
363         Unreviewed build fix after r170029
364
365         Use String() instead of AtomicString().
366
367         * UIProcess/InspectorServer/HTTPRequest.cpp:
368         (WebKit::HTTPRequest::parseHeaders):
369
370 2014-06-16  Brent Fulgham  <bfulgham@apple.com>
371
372         [Win] Use TileController on Windows
373         https://bugs.webkit.org/show_bug.cgi?id=133895
374
375         Reviewed by Tim Horton.
376
377         * WebProcess/WebPage/mac/PlatformCALayerRemote.h: Remove
378         unneeded overload.
379
380 2014-06-16  Timothy Horton  <timothy_horton@apple.com>
381
382         [iOS][wk2] Swipe snapshots are removed too quickly if there is no saved render tree size
383         https://bugs.webkit.org/show_bug.cgi?id=133891
384
385         Reviewed by Simon Fraser.
386
387         * UIProcess/ios/ViewGestureControllerIOS.mm:
388         (WebKit::ViewGestureController::endSwipeGesture):
389         (WebKit::ViewGestureController::setRenderTreeSize):
390         If we don't know the target render tree size, wait until the first layer tree commit
391         that comes in, instead of removing the snapshot when the gesture ends.
392
393 2014-06-16  Timothy Horton  <timothy_horton@apple.com>
394
395         [iOS][wk2] Swiping back briefly shows the previous page before loading the new one
396         https://bugs.webkit.org/show_bug.cgi?id=133885
397
398         Reviewed by Simon Fraser.
399
400         Remove a race between the UI and Web processes when removing the swipe snapshot.
401         Previously, it was possible to get a commit from the Web process with layer content
402         (and render tree size) from the previous page *after* sending the navigation request
403         to the page, because of the asynchronicity of layer tree commits. This could cause
404         the snapshot to be removed early (if the previous fully-loaded page had a sufficiently
405         large render tree size), revealing the old tiles underneath the snapshot.
406
407         * Shared/mac/RemoteLayerTreeTransaction.h:
408         (WebKit::RemoteLayerTreeTransaction::transactionID):
409         (WebKit::RemoteLayerTreeTransaction::setTransactionID):
410         * Shared/mac/RemoteLayerTreeTransaction.mm:
411         (WebKit::RemoteLayerTreeTransaction::encode):
412         (WebKit::RemoteLayerTreeTransaction::decode):
413         * UIProcess/DrawingAreaProxy.h:
414         (WebKit::DrawingAreaProxy::lastVisibleTransactionID):
415         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h:
416         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
417         (WebKit::RemoteLayerTreeDrawingAreaProxy::RemoteLayerTreeDrawingAreaProxy):
418         (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
419         (WebKit::RemoteLayerTreeDrawingAreaProxy::coreAnimationDidCommitLayers):
420         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
421         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
422         (WebKit::RemoteLayerTreeDrawingArea::RemoteLayerTreeDrawingArea):
423         (WebKit::RemoteLayerTreeDrawingArea::flushLayers):
424         (WebKit::RemoteLayerTreeDrawingArea::didUpdate):
425         Keep track of an ever-increasing transaction ID in RemoteLayerTreeDrawingArea(Proxy).
426         It increments in the UI process at didUpdate time, because the Web process cannot
427         have started on a new layer tree commit until didUpdate is sent.
428         It increments in the Web process at commit time.
429
430         * UIProcess/ios/ViewGestureControllerIOS.mm:
431         (WebKit::ViewGestureController::endSwipeGesture):
432         (WebKit::ViewGestureController::setRenderTreeSize):
433         * UIProcess/mac/ViewGestureController.h:
434         Adopt transaction IDs; don't remove the snapshot until the commit
435         that includes the navigation arrives.
436
437 2014-06-16  Dan Bernstein  <mitz@apple.com>
438
439         <rdar://problem/17327707> [Cocoa] Expose WebPreferences::storageBlockingPolicy
440         https://bugs.webkit.org/show_bug.cgi?id=133958
441
442         Reviewed by Anders Carlsson.
443
444         * UIProcess/API/Cocoa/WKPreferences.mm:
445         (toStorageBlockingPolicy): Added this helper conversion function.
446         (toAPI): Ditto.
447         (-[WKPreferences _storageBlockingPolicy]): Added this getter.
448         (-[WKPreferences _setStorageBlockingPolicy:]): Added this setter.
449         * UIProcess/API/Cocoa/WKPreferencesPrivate.h: Declared new _storageBlockingPolicy property
450         and _WKStorageBlockingPolicy enum. 
451
452 2014-06-16  Anders Carlsson  <andersca@apple.com>
453
454         Don't use AtomicString in HTTPHeaderMap
455         https://bugs.webkit.org/show_bug.cgi?id=133957
456         <rdar://problem/15256572>
457
458         Reviewed by Andreas Kling.
459
460         Update for WebCore changes.
461
462         * Shared/WebCoreArgumentCoders.cpp:
463         (IPC::ArgumentCoder<HTTPHeaderMap>::decode):
464
465 2014-06-15  Anders Carlsson  <andersca@apple.com>
466
467         Change ResourceRequestBase::addHTTPHeaderFields to setHTTPHeaderFields instead
468         https://bugs.webkit.org/show_bug.cgi?id=133925
469
470         Reviewed by Sam Weinig.
471
472         * PluginProcess/PluginControllerProxy.h:
473         * Shared/WebCoreArgumentCoders.cpp:
474         (IPC::ArgumentCoder<ResourceRequest>::decode):
475         * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp:
476         (WebKit::NPN_PostURL):
477         * WebProcess/Plugins/PluginView.cpp:
478         (WebKit::PluginView::loadURL):
479         * WebProcess/Plugins/PluginView.h:
480
481 2014-06-16  Anders Carlsson  <andersca@apple.com>
482
483         Add HTTPHeaderName overloads on ResourceResponseBase
484         https://bugs.webkit.org/show_bug.cgi?id=133946
485
486         Reviewed by Andreas Kling.
487
488         * WebProcess/Plugins/PluginView.cpp:
489         (WebKit::buildHTTPHeaders):
490
491 2014-06-16  Dan Bernstein  <mitz@apple.com>
492
493         Fixed a typo in the last change.
494
495         * UIProcess/API/Cocoa/WKPreferences.mm:
496         (-[WKPreferences init]):
497
498 2014-06-16  Dan Bernstein  <mitz@apple.com>
499
500         [Cocoa] Remove WKPreferences persistence in user defaults
501         https://bugs.webkit.org/show_bug.cgi?id=133945
502
503         Reviewed by Anders Carlsson.
504
505         * UIProcess/API/Cocoa/WKPreferences.h: Removed userDefaultsKeyPrefix property and
506         initializer with userDefaultsKeyPrefix parameter.
507         * UIProcess/API/Cocoa/WKPreferences.mm:
508         (-[WKPreferences init]): Changed to initialize an instance with an empty identifier, which
509         means that it won’t persist to user defaults.
510         (-[WKPreferences initWithUserDefaultsKeyPrefix:]): Deleted.
511         (-[WKPreferences userDefaultsKeyPrefix]): Deleted.
512
513 2014-06-16  Zan Dobersek  <zdobersek@igalia.com>
514
515         Page::findStringMatchingRanges() should take Vector<RefPtr<Range>> by reference instead of pointer
516         https://bugs.webkit.org/show_bug.cgi?id=133677
517
518         Reviewed by Anders Carlsson.
519
520         * WebProcess/WebPage/FindController.cpp:
521         (WebKit::FindController::findString): Update the call to Page::findStringMatchingRanges() to pass
522         in a Vector<RefPtr<Range>> reference instead of a pointer.
523         (WebKit::FindController::findStringMatches): Ditto.
524
525 2014-06-16  Zan Dobersek  <zdobersek@igalia.com>
526
527         Unreviewed build fixes for the EFL and GTK+ ports after r169994 and 170000.
528
529         * UIProcess/API/C/WKPluginSiteDataManager.cpp: Undefine the None macro under X11.
530         * UIProcess/API/gtk/WebKitCookieManager.cpp:
531         (webkit_cookie_manager_get_accept_policy): Remove unnecessary ::create() wrappings.
532         (webkit_cookie_manager_get_domains_with_cookies): Ditto.
533         * UIProcess/API/gtk/WebKitWebResource.cpp:
534         (webkit_web_resource_get_data): Ditto.
535
536 2014-06-15  Dan Bernstein  <mitz@apple.com>
537
538         Part 1 of: Change GenericCallback<> function parameters into std::function<>
539         https://bugs.webkit.org/show_bug.cgi?id=133927
540
541         Reviewed by Sam Weinig.
542
543         * UIProcess/API/C/WKApplicationCacheManager.cpp:
544         (WKApplicationCacheManagerGetApplicationCacheOrigins):
545         * UIProcess/API/C/WKContext.cpp:
546         (WKContextGetStatistics):
547         (WKContextGetStatisticsWithOptions):
548         * UIProcess/API/C/WKCookieManager.cpp:
549         (WKCookieManagerGetHostnamesWithCookies):
550         (WKCookieManagerGetHTTPCookieAcceptPolicy):
551         * UIProcess/API/C/WKDatabaseManager.cpp:
552         (WKDatabaseManagerGetDatabasesByOrigin):
553         (WKDatabaseManagerGetDatabaseOrigins):
554         * UIProcess/API/C/WKFrame.cpp:
555         (WKFrameGetMainResourceData):
556         (WKFrameGetResourceData):
557         (WKFrameGetWebArchive):
558         * UIProcess/API/C/WKKeyValueStorageManager.cpp:
559         (WKKeyValueStorageManagerGetKeyValueStorageOrigins):
560         (WKKeyValueStorageManagerGetStorageDetailsByOrigin):
561         * UIProcess/API/C/WKMediaCacheManager.cpp:
562         (WKMediaCacheManagerGetHostnamesWithMediaCache):
563         * UIProcess/API/C/WKOriginDataManager.cpp:
564         (WKOriginDataManagerGetOrigins):
565         * UIProcess/API/C/WKPluginSiteDataManager.cpp:
566         (WKPluginSiteDataManagerGetSitesWithData):
567         * UIProcess/API/C/WKResourceCacheManager.cpp:
568         (WKResourceCacheManagerGetCacheOrigins):
569         * UIProcess/API/Cocoa/WKWebView.mm:
570         (-[WKWebView _getWebArchiveDataWithCompletionHandler:]):
571         * UIProcess/API/mac/WKView.mm:
572         (-[WKView attributedSubstringForProposedRange:completionHandler:]):
573         * UIProcess/Plugins/WebPluginSiteDataManager.cpp:
574         (WebKit::WebPluginSiteDataManager::getSitesWithData):
575         * UIProcess/Plugins/WebPluginSiteDataManager.h:
576         * UIProcess/WebApplicationCacheManagerProxy.cpp:
577         (WebKit::WebApplicationCacheManagerProxy::getApplicationCacheOrigins):
578         * UIProcess/WebApplicationCacheManagerProxy.h:
579         * UIProcess/WebContext.cpp:
580         (WebKit::WebContext::getStatistics):
581         * UIProcess/WebContext.h:
582         * UIProcess/WebCookieManagerProxy.cpp:
583         (WebKit::WebCookieManagerProxy::getHostnamesWithCookies):
584         (WebKit::WebCookieManagerProxy::getHTTPCookieAcceptPolicy):
585         * UIProcess/WebCookieManagerProxy.h:
586         * UIProcess/WebDatabaseManagerProxy.cpp:
587         (WebKit::WebDatabaseManagerProxy::getDatabasesByOrigin):
588         (WebKit::WebDatabaseManagerProxy::getDatabaseOrigins):
589         * UIProcess/WebDatabaseManagerProxy.h:
590         * UIProcess/WebFrameProxy.cpp:
591         (WebKit::WebFrameProxy::getWebArchive):
592         (WebKit::WebFrameProxy::getMainResourceData):
593         (WebKit::WebFrameProxy::getResourceData):
594         * UIProcess/WebFrameProxy.h:
595         * UIProcess/WebKeyValueStorageManager.cpp:
596         (WebKit::WebKeyValueStorageManager::getKeyValueStorageOrigins):
597         (WebKit::WebKeyValueStorageManager::getStorageDetailsByOrigin):
598         * UIProcess/WebKeyValueStorageManager.h:
599         * UIProcess/WebMediaCacheManagerProxy.cpp:
600         (WebKit::WebMediaCacheManagerProxy::getHostnamesWithMediaCache):
601         * UIProcess/WebMediaCacheManagerProxy.h:
602         * UIProcess/WebOriginDataManagerProxy.cpp:
603         (WebKit::WebOriginDataManagerProxy::getOrigins):
604         * UIProcess/WebOriginDataManagerProxy.h:
605         * UIProcess/WebPageProxy.cpp:
606         (WebKit::WebPageProxy::getMainResourceDataOfFrame):
607         (WebKit::WebPageProxy::getResourceDataFromFrame):
608         (WebKit::WebPageProxy::getWebArchiveOfFrame):
609         * UIProcess/WebPageProxy.h:
610         * UIProcess/WebResourceCacheManagerProxy.cpp:
611         (WebKit::WebResourceCacheManagerProxy::getCacheOrigins):
612         * UIProcess/WebResourceCacheManagerProxy.h:
613         * UIProcess/ios/WKContentViewInteraction.mm:
614         (-[WKContentView changeSelectionWithGestureAt:withGesture:withState:]):
615         (-[WKContentView changeSelectionWithTouchesFrom:to:withGesture:withState:]):
616         * UIProcess/ios/WebPageProxyIOS.mm:
617         (WebKit::WebPageProxy::selectWithGesture):
618         (WebKit::WebPageProxy::selectWithTwoTouches):
619         * UIProcess/mac/WebPageProxyMac.mm:
620         (WebKit::WebPageProxy::attributedSubstringForCharacterRangeAsync):
621
622 2014-06-15  Dan Bernstein  <mitz@apple.com>
623
624         <rdar://problem/17291697> [Cocoa] Can’t tell at policy decision time whether WebKit can handle the request
625         https://bugs.webkit.org/show_bug.cgi?id=133930
626
627         Reviewed by Sam Weinig.
628
629         * Shared/NavigationActionData.cpp:
630         (WebKit::NavigationActionData::NavigationActionData): Initialize new member canHandleRequest
631         to false.
632         (WebKit::NavigationActionData::encode): Encode canHandleRequest.
633         (WebKit::NavigationActionData::decode): Decode it.
634         * Shared/NavigationActionData.h: Declared new boolean member canHandleRequest.
635
636         * UIProcess/API/Cocoa/WKNavigationAction.mm:
637         (-[WKNavigationAction _initWithNavigationActionData:]): Set new ivar _canHandleRequest from
638         the action data.
639         (-[WKNavigationAction _canHandleRequest]): Added this getter.
640         * UIProcess/API/Cocoa/WKNavigationActionPrivate.h: Declared new property _canHandleRequest.
641
642         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
643         (WebKit::WebChromeClient::createWindow): Set canHandleRequest in the NavigationActionData.
644
645         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
646         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNewWindowAction): Ditto.
647         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction): Ditto.
648
649 2014-06-15  Ryuan Choi  <ryuan.choi@samsung.com>
650
651         [EFL][WK2] Change ewk_view_settings_get to ewk_page_group_settings_get
652         https://bugs.webkit.org/show_bug.cgi?id=133841
653
654         Reviewed by Gyuyoung Kim.
655
656         Ewk_Settings object is a member of Ewk_Page_Group.
657         So, Ewk_Page_Group is better place for the getter of Ewk_Settings.
658
659         * UIProcess/API/efl/ewk_page_group.cpp:
660         (ewk_page_group_settings_get): Added instead of ewk_view_settings_get.
661         * UIProcess/API/efl/ewk_page_group.h:
662         * UIProcess/API/efl/ewk_view.cpp:
663         (ewk_view_settings_get): Deleted.
664         * UIProcess/API/efl/ewk_view.h:
665         * UIProcess/API/efl/tests/test_ewk2_page_group.cpp:
666         (TEST_F):
667         * UIProcess/API/efl/tests/test_ewk2_settings.cpp:
668         (TEST_F):
669         * UIProcess/API/efl/tests/test_ewk2_view.cpp:
670         (TEST_F): Deleted.
671
672 2014-06-15  Anders Carlsson  <andersca@apple.com>
673
674         Add an autorelease() member function to RetainPtr
675         https://bugs.webkit.org/show_bug.cgi?id=133929
676
677         Reviewed by Dan Bernstein.
678
679         * Shared/API/Cocoa/_WKRemoteObjectRegistry.mm:
680         (-[_WKRemoteObjectRegistry remoteObjectProxyWithInterface:]):
681         * UIProcess/API/Cocoa/WKWebView.mm:
682         (-[WKWebView navigationDelegate]):
683         (-[WKWebView UIDelegate]):
684         (-[WKWebView loadRequest:]):
685         (-[WKWebView loadHTMLString:baseURL:]):
686         (-[WKWebView goToBackForwardListItem:]):
687         (-[WKWebView goBack]):
688         (-[WKWebView goForward]):
689         (-[WKWebView reload]):
690         (-[WKWebView reloadFromOrigin]):
691         (-[WKWebView _historyDelegate]):
692         * WebProcess/WebPage/mac/PlatformCAAnimationRemote.mm:
693         (WebKit::animationValueFromKeyframeValue):
694
695 2014-06-15  Dan Bernstein  <mitz@apple.com>
696
697         Get rid of VoidAPICallback
698         https://bugs.webkit.org/show_bug.cgi?id=133928
699
700         Reviewed by Sam Weinig.
701
702         * UIProcess/API/C/WKPage.cpp:
703         (WKPageForceRepaint): Wrap the API callback in a generic callback here.
704
705         * UIProcess/API/C/WKPluginSiteDataManager.cpp:
706         (WKPluginSiteDataManagerClearSiteData): Ditto.
707         (WKPluginSiteDataManagerClearAllSiteData): Ditto.
708
709         * UIProcess/GenericCallback.h:
710         (WebKit::GenericCallback::performCallback): Added this helper for 0-argument callbacks.
711         (WebKit::VoidCallback::create): Deleted.
712         (WebKit::VoidCallback::~VoidCallback): Deleted.
713         (WebKit::VoidCallback::performCallback): Deleted.
714         (WebKit::VoidCallback::invalidate): Deleted.
715         (WebKit::VoidCallback::VoidCallback): Deleted.
716         (WebKit::VoidAPICallback::create): Deleted.
717
718         * UIProcess/mac/WKFullScreenWindowController.h:
719
720 2014-06-15  Zan Dobersek  <zdobersek@igalia.com>
721
722         Unreviewed build fix for the GTK+ port after r169990.
723
724         * UIProcess/WebPageProxy.cpp:
725         (WebKit::WebPageProxy::resetState): Pass the error value to
726         the rest of invalidateCallbackMap calls.
727
728 2014-06-15  Anders Carlsson  <andersca@apple.com>
729
730         Remove WKPageRunJavaScriptInMainFrame_b
731         https://bugs.webkit.org/show_bug.cgi?id=133926
732
733         Reviewed by Dan Bernstein.
734
735         * UIProcess/API/C/WKPage.cpp:
736         (callRunJavaScriptBlockAndRelease): Deleted.
737         (WKPageRunJavaScriptInMainFrame_b): Deleted.
738         * UIProcess/API/C/WKPage.h:
739
740 2014-06-15  Anders Carlsson  <andersca@apple.com>
741
742         invalidateCallbackMap doesn’t pass the error parameter on to invalidate(), so script completion handler is passed the wrong error
743         https://bugs.webkit.org/show_bug.cgi?id=133921
744         <rdar://problem/17316653>
745
746         Reviewed by Dan Bernstein.
747
748         * UIProcess/GenericCallback.h:
749         (WebKit::VoidCallback::performCallback):
750         (WebKit::VoidCallback::invalidate):
751         (WebKit::VoidAPICallback::create):
752         (WebKit::invalidateCallbackMap):
753         * UIProcess/Plugins/WebPluginSiteDataManager.cpp:
754         (WebKit::WebPluginSiteDataManager::invalidate):
755         (WebKit::WebPluginSiteDataManager::clearSiteData):
756         * UIProcess/WebApplicationCacheManagerProxy.cpp:
757         (WebKit::WebApplicationCacheManagerProxy::contextDestroyed):
758         (WebKit::WebApplicationCacheManagerProxy::processDidClose):
759         * UIProcess/WebContext.cpp:
760         (WebKit::WebContext::~WebContext):
761         * UIProcess/WebCookieManagerProxy.cpp:
762         (WebKit::WebCookieManagerProxy::contextDestroyed):
763         (WebKit::WebCookieManagerProxy::processDidClose):
764         * UIProcess/WebDatabaseManagerProxy.cpp:
765         (WebKit::WebDatabaseManagerProxy::contextDestroyed):
766         (WebKit::WebDatabaseManagerProxy::processDidClose):
767         * UIProcess/WebMediaCacheManagerProxy.cpp:
768         (WebKit::WebMediaCacheManagerProxy::contextDestroyed):
769         (WebKit::WebMediaCacheManagerProxy::processDidClose):
770         * UIProcess/WebOriginDataManagerProxy.cpp:
771         (WebKit::WebOriginDataManagerProxy::contextDestroyed):
772         (WebKit::WebOriginDataManagerProxy::processDidClose):
773         * UIProcess/WebPageProxy.cpp:
774         (WebKit::WebPageProxy::forceRepaint):
775         (WebKit::WebPageProxy::resetState):
776         * UIProcess/WebResourceCacheManagerProxy.cpp:
777         (WebKit::WebResourceCacheManagerProxy::contextDestroyed):
778         (WebKit::WebResourceCacheManagerProxy::processDidClose):
779         * UIProcess/mac/WKFullScreenWindowController.mm:
780         (-[WKFullScreenWindowController dealloc]):
781         (-[WKFullScreenWindowController finishedExitFullScreenAnimation:]):
782
783 2014-06-15  Zan Dobersek  <zdobersek@igalia.com>
784
785         Unreviewed build fix for the GTK+ port after r169987.
786
787         * UIProcess/API/gtk/WebKitWebView.cpp:
788         (webkit_web_view_can_execute_editing_command): The first passed-in parameter
789         is now a reference to a const String object.
790
791 2014-06-14  Dan Bernstein  <mitz@apple.com>
792
793         Replace StringImpl* callback parameters with const String&
794         https://bugs.webkit.org/show_bug.cgi?id=133922
795
796         Reviewed by Sam Weinig.
797
798         * UIProcess/API/C/WKPage.cpp:
799         (toGenericCallbackFunction): Added this helper function to wrap a WKStringRef-returning
800         API callback in a generic const String&-returning callback.
801         (WKPageRenderTreeExternalRepresentation):
802         (WKPageGetSourceForFrame):
803         (WKPageGetContentsAsString):
804         (WKPageGetBytecodeProfile):
805         (WKPageValidateCommand):
806         * UIProcess/API/mac/WKView.mm:
807         (-[WKView validateUserInterfaceItem:]):
808         (-[WKView startSpeaking:]):
809         * UIProcess/WebPageProxy.h:
810         * UIProcess/ios/WKContentViewInteraction.mm:
811         (-[WKContentView _define:]):
812         (-[WKContentView applyAutocorrection:toString:withCompletionHandler:]):
813
814 2014-06-14  Dan Bernstein  <mitz@apple.com>
815
816         Additional iOS build fix.
817
818         * UIProcess/ios/WKContentViewInteraction.mm:
819         (-[WKContentView _define:]):
820         (selectionChangedWithGesture):
821         (selectionChangedWithTouch):
822         (-[WKContentView changeSelectionWithGestureAt:withGesture:withState:]):
823         (-[WKContentView changeSelectionWithTouchAt:withSelectionTouch:baseIsStart:]):
824         (-[WKContentView changeSelectionWithTouchesFrom:to:withGesture:withState:]):
825         (-[WKContentView applyAutocorrection:toString:withCompletionHandler:]):
826
827 2014-06-14  Dan Bernstein  <mitz@apple.com>
828
829         iOS build fix.
830
831         * UIProcess/API/Cocoa/WKWebView.mm:
832         (-[WKWebView _snapshotRect:intoImageOfWidth:completionHandler:]):
833
834 2014-06-14  Dan Bernstein  <mitz@apple.com>
835
836         Get rid of GenericAPICallback
837         https://bugs.webkit.org/show_bug.cgi?id=133909
838
839         Reviewed by Sam Weinig.
840
841         In preparation for passing callbacks as functions, replace GenericAPICallback::create, which
842         returned a GenericCallback, with a function template that returns an appropriate callback
843         function.
844
845         * UIProcess/API/C/WKApplicationCacheManager.cpp:
846         (WKApplicationCacheManagerGetApplicationCacheOrigins):
847         * UIProcess/API/C/WKContext.cpp:
848         (WKContextGetStatistics):
849         (WKContextGetStatisticsWithOptions):
850         * UIProcess/API/C/WKCookieManager.cpp:
851         (WKCookieManagerGetHostnamesWithCookies):
852         (WKCookieManagerGetHTTPCookieAcceptPolicy):
853         * UIProcess/API/C/WKDatabaseManager.cpp:
854         (WKDatabaseManagerGetDatabasesByOrigin):
855         (WKDatabaseManagerGetDatabaseOrigins):
856         * UIProcess/API/C/WKFrame.cpp:
857         (WKFrameGetMainResourceData):
858         (WKFrameGetResourceData):
859         (WKFrameGetWebArchive):
860         * UIProcess/API/C/WKKeyValueStorageManager.cpp:
861         (WKKeyValueStorageManagerGetKeyValueStorageOrigins):
862         (WKKeyValueStorageManagerGetStorageDetailsByOrigin):
863         * UIProcess/API/C/WKMediaCacheManager.cpp:
864         (WKMediaCacheManagerGetHostnamesWithMediaCache):
865         * UIProcess/API/C/WKOriginDataManager.cpp:
866         (WKOriginDataManagerGetOrigins):
867         * UIProcess/API/C/WKPage.cpp:
868         (WKPageRunJavaScriptInMainFrame):
869         (WKPageRenderTreeExternalRepresentation):
870         (WKPageGetSourceForFrame):
871         (WKPageGetContentsAsString):
872         (WKPageGetBytecodeProfile):
873         (WKPageGetSelectionAsWebArchiveData):
874         (WKPageGetContentsAsMHTMLData):
875         (WKPageDrawPagesToPDF):
876         * UIProcess/API/C/WKPluginSiteDataManager.cpp:
877         (WKPluginSiteDataManagerGetSitesWithData):
878         * UIProcess/API/C/WKResourceCacheManager.cpp:
879         (WKResourceCacheManagerGetCacheOrigins):
880
881         * UIProcess/GenericCallback.h:
882         (WebKit::toGenericCallbackFunction): Added. Given a C SPI callback function, returns a generic
883         callback function that wraps it.
884
885 2014-06-14  Dan Bernstein  <mitz@apple.com>
886
887         Reverted the last change, which broken the Mac build.
888
889         * UIProcess/GenericCallback.h:
890         (WebKit::invalidateCallbackMap):
891
892 2014-06-14  Dan Bernstein  <mitz@apple.com>
893
894         Tried to fix the GTK build.
895
896         * UIProcess/GenericCallback.h:
897         (WebKit::invalidateCallbackMap):
898
899 2014-06-14  Anders Carlsson  <andersca@apple.com>
900
901         Fix build.
902
903         * UIProcess/API/mac/WKView.mm:
904         (-[WKView selectedRangeWithCompletionHandler:]):
905         (-[WKView markedRangeWithCompletionHandler:]):
906         (-[WKView hasMarkedTextWithCompletionHandler:]):
907         (-[WKView attributedSubstringForProposedRange:completionHandler:]):
908         (-[WKView firstRectForCharacterRange:completionHandler:]):
909         (-[WKView characterIndexForPoint:completionHandler:]):
910
911 2014-06-14  Zan Dobersek  <zdobersek@igalia.com>
912
913         Unreviewed build fix for the GTK+ port.
914         Fixing the callback lambda parameters after r169962.
915
916         * UIProcess/API/gtk/WebKitPrintOperation.cpp:
917         (webkitPrintOperationPrintPagesForFrame):
918         * UIProcess/API/gtk/WebKitWebResource.cpp:
919         (webkit_web_resource_get_data):
920         * UIProcess/API/gtk/WebKitWebView.cpp:
921         (webkit_web_view_can_execute_editing_command):
922         (webkit_web_view_run_javascript):
923         (resourcesStreamReadCallback):
924         (webkit_web_view_save):
925         (webkit_web_view_save_to_file):
926
927 2014-06-14  Csaba Osztrogonác  <ossy@webkit.org>
928
929         URTBF after r169943 and r169946, use the format of set/get.
930
931         * UIProcess/InspectorServer/WebInspectorServer.cpp:
932         (WebKit::WebInspectorServer::didReceiveUnrecognizedHTTPRequest):
933         * UIProcess/InspectorServer/WebSocketServerConnection.cpp:
934         (WebKit::WebSocketServerConnection::readHTTPMessage):
935         (WebKit::WebSocketServerConnection::upgradeToWebSocketServerConnection):
936
937 2014-06-13  Andreas Kling  <akling@apple.com>
938
939         REGRESSION (r167635): Reference leak in NetworkResourceLoader while loads are being deferred.
940         <https://webkit.org/b/133894>
941         <rdar://problem/17312299>
942
943         Don't self-ref() in start() until we actually start; if page loads are being
944         deferred, start() will be called again once deferral stops.
945
946         This was causing us to leak the entire NetworkResourceLoader object graph.
947
948         Reviewed by Brady Eidson.
949
950         * NetworkProcess/NetworkResourceLoader.cpp:
951         (WebKit::NetworkResourceLoader::start):
952
953 2014-06-13  Dan Bernstein  <mitz@apple.com>
954
955         Make GenericCallback variadic
956         https://bugs.webkit.org/show_bug.cgi?id=133897
957
958         Reviewed by Sam Weinig.
959
960         Also eliminated legacy callback functions and all CallbackBase derived classes outside of
961         GenericCallback.h.
962
963         * UIProcess/API/C/WKPage.cpp:
964         (WKPageValidateCommand): Changed legacy callback (with leading bool parameter) into modern
965         callback (with trailing error parameter).
966         (WKPageComputePagesForPrinting): Ditto.
967
968         * UIProcess/API/Cocoa/WKWebView.mm:
969         (-[WKWebView _getWebArchiveDataWithCompletionHandler:]): Ditto.
970         (-[WKWebView _snapshotRect:intoImageOfWidth:completionHandler:]): Ditto.
971
972         * UIProcess/API/Cocoa/_WKThumbnailView.mm:
973         (-[_WKThumbnailView _requestSnapshotIfNeeded]): Ditto.
974
975         * UIProcess/API/mac/WKView.mm:
976         (-[WKView validateUserInterfaceItem:]): Ditto.
977         (-[WKView startSpeaking:]): Ditto.
978
979         * UIProcess/AutoCorrectionCallback.h: Replaced CallbackBase derived classes with
980         GenericCallback specializations.
981
982         * UIProcess/GenericCallback.h:
983         - Made GenericCallback variadic:
984         (WebKit::GenericCallback::performCallbackWithReturnValue):
985         (WebKit::GenericCallback::invalidate):
986         (WebKit::GenericAPICallback::create):
987
988         - Replaced CallbackBase derived classes with GenericCallback specializations:
989         (WebKit::GenericCallback::create): Deleted.
990         (WebKit::ComputedPagesCallback::create): Deleted.
991         (WebKit::ComputedPagesCallback::~ComputedPagesCallback): Deleted.
992         (WebKit::ComputedPagesCallback::performCallbackWithReturnValue): Deleted.
993         (WebKit::ComputedPagesCallback::invalidate): Deleted.
994         (WebKit::ComputedPagesCallback::ComputedPagesCallback): Deleted.
995         (WebKit::ImageCallback::create): Deleted.
996         (WebKit::ImageCallback::~ImageCallback): Deleted.
997         (WebKit::ImageCallback::performCallbackWithReturnValue): Deleted.
998         (WebKit::ImageCallback::invalidate): Deleted.
999         (WebKit::ImageCallback::ImageCallback): Deleted.
1000
1001         * UIProcess/WebPageProxy.h: Replaced CallbackBase derived classes with GenericCallback
1002         specializations.
1003
1004         * UIProcess/ios/WKContentViewInteraction.mm:
1005         (-[WKContentView requestAutocorrectionRectsForString:withCompletionHandler:]): Changed
1006         legacy callback (with leading bool parameter) into modern callback (with trailing error
1007         parameter).
1008         (-[WKContentView requestDictationContext:]): Ditto.
1009         (-[WKContentView requestAutocorrectionContextWithCompletionHandler:]): Ditto.
1010
1011         * UIProcess/mac/WKPrintingView.mm:
1012         (-[WKPrintingView _preparePDFDataForPrintingOnSecondaryThread]): Ditto.
1013         (-[WKPrintingView _askPageToComputePageRects]): Ditto.
1014         (-[WKPrintingView _drawPreview:]): Ditto.
1015
1016 2014-06-13  Tim Horton  <timothy_horton@apple.com>
1017
1018         Unreviewed; fix the build.
1019
1020         * Shared/mac/RemoteLayerBackingStore.mm:
1021         (WebKit::RemoteLayerBackingStore::drawInContext):
1022
1023 2014-06-13  Martin Hock  <mhock@apple.com>
1024
1025         Clean up layers in RemoteLayerTreeHost::clearLayers().
1026         https://bugs.webkit.org/show_bug.cgi?id=133888
1027
1028         Reviewed by Tim Horton.
1029
1030         * UIProcess/mac/RemoteLayerTreeHost.mm:
1031         (WebKit::RemoteLayerTreeHost::clearLayers):
1032
1033 2014-06-13  Anders Carlsson  <andersca@apple.com>
1034
1035         Add a HTTPHeaderMap::get overload that takes an HTTPHeaderName
1036         https://bugs.webkit.org/show_bug.cgi?id=133877
1037
1038         Reviewed by Andreas Kling.
1039
1040         * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp:
1041         (WebKit::parsePostBuffer):
1042
1043 2014-06-13  Dan Bernstein  <mitz@apple.com>
1044
1045         [iOS] Networking process always decodes keys
1046         https://bugs.webkit.org/show_bug.cgi?id=133863
1047
1048         Reviewed by Anders Carlsson.
1049
1050         * Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.h:
1051         (WebKit::XPCServiceInitializer): Call checkEntitlements on iOS, too.
1052         * Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.mm:
1053         (WebKit::XPCServiceInitializerDelegate::checkEntitlements): On iOS, allow decoding keys
1054         if the application has the appropriate keychain access group.
1055
1056         * Shared/cf/ArgumentCodersCF.cpp:
1057         (IPC::setAllowsDecodingSecKeyRef): Added. Sets static bool.
1058         (IPC::decode): Check the secKeyRefDecodingAllowed bool before decoding a key.
1059         * Shared/cf/ArgumentCodersCF.h:
1060
1061 2014-06-12  Anders Carlsson  <andersca@apple.com>
1062
1063         Add overloads of HTTPHeaderMap::find and remove that take enums
1064         https://bugs.webkit.org/show_bug.cgi?id=133823
1065
1066         Reviewed by Sam Weinig.
1067
1068         * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp:
1069         (WebKit::parsePostBuffer):
1070         Update for WebCore changes.
1071
1072 2014-06-12  Benjamin Poulain  <bpoulain@apple.com>
1073
1074         [iOS][WK2] Do not update the viewport configuration on load until the first viewport arguments is received
1075         https://bugs.webkit.org/show_bug.cgi?id=133719
1076         <rdar://problem/17008149>
1077
1078         Reviewed by Simon Fraser.
1079
1080         When pages are loaded from the page cache, we were updating the viewport to the initial values
1081         in WebPage::dynamicViewportSizeUpdate(), then update the viewport again when the page's viewport argument
1082         are received.
1083
1084         The problem is that was messing up with text autosizing. The page would relayout with the default viewport
1085         configuration, adopt the text autosizing parameters from that size, then remain in that state when
1086         the actual viewport configuration would be set.
1087
1088         With this patch, the viewport configuration is updated from the values in WebCore instead of with default values.
1089         For new documents, this is strictly equivalent. For documents coming from the page cache, the values are from
1090         the previous state of the page, which ensure we do not restart negotiating a viewport configuration from scratch.
1091
1092         * WebProcess/WebPage/WebPage.cpp:
1093         (WebKit::WebPage::didCommitLoad):
1094
1095 2014-06-12  Gavin Barraclough  <barraclough@apple.com>
1096
1097         Add support for thread/WorkQueue QoS
1098         https://bugs.webkit.org/show_bug.cgi?id=130688
1099
1100         Reviewed by Anders Carlson & Simon Fraser.
1101
1102         The EventDispatcher's WorkQueue should be UserInteractive.
1103
1104         * Platform/WorkQueue.cpp:
1105         (WorkQueue::create):
1106             - pass QOS to constructor.
1107         (WorkQueue::WorkQueue):
1108             - pass QOS to platformInitialize.
1109         * Platform/WorkQueue.h:
1110             - added enum, arguments.
1111         * Platform/efl/WorkQueueEfl.cpp:
1112         (WorkQueue::platformInitialize):
1113             - has extra argument.
1114         * Platform/gtk/WorkQueueGtk.cpp:
1115         (WorkQueue::platformInitialize):
1116             - has extra argument.
1117         * Platform/mac/WorkQueueMac.cpp:
1118         (platformQOS):
1119             - map from enum to platform type.
1120         (WorkQueue::platformInitialize):
1121             - set the QoS of the dispatch queue.
1122         * WebProcess/WebPage/EventDispatcher.cpp:
1123         (WebKit::EventDispatcher::EventDispatcher):
1124             - EventDispatcher's WorkQueue should be UserInteractive.
1125         * config.h:
1126             - added HAVE_QOS_CLASSES
1127
1128 2014-06-12  Simon Fraser  <simon.fraser@apple.com>
1129
1130         [iOS] Tiny hack to fix WebKitTestRunner view visibility
1131         https://bugs.webkit.org/show_bug.cgi?id=133833
1132
1133         Reviewed by Tim Horton.
1134         
1135         PageClientImplIOS in WebKitTestRunner has a null m_webView, so isViewInWindow
1136         was returning false, which confused things.
1137         
1138         Fix by falling back to a check on the content view if the m_webView is nil.
1139
1140         * UIProcess/ios/PageClientImplIOS.mm:
1141         (WebKit::PageClientImpl::isViewVisible):
1142         (WebKit::PageClientImpl::isViewInWindow):
1143
1144 2014-06-12  Brady Eidson  <beidson@apple.com>
1145
1146         Add SPI for image controls and service controls preferences.
1147         <rdar://problem/17292209> and https://bugs.webkit.org/show_bug.cgi?id=133820
1148
1149         Reviewed by Anders Carlsson.
1150
1151         * UIProcess/API/C/WKPreferences.cpp:
1152         (WKPreferencesSetServiceControlsEnabled):
1153         (WKPreferencesGetServiceControlsEnabled):
1154         (WKPreferencesSetImageControlsEnabled):
1155         (WKPreferencesGetImageControlsEnabled):
1156         * UIProcess/API/C/WKPreferencesRefPrivate.h:
1157
1158 2014-06-12  Alexey Proskuryakov  <ap@apple.com>
1159
1160         [Mac] Allow reading com.apple.universalaccess preferences
1161         https://bugs.webkit.org/show_bug.cgi?id=133817
1162         <rdar://problem/17028261>
1163
1164         Reviewed by Anders Carlsson.
1165
1166         * WebProcess/com.apple.WebProcess.sb.in:
1167
1168 2014-06-12  Anders Carlsson  <andersca@apple.com>
1169
1170         Fix build.
1171
1172         * Shared/WebCoreArgumentCoders.cpp:
1173         (IPC::ArgumentCoder<HTTPHeaderMap>::decode):
1174         (CoreIPC::ArgumentCoder<ResourceRequest>::decode):
1175
1176 2014-06-12  Dan Bernstein  <mitz@apple.com>
1177
1178         Fixed a harmless error message when rewrite-availability-macros.sh is run in a clean build.
1179
1180         Rubber-stamped by Anders Carlsson.
1181
1182         * mac/rewrite-availability-macros.sh:
1183
1184 2014-06-12  Carlos Garcia Campos  <cgarcia@igalia.com>
1185
1186         [GTK] Remove view mode API
1187         https://bugs.webkit.org/show_bug.cgi?id=133725
1188
1189         Reviewed by Martin Robinson.
1190
1191         It currently does nothing because support for view source mode was
1192         removed from WebCore.
1193
1194         * UIProcess/API/gtk/WebKitWebView.cpp:
1195         (webkitWebViewSetProperty):
1196         (webkitWebViewGetProperty):
1197         (webkit_web_view_class_init):
1198         (webkit_web_view_set_view_mode): Deleted.
1199         (webkit_web_view_get_view_mode): Deleted.
1200         * UIProcess/API/gtk/WebKitWebView.h:
1201         * UIProcess/API/gtk/docs/webkit2gtk-sections.txt:
1202
1203 2014-06-12  Pratik Solanki  <psolanki@apple.com>
1204
1205         Avoid creating a CFData when checking if a resource is file backed
1206         https://bugs.webkit.org/show_bug.cgi?id=133783
1207
1208         Reviewed by Andreas Kling.
1209
1210         When a resource is file backed, we have it as a single CFDataRef in SharedBuffer. Add an
1211         early return in tryGetShareableHandleFromSharedBuffer() so we don't end up creating a new
1212         CFDataRef if we don't already have one in SharedBuffer. If we had to create a CFDataRef, the
1213         it can't have been a file backed resource.
1214
1215         * NetworkProcess/mac/NetworkResourceLoaderMac.mm:
1216         (WebKit::NetworkResourceLoader::tryGetShareableHandleFromSharedBuffer):
1217
1218 2014-06-11  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
1219
1220         Fix build break on EFL and GTK ports since r169820
1221         https://bugs.webkit.org/show_bug.cgi?id=133786
1222
1223         Reviewed by Philippe Normand.
1224
1225         ENABLE_PRIMARY_SNAPSHOTTED_PLUGIN_HEURISTIC macro are missing in PluginView::pluginSnapshotTimerFired().
1226
1227         * WebProcess/Plugins/PluginView.cpp:
1228         (WebKit::PluginView::pluginSnapshotTimerFired):
1229
1230 2014-06-11  Csaba Osztrogonác  <ossy@webkit.org>
1231
1232         [EFL][GTK] Ultimate fix not to have build failures
1233         in the future because of "#if TARGET_OS_IPHONE" guards.
1234
1235         Unreviewed buildfix.
1236
1237         Revert the previous wrong fix attempt r169879.
1238
1239         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
1240         * WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h:
1241
1242 2014-06-11  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
1243
1244         Fix build break on EFL port since r169869
1245         https://bugs.webkit.org/show_bug.cgi?id=133785
1246
1247         Unreviewed, fix a build break on EFL port.
1248
1249         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp: Use defined(TARGET_OS_IPHONE).
1250         * WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h: ditto.
1251
1252 2014-06-11  Simon Fraser  <simon.fraser@apple.com>
1253
1254         [iOS WK2] Give WebKitTestRunner a viewport configuration with initial scale=1 for testing
1255         https://bugs.webkit.org/show_bug.cgi?id=133779
1256
1257         Reviewed by Benjamin Poulain.
1258         
1259         Support a custom viewport configuration for testing, on iOS.
1260
1261         * UIProcess/API/ios/WKViewIOS.mm:
1262         (-[WKView _frameOrBoundsChanged]): Call setViewportConfigurationMinimumLayoutSize()
1263         just as WKWebView does.
1264         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
1265         (WKBundlePageSetUseTestingViewportConfiguration): New SPI to set a viewport config for testing.
1266         * WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h: Ditto.
1267         * WebProcess/WebPage/WebPage.cpp:
1268         (WebKit::WebPage::WebPage):
1269         * WebProcess/WebPage/WebPage.h:
1270         (WebKit::WebPage::setUseTestingViewportConfiguration):
1271         (WebKit::WebPage::isUsingTestingViewportConfiguration):
1272         * WebProcess/WebPage/ios/WebPageIOS.mm:
1273         (WebKit::WebPage::resetViewportDefaultConfiguration):
1274
1275 2014-06-11  Timothy Horton  <timothy_horton@apple.com>
1276
1277         Remove unused VisibleContentRectUpdateInfo update ID
1278         https://bugs.webkit.org/show_bug.cgi?id=133777
1279
1280         Reviewed by Benjamin Poulain.
1281
1282         Remove some unused code.
1283
1284         * Shared/VisibleContentRectUpdateInfo.cpp:
1285         (WebKit::VisibleContentRectUpdateInfo::encode):
1286         (WebKit::VisibleContentRectUpdateInfo::decode):
1287         * Shared/VisibleContentRectUpdateInfo.h:
1288         (WebKit::VisibleContentRectUpdateInfo::VisibleContentRectUpdateInfo):
1289         (WebKit::operator==):
1290         (WebKit::VisibleContentRectUpdateInfo::updateID): Deleted.
1291         * Shared/mac/RemoteLayerTreeTransaction.h:
1292         (WebKit::RemoteLayerTreeTransaction::setLastVisibleContentRectUpdateID): Deleted.
1293         (WebKit::RemoteLayerTreeTransaction::lastVisibleContentRectUpdateID): Deleted.
1294         * Shared/mac/RemoteLayerTreeTransaction.mm:
1295         (WebKit::RemoteLayerTreeTransaction::encode):
1296         (WebKit::RemoteLayerTreeTransaction::decode):
1297         * UIProcess/WebPageProxy.h:
1298         (WebKit::WebPageProxy::nextVisibleContentRectUpdateID): Deleted.
1299         (WebKit::WebPageProxy::lastVisibleContentRectUpdateID): Deleted.
1300         * UIProcess/ios/WKContentView.mm:
1301         (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:]):
1302         * WebProcess/WebPage/WebPage.cpp:
1303         (WebKit::WebPage::WebPage):
1304         (WebKit::WebPage::willCommitLayerTree):
1305         * WebProcess/WebPage/WebPage.h:
1306         * WebProcess/WebPage/ios/WebPageIOS.mm:
1307         (WebKit::WebPage::updateVisibleContentRects):
1308
1309 2014-06-11  Dan Bernstein  <mitz@apple.com>
1310
1311         [Cocoa] Move CompletionHandlerCallChecker into a separate file
1312         https://bugs.webkit.org/show_bug.cgi?id=133774
1313
1314         Reviewed by Anders Carlsson.
1315
1316         * Shared/Cocoa/CompletionHandlerCallChecker.h: Added.
1317         * Shared/Cocoa/CompletionHandlerCallChecker.mm: Added.
1318         (WebKit::CompletionHandlerCallChecker::create):
1319         (WebKit::CompletionHandlerCallChecker::CompletionHandlerCallChecker):
1320         (WebKit::CompletionHandlerCallChecker::~CompletionHandlerCallChecker):
1321         (WebKit::CompletionHandlerCallChecker::didCallCompletionHandler):
1322         (WebKit::CompletionHandlerCallChecker::classImplementingDelegateMethod):
1323
1324         * UIProcess/Cocoa/UIDelegate.mm:
1325         (WebKit::CompletionHandlerCallChecker::create): Deleted.
1326         (WebKit::CompletionHandlerCallChecker::~CompletionHandlerCallChecker): Deleted.
1327         (WebKit::CompletionHandlerCallChecker::didCallCompletionHandler): Deleted.
1328         (WebKit::CompletionHandlerCallChecker::CompletionHandlerCallChecker): Deleted.
1329         (WebKit::CompletionHandlerCallChecker::classImplementingDelegateMethod): Deleted.
1330         * WebKit2.xcodeproj/project.pbxproj:
1331
1332 2014-06-11  Martin Hock  <mhock@apple.com>
1333
1334         [iOS] Clear UIProcess visual state after WebProcess crash
1335         https://bugs.webkit.org/show_bug.cgi?id=133664
1336         <rdar://problem/16952742>
1337
1338         Reviewed by Benjamin Poulain.
1339
1340         * UIProcess/API/Cocoa/WKWebView.mm:
1341         (-[WKWebView _didRelaunchProcess]):
1342         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1343         * UIProcess/ios/PageClientImplIOS.mm:
1344         (WebKit::PageClientImpl::didRelaunchProcess):
1345         * UIProcess/mac/RemoteLayerTreeHost.h:
1346         * UIProcess/mac/RemoteLayerTreeHost.mm:
1347         (WebKit::RemoteLayerTreeHost::~RemoteLayerTreeHost):
1348         (WebKit::RemoteLayerTreeHost::clearLayers):
1349
1350 2014-06-11  Tim Horton  <timothy_horton@apple.com>
1351
1352         Implement swipeWithEvent for non-fluid swipes
1353         https://bugs.webkit.org/show_bug.cgi?id=133766
1354         <rdar://problem/17126889>
1355
1356         Reviewed by Anders Carlsson.
1357
1358         * UIProcess/API/mac/WKView.mm:
1359         (-[WKView swipeWithEvent:]):
1360         On non-fluid swipes, go back or forward depending on the swipe direction.
1361
1362 2014-06-11  Dan Bernstein  <mitz@apple.com>
1363
1364         [Cocoa] Xcode cannot infer that the WebKit target implicitly depends on WebCore.framework
1365         https://bugs.webkit.org/show_bug.cgi?id=133765
1366
1367         Reviewed by Anders Carlsson.
1368
1369         * Configurations/WebKit.xcconfig: Move linking against WebCore from OTHER_LDFLAGS here...
1370         * WebKit2.xcodeproj/project.pbxproj: ...to the Link Binary With Libraries build phase here.
1371
1372 2014-06-11  Timothy Horton  <timothy_horton@apple.com>
1373
1374         [wk2] Don't dispatch view state changes immediately
1375         https://bugs.webkit.org/show_bug.cgi?id=133713
1376
1377         Reviewed by Simon Fraser.
1378
1379         * UIProcess/WebPageProxy.cpp:
1380         (WebKit::WebPageProxy::WebPageProxy):
1381         (WebKit::WebPageProxy::viewStateDidChange):
1382         (WebKit::WebPageProxy::dispatchViewStateChange):
1383         (WebKit::WebPageProxy::updateViewState): Deleted.
1384         * UIProcess/WebPageProxy.h:
1385         On PLATFORM(COCOA), wait until just before CA is going to commit the UI process layer
1386         tree to dispatch view state changes to the Web process. This avoids sending multiple
1387         view state change messages to the Web process within one run-loop cycle, for example
1388         when a view is moved around in the view hierarchy but the view state otherwise remains the same.
1389
1390 2014-06-11  Timothy Horton  <timothy_horton@apple.com>
1391
1392         Make it possible for waitForAndDispatchImmediately to bail if a sync message comes in from the other direction
1393         https://bugs.webkit.org/show_bug.cgi?id=133708
1394
1395         Reviewed by Anders Carlsson.
1396
1397         * Platform/IPC/Connection.cpp:
1398         (IPC::WaitForMessageState):
1399         (IPC::Connection::Connection):
1400         (IPC::Connection::waitForMessage):
1401         (IPC::Connection::processIncomingMessage):
1402         (IPC::Connection::connectionDidClose):
1403         * Platform/IPC/Connection.h:
1404         (IPC::Connection::waitForAndDispatchImmediately):
1405         Remove the waitForMessageMap, and assert that we're only ever waiting for one message at a time.
1406         This simplifies this code a bit, and we never wait on more than one message at a time, so it was unnecessary.
1407
1408         Add a flag to waitForAndDispatchImmediately, InterruptWaitingIfSyncMessageArrives, which will cause
1409         waitForAndDispatchImmediately to bail if a sync message arrives, to avoid pointlessly blocking both processes
1410         for the entire timeout.
1411
1412 2014-06-11  Oliver Hunt  <oliver@apple.com>
1413
1414         Restrict database process profile
1415         https://bugs.webkit.org/show_bug.cgi?id=133750
1416
1417         Reviewed by Alexey Proskuryakov.
1418
1419         Make the sandbox profile much more restrictive.
1420
1421         * Resources/SandboxProfiles/ios/com.apple.WebKit.Databases.sb:
1422
1423 2014-06-11  Roger Fong  <roger_fong@apple.com>
1424
1425         Don't snapshot offscreen plugins that would normally be considered primary plugins after they are moved in view.
1426         https://bugs.webkit.org/show_bug.cgi?id=133667.
1427         <rdar://problem/16743250>
1428
1429         Reviewed by Tim Horton.
1430
1431         * WebProcess/Plugins/PluginView.cpp:
1432         (WebKit::PluginView::PluginView):
1433         (WebKit::PluginView::pluginSnapshotTimerFired):
1434         Set the display state to Playing if the following is true:
1435         The plugin in question is large enough to be considered the primary snapshot and either:
1436         a) The maximum number of snapshot retries has been reached and no good snapshot has been found.
1437         b) The plugin is moved to be on-screen while the snapshot attempts are in progress.
1438         * WebProcess/Plugins/PluginView.h:
1439         * WebProcess/WebPage/WebPage.cpp:
1440         (WebKit::WebPage::plugInIntersectsSearchRect): Re-factor out intersection logic.
1441         (WebKit::WebPage::plugInIsPrimarySize): Re-factor out primary plugin size logic.
1442         (WebKit::WebPage::determinePrimarySnapshottedPlugIn): Use the above two methods here.
1443         * WebProcess/WebPage/WebPage.h:
1444
1445 2014-06-11  Anders Carlsson  <andersca@apple.com>
1446
1447         Move more WKPreferences to WKWebViewConfiguration
1448         https://bugs.webkit.org/show_bug.cgi?id=133756
1449         <rdar://problem/17271468>
1450
1451         Reviewed by Tim Horton.
1452
1453         * UIProcess/API/Cocoa/WKPreferences.h:
1454         * UIProcess/API/Cocoa/WKPreferences.mm:
1455         (-[WKPreferences setMinimumFontSize:]):
1456         (-[WKPreferences suppressesIncrementalRendering]): Deleted.
1457         (-[WKPreferences setSuppressesIncrementalRendering:]): Deleted.
1458         (-[WKPreferences allowsInlineMediaPlayback]): Deleted.
1459         (-[WKPreferences setAllowsInlineMediaPlayback:]): Deleted.
1460         (-[WKPreferences mediaPlaybackRequiresUserAction]): Deleted.
1461         (-[WKPreferences setMediaPlaybackRequiresUserAction:]): Deleted.
1462         (-[WKPreferences mediaPlaybackAllowsAirPlay]): Deleted.
1463         (-[WKPreferences setMediaPlaybackAllowsAirPlay:]): Deleted.
1464         * UIProcess/API/Cocoa/WKWebView.mm:
1465         (-[WKWebView initWithFrame:configuration:]):
1466         * UIProcess/API/Cocoa/WKWebViewConfiguration.h:
1467         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
1468         (-[WKWebViewConfiguration copyWithZone:]):
1469         * WebKit2.xcodeproj/project.pbxproj:
1470
1471 2014-06-11  Enrica Casucci  <enrica@apple.com>
1472
1473         WebKit2 iOS: Unable to open UI menu for "open in new tab" for links on yahoo.com.
1474         https://bugs.webkit.org/show_bug.cgi?id=133749
1475         <rdar://problem/17165992>
1476
1477         Reviewed by Brady Eidson.
1478
1479         The URL returned to the UIProcess as string needs to be encoded.
1480
1481         * WebProcess/WebPage/ios/WebPageIOS.mm:
1482         (WebKit::WebPage::getPositionInformation):
1483
1484 2014-06-10  Anders Carlsson  <andersca@apple.com>
1485
1486         Move suppressesIncrementalRendering to WKWebViewConfiguration
1487         https://bugs.webkit.org/show_bug.cgi?id=133707
1488         <rdar://problem/17271468>
1489
1490         Reviewed by Sam Weinig.
1491
1492         * UIProcess/API/Cocoa/WKPreferences.h:
1493         Get rid of suppressesIncrementalRendering.
1494
1495         * UIProcess/API/Cocoa/WKWebView.mm:
1496         (-[WKWebView initWithFrame:configuration:]):
1497         Set the suppressesIncrementalRenderingKey key in webPageConfiguration.preferenceValues.
1498
1499         * UIProcess/API/Cocoa/WKWebViewConfiguration.h:
1500         Add suppressesIncrementalRendering.
1501
1502         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
1503         (-[WKWebViewConfiguration copyWithZone:]):
1504         Assign suppressesIncrementalRendering.
1505
1506         * UIProcess/WebPageProxy.cpp:
1507         (WebKit::WebPageProxy::WebPageProxy):
1508         Copy webPageConfiguration.preferenceValues to m_configurationPreferenceValues.
1509
1510         (WebKit::WebPageProxy::preferencesStore):
1511         If m_configurationPreferenceValues is empty, just return m_preferences->store(). Otherwise,
1512         copy the store and apply the configuration preference values.
1513
1514         (WebKit::WebPageProxy::preferencesDidChange):
1515         Call preferencesStore() so we'll get the configuration preference values as well.
1516
1517         (WebKit::WebPageProxy::creationParameters):
1518         Ditto.
1519
1520         * UIProcess/WebPageProxy.h:
1521
1522 2014-06-11  Antti Koivisto  <antti@apple.com>
1523
1524         Wrap NSURLRequest in bundle API
1525         https://bugs.webkit.org/show_bug.cgi?id=133732
1526         <rdar://problem/17267217>
1527
1528         Reviewed by Andreas Kling.
1529         
1530         Patch by Dan Bernstein.
1531
1532         We don't want to construct actual NSURLRequests in the web process side unless really needed as it is slow.
1533
1534         * Shared/Cocoa/APIObject.mm:
1535         (API::Object::newObject):
1536         * Shared/Cocoa/WKNSURLRequest.h: Added.
1537         (WebKit::wrapper):
1538         * Shared/Cocoa/WKNSURLRequest.mm: Added.
1539         
1540             Add a wrapper object that initializes the underlying NSURLRequest on-demand.
1541
1542         (-[WKNSURLRequest _web_createTarget]):
1543         (-[WKNSURLRequest URL]):
1544         (-[WKNSURLRequest copyWithZone:]):
1545         * WebKit2.xcodeproj/project.pbxproj:
1546         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
1547         (willSendRequestForFrame):
1548         (didInitiateLoadForResource):
1549
1550 2014-06-11  Dan Bernstein  <mitz@apple.com>
1551
1552         <rdar://problem/17218629> [Cocoa] WKWebView’s canGoBack and canGoForward properties are not KVO-compliant
1553         https://bugs.webkit.org/show_bug.cgi?id=133722
1554
1555         Reviewed by Anders Carlsson.
1556
1557         * UIProcess/API/Cocoa/WKBrowsingContextController.mm: Added no-op overrides of new
1558         PageLoadStateObserver member functions.
1559
1560         * UIProcess/API/Cocoa/WKWebView.h: Documented the canGoBack and canGoForward properties as
1561         being KVO-compliant.
1562         * UIProcess/API/Cocoa/WKWebView.mm:
1563         (-[WKWebView canGoBack]): Changed to get the return value from the page load state.
1564         (-[WKWebView canGoForward]): Ditto.
1565
1566         * UIProcess/Cocoa/NavigationState.h:
1567         * UIProcess/Cocoa/NavigationState.mm:
1568         (WebKit::NavigationState::willChangeCanGoBack): Override this new PageLoadStateObserver
1569         member function by sending the appropriate KVO change message to the WKWebView.
1570         (WebKit::NavigationState::didChangeCanGoBack): Ditto.
1571         (WebKit::NavigationState::willChangeCanGoForward): Ditto.
1572         (WebKit::NavigationState::didChangeCanGoForward): Ditto.
1573
1574         * UIProcess/PageLoadState.cpp:
1575         (WebKit::PageLoadState::commitChanges): Check for changes to canGoBack and canGoForward
1576         and call the observers if needed.
1577         (WebKit::PageLoadState::canGoBack): Added. Returns the value from the committed state.
1578         (WebKit::PageLoadState::setCanGoBack): Added. Sets the value in the uncommitted state.
1579         (WebKit::PageLoadState::canGoForward): Added. Returns the value from the committed state.
1580         (WebKit::PageLoadState::setCanGoForward): Added. Sets the value in the uncommitted state.
1581         * UIProcess/PageLoadState.h:
1582         (WebKit::PageLoadState::Data::Data): Added canGoBack and canGoForward boolean members.
1583
1584         * UIProcess/WebPageProxy.cpp:
1585         (WebKit::WebPageProxy::didChangeBackForwardList): Update the page load state with the new
1586         state of canGoBack and canGoForward.
1587         * UIProcess/WebPageProxy.h: Removed unused member variables m_canGoBack and m_canGoForward.
1588
1589 2014-06-11  Zan Dobersek  <zdobersek@igalia.com>
1590
1591         Avoid Vector copies in WebNotificationManagerProxy::providerDidCloseNotifications(), FindController::findStringMatches()
1592         https://bugs.webkit.org/show_bug.cgi?id=133676
1593
1594         Reviewed by Andreas Kling.
1595
1596         * UIProcess/Notifications/WebNotificationManagerProxy.cpp:
1597         (WebKit::WebNotificationManagerProxy::providerDidCloseNotifications): Move the newly-created
1598         Vector object into the HashMap<>::add() call.
1599         * WebProcess/WebPage/FindController.cpp:
1600         (WebKit::FindController::findStringMatches): Movethe newly-create Vector object into the
1601         Vector<>::append() call.
1602
1603 2014-06-11  Shivakumar JM  <shiva.jm@samsung.com>
1604
1605         [EFL][WK2] Add missing test cases for EWK2ViewTest.
1606         https://bugs.webkit.org/show_bug.cgi?id=133715
1607
1608         Reviewed by Gyuyoung Kim.
1609
1610         Add missing test cases for ewk_view.h APIs, ewk_view_stop(), ewk_view_html_string_load(), ewk_view_theme_get(), 
1611         ewk_view_feed_touch_event(), ewk_view_text_find_highlight_clear(), ewk_view_text_find(), ewk_view_text_matches_count(),
1612         ewk_view_page_contents_get(), ewk_view_script_execute().
1613
1614         * PlatformEfl.cmake:
1615         * UIProcess/API/efl/tests/test_ewk2_view.cpp:
1616         (TEST_F):
1617
1618 2014-06-11  Carlos Garcia Campos  <cgarcia@igalia.com>
1619
1620         [GTK] Use a different user agent string depending on the site
1621         https://bugs.webkit.org/show_bug.cgi?id=132681
1622
1623         Reviewed by Anders Carlsson.
1624
1625         * UIProcess/API/gtk/WebKitSettings.cpp:
1626         (webkit_settings_class_init): Enable site specific quirks setting
1627         by default.
1628         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1629         (WebKit::WebFrameLoaderClient::userAgent): Pass the given URL to WebPage.
1630         * WebProcess/WebPage/WebPage.cpp:
1631         (WebKit::WebPage::userAgent): Try to get the user agent for the
1632         URL received falling back to the current one otherwise.
1633         * WebProcess/WebPage/WebPage.h:
1634         (WebKit::WebPage::platformUserAgent): Added.
1635         * WebProcess/WebPage/efl/WebPageEfl.cpp:
1636         (WebKit::WebPage::platformUserAgent): Return null String.
1637         * WebProcess/WebPage/gtk/WebPageGtk.cpp:
1638         (WebKit::WebPage::platformUserAgent): Use WebCore::standardUserAgentForURL() when site specific quirks
1639         setting is enabled.
1640         * WebProcess/WebPage/ios/WebPageIOS.mm:
1641         (WebKit::WebPage::platformUserAgent): Return null String.
1642         * WebProcess/WebPage/mac/WebPageMac.mm:
1643         (WebKit::WebPage::platformUserAgent): Return null String.
1644
1645 2014-06-10  Benjamin Poulain  <benjamin@webkit.org>
1646
1647         [iOS][WK2] ScrollingTreeOverflowScrollingNode does not use asynchronous touch dispatch
1648         https://bugs.webkit.org/show_bug.cgi?id=133702
1649         <rdar://problem/17259261>
1650
1651         Reviewed by Simon Fraser.
1652
1653         Notify the WKWebView and the TouchGestureRecognizer when on of the internal UIScrollView
1654         starts scrolling in response to a gesture.
1655
1656         * UIProcess/PageClient.h:
1657         * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h:
1658         * UIProcess/Scrolling/RemoteScrollingTree.cpp:
1659         (WebKit::RemoteScrollingTree::scrollingTreeNodeWillStartPanGesture):
1660         * UIProcess/Scrolling/RemoteScrollingTree.h:
1661         * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.h:
1662         * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:
1663         (-[WKOverflowScrollViewDelegate scrollViewWillBeginDragging:]):
1664         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::scrollViewWillStartPanGesture):
1665         * UIProcess/WebPageProxy.h:
1666         * UIProcess/ios/PageClientImplIOS.h:
1667         * UIProcess/ios/PageClientImplIOS.mm:
1668         (WebKit::PageClientImpl::scrollViewWillStartPanGesture):
1669         * UIProcess/ios/RemoteScrollingCoordinatorProxyIOS.mm:
1670         (WebKit::RemoteScrollingCoordinatorProxy::scrollingTreeNodeWillStartPanGesture):
1671         * UIProcess/ios/WebPageProxyIOS.mm:
1672         (WebKit::WebPageProxy::scrollViewWillStartPanGesture):
1673
1674 2014-06-10  Dan Bernstein  <mitz@apple.com>
1675
1676         WebKit2 part of [Cocoa] Handling authentication challenges should not require multiple delegate methods
1677         https://bugs.webkit.org/show_bug.cgi?id=133697
1678
1679         Reviewed by Anders Carlsson.
1680
1681         * Shared/Authentication/AuthenticationManager.cpp:
1682         (WebKit::AuthenticationManager::performDefaultHandling): Added. Calls the new
1683         AuthenticationClient function receivedRequestToPerformDefaultHandling.
1684         (WebKit::AuthenticationManager::rejectProtectionSpaceAndContinue): Added. Calls the new
1685         AuthenticationClient function receivedChallengeRejection.
1686         * Shared/Authentication/AuthenticationManager.h:
1687         * Shared/Authentication/AuthenticationManager.messages.in: Added new messages
1688         PerformDefaultHandling and RejectProtectionSpaceAndContinue.
1689
1690         * Shared/Downloads/DownloadAuthenticationClient.h: Override new AuthenticationClient member
1691         functions.
1692
1693         * Shared/Downloads/ios/DownloadIOS.mm:
1694         (WebKit::Download::receivedRequestToPerformDefaultHandling): Added empty implementation.
1695         (WebKit::Download::receivedChallengeRejection): Ditto.
1696
1697         * Shared/Downloads/mac/DownloadMac.mm:
1698         (WebKit::Download::receivedRequestToPerformDefaultHandling): Added. Forwards to the sender.
1699         (WebKit::Download::receivedChallengeRejection): Ditto.
1700
1701         * UIProcess/API/Cocoa/WKNSURLAuthenticationChallenge.mm:
1702         (checkChallenge): Factored out a bit of code into this helper function.
1703         (-[WKNSURLAuthenticationChallengeSender cancelAuthenticationChallenge:]): Use new helper.
1704         (-[WKNSURLAuthenticationChallengeSender continueWithoutCredentialForAuthenticationChallenge:]):
1705         Ditto.
1706         (-[WKNSURLAuthenticationChallengeSender useCredential:forAuthenticationChallenge:]): Ditto.
1707         (-[WKNSURLAuthenticationChallengeSender performDefaultHandlingForAuthenticationChallenge:]):
1708         Implemented this optional NSURLAuthenticationChallengeSender protocol method by forwarding
1709         to the decision listener.
1710         (-[WKNSURLAuthenticationChallengeSender rejectProtectionSpaceAndContinueWithChallenge:]):
1711         Ditto.
1712
1713         * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h: Declared new delegate method.
1714
1715         * UIProcess/Authentication/AuthenticationChallengeProxy.cpp:
1716         (WebKit::AuthenticationChallengeProxy::performDefaultHandling): Added. Sends a message to
1717         the authentication manager.
1718         (WebKit::AuthenticationChallengeProxy::rejectProtectionSpaceAndContinue): Ditto.
1719         * UIProcess/Authentication/AuthenticationChallengeProxy.h:
1720
1721         * UIProcess/Authentication/AuthenticationDecisionListener.cpp:
1722         (WebKit::AuthenticationDecisionListener::performDefaultHandling): Added. Forwards to the
1723         authentication challenge proxy.
1724         (WebKit::AuthenticationDecisionListener::rejectProtectionSpaceAndContinue): Ditto.
1725         * UIProcess/Authentication/AuthenticationDecisionListener.h:
1726
1727         * UIProcess/Cocoa/NavigationState.h: Added flag in m_navigationDelegateMethods struct.
1728         * UIProcess/Cocoa/NavigationState.mm:
1729         (WebKit::NavigationState::setNavigationDelegate): Initialize
1730         webViewWillSendRequestForAuthenticationChallenge flag in the delegate methods struct.
1731         (WebKit::NavigationState::LoaderClient::canAuthenticateAgainstProtectionSpaceInFrame): If
1732         the delegate implements -_webView:willSendRequestForAuthenticationChallenge:, return true
1733         here; the delegate will respond with -rejectProtectionSpaceAndContinueWithChallenge: if
1734         it cannot authenticate.
1735         (WebKit::NavigationState::LoaderClient::didReceiveAuthenticationChallengeInFrame): If the
1736         delegate implements -_webView:willSendRequestForAuthenticationChallenge:, send that message.
1737
1738 2014-06-10  Timothy Horton  <timothy_horton@apple.com>
1739
1740         Factor repeated CFRunLoopObserver code out
1741         https://bugs.webkit.org/show_bug.cgi?id=133690
1742
1743         Reviewed by Simon Fraser.
1744
1745         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h:
1746         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
1747         (WebKit::RemoteLayerTreeDrawingAreaProxy::RemoteLayerTreeDrawingAreaProxy):
1748         (WebKit::RemoteLayerTreeDrawingAreaProxy::~RemoteLayerTreeDrawingAreaProxy):
1749         (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
1750         (WebKit::RemoteLayerTreeDrawingAreaProxy::showDebugIndicator):
1751         (WebKit::coreAnimationDidCommitLayersCallback): Deleted.
1752         (WebKit::RemoteLayerTreeDrawingAreaProxy::scheduleCoreAnimationLayerCommitObserver): Deleted.
1753         (WebKit::RemoteLayerTreeDrawingAreaProxy::coreAnimationDidCommitLayers): Deleted.
1754         Make use of WebCore::RunLoopObserver.
1755
1756 2014-06-10  Anders Carlsson  <andersca@apple.com>
1757
1758         Fix availability declaration.
1759
1760         * UIProcess/API/Cocoa/WKError.h:
1761
1762 2014-06-10  Anders Carlsson  <andersca@apple.com>
1763
1764         Address a comment about a comment.
1765
1766         * UIProcess/API/Cocoa/WKWebView.mm:
1767         (-[WKWebView evaluateJavaScript:completionHandler:]):
1768
1769 2014-06-10  Anders Carlsson  <andersca@apple.com>
1770
1771         Add -[WKWebView evaluateJavaScript:completionHandler:]
1772         https://bugs.webkit.org/show_bug.cgi?id=133689
1773         <rdar://problem/17152685>
1774
1775         Reviewed by Geoffrey Garen.
1776
1777         * Shared/API/c/WKErrorRef.h:
1778         Remove WKErrorCode typedef from here.
1779
1780         * UIProcess/API/C/WKPageLoaderClient.h:
1781         Use uint32_t instead of WKErrorCode.
1782
1783         * UIProcess/API/Cocoa/WKError.h:
1784         (NS_ENUM):
1785         Add a WKErrorDomain and a WKErrorCode enum.
1786
1787         * UIProcess/API/Cocoa/WKError.mm:
1788         (localizedDescriptionForErrorCode):
1789         Helper that returns the localized description given an error code.
1790
1791         (createNSError):
1792         Helper that creates an NSError with the correct localized description given an error code.
1793
1794         * UIProcess/API/Cocoa/WKErrorInternal.h:
1795         Add helpers.
1796
1797         * UIProcess/API/Cocoa/WKWebView.h:
1798         Add evaluateJavaScript:completionHandler: method.
1799
1800         * UIProcess/API/Cocoa/WKWebView.mm:
1801         (callbackErrorCode):
1802         Helper that returns a WKErrorCode from a WebKit::CallbackBase::Error enum.
1803
1804         (-[WKWebView evaluateJavaScript:completionHandler:]):
1805         Run the JavaScript code and handle all the error cases.
1806
1807         (-[WKWebView _runJavaScriptInMainFrame:]):
1808         Reimplement this using the API method.
1809
1810         * WebKit2.xcodeproj/project.pbxproj:
1811         Add new files.
1812
1813 2014-06-10  Anders Carlsson  <andersca@apple.com>
1814
1815         Don't call Connection::terminateSoon if the connection is null
1816         https://bugs.webkit.org/show_bug.cgi?id=133695
1817         <rdar://problem/17069024>
1818
1819         Reviewed by Tim Horton.
1820
1821         * UIProcess/WebProcessProxy.cpp:
1822         (WebKit::WebProcessProxy::removeWebPage):
1823
1824 2014-06-10  Oliver Hunt  <oliver@apple.com>
1825
1826         Add process entitlements
1827         https://bugs.webkit.org/show_bug.cgi?id=133693
1828
1829         Reviewed by Alexey Proskuryakov.
1830
1831         Add entitlements description for Database process, and
1832         ensure that we reference the correct seatbelt profiles.
1833
1834         * Configurations/DatabaseService.Development.xcconfig:
1835         * Configurations/DatabaseService.xcconfig:
1836         * Configurations/Databases-iOS.entitlements:
1837         * Configurations/Network-iOS.entitlements:
1838         * Configurations/WebContent-iOS.entitlements:
1839         * WebKit2.xcodeproj/project.pbxproj:
1840
1841 2014-06-10  Alexey Proskuryakov  <ap@apple.com>
1842
1843         Fix crashes on some plug-in tests.
1844         https://bugs.webkit.org/show_bug.cgi?id=133691
1845         <rdar://problem/17255836>
1846
1847         Reviewed by Anders Carlsson.
1848
1849         * PluginProcess/PluginControllerProxy.cpp: (WebKit::PluginControllerProxy::initialize):
1850         Cannot use TemporaryChange here, because the object may go away before stack unwinds.
1851
1852 2014-06-10  Antti Koivisto  <antti@apple.com>
1853
1854         Serialize ResourceRequests without platform request
1855         https://bugs.webkit.org/show_bug.cgi?id=133679
1856
1857         Reviewed by Alexey Proskuryakov.
1858
1859         * Shared/WebCoreArgumentCoders.cpp:
1860         (IPC::ArgumentCoder<ResourceRequest>::encode):
1861         (IPC::ArgumentCoder<ResourceRequest>::decode):
1862         
1863             Encode ResourceRequest directly if possible.
1864
1865 2014-06-09  Anders Carlsson  <andersca@apple.com>
1866
1867         Fix build.
1868
1869         * UIProcess/WebPageProxy.cpp:
1870         (WebKit::WebPageProxy::resetState):
1871
1872 2014-06-09  Simon Fraser  <simon.fraser@apple.com>
1873
1874         Work towards having frames in the scrolling tree
1875         https://bugs.webkit.org/show_bug.cgi?id=133665
1876
1877         Reviewed by Tim Horton.
1878         
1879         Override coordinatesScrollingForFrameView() to always return true for composited
1880         frames, for iOS WK2 (eventually this class will have to be specialized for iOS and OS X).
1881
1882         * WebProcess/Scrolling/RemoteScrollingCoordinator.h:
1883         * WebProcess/Scrolling/RemoteScrollingCoordinator.mm:
1884         (WebKit::RemoteScrollingCoordinator::coordinatesScrollingForFrameView):
1885
1886 2014-06-09  Anders Carlsson  <andersca@apple.com>
1887
1888         Give callbacks real status codes
1889         https://bugs.webkit.org/show_bug.cgi?id=133668
1890
1891         Reviewed by Dan Bernstein.
1892
1893         This makes it possible to know whether a callback was invalidated due to the webpage being closed,
1894         or whether it was due the a web process crash.
1895
1896         * UIProcess/GenericCallback.h:
1897         (WebKit::GenericCallback::create):
1898         (WebKit::GenericCallback::performCallbackWithReturnValue):
1899         (WebKit::GenericCallback::invalidate):
1900         (WebKit::invalidateCallbackMap):
1901         * UIProcess/WebPageProxy.cpp:
1902         (WebKit::WebPageProxy::close):
1903         (WebKit::WebPageProxy::resetState):
1904         (WebKit::WebPageProxy::resetStateAfterProcessExited):
1905         * UIProcess/WebPageProxy.h:
1906
1907 2014-06-09  Enrica Casucci  <enrica@apple.com>
1908
1909         iOS WebKit: Crash in charactersAroundPosition.
1910         https://bugs.webkit.org/show_bug.cgi?id=133659
1911         <rdar://problem/17220870>
1912
1913         Reviewed by Benjamin Poulain.
1914
1915         We only need to compute charactersAroundPosition when we are in
1916         editable content.
1917
1918         * WebProcess/WebPage/WebPage.cpp:
1919         (WebKit::WebPage::editorState):
1920
1921 2014-06-06  Andy Estes  <aestes@apple.com>
1922
1923         [iOS] Expose _WKWebViewPrintFormatter and -_webView:printFrame: as SPI
1924         https://bugs.webkit.org/show_bug.cgi?id=133600
1925
1926         Reviewed by David Kilzer.
1927
1928         Expose -_webView:printFrame: in WKUIDelegatePrivate so that clients can implement support for window.print().
1929         Since window.print() can be called from a subframe, expose _WKWebViewPrintFormatter (renamed from
1930         WKWebViewPrintFormatter to reflect its new SPI status) as SPI and add a frameToPrint property.
1931
1932         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: Forward-declared _WKFrameHandle and declared -_webView:printFrame:.
1933         * UIProcess/API/Cocoa/WKWebView.mm:
1934         (-[WKWebView _webViewPrintFormatter]): Added to get a _WKWebViewPrintFormatter.
1935         (-[WKWebView _printFormatterClass]): Updated the class name to _WKWebViewPrintFormatter.
1936         (-[WKWebView _computePageCountAndStartDrawingToPDFForFrame:printInfo:WebKit::firstPage:computedTotalScaleFactor:]):
1937         Added a frame argument. If frame is nil, print the main frame.
1938         (-[WKWebView _computePageCountAndStartDrawingToPDFWithPrintInfo:WebKit::firstPage:computedTotalScaleFactor:]): Deleted.
1939         * UIProcess/API/Cocoa/WKWebViewInternal.h: Forward-declared _WKFrameHandle; removed an unneccessary
1940         forward-declaration of WKWebViewPrintFormatter.
1941         * UIProcess/API/Cocoa/WKWebViewPrivate.h: Added a _webViewPrintFormatter property.
1942         * UIProcess/Cocoa/UIDelegate.h:
1943         * UIProcess/Cocoa/UIDelegate.mm:
1944         (WebKit::UIDelegate::setDelegate):
1945         (WebKit::UIDelegate::UIClient::printFrame): Called -_webView:printFrame:.
1946         * UIProcess/_WKWebViewPrintFormatter.h: Renamed from Source/WebKit2/UIProcess/WKWebViewPrintFormatter.h.
1947         * UIProcess/_WKWebViewPrintFormatter.mm: Renamed from Source/WebKit2/UIProcess/WKWebViewPrintFormatter.mm.
1948         * WebKit2.xcodeproj/project.pbxproj:
1949
1950 2014-06-09  Beth Dakin  <bdakin@apple.com>
1951
1952         Flash video controls hit-test incorrectly after changing topContentInset
1953         https://bugs.webkit.org/show_bug.cgi?id=133658
1954         -and corresponding-
1955         <rdar://problem/16978590>
1956
1957         Reviewed by Anders Carlsson.
1958
1959         When the topContent changes, the PluginView needs to be informed.
1960
1961         New function PluginView::topContentInsetDidChange() calls viewGeometryDidChange().
1962         * WebProcess/Plugins/PluginView.cpp:
1963         (WebKit::PluginView::topContentInsetDidChange):
1964         * WebProcess/Plugins/PluginView.h:
1965
1966         Call topContentInsetDidChange() after setting an inset only if it is a new inset.
1967         * WebProcess/WebPage/WebPage.cpp:
1968         (WebKit::WebPage::setTopContentInset):
1969
1970 2014-06-09  Daniel Bates  <dabates@apple.com>
1971
1972         Another attempt to fix the EFL and GTK builds after <http://trac.webkit.org/changeset/169711>
1973         (https://bugs.webkit.org/show_bug.cgi?id=133657)
1974
1975         Substitute WKErrorRef.h for WKError.h.
1976
1977         * UIProcess/API/efl/ewk_error.cpp:
1978         * WebProcess/WebCoreSupport/efl/WebErrorsEfl.cpp:
1979         * WebProcess/WebCoreSupport/gtk/WebErrorsGtk.cpp:
1980
1981 2014-06-09  Daniel Bates  <dabates@apple.com>
1982
1983         Attempt to fix the EFL and GTK builds after <http://trac.webkit.org/changeset/169711>
1984         (https://bugs.webkit.org/show_bug.cgi?id=133657)
1985
1986         Rename Shared/API/c/WKError.cpp to Shared/API/c/WKErrorRef.cpp.
1987
1988         * CMakeLists.txt:
1989
1990 2014-06-09  Anders Carlsson  <andersca@apple.com>
1991
1992         Address review feedback.
1993
1994         * UIProcess/API/Cocoa/WKWebView.h:
1995
1996 2014-06-09  Anders Carlsson  <andersca@apple.com>
1997
1998         Add a WKError.h header and rename the existing WKError.h to WKErrorRef.h
1999         https://bugs.webkit.org/show_bug.cgi?id=133657
2000
2001         Reviewed by Dan Bernstein.
2002
2003         * Shared/API/Cocoa/WebKit.h:
2004         * Shared/API/c/WKErrorRef.cpp: Renamed from Source/WebKit2/Shared/API/c/WKError.cpp.
2005         (WKErrorGetTypeID):
2006         (WKErrorCopyWKErrorDomain):
2007         (WKErrorCopyDomain):
2008         (WKErrorGetErrorCode):
2009         (WKErrorCopyFailingURL):
2010         (WKErrorCopyLocalizedDescription):
2011         * Shared/API/c/WKErrorRef.h: Renamed from Source/WebKit2/Shared/API/c/WKError.h.
2012         * UIProcess/API/C/WKPage.h:
2013         * UIProcess/API/C/WKPageLoaderClient.h:
2014         * UIProcess/API/C/WebKit2_C.h:
2015         * UIProcess/API/Cocoa/WKError.h: Copied from Source/WebKit2/Shared/API/Cocoa/WebKit.h.
2016         * UIProcess/API/Cocoa/WKError.mm: Copied from Source/WebKit2/Shared/API/Cocoa/WebKit.h.
2017         * WebKit2.xcodeproj/project.pbxproj:
2018         * WebProcess/WebCoreSupport/mac/WebErrorsMac.mm:
2019
2020 2014-06-09  Brady Eidson  <beidson@apple.com>
2021
2022         Use different AppKit API for all services menus
2023         <rdar://problem/16874403> and https://bugs.webkit.org/show_bug.cgi?id=133649
2024
2025         Reviewed by Tim Horton.
2026
2027         * UIProcess/mac/WebContextMenuProxyMac.mm:
2028         (WebKit::WebContextMenuProxyMac::showContextMenu):
2029
2030 2014-06-09  Anders Carlsson  <andersca@apple.com>
2031
2032         Add WKWindowFeatures.h to the umbrella header.
2033
2034         Reviewed by Dan Bernstein.
2035
2036         * Shared/API/Cocoa/WebKit.h:
2037
2038 2014-06-09  Anders Carlsson  <andersca@apple.com>
2039
2040         Add -[WKWebView loadHTMLString:baseURL:]
2041         https://bugs.webkit.org/show_bug.cgi?id=133645
2042         <rdar://problem/17170649>
2043
2044         Reviewed by Sam Weinig.
2045
2046         * UIProcess/API/Cocoa/WKWebView.h:
2047         * UIProcess/API/Cocoa/WKWebView.mm:
2048         (-[WKWebView loadHTMLString:baseURL:]):
2049         * UIProcess/Cocoa/NavigationState.h:
2050         * UIProcess/Cocoa/NavigationState.mm:
2051         (WebKit::NavigationState::createLoadDataNavigation):
2052         * UIProcess/WebPageProxy.cpp:
2053         (WebKit::WebPageProxy::loadHTMLString):
2054         * UIProcess/WebPageProxy.h:
2055         * WebProcess/WebPage/WebPage.cpp:
2056         (WebKit::WebPage::loadDataImpl):
2057         (WebKit::WebPage::loadString):
2058         (WebKit::WebPage::loadData):
2059         (WebKit::WebPage::loadHTMLString):
2060         (WebKit::WebPage::loadAlternateHTMLString):
2061         (WebKit::WebPage::loadPlainTextString):
2062         (WebKit::WebPage::loadWebArchiveData):
2063         * WebProcess/WebPage/WebPage.h:
2064         * WebProcess/WebPage/WebPage.messages.in:
2065
2066 2014-06-09  Simon Fraser  <simon.fraser@apple.com>
2067
2068         Fix more latched scrolling test flakiness and slowness
2069         https://bugs.webkit.org/show_bug.cgi?id=133601
2070
2071         Reviewed by Brent Fulgham.
2072
2073         Latched scrolling tests were flakey for two reasons. First, the EventSender
2074         wheel events were async from the web to the UI process, and the resulting
2075         synthetic events also async from the UI to the web process. Make them sync
2076         for testing.
2077         
2078         Secondly, the timer-based scrolling tree commit could result in the scrolling
2079         tree (specifically the frame node's notion of the scrollable area and content
2080         size) not being updated before the scrolling thread starts getting wheel events.
2081         Fix by having WebPage::wheelEventSyncForTesting() commit if necessary.
2082         
2083         Finally remove all the now-unnecessary timeouts from the tests.
2084
2085         * WebProcess/WebPage/WebPage.cpp:
2086         (WebKit::WebPage::wheelEventSyncForTesting):
2087
2088 2014-06-09  Andrzej Badowski  <a.badowski@samsung.com>
2089
2090         [EFL] Add parameter to MiniBrowser to disable web security
2091         https://bugs.webkit.org/show_bug.cgi?id=121095
2092
2093         Reviewed by Gyuyoung Kim.
2094
2095         -w (--web-security) commandline allows to disable/enable web security (enabled by default).
2096         The reason for this is to test and debug (using, for example, MiniBrowser) scripts accessing
2097         resources from other domains (cross-domain requests) such as access map location on another server.
2098         Another possibility is to launch in a webkit browser local file tests that will refer to the links
2099         in the http website loaded in an iframe. It will not be possible without deactivation of web security.
2100
2101         * UIProcess/API/efl/ewk_settings.cpp:
2102         (ewk_settings_web_security_enabled_set):
2103         (ewk_settings_web_security_enabled_get):
2104         * UIProcess/API/efl/ewk_settings.h:
2105         * UIProcess/API/efl/tests/test_ewk2_settings.cpp:
2106         (TEST_F):
2107
2108 2014-06-08  Sam Weinig  <sam@webkit.org>
2109
2110         [Cocoa] WKScriptMessage should include the frame the message is from
2111         <rdar://problem/17210226>
2112         https://bugs.webkit.org/show_bug.cgi?id=133623
2113
2114         Reviewed by Dan Bernstein.
2115
2116         * UIProcess/API/Cocoa/WKScriptMessage.h:
2117         Add WKFrameInfo property.
2118
2119         * UIProcess/API/Cocoa/WKScriptMessage.mm:
2120         (-[WKScriptMessage _initWithBody:webView:frameInfo:name:]):
2121         Add WKFrameInfo to the initializer.
2122
2123         (-[WKScriptMessage frameInfo]):
2124         Implement frameInfo accessor.
2125
2126         * UIProcess/API/Cocoa/WKScriptMessageInternal.h:
2127         Add WKFrameInfo to the initializer.
2128
2129         * UIProcess/API/Cocoa/WKUserContentController.mm:
2130         Pass the WKFrameInfo to the WKScriptMessage initializer.
2131
2132 2014-06-08  Dan Bernstein  <mitz@apple.com>
2133
2134         [Cococa] WKWindowFeatures.h is missing from WebKit.framework
2135         https://bugs.webkit.org/show_bug.cgi?id=133622
2136
2137         Reviewed by Sam Weinig.
2138
2139         * WebKit2.xcodeproj/project.pbxproj: Promoted WKWindowFeatures.h to Public.
2140
2141 2014-06-08  Dan Bernstein  <mitz@apple.com>
2142
2143         <rdar://problem/17208234> [Mac] Client-certificate authentication isn’t working when using the modern API
2144         https://bugs.webkit.org/show_bug.cgi?id=133617
2145
2146         Reviewed by Sam Weinig.
2147
2148         * Shared/WebCoreArgumentCoders.cpp:
2149         (IPC::ArgumentCoder<Credential>::encode): Encode certificate credentials on Mac as well.
2150         (IPC::ArgumentCoder<Credential>::decode): Decode certificate credentials on Mac as well.
2151
2152         * Shared/cf/ArgumentCodersCF.cpp:
2153         (IPC::encode): Use OS X API for getting a persistent reference to a key.
2154         (IPC::decode): Use OS X API for getting a key from a persistent reference.
2155
2156         * Shared/cf/ArgumentCodersCF.h: Make identity coding available on Mac as well.
2157
2158 2014-06-07  Anders Carlsson  <andersca@apple.com>
2159
2160         Get rid of _WKScriptWorld
2161         https://bugs.webkit.org/show_bug.cgi?id=133610
2162
2163         Reviewed by Dan Bernstein.
2164
2165         * Shared/API/Cocoa/WebKitPrivate.h:
2166         * UIProcess/API/Cocoa/_WKScriptWorld.h: Removed.
2167         * UIProcess/API/Cocoa/_WKScriptWorld.mm: Removed.
2168         * WebKit2.xcodeproj/project.pbxproj:
2169
2170 2014-05-29  Anders Carlsson  <andersca@apple.com>
2171
2172         HTTPHeaderMap should not derive from HashMap
2173         https://bugs.webkit.org/show_bug.cgi?id=133392
2174
2175         Reviewed by Darin Adler.
2176
2177         * Shared/WebCoreArgumentCoders.cpp:
2178         (IPC::ArgumentCoder<HTTPHeaderMap>::encode):
2179         (IPC::ArgumentCoder<HTTPHeaderMap>::decode):
2180
2181 2014-06-07  Alexey Proskuryakov  <ap@apple.com>
2182
2183         [iOS] Fix a path used for sandbox profiles
2184         https://bugs.webkit.org/show_bug.cgi?id=133602
2185         <rdar://problem/17212011>
2186
2187         Reviewed by David Kilzer.
2188
2189         * WebKit2.xcodeproj/project.pbxproj:
2190
2191 2014-06-06  Enrica Casucci  <enrica@apple.com>
2192
2193         REGRESSION (iOS WebKit2): backspace key does not repeat beyond a single word.
2194         https://bugs.webkit.org/show_bug.cgi?id=133593
2195         <rdar://problem/16352228>
2196
2197         Reviewed by Benjamin Poulain.
2198
2199         We need to provide a way for the keyboard layer to select from
2200         the current position to the beginning of the word moving backwards
2201         and implement the method to know when we have reached the beginning of the document.
2202
2203         * UIProcess/WebPageProxy.h:
2204         * UIProcess/ios/WKContentViewInteraction.mm:
2205         (-[WKContentView selectWordBackward]):
2206         (-[WKContentView _selectionAtDocumentStart]):
2207         * UIProcess/ios/WebPageProxyIOS.mm:
2208         (WebKit::WebPageProxy::selectWordBackward):
2209         * WebProcess/WebPage/WebPage.h:
2210         * WebProcess/WebPage/WebPage.messages.in:
2211         * WebProcess/WebPage/ios/WebPageIOS.mm:
2212         (WebKit::WebPage::selectWordBackward):
2213
2214 2014-06-06  Enrica Casucci  <enrica@apple.com>
2215
2216         Adopt the new UIAlertController API to replace UIActionSheet.
2217         https://bugs.webkit.org/show_bug.cgi?id=133582
2218         <rdar://problem/16845223>
2219
2220         Reviewed by Joseph Pecoraro.
2221
2222         UIActionSheet is deprecated. We need to move out action sheets
2223         implementation to UIAlertView.
2224
2225         * UIProcess/API/Cocoa/_WKElementAction.h:
2226         * UIProcess/API/Cocoa/_WKElementAction.mm:
2227         * UIProcess/ios/WKActionSheet.h:
2228         * UIProcess/ios/WKActionSheet.mm:
2229         (-[WKActionSheet presentSheetFromRect:]):
2230         (-[WKActionSheet doneWithSheet]):
2231         (-[WKActionSheet willRotate]):
2232         (-[WKActionSheet updateSheetPosition]):
2233         (-[WKActionSheet _didRotateAndLayout]):
2234         (-[WKActionSheet didRotate]):
2235         * UIProcess/ios/WKActionSheetAssistant.h:
2236         * UIProcess/ios/WKActionSheetAssistant.mm:
2237         (-[WKActionSheetAssistant _createSheetWithElementActions:showLinkTitle:]):
2238         (-[WKActionSheetAssistant showImageSheet]):
2239         (-[WKActionSheetAssistant showLinkSheet]):
2240         (-[WKActionSheetAssistant showDataDetectorsSheet]):
2241         (-[WKActionSheetAssistant cleanupSheet]):
2242         (-[WKActionSheetAssistant actionSheet:clickedButtonAtIndex:]): Deleted.
2243         * UIProcess/ios/WKContentViewInteraction.mm:
2244         (-[WKContentView _longPressRecognized:]):
2245
2246 2014-06-06  Gavin Barraclough  <baraclough@apple.com>
2247
2248         Should boost ChildProcesses on iOS
2249         https://bugs.webkit.org/show_bug.cgi?id=133583
2250
2251         Reviewed by Sam Weinig.
2252
2253         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
2254         (WebKit::connectToService):
2255             - boost all child processes on iOS.
2256
2257 2014-06-06  Alexey Proskuryakov  <ap@apple.com>
2258
2259         Build fix after <http://trac.webkit.org/changeset/169655>.
2260
2261         The SPIs used do not exist on Mac, limit the code to iOS.
2262
2263         * Shared/Authentication/mac/AuthenticationManager.mac.mm:
2264         * Shared/WebCoreArgumentCoders.cpp:
2265         (IPC::ArgumentCoder<Credential>::encode):
2266         (IPC::ArgumentCoder<Credential>::decode):
2267         * Shared/cf/ArgumentCodersCF.cpp:
2268         (IPC::typeFromCFTypeRef):
2269         (IPC::encode):
2270         (IPC::decode):
2271         * Shared/cf/ArgumentCodersCF.h:
2272
2273 2014-06-06  Dan Bernstein  <mitz@apple.com>
2274
2275         <rdar://problem/17095692> [iOS] Client-certificate authentication isn’t working
2276         https://bugs.webkit.org/show_bug.cgi?id=133527
2277
2278         Reviewed by Darin Adler.
2279
2280         * Configurations/Network-iOS.entitlements: Enabled the Network process to access the keys
2281         needed to create identities to authenticate with.
2282
2283         * Shared/WebCoreArgumentCoders.cpp:
2284         (IPC::ArgumentCoder<Credential>::encode): Encode the credential type, and if it is a client
2285         certificate, encode the identity and the certificates.
2286         (IPC::ArgumentCoder<Credential>::decode): Decode the credential type. If it is a client
2287         certificate, decode the identity and the certificates and use the proper Credential
2288         constructor.
2289
2290         * Shared/cf/ArgumentCodersCF.cpp:
2291         (IPC::typeFromCFTypeRef): Handle SecIdentityRef.
2292         (IPC::encode): Encode an identity by encoding its certificate and a persistent reference to
2293         its key.
2294         (IPC::decode): Decode a certificate and a persistent reference to a key, find the key, and
2295         create an identity.
2296         * Shared/cf/ArgumentCodersCF.h:
2297
2298 2014-06-05  Benjamin Poulain  <bpoulain@apple.com>
2299
2300         [iOS][WK2] WebPage sometimes forces two resize events on animated resize
2301         https://bugs.webkit.org/show_bug.cgi?id=133534
2302
2303         Reviewed by Enrica Casucci.
2304
2305         When I updated the patch for resize events (r168556) to use the unobscured rect in scrollview coordinates,
2306         I forgot to update a snippet of code in dynamicViewportSizeUpdate(). Since that code was still using
2307         the scaled unobscured rect, there was sometimes a difference of 1 pixel between the size set by that
2308         call site and the others.
2309
2310         This path nukes the bad code and use the unobscured rect in scrollview coordinates given by the UIProcess.
2311
2312         * WebProcess/WebPage/ios/WebPageIOS.mm:
2313         (WebKit::WebPage::dynamicViewportSizeUpdate):
2314
2315 2014-06-05  Benjamin Poulain  <bpoulain@apple.com>
2316
2317         [iOS][WK2] Add device orientation
2318         https://bugs.webkit.org/show_bug.cgi?id=133530
2319         <rdar://problem/16680041>
2320
2321         Reviewed by Tim Horton.
2322
2323         Add device orientation for WebKit2.
2324
2325         For the public API, WKWebView get the updates through the notification UIWindowDidRotateNotification.
2326         We do not have any control over how the API is used, but we can expect the size will be updated before
2327         the end of rotation in most cases and the events should be sent in the right order.
2328
2329         For Safari, we use an override to support animated resize (and some tabs corner cases).
2330
2331         On the WebProcess side, we just get the new orientation directly or on DynamicViewportSizeUpdate.
2332
2333         * UIProcess/API/Cocoa/WKWebView.mm:
2334         (deviceOrientationForUIInterfaceOrientation):
2335         (deviceOrientation):
2336         (-[WKWebView initWithFrame:configuration:]):
2337         (-[WKWebView _windowDidRotate:]):
2338         (-[WKWebView _setInterfaceOrientationOverride:]):
2339         (-[WKWebView _interfaceOrientationOverride]):
2340         (-[WKWebView _beginAnimatedResizeWithUpdates:]):
2341         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2342         * UIProcess/WebPageProxy.cpp:
2343         (WebKit::WebPageProxy::WebPageProxy):
2344         * UIProcess/WebPageProxy.h:
2345         (WebKit::WebPageProxy::deviceOrientation):
2346         * UIProcess/ios/WebPageProxyIOS.mm:
2347         (WebKit::WebPageProxy::dynamicViewportSizeUpdate):
2348         (WebKit::WebPageProxy::setDeviceOrientation):
2349         * WebProcess/WebCoreSupport/WebChromeClient.h:
2350         * WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm:
2351         (WebKit::WebChromeClient::deviceOrientation):
2352         * WebProcess/WebPage/WebPage.cpp:
2353         (WebKit::WebPage::WebPage):
2354         * WebProcess/WebPage/WebPage.h:
2355         (WebKit::WebPage::deviceOrientation):
2356         * WebProcess/WebPage/WebPage.messages.in:
2357         * WebProcess/WebPage/ios/WebPageIOS.mm:
2358         (WebKit::WebPage::setDeviceOrientation):
2359         (WebKit::WebPage::dynamicViewportSizeUpdate):
2360
2361 2014-06-05  Oliver Hunt  <oliver@apple.com>
2362
2363         Enable SANDBOX_EXTENSIONS build flag universally on cocoa
2364         https://bugs.webkit.org/show_bug.cgi?id=133556
2365
2366         Reviewed by Alexey Proskuryakov.
2367
2368         Remove unnecessary iOS exception.
2369
2370         * WebKit2Prefix.h:
2371
2372 2014-06-05  Alexey Proskuryakov  <ap@apple.com>
2373
2374         [Mac] Tweak plug-in sandbox profiles
2375         https://bugs.webkit.org/show_bug.cgi?id=133549
2376
2377         Fix <rdar://problem/17068055> and <rdar://problem/17148837>.
2378
2379         Reviewed by Sam Weinig and Simon Cooper.
2380
2381         * Resources/PlugInSandboxProfiles/com.apple.ist.ds.appleconnect.webplugin.sb:
2382         * Resources/PlugInSandboxProfiles/com.microsoft.SilverlightPlugin.sb:
2383
2384 2014-06-05  Tanay C  <tanay.c@samsung.com>
2385
2386         Resolve compiler error (call of overloaded 'schedule' function is ambiguous) 
2387         https://bugs.webkit.org/show_bug.cgi?id=133467
2388
2389         Reviewed by Carlos Garcia Campos.
2390
2391         * Shared/Downloads/soup/DownloadSoup.cpp:
2392         (WebKit::DownloadClient::handleResponseLater): Explicitly casting second parameter to std::function<void()>
2393
2394 2014-06-04  Benjamin Poulain  <bpoulain@apple.com>
2395
2396         [iOS][WK2] Restore the visual scroll position instead of the dom scroll position when restoring states from the history
2397         https://bugs.webkit.org/show_bug.cgi?id=133490
2398
2399         Reviewed by Tim Horton.
2400
2401         Instead of restoring the scroll position, restore the visual position. This makes pages appear at the same position
2402         on screen ignoring changes in the obscured top inset.
2403
2404         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2405         * WebProcess/WebCoreSupport/ios/WebFrameLoaderClientIOS.mm:
2406         (WebKit::WebFrameLoaderClient::saveViewStateToItem):
2407         (WebKit::WebFrameLoaderClient::restoreViewState):
2408         Save and restore userHasChangedPageScaleFactor to handle rescaling correctly.
2409         Limit the scale into valid viewport limits in case the viewport meta tag has changed or the device has rotated.
2410
2411         * WebProcess/WebPage/WebPage.cpp:
2412         (WebKit::WebPage::WebPage):
2413         * WebProcess/WebPage/WebPage.h:
2414         (WebKit::WebPage::userHasChangedPageScaleFactor):
2415         * WebProcess/WebPage/ios/WebPageIOS.mm:
2416         (WebKit::WebPage::restorePageState):
2417         (WebKit::WebPage::updateVisibleContentRects):
2418         In updateVisibleContentRects, we keep track or the current difference between the exposed rect and the unobscured rect.
2419         When restoring the page position, we use the current top inset and the saved exposed rect to restore the visual
2420         scroll position.
2421
2422         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.
2423
2424 2014-06-03  Timothy Horton  <timothy_horton@apple.com>
2425
2426         WebKit2 View Gestures (Zoom): Can show unpainted regions when zoom-pinching-out
2427         https://bugs.webkit.org/show_bug.cgi?id=133472
2428         <rdar://problem/15686848>
2429
2430         Reviewed by Simon Fraser.
2431
2432         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
2433         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
2434         (WebKit::TiledCoreAnimationDrawingArea::flushLayers):
2435         (WebKit::TiledCoreAnimationDrawingArea::applyTransientZoomToLayers):
2436         (WebKit::TiledCoreAnimationDrawingArea::adjustTransientZoom):
2437         Use prepopulateRect() when zooming out to ensure that we have tiles for the current exposed area.
2438
2439         Factor applyTransientZoomToLayers out of adjustTransientZoom, so that
2440         flushLayers can call applyTransientZoomToLayers without ending up calling prepopulateRect()
2441         during layer flushing, which causes trouble.
2442
2443         It is OK to populate layers at the current scale even when zooming out, because the overdraw
2444         already covers most of the zoomed out area, and we're only adding a few more tiles at worst.
2445
2446 2014-06-03  Benjamin Poulain  <bpoulain@apple.com>
2447
2448         [iOS][WK2] Align the highlight rects with device pixels
2449         https://bugs.webkit.org/show_bug.cgi?id=133464
2450         <rdar://problem/16708861>
2451
2452         Reviewed by Enrica Casucci.
2453
2454         * UIProcess/ios/WKContentViewInteraction.mm:
2455         (-[WKContentView _showTapHighlightWithColor:WebCore::quads:WebCore::topLeftRadius:WebCore::topRightRadius:WebCore::bottomLeftRadius:WebCore::bottomRightRadius:WebCore::]):
2456
2457 2014-06-02  Enrica Casucci  <enrica@apple.com>
2458
2459         REGRESSION (iOS WebKit2): Single tap in pages with focus on load will clear the selection after the keyboard appears.
2460         https://bugs.webkit.org/show_bug.cgi?id=133465
2461         <rdar://problem/17059189>
2462
2463         Reviewed by Benjamin Poulain.
2464
2465         If a page focuses an input field on load we don't bring the keyboard on screen
2466         since the keyboard is only shown when the user interacts with the page with gestures.
2467         Still the WebProcess sets the focus and the selection according to the rules.
2468         We need to make sure the UI process doesn't accidentally clear this selection
2469         when the user starts the interaction with the page.
2470         This patch also improves the function that retrieves the autocorrection data
2471         to be returned to the keyboard, making sure that we always send back a reply
2472         even when we don't have a valid selection.
2473
2474         * UIProcess/ios/WKContentViewInteraction.mm:
2475         (-[WKContentView _singleTapCommited:]):
2476         * WebProcess/WebPage/ios/WebPageIOS.mm:
2477         (WebKit::WebPage::requestAutocorrectionData):
2478
2479 2014-05-31  Anders Carlsson  <andersca@apple.com>
2480
2481         Change DeferrableOneShotTimer to use std::function instead of being a class template
2482         https://bugs.webkit.org/show_bug.cgi?id=133423
2483
2484         Reviewed by Antti Koivisto.
2485
2486         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
2487         (WebKit::NetworkProcess::platformSetCacheModel):
2488         * Shared/CacheModel.cpp:
2489         (WebKit::calculateCacheSizes):
2490         * Shared/CacheModel.h:
2491         * WebProcess/Plugins/PluginView.cpp:
2492         (WebKit::PluginView::pluginSnapshotTimerFired):
2493         * WebProcess/Plugins/PluginView.h:
2494         * WebProcess/cocoa/WebProcessCocoa.mm:
2495         (WebKit::WebProcess::platformSetCacheModel):
2496
2497 2014-06-02  Benjamin Poulain  <bpoulain@apple.com>
2498
2499         [iOS][WK2] Round the UIScrollView content size to device pixel
2500         https://bugs.webkit.org/show_bug.cgi?id=133417
2501         <rdar://problem/15922440>
2502
2503         Reviewed by Simon Fraser.
2504
2505         We should really have the scaled content size floored to device pixels, but that will be for another
2506         time.
2507         This patch ensure the content size as seen by the API is rounded to device pixels. The value is floored
2508         to avoid showing partial pixels when the content is stable.
2509
2510         * UIProcess/API/Cocoa/WKWebView.mm:
2511         (floorFloatToPixels):
2512         (roundScrollViewCountentSize):
2513         (-[WKWebView _setHasCustomContentView:loadedMIMEType:WTF::]):
2514         (-[WKWebView _didCommitLayerTree:WebKit::]):
2515         (-[WKWebView scrollView:contentSizeForZoomScale:withProposedSize:]):
2516         (-[WKWebView _beginAnimatedResizeWithUpdates:]):
2517         (-[WKWebView _endAnimatedResize]):
2518
2519 2014-06-02  Oliver Hunt  <oliver@apple.com>
2520
2521         Move ifdef to the right place.
2522
2523         RS=Enrica
2524
2525         * WebProcess/cocoa/WebProcessCocoa.mm:
2526         (WebKit::WebProcess::initializeSandbox):
2527
2528 2014-06-02  Gavin Barraclough  <barraclough@apple.com>
2529
2530         Set default voucher for XPC client processes
2531         https://bugs.webkit.org/show_bug.cgi?id=133458
2532
2533         Reviewed by Geoff Garen.
2534
2535         * Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.h:
2536         (WebKit::XPCServiceInitializer):
2537             - add voucher_replace_default_voucher.
2538         * config.h:
2539             - add HAVE_VOUCHERS.
2540
2541 2014-06-02  Jeremy Jones  <jeremyj@apple.com>
2542
2543         Send external playback properties to fullscreen.
2544         https://bugs.webkit.org/show_bug.cgi?id=133366
2545
2546         Reviewed by Simon Fraser.
2547
2548         Forward setExternalPlayback.
2549
2550         * UIProcess/ios/WebVideoFullscreenManagerProxy.messages.in: add setExternalPlaybackProperties
2551         * WebProcess/ios/WebVideoFullscreenManager.h: add setExternalPlaybackProperties
2552         * WebProcess/ios/WebVideoFullscreenManager.mm: add setExternalPlaybackProperties
2553         (WebKit::WebVideoFullscreenManager::setExternalPlaybackProperties): added
2554
2555 2014-06-02  Enrica Casucci  <enrica@apple.com>
2556
2557         Remove unintentional changes to WKContentViewInteraction.mm
2558         introduced in r169500.
2559
2560         Unreviewed.
2561
2562         * UIProcess/ios/WKContentViewInteraction.mm:
2563         (+[WKAutocorrectionContext autocorrectionContextWithData:markedText:selectedText:afterText:selectedRangeInMarkedText:]):
2564
2565 2014-06-02  Geoffrey Garen  <ggaren@apple.com>
2566
2567         Address some review comments on bug 133408
2568         https://bugs.webkit.org/show_bug.cgi?id=133410
2569
2570         Reviewed by Anders Carlsson.
2571
2572         * UIProcess/API/Cocoa/WKBackForwardListItem.h:
2573         * UIProcess/API/Cocoa/WKUIDelegate.h:
2574
2575 2014-06-02  Dan Bernstein  <mitz@apple.com>
2576
2577         [Cocoa] -[WKWebView activeURL] is unused
2578         https://bugs.webkit.org/show_bug.cgi?id=133440
2579
2580         Reviewed by Mark Rowe.
2581
2582         * UIProcess/API/Cocoa/WKWebView.mm:
2583         (-[WKWebView activeURL]): Deleted.
2584         * UIProcess/API/Cocoa/WKWebViewPrivate.h: Removed the property declaration.
2585
2586 2014-05-31  Oliver Hunt  <oliver@apple.com>
2587
2588         Restructure initial distinct sandbox profiles
2589         https://bugs.webkit.org/show_bug.cgi?id=133415
2590
2591         Reviewed by Alexey Proskuryakov.
2592
2593         Add support for manually instantiating the network and
2594         content process sandboxes, and add initial profiles.
2595         These profiles are completely generic so we can make sure
2596         nothing is broken by enabling them.
2597
2598         This also adds a target to the WebKit2 project to correctly
2599         process the profiles.
2600
2601         * DatabaseProcess/ios/DatabaseProcessIOS.mm:
2602         (WebKit::DatabaseProcess::initializeSandbox):
2603         * DatabaseProcess/ios/com.apple.WebKit.DatabasesIOS.sb: Removed.
2604         * NetworkProcess/ios/NetworkProcessIOS.mm:
2605         (WebKit::NetworkProcess::initializeSandbox):
2606         * Resources/SandboxProfiles/ios/com.apple.WebKit.Databases.sb: Added.
2607         * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb: Added.
2608         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: Added.
2609         * WebKit2.xcodeproj/project.pbxproj:
2610         * WebProcess/cocoa/WebProcessCocoa.mm:
2611         (WebKit::WebProcess::initializeSandbox):
2612
2613 2014-06-01  Sam Weinig  <sam@webkit.org>
2614
2615         [Cocoa] Add SPI to get a WebArchive of the WKWebView
2616         <rdar://problem/16748120>
2617         https://bugs.webkit.org/show_bug.cgi?id=133439
2618
2619         Reviewed by Anders Carlsson.
2620
2621         * UIProcess/API/Cocoa/WKWebView.mm:
2622         (-[WKWebView _getWebArchiveDataWithCompletionHandler:]):
2623         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2624
2625 2014-05-31  Anders Carlsson  <andersca@apple.com>
2626
2627         Add a LazyNeverDestroyed class template and use it
2628         https://bugs.webkit.org/show_bug.cgi?id=133425
2629
2630         Reviewed by Darin Adler.
2631
2632         * Shared/mac/SecItemShim.cpp:
2633         (WebKit::responseMap):
2634
2635 2014-05-31  Timothy Horton  <timothy_horton@apple.com>
2636
2637         View snapshots are sometimes taken at the wrong scale
2638         https://bugs.webkit.org/show_bug.cgi?id=133419
2639         <rdar://problem/17087497>
2640
2641         Reviewed by Sam Weinig.
2642
2643         * UIProcess/API/mac/WKView.mm:
2644         (-[WKView _takeViewSnapshot]):
2645         Work around <rdar://problem/17084993> by re-requesting the snapshot at
2646         kCGWindowImageNominalResolution if it was captured at the wrong scale.
2647
2648 2014-05-31  Dan Bernstein  <mitz@apple.com>
2649
2650         [iOS] WebKit2.framework is unused
2651         https://bugs.webkit.org/show_bug.cgi?id=133424
2652
2653         Reviewed by Anders Carlsson.
2654
2655         * Configurations/WebKit2.xcconfig: Set SKIP_INSTALL to YES when targeting iOS.
2656
2657 2014-05-30  Benjamin Poulain  <bpoulain@apple.com>
2658
2659         [iOS][WK2] When a page does not finish rotation before the end of the animation, synchronize explicitely
2660         https://bugs.webkit.org/show_bug.cgi?id=133364
2661         <rdar://problem/17026333>
2662
2663         Reviewed by Sam Weinig.
2664
2665         When a page that does layout on rotation does not respond before the end of the animation, we end up with
2666         a completely inconsistent state on the UIProcess (because it is unware of the new states).
2667
2668         The perfect way to fix this would be to make animated resize transactional and have the WebProcess resolve
2669         conflicts. That is very complicated and the issue is uncommon, so this patch does not do that.
2670
2671         This patch force the synchronization whenever we finish the animation before we heard back
2672         from the WebProcess.
2673
2674         * UIProcess/API/Cocoa/WKWebView.mm:
2675         (-[WKWebView _endAnimatedResize]):
2676         * UIProcess/WebPageProxy.cpp:
2677         (WebKit::WebPageProxy::WebPageProxy):
2678         (WebKit::WebPageProxy::resetState):
2679         * UIProcess/WebPageProxy.h:
2680         * UIProcess/ios/WebPageProxyIOS.mm:
2681         (WebKit::WebPageProxy::dynamicViewportSizeUpdate):
2682         (WebKit::WebPageProxy::synchronizeDynamicViewportUpdate):
2683         (WebKit::WebPageProxy::dynamicViewportUpdateChangedTarget):
2684         * WebProcess/WebPage/WebPage.h:
2685         * WebProcess/WebPage/WebPage.messages.in:
2686         * WebProcess/WebPage/ios/WebPageIOS.mm:
2687         (WebKit::WebPage::dynamicViewportSizeUpdate):
2688         (WebKit::WebPage::synchronizeDynamicViewportUpdate):
2689
2690 2014-05-30  Enrica Casucci  <enrica@apple.com>
2691
2692         REGRESSION (WebKit2): space space to insert period doesn't work in web forms.
2693         https://bugs.webkit.org/show_bug.cgi?id=133413
2694         <rdar://problem/16948333>
2695
2696         Reviewed by Benjamin Poulain.
2697
2698         iOS TextInput needs to know about content surrounding the
2699         current position while editing. Since we don't want to
2700         query this information synchronously when asked, we cache it
2701         as part of the EditorState. EditorState now contains a vector of
2702         three characters representing the content after, before and two
2703         position before the caret position.
2704         The patch also replaces all calls to plainText with plainTextReplacingNoBreakSpace
2705         to work well with iOS text input.
2706
2707         * Shared/EditorState.cpp:
2708         (WebKit::EditorState::encode):
2709         (WebKit::EditorState::decode):
2710         * Shared/EditorState.h:
2711         (WebKit::EditorState::EditorState):
2712         * UIProcess/ios/WKContentViewInteraction.mm:
2713         (-[WKContentView _characterInRelationToCaretSelection:]):
2714         (+[WKAutocorrectionContext autocorrectionContextWithData:markedText:selectedText:afterText:selectedRangeInMarkedText:]):
2715         * WebProcess/WebPage/WebPage.cpp:
2716         (WebKit::WebPage::editorState):
2717         * WebProcess/WebPage/ios/WebPageIOS.mm:
2718         (WebKit::WebPage::requestDictationContext):
2719         (WebKit::WebPage::replaceSelectedText):
2720         (WebKit::WebPage::replaceDictatedText):
2721         (WebKit::WebPage::requestAutocorrectionData):
2722         (WebKit::WebPage::syncApplyAutocorrection):
2723         (WebKit::computeAutocorrectionContext):
2724
2725 2014-05-30  Geoffrey Garen  <ggaren@apple.com>
2726
2727         Fixed the build by adding back a declaration I deleted by accident :(.
2728
2729         Unreviewed.
2730
2731         * UIProcess/API/Cocoa/WKWebView.h:
2732
2733 2014-05-30  Geoffrey Garen  <ggaren@apple.com>
2734
2735         Unreviewed, rolling in r169490.
2736
2737         I changed a non-ASCII apostrophe to ASCII.
2738
2739         Restored changeset:
2740
2741         "Some more copy-editing of the Modern WebKit headerdoc"
2742         https://bugs.webkit.org/show_bug.cgi?id=133408
2743         http://trac.webkit.org/changeset/169490
2744
2745         * UIProcess/API/Cocoa/WKBackForwardList.h:
2746         * UIProcess/API/Cocoa/WKBackForwardListItem.h:
2747         * UIProcess/API/Cocoa/WKFrameInfo.h:
2748         * UIProcess/API/Cocoa/WKNavigation.h:
2749         * UIProcess/API/Cocoa/WKNavigationAction.h:
2750         (NS_ENUM):
2751         * UIProcess/API/Cocoa/WKNavigationDelegate.h:
2752         (NS_ENUM):
2753         * UIProcess/API/Cocoa/WKNavigationResponse.h:
2754         * UIProcess/API/Cocoa/WKPreferences.h:
2755         * UIProcess/API/Cocoa/WKProcessPool.h:
2756         * UIProcess/API/Cocoa/WKScriptMessage.h:
2757         * UIProcess/API/Cocoa/WKScriptMessageHandler.h:
2758         * UIProcess/API/Cocoa/WKUIDelegate.h:
2759         * UIProcess/API/Cocoa/WKUserContentController.h:
2760         * UIProcess/API/Cocoa/WKWebView.h:
2761         * UIProcess/API/Cocoa/WKWebViewConfiguration.h:
2762
2763 2014-05-30  Geoffrey Garen  <ggaren@apple.com>
2764
2765         Unreviewed, rolling out r169490.
2766
2767         It broke the build with a mysterious warning about ASCII.
2768
2769         Reverted changeset:
2770
2771         "Some more copy-editing of the Modern WebKit headerdoc"
2772         https://bugs.webkit.org/show_bug.cgi?id=133408
2773         http://trac.webkit.org/changeset/169490
2774
2775 2014-05-30  Geoffrey Garen  <ggaren@apple.com>
2776
2777         Some more copy-editing of the Modern WebKit headerdoc
2778         https://bugs.webkit.org/show_bug.cgi?id=133408
2779
2780         Reviewed by Beth Dakin.
2781
2782         A copy-editor suggested some edits to the headerdoc for clarity,
2783         style, and formatting.
2784
2785         I reviewed the edits and accepted about 80% of them.
2786
2787         * UIProcess/API/Cocoa/WKBackForwardList.h:
2788         * UIProcess/API/Cocoa/WKBackForwardListItem.h:
2789         * UIProcess/API/Cocoa/WKFrameInfo.h:
2790         * UIProcess/API/Cocoa/WKNavigation.h:
2791         * UIProcess/API/Cocoa/WKNavigationAction.h:
2792         (NS_ENUM):
2793         * UIProcess/API/Cocoa/WKNavigationDelegate.h:
2794         (NS_ENUM):
2795         * UIProcess/API/Cocoa/WKNavigationResponse.h:
2796         * UIProcess/API/Cocoa/WKPreferences.h:
2797         * UIProcess/API/Cocoa/WKProcessPool.h:
2798         * UIProcess/API/Cocoa/WKScriptMessage.h:
2799         * UIProcess/API/Cocoa/WKScriptMessageHandler.h:
2800         * UIProcess/API/Cocoa/WKUIDelegate.h:
2801         * UIProcess/API/Cocoa/WKUserContentController.h:
2802         * UIProcess/API/Cocoa/WKWebView.h:
2803         * UIProcess/API/Cocoa/WKWebViewConfiguration.h:
2804
2805 2014-05-30  Timothy Horton  <timothy_horton@apple.com>
2806
2807         Crash loading skydrive.com (assertion under RemoteLayerTreeDisplayRefreshMonitor)
2808         https://bugs.webkit.org/show_bug.cgi?id=133370
2809         <rdar://problem/17061361>
2810
2811         Reviewed by Darin Adler.
2812
2813         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
2814         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
2815         (WebKit::RemoteLayerTreeDrawingArea::RemoteLayerTreeDrawingArea):
2816         (WebKit::RemoteLayerTreeDrawingArea::willDestroyDisplayRefreshMonitor):
2817         (WebKit::RemoteLayerTreeDrawingArea::didUpdate):
2818         Post-landing review comments from Darin noted that checking if the
2819         DrawingArea's m_displayRefreshMonitors contains the monitor in the
2820         list to notify is insufficient, because a new one could have been
2821         added with the same address. Instead, copy the HashSet, removing
2822         at random from it and firing didUpdateLayers, but *also* removing
2823         from it in the willDestroyDisplayRefreshMonitor callback.
2824         This is very similar to what DisplayRefreshMonitor itself does internally
2825         (we don't have to duplicate its code to avoid re-entry because it is
2826         already impossible to re-enter didUpdate).
2827
2828 2014-05-29  Anders Carlsson  <andersca@apple.com>
2829
2830         -[WKProcessPoolConfiguration setCachePartitionedURLSchemes:] should do a deep copy
2831         https://bugs.webkit.org/show_bug.cgi?id=133393
2832
2833         Reviewed by Dan Bernstein.
2834
2835         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
2836         (-[_WKProcessPoolConfiguration setCachePartitionedURLSchemes:]):
2837
2838 2014-05-29  Mark Lam  <mark.lam@apple.com>
2839
2840         Restoring FloatingPointEnvironment initialization that was accidentally rolled out by r169176.
2841         <https://webkit.org/b/133389>
2842
2843         Rubber stamped by Oliver Hunt.
2844
2845         * Shared/ios/ChildProcessIOS.mm:
2846         (WebKit::ChildProcess::platformInitialize):
2847
2848 2014-05-29  Enrica Casucci  <enrica@apple.com>
2849
2850         Need to notify the keyboard about every KeyDown event.
2851         https://bugs.webkit.org/show_bug.cgi?id=133383
2852         <rdar://problem/16633975>
2853
2854         Reviewed by Benjamin Poulain.
2855         
2856         A key down will generate most of the time a call to the keyboard to add input or delete.
2857         But the event could be handled by JavaScript and its default prevented.
2858         We need to notify the keyboard in every case to allow updating its internal state about what has been typed.
2859
2860         * UIProcess/ios/PageClientImplIOS.mm:
2861         (WebKit::PageClientImpl::doneWithKeyEvent):
2862         * UIProcess/ios/WKContentViewInteraction.h:
2863         * UIProcess/ios/WKContentViewInteraction.mm:
2864         (-[WKContentView _didHandleKeyEvent:]):
2865
2866 2014-05-29  Matthew Hanson  <matthew_hanson@apple.com>
2867
2868         Roll out r169439. <rdar://problem/17069364>
2869
2870     2014-05-28  Gavin Barraclough  <baraclough@apple.com> 
2871
2872             viewStateDidChange should always fully update ViewState
2873             https://bugs.webkit.org/show_bug.cgi?id=133159
2874
2875             Reviewed by Anders Carlson.
2876
2877             Currently WebPageProxy::viewStateDidChange is passed a mask of bits to update.
2878
2879             This has the following negative consequences:
2880              – WKWebView implicitly requires more detailed knowledge of the internal implementation of the PageClient.
2881              – Updates may unnecessarily be split over multiple IPC messages.
2882              – In order to support partial updates we make multiple virtual function calls to PageClient, which then makes duplicate objc calls. 
2883
2884             Better to just always update the entire ViewState. 
2885
2886             * UIProcess/API/Cocoa/WKWebView.mm:
2887             (-[WKWebView didMoveToWindow]):
2888                 - removed argument to viewStateDidChange.
2889             * UIProcess/API/gtk/PageClientImpl.cpp:
2890             (WebKit::PageClientImpl::viewState):
2891             (WebKit::PageClientImpl::isViewWindowActive): Deleted.
2892             (WebKit::PageClientImpl::isViewFocused): Deleted.
2893             (WebKit::PageClientImpl::isViewVisible): Deleted.
2894             (WebKit::PageClientImpl::isViewInWindow): Deleted.
2895             * UIProcess/API/gtk/PageClientImpl.h:
2896                 - merged isViewWindowActive/isViewFocused/isViewVisible/isViewInWindow to viewState.
2897             * UIProcess/API/mac/WKView.mm:
2898             (-[WKView becomeFirstResponder]):
2899             (-[WKView resignFirstResponder]):
2900             (-[WKView viewDidMoveToWindow]):
2901             (-[WKView _windowDidBecomeKey:]):
2902             (-[WKView _windowDidResignKey:]):
2903             (-[WKView _windowDidMiniaturize:]):
2904             (-[WKView _windowDidDeminiaturize:]):
2905             (-[WKView _windowDidOrderOffScreen:]):
2906             (-[WKView _windowDidOrderOnScreen:]):
2907             (-[WKView _windowDidChangeOcclusionState:]):
2908             (-[WKView viewDidHide]):
2909             (-[WKView viewDidUnhide]):
2910             (-[WKView _activeSpaceDidChange:]):
2911             (-[WKView _setThumbnailView:]):
2912             (-[WKView endDeferringViewInWindowChanges]):
2913             (-[WKView endDeferringViewInWindowChangesSync]):
2914                 - removed argument to viewStateDidChange.
2915             * UIProcess/CoordinatedGraphics/WebView.cpp:
2916             (WebKit::WebView::viewState):
2917             (WebKit::WebView::isViewWindowActive): Deleted.
2918             (WebKit::WebView::isViewFocused): Deleted.
2919             (WebKit::WebView::isViewVisible): Deleted.
2920             (WebKit::WebView::isViewInWindow): Deleted.
2921             * UIProcess/CoordinatedGraphics/WebView.h:
2922                 - merged isViewWindowActive/isViewFocused/isViewVisible/isViewInWindow to viewState.
2923             * UIProcess/PageClient.h:
2924             (WebKit::PageClient::isViewVisibleOrOccluded): Deleted.
2925             (WebKit::PageClient::isVisuallyIdle): Deleted.
2926                 - merged isViewVisibleOrOccluded/isVisuallyIdle to subclass viewState methods.
2927             * UIProcess/WebPageProxy.cpp:
2928             (WebKit::WebPageProxy::WebPageProxy):
2929             (WebKit::WebPageProxy::reattachToWebProcess):
2930                 - updateViewState -> PageClient::viewState
2931             (WebKit::WebPageProxy::viewStateDidChange):
2932                 - argument removed; updateViewState -> PageClient::viewState.
2933             (WebKit::WebPageProxy::setCursor):
2934                 - call isViewWindowActive on WebPageProxy, rather than PageClient.
2935             (WebKit::WebPageProxy::updateBackingStoreDiscardableState):
2936                 - call isViewWindowActive on WebPageProxy, rather than PageClient.
2937             (WebKit::WebPageProxy::updateViewState): Deleted.
2938                 - removed - viewState method moved to PageClient.
2939             * UIProcess/WebPageProxy.h:
2940             (WebKit::WebPageProxy::isViewWindowActive):
2941                 - added missing implementation.
2942             (WebKit::WebPageProxy::isViewVisible):
2943                 - removed argument to viewStateDidChange.
2944             * UIProcess/WebProcessProxy.cpp:
2945             (WebKit::WebProcessProxy::windowServerConnectionStateChanged):
2946                 - removed argument to viewStateDidChange.
2947             * UIProcess/ios/PageClientImplIOS.h:
2948             * UIProcess/ios/PageClientImplIOS.mm:
2949             (WebKit::PageClientImpl::viewState):
2950             (WebKit::PageClientImpl::isViewWindowActive): Deleted.
2951             (WebKit::PageClientImpl::isViewFocused): Deleted.
2952             (WebKit::PageClientImpl::isViewVisible): Deleted.
2953             (WebKit::PageClientImpl::isViewInWindow): Deleted.
2954             (WebKit::PageClientImpl::isViewVisibleOrOccluded): Deleted.
2955             (WebKit::PageClientImpl::isVisuallyIdle): Deleted.
2956                 - merged isViewWindowActive/isViewFocused/isViewVisible/isViewInWindow to viewState.
2957             * UIProcess/ios/WKContentView.mm:
2958             (-[WKContentView didMoveToWindow]):
2959             (-[WKContentView _applicationDidEnterBackground:]):
2960             (-[WKContentView _applicationWillEnterForeground:]):
2961                 - removed argument to viewStateDidChange.
2962             * UIProcess/mac/PageClientImpl.h:
2963             * UIProcess/mac/PageClientImpl.mm:
2964             (WebKit::PageClientImpl::viewState):
2965             (WebKit::PageClientImpl::showCorrectionPanel):
2966             (WebKit::PageClientImpl::showDictationAlternativeUI):
2967             (WebKit::PageClientImpl::isViewWindowActive): Deleted.
2968             (WebKit::PageClientImpl::isViewFocused): Deleted.
2969             (WebKit::PageClientImpl::isViewVisibleOrOccluded): Deleted.
2970             (WebKit::PageClientImpl::isVisuallyIdle): Deleted.
2971                 - merged isViewWindowActive/isViewFocused/isViewVisible/isViewInWindow to viewState.
2972
2973 2014-05-29  Dan Bernstein  <mitz@apple.com>
2974
2975         [Cocoa] Can’t recover from subframe load errors
2976         https://bugs.webkit.org/show_bug.cgi?id=133385
2977
2978         Reviewed by Anders Carlsson.
2979
2980         * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h: Declared new delegate method.
2981         * UIProcess/Cocoa/NavigationState.h: Added flag in m_navigationDelegateMethods struct.
2982         * UIProcess/Cocoa/NavigationState.mm:
2983         (WebKit::NavigationState::setNavigationDelegate): Initialize
2984         webViewNavigationDidFailProvisionalLoadInSubframeWithError flag in the delegate methods
2985         struct.
2986         (WebKit::NavigationState::LoaderClient::didFailProvisionalLoadWithErrorForFrame): If the
2987         error occurred in a subframe, invoke the new delegate method.
2988
2989 2014-05-29  Geoffrey Garen  <ggaren@apple.com>
2990
2991         Added a missing @result to WKPreferences headerdoc
2992         https://bugs.webkit.org/show_bug.cgi?id=133381
2993
2994         Reviewed by Dan Bernstein.
2995
2996         * UIProcess/API/Cocoa/WKPreferences.h:
2997
2998 2014-05-29  Alexey Proskuryakov  <ap@apple.com>
2999
3000         [Mac] Always use plug-in sandbox with sandboxed clients
3001         https://bugs.webkit.org/show_bug.cgi?id=133358
3002         <rdar://problem/15637695>
3003
3004         Reviewed by Anders Carlsson.
3005
3006         * PluginProcess/mac/PluginProcessMac.mm: (WebKit::PluginProcess::initializeSandbox):
3007         Refuse to start if parent process is sandboxed, and plug-in process is not going to be.
3008         None of this should run in normal case, because there are also checks on UI process side.
3009         
3010         * Shared/Plugins/PluginModuleInfo.h:
3011         * Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm:
3012         (WebKit::NetscapePluginModule::getPluginInfo):
3013         Added a member to PluginModuleInfo, telling whether the plug-in has a sandbox profile.
3014
3015         * Shared/Plugins/Netscape/mac/PluginInformationMac.mm:
3016         (WebKit::getPlatformPluginModuleInformation): Use the new PluginModuleInfo member,
3017         we no longer need to check the file system here.
3018
3019         * WebKit2.xcodeproj/project.pbxproj:
3020         * Shared/mac/SandboxUtilities.h: Added.
3021         * Shared/mac/SandboxUtilities.cpp: Added. (WebKit::processIsSandboxed):
3022         This code is simple, but include magic is not. Moved it to a separate file to
3023         avoid repeating.
3024
3025         * UIProcess/API/C/mac/WKContextPrivateMac.mm: Removed an unused include.
3026
3027         * UIProcess/Plugins/mac/PluginInfoStoreMac.mm:
3028         (WebKit::PluginInfoStore::shouldUsePlugin): Don't use unsandboxed plug-ins in
3029         sandboxed applications.
3030
3031         * UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
3032         (WebKit::PluginProcessProxy::platformGetLaunchOptions): Don't ever pass disable-sandbox
3033         from sandboxed processes.
3034
3035         * Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.mm:
3036         (WebKit::XPCServiceInitializerDelegate::isClientSandboxed):
3037         Use the new shared code in SandboxUtilities.h.
3038
3039 2014-05-29  Timothy Horton  <timothy_horton@apple.com>
3040
3041         Crash loading skydrive.com (assertion under RemoteLayerTreeDisplayRefreshMonitor)
3042         https://bugs.webkit.org/show_bug.cgi?id=133370
3043         <rdar://problem/17061361>
3044
3045         Reviewed by Anders Carlsson.
3046
3047         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
3048         (WebKit::RemoteLayerTreeDrawingArea::didUpdate):
3049         Copy the set of refresh monitors so that we don't try to mutate the list we're iterating,
3050         and don't try to fire refresh monitors that were removed in a previous iteration of the loop.
3051
3052 2014-05-29  Timothy Horton  <timothy_horton@apple.com>
3053
3054         REGRESSION (iOS WebKit2): Find-in-Page doesn't work in subframes
3055         https://bugs.webkit.org/show_bug.cgi?id=133372
3056         <rdar://problem/17045070>
3057
3058         Reviewed by Simon Fraser.
3059
3060         * WebProcess/WebPage/ios/FindControllerIOS.mm:
3061         (WebKit::FindController::willFindString):
3062         (WebKit::FindController::didFailToFindString):
3063         (WebKit::FindController::didHideFindIndicator):
3064         Flip ignoreCompositionSelectionChange and updateAppearanceEnabled on all
3065         frames, not just the main frame, because the found string can be in a subframe.
3066         Ideally we would flip it on/off for each frame as we move the selection between them,
3067         but would require a lot of work (and the overhead of touching each frame shouldn't be significant).
3068
3069 2014-05-29  Dan Bernstein  <mitz@apple.com>
3070
3071         WKBundleActivateMacFontAscentHack is unused
3072         https://bugs.webkit.org/show_bug.cgi?id=133379
3073
3074         Reviewed by Anders Carlsson.
3075
3076         * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
3077         (WKBundleActivateMacFontAscentHack): Deleted.
3078         * WebProcess/InjectedBundle/API/c/WKBundlePrivate.h:
3079         * WebProcess/InjectedBundle/InjectedBundle.h:
3080         * WebProcess/InjectedBundle/efl/InjectedBundleEfl.cpp:
3081         (WebKit::InjectedBundle::activateMacFontAscentHack): Deleted.
3082         * WebProcess/InjectedBundle/gtk/InjectedBundleGtk.cpp:
3083         (WebKit::InjectedBundle::activateMacFontAscentHack): Deleted.
3084         * WebProcess/InjectedBundle/mac/InjectedBundleMac.mm:
3085         (WebKit::InjectedBundle::activateMacFontAscentHack): Deleted.
3086
3087 2014-05-29  Alexey Proskuryakov  <ap@apple.com>
3088
3089         Add a sandbox profile for com.apple.appstore.CodeRedeemerNetscapePlugin
3090         https://bugs.webkit.org/show_bug.cgi?id=133360
3091
3092         Reviewed by Sam Weinig.
3093
3094         * Resources/PlugInSandboxProfiles/com.apple.WebKit.plugin-common.sb: Looks like
3095         anyone using camera would need access to CoreMedia preferences.
3096
3097         * Resources/PlugInSandboxProfiles/com.apple.appstore.CodeRedeemerNetscapePlugin.sb: Added.
3098
3099         * WebKit2.xcodeproj/project.pbxproj: Added the profile.
3100
3101 2014-05-29  Carlos Garcia Campos  <cgarcia@igalia.com>
3102
3103         [GTK] Add support for HiDPI icons
3104         https://bugs.webkit.org/show_bug.cgi?id=133377
3105
3106         Reviewed by Martin Robinson.
3107
3108         * PlatformGTK.cmake: Compile also the @2x versions for the builtin icons.
3109
3110 2014-05-29  Owen Taylor  <otaylor@redhat.com>
3111
3112         [GTK] Add HighDPI support for non-accelerated compositing contents
3113         https://bugs.webkit.org/show_bug.cgi?id=131562
3114
3115         Reviewed by Anders Carlsson.
3116
3117         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
3118         (deviceScaleFactorChanged): Added this callback to pass scale changes to the page proxy.
3119         (webkitWebViewBaseCreateWebPage): Attach the callback to the notify signal.
3120         * UIProcess/WebPageProxy.cpp:
3121         * UIProcess/cairo/BackingStoreCairo.cpp:
3122         (WebKit::WebPageProxy::setCustomDeviceScaleFactor): Do not set a
3123         custom device scale factor for cairo when it's not supported.
3124         (WebKit::createBackingStoreForGTK): Pass the scale factor to the WebCore backing store.
3125         (WebKit::BackingStore::incorporateUpdate): Ditto.
3126
3127 2014-05-28  Carlos Garcia Campos  <cgarcia@igalia.com>
3128
3129         [GTK] Use GMainLoopSource for idle and timeout sources in WebKit2
3130         https://bugs.webkit.org/show_bug.cgi?id=130081
3131
3132         Reviewed by Martin Robinson.
3133
3134         * Platform/WorkQueue.h:
3135         * Platform/gtk/WorkQueueGtk.cpp:
3136         (WorkQueue::registerSocketEventHandler): Stop pretending it's
3137         possible to register a socket event handler for more than one
3138         descriptor.
3139         (WorkQueue::unregisterSocketEventHandler):
3140         (WorkQueue::dispatch):
3141         (WorkQueue::dispatchAfter):
3142         * Shared/Downloads/soup/DownloadSoup.cpp:
3143         (WebKit::DownloadClient::DownloadClient):
3144         (WebKit::DownloadClient::~DownloadClient):
3145         (WebKit::DownloadClient::didReceiveData):
3146         (WebKit::DownloadClient::handleResponse):
3147         (WebKit::DownloadClient::handleResponseLater):
3148         * UIProcess/Plugins/gtk/PluginInfoCache.cpp:
3149         (WebKit::PluginInfoCache::PluginInfoCache):
3150         (WebKit::PluginInfoCache::~PluginInfoCache):
3151         (WebKit::PluginInfoCache::saveToFile):
3152         (WebKit::PluginInfoCache::updatePluginInfo):
3153         * UIProcess/Plugins/gtk/PluginInfoCache.h:
3154         * WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp:
3155         (WebKit::LayerTreeHostGtk::LayerTreeHostGtk):
3156         (WebKit::LayerTreeHostGtk::layerFlushTimerFired):
3157         (WebKit::LayerTreeHostGtk::scheduleLayerFlush):
3158         (WebKit::LayerTreeHostGtk::cancelPendingLayerFlush):
3159         * WebProcess/WebPage/gtk/LayerTreeHostGtk.h:
3160
3161 2014-05-28  Gavin Barraclough  <baraclough@apple.com>
3162
3163         viewStateDidChange should always fully update ViewState
3164         https://bugs.webkit.org/show_bug.cgi?id=133159
3165
3166         Reviewed by Anders Carlson.
3167
3168         Currently WebPageProxy::viewStateDidChange is passed a mask of bits to update.
3169
3170         This has the following negative consequences:
3171          – WKWebView implicitly requires more detailed knowledge of the internal implementation of the PageClient.
3172          – Updates may unnecessarily be split over multiple IPC messages.
3173          – In order to support partial updates we make multiple virtual function calls to PageClient, which then makes duplicate objc calls.
3174
3175         Better to just always update the entire ViewState.
3176
3177         * UIProcess/API/Cocoa/WKWebView.mm:
3178         (-[WKWebView didMoveToWindow]):
3179             - removed argument to viewStateDidChange.
3180         * UIProcess/API/gtk/PageClientImpl.cpp:
3181         (WebKit::PageClientImpl::viewState):
3182         (WebKit::PageClientImpl::isViewWindowActive): Deleted.
3183         (WebKit::PageClientImpl::isViewFocused): Deleted.
3184         (WebKit::PageClientImpl::isViewVisible): Deleted.
3185         (WebKit::PageClientImpl::isViewInWindow): Deleted.
3186         * UIProcess/API/gtk/PageClientImpl.h:
3187             - merged isViewWindowActive/isViewFocused/isViewVisible/isViewInWindow to viewState.
3188         * UIProcess/API/mac/WKView.mm:
3189         (-[WKView becomeFirstResponder]):
3190         (-[WKView resignFirstResponder]):
3191         (-[WKView viewDidMoveToWindow]):
3192         (-[WKView _windowDidBecomeKey:]):
3193         (-[WKView _windowDidResignKey:]):
3194         (-[WKView _windowDidMiniaturize:]):
3195         (-[WKView _windowDidDeminiaturize:]):
3196         (-[WKView _windowDidOrderOffScreen:]):
3197         (-[WKView _windowDidOrderOnScreen:]):
3198         (-[WKView _windowDidChangeOcclusionState:]):
3199         (-[WKView viewDidHide]):
3200         (-[WKView viewDidUnhide]):
3201         (-[WKView _activeSpaceDidChange:]):
3202         (-[WKView _setThumbnailView:]):
3203         (-[WKView endDeferringViewInWindowChanges]):
3204         (-[WKView endDeferringViewInWindowChangesSync]):
3205             - removed argument to viewStateDidChange.
3206         * UIProcess/CoordinatedGraphics/WebView.cpp:
3207         (WebKit::WebView::viewState):
3208         (WebKit::WebView::isViewWindowActive): Deleted.
3209         (WebKit::WebView::isViewFocused): Deleted.
3210         (WebKit::WebView::isViewVisible): Deleted.
3211         (WebKit::WebView::isViewInWindow): Deleted.
3212         * UIProcess/CoordinatedGraphics/WebView.h:
3213             - merged isViewWindowActive/isViewFocused/isViewVisible/isViewInWindow to viewState.
3214         * UIProcess/PageClient.h:
3215         (WebKit::PageClient::isViewVisibleOrOccluded): Deleted.
3216         (WebKit::PageClient::isVisuallyIdle): Deleted.
3217             - merged isViewVisibleOrOccluded/isVisuallyIdle to subclass viewState methods.
3218         * UIProcess/WebPageProxy.cpp:
3219         (WebKit::WebPageProxy::WebPageProxy):
3220         (WebKit::WebPageProxy::reattachToWebProcess):
3221             - updateViewState -> PageClient::viewState
3222         (WebKit::WebPageProxy::viewStateDidChange):
3223             - argument removed; updateViewState -> PageClient::viewState.
3224         (WebKit::WebPageProxy::setCursor):
3225             - call isViewWindowActive on WebPageProxy, rather than PageClient.
3226         (WebKit::WebPageProxy::updateBackingStoreDiscardableState):
3227             - call isViewWindowActive on WebPageProxy, rather than PageClient.
3228         (WebKit::WebPageProxy::updateViewState): Deleted.
3229             - removed - viewState method moved to PageClient.
3230         * UIProcess/WebPageProxy.h:
3231         (WebKit::WebPageProxy::isViewWindowActive):
3232             - added missing implementation.
3233         (WebKit::WebPageProxy::isViewVisible):
3234             - removed argument to viewStateDidChange.
3235         * UIProcess/WebProcessProxy.cpp:
3236         (WebKit::WebProcessProxy::windowServerConnectionStateChanged):
3237             - removed argument to viewStateDidChange.
3238         * UIProcess/ios/PageClientImplIOS.h:
3239         * UIProcess/ios/PageClientImplIOS.mm:
3240         (WebKit::PageClientImpl::viewState):
3241         (WebKit::PageClientImpl::isViewWindowActive): Deleted.
3242         (WebKit::PageClientImpl::isViewFocused): Deleted.
3243         (WebKit::PageClientImpl::isViewVisible): Deleted.
3244         (WebKit::PageClientImpl::isViewInWindow): Deleted.
3245         (WebKit::PageClientImpl::isViewVisibleOrOccluded): Deleted.
3246         (WebKit::PageClientImpl::isVisuallyIdle): Deleted.
3247             - merged isViewWindowActive/isViewFocused/isViewVisible/isViewInWindow to viewState.
3248         * UIProcess/ios/WKContentView.mm:
3249         (-[WKContentView didMoveToWindow]):
3250         (-[WKContentView _applicationDidEnterBackground:]):
3251         (-[WKContentView _applicationWillEnterForeground:]):
3252             - removed argument to viewStateDidChange.
3253         * UIProcess/mac/PageClientImpl.h:
3254         * UIProcess/mac/PageClientImpl.mm:
3255         (WebKit::PageClientImpl::viewState):
3256         (WebKit::PageClientImpl::showCorrectionPanel):
3257         (WebKit::PageClientImpl::showDictationAlternativeUI):
3258         (WebKit::PageClientImpl::isViewWindowActive): Deleted.
3259         (WebKit::PageClientImpl::isViewFocused): Deleted.
3260         (WebKit::PageClientImpl::isViewVisibleOrOccluded): Deleted.
3261         (WebKit::PageClientImpl::isVisuallyIdle): Deleted.
3262             - merged isViewWindowActive/isViewFocused/isViewVisible/isViewInWindow to viewState.
3263
3264 2014-05-28  Jeffrey Pfau  <jpfau@apple.com>
3265
3266         Add Obj-C API for cache partitioned URL schemes
3267         https://bugs.webkit.org/show_bug.cgi?id=133361
3268         <rdar://problem/17035415>
3269
3270         Reviewed by Anders Carlsson.
3271
3272         * UIProcess/API/Cocoa/WKProcessPool.mm:
3273         (-[WKProcessPool _initWithConfiguration:]):
3274         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
3275         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
3276         (-[_WKProcessPoolConfiguration cachePartitionedURLSchemes]):
3277         (-[_WKProcessPoolConfiguration setCachePartitionedURLSchemes:]):
3278         (-[_WKProcessPoolConfiguration copyWithZone:]):
3279
3280 2014-05-28  Sam Weinig  <sam@webkit.org>
3281
3282         [iOS WebKit2] Sometimes Safari gets into a limbo state after web process crash
3283         <rdar://problem/17029526>
3284         https://bugs.webkit.org/show_bug.cgi?id=133362
3285
3286         Reviewed by Dan Bernstein.
3287
3288         * UIProcess/WebPageProxy.cpp:
3289         (WebKit::WebPageProxy::WebPageProxy):
3290         Remove unnecessary initialization of a unique_ptr.
3291
3292         (WebKit::WebPageProxy::reattachToWebProcess):
3293         Move calls to update the view state and activity tokens to after we have swapped in the new process.
3294
3295         (WebKit::WebPageProxy::resetStateAfterProcessExited):
3296         Clear the activity token on process exit.
3297
3298 2014-05-28  Timothy Horton  <timothy_horton@apple.com>
3299
3300         Add WKWebView SPI to forcefully kill the associated Web process
3301         https://bugs.webkit.org/show_bug.cgi?id=133357
3302
3303         Reviewed by Anders Carlsson.
3304
3305         * UIProcess/API/Cocoa/WKWebView.mm:
3306         (-[WKWebView _killWebContentProcess]):
3307         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
3308
3309 2014-05-28  Dan Bernstein  <mitz@apple.com>
3310
3311         [Cocoa] Crash when trying to decode an instance of a class inheriting from WKObject
3312         https://bugs.webkit.org/show_bug.cgi?id=133355
3313
3314         Reviewed by Anders Carlsson.
3315
3316         * Shared/Cocoa/WKObject.mm:
3317         (-[WKObject classForCoder]): Override this NSObject method to forward to the
3318         target object.
3319         (-[WKObject classForKeyedArchiver]): Ditto.
3320
3321 2014-05-28  Simon Fraser  <simon.fraser@apple.com>
3322
3323         [iOS WK2] Improve behavior of position:fixed inside accelerated overflow-scroll
3324         https://bugs.webkit.org/show_bug.cgi?id=133352
3325
3326         Reviewed by Tim Horton.
3327
3328         Pass the correct delta down to descendant nodes.
3329
3330         * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:
3331         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::updateChildNodesAfterScroll):
3332
3333 2014-05-28  Andy Estes  <aestes@apple.com>
3334
3335         [iOS] REGRESSION (r168388): DidNotHandleTapAsClick not sent when commitPotentialTap() fails
3336         https://bugs.webkit.org/show_bug.cgi?id=133349
3337
3338         Reviewed by Benjamin Poulain.
3339
3340         WebPage::commitPotentialTap() fails when a recognized single tap cannot be sent as a synthetic click event.
3341         We should send WebPageProxy::DidNotHandleTapAsClick in these cases.
3342
3343         * WebProcess/WebPage/WebPage.h:
3344         * WebProcess/WebPage/ios/WebPageIOS.mm:
3345         (WebKit::WebPage::commitPotentialTap):
3346         (WebKit::WebPage::commitPotentialTapFailed):
3347
3348 2014-05-28  Commit Queue  <commit-queue@webkit.org>
3349
3350         Unreviewed, rolling out r169423.
3351         https://bugs.webkit.org/show_bug.cgi?id=133348
3352
3353         It makes a lot of tests crash in assert (Requested by KaL on
3354         #webkit).
3355
3356         Reverted changeset:
3357
3358         "[GTK] Use GMainLoopSource for idle and timeout sources in
3359         WebKit2"
3360         https://bugs.webkit.org/show_bug.cgi?id=130081
3361         http://trac.webkit.org/changeset/169423
3362
3363 2014-05-28  Carlos Garcia Campos  <cgarcia@igalia.com>
3364
3365         [GTK] Use GMainLoopSource for idle and timeout sources in WebKit2
3366         https://bugs.webkit.org/show_bug.cgi?id=130081
3367
3368         Reviewed by Martin Robinson.
3369
3370         * Platform/WorkQueue.h:
3371         * Platform/gtk/WorkQueueGtk.cpp:
3372         (WorkQueue::registerSocketEventHandler): Stop pretending it's
3373         possible to register a socket event handler for more than one
3374         descriptor.
3375         (WorkQueue::unregisterSocketEventHandler):
3376         (WorkQueue::dispatch):
3377         (WorkQueue::dispatchAfter):
3378         * Shared/Downloads/soup/DownloadSoup.cpp:
3379         (WebKit::DownloadClient::DownloadClient):
3380         (WebKit::DownloadClient::~DownloadClient):
3381         (WebKit::DownloadClient::didReceiveData):
3382         (WebKit::DownloadClient::handleResponse):
3383         (WebKit::DownloadClient::handleResponseLater):
3384         * UIProcess/Plugins/gtk/PluginInfoCache.cpp:
3385         (WebKit::PluginInfoCache::PluginInfoCache):
3386         (WebKit::PluginInfoCache::~PluginInfoCache):
3387         (WebKit::PluginInfoCache::saveToFile):
3388         (WebKit::PluginInfoCache::updatePluginInfo):
3389         * UIProcess/Plugins/gtk/PluginInfoCache.h:
3390         * WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp:
3391         (WebKit::LayerTreeHostGtk::LayerTreeHostGtk):
3392         (WebKit::LayerTreeHostGtk::layerFlushTimerFired):
3393         (WebKit::LayerTreeHostGtk::scheduleLayerFlush):
3394         (WebKit::LayerTreeHostGtk::cancelPendingLayerFlush):
3395         * WebProcess/WebPage/gtk/LayerTreeHostGtk.h:
3396
3397 2014-05-28  Dan Bernstein  <mitz@apple.com>
3398
3399         [Cocoa] Can't use bundle-defined classes for bundle parameters
3400         https://bugs.webkit.org/show_bug.cgi?id=133339
3401
3402         Reviewed by Anders Carlsson.
3403
3404         Ensure that bundle parameters are decoded only after the injected bundle is loaded.
3405
3406         * WebProcess/InjectedBundle/InjectedBundle.cpp:
3407         (WebKit::InjectedBundle::create): Moved the definition from the header to here, added the
3408         lagacy initializationUserData as a parameter, and made this function set the sandbox
3409         extension and load the bundle.
3410         (WebKit::InjectedBundle::InjectedBundle): Removed call to platformInitialize.
3411         * WebProcess/InjectedBundle/InjectedBundle.h:
3412         (WebKit::InjectedBundle::setSandboxExtension): Deleted.
3413         * WebProcess/InjectedBundle/mac/InjectedBundleMac.mm:
3414         (WebKit::InjectedBundle::initialize): Renamed the load function to this, and added the
3415         creation parameters as a parameter. Moved code to initialize the bundle paramters from
3416         platformInitialize to here. Changed the class passed to -decodeObjectOfClass:forKey: to
3417         NSObject, to allow arbitrary types in the values, and added an assertion that the
3418         top-level object is a dictionary.
3419         (WebKit::InjectedBundle::platformInitialize): Deleted.
3420         * WebProcess/WebProcess.cpp:
3421         (WebKit::WebProcess::initializeWebProcess): Changed to pass the legacy initialization user
3422         data to InjectedBundle::create() and removed code to separately set the sandbox extension
3423         and load the bundle, which is now done by create().
3424
3425 2014-05-28  Alberto Garcia  <berto@igalia.com>
3426
3427         Unreviewed. Fix warning: unused parameter 'frame'
3428
3429         * WebProcess/WebPage/WebPage.cpp:
3430         (WebKit::WebPage::didFinishDocumentLoad):
3431
3432 2014-05-27  Simon Fraser  <simon.fraser@apple.com>
3433
3434         [iOS WK2] Fix behavior of position:sticky inside accelerated overflow-scroll
3435         https://bugs.webkit.org/show_bug.cgi?id=133334
3436         <rdar://problem/16462535>
3437
3438         Reviewed by Tim Horton.
3439
3440         When the scroll position changes in an accelerated overflow-scroll element, we have
3441         to update child nodes in the scrolling tree for position:sticky. That requires a
3442         more generic ability to update the scrolling tree after some arbitrary zoom or
3443         scroll. To do this, we need to know the current fixed position rect, rather than
3444         having it passed in.
3445         
3446         So make the fixed position rect available from ScrollingTree, and make it possible
3447         to get the current scrollPosition() from any ScrollingTreeScrollingNode.
3448         
3449         Also, implement updateLayersAfterDelegatedScroll() in ScrollingTreeOverflowScrollingNodeIOS,
3450         and have it update descendant layers.
3451         
3452         Finally, fix ScrollingTreeOverflowScrollingNode to use the correct rectangle for its
3453         constraints math, using the scroll position of the parent node if appropriate.
3454
3455         * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h:
3456         * UIProcess/Scrolling/RemoteScrollingTree.cpp:
3457         (WebKit::RemoteScrollingTree::fixedPositionRect):
3458         * UIProcess/Scrolling/RemoteScrollingTree.h:
3459         * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.h:
3460         * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:
3461         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::updateLayersAfterDelegatedScroll):
3462         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::updateChildNodesAfterScroll):
3463         * UIProcess/ios/RemoteScrollingCoordinatorProxyIOS.mm:
3464         (WebKit::RemoteScrollingCoordinatorProxy::customFixedPositionRect):
3465
3466 2014-05-27  Simon Fraser  <simon.fraser@apple.com>
3467
3468         Do some renaming in the scrolling tree
3469         https://bugs.webkit.org/show_bug.cgi?id=133333
3470
3471         Reviewed by Tim Horton.
3472         
3473         Rename ScrollingTreeNode::parentScrollPositionDidChange() to updateLayersAfterAncestorChange()
3474         since this goes deep and to indicate that it's about layer updating.
3475         
3476         Also rename the "viewportRect" parameter to "fixedPositionRect", since on iOS
3477         this is the custom fixed-position rect that changes on zooming.
3478
3479         * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp:
3480         (WebKit::RemoteScrollingCoordinatorProxy::viewportChangedViaDelegatedScrolling):
3481         * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h:
3482         * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.h:
3483         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::updateLayersAfterViewportChange):
3484
3485 2014-05-27  Geoffrey Garen  <ggaren@apple.com>
3486