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