Clean up usesAsyncCallbacks handling in ResourceHandle
[WebKit-https.git] / Source / WebKit2 / ChangeLog
1 2015-07-28  Alexey Proskuryakov  <ap@apple.com>
2
3         Clean up usesAsyncCallbacks handling in ResourceHandle
4         https://bugs.webkit.org/show_bug.cgi?id=147342
5
6         Reviewed by Darin Adler.
7
8         Update for a renaming in WebCore.
9
10         * NetworkProcess/NetworkResourceLoader.cpp:
11         (WebKit::NetworkResourceLoader::cleanup):
12         * Shared/Downloads/soup/DownloadSoup.cpp:
13         (WebKit::Download::platformInvalidate):
14
15 2015-07-28  Chris Fleizach  <cfleizach@apple.com>
16
17         AX: iOS: VoiceOver hangs indefinitely when an JS alert appears
18         https://bugs.webkit.org/show_bug.cgi?id=147386
19
20         Reviewed by Anders Carlsson.
21
22         Support the iOS platform API to notify accessibility clients when the WebProcess is about to suspend (because of some modal dialog).
23         Luckily, we did all the hardwork for OSX a few years ago to support this paradigm.         
24
25         * Platform/IPC/mac/ConnectionMac.mm:
26         (IPC::AccessibilityProcessSuspendedNotification):
27         (IPC::Connection::willSendSyncMessage):
28         (IPC::Connection::didReceiveSyncReply):
29
30 2015-07-28  Yusuke Suzuki  <utatane.tea@gmail.com>
31
32         [ES6] Add ENABLE_ES6_MODULES compile time flag with the default value "false"
33         https://bugs.webkit.org/show_bug.cgi?id=147350
34
35         Reviewed by Sam Weinig.
36
37         * Configurations/FeatureDefines.xcconfig:
38
39 2015-07-28  Said Abou-Hallawa  <sabouhallawa@apple.com>
40
41         [iOS] REGRESSION(r168075): Fullscreen web video doesn't pause on screen lock
42         https://bugs.webkit.org/show_bug.cgi?id=147269
43
44         Reviewed by Andreas Kling.
45
46         Media elements should pause when the application is going to EnterBackground
47         under lock regardless whether it is in full screen or not.
48
49         * Platform/spi/ios/UIKitSPI.h: Forward declare [UIApplication isSuspendedUnderLock].
50
51         * UIProcess/ios/WebPageProxyIOS.mm:
52         (WebKit::WebPageProxy::applicationDidEnterBackground):
53         [UIApp isSuspendedUnderLock] can only be called in the UIProcess. We need
54         to call it here and pass it to the WebPage in the WebProcess as part of the
55         ApplicationDidEnterBackground message.
56         
57         * WebProcess/WebPage/WebPage.h:
58         * WebProcess/WebPage/WebPage.messages.in: Add the new parameter:
59         'isSuspendedUnderLock' to the ApplicationDidEnterBackground message.
60         
61         * WebProcess/WebPage/ios/WebPageIOS.mm:
62         (WebKit::WebPage::applicationDidEnterBackground): On iOS, the WebPage needs
63         to notify the MediaSessionManagerIOS that it received the message 
64         ApplicationDidEnterBackground.
65
66 2015-07-28  Yongjun Zhang  <yongjun_zhang@apple.com>
67
68         Bounds in InteractionInformationAtPosition should be always in main frame coordinate space.
69         https://bugs.webkit.org/show_bug.cgi?id=147372
70
71         When we prepare the bounds for InteractionInformationAtPosition, we should convert the rect to
72         main frame space since WKContent in UIProcess expects it to be in the web view space.
73
74         Reviewed by Tim Horton.
75
76         * WebProcess/WebPage/ios/WebPageIOS.mm:
77         (WebKit::WebPage::getPositionInformation): Convert the bounding rect to main frame space if the element is inside a sub-frame.
78
79 2015-07-27  Simon Fraser  <simon.fraser@apple.com>
80
81         PathApplierFunction should take a reference to a PathElement
82         https://bugs.webkit.org/show_bug.cgi?id=147337
83
84         Reviewed by Dan Bates.
85
86         Convert PathApplierFunction to take a const PathElement&, since it can never be null.
87
88         * Shared/WebCoreArgumentCoders.cpp:
89         (IPC::pathPointCountApplierFunction):
90         (IPC::pathEncodeApplierFunction):
91
92 2015-07-28  Jer Noble  <jer.noble@apple.com>
93
94         [iOS] Notify fullscreen controller in UIProcess whether external playback is allowed
95         https://bugs.webkit.org/show_bug.cgi?id=147343
96
97         Reviewed by Brady Eidson.
98
99         Pass the boolean property wirelessVideoPlaybackDisabled across the UIProcess/WebProcess boundary.
100
101         * UIProcess/ios/WebVideoFullscreenManagerProxy.mm:
102         (WebKit::WebVideoFullscreenManagerProxy::setWirelessVideoPlaybackDisabled):
103         * WebProcess/ios/WebVideoFullscreenManager.mm:
104         (WebKit::WebVideoFullscreenInterfaceContext::setWirelessVideoPlaybackDisabled):
105         (WebKit::WebVideoFullscreenManager::WebVideoFullscreenManager):
106         (WebKit::WebVideoFullscreenManager::setWirelessVideoPlaybackDisabled):
107
108 2015-07-28  Carlos Garcia Campos  <cgarcia@igalia.com>
109
110         [GTK] Use fastMalloc instead of g_slice
111         https://bugs.webkit.org/show_bug.cgi?id=147357
112
113         Reviewed by Sergio Villar Senin.
114
115         The use of g_slice is no longer encouraged by glib developers.
116
117         * UIProcess/API/gtk/WebKitCredential.cpp:
118         (webkitCredentialCreate):
119         (webkit_credential_free):
120         * UIProcess/API/gtk/WebKitJavascriptResult.cpp:
121         (webkitJavascriptResultCreate):
122         (webkit_javascript_result_unref):
123         * UIProcess/API/gtk/WebKitMimeInfo.cpp:
124         (webkitMimeInfoCreate):
125         (webkit_mime_info_unref):
126         * UIProcess/API/gtk/WebKitNavigationAction.cpp:
127         (webkitNavigationActionCreate):
128         (webkit_navigation_action_copy):
129         (webkit_navigation_action_free):
130         * UIProcess/API/gtk/WebKitPrivate.h:
131         * UIProcess/API/gtk/WebKitScriptDialog.cpp:
132         (webkitScriptDialogCopy):
133         (webkitScriptDialogFree):
134         * UIProcess/API/gtk/WebKitUserContent.cpp:
135         (webkit_user_style_sheet_unref):
136         (webkit_user_style_sheet_new):
137         (webkit_user_script_unref):
138         (webkit_user_script_new):
139
140 2015-07-27  Dan Bernstein  <mitz@apple.com>
141
142         [iOS] REGRESSION (r187376): Form editing buttons are missing from the Shortcut Bar
143         https://bugs.webkit.org/show_bug.cgi?id=147351
144
145         Reviewed by Adele Peterson.
146
147         We were relying on -[WKContentView inputAccessoryView] getting called to initialize the form
148         accessory view, even when that method would always return nil, as it does on iPad. After
149         r187376, that method changed to initializing the view only when returning it, which caused
150         this bug.
151
152         * UIProcess/ios/WKContentViewInteraction.mm:
153         (-[WKContentView _displayFormNodeInputView]): Call the new -_ensureFormAccessoryView from
154         here, when we are going to need the view.
155         (-[WKContentView _ensureFormAccessoryView]): Moved initialization code from
156         -inputAccessoryView here, and removed outdated +instancesRespondToSelector: check.
157         (-[WKContentView inputAccessoryView]): Now calls through -formAccessoryView.
158         (-[WKContentView formAccessoryView]): Added call to -_ensureFormAccessoryView here.
159
160 2015-07-27  Andreas Kling  <akling@apple.com>
161
162         WebsiteDataStore should clean up its storage in the network process when destroyed.
163         <https://webkit.org/b/147349>
164         <rdar://problem/21838764>
165
166         Reviewed by Darin Adler.
167
168         Have ~WebsiteDataStore() send a DestroyPrivateBrowsingSession message to all networking processes
169         for ephemeral sessions. This plugs a NetworkStorageSession leak that could retain a large
170         CFNetwork object graph.
171
172         This complements r187115 which did the same for network process storage owned by
173         API::Session objects.
174
175         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
176         (WebKit::WebsiteDataStore::~WebsiteDataStore):
177
178 2015-07-27  Tim Horton  <timothy_horton@apple.com>
179
180         First in-window viewStateChange synchronously blocks despite not previously being in-window
181         https://bugs.webkit.org/show_bug.cgi?id=147344
182         <rdar://problem/22021772>
183
184         Reviewed by Simon Fraser.
185
186         * UIProcess/WebPageProxy.cpp:
187         (WebKit::WebPageProxy::updateViewState):
188         (WebKit::WebPageProxy::dispatchViewStateChange):
189         The whole point of m_viewWasEverInWindow was so that we would not
190         synchronously wait when a view was added to a window for the first time,
191         only all subsequent times.
192
193         However, since m_viewWasEverInWindow was being set *before* being
194         checked in dispatchViewStateChange, we were always blocking. This is
195         a huge waste of main-thread time, because there's no reason to wait
196         for the first paint if you've never seen the view before (and shouldn't
197         expect it to have content).
198
199         Instead, set the flag after dispatching a view state change, so it becomes
200         "have we ever sent a view state with IsInWindow set" instead.
201
202 2015-07-27  Tim Horton  <timothy_horton@apple.com>
203
204         [iOS] Long press or link click can sometimes trigger during/after a preview
205         https://bugs.webkit.org/show_bug.cgi?id=147338
206         <rdar://problem/22020770>
207
208         Reviewed by Enrica Casucci.
209
210         * UIProcess/ios/WKContentViewInteraction.mm:
211         (-[WKContentView _longPressRecognized:]):
212         Bail if we're previewing.
213
214         (-[WKContentView _dataForPreviewItemController:atPosition:type:]):
215         (-[WKContentView _presentedViewControllerForPreviewItemController:]):
216         Always avoid allowing clicks and start interaction when previewing a link.
217
218 2015-07-27  Andreas Kling  <akling@apple.com>
219
220         [iOS] Occasional crashes in WebPage::elementDidBlur()'s async block.
221         <https://webkit.org/b/147281>
222         <rdar://problem/21701858>
223
224         Reviewed by Anders Carlsson.
225
226         Protect the WebPage object until the dispatch_async block has finished.
227         I have no way to repro this, but there's evidence of some crashing here.
228
229         * WebProcess/WebPage/ios/WebPageIOS.mm:
230         (WebKit::WebPage::elementDidBlur):
231
232 2015-07-27  Michael Catanzaro  <mcatanzaro@igalia.com>
233
234         [Seccomp] Set appropriate filters when trapping syscalls by default
235         https://bugs.webkit.org/show_bug.cgi?id=142983
236
237         If we trap syscalls by default, we must not set separate filters to trap
238         anything here, since it will fail causing us to crash.
239
240         But also, there are some things we must allow unconditionally even when
241         trapping by default. sigreturn, obviously. Also, let's whitelist brk
242         here instead of in platform-specific code.
243
244         Reviewed by Žan Doberšek.
245
246         * Shared/linux/SeccompFilters/SeccompBroker.cpp:
247         (WebKit::SeccompBroker::launchProcess): Don't trap sigprocmask or sigaction unless allow is
248         the default action. Also, allow sigreturn and brk is allow is not the default.
249         * Shared/linux/SeccompFilters/SeccompFilters.cpp: Added
250         (WebKit::SeccompFilters::defaultAction):
251         * Shared/linux/SeccompFilters/SeccompFilters.h: Added defaultAction
252
253 2015-07-27  Matthew Daiter  <mdaiter@apple.com>
254
255         Renamed duplicate vectors inside UserMediaPermissionRequestProxy
256         https://bugs.webkit.org/show_bug.cgi?id=147321
257         <rdar://problem/22011290>
258
259         Reviewed by Eric Carlson.
260
261         * UIProcess/UserMediaPermissionRequestProxy.cpp:
262         (WebKit::UserMediaPermissionRequestProxy::UserMediaPermissionRequestProxy):
263         * UIProcess/UserMediaPermissionRequestProxy.h:
264         (WebKit::UserMediaPermissionRequestProxy::videoDeviceUIDs):
265         (WebKit::UserMediaPermissionRequestProxy::audioDeviceUIDs):
266         (WebKit::UserMediaPermissionRequestProxy::deviceUIDsVideo): Deleted.
267         (WebKit::UserMediaPermissionRequestProxy::deviceUIDsAudio): Deleted.
268         * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
269         (WebKit::UserMediaPermissionRequestManager::startRequest):
270
271 2015-07-27  Carlos Garcia Campos  <cgarcia@igalia.com>
272
273         [GTK] Pass a GstInstallPluginsContext to gst_install_plugins_async
274         https://bugs.webkit.org/show_bug.cgi?id=147103
275
276         Reviewed by Philippe Normand.
277
278         This allows PackageKit to properly position the window and make it
279         transient to the web view window.
280
281         * UIProcess/API/gtk/PageClientImpl.cpp:
282         (WebKit::PageClientImpl::setCursor): Disambiguate Cursor now that
283         we include gtkx.h.
284         (WebKit::PageClientImpl::createGstInstallPluginsContext): Create a
285         new GstInstallPluginsContext and set the web view window XID when
286         running on X11.
287         * UIProcess/API/gtk/PageClientImpl.h:
288         * UIProcess/PageClient.h:
289         * UIProcess/efl/WebViewEfl.h:
290         * UIProcess/gstreamer/WebPageProxyGStreamer.cpp:
291         (WebKit::WebPageProxy::requestInstallMissingMediaPlugins): Use
292         PageClient::createGstInstallPluginsContext() to create a new
293         GstInstallPluginsContext and pass it to gst_install_plugins_async().
294
295 2015-07-26  Gwang Yoon Hwang  <yoon@igalia.com>
296
297         [ThreadedCompositor] Unreviewed build fix after r186059
298         https://bugs.webkit.org/show_bug.cgi?id=147315
299
300         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
301         (WebKit::ThreadedCompositor::glContext):
302         Explicitly cast u_int64 to GLNativeWindowType.
303         * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h:
304         (WebKit::ThreadedCoordinatedLayerTreeHost::create):
305         Update declaration to match with modified definition.
306
307
308 2015-07-26  Chris Dumez  <cdumez@apple.com>
309
310         [WK2][iOS] WebContent process main thread should have fixed priority
311         https://bugs.webkit.org/show_bug.cgi?id=147313
312         <rdar://problem/22003112>
313
314         Reviewed by Darin Adler.
315
316         WebContent process main thread should have fixed priority on iOS 9.
317         Priority decay regresses PLT and fixing the main thread's priority
318         gives up a ~3% progression on warm PLT (tested on iPhone 5s).
319
320         * WebProcess/cocoa/WebProcessCocoa.mm:
321         (WebKit::WebProcess::platformInitializeWebProcess):
322
323 2015-07-26  Dan Bernstein  <mitz@apple.com>
324
325         Suppressed an Xcode 7 warning about including a nib in an iOS build product.
326
327         * Configurations/BaseLegacyProcess.xcconfig: Exclude xib files on iOS.
328         * Configurations/BaseXPCService.xcconfig: Ditto.
329
330 2015-07-24  Ryosuke Niwa  <rniwa@webkit.org>
331
332         iOS 8 build fix attempt after r187215.
333
334         * UIProcess/API/Cocoa/WKWebView.mm:
335         (-[WKWebView _snapshotRect:intoImageOfWidth:completionHandler:]): Deleted.
336
337 2015-07-24  Yongjun Zhang  <yongjun_zhang@apple.com>
338
339         Don't create UIWebFormAccessory if we don't require accessory view.
340         https://bugs.webkit.org/show_bug.cgi?id=147283
341
342         Don't try to intialize _formAccessoryView if requiresAccessoryView returns false since we don't
343         need it yet.
344
345         Reviewed by Dan Bernstein.
346
347         * UIProcess/ios/WKContentViewInteraction.mm:
348         (-[WKContentView inputAccessoryView]):
349
350 2015-07-24  Anders Carlsson  <andersca@apple.com>
351
352         WKWebsiteDataStore remove methods don't properly delete cookies
353         https://bugs.webkit.org/show_bug.cgi?id=147282
354         rdar://problem/21948230
355
356         Reviewed by Sam Weinig.
357
358         * NetworkProcess/NetworkProcess.cpp:
359         (WebKit::NetworkProcess::deleteWebsiteDataForOrigins):
360         Call deleteCookiesForHostnames instead of iterating over each hostname.
361
362         * WebProcess/Cookies/WebCookieManager.cpp:
363         (WebKit::WebCookieManager::deleteCookiesForHostname):
364         Call deleteCookiesForHostnames.
365
366 2015-07-24  Anders Carlsson  <andersca@apple.com>
367
368         Networking process crash in NetworkConnectionToWebProcess::convertMainResourceLoadToDownload while attempting to download a blob
369         https://bugs.webkit.org/show_bug.cgi?id=147276
370         rdar://problem/21423353
371
372         Reviewed by Andreas Kling.
373
374         We currently don't support downloading blobs, so for now just bail if we encounter a null loader inside
375         convertMainResourceLoadToDownload (which happens when trying to download a blob URL).
376
377         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
378         (WebKit::NetworkConnectionToWebProcess::didCleanupResourceLoader):
379         Rewrite the assertion to be more clear - it's fine to do an extra hash lookup in debug builds.
380
381         (WebKit::NetworkConnectionToWebProcess::convertMainResourceLoadToDownload):
382         Bail if loader is null.
383
384 2015-07-24  Yusuke Suzuki  <utatane.tea@gmail.com>
385
386         Remove runtime flags for symbols
387         https://bugs.webkit.org/show_bug.cgi?id=147246
388
389         Reviewed by Alex Christensen.
390
391         * UIProcess/API/C/WKPreferencesRefPrivate.h:
392         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
393
394 2015-07-24  Yusuke Suzuki  <utatane.tea@gmail.com>
395
396         Object.getOwnPropertySymbols on large list takes very long
397         https://bugs.webkit.org/show_bug.cgi?id=146137
398
399         Reviewed by Mark Lam.
400
401         * WebProcess/Plugins/Netscape/NPJSObject.cpp:
402         (WebKit::NPJSObject::enumerate):
403
404 2015-07-24  Simon Fraser  <simon.fraser@apple.com>
405
406         Recode.net gets into a continual resize loop in split fullscreen
407         https://bugs.webkit.org/show_bug.cgi?id=147266
408         rdar://problem/21409047
409
410         Reviewed by Tim Horton.
411         
412         In split fullscreen, we use fixed layout and scale to shrink pages down to
413         fit a given width. This is re-evaluated every time the document width changes.
414         However some pages, like recode.net, end up continually resizing because
415         when laid out unconstrained they use a narrower width than when laid out with
416         a fixed layout size. In fixed layout, they actually use more width than the fixed
417         layout size.
418         
419         Detect and break this cycle by just not re-scaling when we've done one fixed layout,
420         and the document is now taking more width than the fixed layout width.
421
422         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
423         (WebKit::TiledCoreAnimationDrawingArea::scaleViewToFitDocumentIfNeeded):
424
425 2015-07-24  Carlos Garcia Campos  <cgarcia@igalia.com>
426
427         [GStreamer] Crashes during plugin installation
428         https://bugs.webkit.org/show_bug.cgi?id=144099
429
430         Reviewed by Philippe Normand.
431
432         Move the missing plugins installation to the UI process, ensuring
433         there's a single installer running and cancelling the request when
434         the page is closed or the media player is deleted.
435
436         * PlatformEfl.cmake: Add new files to compilation.
437         * PlatformGTK.cmake: Ditto.
438         * UIProcess/WebPageProxy.h:
439         * UIProcess/WebPageProxy.messages.in: Add
440         RequestInstallMissingMediaPlugins message.
441         * UIProcess/gstreamer/WebPageProxyGStreamer.cpp: Added.
442         (WebKit::WebPageProxy::requestInstallMissingMediaPlugins): Call
443         gst_install_plugins_async() and send
444         DidEndRequestInstallMissingMediaPlugins message back to the web
445         process when done.
446         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
447         (WebKit::WebChromeClient::requestInstallMissingMediaPlugins): Call
448         WebPage::requestInstallMissingMediaPlugins().
449         * WebProcess/WebCoreSupport/WebChromeClient.h:
450         * WebProcess/WebPage/WebPage.cpp:
451         (WebKit::WebPage::close): Invalidate the install missing plugins
452         request callback.
453         * WebProcess/WebPage/WebPage.h:
454         * WebProcess/WebPage/WebPage.messages.in: Add
455         DidEndRequestInstallMissingMediaPlugins message.
456         * WebProcess/WebPage/gstreamer/WebPageGStreamer.cpp: Added.
457         (WebKit::WebPage::requestInstallMissingMediaPlugins): Send
458         RequestInstallMissingMediaPlugins to the UI process or complete
459         the request early if there's already a request in progress.
460         (WebKit::WebPage::didEndRequestInstallMissingMediaPlugins):
461         Complete the request.
462
463 2015-07-24  Carlos Garcia Campos  <cgarcia@igalia.com>
464
465         Unreviewed. Fix the build with MEDIA_STREAM disabled after r187282.
466
467         RealtimeMediaSource is only defined when MEDIA_STREAM is enabled.
468
469         * UIProcess/UserMediaPermissionRequestProxy.cpp:
470         * UIProcess/UserMediaPermissionRequestProxy.h:
471
472 2015-07-24  Carlos Garcia Campos  <cgarcia@igalia.com>
473
474         REGRESSION(r187100): [GTK] ASSERTION FAILED: Attempt to access post layout data before receiving it when typing backspace
475         https://bugs.webkit.org/show_bug.cgi?id=147196
476
477         Reviewed by Žan Doberšek.
478
479         Do not try to use the PostLayoutData from EditorState when
480         isMissingPostLayoutData is true. That happens when there's a
481         layout pending, and EditorStateChanged is sent again after that
482         layout with the post layout data. So we can just return early and
483         wait until the second message.
484
485         * UIProcess/API/gtk/WebKitEditorState.cpp:
486         (webkitEditorStateChanged):
487         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
488         (webkitWebViewBaseUpdateTextInputState):
489
490 2015-07-23  Alex Christensen  <achristensen@webkit.org>
491
492         Fix 32-bit build after r187272.
493
494         * UIProcess/mac/PageClientImpl.mm:
495         (WebKit::PageClientImpl::mediaDocumentNaturalSizeChanged):
496         Added some WK_API_ENABLED.
497
498 2015-07-23  Dan Bernstein  <mitz@apple.com>
499
500         <rdar://problem/21929532> REGRESSION (r184026): Safari AutoFill with Contact info for phone number is broken
501         https://bugs.webkit.org/show_bug.cgi?id=147249
502
503         Reviewed by Sam Weinig.
504
505         * Shared/API/Cocoa/WKRemoteObjectCoder.mm:
506         (encodeObject): Use encodeString only for strings that encode as NSString or
507         NSMutableString. It can’t encode arbitrary NSString subclasses.
508         (decodeObject): Use decodeString for NSMutableString as well.
509
510 2015-07-23  Zalan Bujtas  <zalan@apple.com>
511
512         [iOS] REGRESSION (187131): Loading CuteOverload zooms in to the top left corner.
513         https://bugs.webkit.org/show_bug.cgi?id=147251
514         rdar://problem/21953359
515
516         Calling zoomToRect() should result in essentially the same zoom scale as if we
517         called setZoomScale with the new page scale factor.
518  
519         Reviewed by Benjamin Poulain.
520
521         * UIProcess/API/Cocoa/WKWebView.mm:
522         (-[WKWebView _didCommitLayerTree:]):
523
524 2015-07-23  Matthew Daiter  <mdaiter@apple.com>
525
526         Linking WebKit2 to be able to grab media sources from a UID
527         https://bugs.webkit.org/show_bug.cgi?id=147202
528         <rdar://problem/21947608>
529
530         Reviewed by Brent Fulgham.
531
532         * UIProcess/UserMediaPermissionRequestProxy.cpp:
533         (WebKit::UserMediaPermissionRequestProxy::getDeviceNameForUID):
534         * UIProcess/UserMediaPermissionRequestProxy.h:
535
536 2015-07-23  Alex Christensen  <achristensen@webkit.org>
537
538         Remove compile and runtime flags for promises.
539         https://bugs.webkit.org/show_bug.cgi?id=147244
540
541         Reviewed by Yusuke Suzuki.
542
543         * Configurations/FeatureDefines.xcconfig:
544         * UIProcess/API/C/WKPreferencesRefPrivate.h:
545         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
546
547 2015-07-21  Jer Noble  <jer.noble@apple.com>
548
549         Notify the UI delegate when a MediaDocument's natural size changes
550         https://bugs.webkit.org/show_bug.cgi?id=147182
551
552         Reviewed by Simon Fraser.
553
554         Pipe notifications of media document natural size changes up from the chrome client, through
555         to the UIProcess,  through the page client, through the WKWebView, to the UIDelegate.
556
557         * UIProcess/API/APIUIClient.h:
558         (API::UIClient::mediaDocumentNaturalSizeChanged):
559         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
560         * UIProcess/API/Cocoa/WKWebView.mm:
561         (-[WKWebView _mediaDocumentNaturalSizeChanged:]):
562         * UIProcess/API/Cocoa/WKWebViewInternal.h:
563         * UIProcess/Cocoa/UIDelegate.h:
564         * UIProcess/Cocoa/UIDelegate.mm:
565         (WebKit::UIDelegate::setDelegate):
566         (WebKit::UIDelegate::UIClient::mediaDocumentNaturalSizeChanged):
567         * UIProcess/PageClient.h:
568         * UIProcess/WebPageProxy.cpp:
569         (WebKit::WebPageProxy::mediaDocumentNaturalSizeChanged):
570         * UIProcess/WebPageProxy.h:
571         * UIProcess/WebPageProxy.messages.in:
572         * UIProcess/ios/PageClientImplIOS.h:
573         * UIProcess/ios/PageClientImplIOS.mm:
574         (WebKit::PageClientImpl::mediaDocumentNaturalSizeChanged):
575         * UIProcess/mac/PageClientImpl.h:
576         * UIProcess/mac/PageClientImpl.mm:
577         (WebKit::PageClientImpl::mediaDocumentNaturalSizeChanged):
578         * WebProcess/WebCoreSupport/WebChromeClient.h:
579         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
580         (WebKit::WebChromeClient::mediaDocumentNaturalSizeChanged):
581         * WebProcess/WebPage/WebPage.cpp:
582         (WebKit::WebPage::mediaDocumentNaturalSizeChanged):
583         * WebProcess/WebPage/WebPage.h:
584         * UIProcess/API/gtk/PageClientImpl.h: Add default, empty implementation of new pure-virtual method.
585         * UIProcess/efl/WebViewEfl.h: Ditto.
586
587 2015-07-23  Enrica Casucci  <enrica@apple.com>
588
589         Removing one incorrect annotation from the previous change.
590
591         Unreviewed.
592
593         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
594
595 2015-07-23  Enrica Casucci  <enrica@apple.com>
596
597         [iOS] Add another preview delegate for didDismissPreview.
598         https://bugs.webkit.org/show_bug.cgi?id=147241
599         rdar://problem/21664211
600
601         Reviewed by Tim Horton and Yongjun Zhang.
602
603         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
604         * UIProcess/ios/WKContentViewInteraction.mm:
605         (-[WKContentView _previewItemController:didDismissPreview:committing:]):
606
607 2015-07-23  Dan Bernstein  <mitz@apple.com>
608
609         <rdar://problem/21910578> Second pass at [iOS] Keyboard shortcuts that take focus away from the web view end up typing a letter into the newly focused field
610         https://bugs.webkit.org/show_bug.cgi?id=146732
611
612         Reviewed by Darin Adler.
613
614         * UIProcess/ios/WKContentViewInteraction.mm:
615         (-[WKContentView _interpretKeyEvent:isCharEvent:]): Rather than checking if the view is
616         first responder, which it might still be when the Web Content processes invokes this
617         callback, check if we are in editable content before forwarding the event to the keyboard.
618
619 2015-07-23  Jer Noble  <jer.noble@apple.com>
620
621         Unreviewed build fix after r187251; rename flag -> allows.
622
623         * UIProcess/WebPageProxy.cpp:
624         (WebKit::WebPageProxy::setAllowsMediaDocumentInlinePlayback):
625
626 2015-07-23  Alex Christensen  <achristensen@webkit.org>
627
628         [iOS] Unreviewed build fix after r187251.
629
630         * UIProcess/WebPageProxy.cpp:
631         (WebKit::WebPageProxy::setAllowsMediaDocumentInlinePlayback):
632         Use the correct name for the boolean to pass along to SetAllowsMediaDocumentInlinePlayback.
633
634 2015-07-23  Enrica Casucci  <enrica@apple.com>
635
636         One more iOS build fix.
637
638         Unreviewed.
639
640         * Platform/spi/ios/UIKitSPI.h:
641         * UIProcess/ios/WKContentViewInteraction.h:
642
643 2015-07-23  Matthew Daiter  <mdaiter@apple.com>
644
645         Bridged passing lists of devices between the UIProcess and the WebProcess
646         https://bugs.webkit.org/show_bug.cgi?id=147056
647         <rdar://problem/21883094>
648
649         Reviewed by Brent Fulgham.
650
651         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp: Modified file
652         to reflect changes made to the header in the .messages.in file
653         (WebKit::UserMediaPermissionRequestManagerProxy::createRequest): Ditto
654         (WebKit::UserMediaPermissionRequestManagerProxy::didReceiveUserMediaPermissionDecision):
655         * UIProcess/UserMediaPermissionRequestManagerProxy.h: Ditto
656         * UIProcess/UserMediaPermissionRequestProxy.cpp: Ditto
657         (WebKit::UserMediaPermissionRequestProxy::UserMediaPermissionRequestProxy):
658         * UIProcess/UserMediaPermissionRequestProxy.h:
659         (WebKit::UserMediaPermissionRequestProxy::create):
660         (WebKit::UserMediaPermissionRequestProxy::deviceUIDsVideo):
661         (WebKit::UserMediaPermissionRequestProxy::deviceUIDsAudio):
662         * UIProcess/WebPageProxy.cpp:
663         (WebKit::WebPageProxy::requestUserMediaPermissionForFrame):
664         * UIProcess/WebPageProxy.h:
665         * UIProcess/WebPageProxy.messages.in: Changed heading
666         * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
667         (WebKit::UserMediaPermissionRequestManager::startRequest):
668         (WebKit::UserMediaPermissionRequestManager::didReceiveUserMediaPermissionDecision):
669         * WebProcess/MediaStream/UserMediaPermissionRequestManager.h:
670         * WebProcess/WebPage/WebPage.cpp:
671         (WebKit::WebPage::didReceiveUserMediaPermissionDecision):
672         * WebProcess/WebPage/WebPage.h:
673         * WebProcess/WebPage/WebPage.messages.in: Changed heading
674
675 2015-07-23  Yongjun Zhang  <yongjun_zhang@apple.com>
676
677         Adopt the new _previewItemControllerDidCancelPreview delegate method.
678         https://bugs.webkit.org/show_bug.cgi?id=147238
679
680         Don't allow hightlight long press to trigger tap if the link preview is cancelled because
681         the link is not preview-able.
682
683         Reviewed by Beth Dakin.
684
685         * UIProcess/ios/WKContentViewInteraction.mm:
686         (-[WKContentView _previewItemControllerDidCancelPreview:]): 
687
688 2015-07-23  Enrica Casucci  <enrica@apple.com>
689
690         iOS build fix after http://trac.webkit.org/changeset/187238.
691
692         Unreviewed.
693
694         * Platform/spi/ios/UIKitSPI.h:
695
696 2015-07-23  Jer Noble  <jer.noble@apple.com>
697
698         [WK2] Add a WKWebView property for whether the view is displaying a media document
699         https://bugs.webkit.org/show_bug.cgi?id=147233
700
701         Reviewed by Beth Dakin.
702
703         Add a _isDisplayingStandaloneMediaDocument property, which queries the frame for whether
704         the current MIME type is one which our media engines support.
705
706         * UIProcess/API/Cocoa/WKWebView.mm:
707         (-[WKWebView _isDisplayingStandaloneMediaDocument]):
708         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
709         * UIProcess/WebFrameProxy.cpp:
710         (WebKit::WebFrameProxy::isDisplayingStandaloneMediaDocument):
711         * UIProcess/WebFrameProxy.h:
712
713 2015-07-21  Jer Noble  <jer.noble@apple.com>
714
715         [iOS] Add an explicit API to allow media documents to (temporarily) play inline
716         https://bugs.webkit.org/show_bug.cgi?id=147181
717
718         Reviewed by Beth Dakin.
719
720         Add a WKWebView(Private) API which allows MediaDocuments loaded by the view to play their contents inline, regardless
721         of whether inline playback is restricted on the current device.
722
723         * UIProcess/API/Cocoa/WKWebView.mm:
724         (-[WKWebView _setRequiresUserActionForMediaPlayback:]): Added. Pass through to WebPageProxy.
725         (-[WKWebView _allowsMediaDocumentInlinePlayback]): Ditto.
726         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
727         * UIProcess/WebPageProxy.cpp:
728         (WebKit::WebPageProxy::allowsMediaDocumentInlinePlayback): Simple getter.
729         (WebKit::WebPageProxy::setAllowsMediaDocumentInlinePlayback): Set, and conditionally pass the new value to WebPage.
730         * UIProcess/WebPageProxy.h:
731         * WebProcess/WebPage/WebPage.cpp:
732         (WebKit::WebPage::setAllowsMediaDocumentInlinePlayback): Set, and conditionally notify WebCore page of the change.
733         * WebProcess/WebPage/WebPage.h:
734         (WebKit::WebPage::allowsMediaDocumentInlinePlayback): Simple getter.
735         * WebProcess/WebPage/WebPage.messages.in: Add new messages.
736
737 2015-07-23  Beth Dakin  <bdakin@apple.com>
738
739         Should not allow previews of 1x1 images
740         https://bugs.webkit.org/show_bug.cgi?id=147237
741         -and corresponding-
742         rdar://problem/21968460
743
744         Reviewed by Tim Horton.
745
746         1x1 images are used on some sites to cover actual images, which leads to a 
747         misleading preview experience. There is not any reason why you would really 
748         want to preview an image this small nor any reason to believe that the 
749         preview would result in anything useful.
750         * WebProcess/WebPage/ios/WebPageIOS.mm:
751         (WebKit::WebPage::getPositionInformation):
752
753 2015-07-23  Brady Eidson  <beidson@apple.com>
754
755         Crash in WebPlatformStrategies::createPingHandle - Deref a null NetworkingContext.
756         <rdar://problem/21949735> and https://bugs.webkit.org/show_bug.cgi?id=147227
757
758         Reviewed by Alexey Proskuryakov.
759
760         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
761         (WebKit::WebPlatformStrategies::createPingHandle): Skip it if there's a null NetworkingContext.
762
763 2015-07-23  Tim Horton  <timothy_horton@apple.com>
764
765         Remove some files that should have been removed with WebKit2 Windows
766         https://bugs.webkit.org/show_bug.cgi?id=147223
767
768         Reviewed by Csaba Osztrogonác.
769
770         * Shared/API/c/cf/WKURLRequestCF.cpp: Removed.
771         * Shared/API/c/cf/WKURLRequestCF.h: Removed.
772         * Shared/API/c/cf/WKURLResponseCF.cpp: Removed.
773         * Shared/API/c/cf/WKURLResponseCF.h: Removed.
774
775 2015-07-23  Timothy Horton  <timothy_horton@apple.com>
776
777         Fix the build
778
779         * Platform/spi/ios/UIKitSPI.h:
780
781 2015-07-23  Tim Horton  <timothy_horton@apple.com>
782
783         Remove files that were meant to be removed in r173929
784
785         * WebProcess/WebPage/mac/WebInspectorMac.mm: Removed.
786
787 2015-07-23  Tim Horton  <timothy_horton@apple.com>
788
789         Remove files that were meant to be removed in r168213
790
791         * UIProcess/API/Cocoa/WKErrorRecoveryAttempting.h: Removed.
792
793 2015-07-23  Tim Horton  <timothy_horton@apple.com>
794
795         Remove files that were meant to be removed in r168229
796
797         * UIProcess/API/Cocoa/WKSession.h: Removed.
798         * UIProcess/API/Cocoa/WKSession.mm: Removed.
799         * UIProcess/API/Cocoa/WKSessionInternal.h: Removed.
800
801 2015-07-23  Tim Horton  <timothy_horton@apple.com>
802
803         Remove files that were meant to be removed in r165014
804
805         * WebProcess/WebPage/mac/WKAccessibilityWebPageObject.h: Removed.
806         * WebProcess/WebPage/mac/WKAccessibilityWebPageObject.mm: Removed.
807
808 2015-07-23  Carlos Garcia Campos  <cgarcia@igalia.com>
809
810         [GTK] Add API to allow executing editing commands that require an argument
811         https://bugs.webkit.org/show_bug.cgi?id=146781
812
813         Reviewed by Gustavo Noronha Silva.
814
815         Commands like InsertImage or CreateLink receive an argument, but
816         we only have webkit_web_view_execute_editing_command() that
817         doesn't receive any argument. This patch adds
818         webkit_web_view_execute_editing_command_with_argument() for those
819         commands. It also adds WEBKIT_EDITING_COMMAND_INSERT_IMAGE and
820         WEBKIT_EDITING_COMMAND_CREATE_LINK to the predefined editing commands.
821
822         * UIProcess/API/gtk/WebKitEditingCommands.h: Add
823         WEBKIT_EDITING_COMMAND_INSERT_IMAGE and WEBKIT_EDITING_COMMAND_CREATE_LINK.
824         * UIProcess/API/gtk/WebKitWebView.cpp:
825         (webkit_web_view_execute_editing_command_with_argument):
826         * UIProcess/API/gtk/WebKitWebView.h:
827         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt: Add new symbols.
828         * UIProcess/WebPageProxy.cpp:
829         (WebKit::WebPageProxy::executeEditCommand): Pass also the argument
830         to the message.
831         * UIProcess/WebPageProxy.h:
832         * WebProcess/WebPage/WebPage.cpp:
833         (WebKit::WebPage::executeEditCommand): Add the argument parameter
834         to the message handler.
835         * WebProcess/WebPage/WebPage.h:
836         * WebProcess/WebPage/WebPage.messages.in: Add argument parameter
837         to ExecuteEditCommand message.
838
839 2015-07-22  Sukolsak Sakshuwong  <sukolsak@gmail.com>
840
841         Add ENABLE_WEBASSEMBLY feature flag for WebAssembly
842         https://bugs.webkit.org/show_bug.cgi?id=147212
843
844         Reviewed by Filip Pizlo.
845
846         * Configurations/FeatureDefines.xcconfig:
847
848 2015-07-22  James Savage  <james.savage@apple.com>
849
850         Use updated CoreAnimation snapshot SPI.
851         https://bugs.webkit.org/show_bug.cgi?id=147197
852         <rdar://problem/21032083>
853
854         Reviewed by Tim Horton.
855         Patch by James Savage.
856
857         * Platform/spi/ios/UIKitSPI.h:
858         * UIProcess/API/Cocoa/WKWebView.mm:
859         (-[WKWebView _snapshotRect:intoImageOfWidth:completionHandler:]):
860
861 2015-07-22  Timothy Horton  <timothy_horton@apple.com>
862
863         Fix the build
864
865         * UIProcess/ios/WKContentViewInteraction.mm:
866         (-[WKContentView setupInteraction]):
867         (-[WKContentView cleanupInteraction]):
868
869 2015-07-22  Commit Queue  <commit-queue@webkit.org>
870
871         Unreviewed, rolling out r187196.
872         https://bugs.webkit.org/show_bug.cgi?id=147213
873
874         broke all the iOS builds (Requested by thorton on #webkit).
875
876         Reverted changeset:
877
878         "Use updated CoreAnimation snapshot SPI."
879         https://bugs.webkit.org/show_bug.cgi?id=147197
880         http://trac.webkit.org/changeset/187196
881
882 2015-07-22  Tim Horton  <timothy_horton@apple.com>
883
884         Fix the build
885
886         * UIProcess/ios/WKContentViewInteraction.h:
887
888 2015-07-22  Tim Horton  <timothy_horton@apple.com>
889
890         [iOS] Adjust the preview architecture
891         https://bugs.webkit.org/show_bug.cgi?id=147203
892         <rdar://problem/21945775>
893
894         Reviewed by Simon Fraser.
895
896         * UIProcess/ios/WKContentViewInteraction.mm:
897         (-[WKContentView _dataForPreviewItemController:atPosition:type:]):
898         Link previews should win over image previews if both are possible.
899
900 2015-07-22  James Savage  <james.savage@apple.com>
901
902         Use updated CoreAnimation snapshot SPI.
903         https://bugs.webkit.org/show_bug.cgi?id=147197
904
905         Reviewed by Tim Horton.
906
907         * Platform/spi/ios/UIKitSPI.h:
908         * UIProcess/API/Cocoa/WKWebView.mm:
909         (-[WKWebView _snapshotRect:intoImageOfWidth:completionHandler:]):
910
911 2015-07-22  Tim Horton  <timothy_horton@apple.com>
912
913         [iOS] Adjust the preview architecture
914         https://bugs.webkit.org/show_bug.cgi?id=147203
915         <rdar://problem/21945775>
916
917         Reviewed by Beth Dakin.
918
919         * Platform/spi/ios/UIKitSPI.h:
920         * UIProcess/API/Cocoa/WKWebView.mm:
921         (-[WKWebView _setAllowsLinkPreview:]): Deleted.
922         * UIProcess/ios/WKContentView.mm:
923         (-[WKContentView willMoveToWindow:]): Deleted.
924         * UIProcess/ios/WKContentViewInteraction.h:
925         * UIProcess/ios/WKContentViewInteraction.mm:
926         (-[WKContentView setupInteraction]):
927         (-[WKContentView cleanupInteraction]):
928         (-[WKContentView _registerPreview]):
929         (-[WKContentView _unregisterPreview]):
930         (-[WKContentView _interactionShouldBeginFromPreviewItemController:forPosition:]):
931         (-[WKContentView _dataForPreviewItemController:atPosition:type:]):
932         (-[WKContentView _presentationRectForPreviewItemController:]):
933         (-[WKContentView _presentedViewControllerForPreviewItemController:]):
934         (-[WKContentView _previewItemController:commitPreview:]):
935         (-[WKContentView _previewItemController:willPresentPreview:forPosition:inSourceView:]):
936         (-[WKContentView _previewItemController:didDismissPreview:committing:]):
937         (-[WKContentView _presentationSnapshotForPreviewItemController:]):
938         (-[WKContentView _presentationRectsForPreviewItemController:]):
939         (-[WKContentView gestureRecognizerShouldBegin:]): Deleted.
940         (-[WKContentView _registerPreviewInWindow:]): Deleted.
941         (-[WKContentView _unregisterPreviewInWindow:]): Deleted.
942         (-[WKContentView previewViewControllerForPosition:inSourceView:]): Deleted.
943         (-[WKContentView commitPreviewViewController:]): Deleted.
944         (-[WKContentView willPresentPreviewViewController:forPosition:inSourceView:]): Deleted.
945         (-[WKContentView didDismissPreviewViewController:committing:]): Deleted.
946         Register and unregister in setup/cleanupInteraction instead of when moving between windows.
947         Implement 'shouldBegin' instead of interacting directly with the recognizer.
948         Make use of system enums instead of our own.
949         Let UIPreviewItemController handle shrink-wrapping and the indicator view.
950
951 2015-07-22  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
952
953         [EFL] Support indexeddb for WK2
954         https://bugs.webkit.org/show_bug.cgi?id=145867
955
956         Reviewed by Csaba Osztrogonác.
957
958         Add stub implementation for indexeddb. Move KeyedDecoder and KeyedEncoder from gtk to glib
959         in order to share it between GTK and EFL ports.
960
961         * DatabaseProcess/EntryPoint/unix/DatabaseProcessMain.cpp:
962         * DatabaseProcess/efl/DatabaseProcessMainEfl.cpp: Copied from Source/WebKit2/DatabaseProcess/EntryPoint/unix/DatabaseProcessMain.cpp.
963         (WebKit::DatabaseProcessMainUnix):
964         * PlatformEfl.cmake:
965         * PlatformGTK.cmake:
966         * Shared/glib/KeyedDecoder.cpp: Renamed from Source/WebKit2/Shared/gtk/KeyedDecoder.cpp.
967         (WebKit::KeyedDecoder::KeyedDecoder):
968         (WebKit::KeyedDecoder::~KeyedDecoder):
969         (WebKit::KeyedDecoder::dictionaryFromGVariant):
970         (WebKit::KeyedDecoder::decodeBytes):
971         (WebKit::KeyedDecoder::decodeSimpleValue):
972         (WebKit::KeyedDecoder::decodeBool):
973         (WebKit::KeyedDecoder::decodeUInt32):
974         (WebKit::KeyedDecoder::decodeInt32):
975         (WebKit::KeyedDecoder::decodeInt64):
976         (WebKit::KeyedDecoder::decodeFloat):
977         (WebKit::KeyedDecoder::decodeDouble):
978         (WebKit::KeyedDecoder::decodeString):
979         (WebKit::KeyedDecoder::beginObject):
980         (WebKit::KeyedDecoder::endObject):
981         (WebKit::KeyedDecoder::beginArray):
982         (WebKit::KeyedDecoder::beginArrayElement):
983         (WebKit::KeyedDecoder::endArrayElement):
984         (WebKit::KeyedDecoder::endArray):
985         * Shared/glib/KeyedDecoder.h: Renamed from Source/WebKit2/Shared/gtk/KeyedDecoder.h.
986         * Shared/glib/KeyedEncoder.cpp: Renamed from Source/WebKit2/Shared/gtk/KeyedEncoder.cpp.
987         (WebKit::KeyedEncoder::KeyedEncoder):
988         (WebKit::KeyedEncoder::~KeyedEncoder):
989         (WebKit::KeyedEncoder::encodeBytes):
990         (WebKit::KeyedEncoder::encodeBool):
991         (WebKit::KeyedEncoder::encodeUInt32):
992         (WebKit::KeyedEncoder::encodeInt32):
993         (WebKit::KeyedEncoder::encodeInt64):
994         (WebKit::KeyedEncoder::encodeFloat):
995         (WebKit::KeyedEncoder::encodeDouble):
996         (WebKit::KeyedEncoder::encodeString):
997         (WebKit::KeyedEncoder::beginObject):
998         (WebKit::KeyedEncoder::endObject):
999         (WebKit::KeyedEncoder::beginArray):
1000         (WebKit::KeyedEncoder::beginArrayElement):
1001         (WebKit::KeyedEncoder::endArrayElement):
1002         (WebKit::KeyedEncoder::endArray):
1003         (WebKit::KeyedEncoder::finishEncoding):
1004         * Shared/glib/KeyedEncoder.h: Renamed from Source/WebKit2/Shared/gtk/KeyedEncoder.h.
1005         * UIProcess/Databases/efl/DatabaseProcessProxyEfl.cpp: Copied from Source/WebKit2/DatabaseProcess/EntryPoint/unix/DatabaseProcessMain.cpp.
1006         (WebKit::DatabaseProcessProxy::platformGetLaunchOptions):
1007
1008 2015-07-22  Michael Catanzaro  <mcatanzaro@igalia.com>
1009
1010         [Seccomp] Canonicalize filesystem path when whitelisting it
1011         https://bugs.webkit.org/show_bug.cgi?id=142986
1012
1013         Reviewed by Žan Doberšek.
1014
1015         * Shared/linux/SeccompFilters/SyscallPolicy.cpp:
1016         (WebKit::canonicalizeFileName):
1017         (WebKit::SyscallPolicy::addFilePermission):
1018         (WebKit::SyscallPolicy::addDirectoryPermission):
1019
1020 2015-07-21  Simon Fraser  <simon.fraser@apple.com>
1021
1022         Add logging for TiledCoreAnimationDrawingArea resizing
1023         https://bugs.webkit.org/show_bug.cgi?id=147180
1024
1025         Reviewed by Tim Horton.
1026
1027         Add a "Resize" log channel for WebKit2, and use it to log data in scaleViewToFitDocumentIfNeeded().
1028
1029         * Platform/Logging.h:
1030         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
1031         (WebKit::TiledCoreAnimationDrawingArea::scaleViewToFitDocumentIfNeeded):
1032
1033 2015-07-22  Sam Weinig  <sam@webkit.org>
1034
1035         Encode/Decode underlying errors when serializing NSErrors
1036         <rdar://problem/21818117>
1037         https://bugs.webkit.org/show_bug.cgi?id=147199
1038
1039         Reviewed by Anders Carlsson.
1040
1041         * Shared/mac/WebCoreArgumentCodersMac.mm:
1042         (IPC::ArgumentCoder<CertificateInfo>::decode):
1043         (IPC::encodeNSError):
1044         (IPC::ArgumentCoder<ResourceError>::encodePlatformData):
1045         (IPC::decodeNSError):
1046         (IPC::ArgumentCoder<ResourceError>::decodePlatformData):
1047         Break out encoding/decoding of the NSErrors into a helpers so they can be called
1048         for the underlying error.
1049
1050 2015-07-22  Beth Dakin  <bdakin@apple.com>
1051
1052         Animated images should animate in previews
1053         https://bugs.webkit.org/show_bug.cgi?id=147173
1054         -and corresponding-
1055         rdar://problem/21637698
1056
1057         Reviewed by Dan Bernstein.
1058
1059         InteractionInformationAtPosition needs to know if it’s an animated image.
1060         * Shared/InteractionInformationAtPosition.cpp:
1061         (WebKit::InteractionInformationAtPosition::encode):
1062         (WebKit::InteractionInformationAtPosition::decode):
1063         * Shared/InteractionInformationAtPosition.h:
1064
1065         New delegate method to create a link preview view controller for animated 
1066         images.
1067         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
1068
1069         Treat animated images more like link previews.
1070         * UIProcess/ios/WKContentViewInteraction.mm:
1071         (-[WKContentView previewViewControllerForPosition:inSourceView:]):
1072
1073         Set info.isAnimatedImage
1074         * WebProcess/WebPage/ios/WebPageIOS.mm:
1075         (WebKit::WebPage::getPositionInformation):
1076
1077 2015-07-22  Michael Catanzaro  <mcatanzaro@igalia.com>
1078
1079         [Seccomp Filters] Add helpers to get XDG base directory locations
1080         https://bugs.webkit.org/show_bug.cgi?id=142982
1081
1082         Reviewed by Zan Dobersek.
1083
1084         * PlatformEfl.cmake:
1085         * PlatformGTK.cmake:
1086         * Shared/linux/SeccompFilters/XDGBaseDirectory.h: Added.
1087         * Shared/linux/SeccompFilters/XDGBaseDirectoryGLib.cpp: Added.
1088         (WebKit::userHomeDirectory):
1089         (WebKit::userCacheDirectory):
1090         (WebKit::userConfigDirectory):
1091         (WebKit::userDataDirectory):
1092         (WebKit::userRuntimeDirectory):
1093
1094 2015-07-22  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
1095
1096         [EFL][WK2] EWK2ContextTestMultipleProcesses.ewk_context_network_process_model fails to pass
1097         https://bugs.webkit.org/show_bug.cgi?id=142967
1098
1099         Reviewed by Csaba Osztrogonác.
1100
1101         Though processIdentifier() can return 0 when a page is not closed, ewk_context_network_process_model has
1102         not been considered process id can be 0. This patch adds a protection logic which doesn't test when process
1103         id is 0 at the moment.
1104
1105         * UIProcess/API/efl/tests/test_ewk2_context.cpp:
1106         (TEST_F):
1107
1108 2015-07-22  Carlos Garcia Campos  <cgarcia@igalia.com>
1109
1110         Unreviewed. Fix some warnings when generating GTK+ HTML API docs.
1111
1112         * UIProcess/API/gtk/docs/webkit2gtk-docs.sgml: Add
1113         WebKitWebsiteDataManager and WebKitWebEditor.
1114
1115 2015-07-21  Carlos Garcia Campos  <cgarcia@igalia.com>
1116
1117         Unreviewed. Update OptionsGTK.cmake and NEWS for 2.9.4 release.
1118
1119         * gtk/NEWS: Add release notes for 2.9.4.
1120
1121 2015-07-21  Joseph Pecoraro  <pecoraro@apple.com>
1122
1123         Web Inspector: [Mac] "Open Image In New Window" context menu item does nothing on an image
1124         https://bugs.webkit.org/show_bug.cgi?id=147175
1125
1126         Reviewed by Timothy Hatcher.
1127
1128         * UIProcess/mac/WebInspectorProxyMac.mm:
1129         (WebKit::getContextMenuFromProposedMenu):
1130         (WebKit::WebInspectorProxy::platformCreateInspectorPage):
1131         Remove default context menus that won't work in the inspector page.
1132
1133 2015-07-21  Benjamin Poulain  <benjamin@webkit.org>
1134
1135         [Content Extensions] Use a jump table when consecutive transitions have different targets
1136         https://bugs.webkit.org/show_bug.cgi?id=147099
1137
1138         Reviewed by Alex Christensen.
1139
1140         * UIProcess/API/APIUserContentExtensionStore.h:
1141
1142 2015-07-21  Daniel Bates  <dabates@apple.com>
1143
1144         Fix the build following <https://trac.webkit.org/changeset/187129>
1145         (https://bugs.webkit.org/show_bug.cgi?id=147112)
1146
1147         * UIProcess/WebProcessProxy.cpp:
1148         (WebKit::WebProcessProxy::reinstateNetworkProcessAssertionState): Guard implementation with PLATFORM(IOS)
1149         since this logic is specific to the iOS port.
1150
1151 2015-07-21  Simon Fraser  <simon.fraser@apple.com>
1152
1153         Rename the 'View' log channel to 'Printing'
1154         https://bugs.webkit.org/show_bug.cgi?id=147172
1155
1156         Reviewed by Zalan Bujtas.
1157
1158         "View" was a terrible name for a log channel that was all about printing.
1159         Sort the log channels.
1160
1161         * Platform/Logging.h:
1162         * UIProcess/API/mac/WKView.mm:
1163         (-[WKView drawRect:]):
1164         (-[WKView printOperationWithPrintInfo:forFrame:]):
1165         * UIProcess/mac/WKPrintingView.mm:
1166         (-[WKPrintingView _preparePDFDataForPrintingOnSecondaryThread]):
1167         (pageDidComputePageRects):
1168         (-[WKPrintingView knowsPageRange:]):
1169         (-[WKPrintingView drawRect:]):
1170         (-[WKPrintingView rectForPage:]):
1171         (-[WKPrintingView beginDocument]):
1172         (-[WKPrintingView endDocument]):
1173
1174 2015-07-21  Zalan Bujtas  <zalan@apple.com>
1175
1176         [iOS] Menu drop down such as on nike.com does not stay
1177         https://bugs.webkit.org/show_bug.cgi?id=147047
1178         rdar://problem/21046961
1179
1180         Reviewed by Benjamin Poulain.
1181
1182         This is a workaround for unintended scrolling while scaling.
1183         (Based on Benjamin Poulain's WIP patch for webkit.org/b/136904)
1184
1185         In certain cases when scaling would result in moving the scrollview (which would trigger
1186         a scroll event on WebCore side), zoomRect is called instead of setZoomScale to ensure
1187         that the scroll position stays intact.
1188
1189         * UIProcess/API/Cocoa/WKWebView.mm:
1190         (-[WKWebView _didCommitLayerTree:]):
1191
1192 2015-07-21  Daniel Bates  <dabates@apple.com>
1193
1194         WTFCrash() in WebKit::WebProcess::networkConnection()
1195         https://bugs.webkit.org/show_bug.cgi?id=147112
1196         <rdar://problem/18477459>
1197
1198         Reviewed by Gavin Barraclough.
1199
1200         Fixes an issue where a newly launched network process may be jetsam'd because it has not
1201         taken a process assertion between the time it was launched and the time when a web process
1202         makes use of it.
1203
1204         Initially a network process does not have a process assertion. A process assertion is taken
1205         (if one has not been taken) for the network process when a process assertion is taken for at
1206         least one web process. When the network process crashes a WebProcess may ultimately launch a
1207         new network process in WebProcess::networkConnection(). The new network process may be jetsam'd
1208         immediately when the system is under some measure pressure because it has a low jetsam priority,
1209         0 (since it does not have a process assertion and higher priority implies that a process is less
1210         likely to be jetsam'd). And the logic in WebProcess::networkConnection() explicitly calls
1211         CRASH() if the newly launched network process crashes immediately. Towards preventing the newly
1212         launched network process from being jetsam'd we should obtain a process assertion for it.
1213
1214         * UIProcess/WebProcessPool.cpp:
1215         (WebKit::WebProcessPool::WebProcessPool): Initialize m_didNetworkProcessCrash to false.
1216         (WebKit::WebProcessPool::ensureNetworkProcess): If the network process crashed (m_didNetworkProcessCrash == true)
1217         then tell each process in the pool to reinstate their network activity token for the new network process.
1218         (WebKit::WebProcessPool::networkProcessCrashed): Set m_didNetworkProcessCrash to true when the
1219         network process crashed.
1220         * UIProcess/WebProcessPool.h:
1221         * UIProcess/WebProcessProxy.cpp:
1222         (WebKit::WebProcessProxy::reinstateNetworkProcessAssertionState): Added.
1223         (WebKit::WebProcessProxy::didSetAssertionState): Add assert to ensure we never have both
1224         a background- and foreground- activity token for the network process.
1225         * UIProcess/WebProcessProxy.h:
1226
1227 2015-07-21  Daniel Bates  <dabates@apple.com>
1228
1229         ASSERT(m_suspendMessageCount >= 0) fails in ProcessThrottler::didCancelProcessSuspension()
1230         when WebContent process crashes; Network process may never voluntarily suspend
1231         https://bugs.webkit.org/show_bug.cgi?id=147122
1232         <rdar://problem/21906759>
1233
1234         Reviewed by Chris Dumez.
1235
1236         Fixes an issue where the network process may never voluntarily release its process assertion.
1237
1238         Currently the network process always sends both a ProcessReadyToSuspend and CancelPrepareToSuspend
1239         message in response to receiving a PrepareToSuspend message and CancelPrepareToSuspend message,
1240         respectively. The process throttler expects to receive either a ProcessReadyToSuspend message
1241         or a CancelPrepareToSuspend message (and not both) in response to sending the message sequence
1242         PrepareToSuspend, CancelPrepareToSuspend. When a process throttler receives both messages in
1243         response to this sequence then its internal message count becomes imbalanced and it will
1244         never release the process assertion it manages. One user interaction that can cause such an
1245         imbalance, in the process throttler held by NetworkProcessProxy, is switching tabs.
1246
1247         * NetworkProcess/NetworkProcess.cpp:
1248         (WebKit::NetworkProcess::cancelPrepareToSuspend): Do not send message NetworkProcessProxy::DidCancelProcessSuspension. 
1249         * UIProcess/Network/NetworkProcessProxy.cpp:
1250         (WebKit::NetworkProcessProxy::didCancelProcessSuspension): Deleted.
1251         * UIProcess/Network/NetworkProcessProxy.h:
1252         * UIProcess/Network/NetworkProcessProxy.messages.in: Remove message NetworkProcessProxy::DidCancelProcessSuspension.
1253
1254 2015-07-21  Matthew Daiter  <mdaiter@apple.com>
1255
1256         Make sure to invalidate requests for user media after webpage reset
1257         https://bugs.webkit.org/show_bug.cgi?id=147155
1258         <rdar://problem/21924174>
1259
1260         Reviewed by Brent Fulgham.
1261
1262         * UIProcess/WebPageProxy.cpp:
1263         (WebKit::WebPageProxy::resetState): Added user media reset
1264
1265 2015-07-21  Tim Horton  <timothy_horton@apple.com>
1266
1267         [iOS] Avoid using a TextIndicator if there are non-text things to indicate
1268         https://bugs.webkit.org/show_bug.cgi?id=147152
1269         <rdar://problem/21921061>
1270
1271         Reviewed by Beth Dakin.
1272
1273         * UIProcess/ios/WKContentViewInteraction.mm:
1274         (-[WKContentView willPresentPreviewViewController:forPosition:inSourceView:]):
1275         * WebProcess/WebPage/ios/WebPageIOS.mm:
1276         (WebKit::shouldUseTextIndicatorForLink):
1277         (WebKit::WebPage::getPositionInformation):
1278         Fall back to a rectangular area instead of a TextIndicator if there are any
1279         non-inline elements inside the link.
1280
1281 2015-07-21  Andreas Kling  <akling@apple.com>
1282
1283         API::Session should clean up its storage in the network process when destroyed.
1284         <https://webkit.org/b/147139>
1285         <rdar://problem/21838764>
1286
1287         Reviewed by Anders Carlsson.
1288
1289         Have ~Session() send a DestroyPrivateBrowsingSession message to all networking processes
1290         for ephemeral sessions. This plugs a NetworkStorageSession leak that could retain a large
1291         CFNetwork object graph.
1292
1293         * UIProcess/API/APISession.cpp:
1294         (API::Session::~Session):
1295
1296 2015-07-21  Sungmann Cho  <sungmann.cho@navercorp.com>
1297
1298         Make PluginProxy::handleMouseEvent() asynchronous.
1299         https://bugs.webkit.org/show_bug.cgi?id=146142
1300
1301         Reviewed by Anders Carlsson.
1302
1303         PluginProxy::handleMouseEvent() forwards the generated mouse event to PluginControllerProxy
1304         using a synchronous message, but the recipient always reply immediately with the same value("true")
1305         even before handling the received message. So I think PluginProxy::handleMouseEvent() is perfectly
1306         OK to process its messages asynchronously.
1307
1308         * PluginProcess/PluginControllerProxy.cpp:
1309         (WebKit::PluginControllerProxy::handleMouseEvent):
1310         * PluginProcess/PluginControllerProxy.h:
1311         * PluginProcess/PluginControllerProxy.messages.in:
1312         * WebProcess/Plugins/PluginProxy.cpp:
1313         (WebKit::PluginProxy::handleMouseEvent):
1314
1315 2015-07-20  Carlos Garcia Campos  <cgarcia@igalia.com>
1316
1317         [GTK] Add API to be notified about editor state changes
1318         https://bugs.webkit.org/show_bug.cgi?id=145875
1319
1320         Reviewed by Gustavo Noronha Silva.
1321
1322         Add WebKitEditorState object, that is created on demand by the
1323         WebKitWebView and can be used to get the typing attributes of the
1324         editor at the current position or selection.
1325
1326         * PlatformGTK.cmake:
1327         * Shared/EditorState.cpp: Use part of the PostLayoutData struct
1328         for the GTK port too.
1329         (WebKit::EditorState::encode): Encode PostLayoutData for GTK and
1330         remove our custom cursorRect.
1331         (WebKit::EditorState::decode): Decode PostLayoutData for GTK and
1332         remove our custom cursorRect.
1333         (WebKit::EditorState::PostLayoutData::encode): Reorder it to
1334         reduce the amonut of ifdefs.
1335         (WebKit::EditorState::PostLayoutData::decode): Ditto.
1336         * Shared/EditorState.h: Add AttributeStrikeThrough to
1337         TypingAttributes enum.
1338         * UIProcess/API/gtk/PageClientImpl.cpp:
1339         (WebKit::PageClientImpl::selectionDidChange): Rename
1340         updateTextInputState() to selectionDidChange() and also notify the
1341         WebKitWebView.
1342         * UIProcess/API/gtk/PageClientImpl.h:
1343         * UIProcess/API/gtk/WebKitEditorState.cpp: Added.
1344         (webkitEditorStateGetProperty):
1345         (webkit_editor_state_class_init):
1346         (webkitEditorStateSetTypingAttributes):
1347         (webkitEditorStateCreate):
1348         (webkitEditorStateChanged):
1349         (webkit_editor_state_get_typing_attributes):
1350         * UIProcess/API/gtk/WebKitEditorState.h: Added.
1351         * UIProcess/API/gtk/WebKitEditorStatePrivate.h: Added.
1352         * UIProcess/API/gtk/WebKitWebView.cpp:
1353         (webkitWebViewSelectionDidChange): Notify the WebKitEditorState if
1354         it has already been created.
1355         (webkit_web_view_get_editor_state): Ensure a WebKitEditorState and
1356         return it.
1357         * UIProcess/API/gtk/WebKitWebView.h:
1358         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
1359         (webkitWebViewBaseUpdateTextInputState): Get the caret cursor rect
1360         from PostLayoutData.
1361         * UIProcess/API/gtk/WebKitWebViewPrivate.h:
1362         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt: Add new symbols.
1363         * UIProcess/API/gtk/docs/webkit2gtk-4.0.types: Add webkit_editor_state_get_type.
1364         * UIProcess/API/gtk/docs/webkit2gtk-docs.sgml: Add new section for WebKitEditorState.
1365         * UIProcess/API/gtk/webkit2.h: Include WebKitEditorState.h.
1366         * UIProcess/PageClient.h:
1367         * UIProcess/gtk/WebPageProxyGtk.cpp:
1368         (WebKit::WebPageProxy::editorStateChanged): Call PageClientImpl::selectionDidChange().
1369         * WebProcess/WebPage/gtk/WebPageGtk.cpp:
1370         (WebKit::WebPage::platformEditorState): Add typing attributes to EditorState.
1371
1372 2015-07-20  Simon Fraser  <simon.fraser@apple.com>
1373
1374         Fix the iOS build.
1375
1376         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
1377
1378 2015-07-20  Simon Fraser  <simon.fraser@apple.com>
1379
1380         Facebook in tiled fullscreen is slow
1381         https://bugs.webkit.org/show_bug.cgi?id=147134
1382         rdar://problem/21823349
1383
1384         Reviewed by Tim Horton.
1385         
1386         TiledCoreAnimationDrawingArea::scaleViewToFitDocumentIfNeeded() could cause a page to toggle
1387         between two fixed layout sizes differing by a pixel, because of rounding. This would cause
1388         lots of extra layouts and painting.
1389         
1390         This happened because the the fixed layout size was computed using ceil(m_webPage.size().width() / viewScale)
1391
1392         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
1393         (WebKit::TiledCoreAnimationDrawingArea::scaleViewToFitDocumentIfNeeded):
1394
1395 2015-07-20  Wenson Hsieh  <wenson_hsieh@apple.com>
1396
1397         Fix crash due to RemoteLayerTreeDisplayRefreshMonitor outliving RemoteLayerTreeDrawingArea
1398         https://bugs.webkit.org/show_bug.cgi?id=147124
1399         <rdar://problem/21582858>
1400
1401         Reviewed by Simon Fraser.
1402
1403         Refactors RemoteLayerTreeDisplayRefreshMonitor to use a weak pointer rather than a reference
1404         to its RemoteLayerTreeDrawingArea, since the drawing area may be deallocated before the monitor
1405         in some rare cases. This rarely caused pages using requestAnimationFrame to crash on iOS. However,
1406         this should not be the case: logically, a RemoteLayerTreeDrawingArea should always outlive its
1407         refresh monitors. Refer to https://bugs.webkit.org/show_bug.cgi?id=147128 for more details.
1408
1409         * WebProcess/WebPage/Cocoa/RemoteLayerTreeDisplayRefreshMonitor.h:
1410         * WebProcess/WebPage/Cocoa/RemoteLayerTreeDisplayRefreshMonitor.mm:
1411         (WebKit::RemoteLayerTreeDisplayRefreshMonitor::RemoteLayerTreeDisplayRefreshMonitor):
1412         (WebKit::RemoteLayerTreeDisplayRefreshMonitor::~RemoteLayerTreeDisplayRefreshMonitor): On destruction, checks
1413             first to see whether or not the drawing area has been deallocated before telling it to update its monitors.
1414         (WebKit::RemoteLayerTreeDisplayRefreshMonitor::requestRefreshCallback):
1415         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
1416         (WebKit::RemoteLayerTreeDrawingArea::createWeakPtr): Creates and returns a new weak pointer to itself.
1417         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
1418         (WebKit::RemoteLayerTreeDrawingArea::RemoteLayerTreeDrawingArea):
1419
1420 2015-07-20  Alex Christensen  <achristensen@webkit.org>
1421
1422         [Content Extensions] Cache actions with domains that match everything
1423         https://bugs.webkit.org/show_bug.cgi?id=147050
1424
1425         Reviewed by Benjamin Poulain.
1426
1427         * UIProcess/API/APIUserContentExtensionStore.h:
1428
1429 2015-07-20  Gordon Sheridan  <gordon_sheridan@apple.com>
1430
1431         Support blocking a plug-in for non-security reasons
1432         https://bugs.webkit.org/show_bug.cgi?id=145009
1433
1434         Reviewed by Anders Carlsson.
1435
1436         * Shared/Plugins/PluginModuleInfo.h:
1437         Replace PluginModuleBlocked with separate enum values for blocking for security and compatibility.
1438
1439         * UIProcess/API/C/WKAPICast.h:
1440         (WebKit::toWKPluginLoadPolicy):
1441         Modify to handle change to PluginModuleBlocked enum.
1442
1443         (WebKit::toPluginModuleLoadPolicy):
1444         Ditto.
1445
1446         * UIProcess/API/C/WKPluginLoadPolicy.h:
1447         Added enum value for blocking a plugin for compatibility reasons.
1448
1449         * UIProcess/Plugins/mac/PluginInfoStoreMac.mm:
1450         (WebKit::shouldBlockPlugin):
1451         Check load policy for both reasons a plugin may be blocked.
1452
1453         (WebKit::WKPlugInModuleLoadPolicyToPluginModuleLoadPolicy):
1454         Added function to convert between load policy enum types.
1455
1456         (WebKit::PluginInfoStore::defaultLoadPolicyForPlugin):
1457         Modified to call WKLoadPolicyForPluginVersion() which can distinguish between blocked for security or compatibility.
1458
1459         * UIProcess/WebPageProxy.cpp:
1460         (WebKit::WebPageProxy::findPlugin):
1461         Updated to recognize both PluginModuleBlocked enum values that indicate a plugin is blocked.
1462
1463         * WebProcess/WebPage/WebPage.cpp:
1464         (WebKit::WebPage::createPlugin):
1465         Ditto.
1466
1467         (WebKit::WebPage::canPluginHandleResponse):
1468         Ditto.
1469
1470 2015-07-20  Antti Koivisto  <antti@apple.com>
1471
1472         NSURLCache fallback does not work on iOS due to sandboxing
1473         https://bugs.webkit.org/show_bug.cgi?id=146314
1474         <rdar://problem/21433691>
1475
1476         Reviewed by Anders Carlsson.
1477
1478         This broke with earlier cache path computation changes.
1479
1480         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
1481         (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
1482
1483             NSURLCache path is relative to the container cache path so "." is sufficient.
1484             This puts the cache files under
1485             <container>/Library/Caches/com.apple.WebKit.Networking/
1486
1487 2015-07-20  Jeremy Jones  <jeremyj@apple.com>
1488
1489         Adopt AVPlayerLayerView
1490         https://bugs.webkit.org/show_bug.cgi?id=146862
1491
1492         Reviewed by Simon Fraser.
1493
1494         The CALayerHost is replaced with WebLayerHostView to be compatible with UIView animations.
1495         videoLayerFrame and videoLayerGravity no longer need to be stored because they are stored
1496         where they are used in the interface. Some animation is improved in the conversion.
1497
1498         * UIProcess/ios/WebVideoFullscreenManagerProxy.h:
1499         * UIProcess/ios/WebVideoFullscreenManagerProxy.mm:
1500         (+[WebLayerHostView layerClass]): Add class WebLayerHostView.
1501         (-[WebLayerHostView contextID]):
1502         (-[WebLayerHostView setContextID:]):
1503         (-[WebLayerHostView layerHost]):
1504         (WebKit::WebVideoFullscreenManagerProxy::invalidate): layer -> view
1505         (WebKit::WebVideoFullscreenManagerProxy::setupFullscreenWithID):
1506         Apply the hostingDeviceScaleFactor transform to -sublayerTransform instead of to
1507         -transform. This more directly inverts the tranform WebProcess and allows -transform
1508         to be used for animation in the UIProcess. This is important because UIView's actions
1509         animate -transform, but not -sublayerTrasform.
1510
1511         (WebKit::WebVideoFullscreenManagerProxy::didCleanupFullscreen): layer -> view
1512         (WebKit::WebVideoFullscreenModelContext::setVideoLayerFrame): Deleted.
1513         (WebKit::WebVideoFullscreenModelContext::videoLayerFrame): Deleted.
1514         (WebKit::WebVideoFullscreenModelContext::setVideoLayerGravity): Deleted.
1515         (WebKit::WebVideoFullscreenModelContext::videoLayerGravity): Deleted.
1516         * WebProcess/ios/WebVideoFullscreenManager.mm:
1517         (WebKit::WebVideoFullscreenManager::enterVideoFullscreenForVideoElement):
1518         Set initial video layer frame to fix start point of animation.
1519
1520         (WebKit::WebVideoFullscreenManager::didSetupFullscreen):
1521         dispatch_async allows the CATransaction to complete before continuing with the animation.
1522         This prevents a flash during animation.
1523
1524 2015-07-20  Tim Horton  <timothy_horton@apple.com>
1525
1526         REGRESSION (r174287): Flash of black when opening a new web view or navigating to a new page
1527         https://bugs.webkit.org/show_bug.cgi?id=147127
1528         <rdar://problem/21474317>
1529
1530         Reviewed by Simon Fraser.
1531
1532         * WebProcess/WebPage/WebPage.cpp:
1533         (WebKit::WebPage::snapshotAtSize):
1534         Avoid using an invalid documentBackgroundColor, fall back to baseBackgroundColor
1535         like we did before r174287.
1536
1537 2015-07-20  Michael Catanzaro  <mcatanzaro@igalia.com>
1538
1539         [Seccomp] Should be easier to debug blocked syscalls
1540         https://bugs.webkit.org/show_bug.cgi?id=142980
1541
1542         These should be printed even when not running in debug mode. There is no
1543         value in hiding errors from release build users.
1544
1545         Reviewed by Žan Doberšek.
1546
1547         * Shared/linux/SeccompFilters/SeccompBroker.cpp:
1548         (WebKit::SeccompBroker::runLoop): Don't close stderr et. al. in release builds.
1549         * Shared/linux/SeccompFilters/Syscall.cpp:
1550         (WebKit::write_uint): Added.
1551         (WebKit::reportUnexpectedSyscall): Added.
1552         (WebKit::Syscall::createFromContext): Call reportUnexpectedSyscall. Also, no need to crash
1553         here in release builds.
1554         * Shared/linux/SeccompFilters/SyscallPolicy.cpp:
1555         (WebKit::SyscallPolicy::hasPermissionForPath): Print a warning when access is denied.
1556         (WebKit::SyscallPolicy::permissionToString): Added.
1557         * Shared/linux/SeccompFilters/SyscallPolicy.h: Add permissionToString.
1558
1559 2015-07-20  Csaba Osztrogonác  <ossy@webkit.org>
1560
1561         Fix the !ENABLE(VIDEO) build after r186396
1562         https://bugs.webkit.org/show_bug.cgi?id=147116
1563
1564         Reviewed by Brent Fulgham.
1565
1566         * WebProcess/WebProcess.cpp:
1567         (WebKit::WebProcess::didClose):
1568
1569 2015-07-20  Tomas Popela  <tpopela@redhat.com>
1570
1571         [GTK] Add selection-changed signal to the WebKit2 API
1572         https://bugs.webkit.org/show_bug.cgi?id=137116
1573
1574         Reviewed by Carlos Garcia Campos.
1575
1576         Add a new object WebKitWebEditor where the editing capabilities of a
1577         WebPage will be grouped and exposed. Add the selection-changed signal
1578         there (we used the same name as in WK1 API).
1579
1580         * PlatformGTK.cmake:
1581         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
1582         * WebProcess/InjectedBundle/API/gtk/WebKitWebEditor.cpp: Added.
1583         (didChangeSelection):
1584         (webkitWebEditorCreate):
1585         (webkit_web_editor_get_page):
1586         * WebProcess/InjectedBundle/API/gtk/WebKitWebEditor.h: Added.
1587         * WebProcess/InjectedBundle/API/gtk/WebKitWebEditorPrivate.h: Added.
1588         * WebProcess/InjectedBundle/API/gtk/WebKitWebPage.cpp:
1589         (webkitWebPageGetPage):
1590         (webkit_web_page_get_editor):
1591         * WebProcess/InjectedBundle/API/gtk/WebKitWebPage.h:
1592         * WebProcess/InjectedBundle/API/gtk/WebKitWebPagePrivate.h:
1593         * WebProcess/InjectedBundle/API/gtk/webkit-web-extension.h:
1594
1595 2015-07-16  Anders Carlsson  <andersca@apple.com>
1596
1597         WebsiteDataStore operations need to grab background assertions
1598         https://bugs.webkit.org/show_bug.cgi?id=147015
1599         rdar://problem/21799011
1600
1601         Reviewed by Sam Weinig.
1602
1603         * UIProcess/Network/NetworkProcessProxy.cpp:
1604         (WebKit::NetworkProcessProxy::fetchWebsiteData):
1605         (WebKit::NetworkProcessProxy::deleteWebsiteData):
1606         (WebKit::NetworkProcessProxy::deleteWebsiteDataForOrigins):
1607         * UIProcess/WebProcessProxy.cpp:
1608         (WebKit::WebProcessProxy::fetchWebsiteData):
1609         (WebKit::WebProcessProxy::deleteWebsiteData):
1610         (WebKit::WebProcessProxy::deleteWebsiteDataForOrigins):
1611
1612 2015-07-19  Michael Catanzaro  <mcatanzaro@igalia.com>
1613
1614         Unreviewed, placate -Wmismatched-tags after r187011
1615
1616         It's basically bug #146990 again. Oops.
1617
1618         * WebProcess/gtk/SeccompFiltersWebProcessGtk.h:
1619
1620 2015-07-19  Michael Catanzaro  <mcatanzaro@igalia.com>
1621
1622         [GTK] Add seccomp filters support
1623         https://bugs.webkit.org/show_bug.cgi?id=110014
1624
1625         Reviewed by Žan Doberšek.
1626
1627         Allow building with ENABLE_SECCOMP_FILTERS=ON. Based on work by Thiago Marcos P. Santos.
1628
1629         * PlatformGTK.cmake: Support ENABLE_SECCOMP_FILTERS build option.
1630         * WebProcess/gtk/SeccompFiltersWebProcessGtk.cpp: Added.
1631         (WebKit::SeccompFiltersWebProcessGtk::SeccompFiltersWebProcessGtk):
1632         (WebKit::SeccompFiltersWebProcessGtk::platformInitialize):
1633         * WebProcess/gtk/SeccompFiltersWebProcessGtk.h: Added.
1634         * WebProcess/soup/WebProcessSoup.cpp:
1635         (WebKit::WebProcess::platformInitializeWebProcess): Initialize default
1636         GTK+ web process seccomp filters.
1637
1638 2015-07-18  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
1639
1640         Reduce PassRefPtr in WebKit2 - 3
1641         https://bugs.webkit.org/show_bug.cgi?id=146995
1642
1643         Reviewed by Daniel Bates.
1644
1645         To remove PassRefPtr, this patch reduces use of PassRefPtr in WebKit2.
1646         Because some uses depend on WebCore, WebCore, WK1 ports are modified as well.
1647
1648         * DatabaseProcess/DatabaseProcess.cpp:
1649         (WebKit::DatabaseProcess::getOrCreateUniqueIDBDatabase):
1650         * DatabaseProcess/DatabaseProcess.h:
1651         * PluginProcess/PluginControllerProxy.cpp:
1652         (WebKit::PluginControllerProxy::takeInitializationReply):
1653         * PluginProcess/PluginControllerProxy.h:
1654         * Shared/CoordinatedGraphics/CoordinatedBackingStore.cpp:
1655         (WebKit::CoordinatedBackingStore::texture):
1656         * Shared/CoordinatedGraphics/CoordinatedBackingStore.h:
1657         (WebKit::CoordinatedBackingStore::create):
1658         * Shared/CoordinatedGraphics/WebCoordinatedSurface.cpp:
1659         (WebKit::WebCoordinatedSurface::create):
1660         (WebKit::WebCoordinatedSurface::createWithSurface):
1661         * Shared/CoordinatedGraphics/WebCoordinatedSurface.h:
1662         * UIProcess/API/APILoaderClient.h:
1663         (API::LoaderClient::webCryptoMasterKey):
1664         * UIProcess/API/APINavigationClient.h:
1665         (API::NavigationClient::webCryptoMasterKey):
1666         * UIProcess/API/C/WKPage.cpp:
1667         (WKPageSetPageLoaderClient):
1668         (WKPageSetPageNavigationClient):
1669         * UIProcess/API/gtk/PageClientImpl.cpp:
1670         (WebKit::PageClientImpl::createPopupMenuProxy):
1671         (WebKit::PageClientImpl::createContextMenuProxy):
1672         (WebKit::PageClientImpl::createColorPicker):
1673         * UIProcess/API/gtk/PageClientImpl.h:
1674         * UIProcess/Authentication/WebCredential.h:
1675         * UIProcess/Authentication/WebProtectionSpace.h:
1676         * UIProcess/AutoCorrectionCallback.h:
1677         * UIProcess/Cocoa/NavigationState.h:
1678         * UIProcess/Cocoa/NavigationState.mm:
1679         (WebKit::NavigationState::NavigationClient::webCryptoMasterKey):
1680         * UIProcess/CoordinatedGraphics/WebView.cpp:
1681         (WebKit::WebView::createPopupMenuProxy):
1682         (WebKit::WebView::createContextMenuProxy):
1683         (WebKit::WebView::createColorPicker):
1684         * UIProcess/CoordinatedGraphics/WebView.h:
1685         * UIProcess/PageClient.h:
1686         * UIProcess/WebPageProxy.h:
1687         * UIProcess/efl/WebViewEfl.cpp:
1688         (WebKit::WebViewEfl::createPopupMenuProxy):
1689         (WebKit::WebViewEfl::createContextMenuProxy):
1690         (WebKit::WebViewEfl::createColorPicker):
1691         * UIProcess/efl/WebViewEfl.h:
1692         * UIProcess/ios/PageClientImplIOS.h:
1693         * UIProcess/ios/PageClientImplIOS.mm:
1694         (WebKit::PageClientImpl::createPopupMenuProxy):
1695         (WebKit::PageClientImpl::createContextMenuProxy):
1696         * UIProcess/ios/WebPageProxyIOS.mm:
1697         (WebKit::WebPageProxy::dataSelectionForPasteboard):
1698         * UIProcess/mac/PageClientImpl.h:
1699         * UIProcess/mac/PageClientImpl.mm:
1700         (WebKit::PageClientImpl::createPopupMenuProxy):
1701         (WebKit::PageClientImpl::createContextMenuProxy):
1702         (WebKit::PageClientImpl::createColorPicker):
1703         * UIProcess/mac/WebPageProxyMac.mm:
1704         (WebKit::WebPageProxy::dataSelectionForPasteboard):
1705         * WebProcess/Network/WebResourceLoadScheduler.cpp:
1706         (WebKit::WebResourceLoadScheduler::scheduleSubresourceLoad):
1707         (WebKit::WebResourceLoadScheduler::schedulePluginStreamLoad):
1708         * WebProcess/Network/WebResourceLoadScheduler.h:
1709         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
1710         (WebKit::NetscapePlugin::fromNPP):
1711         (WebKit::NetscapePlugin::snapshot):
1712         (WebKit::NetscapePlugin::liveResourceData):
1713         * WebProcess/Plugins/Netscape/NetscapePlugin.h:
1714         * WebProcess/Plugins/Plugin.h:
1715         * WebProcess/Plugins/PluginProxy.cpp:
1716         (WebKit::PluginProxy::snapshot):
1717         (WebKit::PluginProxy::liveResourceData):
1718         * WebProcess/Plugins/PluginProxy.h:
1719         * WebProcess/Storage/StorageNamespaceImpl.cpp:
1720         (WebKit::StorageNamespaceImpl::storageArea):
1721         (WebKit::StorageNamespaceImpl::copy):
1722         * WebProcess/Storage/StorageNamespaceImpl.h:
1723         * WebProcess/WebCoreSupport/SessionStateConversion.cpp:
1724         (WebKit::toHistoryItem):
1725         * WebProcess/WebCoreSupport/SessionStateConversion.h:
1726         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1727         (WebKit::WebChromeClient::createPopupMenu):
1728         (WebKit::WebChromeClient::createSearchPopupMenu):
1729         * WebProcess/WebCoreSupport/WebChromeClient.h:
1730         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1731         (WebKit::WebFrameLoaderClient::createDocumentLoader):
1732         (WebKit::WebFrameLoaderClient::createFrame):
1733         (WebKit::WebFrameLoaderClient::createPlugin):
1734         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
1735         * WebProcess/WebPage/WebPage.cpp:
1736         (WebKit::WebPage::create):
1737         (WebKit::WebPage::createDocumentLoader):
1738         * WebProcess/WebPage/WebPage.h:
1739         * WebProcess/WebPage/mac/WebPageMac.mm:
1740         (WebKit::WebPage::lookupTextAtLocation):
1741
1742 2015-07-18  Simon Fraser  <simon.fraser@apple.com>
1743
1744         Scroll position jumps when scrolling scaling pages down in split view
1745         https://bugs.webkit.org/show_bug.cgi?id=147072
1746         rdar://problem/21769577
1747
1748         Reviewed by Sam Weinig.
1749         
1750         When apple.com/music is in Split View at a reduced scale, scrolling the page
1751         can cause unwanted scroll jumps. This happened because we'd enter
1752         TiledCoreAnimationDrawingArea::scaleViewToFitDocumentIfNeeded() with a pending
1753         layout, so run the autosizing logic. When scrolled near the bottom, the unconstrained
1754         layout resulted in a shorter document, which truncated the scroll position. The
1755         scaled layout then restored the longer document, but it also restored that
1756         truncated scroll position.
1757         
1758         Forcing a layout is sufficient to fix the bug for this page, and doing a single
1759         layout (which will happen anyway) is preferable to running the autosize logic
1760         if layout happens to be dirty.
1761
1762         I was not able to make a test to reproduce the problem. Entering
1763         scaleViewToFitDocumentIfNeeded() with pending layout was triggerable
1764         using a transform transition, but I was not able to reproduce incorrect
1765         scroll position restoration.
1766
1767         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
1768         (WebKit::TiledCoreAnimationDrawingArea::scaleViewToFitDocumentIfNeeded):
1769
1770 2015-07-17  Andy Estes  <aestes@apple.com>
1771
1772         [iOS] Further tighten the sandbox around pages fetched with Content-Disposition: attachment
1773         https://bugs.webkit.org/show_bug.cgi?id=147044
1774         rdar://problem/21567820
1775
1776         Reviewed by Brady Eidson.
1777
1778         * WebProcess/WebPage/WebPage.cpp:
1779         (WebKit::WebPage::WebPage): Enabled Content-Disposition: attachment sandbox on iOS.
1780
1781 2015-07-17  Tim Horton  <timothy_horton@apple.com>
1782
1783         [iOS] TextIndicator has a large forehead when line-height > 1
1784         https://bugs.webkit.org/show_bug.cgi?id=147058
1785         <rdar://problem/21643094>
1786
1787         Reviewed by Dean Jackson.
1788
1789         * WebProcess/WebPage/ios/WebPageIOS.mm:
1790         (WebKit::WebPage::getPositionInformation):
1791         Apply a review comment that I left myself and then forgot about.
1792
1793 2015-07-17  Enrica Casucci  <enrica@apple.com>
1794
1795         [iOS] Implement selectionInteractionAssistant accessor.
1796         https://bugs.webkit.org/show_bug.cgi?id=147054
1797         rdar://problem/20864286
1798
1799         Reviewed by Tim Horton.
1800
1801         One more change to adopt the new selection interaction
1802         model on iOS.
1803
1804         * UIProcess/ios/WKContentViewInteraction.mm:
1805         (-[WKContentView selectionInteractionAssistant]):
1806
1807 2015-07-17  Dan Bernstein  <mitz@apple.com>
1808
1809         REGRESSION (r186964): Crash in WebKit2.CloseFromWithinCreatePage
1810         https://bugs.webkit.org/show_bug.cgi?id=147055
1811
1812         Reviewed by Alex Christensen.
1813
1814         * UIProcess/WebPageProxy.cpp:
1815         (WebKit::WebPageProxy::createNewPage): Grab the main frame’s URL before calling out to the
1816         client, who may destroy the frame.
1817
1818 2015-07-17  Dan Bernstein  <mitz@apple.com>
1819
1820         WebKit2 part of <rdar://problem/21803781> The external URL policy is not reported correctly in navigation actions that create new windows
1821         https://bugs.webkit.org/show_bug.cgi?id=147040
1822
1823         Reviewed by Dean Jackson.
1824
1825         * UIProcess/Cocoa/UIDelegate.mm:
1826         (WebKit::UIDelegate::UIClient::createNewPage): Disallow App Links if the new page is for the
1827         same protocol, host and port as the main frame of this page.
1828
1829         * UIProcess/WebPageProxy.cpp:
1830         (WebKit::WebPageProxy::decidePolicyForNavigationAction): Disallow App Links if
1831         m_shouldSuppressAppLinksInNextNavigationPolicyDecision is set, and reset it. See below for
1832         when we set it.
1833         (WebKit::WebPageProxy::decidePolicyForNewWindowAction): Disallow App Links if the new window
1834         is for the same protocol, host and port as the main frame of this page.
1835         (WebKit::WebPageProxy::createNewPage): Make the new page disallow App Links in the first
1836         policy decision if it is for the same protocol, host and port as the main frame of this
1837         page.
1838         * UIProcess/WebPageProxy.h: Added m_shouldSuppressAppLinksInNextNavigationPolicyDecision
1839         member variable.
1840
1841         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1842         (WebKit::WebChromeClient::createWindow): Pass the shouldOpenExternalURLsPolicy.
1843
1844         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1845         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNewWindowAction): Ditto.
1846
1847 2015-07-17  Tim Horton  <timothy_horton@apple.com>
1848
1849         iOS TextIndicators include text that is not supposed to be indicated
1850         https://bugs.webkit.org/show_bug.cgi?id=147028
1851         <rdar://problem/21643094>
1852
1853         Reviewed by Sam Weinig.
1854
1855         * WebProcess/Plugins/PluginView.cpp:
1856         (WebKit::PluginView::shouldCreateTransientPaintingSnapshot):
1857
1858 2015-07-17  Carlos Garcia Campos  <cgarcia@igalia.com>
1859
1860         [GTK] Cleanup PasteboardHelper
1861         https://bugs.webkit.org/show_bug.cgi?id=147035
1862
1863         Reviewed by Žan Doberšek.
1864
1865         Use PasteboardHelper::singleton() instead of
1866         PasteboardHelper::defaultPasteboardHelper().
1867
1868         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
1869         (webkitWebViewBaseConstructed):
1870         * UIProcess/gtk/DragAndDropHandler.cpp:
1871         (WebKit::DragAndDropHandler::startDrag):
1872         (WebKit::DragAndDropHandler::fillDragData):
1873         (WebKit::DragAndDropHandler::dataObjectForDropData):
1874         (WebKit::DragAndDropHandler::requestDragData):
1875
1876 2015-07-16  Matt Baker  <mattbaker@apple.com>
1877
1878         [Mac] Web Inspector toolbar can be covered by the Safari tab bar when docked to the right
1879         https://bugs.webkit.org/show_bug.cgi?id=146994
1880
1881         Reviewed by Timothy Hatcher.
1882
1883         WebInspectorProxy contained logic which ignored the next frame change notification from the inspected view,
1884         whenever it updated the frames of both the Inspector view and inspected view. This patch removes that logic,
1885         as it prevented the Inspector's frame from being adjusted after changes to the browser's top content inset.
1886
1887         * UIProcess/mac/WebInspectorProxyMac.mm:
1888         (-[WKWebInspectorProxyObjCAdapter ignoreNextInspectedViewFrameDidChange]): Deleted.
1889         (-[WKWebInspectorProxyObjCAdapter inspectedViewFrameDidChange:]): Deleted.
1890         (WebKit::WebInspectorProxy::inspectedViewFrameDidChange): Deleted.
1891
1892 2015-07-16  Joseph Pecoraro  <pecoraro@apple.com>
1893
1894         Web Inspector: [Mac] Save dialog not working when inspector is docked
1895         https://bugs.webkit.org/show_bug.cgi?id=146991
1896
1897         Reviewed by Sam Weinig.
1898
1899         * UIProcess/mac/WebInspectorProxyMac.mm:
1900         (WebKit::runOpenPanel):
1901         (WebKit::WebInspectorProxy::platformSave):
1902         When the window is nil (docked) use a non-window version of running the dialog.
1903
1904 2015-07-16  Tim Horton  <timothy_horton@apple.com>
1905
1906         Add shrink-wrapped link highlights
1907         https://bugs.webkit.org/show_bug.cgi?id=147021
1908         <rdar://problem/21643094>
1909
1910         Reviewed by Enrica Casucci.
1911
1912         * Shared/InteractionInformationAtPosition.cpp:
1913         (WebKit::InteractionInformationAtPosition::encode):
1914         (WebKit::InteractionInformationAtPosition::decode):
1915         * Shared/InteractionInformationAtPosition.h:
1916         Add a TextIndicator to InteractionInformationAtPosition.
1917         Make use of some new C++ features.
1918
1919         * UIProcess/ios/WKContentViewInteraction.h:
1920         * UIProcess/ios/WKContentViewInteraction.mm:
1921         (-[WKContentView willPresentPreviewViewController:forPosition:inSourceView:]):
1922         (-[WKContentView didDismissPreviewViewController:committing:]):
1923         Make use of the TextIndicator (if we have one) to show a shrink-wrapped
1924         snapshot of the link.
1925
1926         * WebProcess/WebPage/ios/WebPageIOS.mm:
1927         (WebKit::WebPage::getPositionInformation):
1928         Build a TextIndicator for the link if possible.
1929
1930 2015-07-16  Matt Rajca  <mrajca@apple.com>
1931
1932         Media Session: remove plumbing for delivering start/end-of-interruption events
1933         https://bugs.webkit.org/show_bug.cgi?id=147005
1934
1935         Reviewed by Eric Carlson.
1936
1937         Instead of receiving interruptions through WebKit, we will provide platform-specific implementations in WebCore
1938         so the same behavior is available to all clients.
1939
1940         * UIProcess/API/C/WKPage.cpp:
1941         * UIProcess/API/C/WKPagePrivate.h:
1942         * UIProcess/WebPageProxy.cpp:
1943         * UIProcess/WebPageProxy.h:
1944         * WebProcess/WebPage/WebPage.cpp:
1945         * WebProcess/WebPage/WebPage.h:
1946         * WebProcess/WebPage/WebPage.messages.in:
1947
1948 2015-07-16  Michael Catanzaro  <mcatanzaro@igalia.com>
1949
1950         REGRESSION(r186464): [SOUP] ASSERTION FAILED: !m_messageReceiverMapCount when closing any tab
1951         https://bugs.webkit.org/show_bug.cgi?id=147006
1952
1953         Reviewed by Anders Carlsson.
1954
1955         Remove the message receiver before it is deallocated.
1956
1957         * UIProcess/Network/CustomProtocols/soup/CustomProtocolManagerProxySoup.cpp:
1958         (WebKit::CustomProtocolManagerProxy::~CustomProtocolManagerProxy):
1959
1960 2015-07-16  Brady Eidson  <beidson@apple.com>
1961
1962         Review feedback followup for:
1963         REGRESSION(r186088): Crash under WebKit::WebPageProxy::didFailLoadForFrame
1964         <rdar://problem/21692212> and https://bugs.webkit.org/show_bug.cgi?id=146988
1965
1966         * UIProcess/mac/PageClientImpl.mm:
1967         (WebKit::PageClientImpl::refView): CFRetain instead of Obj-C retain.
1968         (WebKit::PageClientImpl::derefView): CFRelease instead of Obj-C release.
1969
1970
1971 2015-07-16  Michael Catanzaro  <mcatanzaro@igalia.com>
1972
1973         [Linux] Seccomp: fix -Wmismatched-tags
1974         https://bugs.webkit.org/show_bug.cgi?id=146990
1975
1976         Reviewed by Žan Doberšek.
1977
1978         WebProcessCreationParameters is a struct nowadays, not a class, so declare it appropriately.
1979
1980         * Shared/linux/SeccompFilters/SyscallPolicy.h:
1981
1982 2015-07-16  Carlos Garcia Campos  <cgarcia@igalia.com>
1983
1984         REGRESSION(r185415): [GTK] Browsers crash when an input method is enabled
1985         https://bugs.webkit.org/show_bug.cgi?id=146639
1986
1987         Reviewed by Žan Doberšek.
1988
1989         In r185415 I assumed that preedit signals were always emitted
1990         after a keypress was handled by the WebView. However, some input
1991         methods handle the keyboard events before the WebView, and preedit
1992         signals are emitted but no key event has been handled by the
1993         WebView. So, instead of asserting when filter key event completion
1994         handler is nullptr, we should check whether the current event was
1995         generated for a WebView filter request or not. In case the
1996         completion handler is nullptr, we send the event directly to the
1997         page, instead of going through the WebView, since there won't be
1998         editing commands for those events anyway.
1999
2000         * UIProcess/gtk/InputMethodFilter.cpp:
2001         (WebKit::InputMethodFilter::handleKeyboardEvent):
2002         (WebKit::InputMethodFilter::handleKeyboardEventWithCompositionResults):
2003
2004 2015-07-15  Carlos Garcia Campos  <cgarcia@igalia.com>
2005
2006         Unreviewed. Follow up to r186887 for GTK+.
2007
2008         Add GTK+ implementation of PageClientImpl::refView/derefView.
2009
2010         * UIProcess/API/gtk/PageClientImpl.cpp:
2011         (WebKit::PageClientImpl::refView):
2012         (WebKit::PageClientImpl::derefView):
2013         * UIProcess/API/gtk/PageClientImpl.h:
2014
2015 2015-07-15  Carlos Garcia Campos  <cgarcia@igalia.com>
2016
2017         [GTK] Input method filter is always enabled when the view is focused
2018         https://bugs.webkit.org/show_bug.cgi?id=146965
2019
2020         Reviewed by Martin Robinson.
2021
2022         It should only be enabled when the view is focused and there's an
2023         editable element focused. In r138544, when input methods were
2024         implemented, the message SetInputMethodState was added, but it was
2025         never used. Instead, the notifyFocusIn method of the IM filter
2026         enables the input method unconditionally. We should actually use
2027         the SetInputMethodState message to enable/disable input methods
2028         when editable elements are focused/unfocused.
2029
2030         * UIProcess/gtk/InputMethodFilter.cpp:
2031         (WebKit::InputMethodFilter::setEnabled): Call notifyFocusedIn/Out
2032         when inputs methods are enabled/disabled instead of notifying the
2033         IM context directly.
2034         (WebKit::InputMethodFilter::setCursorRect): Do not update the
2035         cursor position if input methods are didabled.
2036         (WebKit::InputMethodFilter::notifyFocusedIn): Do nothing when
2037         input methods are disabled. Do not enable input methods
2038         uncontionally here.
2039         (WebKit::InputMethodFilter::notifyFocusedOut): Do not disable
2040         input methods uncontionally here.
2041         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
2042         (WebKit::WebEditorClient::setInputMethodState): Call
2043         WebPage::setInputMethodState() for GTK platform.
2044         * WebProcess/WebPage/WebPage.h: Add setInputMethodState() for GTK platform.
2045         * WebProcess/WebPage/gtk/WebPageGtk.cpp:
2046         (WebKit::WebPage::setInputMethodState): Update input method state
2047         and send SetInputMethodState message to the UI process if state changed.
2048
2049 2015-07-15  Brady Eidson  <beidson@apple.com>
2050
2051         REGRESSION(r186088): Crash under WebKit::WebPageProxy::didFailLoadForFrame
2052         <rdar://problem/21692212> and https://bugs.webkit.org/show_bug.cgi?id=146988
2053
2054         Reviewed by Sam Weinig.
2055
2056         When a loader delegate callback results in the WKView getting deallocated, then the PageClient
2057         is also destroyed.
2058
2059         WebPageProxy then (often) turns around and uses the PageClient anyways.
2060
2061         Tried to write a TestWebKitAPI test for this, but only didFailLoadForFrame appears to obviously 
2062         be vulnerable, and there seems to be no way to reproduce that failure case under TestWebKitAPI.
2063
2064         * UIProcess/PageClient.h: Add ref/derefView.
2065
2066         * UIProcess/API/gtk/PageClientImpl.h: Stub them out.
2067         * UIProcess/efl/WebViewEfl.h: Stub them out.
2068
2069         * UIProcess/mac/PageClientImpl.h:
2070         * UIProcess/mac/PageClientImpl.mm:
2071         (WebKit::PageClientImpl::refView): [m_wkView retain]
2072         (WebKit::PageClientImpl::derefView): [m_wkView release]
2073
2074         * UIProcess/ios/PageClientImplIOS.h:
2075         * UIProcess/ios/PageClientImplIOS.mm:
2076         (WebKit::PageClientImpl::refView): Retain all 3 views.
2077         (WebKit::PageClientImpl::derefView): Release all 3 views.
2078
2079         * UIProcess/WebPageProxy.cpp:
2080         (WebKit::PageClientProtector::PageClientProtector): Calls refView() on the PageClient.
2081         (WebKit::PageClientProtector::~PageClientProtector): Calls derefView() on the PageClient.
2082         (WebKit::WebPageProxy::didChangeBackForwardList): All methods that make m_loaderClient or
2083           m_pageClient callouts get a protector at their head.
2084         (WebKit::WebPageProxy::willGoToBackForwardListItem):
2085         (WebKit::WebPageProxy::shouldKeepCurrentBackForwardListItemInList):
2086         (WebKit::WebPageProxy::findPlugin):
2087         (WebKit::WebPageProxy::didCreateMainFrame):
2088         (WebKit::WebPageProxy::didCreateSubframe):
2089         (WebKit::WebPageProxy::didStartProgress):
2090         (WebKit::WebPageProxy::didChangeProgress):
2091         (WebKit::WebPageProxy::didFinishProgress):
2092         (WebKit::WebPageProxy::didDestroyNavigation):
2093         (WebKit::WebPageProxy::didStartProvisionalLoadForFrame):
2094         (WebKit::WebPageProxy::didReceiveServerRedirectForProvisionalLoadForFrame):
2095         (WebKit::WebPageProxy::didChangeProvisionalURLForFrame):
2096         (WebKit::WebPageProxy::didFailProvisionalLoadForFrame):
2097         (WebKit::WebPageProxy::didCommitLoadForFrame):
2098         (WebKit::WebPageProxy::didFinishDocumentLoadForFrame):
2099         (WebKit::WebPageProxy::didFinishLoadForFrame):
2100         (WebKit::WebPageProxy::didFailLoadForFrame):
2101         (WebKit::WebPageProxy::didSameDocumentNavigationForFrame):
2102         (WebKit::WebPageProxy::didReceiveTitleForFrame):
2103         (WebKit::WebPageProxy::didFirstLayoutForFrame):
2104         (WebKit::WebPageProxy::didFirstVisuallyNonEmptyLayoutForFrame):
2105         (WebKit::WebPageProxy::didLayoutForCustomContentProvider):
2106         (WebKit::WebPageProxy::didLayout):
2107         (WebKit::WebPageProxy::didRemoveFrameFromHierarchy):
2108         (WebKit::WebPageProxy::didDisplayInsecureContentForFrame):
2109         (WebKit::WebPageProxy::didRunInsecureContentForFrame):
2110         (WebKit::WebPageProxy::didDetectXSSForFrame):
2111         (WebKit::WebPageProxy::frameDidBecomeFrameSet):
2112         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
2113         (WebKit::WebPageProxy::decidePolicyForNewWindowAction):
2114         (WebKit::WebPageProxy::decidePolicyForResponse):
2115         (WebKit::WebPageProxy::decidePolicyForResponseSync):
2116         (WebKit::WebPageProxy::unableToImplementPolicy):
2117         (WebKit::WebPageProxy::didNavigateWithNavigationData):
2118         (WebKit::WebPageProxy::didPerformClientRedirect):
2119         (WebKit::WebPageProxy::didPerformServerRedirect):
2120         (WebKit::WebPageProxy::didUpdateHistoryTitle):
2121         (WebKit::WebPageProxy::wrapCryptoKey):
2122         (WebKit::WebPageProxy::unwrapCryptoKey):
2123         (WebKit::WebPageProxy::navigationGestureDidBegin):
2124         (WebKit::WebPageProxy::navigationGestureWillEnd):
2125         (WebKit::WebPageProxy::navigationGestureDidEnd):
2126         (WebKit::WebPageProxy::willRecordNavigationSnapshot):
2127
2128 2015-07-15  Sam Weinig  <sam@webkit.org>
2129
2130         Color match plug-ins
2131         <rdar://problem/21758722>
2132         https://bugs.webkit.org/show_bug.cgi?id=146987
2133
2134         Reviewed by Dean Jackson.
2135
2136         * Platform/mac/LayerHostingContext.h:
2137         * Platform/mac/LayerHostingContext.mm:
2138         (WebKit::LayerHostingContext::setColorMatchUntaggedContent):
2139         (WebKit::LayerHostingContext::colorMatchUntaggedContent):
2140         Add setter/getter for color matching untagged content.
2141
2142         * PluginProcess/mac/PluginControllerProxyMac.mm:
2143         (WebKit::PluginControllerProxy::updateLayerHostingContext):
2144         Have plug-ins CAContext's color match untagged colors into sRGB.
2145
2146 2015-07-15  Michael Catanzaro  <mcatanzaro@igalia.com>
2147
2148         [GTK] Rename PACKAGE_LOCALE_DIR to LOCALEDIR
2149         https://bugs.webkit.org/show_bug.cgi?id=146975
2150
2151         Reviewed by Martin Robinson.
2152
2153         * PlatformGTK.cmake:
2154         * UIProcess/API/gtk/WebKitWebContext.cpp:
2155         (webkit_web_context_class_init):
2156         * WebProcess/gtk/WebProcessMainGtk.cpp:
2157
2158 2015-07-15  Michael Catanzaro  <mcatanzaro@igalia.com>
2159
2160         [GTK] Rename LIBEXECDIR to PKGLIBEXECDIR
2161         https://bugs.webkit.org/show_bug.cgi?id=140070
2162
2163         Reviewed by Martin Robinson.
2164
2165         The path that's currently stored in LIBEXECDIR is one level lower than
2166         the real LIBEXECDIR, which we are going to need. Introduce PKGLIBEXECDIR
2167         so that we can use LIBEXECDIR for the real LIBEXECDIR in the future.
2168
2169         * PlatformGTK.cmake:
2170         * Shared/gtk/ProcessExecutablePathGtk.cpp:
2171         (WebKit::findWebKitProcess):
2172
2173 2015-07-15  Daniel Bates  <dabates@apple.com>
2174
2175         [Mac][WK2] Videos should only have access to cookies when -[NSURLRequest HTTPShouldHandleCookies] is YES
2176         https://bugs.webkit.org/show_bug.cgi?id=146763
2177         <rdar://problem/21736994>
2178
2179         Reviewed by Darin Adler.
2180
2181         We should only fetch cookies from the Network process when -[NSURLRequest HTTPShouldHandleCookies] is YES.
2182         This makes us more closely match the behavior of the CFNetwork implementation of
2183         -[__NSURLSessionLocal {_copyCookiesForRequestUsingAllAppropriateStorageSemantics, _getCookieHeadersForTask:completionHandler}].
2184
2185         * Shared/mac/CookieStorageShim.mm:
2186         (-[WKNSURLSessionLocal _copyCookiesForRequestUsingAllAppropriateStorageSemantics:]):
2187         (-[WKNSURLSessionLocal _getCookieHeadersForTask:completionHandler:]):
2188
2189 2015-07-14  Enrica Casucci  <enrica@apple.com>
2190
2191         [iOS] Add support for updateSelectionWithExtentPoint:withBoundary.
2192         https://bugs.webkit.org/show_bug.cgi?id=146951
2193         rdar://problem/20864286
2194
2195         Reviewed by Tim Horton.
2196
2197         Add implementation for new method used by text selection
2198         engine on iOS. The new function modifies the selection near the given point
2199         and snaps it at the boundary of the specified granularity.
2200
2201         * UIProcess/WebPageProxy.h:
2202         * UIProcess/ios/WKContentViewInteraction.mm:
2203         (-[WKContentView updateSelectionWithExtentPoint:completionHandler:]):
2204         (-[WKContentView updateSelectionWithExtentPoint:withBoundary:completionHandler:]):
2205         (-[WKContentView _characterBeforeCaretSelection]):
2206         * UIProcess/ios/WebPageProxyIOS.mm:
2207         (WebKit::WebPageProxy::updateSelectionWithExtentPoint):
2208         (WebKit::WebPageProxy::updateSelectionWithExtentPointAndBoundary):
2209         (WebKit::WebPageProxy::requestDictationContext):
2210         * WebProcess/WebPage/WebPage.h:
2211         * WebProcess/WebPage/WebPage.messages.in:
2212         * WebProcess/WebPage/ios/WebPageIOS.mm:
2213         (WebKit::WebPage::rangeForGranularityAtPoint):
2214         (WebKit::WebPage::selectTextWithGranularityAtPoint):
2215         (WebKit::WebPage::updateSelectionWithExtentPointAndBoundary):
2216
2217 2015-07-15  Michael Catanzaro  <mcatanzaro@igalia.com>
2218
2219         [Linux] SeccompBrokerClient should cache arbitrary file descriptors
2220         https://bugs.webkit.org/show_bug.cgi?id=140068
2221
2222         Reviewed by Žan Doberšek.
2223
2224         If malloc() attempts to open /proc/sys/vm/overcommit_memory in a SIGSYS
2225         signal handler, the SeccompBroker will attempt to recursively broker the
2226         open() syscall. Generalize the existing code that already handles the
2227         similar case where malloc() opens /sys/devices/system/cpu/online to
2228         handle this situation as well.
2229
2230         * Shared/linux/SeccompFilters/SeccompBroker.cpp:
2231         (WebKit::SIGSYSHandler):
2232         (WebKit::SeccompBrokerClient::SeccompBrokerClient):
2233         (WebKit::SeccompBrokerClient::~SeccompBrokerClient):
2234         (WebKit::SeccompBrokerClient::handleIfOpeningCachedFile):
2235         (WebKit::SeccompBrokerClient::cacheFile):
2236         (WebKit::SeccompBrokerClient::handleIfOpeningOnlineCPUCount): Deleted.
2237
2238 2015-07-15  ChangSeok Oh  <changseok.oh@collabora.com>
2239
2240         [GTK] Accelerated compositing is enabled by MiniBrowser in Wayland
2241         https://bugs.webkit.org/show_bug.cgi?id=146827
2242
2243         Reviewed by Žan Doberšek.
2244
2245         WebKit2Gtk+ does not currently support accelerated compositing. For the reason,
2246         we forcedly disable it in webkitWebViewBaseCreateWebPage. However, when we launch
2247         MiniBrowser in wayland, the unsupported feature is re-enabled since the existing
2248         setting is overwritten by a newly created one. Here the default value for
2249         accelerated compositing is true. We can fix this by moving the code disabling
2250         accelerated composition to WebPreferences::platformInitializeStore() so that
2251         we make sure the accelerated compositing is always disabled for wayland.
2252
2253         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
2254         (webkitWebViewBaseCreateWebPage): Deleted.
2255         * UIProcess/gtk/WebPreferencesGtk.cpp:
2256         (WebKit::WebPreferences::platformInitializeStore):
2257
2258 2015-07-15  Dan Bernstein  <mitz@apple.com>
2259
2260         Fixed build fix.
2261
2262         * Platform/spi/ios/SafariServicesSPI.h:
2263
2264 2015-07-14  Ryuan Choi  <ryuan.choi@navercorp.com>
2265
2266         [CoordinatedGraphics] Possible wrong rendering with scrolling
2267         https://bugs.webkit.org/show_bug.cgi?id=146958
2268
2269         Reviewed by Gyuyoung Kim.
2270
2271         While r174261 fixing build break, there is some mistake that flushes contents layer
2272         instead of overlay layer.
2273
2274         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
2275         (WebKit::CoordinatedLayerTreeHost::didFlushRootLayer):
2276
2277 2015-07-14  Dan Bernstein  <mitz@apple.com>
2278
2279         Attempted build fixes.
2280
2281         * Platform/spi/ios/SafariServicesSPI.h:
2282
2283 2015-07-14  Dan Bernstein  <mitz@apple.com>
2284
2285         Attempted build fixes.
2286
2287         * Platform/spi/ios/SafariServicesSPI.h:
2288
2289 2015-07-14  Anders Carlsson  <andersca@apple.com>
2290
2291         Remove wkPopupMenu from WebCoreSystemInterface; it's not called from WebCore
2292         https://bugs.webkit.org/show_bug.cgi?id=146945
2293
2294         Reviewed by Tim Horton.
2295
2296         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
2297         (InitWebCoreSystemInterface): Deleted.
2298
2299 2015-07-14  Anders Carlsson  <andersca@apple.com>
2300
2301         Release assert under StyleResolver::loadPendingImages() caused by MemoryPressureHandler
2302         https://bugs.webkit.org/show_bug.cgi?id=146940
2303         rdar://problem/21605505
2304
2305         Reviewed by Sam Weinig.
2306
2307         * WebProcess/WebProcess.cpp:
2308         (WebKit::WebProcess::processWillSuspendImminently):
2309
2310 2015-07-14  Sam Weinig  <sam@webkit.org>
2311
2312         WebKit needs to serialize numeric values in NSError userInfo
2313         <rdar://problem/21818117>
2314         https://bugs.webkit.org/show_bug.cgi?id=146936
2315
2316         Reviewed by Anders Carlsson.
2317
2318         * Shared/mac/WebCoreArgumentCodersMac.mm:
2319         (IPC::ArgumentCoder<ResourceError>::encodePlatformData):
2320         Encode userInfo values that are NSNumbers in addition to NSStrings and NSURLs. Decoding 
2321         is already handled.
2322
2323 2015-07-14  Michael Catanzaro  <mcatanzaro@igalia.com>
2324
2325         [Linux] SeccompFilters: whitelist all NPAPI plugin directories
2326         https://bugs.webkit.org/show_bug.cgi?id=140067
2327
2328         Reviewed by Žan Doberšek.
2329
2330         * PlatformEfl.cmake: Build PluginSearchPath.cpp
2331         * PlatformGTK.cmake: Build PluginSearchPath.cpp
2332         * Shared/Plugins/unix/PluginSearchPath.cpp: Added.
2333         (WebKit::pluginsDirectories): Moved from PluginInfoStoreUnix.cpp.
2334         * Shared/Plugins/unix/PluginSearchPath.h: Added.
2335         * Shared/linux/SeccompFilters/SyscallPolicy.cpp:
2336         (WebKit::SyscallPolicy::addDefaultWebProcessPolicy): Add the entire
2337         plugin search path to the whitelist.
2338         * UIProcess/Plugins/unix/PluginInfoStoreUnix.cpp:
2339         (WebKit::PluginInfoStore::pluginsDirectories): Now gets plugins
2340         directories from PluginSearchPath.cpp
2341
2342 2015-07-14  Yongjun Zhang  <yongjun_zhang@apple.com>
2343
2344         https://bugs.webkit.org/show_bug.cgi?id=146917
2345         iOS WebKit doesn't build.
2346         rdar://problem/21801544
2347
2348         Fix the build - don't use deprecated methods.
2349
2350         Reviewed by Dan Bernstein.
2351
2352         * UIProcess/ios/WKContentViewInteraction.h:
2353         * UIProcess/ios/WKContentViewInteraction.mm:
2354         (-[WKContentView _registerPreviewInWindow:]):
2355         (-[WKContentView _unregisterPreviewInWindow:]):
2356
2357 2015-07-14  Yongjun Zhang  <yongjun_zhang@apple.com>
2358
2359         https://bugs.webkit.org/show_bug.cgi?id=146909
2360         Add actions for default link preview that uses SFSafariViewController.
2361
2362         Use the new private properties to prepare actions for the default link preview controller.
2363
2364         Reviewed by Dan Bernstein.
2365
2366         * UIProcess/ios/WKContentViewInteraction.mm:
2367         (-[WKContentView previewViewControllerForPosition:inSourceView:]):
2368
2369 2015-07-14  Michael Catanzaro  <mcatanzaro@igalia.com>
2370
2371         [Linux] SeccompFilters: whitelist source directory on all ports
2372         https://bugs.webkit.org/show_bug.cgi?id=140066
2373
2374         Reviewed by Žan Doberšek.
2375
2376         Move this from EFL to port-independent code.
2377
2378         * Shared/linux/SeccompFilters/SyscallPolicy.cpp:
2379         (WebKit::SyscallPolicy::addDefaultWebProcessPolicy):
2380         * WebProcess/efl/SeccompFiltersWebProcessEfl.cpp:
2381         (WebKit::SeccompFiltersWebProcessEfl::platformInitialize):
2382
2383 2015-07-14  Zan Dobersek  <zdobersek@igalia.com>
2384
2385         [GTK] Add a runtime check for X11 display in webkitWebViewBaseExitAcceleratedCompositingMode()
2386         https://bugs.webkit.org/show_bug.cgi?id=146711
2387
2388         Reviewed by Carlos Garcia Campos.
2389
2390         webkitWebViewBaseExitAcceleratedCompositingMode() is already guarded with
2391         X11 build guards, but it should also do a runtime check that the program
2392         is running under an X11 display before proceeding.
2393
2394         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
2395         (webkitWebViewBaseDidRelaunchWebProcess):
2396
2397 2015-07-13  Matt Rajca  <mrajca@apple.com>
2398
2399         Media Session: add plumbing for delivering start/end-of-interruption events
2400         https://bugs.webkit.org/show_bug.cgi?id=146837
2401
2402         Reviewed by Tim Horton.
2403
2404         * UIProcess/API/C/WKPage.cpp:
2405         (WKPageHandleMediaSessionInterruptionEvent):
2406         * UIProcess/API/C/WKPagePrivate.h:
2407         * UIProcess/WebPageProxy.cpp:
2408         (WebKit::WebPageProxy::handleMediaSessionInterruptionEvent):
2409         * UIProcess/WebPageProxy.h:
2410         * WebProcess/WebPage/WebPage.cpp:
2411         (WebKit::WebPage::handleMediaSessionInterruptionEvent):
2412         * WebProcess/WebPage/WebPage.h:
2413         * WebProcess/WebPage/WebPage.messages.in:
2414
2415 2015-07-13  Simon Fraser  <simon.fraser@apple.com>
2416
2417         [iOS WK2] When choosing an initial viewport scale, take overflow on the <body> into account
2418         https://bugs.webkit.org/show_bug.cgi?id=146918
2419         rdar://problem/9222837
2420
2421         Reviewed by Tim Horton.
2422
2423         Use as input to the viewport scaling algorithm a contents size from the FrameView
2424         that takes overflow on the viewport renderer into account. This prevents unexpected
2425         viewports scaling on pages that have content that overflows their expressed contents size,
2426         but apply overflow to the <body>.
2427
2428         * WebProcess/WebPage/WebPage.cpp:
2429         (WebKit::WebPage::mainFrameDidLayout): Use contentsSizeRespectingOverflow(),
2430         rather than raw contentsSize(), to determine scaling.
2431
2432 2015-07-13  Dan Bernstein  <mitz@apple.com>
2433
2434         Fixed the build.
2435
2436         * UIProcess/ios/WKContentViewInteraction.mm:
2437         (-[WKContentView _registerPreviewInWindow:]):
2438         (-[WKContentView _unregisterPreviewInWindow:]):
2439
2440 2015-07-13  Dan Bernstein  <mitz@apple.com>
2441
2442         Removed now-unused SPI -[WKWebView _loadRequest:withOptions:].
2443
2444         Rubber-stamped by Anders Carlsson.
2445
2446         * UIProcess/API/Cocoa/WKWebView.mm:
2447         (-[WKWebView _loadRequest:withOptions:]): Deleted.
2448         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2449
2450 2015-07-13  Anders Carlsson  <andersca@apple.com>
2451
2452         Apps linked with a deployment target of iOS 7.x or earlier crash when using modern WebKit API
2453         https://bugs.webkit.org/show_bug.cgi?id=146913
2454         rdar://problem/21789252
2455
2456         Reviewed by Dan Bernstein.
2457
2458         Make a top-level symlink from /System/Library/PrivateFrameworks/WebKit.framework to
2459         /System/Library/Frameworks/WebKit.framework.
2460
2461         * WebKit2.xcodeproj/project.pbxproj:
2462
2463 2015-07-13  Anders Carlsson  <andersca@apple.com>
2464
2465         Silverlight causes tabs to hang
2466         https://bugs.webkit.org/show_bug.cgi?id=146912
2467         rdar://problem/21686508
2468
2469         Reviewed by Sam Weinig.
2470
2471         Make sure to link production builds of the legacy plug-in process against the shim on 10.11 and newer.
2472
2473         * Configurations/PluginProcess.xcconfig:
2474
2475 2015-07-13  Michael Catanzaro  <mcatanzaro@igalia.com>
2476
2477         [Linux] SeccompFilters: handle alternate install prefixes
2478         https://bugs.webkit.org/show_bug.cgi?id=140065
2479
2480         Reviewed by Žan Doberšek.
2481
2482         If the install prefix is something other than /usr, e.g. /usr/local or
2483         ~/jhbuild/install, then we want to make sure to allow libraries and data
2484         from that prefix.
2485
2486         * PlatformEfl.cmake:
2487         * Shared/linux/SeccompFilters/SyscallPolicy.cpp:
2488         (WebKit::SyscallPolicy::addDefaultWebProcessPolicy):
2489
2490 2015-07-13  Carlos Garcia Campos  <cgarcia@igalia.com>
2491
2492         [GTK] Contents not correctly laid out when the web view is not realized
2493         https://bugs.webkit.org/show_bug.cgi?id=142532
2494
2495         Reviewed by Darin Adler.
2496
2497         The problem is that we are not reporting any size until the web
2498         view is realized, so any web view loaded in a separate tab in the
2499         browser, will report 0x0 as the window.innerWidth,
2500         window.innerHeight until the view is realized. Websites that use
2501         the window.innerWidth/innerHeight during the page load to decide
2502         how to lay out the contents will be rendered wrongly.
2503         I haven't been able to reproduce this with unit tests, as this
2504         requires the particular case of same window but different web
2505         views using tabs for example.
2506
2507         * UIProcess/API/gtk/PageClientImpl.cpp:
2508         (WebKit::PageClientImpl::viewSize): Always report the drawing area
2509         size to make usre it's in sync with the WebProcess page size.
2510         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
2511         (webkitWebViewBaseSizeAllocate): Remove the optimization of only
2512         report the size when it has changed, since both the redirected
2513         window and the drawing area already do that check. Also remove the
2514         optimization of waiting until the view is mapped to report its
2515         size, since that's often too late for websites using the window
2516         size during load.
2517         (webkitWebViewBaseMap): Never report size on map, it should have
2518         already been reported by size-allocate.
2519
2520 2015-07-11  Nikita Vasilyev  <nvasilyev@apple.com>
2521
2522         Web Inspector: Inspector should be able to be docked to the bottom of a narrow window
2523         https://bugs.webkit.org/show_bug.cgi?id=146871
2524
2525         Reviewed by Timothy Hatcher.
2526
2527         * UIProcess/WebInspectorProxy.cpp:
2528         * UIProcess/mac/WebInspectorProxyMac.mm:
2529         (WebKit::WebInspectorProxy::platformCanAttach):
2530         * WebProcess/WebPage/WebInspector.cpp:
2531
2532 2015-07-11  Joseph Pecoraro  <pecoraro@apple.com>
2533
2534         Allow clients to opt-out of default app link link actions
2535         https://bugs.webkit.org/show_bug.cgi?id=146883
2536         <rdar://problem/21221902>
2537
2538         Reviewed by Dan Bernstein.
2539
2540         * UIProcess/API/APIUIClient.h:
2541         (API::UIClient::shouldIncludeAppLinkActionsForElement):
2542         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
2543         * UIProcess/Cocoa/UIDelegate.h:
2544         * UIProcess/Cocoa/UIDelegate.mm:
2545         (WebKit::UIDelegate::setDelegate):
2546         (WebKit::UIDelegate::UIClient::shouldIncludeAppLinkActionsForElement):
2547         Plumbing for a new delegate message to ask the client if they
2548         would like app link actions or not. Default is yes.
2549
2550         * UIProcess/ios/WKActionSheetAssistant.h:
2551         * UIProcess/ios/WKActionSheetAssistant.mm:
2552         (-[WKActionSheetAssistant showImageSheet]):
2553         (-[WKActionSheetAssistant showLinkSheet]):
2554         (-[WKActionSheetAssistant defaultActionsForLinkSheet:]):
2555         (-[WKActionSheetAssistant defaultActionsForImageSheet:]):
2556         Pass elementInfo into methods generating default actions.
2557         
2558         (-[WKActionSheetAssistant _appendOpenActionsForURL:actions:elementInfo:]):
2559         When generating open actions, if the process has AppLink capabilities
2560         ask the client if they want to include AppLink actions or fall back
2561         to the basic Open action.
2562
2563         * UIProcess/ios/WKContentViewInteraction.mm:
2564         (-[WKContentView actionSheetAssistant:shouldIncludeAppLinkActionsForElement:]):
2565         (-[WKContentView previewViewControllerForPosition:inSourceView:]):
2566         * UIProcess/ios/WKPDFView.mm:
2567         (-[WKPDFView actionSheetAssistant:shouldIncludeAppLinkActionsForElement:]):
2568         Assistant delegate implementations forward to the UIDelegate.
2569
2570 2015-07-11  Joseph Pecoraro  <pecoraro@apple.com>
2571
2572         Update default link action sheets for app links
2573         https://bugs.webkit.org/show_bug.cgi?id=146658
2574         <rdar://problem/21221902>
2575
2576         Reviewed by Dan Bernstein.
2577
2578         * Shared/mac/SandboxUtilities.h:
2579         * Shared/mac/SandboxUtilities.mm: Renamed from Source/WebKit2/Shared/mac/SandboxUtilities.cpp.
2580         (WebKit::processHasEntitlement):
2581         * UIProcess/ApplicationStateTracker.mm:
2582         (WebKit::applicationType):
2583         (WebKit::hasEntitlement): Deleted.
2584         * WebKit2.xcodeproj/project.pbxproj:
2585         Share a helper for checking if the current process has an entitlement.
2586
2587         * UIProcess/API/Cocoa/_WKElementAction.h:
2588         * UIProcess/API/Cocoa/_WKElementAction.mm:
2589         (+[_WKElementAction _elementActionWithType:title:actionHandler:]):
2590         (+[_WKElementAction _elementActionWithType:customTitle:assistant:]):
2591         * UIProcess/API/Cocoa/_WKElementActionInternal.h:
2592         Add an internal way to make an element action with a standard type and regular handler.
2593         We use this for the new standard types that don't have a default implementation.
2594
2595         * UIProcess/ios/WKActionSheetAssistant.mm:
2596         (applicationHasAppLinkEntitlements):
2597         (appLinkForURL):
2598         Helpers checking access to app links and fetching app links.
2599
2600         (-[WKActionSheetAssistant _appendOpenActionsForURL:actions:]):
2601         (-[WKActionSheetAssistant defaultActionsForLinkSheet]):
2602         (-[WKActionSheetAssistant defaultActionsForImageSheet]):
2603         Create "Open in Safari" and "Open in 'App'" default actions for AppLinks,
2604         otherwise add the normal default "Open" action.
2605
2606 2015-07-11  Enrica Casucci  <enrica@apple.com>
2607
2608         Remove incorrect overriding of inputAssistantItem in WKContentView.
2609         https://bugs.webkit.org/show_bug.cgi?id=146863
2610         rdar://problem/21507154
2611
2612         Reviewed by Sam Weinig.
2613
2614         Correction to the patch in r186713.
2615         We need to provide the inputAssistantItem from the responder.
2616
2617         * UIProcess/ios/WKContentViewInteraction.mm:
2618         (-[WKContentView inputAccessoryView]):
2619
2620 2015-07-11  Commit Queue  <commit-queue@webkit.org>
2621
2622         Unreviewed, rolling out r186689 and r186710.
2623         https://bugs.webkit.org/show_bug.cgi?id=146880
2624
2625         May have caused a PLT regression and broken a layout test
2626         (Requested by cdumez on #webkit).
2627
2628         Reverted changesets:
2629
2630         "[WK2] Increase the QoS of some of our WorkQueues to match the
2631         one of our processes"
2632         https://bugs.webkit.org/show_bug.cgi?id=146855
2633         http://trac.webkit.org/changeset/186689
2634
2635         "REGRESSION (r186689?): fast/frames/frame-limit.html timeout
2636         on Mavericks {Release,Debug} WK2 bots"
2637         https://bugs.webkit.org/show_bug.cgi?id=146876
2638         http://trac.webkit.org/changeset/186710
2639
2640 2015-07-10  Enrica Casucci  <enrica@apple.com>
2641
2642         Remove incorrect overriding of inputAssistantItem in WKContentView.
2643         https://bugs.webkit.org/show_bug.cgi?id=146863
2644         rdar://problem/21507154
2645
2646         Reviewed by Dan Bernstein.
2647
2648         Removing implementation of inputAssistantItem and moving initialization
2649         of formAccessoryView to inputAccessoryView to avoid interfering with
2650         the keyboard handling of the assistant bar.
2651
2652         * UIProcess/ios/WKContentViewInteraction.mm:
2653         (-[WKContentView inputAccessoryView]):
2654         (-[WKContentView inputAssistantItem]): Deleted.
2655         (-[WKContentView _inputAssistantItem]): Deleted.
2656
2657 2015-07-10  Simon Fraser  <simon.fraser@apple.com>
2658
2659         [iOS WK2] Scrolling issues on horizontally scrollable RTL pages
2660         https://bugs.webkit.org/show_bug.cgi?id=146872
2661         rdar://problem/7569416
2662
2663         Reviewed by Sam Weinig.
2664
2665         Horizontally scrollable RTL pages in WebKit2 had a variety of issues: they had
2666         a gap down the right edge, and unreachable content on the left side, focussing
2667         form fields scrolled to the wrong location, and programmatic scrolls scrolled
2668         to the wrong place.
2669         
2670         Fix by plumbing the WebCore notion of scrollOrigin through to the UI process,
2671         and using it in various places. There are three main aspects to the patch:
2672         
2673         1. scroll origin is included in RemoteLayerTreeTransaction, and plumbed through
2674            to -[WKWebView _scrollToContentOffset:] for correct programmatic scrolling,
2675            including zooming to focused form elements. The WKContentView's boundsOrigin
2676            is set to the scroll origin so that the view coordinates match document coordinates.
2677         2. WebPageProxy::computeCustomFixedPositionRect() uses the actual documentRect()
2678            rather than just conjuring up a rect with a zero origin, which makes position:fixed
2679            work correctly.
2680         3. _interactionViewsContainerView (which hosts tap highlights) is positioned to 
2681            coincide with the origin of the documentRect (i.e. at the scroll origin, which
2682            may not be top-left). This allows tap highlights to show in the correct location.
2683         4. ScrollView::unobscuredContentRect() is fixed to take scroll origin into account;
2684            if the returned rect is wrong, RenderLayer::hitTest() incorrectly clips the hit
2685            testing area.
2686
2687         * Shared/mac/RemoteLayerTreeTransaction.h:
2688         (WebKit::RemoteLayerTreeTransaction::scrollOrigin):
2689         (WebKit::RemoteLayerTreeTransaction::setScrollOrigin):
2690         * Shared/mac/RemoteLayerTreeTransaction.mm:
2691         (WebKit::RemoteLayerTreeTransaction::encode):
2692         (WebKit::RemoteLayerTreeTransaction::decode):
2693         (WebKit::RemoteLayerTreeTransaction::description): Dump some more info.
2694         * UIProcess/API/Cocoa/WKWebView.mm:
2695         (-[WKWebView _scrollToContentOffset:scrollOrigin:]):
2696         (-[WKWebView _scrollToContentOffset:]): Deleted.
2697         * UIProcess/API/Cocoa/WKWebViewInternal.h:
2698         * UIProcess/API/gtk/PageClientImpl.cpp:
2699         (WebKit::PageClientImpl::requestScroll):
2700         * UIProcess/API/gtk/PageClientImpl.h:
2701         * UIProcess/CoordinatedGraphics/WebView.cpp:
2702         (WebKit::WebView::requestScroll):
2703         * UIProcess/CoordinatedGraphics/WebView.h:
2704         * UIProcess/PageClient.h:
2705         * UIProcess/WebPageProxy.cpp:
2706         (WebKit::WebPageProxy::requestScroll):
2707         * UIProcess/WebPageProxy.h:
2708         * UIProcess/ios/PageClientImplIOS.h:
2709         * UIProcess/ios/PageClientImplIOS.mm:
2710         (WebKit::PageClientImpl::requestScroll):
2711         (WebKit::PageClientImpl::documentRect):
2712         (WebKit::PageClientImpl::contentsSize): Deleted.
2713         * UIProcess/ios/WKContentView.mm:
2714         (-[WKContentView _didCommitLayerTree:]):
2715         * UIProcess/ios/WebPageProxyIOS.mm:
2716         (WebKit::WebPageProxy::computeCustomFixedPositionRect):
2717         * UIProcess/mac/PageClientImpl.h:
2718         * UIProcess/mac/PageClientImpl.mm:
2719         (WebKit::PageClientImpl::requestScroll):
2720         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
2721         (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
2722         * WebProcess/WebPage/WebPage.cpp:
2723         (WebKit::WebPage::willCommitLayerTree):
2724
2725 2015-07-10  Chris Dumez  <cdumez@apple.com>
2726
2727         [WK2] Diagnostic logging messages are causing too much IPC
2728         https://bugs.webkit.org/show_bug.cgi?id=146873
2729         <rdar://problem/21779205>
2730
2731         Reviewed by Ryosuke Niwa.
2732
2733         Diagnostic logging messages are causing too much IPC. To address the
2734         problem, we now do the sampling of the senders' side (WebContent
2735         process and Networking process) instead of the receiver's side
2736         (UIProcess).
2737
2738         * NetworkProcess/NetworkProcess.cpp:
2739         (WebKit::NetworkProcess::logDiagnosticMessage):
2740         (WebKit::NetworkProcess::logDiagnosticMessageWithResult):
2741         (WebKit::NetworkProcess::logDiagnosticMessageWithValue):
2742         * UIProcess/Network/NetworkProcessProxy.cpp:
2743         (WebKit::NetworkProcessProxy::logSampledDiagnosticMessage):
2744         (WebKit::NetworkProcessProxy::logSampledDiagnosticMessageWithResult):
2745         (WebKit::NetworkProcessProxy::logSampledDiagnosticMessageWithValue):
2746         * UIProcess/Network/NetworkProcessProxy.h:
2747         * UIProcess/Network/NetworkProcessProxy.messages.in:
2748         * UIProcess/WebPageProxy.cpp:
2749         (WebKit::WebPageProxy::logDiagnosticMessage):
2750         (WebKit::WebPageProxy::logDiagnosticMessageWithResult):
2751         (WebKit::WebPageProxy::logDiagnosticMessageWithValue):
2752         (WebKit::WebPageProxy::logSampledDiagnosticMessage):
2753         (WebKit::WebPageProxy::logSampledDiagnosticMessageWithResult):
2754         (WebKit::WebPageProxy::logSampledDiagnosticMessageWithValue):
2755         * UIProcess/WebPageProxy.h:
2756         * UIProcess/WebPageProxy.messages.in:
2757         * WebProcess/WebCoreSupport/WebDiagnosticLoggingClient.cpp:
2758         (WebKit::WebDiagnosticLoggingClient::logDiagnosticMessage):
2759         (WebKit::WebDiagnosticLoggingClient::logDiagnosticMessageWithResult):
2760         (WebKit::WebDiagnosticLoggingClient::logDiagnosticMessageWithValue):
2761
2762 2015-07-10  Dean Jackson  <dino@apple.com>
2763
2764         Airplay button and placeholder are missing in inline controls
2765         https://bugs.webkit.org/show_bug.cgi?id=146869
2766         <rdar://problem/21555051>
2767
2768         Reviewed by Simon Fraser.
2769
2770         Fix a typo in the ENABLE that was causing the Airplay
2771         setting (allowsAirPlayForMediaPlayback, which becomes
2772         webkitWirelessVideoPlaybackDisabled) to default to false.
2773
2774         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
2775         (-[WKWebViewConfiguration init]): Change WIRELESS_TARGET_PLAYBACK
2776         to WIRELESS_PLAYBACK_TARGET.
2777
2778 2015-07-10  Tim Horton  <timothy_horton@apple.com>
2779
2780         Use CoreAnimation fences instead of synchronous IPC to synchronize resize
2781         https://bugs.webkit.org/show_bug.cgi?id=146294
2782         <rdar://problem/21090193>
2783
2784         Reviewed by Anders Carlsson.
2785
2786         * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm:
2787         (WebKit::TiledCoreAnimationDrawingAreaProxy::createFenceForGeometryUpdate):
2788         Tiny followup; don't touch Connection if the connection isn't valid.
2789
2790 2015-07-10  Chris Dumez  <cdumez@apple.com>
2791
2792         [WK2] Increase the QoS of some of our WorkQueues to match the one of our processes
2793         https://bugs.webkit.org/show_bug.cgi?id=146855
2794
2795         Reviewed by Anders Carlsson.
2796
2797         Increase the QoS of some of our WorkQueues to match the one of our processes. For
2798         e.g., even though the WebContent and the Networking processes have USER_UNITIATED
2799         QoS, the IPC between them is using a WorkQueue with DEFAULT QoS. Similarly, the
2800         WorkQueue used for network cache reads has DEFAULT QoS.
2801
2802         * NetworkProcess/cache/NetworkCacheStorage.cpp:
2803         (WebKit::NetworkCache::Storage::Storage):
2804         * Platform/IPC/Connection.cpp:
2805         (IPC::Connection::Connection):
2806
2807 2015-07-10  Zalan Bujtas  <zalan@apple.com>
2808
2809         Crash at WebCore::WebPage::innerFrameQuad.
2810         https://bugs.webkit.org/show_bug.cgi?id=146843
2811         rdar://problem/21501819
2812
2813         Reviewed by Andreas Kling.
2814
2815         We may end up with a null rootEditableElement() after calling Document::updateLayout().
2816
2817         Speculative fix. Not reproducible.
2818
2819         * WebProcess/WebPage/WebPage.h: Some const cleanup.
2820         * WebProcess/WebPage/ios/WebPageIOS.mm:
2821         (WebKit::innerFrameQuad): null check assistedNode.rootEditableElement()
2822         (WebKit::constrainPoint):
2823         (WebKit::WebPage::selectWithGesture):
2824         (WebKit::WebPage::visiblePositionInFocusedNodeForPoint):
2825         (WebKit::WebPage::selectPositionAtPoint):
2826         (WebKit::WebPage::selectPositionAtBoundaryWithDirection):
2827         (WebKit::WebPage::selectTextWithGranularityAtPoint):
2828         (WebKit::WebPage::updateSelectionWithExtentPoint):
2829         (WebKit::WebPage::getPositionInformation):
2830
2831 2015-07-09  Jon Honeycutt  <jhoneycutt@apple.com>
2832
2833         [iOS] Document picker has overlapping icons on iPad
2834         https://bugs.webkit.org/show_bug.cgi?id=146808
2835         <rdar://problem/21251875>
2836
2837         Reviewed by Sam Weinig.
2838
2839         * UIProcess/ios/forms/WKFileUploadPanel.mm:
2840         (-[WKFileUploadPanel documentMenu:didPickDocumentPicker:]):
2841         Don't show this UI as a popover on iPad; the default is a full screen
2842         form sheet.
2843
2844 2015-07-09  Dan Bernstein  <mitz@apple.com>
2845
2846         WebKit2 part of Track and expose policies for external URL schemes and App Links separately
2847         https://bugs.webkit.org/show_bug.cgi?id=146822
2848
2849         Reviewed by Anders Carlsson.
2850
2851         * Shared/NavigationActionData.cpp:
2852         (WebKit::NavigationActionData::encode):
2853         (WebKit::NavigationActionData::decode):
2854         * Shared/NavigationActionData.h:
2855           Replaced the shouldOpenExternalURLsPolicy boolean member with a
2856           shouldOpenExternalURLsPolicy member whose type is ShouldOpenExternalURLsPolicy, and
2857           updated encoding and decoding:
2858
2859         * UIProcess/API/APINavigationAction.h:
2860           Added shouldOpenAppLinks boolean to NavigationAction::create and the constructor. It
2861           augments the policy in the NavigationActionData with a valude decided in the UI process.
2862           Replaced shouldOpenExternalURLs() with shouldOpenExternalSchemes() and
2863           shouldOpenAppLinks() which check the policy and the new m_shouldOpenAppLinks boolean.
2864
2865         * UIProcess/API/Cocoa/WKNavigationAction.mm:
2866         (-[WKNavigationAction _shouldOpenExternalSchemes]): Getter for new property, calls through
2867           to the NavigationAction.
2868         (-[WKNavigationAction _shouldOpenAppLinks]): Ditto.
2869         (-[WKNavigationAction _shouldOpenExternalURLs]): Now deprecated and returns the
2870           _shouldOpenExternalSchemes value.
2871         * UIProcess/API/Cocoa/WKNavigationActionPrivate.h: Declared new properties for the two
2872           policies and deprecated old property.
2873
2874         * UIProcess/Cocoa/NavigationState.mm:
2875         (WebKit::tryAppLink): Changed to use NavigationAction::shouldOpenAppLinks, which
2876           encapsulates logic that used to be here.
2877
2878         * UIProcess/Cocoa/UIDelegate.mm:
2879         (WebKit::UIDelegate::UIClient::createNewPage): Allow App Links (if already allowed by policy).
2880
2881         * UIProcess/WebPageProxy.cpp:
2882         (WebKit::WebPageProxy::decidePolicyForNavigationAction): Moved logic from tryAppLink in
2883           NavigationState.mm here and pass the result to NavigationAction::create.
2884         (WebKit::WebPageProxy::decidePolicyForNewWindowAction): Allow App Links (if already allowed
2885           by policy).
2886         * UIProcess/WebPageProxy.h:
2887         (WebKit::WebPageProxy::loadRequest): Changed the default policy to not allow App Links (but
2888           still allow external schemes).
2889
2890         * WebProcess/InjectedBundle/API/c/WKBundleNavigationAction.cpp:
2891         (WKBundleNavigationActionGetShouldTryAppLinks): Added this getter.
2892         * WebProcess/InjectedBundle/API/c/WKBundleNavigationActionPrivate.h:
2893
2894         * WebProcess/InjectedBundle/InjectedBundleNavigationAction.cpp:
2895         (WebKit::InjectedBundleNavigationAction::InjectedBundleNavigationAction):
2896         * WebProcess/InjectedBundle/InjectedBundleNavigationAction.h:
2897           Added m_shouldTryAppLinks boolean member, initialized from the policy. Updated the
2898           initialization of m_shouldOpenExternalURLs to account for the new policy.
2899
2900         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2901         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction): Pass the policy
2902           in the navigation data.
2903
2904 2015-07-09  Tim Horton  <timothy_horton@apple.com>
2905
2906         Use CoreAnimation fences instead of synchronous IPC to synchronize resize
2907         https://bugs.webkit.org/show_bug.cgi?id=146294
2908         <rdar://problem/21090193>
2909
2910         Reviewed by Anders Carlsson.
2911
2912         Because of changes in underlying frameworks, we can no longer depend on
2913         blocking the UI process main thread to be sufficient to synchronize
2914         UI process CA commits with commits coming from the Web process.
2915
2916         Instead, we have to use CoreAnimation fences to perform this synchronization.
2917         Instead of blocking inside waitForAndDispatchImmediately, we'll end up
2918         blocking during the CA commit.
2919
2920         * Platform/mac/LayerHostingContext.mm:
2921         Use HAVE(COREANIMATION_FENCES).
2922
2923         * Platform/IPC/Connection.cpp:
2924         (IPC::Connection::Connection):
2925         (IPC::Connection::processIncomingMessage):
2926         (IPC::Connection::installIncomingSyncMessageCallback):
2927         (IPC::Connection::uninstallIncomingSyncMessageCallback):
2928         Keep track of a set of incoming sync message callbacks, and fire them
2929         (on another queue) when a sync message arrives.
2930
2931         (IPC::Connection::hasIncomingSyncMessage):
2932         * Platform/IPC/Connection.h:
2933         Add a way to check if there are any sync messages in the queue.
2934
2935         * UIProcess/API/mac/WKView.mm:
2936         (-[WKView forceAsyncDrawingAreaSizeUpdate:]):
2937         (-[WKView waitForAsyncDrawingAreaSizeUpdate]):
2938         These are no longer used; do nothing on 10.10+.
2939
2940         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
2941         (WebKit::RemoteLayerTreeDrawingAreaProxy::sendUpdateGeometry):
2942         * WebProcess/WebPage/DrawingArea.h:
2943         (WebKit::DrawingArea::updateGeometry):
2944         * WebProcess/WebPage/DrawingArea.messages.in:
2945         * WebProcess/WebPage/WebPage.cpp:
2946         (WebKit::WebPage::scaleViewAndUpdateGeometryFenced):
2947         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
2948         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
2949         (WebKit::RemoteLayerTreeDrawingArea::updateGeometry):
2950         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
2951         Add a MachSendRight parameter to UpdateGeometry, so that we can send along
2952         a fence port with the geometry update if needed.
2953
2954         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
2955         (WebKit::TiledCoreAnimationDrawingArea::updateGeometry):
2956         Apply the incoming fence so that geometry changes will be synchronized between processes.
2957
2958         * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm:
2959         (WebKit::TiledCoreAnimationDrawingAreaProxy::waitForPossibleGeometryUpdate):
2960         Don't wait for DidUpdateGeometry to come in if we're using fences to achieve the same thing.
2961
2962         (WebKit::TiledCoreAnimationDrawingAreaProxy::sendUpdateGeometry):
2963         Create and block us on a fence and send it along with the geometry update.
2964         If a sync message is in the incoming message queue, don't create the fence;
2965         if a sync message comes in at any point after we've installed the fence (but
2966         before the relevant commit completes), invalidate the fence, so that we won't
2967         end up temorarily deadlocked waiting for the fence timeout.
2968
2969 2015-07-09  Michael Catanzaro  <mcatanzaro@igalia.com>
2970
2971         [GTK] Crash when spell checker returns no guesses
2972         https://bugs.webkit.org/show_bug.cgi?id=146805
2973
2974         Reviewed by Martin Robinson.
2975
2976         Properly handle ContextMenuItemTagNoGuessesFound in the switch statement.
2977
2978         * UIProcess/API/gtk/WebKitContextMenuActions.cpp:
2979         (webkitContextMenuActionGetForContextMenuItem):
2980
2981 2015-07-09  Alex Christensen  <achristensen@webkit.org>
2982
2983         [Content Extensions] Add 3 byte jump size.
2984         https://bugs.webkit.org/show_bug.cgi?id=146425
2985
2986         Reviewed by Darin Adler.
2987
2988         * UIProcess/API/APIUserContentExtensionStore.h:
2989         Increment CurrentContentExtensionFileVersion because of change in the bytecode.
2990
2991 2015-07-09  Anders Carlsson  <andersca@apple.com>
2992
2993         SafariViewController loads partial webpage or entirely blank webpage
2994         https://bugs.webkit.org/show_bug.cgi?id=146815
2995         rdar://problem/21734757
2996
2997         Reviewed by Dan Bernstein.
2998
2999         * Platform/spi/ios/UIKitSPI.h:
3000         Add _hostProcessIdentifier getter.
3001
3002         * UIProcess/ApplicationStateTracker.h:
3003         Change ApplicationStateTracker to hold on to a WKContentView instead of a UIView.
3004
3005         * UIProcess/ApplicationStateTracker.mm:
3006         (WebKit::applicationType):
3007         Add a helper function that returns the type of application the web view is hosted by (regular
3008         application, view service or extension).
3009
3010         (WebKit::ApplicationStateTracker::ApplicationStateTracker):
3011         Register notifications and update m_isInBackground. For regular applications, just listen for UIApplication notifications.
3012         For view services, walk the view controller hierarchy and find the service view controller and listen for notifications and use
3013         BKS to find the background state of the host application. For extensions, just use BKSApplicationStateMonitor directly.
3014
3015         (WebKit::isViewService): Deleted.
3016
3017         * UIProcess/ios/WKContentView.mm:
3018         (-[WKContentView willMoveToWindow:]):
3019         If we're moving out of a window, null out the state tracker.
3020
3021         (-[WKContentView didMoveToWindow]):
3022         If we moved to a window, create a new state tracker.
3023
3024         (-[WKContentView isBackground]):
3025         Handle a null application state.
3026
3027         (-[WKContentView _commonInitializationWithProcessPool:configuration:]): Deleted.
3028         Don't create the application state here.
3029
3030 2015-07-09  Dan Bernstein  <mitz@apple.com>
3031
3032         [Cocoa] Report the first paint after committing a load as a rendering progress event
3033         https://bugs.webkit.org/show_bug.cgi?id=146765
3034
3035         Reviewed by Tim Horton.
3036
3037         * Shared/API/Cocoa/_WKRenderingProgressEvents.h: Added _WKRenderingProgressEventFirstPaint.
3038
3039         * UIProcess/API/Cocoa/WKWebView.mm:
3040         (-[WKWebView _didCommitLayerTree:]): If this is the first layer tree commit since the load
3041         was committed, and the delegate is observing _WKRenderingProgressEventFirstPaint, call
3042         NavigationState::didFirstPaint.
3043
3044         * UIProcess/Cocoa/NavigationState.h:
3045         * UIProcess/Cocoa/NavigationState.mm:
3046         (WebKit::NavigationState::didFirstPaint): Added. Calls -_webView:renderingProgressDidChange:
3047         with _WKRenderingProgressEventFirstPaint.
3048
3049 2015-07-08  Jinwoo Song  <jinwoo7.song@samsung.com>
3050
3051         [EFL] When closing inspector window, EwkView is not released properly.
3052         https://bugs.webkit.org/show_bug.cgi?id=146716
3053
3054         Reviewed by Gyuyoung Kim.
3055
3056         It's because inspector window could not be deleted by remaining reference
3057         from inspector view(evas object). This patch deletes the inspector window
3058         after finishing the evas object smart call.
3059
3060         * UIProcess/efl/WebInspectorProxyEfl.cpp:
3061         (WebKit::destroyInspectorWindow):
3062         (WebKit::WebInspectorProxy::platformDidClose):
3063
3064 2015-07-08  Hyungwook Lee  <hyungwook.lee@navercorp.com>
3065
3066         Fix ASSERTION FAILED: !m_pendingNavigationID in WebPage::reload().
3067         https://bugs.webkit.org/show_bug.cgi?id=146546
3068
3069         Reviewed by Darin Adler.
3070
3071         We did't reset pendingNavigationID value when request url is empty.
3072         Hence we need to ignore ASSERT check in this case.
3073
3074         * WebProcess/WebPage/WebPage.cpp:
3075         (WebKit::WebPage::reload):
3076
3077 2015-07-08  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
3078
3079         Use Ref/RefPtr instead of PassRefPtr in WebKit2 - 2
3080         https://bugs.webkit.org/show_bug.cgi?id=146591
3081
3082         Reviewed by Darin Adler.
3083
3084         Following patch in order to reduce use of PassRefPtr.
3085
3086         * Shared/BlobDataFileReferenceWithSandboxExtension.h:
3087         * Shared/Cocoa/CompletionHandlerCallChecker.h:
3088         * Shared/Cocoa/CompletionHandlerCallChecker.mm:
3089         (WebKit::CompletionHandlerCallChecker::create):
3090         * Shared/Downloads/DownloadAuthenticationClient.h:
3091         (WebKit::DownloadAuthenticationClient::create):
3092         * Shared/SandboxExtension.h:
3093         * Shared/ShareableResource.cpp:
3094         (WebKit::ShareableResource::create):
3095         * Shared/ShareableResource.h:
3096         * Shared/mac/ObjCObjectGraph.h:
3097         (WebKit::ObjCObjectGraph::create):
3098         * Shared/mac/SandboxExtensionMac.mm:
3099         (WebKit::SandboxExtension::create):
3100         * UIProcess/API/Cocoa/WKProcessGroup.mm:
3101         (getInjectedBundleInitializationUserData):
3102         * UIProcess/WebPreferences.cpp:
3103         (WebKit::WebPreferences::create):
3104         * UIProcess/WebPreferences.h:
3105         * WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.cpp:
3106         (WKBundlePageOverlayCreate):
3107         * WebProcess/InjectedBundle/API/c/mac/WKBundlePageBannerMac.mm:
3108         (WKBundlePageBannerCreateBannerWithCALayer):
3109         * WebProcess/InjectedBundle/InjectedBundleDOMWindowExtension.cpp:
3110         (WebKit::InjectedBundleDOMWindowExtension::create):
3111         * WebProcess/InjectedBundle/InjectedBundleDOMWindowExtension.h:
3112         * WebProcess/InjectedBundle/InjectedBundleHitTestResult.cpp:
3113         (WebKit::InjectedBundleHitTestResult::create):
3114         * WebProcess/InjectedBundle/InjectedBundleHitTestResult.h:
3115         * WebProcess/InjectedBundle/InjectedBundleNavigationAction.cpp:
3116         (WebKit::InjectedBundleNavigationAction::create):
3117         * WebProcess/InjectedBundle/InjectedBundleNavigationAction.h:
3118         * WebProcess/InjectedBundle/InjectedBundlePageContextMenuClient.cpp:
3119         (WebKit::InjectedBundlePageContextMenuClient::getCustomMenuFromDefaultItems):
3120         (WebKit::InjectedBundlePageContextMenuClient::prepareForImmediateAction):
3121         * WebProcess/InjectedBundle/InjectedBundleScriptWorld.cpp:
3122         (WebKit::InjectedBundleScriptWorld::create):
3123         * WebProcess/InjectedBundle/InjectedBundleScriptWorld.h:
3124         * WebProcess/Network/NetworkProcessConnection.h:
3125         (WebKit::NetworkProcessConnection::create):
3126         * WebProcess/Network/WebResourceLoader.cpp:
3127         (WebKit::WebResourceLoader::create):
3128         * WebProcess/Network/WebResourceLoader.h:
3129         * WebProcess/Notifications/NotificationPermissionRequestManager.cpp:
3130         (WebKit::NotificationPermissionRequestManager::create):
3131         * WebProcess/Notifications/NotificationPermissionRequestManager.h:
3132         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
3133         (WebKit::NetscapePlugin::create):
3134         * WebProcess/Plugins/Netscape/NetscapePlugin.h:
3135         * WebProcess/Plugins/Netscape/NetscapePluginStream.h:
3136         (WebKit::NetscapePluginStream::create):
3137         * WebProcess/Plugins/PDF/PDFPlugin.h:
3138         * WebProcess/Plugins/PDF/PDFPlugin.mm:
3139         (WebKit::PDFPlugin::create):
3140         * WebProcess/Plugins/PDF/PDFPluginAnnotation.h:
3141         (WebKit::PDFPluginAnnotation::PDFPluginAnnotationEventListener::create):
3142         * WebProcess/Plugins/PDF/PDFPluginChoiceAnnotation.h:
3143         * WebProcess/Plugins/PDF/PDFPluginChoiceAnnotation.mm:
3144         (WebKit::PDFPluginChoiceAnnotation::create):
3145         * WebProcess/Plugins/PDF/PDFPluginPasswordField.h:
3146         * WebProcess/Plugins/PDF/PDFPluginPasswordField.mm:
3147         (WebKit::PDFPluginPasswordField::create):
3148         * WebProcess/Plugins/PDF/PDFPluginTextAnnotation.h:
3149         * WebProcess/Plugins/PDF/PDFPluginTextAnnotation.mm:
3150         (WebKit::PDFPluginTextAnnotation::create):
3151         * WebProcess/Plugins/PluginProcessConnection.h:
3152         (WebKit::PluginProcessConnection::create):
3153         * WebProcess/Plugins/PluginProcessConnectionManager.cpp:
3154         (WebKit::PluginProcessConnectionManager::create):
3155         * WebProcess/Plugins/PluginProcessConnectionManager.h:
3156         * WebProcess/Plugins/PluginProxy.cpp:
3157         (WebKit::PluginProxy::create):
3158         * WebProcess/Plugins/PluginProxy.h:
3159         * WebProcess/Plugins/PluginView.cpp:
3160         (WebKit::PluginView::URLRequest::create):
3161         (WebKit::PluginView::Stream::create):
3162         (WebKit::PluginView::create):
3163         * WebProcess/Plugins/PluginView.h:
3164         * WebProcess/Scrolling/RemoteScrollingCoordinator.h:
3165         (WebKit::RemoteScrollingCoordinator::create):
3166         * WebProcess/Storage/StorageAreaImpl.cpp:
3167         (WebKit::StorageAreaImpl::create):
3168         * WebProcess/Storage/StorageAreaImpl.h:
3169         * WebProcess/Storage/StorageAreaMap.cpp:
3170         (WebKit::StorageAreaMap::create):
3171         * WebProcess/Storage/StorageAreaMap.h:
3172         * WebProcess/WebConnectionToUIProcess.cpp:
3173         (WebKit::WebConnectionToUIProcess::create):
3174         * WebProcess/WebConnectionToUIProcess.h:
3175         * WebProcess/WebCoreSupport/WebPopupMenu.cpp:
3176         (WebKit::WebPopupMenu::create):
3177         * WebProcess/WebCoreSupport/WebPopupMenu.h:
3178         * WebProcess/WebCoreSupport/WebSearchPopupMenu.cpp:
3179         (WebKit::WebSearchPopupMenu::create):
3180         * WebProcess/WebCoreSupport/WebSearchPopupMenu.h:
3181         * WebProcess/WebCoreSupport/ios/WebQuickLookHandleClient.h:
3182         * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.h:
3183         (WebKit::WebFrameNetworkingContext::create):
3184         * WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.h:
3185         (WebKit::WebFrameNetworkingContext::create):
3186         * WebProcess/WebPage/Cocoa/RemoteLayerTreeDisplayRefreshMonitor.h:
3187         (WebKit::RemoteLayerTreeDisplayRefreshMonitor::create):
3188         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
3189         (WebKit::CoordinatedLayerTreeHost::create):
3190         * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp:
3191         (WebKit::ThreadedCoordinatedLayerTreeHost::create):
3192         * WebProcess/WebPage/EventDispatcher.cpp:
3193         (WebKit::EventDispatcher::create):
3194         * WebProcess/WebPage/EventDispatcher.h:
3195         * WebProcess/WebPage/PageBanner.h:
3196         * WebProcess/WebPage/WebBackForwardListProxy.h:
3197         (WebKit::WebBackForwardListProxy::create):
3198         * WebProcess/WebPage/WebContextMenu.h:
3199         (WebKit::WebContextMenu::create):
3200         * WebProcess/WebPage/WebDocumentLoader.h:
3201         (WebKit::WebDocumentLoader::create):
3202         * WebProcess/WebPage/WebInspector.cpp:
3203         (WebKit::WebInspector::create):
3204         * WebProcess/WebPage/WebInspector.h:
3205         * WebProcess/WebPage/WebInspectorUI.cpp:
3206         (WebKit::WebInspectorUI::create):
3207         * WebProcess/WebPage/WebInspectorUI.h:
3208         * WebProcess/WebPage/WebOpenPanelResultListener.cpp:
3209         (WebKit::WebOpenPanelResultListener::create):
3210         * WebProcess/WebPage/WebOpenPanelResultListener.h:
3211         * WebProcess/WebPage/WebPageOverlay.cpp:
3212         (WebKit::WebPageOverlay::create):
3213         * WebProcess/WebPage/WebPageOverlay.h:
3214         * WebProcess/WebPage/WebUndoStep.cpp:
3215         (WebKit::WebUndoStep::create):
3216         * WebProcess/WebPage/WebUndoStep.h:
3217         * WebProcess/WebPage/mac/PageBannerMac.mm:
3218         (WebKit::PageBanner::create):
3219         * WebProcess/WebPage/mac/PlatformCAAnimationRemote.h:
3220         * WebProcess/WebPage/mac/PlatformCAAnimationRemote.mm:
3221         (WebKit::PlatformCAAnimationRemote::create):
3222         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
3223         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
3224         (WebKit::RemoteLayerTreeDrawingArea::BackingStoreFlusher::create):
3225         * WebProcess/ios/WebVideoFullscreenManager.h:
3226         * WebProcess/ios/WebVideoFullscreenManager.mm:
3227         (WebKit::WebVideoFullscreenManager::create):
3228
3229 2015-07-08  Anders Carlsson  <andersca@apple.com>
3230
3231         WKSecurityOrigin.h has wrong availability info
3232         https://bugs.webkit.org/show_bug.cgi?id=146761
3233         rdar://problem/21735802
3234
3235         Reviewed by Dan Bernstein.
3236
3237         * UIProcess/API/Cocoa/WKSecurityOrigin.h:
3238
3239 2015-07-08  Andreas Kling  <akling@apple.com>
3240
3241         [iOS] Scrolling is laggy when the keyboard is up and a form element is focused.
3242         <https://webkit.org/b/146735>
3243         <rdar://problem/21151033>
3244
3245         Reviewed by Enrica Casucci.
3246
3247         Every touch on the page causes us to call elementDidFocus(), since we may need to bring
3248         up a keyboard if the node had previously been programmatically focused. This was causing
3249         little lag spikes during scrolling every time you'd put your finger to the screen.
3250
3251         Have WebPage::elementDidFocus() return early if the node already has focus, and we've
3252         started an input session in response to non-programmatic focus already.
3253
3254         * WebProcess/WebPage/WebPage.h:
3255         * WebProcess/WebPage/ios/WebPageIOS.mm:
3256         (WebKit::WebPage::elementDidFocus):
3257         (WebKit::WebPage::elementDidBlur):
3258
3259 2015-07-08  Matt Rajca  <mrajca@apple.com>
3260
3261         Media Session: indicate to clients whether a media session has active media elements
3262         https://bugs.webkit.org/show_bug.cgi?id=146742
3263
3264         Reviewed by Tim Horton.
3265
3266         * UIProcess/API/C/WKPage.cpp:
3267         (WKPageHasMediaSessionWithActiveMediaElements):
3268         * UIProcess/API/C/WKPagePrivate.h:
3269         * UIProcess/WebPageProxy.cpp:
3270         (WebKit::WebPageProxy::hasMediaSessionWithActiveMediaElementsDidChange):
3271         * UIProcess/WebPageProxy.h:
3272         (WebKit::WebPageProxy::hasMediaSessionWithActiveMediaElementsDidChange):
3273         * UIProcess/WebPageProxy.messages.in:
3274         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
3275         (WebKit::WebChromeClient::hasMediaSessionWithActiveMediaElementsDidChange):
3276         * WebProcess/WebCoreSupport/WebChromeClient.h:
3277
3278 2015-07-07  Matt Rajca  <mrajca@apple.com>
3279
3280         Media Session: propagate artwork URL with metadata to UI clients
3281         https://bugs.webkit.org/show_bug.cgi?id=146698
3282
3283         Reviewed by Tim Horton.
3284
3285         * Shared/WebMediaSessionMetadata.h:
3286         (WebKit::WebMediaSessionMetadata::artworkURL):
3287         * UIProcess/API/C/WKMediaSessionMetadata.cpp:
3288         (WKMediaSessionMetadataCopyArtworkURL):
3289         * UIProcess/API/C/WKMediaSessionMetadata.h:
3290
3291 2015-07-08  Yongjun Zhang  <yongjun_zhang@apple.com>
3292
3293         Don't allow page scroll when previewing a link or image.
3294         https://bugs.webkit.org/show_bug.cgi?id=146741
3295         rdar://problem/21733053
3296
3297         Reviewed by Beth Dakin.
3298
3299         Don't let preview gesture and scroll panning gesture or zooming gesture recognize at the same time.
3300
3301         * UIProcess/ios/WKContentViewInteraction.mm:
3302         (-[WKContentView gestureRecognizer:canPreventGestureRecognizer:]):
3303
3304 2015-07-08  Tim Horton  <timothy_horton@apple.com>
3305
3306         Snapshots can be misplaced when custom swipe views are offset from the window origin
3307         https://bugs.webkit.org/show_bug.cgi?id=146744
3308         <rdar://problem/20942120>
3309
3310         Reviewed by Dean Jackson.
3311
3312         * UIProcess/mac/ViewGestureControllerMac.mm:
3313         (WebKit::ViewGestureController::beginSwipeGesture):
3314         Keep swipeArea in window coordinates; it was already in window coordinates
3315         when using custom swipe views, but not in the non-custom case.
3316
3317         Convert from window coordinates to parent-of-m_swipeLayer coordinates when
3318         determining m_swipeLayer's frame.
3319
3320 2015-07-07  Andy Estes  <aestes@apple.com>
3321
3322         [iOS][WK2] Ignore synthetic clicks in subframes initiated on a previous page
3323         https://bugs.webkit.org/show_bug.cgi?id=146712
3324
3325         Reviewed by Benjamin Poulain.
3326
3327         r178980 fixed an issue where, if a main frame navigation occurs in response to a touch event, a synthetic click
3328         event could fire on the navigated-to page. This change extends this fix to apply to subframes.
3329
3330         * WebProcess/WebPage/WebFrame.cpp:
3331         (WebKit::WebFrame::WebFrame):
3332         * WebProcess/WebPage/WebFrame.h:
3333         (WebKit::WebFrame::firstLayerTreeTransactionIDAfterDidCommitLoad):
3334         (WebKit::WebFrame::setFirstLayerTreeTransactionIDAfterDidCommitLoad):
3335         * WebProcess/WebPage/WebPage.cpp:
3336         (WebKit::WebPage::didCommitLoad): Stored the next layer tree transaction ID, and called cancelPotentialTapInFrame(), for the committed frame.
3337         * WebProcess/WebPage/WebPage.h:
3338         * WebProcess/WebPage/ios/WebPageIOS.mm:
3339         (WebKit::WebPage::handleTap): Determined the first post-commit layer tree transaction ID from the tap target node's frame.
3340         (WebKit::WebPage::commitPotentialTap): Ditto.
3341         (WebKit::WebPage::cancelPotentialTap): Called cancelPotentialTapInFrame(), passing m_mainFrame.
3342         (WebKit::WebPage::cancelPotentialTapInFrame): Taught to only cancel a potential tap whose target node is a descendant of the given frame.
3343         (WebKit::WebPage::updateVisibleContentRects): Updated to use the main frame's first post-commit layer tree transaction ID.
3344
3345 2015-07-08  Brady Eidson  <beidson@apple.com>
3346
3347         Move PingLoaders to the NetworkingProcess.
3348         <rdar://problem/18860263> and https://bugs.webkit.org/show_bug.cgi?id=146710
3349
3350         Reviewed by Tim Horton.
3351
3352         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
3353         (WebKit::NetworkConnectionToWebProcess::loadPing): Create a PingHandle and then return.
3354         * NetworkProcess/NetworkConnectionToWebProcess.h:
3355         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
3356         
3357         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
3358         (WebKit::WebPlatformStrategies::createPingHandle): If the Network process is enabled,
3359           compile the appropriate load parameters and then message to it.
3360           Otherwise, use the default in-process PingHandle.
3361         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
3362
3363 2015-07-08  Beth Dakin  <bdakin@apple.com>
3364
3365         Only support image previews for clients that implement commitPreviewedImageWithURL 
3366         delegate
3367         https://bugs.webkit.org/show_bug.cgi?id=146739
3368         -and corresponding-
3369         rdar://problem/21692929
3370
3371         Reviewed by Tim Horton.
3372
3373         We should only support image previews for clients that implement 
3374         commitPreviewedImageWithURL delegate since there is no default commit action.
3375         * UIProcess/ios/WKContentViewInteraction.mm:
3376         (-[WKContentView previewViewControllerForPosition:inSourceView:]):
3377
3378 2015-07-08  Anders Carlsson  <andersca@apple.com>
3379
3380         Make ApplicationStateTracker be per view instead of being a singleton
3381         https://bugs.webkit.org/show_bug.cgi?id=146737
3382
3383         Reviewed by Andreas Kling.
3384
3385         * UIProcess/ApplicationStateTracker.h:
3386         Update to be per view instead of a singleton.
3387
3388         * UIProcess/ApplicationStateTracker.mm:
3389         (WebKit::ApplicationStateTracker::ApplicationStateTracker):
3390         Change to take a view + selectors.
3391
3392         (WebKit::ApplicationStateTracker::~ApplicationStateTracker):
3393         Invalidate the state monitor and remove the listeners.
3394
3395         (WebKit::ApplicationStateTracker::applicationDidEnterBackground):
3396         Just call the single background method.
3397
3398         (WebKit::ApplicationStateTracker::applicationWillEnterForeground):
3399         Just call the single foreground method.
3400
3401         (WebKit::ApplicationStateTracker::singleton): Deleted.
3402         (WebKit::ApplicationStateTracker::addListener): Deleted.
3403         (WebKit::ApplicationStateTracker::invokeListeners): Deleted.
3404         (WebKit::ApplicationStateTracker::pruneListeners): Deleted.
3405
3406         * UIProcess/ios/WKContentView.mm:
3407         (-[WKContentView _commonInitializationWithProcessPool:configuration:]):
3408         Create the ApplicationStateTracker here.
3409
3410         (-[WKContentView isBackground]):
3411         Get the ivar instead of the singleton.
3412
3413 2015-07-08  Beth Dakin  <bdakin@apple.com>
3414
3415         InteractionInformationAtPosition bounds seem wrong on many sites, affects 
3416         apple.com
3417         https://bugs.webkit.org/show_bug.cgi?id=146736
3418         -and corresponding-
3419         rdar://problem/21655549
3420
3421         Reviewed by Tim Horton.
3422
3423         http://trac.webkit.org/changeset/186132/ changed the bounds for 
3424         InteractionInformationAtPosition. The image-related changes are good, but the 
3425         link-related changes feel wrong on many sites. We should revert the change for now 
3426         and just use the absoluteBoundingBoxRect() for non-images.
3427         * WebProcess/WebPage/ios/WebPageIOS.mm:
3428         (WebKit::WebPage::getPositionInformation):
3429
3430 2015-07-08  Beth Dakin  <bdakin@apple.com>
3431
3432         Add actions to image previews
3433         https://bugs.webkit.org/show_bug.cgi?id=146702
3434         -and corresponding-
3435         <rdar://problem/21642654>
3436
3437         Reviewed by Sam Weinig.
3438
3439         Add an array of actions and _WKActivatedElementInfo in order to properly invoke 
3440         the actions.
3441         * UIProcess/WKImagePreviewViewController.h:
3442         * UIProcess/WKImagePreviewViewController.mm:
3443         (-[WKImagePreviewViewController loadView]):
3444         (-[WKImagePreviewViewController initWithCGImage:defaultActions:elementInfo:]):
3445         (_scaleSizeWithinSize):
3446         (-[WKImagePreviewViewController initWithCGImage:]): Deleted.
3447
3448         Re-factor defaultActionsForImageSheet into a stand-alone function so that it can 
3449         be invoked for previews as well as for the action sheet.
3450         * UIProcess/ios/WKActionSheetAssistant.h:
3451         * UIProcess/ios/WKActionSheetAssistant.mm:
3452         (-[WKActionSheetAssistant showImageSheet]):
3453         (-[WKActionSheetAssistant defaultActionsForLinkSheet]):
3454         (-[WKActionSheetAssistant defaultActionsForImageSheet]):
3455         (-[WKActionSheetAssistant showLinkSheet]):
3456
3457         WKImagePreviewViewController initializer now takes the default actions and 
3458         _WKActivatedElementInfo.
3459         * UIProcess/ios/WKContentViewInteraction.mm:
3460         (-[WKContentView previewViewControllerForPosition:inSourceView:]):
3461
3462 2015-07-08  Dan Bernstein  <mitz@apple.com>
3463
3464         <rdar://problem/21669397> [iOS] Keyboard shortcuts that take focus away from the web view end up typing a letter into the newly focused field
3465         https://bugs.webkit.org/show_bug.cgi?id=146732
3466
3467         Reviewed by Sam Weinig.
3468
3469         * UIProcess/ios/WKContentViewInteraction.mm:
3470         (-[WKContentView _interpretKeyEvent:isCharEvent:]): Bail out if we are no longer the first
3471         responder.
3472
3473 2015-07-07  Anders Carlsson  <andersca@apple.com>
3474