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