faf6237ba21bf1f4d768ce9ef5a1f984425e881a
[WebKit-https.git] / Source / WebKit2 / ChangeLog
1 2015-07-22  James Savage  <james.savage@apple.com>
2
3         Use updated CoreAnimation snapshot SPI.
4         https://bugs.webkit.org/show_bug.cgi?id=147197
5         <rdar://problem/21032083>
6
7         Reviewed by Tim Horton.
8         Patch by James Savage.
9
10         * Platform/spi/ios/UIKitSPI.h:
11         * UIProcess/API/Cocoa/WKWebView.mm:
12         (-[WKWebView _snapshotRect:intoImageOfWidth:completionHandler:]):
13
14 2015-07-22  Timothy Horton  <timothy_horton@apple.com>
15
16         Fix the build
17
18         * UIProcess/ios/WKContentViewInteraction.mm:
19         (-[WKContentView setupInteraction]):
20         (-[WKContentView cleanupInteraction]):
21
22 2015-07-22  Commit Queue  <commit-queue@webkit.org>
23
24         Unreviewed, rolling out r187196.
25         https://bugs.webkit.org/show_bug.cgi?id=147213
26
27         broke all the iOS builds (Requested by thorton on #webkit).
28
29         Reverted changeset:
30
31         "Use updated CoreAnimation snapshot SPI."
32         https://bugs.webkit.org/show_bug.cgi?id=147197
33         http://trac.webkit.org/changeset/187196
34
35 2015-07-22  Tim Horton  <timothy_horton@apple.com>
36
37         Fix the build
38
39         * UIProcess/ios/WKContentViewInteraction.h:
40
41 2015-07-22  Tim Horton  <timothy_horton@apple.com>
42
43         [iOS] Adjust the preview architecture
44         https://bugs.webkit.org/show_bug.cgi?id=147203
45         <rdar://problem/21945775>
46
47         Reviewed by Simon Fraser.
48
49         * UIProcess/ios/WKContentViewInteraction.mm:
50         (-[WKContentView _dataForPreviewItemController:atPosition:type:]):
51         Link previews should win over image previews if both are possible.
52
53 2015-07-22  James Savage  <james.savage@apple.com>
54
55         Use updated CoreAnimation snapshot SPI.
56         https://bugs.webkit.org/show_bug.cgi?id=147197
57
58         Reviewed by Tim Horton.
59
60         * Platform/spi/ios/UIKitSPI.h:
61         * UIProcess/API/Cocoa/WKWebView.mm:
62         (-[WKWebView _snapshotRect:intoImageOfWidth:completionHandler:]):
63
64 2015-07-22  Tim Horton  <timothy_horton@apple.com>
65
66         [iOS] Adjust the preview architecture
67         https://bugs.webkit.org/show_bug.cgi?id=147203
68         <rdar://problem/21945775>
69
70         Reviewed by Beth Dakin.
71
72         * Platform/spi/ios/UIKitSPI.h:
73         * UIProcess/API/Cocoa/WKWebView.mm:
74         (-[WKWebView _setAllowsLinkPreview:]): Deleted.
75         * UIProcess/ios/WKContentView.mm:
76         (-[WKContentView willMoveToWindow:]): Deleted.
77         * UIProcess/ios/WKContentViewInteraction.h:
78         * UIProcess/ios/WKContentViewInteraction.mm:
79         (-[WKContentView setupInteraction]):
80         (-[WKContentView cleanupInteraction]):
81         (-[WKContentView _registerPreview]):
82         (-[WKContentView _unregisterPreview]):
83         (-[WKContentView _interactionShouldBeginFromPreviewItemController:forPosition:]):
84         (-[WKContentView _dataForPreviewItemController:atPosition:type:]):
85         (-[WKContentView _presentationRectForPreviewItemController:]):
86         (-[WKContentView _presentedViewControllerForPreviewItemController:]):
87         (-[WKContentView _previewItemController:commitPreview:]):
88         (-[WKContentView _previewItemController:willPresentPreview:forPosition:inSourceView:]):
89         (-[WKContentView _previewItemController:didDismissPreview:committing:]):
90         (-[WKContentView _presentationSnapshotForPreviewItemController:]):
91         (-[WKContentView _presentationRectsForPreviewItemController:]):
92         (-[WKContentView gestureRecognizerShouldBegin:]): Deleted.
93         (-[WKContentView _registerPreviewInWindow:]): Deleted.
94         (-[WKContentView _unregisterPreviewInWindow:]): Deleted.
95         (-[WKContentView previewViewControllerForPosition:inSourceView:]): Deleted.
96         (-[WKContentView commitPreviewViewController:]): Deleted.
97         (-[WKContentView willPresentPreviewViewController:forPosition:inSourceView:]): Deleted.
98         (-[WKContentView didDismissPreviewViewController:committing:]): Deleted.
99         Register and unregister in setup/cleanupInteraction instead of when moving between windows.
100         Implement 'shouldBegin' instead of interacting directly with the recognizer.
101         Make use of system enums instead of our own.
102         Let UIPreviewItemController handle shrink-wrapping and the indicator view.
103
104 2015-07-22  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
105
106         [EFL] Support indexeddb for WK2
107         https://bugs.webkit.org/show_bug.cgi?id=145867
108
109         Reviewed by Csaba Osztrogonác.
110
111         Add stub implementation for indexeddb. Move KeyedDecoder and KeyedEncoder from gtk to glib
112         in order to share it between GTK and EFL ports.
113
114         * DatabaseProcess/EntryPoint/unix/DatabaseProcessMain.cpp:
115         * DatabaseProcess/efl/DatabaseProcessMainEfl.cpp: Copied from Source/WebKit2/DatabaseProcess/EntryPoint/unix/DatabaseProcessMain.cpp.
116         (WebKit::DatabaseProcessMainUnix):
117         * PlatformEfl.cmake:
118         * PlatformGTK.cmake:
119         * Shared/glib/KeyedDecoder.cpp: Renamed from Source/WebKit2/Shared/gtk/KeyedDecoder.cpp.
120         (WebKit::KeyedDecoder::KeyedDecoder):
121         (WebKit::KeyedDecoder::~KeyedDecoder):
122         (WebKit::KeyedDecoder::dictionaryFromGVariant):
123         (WebKit::KeyedDecoder::decodeBytes):
124         (WebKit::KeyedDecoder::decodeSimpleValue):
125         (WebKit::KeyedDecoder::decodeBool):
126         (WebKit::KeyedDecoder::decodeUInt32):
127         (WebKit::KeyedDecoder::decodeInt32):
128         (WebKit::KeyedDecoder::decodeInt64):
129         (WebKit::KeyedDecoder::decodeFloat):
130         (WebKit::KeyedDecoder::decodeDouble):
131         (WebKit::KeyedDecoder::decodeString):
132         (WebKit::KeyedDecoder::beginObject):
133         (WebKit::KeyedDecoder::endObject):
134         (WebKit::KeyedDecoder::beginArray):
135         (WebKit::KeyedDecoder::beginArrayElement):
136         (WebKit::KeyedDecoder::endArrayElement):
137         (WebKit::KeyedDecoder::endArray):
138         * Shared/glib/KeyedDecoder.h: Renamed from Source/WebKit2/Shared/gtk/KeyedDecoder.h.
139         * Shared/glib/KeyedEncoder.cpp: Renamed from Source/WebKit2/Shared/gtk/KeyedEncoder.cpp.
140         (WebKit::KeyedEncoder::KeyedEncoder):
141         (WebKit::KeyedEncoder::~KeyedEncoder):
142         (WebKit::KeyedEncoder::encodeBytes):
143         (WebKit::KeyedEncoder::encodeBool):
144         (WebKit::KeyedEncoder::encodeUInt32):
145         (WebKit::KeyedEncoder::encodeInt32):
146         (WebKit::KeyedEncoder::encodeInt64):
147         (WebKit::KeyedEncoder::encodeFloat):
148         (WebKit::KeyedEncoder::encodeDouble):
149         (WebKit::KeyedEncoder::encodeString):
150         (WebKit::KeyedEncoder::beginObject):
151         (WebKit::KeyedEncoder::endObject):
152         (WebKit::KeyedEncoder::beginArray):
153         (WebKit::KeyedEncoder::beginArrayElement):
154         (WebKit::KeyedEncoder::endArrayElement):
155         (WebKit::KeyedEncoder::endArray):
156         (WebKit::KeyedEncoder::finishEncoding):
157         * Shared/glib/KeyedEncoder.h: Renamed from Source/WebKit2/Shared/gtk/KeyedEncoder.h.
158         * UIProcess/Databases/efl/DatabaseProcessProxyEfl.cpp: Copied from Source/WebKit2/DatabaseProcess/EntryPoint/unix/DatabaseProcessMain.cpp.
159         (WebKit::DatabaseProcessProxy::platformGetLaunchOptions):
160
161 2015-07-22  Michael Catanzaro  <mcatanzaro@igalia.com>
162
163         [Seccomp] Canonicalize filesystem path when whitelisting it
164         https://bugs.webkit.org/show_bug.cgi?id=142986
165
166         Reviewed by Žan Doberšek.
167
168         * Shared/linux/SeccompFilters/SyscallPolicy.cpp:
169         (WebKit::canonicalizeFileName):
170         (WebKit::SyscallPolicy::addFilePermission):
171         (WebKit::SyscallPolicy::addDirectoryPermission):
172
173 2015-07-21  Simon Fraser  <simon.fraser@apple.com>
174
175         Add logging for TiledCoreAnimationDrawingArea resizing
176         https://bugs.webkit.org/show_bug.cgi?id=147180
177
178         Reviewed by Tim Horton.
179
180         Add a "Resize" log channel for WebKit2, and use it to log data in scaleViewToFitDocumentIfNeeded().
181
182         * Platform/Logging.h:
183         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
184         (WebKit::TiledCoreAnimationDrawingArea::scaleViewToFitDocumentIfNeeded):
185
186 2015-07-22  Sam Weinig  <sam@webkit.org>
187
188         Encode/Decode underlying errors when serializing NSErrors
189         <rdar://problem/21818117>
190         https://bugs.webkit.org/show_bug.cgi?id=147199
191
192         Reviewed by Anders Carlsson.
193
194         * Shared/mac/WebCoreArgumentCodersMac.mm:
195         (IPC::ArgumentCoder<CertificateInfo>::decode):
196         (IPC::encodeNSError):
197         (IPC::ArgumentCoder<ResourceError>::encodePlatformData):
198         (IPC::decodeNSError):
199         (IPC::ArgumentCoder<ResourceError>::decodePlatformData):
200         Break out encoding/decoding of the NSErrors into a helpers so they can be called
201         for the underlying error.
202
203 2015-07-22  Beth Dakin  <bdakin@apple.com>
204
205         Animated images should animate in previews
206         https://bugs.webkit.org/show_bug.cgi?id=147173
207         -and corresponding-
208         rdar://problem/21637698
209
210         Reviewed by Dan Bernstein.
211
212         InteractionInformationAtPosition needs to know if it’s an animated image.
213         * Shared/InteractionInformationAtPosition.cpp:
214         (WebKit::InteractionInformationAtPosition::encode):
215         (WebKit::InteractionInformationAtPosition::decode):
216         * Shared/InteractionInformationAtPosition.h:
217
218         New delegate method to create a link preview view controller for animated 
219         images.
220         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
221
222         Treat animated images more like link previews.
223         * UIProcess/ios/WKContentViewInteraction.mm:
224         (-[WKContentView previewViewControllerForPosition:inSourceView:]):
225
226         Set info.isAnimatedImage
227         * WebProcess/WebPage/ios/WebPageIOS.mm:
228         (WebKit::WebPage::getPositionInformation):
229
230 2015-07-22  Michael Catanzaro  <mcatanzaro@igalia.com>
231
232         [Seccomp Filters] Add helpers to get XDG base directory locations
233         https://bugs.webkit.org/show_bug.cgi?id=142982
234
235         Reviewed by Zan Dobersek.
236
237         * PlatformEfl.cmake:
238         * PlatformGTK.cmake:
239         * Shared/linux/SeccompFilters/XDGBaseDirectory.h: Added.
240         * Shared/linux/SeccompFilters/XDGBaseDirectoryGLib.cpp: Added.
241         (WebKit::userHomeDirectory):
242         (WebKit::userCacheDirectory):
243         (WebKit::userConfigDirectory):
244         (WebKit::userDataDirectory):
245         (WebKit::userRuntimeDirectory):
246
247 2015-07-22  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
248
249         [EFL][WK2] EWK2ContextTestMultipleProcesses.ewk_context_network_process_model fails to pass
250         https://bugs.webkit.org/show_bug.cgi?id=142967
251
252         Reviewed by Csaba Osztrogonác.
253
254         Though processIdentifier() can return 0 when a page is not closed, ewk_context_network_process_model has
255         not been considered process id can be 0. This patch adds a protection logic which doesn't test when process
256         id is 0 at the moment.
257
258         * UIProcess/API/efl/tests/test_ewk2_context.cpp:
259         (TEST_F):
260
261 2015-07-22  Carlos Garcia Campos  <cgarcia@igalia.com>
262
263         Unreviewed. Fix some warnings when generating GTK+ HTML API docs.
264
265         * UIProcess/API/gtk/docs/webkit2gtk-docs.sgml: Add
266         WebKitWebsiteDataManager and WebKitWebEditor.
267
268 2015-07-21  Carlos Garcia Campos  <cgarcia@igalia.com>
269
270         Unreviewed. Update OptionsGTK.cmake and NEWS for 2.9.4 release.
271
272         * gtk/NEWS: Add release notes for 2.9.4.
273
274 2015-07-21  Joseph Pecoraro  <pecoraro@apple.com>
275
276         Web Inspector: [Mac] "Open Image In New Window" context menu item does nothing on an image
277         https://bugs.webkit.org/show_bug.cgi?id=147175
278
279         Reviewed by Timothy Hatcher.
280
281         * UIProcess/mac/WebInspectorProxyMac.mm:
282         (WebKit::getContextMenuFromProposedMenu):
283         (WebKit::WebInspectorProxy::platformCreateInspectorPage):
284         Remove default context menus that won't work in the inspector page.
285
286 2015-07-21  Benjamin Poulain  <benjamin@webkit.org>
287
288         [Content Extensions] Use a jump table when consecutive transitions have different targets
289         https://bugs.webkit.org/show_bug.cgi?id=147099
290
291         Reviewed by Alex Christensen.
292
293         * UIProcess/API/APIUserContentExtensionStore.h:
294
295 2015-07-21  Daniel Bates  <dabates@apple.com>
296
297         Fix the build following <https://trac.webkit.org/changeset/187129>
298         (https://bugs.webkit.org/show_bug.cgi?id=147112)
299
300         * UIProcess/WebProcessProxy.cpp:
301         (WebKit::WebProcessProxy::reinstateNetworkProcessAssertionState): Guard implementation with PLATFORM(IOS)
302         since this logic is specific to the iOS port.
303
304 2015-07-21  Simon Fraser  <simon.fraser@apple.com>
305
306         Rename the 'View' log channel to 'Printing'
307         https://bugs.webkit.org/show_bug.cgi?id=147172
308
309         Reviewed by Zalan Bujtas.
310
311         "View" was a terrible name for a log channel that was all about printing.
312         Sort the log channels.
313
314         * Platform/Logging.h:
315         * UIProcess/API/mac/WKView.mm:
316         (-[WKView drawRect:]):
317         (-[WKView printOperationWithPrintInfo:forFrame:]):
318         * UIProcess/mac/WKPrintingView.mm:
319         (-[WKPrintingView _preparePDFDataForPrintingOnSecondaryThread]):
320         (pageDidComputePageRects):
321         (-[WKPrintingView knowsPageRange:]):
322         (-[WKPrintingView drawRect:]):
323         (-[WKPrintingView rectForPage:]):
324         (-[WKPrintingView beginDocument]):
325         (-[WKPrintingView endDocument]):
326
327 2015-07-21  Zalan Bujtas  <zalan@apple.com>
328
329         [iOS] Menu drop down such as on nike.com does not stay
330         https://bugs.webkit.org/show_bug.cgi?id=147047
331         rdar://problem/21046961
332
333         Reviewed by Benjamin Poulain.
334
335         This is a workaround for unintended scrolling while scaling.
336         (Based on Benjamin Poulain's WIP patch for webkit.org/b/136904)
337
338         In certain cases when scaling would result in moving the scrollview (which would trigger
339         a scroll event on WebCore side), zoomRect is called instead of setZoomScale to ensure
340         that the scroll position stays intact.
341
342         * UIProcess/API/Cocoa/WKWebView.mm:
343         (-[WKWebView _didCommitLayerTree:]):
344
345 2015-07-21  Daniel Bates  <dabates@apple.com>
346
347         WTFCrash() in WebKit::WebProcess::networkConnection()
348         https://bugs.webkit.org/show_bug.cgi?id=147112
349         <rdar://problem/18477459>
350
351         Reviewed by Gavin Barraclough.
352
353         Fixes an issue where a newly launched network process may be jetsam'd because it has not
354         taken a process assertion between the time it was launched and the time when a web process
355         makes use of it.
356
357         Initially a network process does not have a process assertion. A process assertion is taken
358         (if one has not been taken) for the network process when a process assertion is taken for at
359         least one web process. When the network process crashes a WebProcess may ultimately launch a
360         new network process in WebProcess::networkConnection(). The new network process may be jetsam'd
361         immediately when the system is under some measure pressure because it has a low jetsam priority,
362         0 (since it does not have a process assertion and higher priority implies that a process is less
363         likely to be jetsam'd). And the logic in WebProcess::networkConnection() explicitly calls
364         CRASH() if the newly launched network process crashes immediately. Towards preventing the newly
365         launched network process from being jetsam'd we should obtain a process assertion for it.
366
367         * UIProcess/WebProcessPool.cpp:
368         (WebKit::WebProcessPool::WebProcessPool): Initialize m_didNetworkProcessCrash to false.
369         (WebKit::WebProcessPool::ensureNetworkProcess): If the network process crashed (m_didNetworkProcessCrash == true)
370         then tell each process in the pool to reinstate their network activity token for the new network process.
371         (WebKit::WebProcessPool::networkProcessCrashed): Set m_didNetworkProcessCrash to true when the
372         network process crashed.
373         * UIProcess/WebProcessPool.h:
374         * UIProcess/WebProcessProxy.cpp:
375         (WebKit::WebProcessProxy::reinstateNetworkProcessAssertionState): Added.
376         (WebKit::WebProcessProxy::didSetAssertionState): Add assert to ensure we never have both
377         a background- and foreground- activity token for the network process.
378         * UIProcess/WebProcessProxy.h:
379
380 2015-07-21  Daniel Bates  <dabates@apple.com>
381
382         ASSERT(m_suspendMessageCount >= 0) fails in ProcessThrottler::didCancelProcessSuspension()
383         when WebContent process crashes; Network process may never voluntarily suspend
384         https://bugs.webkit.org/show_bug.cgi?id=147122
385         <rdar://problem/21906759>
386
387         Reviewed by Chris Dumez.
388
389         Fixes an issue where the network process may never voluntarily release its process assertion.
390
391         Currently the network process always sends both a ProcessReadyToSuspend and CancelPrepareToSuspend
392         message in response to receiving a PrepareToSuspend message and CancelPrepareToSuspend message,
393         respectively. The process throttler expects to receive either a ProcessReadyToSuspend message
394         or a CancelPrepareToSuspend message (and not both) in response to sending the message sequence
395         PrepareToSuspend, CancelPrepareToSuspend. When a process throttler receives both messages in
396         response to this sequence then its internal message count becomes imbalanced and it will
397         never release the process assertion it manages. One user interaction that can cause such an
398         imbalance, in the process throttler held by NetworkProcessProxy, is switching tabs.
399
400         * NetworkProcess/NetworkProcess.cpp:
401         (WebKit::NetworkProcess::cancelPrepareToSuspend): Do not send message NetworkProcessProxy::DidCancelProcessSuspension. 
402         * UIProcess/Network/NetworkProcessProxy.cpp:
403         (WebKit::NetworkProcessProxy::didCancelProcessSuspension): Deleted.
404         * UIProcess/Network/NetworkProcessProxy.h:
405         * UIProcess/Network/NetworkProcessProxy.messages.in: Remove message NetworkProcessProxy::DidCancelProcessSuspension.
406
407 2015-07-21  Matthew Daiter  <mdaiter@apple.com>
408
409         Make sure to invalidate requests for user media after webpage reset
410         https://bugs.webkit.org/show_bug.cgi?id=147155
411         <rdar://problem/21924174>
412
413         Reviewed by Brent Fulgham.
414
415         * UIProcess/WebPageProxy.cpp:
416         (WebKit::WebPageProxy::resetState): Added user media reset
417
418 2015-07-21  Tim Horton  <timothy_horton@apple.com>
419
420         [iOS] Avoid using a TextIndicator if there are non-text things to indicate
421         https://bugs.webkit.org/show_bug.cgi?id=147152
422         <rdar://problem/21921061>
423
424         Reviewed by Beth Dakin.
425
426         * UIProcess/ios/WKContentViewInteraction.mm:
427         (-[WKContentView willPresentPreviewViewController:forPosition:inSourceView:]):
428         * WebProcess/WebPage/ios/WebPageIOS.mm:
429         (WebKit::shouldUseTextIndicatorForLink):
430         (WebKit::WebPage::getPositionInformation):
431         Fall back to a rectangular area instead of a TextIndicator if there are any
432         non-inline elements inside the link.
433
434 2015-07-21  Andreas Kling  <akling@apple.com>
435
436         API::Session should clean up its storage in the network process when destroyed.
437         <https://webkit.org/b/147139>
438         <rdar://problem/21838764>
439
440         Reviewed by Anders Carlsson.
441
442         Have ~Session() send a DestroyPrivateBrowsingSession message to all networking processes
443         for ephemeral sessions. This plugs a NetworkStorageSession leak that could retain a large
444         CFNetwork object graph.
445
446         * UIProcess/API/APISession.cpp:
447         (API::Session::~Session):
448
449 2015-07-21  Sungmann Cho  <sungmann.cho@navercorp.com>
450
451         Make PluginProxy::handleMouseEvent() asynchronous.
452         https://bugs.webkit.org/show_bug.cgi?id=146142
453
454         Reviewed by Anders Carlsson.
455
456         PluginProxy::handleMouseEvent() forwards the generated mouse event to PluginControllerProxy
457         using a synchronous message, but the recipient always reply immediately with the same value("true")
458         even before handling the received message. So I think PluginProxy::handleMouseEvent() is perfectly
459         OK to process its messages asynchronously.
460
461         * PluginProcess/PluginControllerProxy.cpp:
462         (WebKit::PluginControllerProxy::handleMouseEvent):
463         * PluginProcess/PluginControllerProxy.h:
464         * PluginProcess/PluginControllerProxy.messages.in:
465         * WebProcess/Plugins/PluginProxy.cpp:
466         (WebKit::PluginProxy::handleMouseEvent):
467
468 2015-07-20  Carlos Garcia Campos  <cgarcia@igalia.com>
469
470         [GTK] Add API to be notified about editor state changes
471         https://bugs.webkit.org/show_bug.cgi?id=145875
472
473         Reviewed by Gustavo Noronha Silva.
474
475         Add WebKitEditorState object, that is created on demand by the
476         WebKitWebView and can be used to get the typing attributes of the
477         editor at the current position or selection.
478
479         * PlatformGTK.cmake:
480         * Shared/EditorState.cpp: Use part of the PostLayoutData struct
481         for the GTK port too.
482         (WebKit::EditorState::encode): Encode PostLayoutData for GTK and
483         remove our custom cursorRect.
484         (WebKit::EditorState::decode): Decode PostLayoutData for GTK and
485         remove our custom cursorRect.
486         (WebKit::EditorState::PostLayoutData::encode): Reorder it to
487         reduce the amonut of ifdefs.
488         (WebKit::EditorState::PostLayoutData::decode): Ditto.
489         * Shared/EditorState.h: Add AttributeStrikeThrough to
490         TypingAttributes enum.
491         * UIProcess/API/gtk/PageClientImpl.cpp:
492         (WebKit::PageClientImpl::selectionDidChange): Rename
493         updateTextInputState() to selectionDidChange() and also notify the
494         WebKitWebView.
495         * UIProcess/API/gtk/PageClientImpl.h:
496         * UIProcess/API/gtk/WebKitEditorState.cpp: Added.
497         (webkitEditorStateGetProperty):
498         (webkit_editor_state_class_init):
499         (webkitEditorStateSetTypingAttributes):
500         (webkitEditorStateCreate):
501         (webkitEditorStateChanged):
502         (webkit_editor_state_get_typing_attributes):
503         * UIProcess/API/gtk/WebKitEditorState.h: Added.
504         * UIProcess/API/gtk/WebKitEditorStatePrivate.h: Added.
505         * UIProcess/API/gtk/WebKitWebView.cpp:
506         (webkitWebViewSelectionDidChange): Notify the WebKitEditorState if
507         it has already been created.
508         (webkit_web_view_get_editor_state): Ensure a WebKitEditorState and
509         return it.
510         * UIProcess/API/gtk/WebKitWebView.h:
511         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
512         (webkitWebViewBaseUpdateTextInputState): Get the caret cursor rect
513         from PostLayoutData.
514         * UIProcess/API/gtk/WebKitWebViewPrivate.h:
515         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt: Add new symbols.
516         * UIProcess/API/gtk/docs/webkit2gtk-4.0.types: Add webkit_editor_state_get_type.
517         * UIProcess/API/gtk/docs/webkit2gtk-docs.sgml: Add new section for WebKitEditorState.
518         * UIProcess/API/gtk/webkit2.h: Include WebKitEditorState.h.
519         * UIProcess/PageClient.h:
520         * UIProcess/gtk/WebPageProxyGtk.cpp:
521         (WebKit::WebPageProxy::editorStateChanged): Call PageClientImpl::selectionDidChange().
522         * WebProcess/WebPage/gtk/WebPageGtk.cpp:
523         (WebKit::WebPage::platformEditorState): Add typing attributes to EditorState.
524
525 2015-07-20  Simon Fraser  <simon.fraser@apple.com>
526
527         Fix the iOS build.
528
529         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
530
531 2015-07-20  Simon Fraser  <simon.fraser@apple.com>
532
533         Facebook in tiled fullscreen is slow
534         https://bugs.webkit.org/show_bug.cgi?id=147134
535         rdar://problem/21823349
536
537         Reviewed by Tim Horton.
538         
539         TiledCoreAnimationDrawingArea::scaleViewToFitDocumentIfNeeded() could cause a page to toggle
540         between two fixed layout sizes differing by a pixel, because of rounding. This would cause
541         lots of extra layouts and painting.
542         
543         This happened because the the fixed layout size was computed using ceil(m_webPage.size().width() / viewScale)
544
545         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
546         (WebKit::TiledCoreAnimationDrawingArea::scaleViewToFitDocumentIfNeeded):
547
548 2015-07-20  Wenson Hsieh  <wenson_hsieh@apple.com>
549
550         Fix crash due to RemoteLayerTreeDisplayRefreshMonitor outliving RemoteLayerTreeDrawingArea
551         https://bugs.webkit.org/show_bug.cgi?id=147124
552         <rdar://problem/21582858>
553
554         Reviewed by Simon Fraser.
555
556         Refactors RemoteLayerTreeDisplayRefreshMonitor to use a weak pointer rather than a reference
557         to its RemoteLayerTreeDrawingArea, since the drawing area may be deallocated before the monitor
558         in some rare cases. This rarely caused pages using requestAnimationFrame to crash on iOS. However,
559         this should not be the case: logically, a RemoteLayerTreeDrawingArea should always outlive its
560         refresh monitors. Refer to https://bugs.webkit.org/show_bug.cgi?id=147128 for more details.
561
562         * WebProcess/WebPage/Cocoa/RemoteLayerTreeDisplayRefreshMonitor.h:
563         * WebProcess/WebPage/Cocoa/RemoteLayerTreeDisplayRefreshMonitor.mm:
564         (WebKit::RemoteLayerTreeDisplayRefreshMonitor::RemoteLayerTreeDisplayRefreshMonitor):
565         (WebKit::RemoteLayerTreeDisplayRefreshMonitor::~RemoteLayerTreeDisplayRefreshMonitor): On destruction, checks
566             first to see whether or not the drawing area has been deallocated before telling it to update its monitors.
567         (WebKit::RemoteLayerTreeDisplayRefreshMonitor::requestRefreshCallback):
568         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
569         (WebKit::RemoteLayerTreeDrawingArea::createWeakPtr): Creates and returns a new weak pointer to itself.
570         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
571         (WebKit::RemoteLayerTreeDrawingArea::RemoteLayerTreeDrawingArea):
572
573 2015-07-20  Alex Christensen  <achristensen@webkit.org>
574
575         [Content Extensions] Cache actions with domains that match everything
576         https://bugs.webkit.org/show_bug.cgi?id=147050
577
578         Reviewed by Benjamin Poulain.
579
580         * UIProcess/API/APIUserContentExtensionStore.h:
581
582 2015-07-20  Gordon Sheridan  <gordon_sheridan@apple.com>
583
584         Support blocking a plug-in for non-security reasons
585         https://bugs.webkit.org/show_bug.cgi?id=145009
586
587         Reviewed by Anders Carlsson.
588
589         * Shared/Plugins/PluginModuleInfo.h:
590         Replace PluginModuleBlocked with separate enum values for blocking for security and compatibility.
591
592         * UIProcess/API/C/WKAPICast.h:
593         (WebKit::toWKPluginLoadPolicy):
594         Modify to handle change to PluginModuleBlocked enum.
595
596         (WebKit::toPluginModuleLoadPolicy):
597         Ditto.
598
599         * UIProcess/API/C/WKPluginLoadPolicy.h:
600         Added enum value for blocking a plugin for compatibility reasons.
601
602         * UIProcess/Plugins/mac/PluginInfoStoreMac.mm:
603         (WebKit::shouldBlockPlugin):
604         Check load policy for both reasons a plugin may be blocked.
605
606         (WebKit::WKPlugInModuleLoadPolicyToPluginModuleLoadPolicy):
607         Added function to convert between load policy enum types.
608
609         (WebKit::PluginInfoStore::defaultLoadPolicyForPlugin):
610         Modified to call WKLoadPolicyForPluginVersion() which can distinguish between blocked for security or compatibility.
611
612         * UIProcess/WebPageProxy.cpp:
613         (WebKit::WebPageProxy::findPlugin):
614         Updated to recognize both PluginModuleBlocked enum values that indicate a plugin is blocked.
615
616         * WebProcess/WebPage/WebPage.cpp:
617         (WebKit::WebPage::createPlugin):
618         Ditto.
619
620         (WebKit::WebPage::canPluginHandleResponse):
621         Ditto.
622
623 2015-07-20  Antti Koivisto  <antti@apple.com>
624
625         NSURLCache fallback does not work on iOS due to sandboxing
626         https://bugs.webkit.org/show_bug.cgi?id=146314
627         <rdar://problem/21433691>
628
629         Reviewed by Anders Carlsson.
630
631         This broke with earlier cache path computation changes.
632
633         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
634         (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
635
636             NSURLCache path is relative to the container cache path so "." is sufficient.
637             This puts the cache files under
638             <container>/Library/Caches/com.apple.WebKit.Networking/
639
640 2015-07-20  Jeremy Jones  <jeremyj@apple.com>
641
642         Adopt AVPlayerLayerView
643         https://bugs.webkit.org/show_bug.cgi?id=146862
644
645         Reviewed by Simon Fraser.
646
647         The CALayerHost is replaced with WebLayerHostView to be compatible with UIView animations.
648         videoLayerFrame and videoLayerGravity no longer need to be stored because they are stored
649         where they are used in the interface. Some animation is improved in the conversion.
650
651         * UIProcess/ios/WebVideoFullscreenManagerProxy.h:
652         * UIProcess/ios/WebVideoFullscreenManagerProxy.mm:
653         (+[WebLayerHostView layerClass]): Add class WebLayerHostView.
654         (-[WebLayerHostView contextID]):
655         (-[WebLayerHostView setContextID:]):
656         (-[WebLayerHostView layerHost]):
657         (WebKit::WebVideoFullscreenManagerProxy::invalidate): layer -> view
658         (WebKit::WebVideoFullscreenManagerProxy::setupFullscreenWithID):
659         Apply the hostingDeviceScaleFactor transform to -sublayerTransform instead of to
660         -transform. This more directly inverts the tranform WebProcess and allows -transform
661         to be used for animation in the UIProcess. This is important because UIView's actions
662         animate -transform, but not -sublayerTrasform.
663
664         (WebKit::WebVideoFullscreenManagerProxy::didCleanupFullscreen): layer -> view
665         (WebKit::WebVideoFullscreenModelContext::setVideoLayerFrame): Deleted.
666         (WebKit::WebVideoFullscreenModelContext::videoLayerFrame): Deleted.
667         (WebKit::WebVideoFullscreenModelContext::setVideoLayerGravity): Deleted.
668         (WebKit::WebVideoFullscreenModelContext::videoLayerGravity): Deleted.
669         * WebProcess/ios/WebVideoFullscreenManager.mm:
670         (WebKit::WebVideoFullscreenManager::enterVideoFullscreenForVideoElement):
671         Set initial video layer frame to fix start point of animation.
672
673         (WebKit::WebVideoFullscreenManager::didSetupFullscreen):
674         dispatch_async allows the CATransaction to complete before continuing with the animation.
675         This prevents a flash during animation.
676
677 2015-07-20  Tim Horton  <timothy_horton@apple.com>
678
679         REGRESSION (r174287): Flash of black when opening a new web view or navigating to a new page
680         https://bugs.webkit.org/show_bug.cgi?id=147127
681         <rdar://problem/21474317>
682
683         Reviewed by Simon Fraser.
684
685         * WebProcess/WebPage/WebPage.cpp:
686         (WebKit::WebPage::snapshotAtSize):
687         Avoid using an invalid documentBackgroundColor, fall back to baseBackgroundColor
688         like we did before r174287.
689
690 2015-07-20  Michael Catanzaro  <mcatanzaro@igalia.com>
691
692         [Seccomp] Should be easier to debug blocked syscalls
693         https://bugs.webkit.org/show_bug.cgi?id=142980
694
695         These should be printed even when not running in debug mode. There is no
696         value in hiding errors from release build users.
697
698         Reviewed by Žan Doberšek.
699
700         * Shared/linux/SeccompFilters/SeccompBroker.cpp:
701         (WebKit::SeccompBroker::runLoop): Don't close stderr et. al. in release builds.
702         * Shared/linux/SeccompFilters/Syscall.cpp:
703         (WebKit::write_uint): Added.
704         (WebKit::reportUnexpectedSyscall): Added.
705         (WebKit::Syscall::createFromContext): Call reportUnexpectedSyscall. Also, no need to crash
706         here in release builds.
707         * Shared/linux/SeccompFilters/SyscallPolicy.cpp:
708         (WebKit::SyscallPolicy::hasPermissionForPath): Print a warning when access is denied.
709         (WebKit::SyscallPolicy::permissionToString): Added.
710         * Shared/linux/SeccompFilters/SyscallPolicy.h: Add permissionToString.
711
712 2015-07-20  Csaba Osztrogonác  <ossy@webkit.org>
713
714         Fix the !ENABLE(VIDEO) build after r186396
715         https://bugs.webkit.org/show_bug.cgi?id=147116
716
717         Reviewed by Brent Fulgham.
718
719         * WebProcess/WebProcess.cpp:
720         (WebKit::WebProcess::didClose):
721
722 2015-07-20  Tomas Popela  <tpopela@redhat.com>
723
724         [GTK] Add selection-changed signal to the WebKit2 API
725         https://bugs.webkit.org/show_bug.cgi?id=137116
726
727         Reviewed by Carlos Garcia Campos.
728
729         Add a new object WebKitWebEditor where the editing capabilities of a
730         WebPage will be grouped and exposed. Add the selection-changed signal
731         there (we used the same name as in WK1 API).
732
733         * PlatformGTK.cmake:
734         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
735         * WebProcess/InjectedBundle/API/gtk/WebKitWebEditor.cpp: Added.
736         (didChangeSelection):
737         (webkitWebEditorCreate):
738         (webkit_web_editor_get_page):
739         * WebProcess/InjectedBundle/API/gtk/WebKitWebEditor.h: Added.
740         * WebProcess/InjectedBundle/API/gtk/WebKitWebEditorPrivate.h: Added.
741         * WebProcess/InjectedBundle/API/gtk/WebKitWebPage.cpp:
742         (webkitWebPageGetPage):
743         (webkit_web_page_get_editor):
744         * WebProcess/InjectedBundle/API/gtk/WebKitWebPage.h:
745         * WebProcess/InjectedBundle/API/gtk/WebKitWebPagePrivate.h:
746         * WebProcess/InjectedBundle/API/gtk/webkit-web-extension.h:
747
748 2015-07-16  Anders Carlsson  <andersca@apple.com>
749
750         WebsiteDataStore operations need to grab background assertions
751         https://bugs.webkit.org/show_bug.cgi?id=147015
752         rdar://problem/21799011
753
754         Reviewed by Sam Weinig.
755
756         * UIProcess/Network/NetworkProcessProxy.cpp:
757         (WebKit::NetworkProcessProxy::fetchWebsiteData):
758         (WebKit::NetworkProcessProxy::deleteWebsiteData):
759         (WebKit::NetworkProcessProxy::deleteWebsiteDataForOrigins):
760         * UIProcess/WebProcessProxy.cpp:
761         (WebKit::WebProcessProxy::fetchWebsiteData):
762         (WebKit::WebProcessProxy::deleteWebsiteData):
763         (WebKit::WebProcessProxy::deleteWebsiteDataForOrigins):
764
765 2015-07-19  Michael Catanzaro  <mcatanzaro@igalia.com>
766
767         Unreviewed, placate -Wmismatched-tags after r187011
768
769         It's basically bug #146990 again. Oops.
770
771         * WebProcess/gtk/SeccompFiltersWebProcessGtk.h:
772
773 2015-07-19  Michael Catanzaro  <mcatanzaro@igalia.com>
774
775         [GTK] Add seccomp filters support
776         https://bugs.webkit.org/show_bug.cgi?id=110014
777
778         Reviewed by Žan Doberšek.
779
780         Allow building with ENABLE_SECCOMP_FILTERS=ON. Based on work by Thiago Marcos P. Santos.
781
782         * PlatformGTK.cmake: Support ENABLE_SECCOMP_FILTERS build option.
783         * WebProcess/gtk/SeccompFiltersWebProcessGtk.cpp: Added.
784         (WebKit::SeccompFiltersWebProcessGtk::SeccompFiltersWebProcessGtk):
785         (WebKit::SeccompFiltersWebProcessGtk::platformInitialize):
786         * WebProcess/gtk/SeccompFiltersWebProcessGtk.h: Added.
787         * WebProcess/soup/WebProcessSoup.cpp:
788         (WebKit::WebProcess::platformInitializeWebProcess): Initialize default
789         GTK+ web process seccomp filters.
790
791 2015-07-18  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
792
793         Reduce PassRefPtr in WebKit2 - 3
794         https://bugs.webkit.org/show_bug.cgi?id=146995
795
796         Reviewed by Daniel Bates.
797
798         To remove PassRefPtr, this patch reduces use of PassRefPtr in WebKit2.
799         Because some uses depend on WebCore, WebCore, WK1 ports are modified as well.
800
801         * DatabaseProcess/DatabaseProcess.cpp:
802         (WebKit::DatabaseProcess::getOrCreateUniqueIDBDatabase):
803         * DatabaseProcess/DatabaseProcess.h:
804         * PluginProcess/PluginControllerProxy.cpp:
805         (WebKit::PluginControllerProxy::takeInitializationReply):
806         * PluginProcess/PluginControllerProxy.h:
807         * Shared/CoordinatedGraphics/CoordinatedBackingStore.cpp:
808         (WebKit::CoordinatedBackingStore::texture):
809         * Shared/CoordinatedGraphics/CoordinatedBackingStore.h:
810         (WebKit::CoordinatedBackingStore::create):
811         * Shared/CoordinatedGraphics/WebCoordinatedSurface.cpp:
812         (WebKit::WebCoordinatedSurface::create):
813         (WebKit::WebCoordinatedSurface::createWithSurface):
814         * Shared/CoordinatedGraphics/WebCoordinatedSurface.h:
815         * UIProcess/API/APILoaderClient.h:
816         (API::LoaderClient::webCryptoMasterKey):
817         * UIProcess/API/APINavigationClient.h:
818         (API::NavigationClient::webCryptoMasterKey):
819         * UIProcess/API/C/WKPage.cpp:
820         (WKPageSetPageLoaderClient):
821         (WKPageSetPageNavigationClient):
822         * UIProcess/API/gtk/PageClientImpl.cpp:
823         (WebKit::PageClientImpl::createPopupMenuProxy):
824         (WebKit::PageClientImpl::createContextMenuProxy):
825         (WebKit::PageClientImpl::createColorPicker):
826         * UIProcess/API/gtk/PageClientImpl.h:
827         * UIProcess/Authentication/WebCredential.h:
828         * UIProcess/Authentication/WebProtectionSpace.h:
829         * UIProcess/AutoCorrectionCallback.h:
830         * UIProcess/Cocoa/NavigationState.h:
831         * UIProcess/Cocoa/NavigationState.mm:
832         (WebKit::NavigationState::NavigationClient::webCryptoMasterKey):
833         * UIProcess/CoordinatedGraphics/WebView.cpp:
834         (WebKit::WebView::createPopupMenuProxy):
835         (WebKit::WebView::createContextMenuProxy):
836         (WebKit::WebView::createColorPicker):
837         * UIProcess/CoordinatedGraphics/WebView.h:
838         * UIProcess/PageClient.h:
839         * UIProcess/WebPageProxy.h:
840         * UIProcess/efl/WebViewEfl.cpp:
841         (WebKit::WebViewEfl::createPopupMenuProxy):
842         (WebKit::WebViewEfl::createContextMenuProxy):
843         (WebKit::WebViewEfl::createColorPicker):
844         * UIProcess/efl/WebViewEfl.h:
845         * UIProcess/ios/PageClientImplIOS.h:
846         * UIProcess/ios/PageClientImplIOS.mm:
847         (WebKit::PageClientImpl::createPopupMenuProxy):
848         (WebKit::PageClientImpl::createContextMenuProxy):
849         * UIProcess/ios/WebPageProxyIOS.mm:
850         (WebKit::WebPageProxy::dataSelectionForPasteboard):
851         * UIProcess/mac/PageClientImpl.h:
852         * UIProcess/mac/PageClientImpl.mm:
853         (WebKit::PageClientImpl::createPopupMenuProxy):
854         (WebKit::PageClientImpl::createContextMenuProxy):
855         (WebKit::PageClientImpl::createColorPicker):
856         * UIProcess/mac/WebPageProxyMac.mm:
857         (WebKit::WebPageProxy::dataSelectionForPasteboard):
858         * WebProcess/Network/WebResourceLoadScheduler.cpp:
859         (WebKit::WebResourceLoadScheduler::scheduleSubresourceLoad):
860         (WebKit::WebResourceLoadScheduler::schedulePluginStreamLoad):
861         * WebProcess/Network/WebResourceLoadScheduler.h:
862         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
863         (WebKit::NetscapePlugin::fromNPP):
864         (WebKit::NetscapePlugin::snapshot):
865         (WebKit::NetscapePlugin::liveResourceData):
866         * WebProcess/Plugins/Netscape/NetscapePlugin.h:
867         * WebProcess/Plugins/Plugin.h:
868         * WebProcess/Plugins/PluginProxy.cpp:
869         (WebKit::PluginProxy::snapshot):
870         (WebKit::PluginProxy::liveResourceData):
871         * WebProcess/Plugins/PluginProxy.h:
872         * WebProcess/Storage/StorageNamespaceImpl.cpp:
873         (WebKit::StorageNamespaceImpl::storageArea):
874         (WebKit::StorageNamespaceImpl::copy):
875         * WebProcess/Storage/StorageNamespaceImpl.h:
876         * WebProcess/WebCoreSupport/SessionStateConversion.cpp:
877         (WebKit::toHistoryItem):
878         * WebProcess/WebCoreSupport/SessionStateConversion.h:
879         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
880         (WebKit::WebChromeClient::createPopupMenu):
881         (WebKit::WebChromeClient::createSearchPopupMenu):
882         * WebProcess/WebCoreSupport/WebChromeClient.h:
883         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
884         (WebKit::WebFrameLoaderClient::createDocumentLoader):
885         (WebKit::WebFrameLoaderClient::createFrame):
886         (WebKit::WebFrameLoaderClient::createPlugin):
887         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
888         * WebProcess/WebPage/WebPage.cpp:
889         (WebKit::WebPage::create):
890         (WebKit::WebPage::createDocumentLoader):
891         * WebProcess/WebPage/WebPage.h:
892         * WebProcess/WebPage/mac/WebPageMac.mm:
893         (WebKit::WebPage::lookupTextAtLocation):
894
895 2015-07-18  Simon Fraser  <simon.fraser@apple.com>
896
897         Scroll position jumps when scrolling scaling pages down in split view
898         https://bugs.webkit.org/show_bug.cgi?id=147072
899         rdar://problem/21769577
900
901         Reviewed by Sam Weinig.
902         
903         When apple.com/music is in Split View at a reduced scale, scrolling the page
904         can cause unwanted scroll jumps. This happened because we'd enter
905         TiledCoreAnimationDrawingArea::scaleViewToFitDocumentIfNeeded() with a pending
906         layout, so run the autosizing logic. When scrolled near the bottom, the unconstrained
907         layout resulted in a shorter document, which truncated the scroll position. The
908         scaled layout then restored the longer document, but it also restored that
909         truncated scroll position.
910         
911         Forcing a layout is sufficient to fix the bug for this page, and doing a single
912         layout (which will happen anyway) is preferable to running the autosize logic
913         if layout happens to be dirty.
914
915         I was not able to make a test to reproduce the problem. Entering
916         scaleViewToFitDocumentIfNeeded() with pending layout was triggerable
917         using a transform transition, but I was not able to reproduce incorrect
918         scroll position restoration.
919
920         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
921         (WebKit::TiledCoreAnimationDrawingArea::scaleViewToFitDocumentIfNeeded):
922
923 2015-07-17  Andy Estes  <aestes@apple.com>
924
925         [iOS] Further tighten the sandbox around pages fetched with Content-Disposition: attachment
926         https://bugs.webkit.org/show_bug.cgi?id=147044
927         rdar://problem/21567820
928
929         Reviewed by Brady Eidson.
930
931         * WebProcess/WebPage/WebPage.cpp:
932         (WebKit::WebPage::WebPage): Enabled Content-Disposition: attachment sandbox on iOS.
933
934 2015-07-17  Tim Horton  <timothy_horton@apple.com>
935
936         [iOS] TextIndicator has a large forehead when line-height > 1
937         https://bugs.webkit.org/show_bug.cgi?id=147058
938         <rdar://problem/21643094>
939
940         Reviewed by Dean Jackson.
941
942         * WebProcess/WebPage/ios/WebPageIOS.mm:
943         (WebKit::WebPage::getPositionInformation):
944         Apply a review comment that I left myself and then forgot about.
945
946 2015-07-17  Enrica Casucci  <enrica@apple.com>
947
948         [iOS] Implement selectionInteractionAssistant accessor.
949         https://bugs.webkit.org/show_bug.cgi?id=147054
950         rdar://problem/20864286
951
952         Reviewed by Tim Horton.
953
954         One more change to adopt the new selection interaction
955         model on iOS.
956
957         * UIProcess/ios/WKContentViewInteraction.mm:
958         (-[WKContentView selectionInteractionAssistant]):
959
960 2015-07-17  Dan Bernstein  <mitz@apple.com>
961
962         REGRESSION (r186964): Crash in WebKit2.CloseFromWithinCreatePage
963         https://bugs.webkit.org/show_bug.cgi?id=147055
964
965         Reviewed by Alex Christensen.
966
967         * UIProcess/WebPageProxy.cpp:
968         (WebKit::WebPageProxy::createNewPage): Grab the main frame’s URL before calling out to the
969         client, who may destroy the frame.
970
971 2015-07-17  Dan Bernstein  <mitz@apple.com>
972
973         WebKit2 part of <rdar://problem/21803781> The external URL policy is not reported correctly in navigation actions that create new windows
974         https://bugs.webkit.org/show_bug.cgi?id=147040
975
976         Reviewed by Dean Jackson.
977
978         * UIProcess/Cocoa/UIDelegate.mm:
979         (WebKit::UIDelegate::UIClient::createNewPage): Disallow App Links if the new page is for the
980         same protocol, host and port as the main frame of this page.
981
982         * UIProcess/WebPageProxy.cpp:
983         (WebKit::WebPageProxy::decidePolicyForNavigationAction): Disallow App Links if
984         m_shouldSuppressAppLinksInNextNavigationPolicyDecision is set, and reset it. See below for
985         when we set it.
986         (WebKit::WebPageProxy::decidePolicyForNewWindowAction): Disallow App Links if the new window
987         is for the same protocol, host and port as the main frame of this page.
988         (WebKit::WebPageProxy::createNewPage): Make the new page disallow App Links in the first
989         policy decision if it is for the same protocol, host and port as the main frame of this
990         page.
991         * UIProcess/WebPageProxy.h: Added m_shouldSuppressAppLinksInNextNavigationPolicyDecision
992         member variable.
993
994         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
995         (WebKit::WebChromeClient::createWindow): Pass the shouldOpenExternalURLsPolicy.
996
997         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
998         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNewWindowAction): Ditto.
999
1000 2015-07-17  Tim Horton  <timothy_horton@apple.com>
1001
1002         iOS TextIndicators include text that is not supposed to be indicated
1003         https://bugs.webkit.org/show_bug.cgi?id=147028
1004         <rdar://problem/21643094>
1005
1006         Reviewed by Sam Weinig.
1007
1008         * WebProcess/Plugins/PluginView.cpp:
1009         (WebKit::PluginView::shouldCreateTransientPaintingSnapshot):
1010
1011 2015-07-17  Carlos Garcia Campos  <cgarcia@igalia.com>
1012
1013         [GTK] Cleanup PasteboardHelper
1014         https://bugs.webkit.org/show_bug.cgi?id=147035
1015
1016         Reviewed by Žan Doberšek.
1017
1018         Use PasteboardHelper::singleton() instead of
1019         PasteboardHelper::defaultPasteboardHelper().
1020
1021         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
1022         (webkitWebViewBaseConstructed):
1023         * UIProcess/gtk/DragAndDropHandler.cpp:
1024         (WebKit::DragAndDropHandler::startDrag):
1025         (WebKit::DragAndDropHandler::fillDragData):
1026         (WebKit::DragAndDropHandler::dataObjectForDropData):
1027         (WebKit::DragAndDropHandler::requestDragData):
1028
1029 2015-07-16  Matt Baker  <mattbaker@apple.com>
1030
1031         [Mac] Web Inspector toolbar can be covered by the Safari tab bar when docked to the right
1032         https://bugs.webkit.org/show_bug.cgi?id=146994
1033
1034         Reviewed by Timothy Hatcher.
1035
1036         WebInspectorProxy contained logic which ignored the next frame change notification from the inspected view,
1037         whenever it updated the frames of both the Inspector view and inspected view. This patch removes that logic,
1038         as it prevented the Inspector's frame from being adjusted after changes to the browser's top content inset.
1039
1040         * UIProcess/mac/WebInspectorProxyMac.mm:
1041         (-[WKWebInspectorProxyObjCAdapter ignoreNextInspectedViewFrameDidChange]): Deleted.
1042         (-[WKWebInspectorProxyObjCAdapter inspectedViewFrameDidChange:]): Deleted.
1043         (WebKit::WebInspectorProxy::inspectedViewFrameDidChange): Deleted.
1044
1045 2015-07-16  Joseph Pecoraro  <pecoraro@apple.com>
1046
1047         Web Inspector: [Mac] Save dialog not working when inspector is docked
1048         https://bugs.webkit.org/show_bug.cgi?id=146991
1049
1050         Reviewed by Sam Weinig.
1051
1052         * UIProcess/mac/WebInspectorProxyMac.mm:
1053         (WebKit::runOpenPanel):
1054         (WebKit::WebInspectorProxy::platformSave):
1055         When the window is nil (docked) use a non-window version of running the dialog.
1056
1057 2015-07-16  Tim Horton  <timothy_horton@apple.com>
1058
1059         Add shrink-wrapped link highlights
1060         https://bugs.webkit.org/show_bug.cgi?id=147021
1061         <rdar://problem/21643094>
1062
1063         Reviewed by Enrica Casucci.
1064
1065         * Shared/InteractionInformationAtPosition.cpp:
1066         (WebKit::InteractionInformationAtPosition::encode):
1067         (WebKit::InteractionInformationAtPosition::decode):
1068         * Shared/InteractionInformationAtPosition.h:
1069         Add a TextIndicator to InteractionInformationAtPosition.
1070         Make use of some new C++ features.
1071
1072         * UIProcess/ios/WKContentViewInteraction.h:
1073         * UIProcess/ios/WKContentViewInteraction.mm:
1074         (-[WKContentView willPresentPreviewViewController:forPosition:inSourceView:]):
1075         (-[WKContentView didDismissPreviewViewController:committing:]):
1076         Make use of the TextIndicator (if we have one) to show a shrink-wrapped
1077         snapshot of the link.
1078
1079         * WebProcess/WebPage/ios/WebPageIOS.mm:
1080         (WebKit::WebPage::getPositionInformation):
1081         Build a TextIndicator for the link if possible.
1082
1083 2015-07-16  Matt Rajca  <mrajca@apple.com>
1084
1085         Media Session: remove plumbing for delivering start/end-of-interruption events
1086         https://bugs.webkit.org/show_bug.cgi?id=147005
1087
1088         Reviewed by Eric Carlson.
1089
1090         Instead of receiving interruptions through WebKit, we will provide platform-specific implementations in WebCore
1091         so the same behavior is available to all clients.
1092
1093         * UIProcess/API/C/WKPage.cpp:
1094         * UIProcess/API/C/WKPagePrivate.h:
1095         * UIProcess/WebPageProxy.cpp:
1096         * UIProcess/WebPageProxy.h:
1097         * WebProcess/WebPage/WebPage.cpp:
1098         * WebProcess/WebPage/WebPage.h:
1099         * WebProcess/WebPage/WebPage.messages.in:
1100
1101 2015-07-16  Michael Catanzaro  <mcatanzaro@igalia.com>
1102
1103         REGRESSION(r186464): [SOUP] ASSERTION FAILED: !m_messageReceiverMapCount when closing any tab
1104         https://bugs.webkit.org/show_bug.cgi?id=147006
1105
1106         Reviewed by Anders Carlsson.
1107
1108         Remove the message receiver before it is deallocated.
1109
1110         * UIProcess/Network/CustomProtocols/soup/CustomProtocolManagerProxySoup.cpp:
1111         (WebKit::CustomProtocolManagerProxy::~CustomProtocolManagerProxy):
1112
1113 2015-07-16  Brady Eidson  <beidson@apple.com>
1114
1115         Review feedback followup for:
1116         REGRESSION(r186088): Crash under WebKit::WebPageProxy::didFailLoadForFrame
1117         <rdar://problem/21692212> and https://bugs.webkit.org/show_bug.cgi?id=146988
1118
1119         * UIProcess/mac/PageClientImpl.mm:
1120         (WebKit::PageClientImpl::refView): CFRetain instead of Obj-C retain.
1121         (WebKit::PageClientImpl::derefView): CFRelease instead of Obj-C release.
1122
1123
1124 2015-07-16  Michael Catanzaro  <mcatanzaro@igalia.com>
1125
1126         [Linux] Seccomp: fix -Wmismatched-tags
1127         https://bugs.webkit.org/show_bug.cgi?id=146990
1128
1129         Reviewed by Žan Doberšek.
1130
1131         WebProcessCreationParameters is a struct nowadays, not a class, so declare it appropriately.
1132
1133         * Shared/linux/SeccompFilters/SyscallPolicy.h:
1134
1135 2015-07-16  Carlos Garcia Campos  <cgarcia@igalia.com>
1136
1137         REGRESSION(r185415): [GTK] Browsers crash when an input method is enabled
1138         https://bugs.webkit.org/show_bug.cgi?id=146639
1139
1140         Reviewed by Žan Doberšek.
1141
1142         In r185415 I assumed that preedit signals were always emitted
1143         after a keypress was handled by the WebView. However, some input
1144         methods handle the keyboard events before the WebView, and preedit
1145         signals are emitted but no key event has been handled by the
1146         WebView. So, instead of asserting when filter key event completion
1147         handler is nullptr, we should check whether the current event was
1148         generated for a WebView filter request or not. In case the
1149         completion handler is nullptr, we send the event directly to the
1150         page, instead of going through the WebView, since there won't be
1151         editing commands for those events anyway.
1152
1153         * UIProcess/gtk/InputMethodFilter.cpp:
1154         (WebKit::InputMethodFilter::handleKeyboardEvent):
1155         (WebKit::InputMethodFilter::handleKeyboardEventWithCompositionResults):
1156
1157 2015-07-15  Carlos Garcia Campos  <cgarcia@igalia.com>
1158
1159         Unreviewed. Follow up to r186887 for GTK+.
1160
1161         Add GTK+ implementation of PageClientImpl::refView/derefView.
1162
1163         * UIProcess/API/gtk/PageClientImpl.cpp:
1164         (WebKit::PageClientImpl::refView):
1165         (WebKit::PageClientImpl::derefView):
1166         * UIProcess/API/gtk/PageClientImpl.h:
1167
1168 2015-07-15  Carlos Garcia Campos  <cgarcia@igalia.com>
1169
1170         [GTK] Input method filter is always enabled when the view is focused
1171         https://bugs.webkit.org/show_bug.cgi?id=146965
1172
1173         Reviewed by Martin Robinson.
1174
1175         It should only be enabled when the view is focused and there's an
1176         editable element focused. In r138544, when input methods were
1177         implemented, the message SetInputMethodState was added, but it was
1178         never used. Instead, the notifyFocusIn method of the IM filter
1179         enables the input method unconditionally. We should actually use
1180         the SetInputMethodState message to enable/disable input methods
1181         when editable elements are focused/unfocused.
1182
1183         * UIProcess/gtk/InputMethodFilter.cpp:
1184         (WebKit::InputMethodFilter::setEnabled): Call notifyFocusedIn/Out
1185         when inputs methods are enabled/disabled instead of notifying the
1186         IM context directly.
1187         (WebKit::InputMethodFilter::setCursorRect): Do not update the
1188         cursor position if input methods are didabled.
1189         (WebKit::InputMethodFilter::notifyFocusedIn): Do nothing when
1190         input methods are disabled. Do not enable input methods
1191         uncontionally here.
1192         (WebKit::InputMethodFilter::notifyFocusedOut): Do not disable
1193         input methods uncontionally here.
1194         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
1195         (WebKit::WebEditorClient::setInputMethodState): Call
1196         WebPage::setInputMethodState() for GTK platform.
1197         * WebProcess/WebPage/WebPage.h: Add setInputMethodState() for GTK platform.
1198         * WebProcess/WebPage/gtk/WebPageGtk.cpp:
1199         (WebKit::WebPage::setInputMethodState): Update input method state
1200         and send SetInputMethodState message to the UI process if state changed.
1201
1202 2015-07-15  Brady Eidson  <beidson@apple.com>
1203
1204         REGRESSION(r186088): Crash under WebKit::WebPageProxy::didFailLoadForFrame
1205         <rdar://problem/21692212> and https://bugs.webkit.org/show_bug.cgi?id=146988
1206
1207         Reviewed by Sam Weinig.
1208
1209         When a loader delegate callback results in the WKView getting deallocated, then the PageClient
1210         is also destroyed.
1211
1212         WebPageProxy then (often) turns around and uses the PageClient anyways.
1213
1214         Tried to write a TestWebKitAPI test for this, but only didFailLoadForFrame appears to obviously 
1215         be vulnerable, and there seems to be no way to reproduce that failure case under TestWebKitAPI.
1216
1217         * UIProcess/PageClient.h: Add ref/derefView.
1218
1219         * UIProcess/API/gtk/PageClientImpl.h: Stub them out.
1220         * UIProcess/efl/WebViewEfl.h: Stub them out.
1221
1222         * UIProcess/mac/PageClientImpl.h:
1223         * UIProcess/mac/PageClientImpl.mm:
1224         (WebKit::PageClientImpl::refView): [m_wkView retain]
1225         (WebKit::PageClientImpl::derefView): [m_wkView release]
1226
1227         * UIProcess/ios/PageClientImplIOS.h:
1228         * UIProcess/ios/PageClientImplIOS.mm:
1229         (WebKit::PageClientImpl::refView): Retain all 3 views.
1230         (WebKit::PageClientImpl::derefView): Release all 3 views.
1231
1232         * UIProcess/WebPageProxy.cpp:
1233         (WebKit::PageClientProtector::PageClientProtector): Calls refView() on the PageClient.
1234         (WebKit::PageClientProtector::~PageClientProtector): Calls derefView() on the PageClient.
1235         (WebKit::WebPageProxy::didChangeBackForwardList): All methods that make m_loaderClient or
1236           m_pageClient callouts get a protector at their head.
1237         (WebKit::WebPageProxy::willGoToBackForwardListItem):
1238         (WebKit::WebPageProxy::shouldKeepCurrentBackForwardListItemInList):
1239         (WebKit::WebPageProxy::findPlugin):
1240         (WebKit::WebPageProxy::didCreateMainFrame):
1241         (WebKit::WebPageProxy::didCreateSubframe):
1242         (WebKit::WebPageProxy::didStartProgress):
1243         (WebKit::WebPageProxy::didChangeProgress):
1244         (WebKit::WebPageProxy::didFinishProgress):
1245         (WebKit::WebPageProxy::didDestroyNavigation):
1246         (WebKit::WebPageProxy::didStartProvisionalLoadForFrame):
1247         (WebKit::WebPageProxy::didReceiveServerRedirectForProvisionalLoadForFrame):
1248         (WebKit::WebPageProxy::didChangeProvisionalURLForFrame):
1249         (WebKit::WebPageProxy::didFailProvisionalLoadForFrame):
1250         (WebKit::WebPageProxy::didCommitLoadForFrame):
1251         (WebKit::WebPageProxy::didFinishDocumentLoadForFrame):
1252         (WebKit::WebPageProxy::didFinishLoadForFrame):
1253         (WebKit::WebPageProxy::didFailLoadForFrame):
1254         (WebKit::WebPageProxy::didSameDocumentNavigationForFrame):
1255         (WebKit::WebPageProxy::didReceiveTitleForFrame):
1256         (WebKit::WebPageProxy::didFirstLayoutForFrame):
1257         (WebKit::WebPageProxy::didFirstVisuallyNonEmptyLayoutForFrame):
1258         (WebKit::WebPageProxy::didLayoutForCustomContentProvider):
1259         (WebKit::WebPageProxy::didLayout):
1260         (WebKit::WebPageProxy::didRemoveFrameFromHierarchy):
1261         (WebKit::WebPageProxy::didDisplayInsecureContentForFrame):
1262         (WebKit::WebPageProxy::didRunInsecureContentForFrame):
1263         (WebKit::WebPageProxy::didDetectXSSForFrame):
1264         (WebKit::WebPageProxy::frameDidBecomeFrameSet):
1265         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
1266         (WebKit::WebPageProxy::decidePolicyForNewWindowAction):
1267         (WebKit::WebPageProxy::decidePolicyForResponse):
1268         (WebKit::WebPageProxy::decidePolicyForResponseSync):
1269         (WebKit::WebPageProxy::unableToImplementPolicy):
1270         (WebKit::WebPageProxy::didNavigateWithNavigationData):
1271         (WebKit::WebPageProxy::didPerformClientRedirect):
1272         (WebKit::WebPageProxy::didPerformServerRedirect):
1273         (WebKit::WebPageProxy::didUpdateHistoryTitle):
1274         (WebKit::WebPageProxy::wrapCryptoKey):
1275         (WebKit::WebPageProxy::unwrapCryptoKey):
1276         (WebKit::WebPageProxy::navigationGestureDidBegin):
1277         (WebKit::WebPageProxy::navigationGestureWillEnd):
1278         (WebKit::WebPageProxy::navigationGestureDidEnd):
1279         (WebKit::WebPageProxy::willRecordNavigationSnapshot):
1280
1281 2015-07-15  Sam Weinig  <sam@webkit.org>
1282
1283         Color match plug-ins
1284         <rdar://problem/21758722>
1285         https://bugs.webkit.org/show_bug.cgi?id=146987
1286
1287         Reviewed by Dean Jackson.
1288
1289         * Platform/mac/LayerHostingContext.h:
1290         * Platform/mac/LayerHostingContext.mm:
1291         (WebKit::LayerHostingContext::setColorMatchUntaggedContent):
1292         (WebKit::LayerHostingContext::colorMatchUntaggedContent):
1293         Add setter/getter for color matching untagged content.
1294
1295         * PluginProcess/mac/PluginControllerProxyMac.mm:
1296         (WebKit::PluginControllerProxy::updateLayerHostingContext):
1297         Have plug-ins CAContext's color match untagged colors into sRGB.
1298
1299 2015-07-15  Michael Catanzaro  <mcatanzaro@igalia.com>
1300
1301         [GTK] Rename PACKAGE_LOCALE_DIR to LOCALEDIR
1302         https://bugs.webkit.org/show_bug.cgi?id=146975
1303
1304         Reviewed by Martin Robinson.
1305
1306         * PlatformGTK.cmake:
1307         * UIProcess/API/gtk/WebKitWebContext.cpp:
1308         (webkit_web_context_class_init):
1309         * WebProcess/gtk/WebProcessMainGtk.cpp:
1310
1311 2015-07-15  Michael Catanzaro  <mcatanzaro@igalia.com>
1312
1313         [GTK] Rename LIBEXECDIR to PKGLIBEXECDIR
1314         https://bugs.webkit.org/show_bug.cgi?id=140070
1315
1316         Reviewed by Martin Robinson.
1317
1318         The path that's currently stored in LIBEXECDIR is one level lower than
1319         the real LIBEXECDIR, which we are going to need. Introduce PKGLIBEXECDIR
1320         so that we can use LIBEXECDIR for the real LIBEXECDIR in the future.
1321
1322         * PlatformGTK.cmake:
1323         * Shared/gtk/ProcessExecutablePathGtk.cpp:
1324         (WebKit::findWebKitProcess):
1325
1326 2015-07-15  Daniel Bates  <dabates@apple.com>
1327
1328         [Mac][WK2] Videos should only have access to cookies when -[NSURLRequest HTTPShouldHandleCookies] is YES
1329         https://bugs.webkit.org/show_bug.cgi?id=146763
1330         <rdar://problem/21736994>
1331
1332         Reviewed by Darin Adler.
1333
1334         We should only fetch cookies from the Network process when -[NSURLRequest HTTPShouldHandleCookies] is YES.
1335         This makes us more closely match the behavior of the CFNetwork implementation of
1336         -[__NSURLSessionLocal {_copyCookiesForRequestUsingAllAppropriateStorageSemantics, _getCookieHeadersForTask:completionHandler}].
1337
1338         * Shared/mac/CookieStorageShim.mm:
1339         (-[WKNSURLSessionLocal _copyCookiesForRequestUsingAllAppropriateStorageSemantics:]):
1340         (-[WKNSURLSessionLocal _getCookieHeadersForTask:completionHandler:]):
1341
1342 2015-07-14  Enrica Casucci  <enrica@apple.com>
1343
1344         [iOS] Add support for updateSelectionWithExtentPoint:withBoundary.
1345         https://bugs.webkit.org/show_bug.cgi?id=146951
1346         rdar://problem/20864286
1347
1348         Reviewed by Tim Horton.
1349
1350         Add implementation for new method used by text selection
1351         engine on iOS. The new function modifies the selection near the given point
1352         and snaps it at the boundary of the specified granularity.
1353
1354         * UIProcess/WebPageProxy.h:
1355         * UIProcess/ios/WKContentViewInteraction.mm:
1356         (-[WKContentView updateSelectionWithExtentPoint:completionHandler:]):
1357         (-[WKContentView updateSelectionWithExtentPoint:withBoundary:completionHandler:]):
1358         (-[WKContentView _characterBeforeCaretSelection]):
1359         * UIProcess/ios/WebPageProxyIOS.mm:
1360         (WebKit::WebPageProxy::updateSelectionWithExtentPoint):
1361         (WebKit::WebPageProxy::updateSelectionWithExtentPointAndBoundary):
1362         (WebKit::WebPageProxy::requestDictationContext):
1363         * WebProcess/WebPage/WebPage.h:
1364         * WebProcess/WebPage/WebPage.messages.in:
1365         * WebProcess/WebPage/ios/WebPageIOS.mm:
1366         (WebKit::WebPage::rangeForGranularityAtPoint):
1367         (WebKit::WebPage::selectTextWithGranularityAtPoint):
1368         (WebKit::WebPage::updateSelectionWithExtentPointAndBoundary):
1369
1370 2015-07-15  Michael Catanzaro  <mcatanzaro@igalia.com>
1371
1372         [Linux] SeccompBrokerClient should cache arbitrary file descriptors
1373         https://bugs.webkit.org/show_bug.cgi?id=140068
1374
1375         Reviewed by Žan Doberšek.
1376
1377         If malloc() attempts to open /proc/sys/vm/overcommit_memory in a SIGSYS
1378         signal handler, the SeccompBroker will attempt to recursively broker the
1379         open() syscall. Generalize the existing code that already handles the
1380         similar case where malloc() opens /sys/devices/system/cpu/online to
1381         handle this situation as well.
1382
1383         * Shared/linux/SeccompFilters/SeccompBroker.cpp:
1384         (WebKit::SIGSYSHandler):
1385         (WebKit::SeccompBrokerClient::SeccompBrokerClient):
1386         (WebKit::SeccompBrokerClient::~SeccompBrokerClient):
1387         (WebKit::SeccompBrokerClient::handleIfOpeningCachedFile):
1388         (WebKit::SeccompBrokerClient::cacheFile):
1389         (WebKit::SeccompBrokerClient::handleIfOpeningOnlineCPUCount): Deleted.
1390
1391 2015-07-15  ChangSeok Oh  <changseok.oh@collabora.com>
1392
1393         [GTK] Accelerated compositing is enabled by MiniBrowser in Wayland
1394         https://bugs.webkit.org/show_bug.cgi?id=146827
1395
1396         Reviewed by Žan Doberšek.
1397
1398         WebKit2Gtk+ does not currently support accelerated compositing. For the reason,
1399         we forcedly disable it in webkitWebViewBaseCreateWebPage. However, when we launch
1400         MiniBrowser in wayland, the unsupported feature is re-enabled since the existing
1401         setting is overwritten by a newly created one. Here the default value for
1402         accelerated compositing is true. We can fix this by moving the code disabling
1403         accelerated composition to WebPreferences::platformInitializeStore() so that
1404         we make sure the accelerated compositing is always disabled for wayland.
1405
1406         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
1407         (webkitWebViewBaseCreateWebPage): Deleted.
1408         * UIProcess/gtk/WebPreferencesGtk.cpp:
1409         (WebKit::WebPreferences::platformInitializeStore):
1410
1411 2015-07-15  Dan Bernstein  <mitz@apple.com>
1412
1413         Fixed build fix.
1414
1415         * Platform/spi/ios/SafariServicesSPI.h:
1416
1417 2015-07-14  Ryuan Choi  <ryuan.choi@navercorp.com>
1418
1419         [CoordinatedGraphics] Possible wrong rendering with scrolling
1420         https://bugs.webkit.org/show_bug.cgi?id=146958
1421
1422         Reviewed by Gyuyoung Kim.
1423
1424         While r174261 fixing build break, there is some mistake that flushes contents layer
1425         instead of overlay layer.
1426
1427         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
1428         (WebKit::CoordinatedLayerTreeHost::didFlushRootLayer):
1429
1430 2015-07-14  Dan Bernstein  <mitz@apple.com>
1431
1432         Attempted build fixes.
1433
1434         * Platform/spi/ios/SafariServicesSPI.h:
1435
1436 2015-07-14  Dan Bernstein  <mitz@apple.com>
1437
1438         Attempted build fixes.
1439
1440         * Platform/spi/ios/SafariServicesSPI.h:
1441
1442 2015-07-14  Anders Carlsson  <andersca@apple.com>
1443
1444         Remove wkPopupMenu from WebCoreSystemInterface; it's not called from WebCore
1445         https://bugs.webkit.org/show_bug.cgi?id=146945
1446
1447         Reviewed by Tim Horton.
1448
1449         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
1450         (InitWebCoreSystemInterface): Deleted.
1451
1452 2015-07-14  Anders Carlsson  <andersca@apple.com>
1453
1454         Release assert under StyleResolver::loadPendingImages() caused by MemoryPressureHandler
1455         https://bugs.webkit.org/show_bug.cgi?id=146940
1456         rdar://problem/21605505
1457
1458         Reviewed by Sam Weinig.
1459
1460         * WebProcess/WebProcess.cpp:
1461         (WebKit::WebProcess::processWillSuspendImminently):
1462
1463 2015-07-14  Sam Weinig  <sam@webkit.org>
1464
1465         WebKit needs to serialize numeric values in NSError userInfo
1466         <rdar://problem/21818117>
1467         https://bugs.webkit.org/show_bug.cgi?id=146936
1468
1469         Reviewed by Anders Carlsson.
1470
1471         * Shared/mac/WebCoreArgumentCodersMac.mm:
1472         (IPC::ArgumentCoder<ResourceError>::encodePlatformData):
1473         Encode userInfo values that are NSNumbers in addition to NSStrings and NSURLs. Decoding 
1474         is already handled.
1475
1476 2015-07-14  Michael Catanzaro  <mcatanzaro@igalia.com>
1477
1478         [Linux] SeccompFilters: whitelist all NPAPI plugin directories
1479         https://bugs.webkit.org/show_bug.cgi?id=140067
1480
1481         Reviewed by Žan Doberšek.
1482
1483         * PlatformEfl.cmake: Build PluginSearchPath.cpp
1484         * PlatformGTK.cmake: Build PluginSearchPath.cpp
1485         * Shared/Plugins/unix/PluginSearchPath.cpp: Added.
1486         (WebKit::pluginsDirectories): Moved from PluginInfoStoreUnix.cpp.
1487         * Shared/Plugins/unix/PluginSearchPath.h: Added.
1488         * Shared/linux/SeccompFilters/SyscallPolicy.cpp:
1489         (WebKit::SyscallPolicy::addDefaultWebProcessPolicy): Add the entire
1490         plugin search path to the whitelist.
1491         * UIProcess/Plugins/unix/PluginInfoStoreUnix.cpp:
1492         (WebKit::PluginInfoStore::pluginsDirectories): Now gets plugins
1493         directories from PluginSearchPath.cpp
1494
1495 2015-07-14  Yongjun Zhang  <yongjun_zhang@apple.com>
1496
1497         https://bugs.webkit.org/show_bug.cgi?id=146917
1498         iOS WebKit doesn't build.
1499         rdar://problem/21801544
1500
1501         Fix the build - don't use deprecated methods.
1502
1503         Reviewed by Dan Bernstein.
1504
1505         * UIProcess/ios/WKContentViewInteraction.h:
1506         * UIProcess/ios/WKContentViewInteraction.mm:
1507         (-[WKContentView _registerPreviewInWindow:]):
1508         (-[WKContentView _unregisterPreviewInWindow:]):
1509
1510 2015-07-14  Yongjun Zhang  <yongjun_zhang@apple.com>
1511
1512         https://bugs.webkit.org/show_bug.cgi?id=146909
1513         Add actions for default link preview that uses SFSafariViewController.
1514
1515         Use the new private properties to prepare actions for the default link preview controller.
1516
1517         Reviewed by Dan Bernstein.
1518
1519         * UIProcess/ios/WKContentViewInteraction.mm:
1520         (-[WKContentView previewViewControllerForPosition:inSourceView:]):
1521
1522 2015-07-14  Michael Catanzaro  <mcatanzaro@igalia.com>
1523
1524         [Linux] SeccompFilters: whitelist source directory on all ports
1525         https://bugs.webkit.org/show_bug.cgi?id=140066
1526
1527         Reviewed by Žan Doberšek.
1528
1529         Move this from EFL to port-independent code.
1530
1531         * Shared/linux/SeccompFilters/SyscallPolicy.cpp:
1532         (WebKit::SyscallPolicy::addDefaultWebProcessPolicy):
1533         * WebProcess/efl/SeccompFiltersWebProcessEfl.cpp:
1534         (WebKit::SeccompFiltersWebProcessEfl::platformInitialize):
1535
1536 2015-07-14  Zan Dobersek  <zdobersek@igalia.com>
1537
1538         [GTK] Add a runtime check for X11 display in webkitWebViewBaseExitAcceleratedCompositingMode()
1539         https://bugs.webkit.org/show_bug.cgi?id=146711
1540
1541         Reviewed by Carlos Garcia Campos.
1542
1543         webkitWebViewBaseExitAcceleratedCompositingMode() is already guarded with
1544         X11 build guards, but it should also do a runtime check that the program
1545         is running under an X11 display before proceeding.
1546
1547         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
1548         (webkitWebViewBaseDidRelaunchWebProcess):
1549
1550 2015-07-13  Matt Rajca  <mrajca@apple.com>
1551
1552         Media Session: add plumbing for delivering start/end-of-interruption events
1553         https://bugs.webkit.org/show_bug.cgi?id=146837
1554
1555         Reviewed by Tim Horton.
1556
1557         * UIProcess/API/C/WKPage.cpp:
1558         (WKPageHandleMediaSessionInterruptionEvent):
1559         * UIProcess/API/C/WKPagePrivate.h:
1560         * UIProcess/WebPageProxy.cpp:
1561         (WebKit::WebPageProxy::handleMediaSessionInterruptionEvent):
1562         * UIProcess/WebPageProxy.h:
1563         * WebProcess/WebPage/WebPage.cpp:
1564         (WebKit::WebPage::handleMediaSessionInterruptionEvent):
1565         * WebProcess/WebPage/WebPage.h:
1566         * WebProcess/WebPage/WebPage.messages.in:
1567
1568 2015-07-13  Simon Fraser  <simon.fraser@apple.com>
1569
1570         [iOS WK2] When choosing an initial viewport scale, take overflow on the <body> into account
1571         https://bugs.webkit.org/show_bug.cgi?id=146918
1572         rdar://problem/9222837
1573
1574         Reviewed by Tim Horton.
1575
1576         Use as input to the viewport scaling algorithm a contents size from the FrameView
1577         that takes overflow on the viewport renderer into account. This prevents unexpected
1578         viewports scaling on pages that have content that overflows their expressed contents size,
1579         but apply overflow to the <body>.
1580
1581         * WebProcess/WebPage/WebPage.cpp:
1582         (WebKit::WebPage::mainFrameDidLayout): Use contentsSizeRespectingOverflow(),
1583         rather than raw contentsSize(), to determine scaling.
1584
1585 2015-07-13  Dan Bernstein  <mitz@apple.com>
1586
1587         Fixed the build.
1588
1589         * UIProcess/ios/WKContentViewInteraction.mm:
1590         (-[WKContentView _registerPreviewInWindow:]):
1591         (-[WKContentView _unregisterPreviewInWindow:]):
1592
1593 2015-07-13  Dan Bernstein  <mitz@apple.com>
1594
1595         Removed now-unused SPI -[WKWebView _loadRequest:withOptions:].
1596
1597         Rubber-stamped by Anders Carlsson.
1598
1599         * UIProcess/API/Cocoa/WKWebView.mm:
1600         (-[WKWebView _loadRequest:withOptions:]): Deleted.
1601         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1602
1603 2015-07-13  Anders Carlsson  <andersca@apple.com>
1604
1605         Apps linked with a deployment target of iOS 7.x or earlier crash when using modern WebKit API
1606         https://bugs.webkit.org/show_bug.cgi?id=146913
1607         rdar://problem/21789252
1608
1609         Reviewed by Dan Bernstein.
1610
1611         Make a top-level symlink from /System/Library/PrivateFrameworks/WebKit.framework to
1612         /System/Library/Frameworks/WebKit.framework.
1613
1614         * WebKit2.xcodeproj/project.pbxproj:
1615
1616 2015-07-13  Anders Carlsson  <andersca@apple.com>
1617
1618         Silverlight causes tabs to hang
1619         https://bugs.webkit.org/show_bug.cgi?id=146912
1620         rdar://problem/21686508
1621
1622         Reviewed by Sam Weinig.
1623
1624         Make sure to link production builds of the legacy plug-in process against the shim on 10.11 and newer.
1625
1626         * Configurations/PluginProcess.xcconfig:
1627
1628 2015-07-13  Michael Catanzaro  <mcatanzaro@igalia.com>
1629
1630         [Linux] SeccompFilters: handle alternate install prefixes
1631         https://bugs.webkit.org/show_bug.cgi?id=140065
1632
1633         Reviewed by Žan Doberšek.
1634
1635         If the install prefix is something other than /usr, e.g. /usr/local or
1636         ~/jhbuild/install, then we want to make sure to allow libraries and data
1637         from that prefix.
1638
1639         * PlatformEfl.cmake:
1640         * Shared/linux/SeccompFilters/SyscallPolicy.cpp:
1641         (WebKit::SyscallPolicy::addDefaultWebProcessPolicy):
1642
1643 2015-07-13  Carlos Garcia Campos  <cgarcia@igalia.com>
1644
1645         [GTK] Contents not correctly laid out when the web view is not realized
1646         https://bugs.webkit.org/show_bug.cgi?id=142532
1647
1648         Reviewed by Darin Adler.
1649
1650         The problem is that we are not reporting any size until the web
1651         view is realized, so any web view loaded in a separate tab in the
1652         browser, will report 0x0 as the window.innerWidth,
1653         window.innerHeight until the view is realized. Websites that use
1654         the window.innerWidth/innerHeight during the page load to decide
1655         how to lay out the contents will be rendered wrongly.
1656         I haven't been able to reproduce this with unit tests, as this
1657         requires the particular case of same window but different web
1658         views using tabs for example.
1659
1660         * UIProcess/API/gtk/PageClientImpl.cpp:
1661         (WebKit::PageClientImpl::viewSize): Always report the drawing area
1662         size to make usre it's in sync with the WebProcess page size.
1663         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
1664         (webkitWebViewBaseSizeAllocate): Remove the optimization of only
1665         report the size when it has changed, since both the redirected
1666         window and the drawing area already do that check. Also remove the
1667         optimization of waiting until the view is mapped to report its
1668         size, since that's often too late for websites using the window
1669         size during load.
1670         (webkitWebViewBaseMap): Never report size on map, it should have
1671         already been reported by size-allocate.
1672
1673 2015-07-11  Nikita Vasilyev  <nvasilyev@apple.com>
1674
1675         Web Inspector: Inspector should be able to be docked to the bottom of a narrow window
1676         https://bugs.webkit.org/show_bug.cgi?id=146871
1677
1678         Reviewed by Timothy Hatcher.
1679
1680         * UIProcess/WebInspectorProxy.cpp:
1681         * UIProcess/mac/WebInspectorProxyMac.mm:
1682         (WebKit::WebInspectorProxy::platformCanAttach):
1683         * WebProcess/WebPage/WebInspector.cpp:
1684
1685 2015-07-11  Joseph Pecoraro  <pecoraro@apple.com>
1686
1687         Allow clients to opt-out of default app link link actions
1688         https://bugs.webkit.org/show_bug.cgi?id=146883
1689         <rdar://problem/21221902>
1690
1691         Reviewed by Dan Bernstein.
1692
1693         * UIProcess/API/APIUIClient.h:
1694         (API::UIClient::shouldIncludeAppLinkActionsForElement):
1695         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
1696         * UIProcess/Cocoa/UIDelegate.h:
1697         * UIProcess/Cocoa/UIDelegate.mm:
1698         (WebKit::UIDelegate::setDelegate):
1699         (WebKit::UIDelegate::UIClient::shouldIncludeAppLinkActionsForElement):
1700         Plumbing for a new delegate message to ask the client if they
1701         would like app link actions or not. Default is yes.
1702
1703         * UIProcess/ios/WKActionSheetAssistant.h:
1704         * UIProcess/ios/WKActionSheetAssistant.mm:
1705         (-[WKActionSheetAssistant showImageSheet]):
1706         (-[WKActionSheetAssistant showLinkSheet]):
1707         (-[WKActionSheetAssistant defaultActionsForLinkSheet:]):
1708         (-[WKActionSheetAssistant defaultActionsForImageSheet:]):
1709         Pass elementInfo into methods generating default actions.
1710         
1711         (-[WKActionSheetAssistant _appendOpenActionsForURL:actions:elementInfo:]):
1712         When generating open actions, if the process has AppLink capabilities
1713         ask the client if they want to include AppLink actions or fall back
1714         to the basic Open action.
1715
1716         * UIProcess/ios/WKContentViewInteraction.mm:
1717         (-[WKContentView actionSheetAssistant:shouldIncludeAppLinkActionsForElement:]):
1718         (-[WKContentView previewViewControllerForPosition:inSourceView:]):
1719         * UIProcess/ios/WKPDFView.mm:
1720         (-[WKPDFView actionSheetAssistant:shouldIncludeAppLinkActionsForElement:]):
1721         Assistant delegate implementations forward to the UIDelegate.
1722
1723 2015-07-11  Joseph Pecoraro  <pecoraro@apple.com>
1724
1725         Update default link action sheets for app links
1726         https://bugs.webkit.org/show_bug.cgi?id=146658
1727         <rdar://problem/21221902>
1728
1729         Reviewed by Dan Bernstein.
1730
1731         * Shared/mac/SandboxUtilities.h:
1732         * Shared/mac/SandboxUtilities.mm: Renamed from Source/WebKit2/Shared/mac/SandboxUtilities.cpp.
1733         (WebKit::processHasEntitlement):
1734         * UIProcess/ApplicationStateTracker.mm:
1735         (WebKit::applicationType):
1736         (WebKit::hasEntitlement): Deleted.
1737         * WebKit2.xcodeproj/project.pbxproj:
1738         Share a helper for checking if the current process has an entitlement.
1739
1740         * UIProcess/API/Cocoa/_WKElementAction.h:
1741         * UIProcess/API/Cocoa/_WKElementAction.mm:
1742         (+[_WKElementAction _elementActionWithType:title:actionHandler:]):
1743         (+[_WKElementAction _elementActionWithType:customTitle:assistant:]):
1744         * UIProcess/API/Cocoa/_WKElementActionInternal.h:
1745         Add an internal way to make an element action with a standard type and regular handler.
1746         We use this for the new standard types that don't have a default implementation.
1747
1748         * UIProcess/ios/WKActionSheetAssistant.mm:
1749         (applicationHasAppLinkEntitlements):
1750         (appLinkForURL):
1751         Helpers checking access to app links and fetching app links.
1752
1753         (-[WKActionSheetAssistant _appendOpenActionsForURL:actions:]):
1754         (-[WKActionSheetAssistant defaultActionsForLinkSheet]):
1755         (-[WKActionSheetAssistant defaultActionsForImageSheet]):
1756         Create "Open in Safari" and "Open in 'App'" default actions for AppLinks,
1757         otherwise add the normal default "Open" action.
1758
1759 2015-07-11  Enrica Casucci  <enrica@apple.com>
1760
1761         Remove incorrect overriding of inputAssistantItem in WKContentView.
1762         https://bugs.webkit.org/show_bug.cgi?id=146863
1763         rdar://problem/21507154
1764
1765         Reviewed by Sam Weinig.
1766
1767         Correction to the patch in r186713.
1768         We need to provide the inputAssistantItem from the responder.
1769
1770         * UIProcess/ios/WKContentViewInteraction.mm:
1771         (-[WKContentView inputAccessoryView]):
1772
1773 2015-07-11  Commit Queue  <commit-queue@webkit.org>
1774
1775         Unreviewed, rolling out r186689 and r186710.
1776         https://bugs.webkit.org/show_bug.cgi?id=146880
1777
1778         May have caused a PLT regression and broken a layout test
1779         (Requested by cdumez on #webkit).
1780
1781         Reverted changesets:
1782
1783         "[WK2] Increase the QoS of some of our WorkQueues to match the
1784         one of our processes"
1785         https://bugs.webkit.org/show_bug.cgi?id=146855
1786         http://trac.webkit.org/changeset/186689
1787
1788         "REGRESSION (r186689?): fast/frames/frame-limit.html timeout
1789         on Mavericks {Release,Debug} WK2 bots"
1790         https://bugs.webkit.org/show_bug.cgi?id=146876
1791         http://trac.webkit.org/changeset/186710
1792
1793 2015-07-10  Enrica Casucci  <enrica@apple.com>
1794
1795         Remove incorrect overriding of inputAssistantItem in WKContentView.
1796         https://bugs.webkit.org/show_bug.cgi?id=146863
1797         rdar://problem/21507154
1798
1799         Reviewed by Dan Bernstein.
1800
1801         Removing implementation of inputAssistantItem and moving initialization
1802         of formAccessoryView to inputAccessoryView to avoid interfering with
1803         the keyboard handling of the assistant bar.
1804
1805         * UIProcess/ios/WKContentViewInteraction.mm:
1806         (-[WKContentView inputAccessoryView]):
1807         (-[WKContentView inputAssistantItem]): Deleted.
1808         (-[WKContentView _inputAssistantItem]): Deleted.
1809
1810 2015-07-10  Simon Fraser  <simon.fraser@apple.com>
1811
1812         [iOS WK2] Scrolling issues on horizontally scrollable RTL pages
1813         https://bugs.webkit.org/show_bug.cgi?id=146872
1814         rdar://problem/7569416
1815
1816         Reviewed by Sam Weinig.
1817
1818         Horizontally scrollable RTL pages in WebKit2 had a variety of issues: they had
1819         a gap down the right edge, and unreachable content on the left side, focussing
1820         form fields scrolled to the wrong location, and programmatic scrolls scrolled
1821         to the wrong place.
1822         
1823         Fix by plumbing the WebCore notion of scrollOrigin through to the UI process,
1824         and using it in various places. There are three main aspects to the patch:
1825         
1826         1. scroll origin is included in RemoteLayerTreeTransaction, and plumbed through
1827            to -[WKWebView _scrollToContentOffset:] for correct programmatic scrolling,
1828            including zooming to focused form elements. The WKContentView's boundsOrigin
1829            is set to the scroll origin so that the view coordinates match document coordinates.
1830         2. WebPageProxy::computeCustomFixedPositionRect() uses the actual documentRect()
1831            rather than just conjuring up a rect with a zero origin, which makes position:fixed
1832            work correctly.
1833         3. _interactionViewsContainerView (which hosts tap highlights) is positioned to 
1834            coincide with the origin of the documentRect (i.e. at the scroll origin, which
1835            may not be top-left). This allows tap highlights to show in the correct location.
1836         4. ScrollView::unobscuredContentRect() is fixed to take scroll origin into account;
1837            if the returned rect is wrong, RenderLayer::hitTest() incorrectly clips the hit
1838            testing area.
1839
1840         * Shared/mac/RemoteLayerTreeTransaction.h:
1841         (WebKit::RemoteLayerTreeTransaction::scrollOrigin):
1842         (WebKit::RemoteLayerTreeTransaction::setScrollOrigin):
1843         * Shared/mac/RemoteLayerTreeTransaction.mm:
1844         (WebKit::RemoteLayerTreeTransaction::encode):
1845         (WebKit::RemoteLayerTreeTransaction::decode):
1846         (WebKit::RemoteLayerTreeTransaction::description): Dump some more info.
1847         * UIProcess/API/Cocoa/WKWebView.mm:
1848         (-[WKWebView _scrollToContentOffset:scrollOrigin:]):
1849         (-[WKWebView _scrollToContentOffset:]): Deleted.
1850         * UIProcess/API/Cocoa/WKWebViewInternal.h:
1851         * UIProcess/API/gtk/PageClientImpl.cpp:
1852         (WebKit::PageClientImpl::requestScroll):
1853         * UIProcess/API/gtk/PageClientImpl.h:
1854         * UIProcess/CoordinatedGraphics/WebView.cpp:
1855         (WebKit::WebView::requestScroll):
1856         * UIProcess/CoordinatedGraphics/WebView.h:
1857         * UIProcess/PageClient.h:
1858         * UIProcess/WebPageProxy.cpp:
1859         (WebKit::WebPageProxy::requestScroll):
1860         * UIProcess/WebPageProxy.h:
1861         * UIProcess/ios/PageClientImplIOS.h:
1862         * UIProcess/ios/PageClientImplIOS.mm:
1863         (WebKit::PageClientImpl::requestScroll):
1864         (WebKit::PageClientImpl::documentRect):
1865         (WebKit::PageClientImpl::contentsSize): Deleted.
1866         * UIProcess/ios/WKContentView.mm:
1867         (-[WKContentView _didCommitLayerTree:]):
1868         * UIProcess/ios/WebPageProxyIOS.mm:
1869         (WebKit::WebPageProxy::computeCustomFixedPositionRect):
1870         * UIProcess/mac/PageClientImpl.h:
1871         * UIProcess/mac/PageClientImpl.mm:
1872         (WebKit::PageClientImpl::requestScroll):
1873         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
1874         (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
1875         * WebProcess/WebPage/WebPage.cpp:
1876         (WebKit::WebPage::willCommitLayerTree):
1877
1878 2015-07-10  Chris Dumez  <cdumez@apple.com>
1879
1880         [WK2] Diagnostic logging messages are causing too much IPC
1881         https://bugs.webkit.org/show_bug.cgi?id=146873
1882         <rdar://problem/21779205>
1883
1884         Reviewed by Ryosuke Niwa.
1885
1886         Diagnostic logging messages are causing too much IPC. To address the
1887         problem, we now do the sampling of the senders' side (WebContent
1888         process and Networking process) instead of the receiver's side
1889         (UIProcess).
1890
1891         * NetworkProcess/NetworkProcess.cpp:
1892         (WebKit::NetworkProcess::logDiagnosticMessage):
1893         (WebKit::NetworkProcess::logDiagnosticMessageWithResult):
1894         (WebKit::NetworkProcess::logDiagnosticMessageWithValue):
1895         * UIProcess/Network/NetworkProcessProxy.cpp:
1896         (WebKit::NetworkProcessProxy::logSampledDiagnosticMessage):
1897         (WebKit::NetworkProcessProxy::logSampledDiagnosticMessageWithResult):
1898         (WebKit::NetworkProcessProxy::logSampledDiagnosticMessageWithValue):
1899         * UIProcess/Network/NetworkProcessProxy.h:
1900         * UIProcess/Network/NetworkProcessProxy.messages.in:
1901         * UIProcess/WebPageProxy.cpp:
1902         (WebKit::WebPageProxy::logDiagnosticMessage):
1903         (WebKit::WebPageProxy::logDiagnosticMessageWithResult):
1904         (WebKit::WebPageProxy::logDiagnosticMessageWithValue):
1905         (WebKit::WebPageProxy::logSampledDiagnosticMessage):
1906         (WebKit::WebPageProxy::logSampledDiagnosticMessageWithResult):
1907         (WebKit::WebPageProxy::logSampledDiagnosticMessageWithValue):
1908         * UIProcess/WebPageProxy.h:
1909         * UIProcess/WebPageProxy.messages.in:
1910         * WebProcess/WebCoreSupport/WebDiagnosticLoggingClient.cpp:
1911         (WebKit::WebDiagnosticLoggingClient::logDiagnosticMessage):
1912         (WebKit::WebDiagnosticLoggingClient::logDiagnosticMessageWithResult):
1913         (WebKit::WebDiagnosticLoggingClient::logDiagnosticMessageWithValue):
1914
1915 2015-07-10  Dean Jackson  <dino@apple.com>
1916
1917         Airplay button and placeholder are missing in inline controls
1918         https://bugs.webkit.org/show_bug.cgi?id=146869
1919         <rdar://problem/21555051>
1920
1921         Reviewed by Simon Fraser.
1922
1923         Fix a typo in the ENABLE that was causing the Airplay
1924         setting (allowsAirPlayForMediaPlayback, which becomes
1925         webkitWirelessVideoPlaybackDisabled) to default to false.
1926
1927         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
1928         (-[WKWebViewConfiguration init]): Change WIRELESS_TARGET_PLAYBACK
1929         to WIRELESS_PLAYBACK_TARGET.
1930
1931 2015-07-10  Tim Horton  <timothy_horton@apple.com>
1932
1933         Use CoreAnimation fences instead of synchronous IPC to synchronize resize
1934         https://bugs.webkit.org/show_bug.cgi?id=146294
1935         <rdar://problem/21090193>
1936
1937         Reviewed by Anders Carlsson.
1938
1939         * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm:
1940         (WebKit::TiledCoreAnimationDrawingAreaProxy::createFenceForGeometryUpdate):
1941         Tiny followup; don't touch Connection if the connection isn't valid.
1942
1943 2015-07-10  Chris Dumez  <cdumez@apple.com>
1944
1945         [WK2] Increase the QoS of some of our WorkQueues to match the one of our processes
1946         https://bugs.webkit.org/show_bug.cgi?id=146855
1947
1948         Reviewed by Anders Carlsson.
1949
1950         Increase the QoS of some of our WorkQueues to match the one of our processes. For
1951         e.g., even though the WebContent and the Networking processes have USER_UNITIATED
1952         QoS, the IPC between them is using a WorkQueue with DEFAULT QoS. Similarly, the
1953         WorkQueue used for network cache reads has DEFAULT QoS.
1954
1955         * NetworkProcess/cache/NetworkCacheStorage.cpp:
1956         (WebKit::NetworkCache::Storage::Storage):
1957         * Platform/IPC/Connection.cpp:
1958         (IPC::Connection::Connection):
1959
1960 2015-07-10  Zalan Bujtas  <zalan@apple.com>
1961
1962         Crash at WebCore::WebPage::innerFrameQuad.
1963         https://bugs.webkit.org/show_bug.cgi?id=146843
1964         rdar://problem/21501819
1965
1966         Reviewed by Andreas Kling.
1967
1968         We may end up with a null rootEditableElement() after calling Document::updateLayout().
1969
1970         Speculative fix. Not reproducible.
1971
1972         * WebProcess/WebPage/WebPage.h: Some const cleanup.
1973         * WebProcess/WebPage/ios/WebPageIOS.mm:
1974         (WebKit::innerFrameQuad): null check assistedNode.rootEditableElement()
1975         (WebKit::constrainPoint):
1976         (WebKit::WebPage::selectWithGesture):
1977         (WebKit::WebPage::visiblePositionInFocusedNodeForPoint):
1978         (WebKit::WebPage::selectPositionAtPoint):
1979         (WebKit::WebPage::selectPositionAtBoundaryWithDirection):
1980         (WebKit::WebPage::selectTextWithGranularityAtPoint):
1981         (WebKit::WebPage::updateSelectionWithExtentPoint):
1982         (WebKit::WebPage::getPositionInformation):
1983
1984 2015-07-09  Jon Honeycutt  <jhoneycutt@apple.com>
1985
1986         [iOS] Document picker has overlapping icons on iPad
1987         https://bugs.webkit.org/show_bug.cgi?id=146808
1988         <rdar://problem/21251875>
1989
1990         Reviewed by Sam Weinig.
1991
1992         * UIProcess/ios/forms/WKFileUploadPanel.mm:
1993         (-[WKFileUploadPanel documentMenu:didPickDocumentPicker:]):
1994         Don't show this UI as a popover on iPad; the default is a full screen
1995         form sheet.
1996
1997 2015-07-09  Dan Bernstein  <mitz@apple.com>
1998
1999         WebKit2 part of Track and expose policies for external URL schemes and App Links separately
2000         https://bugs.webkit.org/show_bug.cgi?id=146822
2001
2002         Reviewed by Anders Carlsson.
2003
2004         * Shared/NavigationActionData.cpp:
2005         (WebKit::NavigationActionData::encode):
2006         (WebKit::NavigationActionData::decode):
2007         * Shared/NavigationActionData.h:
2008           Replaced the shouldOpenExternalURLsPolicy boolean member with a
2009           shouldOpenExternalURLsPolicy member whose type is ShouldOpenExternalURLsPolicy, and
2010           updated encoding and decoding:
2011
2012         * UIProcess/API/APINavigationAction.h:
2013           Added shouldOpenAppLinks boolean to NavigationAction::create and the constructor. It
2014           augments the policy in the NavigationActionData with a valude decided in the UI process.
2015           Replaced shouldOpenExternalURLs() with shouldOpenExternalSchemes() and
2016           shouldOpenAppLinks() which check the policy and the new m_shouldOpenAppLinks boolean.
2017
2018         * UIProcess/API/Cocoa/WKNavigationAction.mm:
2019         (-[WKNavigationAction _shouldOpenExternalSchemes]): Getter for new property, calls through
2020           to the NavigationAction.
2021         (-[WKNavigationAction _shouldOpenAppLinks]): Ditto.
2022         (-[WKNavigationAction _shouldOpenExternalURLs]): Now deprecated and returns the
2023           _shouldOpenExternalSchemes value.
2024         * UIProcess/API/Cocoa/WKNavigationActionPrivate.h: Declared new properties for the two
2025           policies and deprecated old property.
2026
2027         * UIProcess/Cocoa/NavigationState.mm:
2028         (WebKit::tryAppLink): Changed to use NavigationAction::shouldOpenAppLinks, which
2029           encapsulates logic that used to be here.
2030
2031         * UIProcess/Cocoa/UIDelegate.mm:
2032         (WebKit::UIDelegate::UIClient::createNewPage): Allow App Links (if already allowed by policy).
2033
2034         * UIProcess/WebPageProxy.cpp:
2035         (WebKit::WebPageProxy::decidePolicyForNavigationAction): Moved logic from tryAppLink in
2036           NavigationState.mm here and pass the result to NavigationAction::create.
2037         (WebKit::WebPageProxy::decidePolicyForNewWindowAction): Allow App Links (if already allowed
2038           by policy).
2039         * UIProcess/WebPageProxy.h:
2040         (WebKit::WebPageProxy::loadRequest): Changed the default policy to not allow App Links (but
2041           still allow external schemes).
2042
2043         * WebProcess/InjectedBundle/API/c/WKBundleNavigationAction.cpp:
2044         (WKBundleNavigationActionGetShouldTryAppLinks): Added this getter.
2045         * WebProcess/InjectedBundle/API/c/WKBundleNavigationActionPrivate.h:
2046
2047         * WebProcess/InjectedBundle/InjectedBundleNavigationAction.cpp:
2048         (WebKit::InjectedBundleNavigationAction::InjectedBundleNavigationAction):
2049         * WebProcess/InjectedBundle/InjectedBundleNavigationAction.h:
2050           Added m_shouldTryAppLinks boolean member, initialized from the policy. Updated the
2051           initialization of m_shouldOpenExternalURLs to account for the new policy.
2052
2053         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2054         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction): Pass the policy
2055           in the navigation data.
2056
2057 2015-07-09  Tim Horton  <timothy_horton@apple.com>
2058
2059         Use CoreAnimation fences instead of synchronous IPC to synchronize resize
2060         https://bugs.webkit.org/show_bug.cgi?id=146294
2061         <rdar://problem/21090193>
2062
2063         Reviewed by Anders Carlsson.
2064
2065         Because of changes in underlying frameworks, we can no longer depend on
2066         blocking the UI process main thread to be sufficient to synchronize
2067         UI process CA commits with commits coming from the Web process.
2068
2069         Instead, we have to use CoreAnimation fences to perform this synchronization.
2070         Instead of blocking inside waitForAndDispatchImmediately, we'll end up
2071         blocking during the CA commit.
2072
2073         * Platform/mac/LayerHostingContext.mm:
2074         Use HAVE(COREANIMATION_FENCES).
2075
2076         * Platform/IPC/Connection.cpp:
2077         (IPC::Connection::Connection):
2078         (IPC::Connection::processIncomingMessage):
2079         (IPC::Connection::installIncomingSyncMessageCallback):
2080         (IPC::Connection::uninstallIncomingSyncMessageCallback):
2081         Keep track of a set of incoming sync message callbacks, and fire them
2082         (on another queue) when a sync message arrives.
2083
2084         (IPC::Connection::hasIncomingSyncMessage):
2085         * Platform/IPC/Connection.h:
2086         Add a way to check if there are any sync messages in the queue.
2087
2088         * UIProcess/API/mac/WKView.mm:
2089         (-[WKView forceAsyncDrawingAreaSizeUpdate:]):
2090         (-[WKView waitForAsyncDrawingAreaSizeUpdate]):
2091         These are no longer used; do nothing on 10.10+.
2092
2093         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
2094         (WebKit::RemoteLayerTreeDrawingAreaProxy::sendUpdateGeometry):
2095         * WebProcess/WebPage/DrawingArea.h:
2096         (WebKit::DrawingArea::updateGeometry):
2097         * WebProcess/WebPage/DrawingArea.messages.in:
2098         * WebProcess/WebPage/WebPage.cpp:
2099         (WebKit::WebPage::scaleViewAndUpdateGeometryFenced):
2100         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
2101         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
2102         (WebKit::RemoteLayerTreeDrawingArea::updateGeometry):
2103         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
2104         Add a MachSendRight parameter to UpdateGeometry, so that we can send along
2105         a fence port with the geometry update if needed.
2106
2107         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
2108         (WebKit::TiledCoreAnimationDrawingArea::updateGeometry):
2109         Apply the incoming fence so that geometry changes will be synchronized between processes.
2110
2111         * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm:
2112         (WebKit::TiledCoreAnimationDrawingAreaProxy::waitForPossibleGeometryUpdate):
2113         Don't wait for DidUpdateGeometry to come in if we're using fences to achieve the same thing.
2114
2115         (WebKit::TiledCoreAnimationDrawingAreaProxy::sendUpdateGeometry):
2116         Create and block us on a fence and send it along with the geometry update.
2117         If a sync message is in the incoming message queue, don't create the fence;
2118         if a sync message comes in at any point after we've installed the fence (but
2119         before the relevant commit completes), invalidate the fence, so that we won't
2120         end up temorarily deadlocked waiting for the fence timeout.
2121
2122 2015-07-09  Michael Catanzaro  <mcatanzaro@igalia.com>
2123
2124         [GTK] Crash when spell checker returns no guesses
2125         https://bugs.webkit.org/show_bug.cgi?id=146805
2126
2127         Reviewed by Martin Robinson.
2128
2129         Properly handle ContextMenuItemTagNoGuessesFound in the switch statement.
2130
2131         * UIProcess/API/gtk/WebKitContextMenuActions.cpp:
2132         (webkitContextMenuActionGetForContextMenuItem):
2133
2134 2015-07-09  Alex Christensen  <achristensen@webkit.org>
2135
2136         [Content Extensions] Add 3 byte jump size.
2137         https://bugs.webkit.org/show_bug.cgi?id=146425
2138
2139         Reviewed by Darin Adler.
2140
2141         * UIProcess/API/APIUserContentExtensionStore.h:
2142         Increment CurrentContentExtensionFileVersion because of change in the bytecode.
2143
2144 2015-07-09  Anders Carlsson  <andersca@apple.com>
2145
2146         SafariViewController loads partial webpage or entirely blank webpage
2147         https://bugs.webkit.org/show_bug.cgi?id=146815
2148         rdar://problem/21734757
2149
2150         Reviewed by Dan Bernstein.
2151
2152         * Platform/spi/ios/UIKitSPI.h:
2153         Add _hostProcessIdentifier getter.
2154
2155         * UIProcess/ApplicationStateTracker.h:
2156         Change ApplicationStateTracker to hold on to a WKContentView instead of a UIView.
2157
2158         * UIProcess/ApplicationStateTracker.mm:
2159         (WebKit::applicationType):
2160         Add a helper function that returns the type of application the web view is hosted by (regular
2161         application, view service or extension).
2162
2163         (WebKit::ApplicationStateTracker::ApplicationStateTracker):
2164         Register notifications and update m_isInBackground. For regular applications, just listen for UIApplication notifications.
2165         For view services, walk the view controller hierarchy and find the service view controller and listen for notifications and use
2166         BKS to find the background state of the host application. For extensions, just use BKSApplicationStateMonitor directly.
2167
2168         (WebKit::isViewService): Deleted.
2169
2170         * UIProcess/ios/WKContentView.mm:
2171         (-[WKContentView willMoveToWindow:]):
2172         If we're moving out of a window, null out the state tracker.
2173
2174         (-[WKContentView didMoveToWindow]):
2175         If we moved to a window, create a new state tracker.
2176
2177         (-[WKContentView isBackground]):
2178         Handle a null application state.
2179
2180         (-[WKContentView _commonInitializationWithProcessPool:configuration:]): Deleted.
2181         Don't create the application state here.
2182
2183 2015-07-09  Dan Bernstein  <mitz@apple.com>
2184
2185         [Cocoa] Report the first paint after committing a load as a rendering progress event
2186         https://bugs.webkit.org/show_bug.cgi?id=146765
2187
2188         Reviewed by Tim Horton.
2189
2190         * Shared/API/Cocoa/_WKRenderingProgressEvents.h: Added _WKRenderingProgressEventFirstPaint.
2191
2192         * UIProcess/API/Cocoa/WKWebView.mm:
2193         (-[WKWebView _didCommitLayerTree:]): If this is the first layer tree commit since the load
2194         was committed, and the delegate is observing _WKRenderingProgressEventFirstPaint, call
2195         NavigationState::didFirstPaint.
2196
2197         * UIProcess/Cocoa/NavigationState.h:
2198         * UIProcess/Cocoa/NavigationState.mm:
2199         (WebKit::NavigationState::didFirstPaint): Added. Calls -_webView:renderingProgressDidChange:
2200         with _WKRenderingProgressEventFirstPaint.
2201
2202 2015-07-08  Jinwoo Song  <jinwoo7.song@samsung.com>
2203
2204         [EFL] When closing inspector window, EwkView is not released properly.
2205         https://bugs.webkit.org/show_bug.cgi?id=146716
2206
2207         Reviewed by Gyuyoung Kim.
2208
2209         It's because inspector window could not be deleted by remaining reference
2210         from inspector view(evas object). This patch deletes the inspector window
2211         after finishing the evas object smart call.
2212
2213         * UIProcess/efl/WebInspectorProxyEfl.cpp:
2214         (WebKit::destroyInspectorWindow):
2215         (WebKit::WebInspectorProxy::platformDidClose):
2216
2217 2015-07-08  Hyungwook Lee  <hyungwook.lee@navercorp.com>
2218
2219         Fix ASSERTION FAILED: !m_pendingNavigationID in WebPage::reload().
2220         https://bugs.webkit.org/show_bug.cgi?id=146546
2221
2222         Reviewed by Darin Adler.
2223
2224         We did't reset pendingNavigationID value when request url is empty.
2225         Hence we need to ignore ASSERT check in this case.
2226
2227         * WebProcess/WebPage/WebPage.cpp:
2228         (WebKit::WebPage::reload):
2229
2230 2015-07-08  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
2231
2232         Use Ref/RefPtr instead of PassRefPtr in WebKit2 - 2
2233         https://bugs.webkit.org/show_bug.cgi?id=146591
2234
2235         Reviewed by Darin Adler.
2236
2237         Following patch in order to reduce use of PassRefPtr.
2238
2239         * Shared/BlobDataFileReferenceWithSandboxExtension.h:
2240         * Shared/Cocoa/CompletionHandlerCallChecker.h:
2241         * Shared/Cocoa/CompletionHandlerCallChecker.mm:
2242         (WebKit::CompletionHandlerCallChecker::create):
2243         * Shared/Downloads/DownloadAuthenticationClient.h:
2244         (WebKit::DownloadAuthenticationClient::create):
2245         * Shared/SandboxExtension.h:
2246         * Shared/ShareableResource.cpp:
2247         (WebKit::ShareableResource::create):
2248         * Shared/ShareableResource.h:
2249         * Shared/mac/ObjCObjectGraph.h:
2250         (WebKit::ObjCObjectGraph::create):
2251         * Shared/mac/SandboxExtensionMac.mm:
2252         (WebKit::SandboxExtension::create):
2253         * UIProcess/API/Cocoa/WKProcessGroup.mm:
2254         (getInjectedBundleInitializationUserData):
2255         * UIProcess/WebPreferences.cpp:
2256         (WebKit::WebPreferences::create):
2257         * UIProcess/WebPreferences.h:
2258         * WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.cpp:
2259         (WKBundlePageOverlayCreate):
2260         * WebProcess/InjectedBundle/API/c/mac/WKBundlePageBannerMac.mm:
2261         (WKBundlePageBannerCreateBannerWithCALayer):
2262         * WebProcess/InjectedBundle/InjectedBundleDOMWindowExtension.cpp:
2263         (WebKit::InjectedBundleDOMWindowExtension::create):
2264         * WebProcess/InjectedBundle/InjectedBundleDOMWindowExtension.h:
2265         * WebProcess/InjectedBundle/InjectedBundleHitTestResult.cpp:
2266         (WebKit::InjectedBundleHitTestResult::create):
2267         * WebProcess/InjectedBundle/InjectedBundleHitTestResult.h:
2268         * WebProcess/InjectedBundle/InjectedBundleNavigationAction.cpp:
2269         (WebKit::InjectedBundleNavigationAction::create):
2270         * WebProcess/InjectedBundle/InjectedBundleNavigationAction.h:
2271         * WebProcess/InjectedBundle/InjectedBundlePageContextMenuClient.cpp:
2272         (WebKit::InjectedBundlePageContextMenuClient::getCustomMenuFromDefaultItems):
2273         (WebKit::InjectedBundlePageContextMenuClient::prepareForImmediateAction):
2274         * WebProcess/InjectedBundle/InjectedBundleScriptWorld.cpp:
2275         (WebKit::InjectedBundleScriptWorld::create):
2276         * WebProcess/InjectedBundle/InjectedBundleScriptWorld.h:
2277         * WebProcess/Network/NetworkProcessConnection.h:
2278         (WebKit::NetworkProcessConnection::create):
2279         * WebProcess/Network/WebResourceLoader.cpp:
2280         (WebKit::WebResourceLoader::create):
2281         * WebProcess/Network/WebResourceLoader.h:
2282         * WebProcess/Notifications/NotificationPermissionRequestManager.cpp:
2283         (WebKit::NotificationPermissionRequestManager::create):
2284         * WebProcess/Notifications/NotificationPermissionRequestManager.h:
2285         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
2286         (WebKit::NetscapePlugin::create):
2287         * WebProcess/Plugins/Netscape/NetscapePlugin.h:
2288         * WebProcess/Plugins/Netscape/NetscapePluginStream.h:
2289         (WebKit::NetscapePluginStream::create):
2290         * WebProcess/Plugins/PDF/PDFPlugin.h:
2291         * WebProcess/Plugins/PDF/PDFPlugin.mm:
2292         (WebKit::PDFPlugin::create):
2293         * WebProcess/Plugins/PDF/PDFPluginAnnotation.h:
2294         (WebKit::PDFPluginAnnotation::PDFPluginAnnotationEventListener::create):
2295         * WebProcess/Plugins/PDF/PDFPluginChoiceAnnotation.h:
2296         * WebProcess/Plugins/PDF/PDFPluginChoiceAnnotation.mm:
2297         (WebKit::PDFPluginChoiceAnnotation::create):
2298         * WebProcess/Plugins/PDF/PDFPluginPasswordField.h:
2299         * WebProcess/Plugins/PDF/PDFPluginPasswordField.mm:
2300         (WebKit::PDFPluginPasswordField::create):
2301         * WebProcess/Plugins/PDF/PDFPluginTextAnnotation.h:
2302         * WebProcess/Plugins/PDF/PDFPluginTextAnnotation.mm:
2303         (WebKit::PDFPluginTextAnnotation::create):
2304         * WebProcess/Plugins/PluginProcessConnection.h:
2305         (WebKit::PluginProcessConnection::create):
2306         * WebProcess/Plugins/PluginProcessConnectionManager.cpp:
2307         (WebKit::PluginProcessConnectionManager::create):
2308         * WebProcess/Plugins/PluginProcessConnectionManager.h:
2309         * WebProcess/Plugins/PluginProxy.cpp:
2310         (WebKit::PluginProxy::create):
2311         * WebProcess/Plugins/PluginProxy.h:
2312         * WebProcess/Plugins/PluginView.cpp:
2313         (WebKit::PluginView::URLRequest::create):
2314         (WebKit::PluginView::Stream::create):
2315         (WebKit::PluginView::create):
2316         * WebProcess/Plugins/PluginView.h:
2317         * WebProcess/Scrolling/RemoteScrollingCoordinator.h:
2318         (WebKit::RemoteScrollingCoordinator::create):
2319         * WebProcess/Storage/StorageAreaImpl.cpp:
2320         (WebKit::StorageAreaImpl::create):
2321         * WebProcess/Storage/StorageAreaImpl.h:
2322         * WebProcess/Storage/StorageAreaMap.cpp:
2323         (WebKit::StorageAreaMap::create):
2324         * WebProcess/Storage/StorageAreaMap.h:
2325         * WebProcess/WebConnectionToUIProcess.cpp:
2326         (WebKit::WebConnectionToUIProcess::create):
2327         * WebProcess/WebConnectionToUIProcess.h:
2328         * WebProcess/WebCoreSupport/WebPopupMenu.cpp:
2329         (WebKit::WebPopupMenu::create):
2330         * WebProcess/WebCoreSupport/WebPopupMenu.h:
2331         * WebProcess/WebCoreSupport/WebSearchPopupMenu.cpp:
2332         (WebKit::WebSearchPopupMenu::create):
2333         * WebProcess/WebCoreSupport/WebSearchPopupMenu.h:
2334         * WebProcess/WebCoreSupport/ios/WebQuickLookHandleClient.h:
2335         * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.h:
2336         (WebKit::WebFrameNetworkingContext::create):
2337         * WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.h:
2338         (WebKit::WebFrameNetworkingContext::create):
2339         * WebProcess/WebPage/Cocoa/RemoteLayerTreeDisplayRefreshMonitor.h:
2340         (WebKit::RemoteLayerTreeDisplayRefreshMonitor::create):
2341         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
2342         (WebKit::CoordinatedLayerTreeHost::create):
2343         * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp:
2344         (WebKit::ThreadedCoordinatedLayerTreeHost::create):
2345         * WebProcess/WebPage/EventDispatcher.cpp:
2346         (WebKit::EventDispatcher::create):
2347         * WebProcess/WebPage/EventDispatcher.h:
2348         * WebProcess/WebPage/PageBanner.h:
2349         * WebProcess/WebPage/WebBackForwardListProxy.h:
2350         (WebKit::WebBackForwardListProxy::create):
2351         * WebProcess/WebPage/WebContextMenu.h:
2352         (WebKit::WebContextMenu::create):
2353         * WebProcess/WebPage/WebDocumentLoader.h:
2354         (WebKit::WebDocumentLoader::create):
2355         * WebProcess/WebPage/WebInspector.cpp:
2356         (WebKit::WebInspector::create):
2357         * WebProcess/WebPage/WebInspector.h:
2358         * WebProcess/WebPage/WebInspectorUI.cpp:
2359         (WebKit::WebInspectorUI::create):
2360         * WebProcess/WebPage/WebInspectorUI.h:
2361         * WebProcess/WebPage/WebOpenPanelResultListener.cpp:
2362         (WebKit::WebOpenPanelResultListener::create):
2363         * WebProcess/WebPage/WebOpenPanelResultListener.h:
2364         * WebProcess/WebPage/WebPageOverlay.cpp:
2365         (WebKit::WebPageOverlay::create):
2366         * WebProcess/WebPage/WebPageOverlay.h:
2367         * WebProcess/WebPage/WebUndoStep.cpp:
2368         (WebKit::WebUndoStep::create):
2369         * WebProcess/WebPage/WebUndoStep.h:
2370         * WebProcess/WebPage/mac/PageBannerMac.mm:
2371         (WebKit::PageBanner::create):
2372         * WebProcess/WebPage/mac/PlatformCAAnimationRemote.h:
2373         * WebProcess/WebPage/mac/PlatformCAAnimationRemote.mm:
2374         (WebKit::PlatformCAAnimationRemote::create):
2375         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
2376         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
2377         (WebKit::RemoteLayerTreeDrawingArea::BackingStoreFlusher::create):
2378         * WebProcess/ios/WebVideoFullscreenManager.h:
2379         * WebProcess/ios/WebVideoFullscreenManager.mm:
2380         (WebKit::WebVideoFullscreenManager::create):
2381
2382 2015-07-08  Anders Carlsson  <andersca@apple.com>
2383
2384         WKSecurityOrigin.h has wrong availability info
2385         https://bugs.webkit.org/show_bug.cgi?id=146761
2386         rdar://problem/21735802
2387
2388         Reviewed by Dan Bernstein.
2389
2390         * UIProcess/API/Cocoa/WKSecurityOrigin.h:
2391
2392 2015-07-08  Andreas Kling  <akling@apple.com>
2393
2394         [iOS] Scrolling is laggy when the keyboard is up and a form element is focused.
2395         <https://webkit.org/b/146735>
2396         <rdar://problem/21151033>
2397
2398         Reviewed by Enrica Casucci.
2399
2400         Every touch on the page causes us to call elementDidFocus(), since we may need to bring
2401         up a keyboard if the node had previously been programmatically focused. This was causing
2402         little lag spikes during scrolling every time you'd put your finger to the screen.
2403
2404         Have WebPage::elementDidFocus() return early if the node already has focus, and we've
2405         started an input session in response to non-programmatic focus already.
2406
2407         * WebProcess/WebPage/WebPage.h:
2408         * WebProcess/WebPage/ios/WebPageIOS.mm:
2409         (WebKit::WebPage::elementDidFocus):
2410         (WebKit::WebPage::elementDidBlur):
2411
2412 2015-07-08  Matt Rajca  <mrajca@apple.com>
2413
2414         Media Session: indicate to clients whether a media session has active media elements
2415         https://bugs.webkit.org/show_bug.cgi?id=146742
2416
2417         Reviewed by Tim Horton.
2418
2419         * UIProcess/API/C/WKPage.cpp:
2420         (WKPageHasMediaSessionWithActiveMediaElements):
2421         * UIProcess/API/C/WKPagePrivate.h:
2422         * UIProcess/WebPageProxy.cpp:
2423         (WebKit::WebPageProxy::hasMediaSessionWithActiveMediaElementsDidChange):
2424         * UIProcess/WebPageProxy.h:
2425         (WebKit::WebPageProxy::hasMediaSessionWithActiveMediaElementsDidChange):
2426         * UIProcess/WebPageProxy.messages.in:
2427         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2428         (WebKit::WebChromeClient::hasMediaSessionWithActiveMediaElementsDidChange):
2429         * WebProcess/WebCoreSupport/WebChromeClient.h:
2430
2431 2015-07-07  Matt Rajca  <mrajca@apple.com>
2432
2433         Media Session: propagate artwork URL with metadata to UI clients
2434         https://bugs.webkit.org/show_bug.cgi?id=146698
2435
2436         Reviewed by Tim Horton.
2437
2438         * Shared/WebMediaSessionMetadata.h:
2439         (WebKit::WebMediaSessionMetadata::artworkURL):
2440         * UIProcess/API/C/WKMediaSessionMetadata.cpp:
2441         (WKMediaSessionMetadataCopyArtworkURL):
2442         * UIProcess/API/C/WKMediaSessionMetadata.h:
2443
2444 2015-07-08  Yongjun Zhang  <yongjun_zhang@apple.com>
2445
2446         Don't allow page scroll when previewing a link or image.
2447         https://bugs.webkit.org/show_bug.cgi?id=146741
2448         rdar://problem/21733053
2449
2450         Reviewed by Beth Dakin.
2451
2452         Don't let preview gesture and scroll panning gesture or zooming gesture recognize at the same time.
2453
2454         * UIProcess/ios/WKContentViewInteraction.mm:
2455         (-[WKContentView gestureRecognizer:canPreventGestureRecognizer:]):
2456
2457 2015-07-08  Tim Horton  <timothy_horton@apple.com>
2458
2459         Snapshots can be misplaced when custom swipe views are offset from the window origin
2460         https://bugs.webkit.org/show_bug.cgi?id=146744
2461         <rdar://problem/20942120>
2462
2463         Reviewed by Dean Jackson.
2464
2465         * UIProcess/mac/ViewGestureControllerMac.mm:
2466         (WebKit::ViewGestureController::beginSwipeGesture):
2467         Keep swipeArea in window coordinates; it was already in window coordinates
2468         when using custom swipe views, but not in the non-custom case.
2469
2470         Convert from window coordinates to parent-of-m_swipeLayer coordinates when
2471         determining m_swipeLayer's frame.
2472
2473 2015-07-07  Andy Estes  <aestes@apple.com>
2474
2475         [iOS][WK2] Ignore synthetic clicks in subframes initiated on a previous page
2476         https://bugs.webkit.org/show_bug.cgi?id=146712
2477
2478         Reviewed by Benjamin Poulain.
2479
2480         r178980 fixed an issue where, if a main frame navigation occurs in response to a touch event, a synthetic click
2481         event could fire on the navigated-to page. This change extends this fix to apply to subframes.
2482
2483         * WebProcess/WebPage/WebFrame.cpp:
2484         (WebKit::WebFrame::WebFrame):
2485         * WebProcess/WebPage/WebFrame.h:
2486         (WebKit::WebFrame::firstLayerTreeTransactionIDAfterDidCommitLoad):
2487         (WebKit::WebFrame::setFirstLayerTreeTransactionIDAfterDidCommitLoad):
2488         * WebProcess/WebPage/WebPage.cpp:
2489         (WebKit::WebPage::didCommitLoad): Stored the next layer tree transaction ID, and called cancelPotentialTapInFrame(), for the committed frame.
2490         * WebProcess/WebPage/WebPage.h:
2491         * WebProcess/WebPage/ios/WebPageIOS.mm:
2492         (WebKit::WebPage::handleTap): Determined the first post-commit layer tree transaction ID from the tap target node's frame.
2493         (WebKit::WebPage::commitPotentialTap): Ditto.
2494         (WebKit::WebPage::cancelPotentialTap): Called cancelPotentialTapInFrame(), passing m_mainFrame.
2495         (WebKit::WebPage::cancelPotentialTapInFrame): Taught to only cancel a potential tap whose target node is a descendant of the given frame.
2496         (WebKit::WebPage::updateVisibleContentRects): Updated to use the main frame's first post-commit layer tree transaction ID.
2497
2498 2015-07-08  Brady Eidson  <beidson@apple.com>
2499
2500         Move PingLoaders to the NetworkingProcess.
2501         <rdar://problem/18860263> and https://bugs.webkit.org/show_bug.cgi?id=146710
2502
2503         Reviewed by Tim Horton.
2504
2505         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
2506         (WebKit::NetworkConnectionToWebProcess::loadPing): Create a PingHandle and then return.
2507         * NetworkProcess/NetworkConnectionToWebProcess.h:
2508         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
2509         
2510         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
2511         (WebKit::WebPlatformStrategies::createPingHandle): If the Network process is enabled,
2512           compile the appropriate load parameters and then message to it.
2513           Otherwise, use the default in-process PingHandle.
2514         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
2515
2516 2015-07-08  Beth Dakin  <bdakin@apple.com>
2517
2518         Only support image previews for clients that implement commitPreviewedImageWithURL 
2519         delegate
2520         https://bugs.webkit.org/show_bug.cgi?id=146739
2521         -and corresponding-
2522         rdar://problem/21692929
2523
2524         Reviewed by Tim Horton.
2525
2526         We should only support image previews for clients that implement 
2527         commitPreviewedImageWithURL delegate since there is no default commit action.
2528         * UIProcess/ios/WKContentViewInteraction.mm:
2529         (-[WKContentView previewViewControllerForPosition:inSourceView:]):
2530
2531 2015-07-08  Anders Carlsson  <andersca@apple.com>
2532
2533         Make ApplicationStateTracker be per view instead of being a singleton
2534         https://bugs.webkit.org/show_bug.cgi?id=146737
2535
2536         Reviewed by Andreas Kling.
2537
2538         * UIProcess/ApplicationStateTracker.h:
2539         Update to be per view instead of a singleton.
2540
2541         * UIProcess/ApplicationStateTracker.mm:
2542         (WebKit::ApplicationStateTracker::ApplicationStateTracker):
2543         Change to take a view + selectors.
2544
2545         (WebKit::ApplicationStateTracker::~ApplicationStateTracker):
2546         Invalidate the state monitor and remove the listeners.
2547
2548         (WebKit::ApplicationStateTracker::applicationDidEnterBackground):
2549         Just call the single background method.
2550
2551         (WebKit::ApplicationStateTracker::applicationWillEnterForeground):
2552         Just call the single foreground method.
2553
2554         (WebKit::ApplicationStateTracker::singleton): Deleted.
2555         (WebKit::ApplicationStateTracker::addListener): Deleted.
2556         (WebKit::ApplicationStateTracker::invokeListeners): Deleted.
2557         (WebKit::ApplicationStateTracker::pruneListeners): Deleted.
2558
2559         * UIProcess/ios/WKContentView.mm:
2560         (-[WKContentView _commonInitializationWithProcessPool:configuration:]):
2561         Create the ApplicationStateTracker here.
2562
2563         (-[WKContentView isBackground]):
2564         Get the ivar instead of the singleton.
2565
2566 2015-07-08  Beth Dakin  <bdakin@apple.com>
2567
2568         InteractionInformationAtPosition bounds seem wrong on many sites, affects 
2569         apple.com
2570         https://bugs.webkit.org/show_bug.cgi?id=146736
2571         -and corresponding-
2572         rdar://problem/21655549
2573
2574         Reviewed by Tim Horton.
2575
2576         http://trac.webkit.org/changeset/186132/ changed the bounds for 
2577         InteractionInformationAtPosition. The image-related changes are good, but the 
2578         link-related changes feel wrong on many sites. We should revert the change for now 
2579         and just use the absoluteBoundingBoxRect() for non-images.
2580         * WebProcess/WebPage/ios/WebPageIOS.mm:
2581         (WebKit::WebPage::getPositionInformation):
2582
2583 2015-07-08  Beth Dakin  <bdakin@apple.com>
2584
2585         Add actions to image previews
2586         https://bugs.webkit.org/show_bug.cgi?id=146702
2587         -and corresponding-
2588         <rdar://problem/21642654>
2589
2590         Reviewed by Sam Weinig.
2591
2592         Add an array of actions and _WKActivatedElementInfo in order to properly invoke 
2593         the actions.
2594         * UIProcess/WKImagePreviewViewController.h:
2595         * UIProcess/WKImagePreviewViewController.mm:
2596         (-[WKImagePreviewViewController loadView]):
2597         (-[WKImagePreviewViewController initWithCGImage:defaultActions:elementInfo:]):
2598         (_scaleSizeWithinSize):
2599         (-[WKImagePreviewViewController initWithCGImage:]): Deleted.
2600
2601         Re-factor defaultActionsForImageSheet into a stand-alone function so that it can 
2602         be invoked for previews as well as for the action sheet.
2603         * UIProcess/ios/WKActionSheetAssistant.h:
2604         * UIProcess/ios/WKActionSheetAssistant.mm:
2605         (-[WKActionSheetAssistant showImageSheet]):
2606         (-[WKActionSheetAssistant defaultActionsForLinkSheet]):
2607         (-[WKActionSheetAssistant defaultActionsForImageSheet]):
2608         (-[WKActionSheetAssistant showLinkSheet]):
2609
2610         WKImagePreviewViewController initializer now takes the default actions and 
2611         _WKActivatedElementInfo.
2612         * UIProcess/ios/WKContentViewInteraction.mm:
2613         (-[WKContentView previewViewControllerForPosition:inSourceView:]):
2614
2615 2015-07-08  Dan Bernstein  <mitz@apple.com>
2616
2617         <rdar://problem/21669397> [iOS] Keyboard shortcuts that take focus away from the web view end up typing a letter into the newly focused field
2618         https://bugs.webkit.org/show_bug.cgi?id=146732
2619
2620         Reviewed by Sam Weinig.
2621
2622         * UIProcess/ios/WKContentViewInteraction.mm:
2623         (-[WKContentView _interpretKeyEvent:isCharEvent:]): Bail out if we are no longer the first
2624         responder.
2625
2626 2015-07-07  Anders Carlsson  <andersca@apple.com>
2627
2628         Always begin a background task when needed, not just when we go into the background
2629         https://bugs.webkit.org/show_bug.cgi?id=146704
2630
2631         Reviewed by Gavin Barraclough.
2632
2633         The system let background code run for the same amount of time regardless of whether the assertion was grabbed
2634         when the app is in the foreground or being backgrounded, so remove the background/foreground tracking code.
2635
2636         * UIProcess/ios/ProcessAssertionIOS.mm:
2637         (-[WKProcessAssertionBackgroundTaskManager _updateBackgroundTask]):
2638         (-[WKProcessAssertionBackgroundTaskManager init]): Deleted.
2639         (-[WKProcessAssertionBackgroundTaskManager _applicationWillEnterForeground]): Deleted.
2640         (-[WKProcessAssertionBackgroundTaskManager _applicationDidEnterBackground]): Deleted.
2641
2642 2015-07-08  Antti Koivisto  <antti@apple.com>
2643
2644         Network Cache: Don't open files in main thread
2645         https://bugs.webkit.org/show_bug.cgi?id=146722
2646
2647         Follow-up.
2648
2649         * NetworkProcess/cache/NetworkCacheStorage.cpp:
2650         (WebKit::NetworkCache::Storage::dispatchReadOperation):
2651
2652             Accessing m_bodyFilter is technically not thread safe so keep it in main thread.
2653
2654 2015-07-08  Antti Koivisto  <antti@apple.com>
2655
2656         Network Cache: Don't open files in main thread
2657         https://bugs.webkit.org/show_bug.cgi?id=146722
2658
2659         Reviewed by Chris Dumez.
2660
2661         While we use open() with O_NONBLOCK profiling indicates that we still may block up to 5ms under the syscall in some case.
2662
2663         * NetworkProcess/cache/NetworkCacheStorage.cpp:
2664         (WebKit::NetworkCache::Storage::dispatchReadOperation):
2665
2666             Dispatch read operation to a concurrent queue.
2667             With this we can also eliminate the separate dispatch() for body blob read.
2668
2669 2015-07-08  Sungmann Cho  <sungmann.cho@navercorp.com>
2670
2671         [Unix] Remove unused local variable from Connection::sendOutgoingMessage().
2672         https://bugs.webkit.org/show_bug.cgi?id=146713
2673
2674         Reviewed by Csaba Osztrogonác.
2675
2676         * Platform/IPC/unix/ConnectionUnix.cpp:
2677         (IPC::Connection::sendOutgoingMessage):
2678
2679 2015-07-07  Tim Horton  <timothy_horton@apple.com>
2680
2681         Occasional null deref in the CA callback in flushLayers()
2682         https://bugs.webkit.org/show_bug.cgi?id=146700
2683         <rdar://problem/21668754>
2684
2685         Reviewed by Simon Fraser.
2686
2687         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
2688         (WebKit::TiledCoreAnimationDrawingArea::flushLayers):
2689         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
2690         (WebKit::RemoteLayerTreeDrawingArea::flushLayers):
2691         Make sure we keep the WebPage alive, and null-check the potentially null
2692         WebCore objects (Page and Frame).
2693
2694 2015-07-06  Matt Rajca  <mrajca@apple.com>
2695
2696         Media Session: propagate metadata changes to UI clients
2697         https://bugs.webkit.org/show_bug.cgi?id=146660
2698
2699         Reviewed by Tim Horton.
2700
2701         * CMakeLists.txt: Added WebMediaSessionMetadata and WKMediaSessionMetadata.
2702         * Shared/API/APIObject.h: Added a media session metadata type.
2703         * Shared/API/c/WKBase.h:
2704         * Shared/WebMediaSessionMetadata.cpp: Added API adapter for WebCore::MediaSessionMetadata.
2705         (WebKit::WebMediaSessionMetadata::create):
2706         (WebKit::WebMediaSessionMetadata::WebMediaSessionMetadata):
2707         (WebKit::WebMediaSessionMetadata::~WebMediaSessionMetadata):
2708         * Shared/WebMediaSessionMetadata.h: Added API adapter for WebCore::MediaSessionMetadata.
2709         (WebKit::WebMediaSessionMetadata::title):
2710         (WebKit::WebMediaSessionMetadata::artist):
2711         (WebKit::WebMediaSessionMetadata::album):
2712         * UIProcess/API/APIUIClient.h: Added 'mediaSessionMetadataDidChange' interface.
2713         (API::UIClient::mediaSessionMetadataDidChange):
2714         * UIProcess/API/C/WKAPICast.h:
2715         * UIProcess/API/C/WKMediaSessionMetadata.cpp: Added C wrapper for WebMediaSessionMetadata.
2716         (WKMediaSessionMetadataGetTypeID):
2717         (WKMediaSessionMetadataCopyTitle):
2718         (WKMediaSessionMetadataCopyArtist):
2719         (WKMediaSessionMetadataCopyAlbum):
2720         * UIProcess/API/C/WKMediaSessionMetadata.h: Added C wrapper for WebMediaSessionMetadata.
2721         * UIProcess/API/C/WKPage.cpp: Forward 'mediaSessionMetadataDidChange' to client.
2722         (WKPageSetPageUIClient):
2723         * UIProcess/API/C/WKPageUIClient.h: Added 'mediaSessionMetadataDidChange' callback.
2724         * UIProcess/WebPageProxy.cpp: Forward 'mediaSessionMetadataDidChange' to UI client.
2725         (WebKit::WebPageProxy::mediaSessionMetadataDidChange):
2726         * WebKit2.xcodeproj/project.pbxproj: Added WebMediaSessionMetadata and WKMediaSessionMetadata.
2727
2728 2015-07-07  Brady Eidson  <beidson@apple.com>
2729
2730         HTTP Auth cached after disabling private browsing/reset.
2731         <rdar://problem/8293055> and https://bugs.webkit.org/show_bug.cgi?id=146654
2732
2733         Reviewed by Tim Horton.
2734
2735         * WebProcess/Plugins/PluginView.cpp:
2736         (WebKit::PluginView::getAuthenticationInfo):
2737
2738 2015-07-07  Anders Carlsson  <andersca@apple.com>
2739
2740         Make sure to remove the download message receiver before freeing it
2741         https://bugs.webkit.org/show_bug.cgi?id=146687
2742
2743         Reviewed by Simon Fraser.
2744
2745         * UIProcess/Downloads/DownloadProxyMap.cpp:
2746         (WebKit::DownloadProxyMap::downloadFinished):
2747
2748 2015-07-07  Chris Dumez  <cdumez@apple.com>
2749
2750         Unreviewed, Fix non-Mac build after r186464.
2751
2752         * UIProcess/Network/CustomProtocols/soup/CustomProtocolManagerProxySoup.cpp:
2753         (WebKit::CustomProtocolManagerProxy::~CustomProtocolManagerProxy):
2754
2755 2015-07-06  Anders Carlsson  <andersca@apple.com>
2756
2757         Make sure to remove message receivers before they are deallocated
2758         https://bugs.webkit.org/show_bug.cgi?id=146666
2759         rdar://problem/21331118
2760
2761         Reviewed by Tim Horton.
2762
2763         Add code so we can assert that there are no message receiver maps pointing to a message receiver
2764         when it's being destroyed. Fix all the assertions by calling removeMessageReceiver in the right places.
2765
2766         * Platform/IPC/MessageReceiver.h:
2767         (IPC::MessageReceiver::~MessageReceiver):
2768         (IPC::MessageReceiver::willBeAddedToMessageReceiverMap):
2769         (IPC::MessageReceiver::willBeRemovedFromMessageReceiverMap):
2770         * Platform/IPC/MessageReceiverMap.cpp:
2771         (IPC::MessageReceiverMap::addMessageReceiver):
2772         (IPC::MessageReceiverMap::removeMessageReceiver):
2773         (IPC::MessageReceiverMap::invalidate):
2774         * Shared/ChildProcess.cpp:
2775         (WebKit::ChildProcess::removeMessageReceiver):
2776         * Shared/ChildProcess.h:
2777         * Shared/ChildProcessProxy.cpp:
2778         (WebKit::ChildProcessProxy::removeMessageReceiver):
2779         * Shared/ChildProcessProxy.h:
2780         * UIProcess/API/Cocoa/WKBrowsingContextController.mm:
2781         (-[WKBrowsingContextController dealloc]):
2782         * UIProcess/Network/CustomProtocols/CustomProtocolManagerProxy.h:
2783         * UIProcess/Network/CustomProtocols/mac/CustomProtocolManagerProxyMac.mm:
2784         (WebKit::CustomProtocolManagerProxy::~CustomProtocolManagerProxy):
2785         * UIProcess/UserContent/WebUserContentControllerProxy.cpp:
2786         (WebKit::WebUserContentControllerProxy::~WebUserContentControllerProxy):
2787         * UIProcess/WebConnectionToWebProcess.cpp:
2788         (WebKit::WebConnectionToWebProcess::invalidate):
2789         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
2790         (-[WKWebProcessPlugInBrowserContextController dealloc]):
2791         * WebProcess/WebConnectionToUIProcess.cpp:
2792         (WebKit::WebConnectionToUIProcess::invalidate):
2793
2794 2015-07-06  Brent Fulgham  <bfulgham@apple.com>
2795
2796         Ensure media playback is stopped during page close
2797         https://bugs.webkit.org/show_bug.cgi?id=146554
2798         <rdar://problem/18033944>
2799
2800         Reviewed by Brady Eidson.
2801
2802         * WebProcess/WebProcess.cpp:
2803         (WebKit::WebProcess::didClose): Make sure to clean up any running media sessions when
2804         the process is being shut down.
2805
2806 2015-07-06  Commit Queue  <commit-queue@webkit.org>
2807
2808         Unreviewed, rolling out r186385.
2809         https://bugs.webkit.org/show_bug.cgi?id=146668
2810
2811         crashes 3 webaudio tests in debug builds (Requested by
2812         alexchristensen on #webkit).
2813
2814         Reverted changeset:
2815
2816         "Ensure media playback is stopped during page close"
2817         https://bugs.webkit.org/show_bug.cgi?id=146554
2818         http://trac.webkit.org/changeset/186385
2819
2820 2015-07-06  Brent Fulgham  <bfulgham@apple.com>
2821
2822         Ensure media playback is stopped during page close
2823         https://bugs.webkit.org/show_bug.cgi?id=146554
2824         <rdar://problem/18033944>
2825
2826         Reviewed by Brady Eidson.
2827
2828         * WebProcess/WebProcess.cpp:
2829         (WebKit::WebProcess::didClose): Make sure to clean up any running media sessions when
2830         the process is being shut down.
2831
2832 2015-07-06  Yongjun Zhang  <yongjun_zhang@apple.com>
2833
2834         Allow UIDelegate to customize link actions in preview.
2835         https://bugs.webkit.org/show_bug.cgi?id=146567
2836
2837         Add a new UIDelegate method to pass the defaultActions and elementInfo to client to allow
2838         the client customize the actions based on the element. Also add a new SPI runActionWithElementInfo:
2839         to _WKElementAction and make it aware of the WKActionSheetAssistant that creates it, so that
2840         the client can run the action without knowing WKActionSheetAssistant.
2841
2842         Reviewed by Beth Dakin.
2843
2844         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: Add delegate method _webView:previewViewControllerForURL:defaultActions:elementInfo:.
2845         * UIProcess/API/Cocoa/_WKElementAction.h: Add a SPI runActionWithElementInfo:.
2846         * UIProcess/API/Cocoa/_WKElementAction.mm:
2847         (-[_WKElementAction _initWithTitle:actionHandler:type:assistant:]): Modified initializer, also initialize _defaultActionSheetAssistant
2848             iVar if the caller provides that.
2849         (+[_WKElementAction elementActionWithTitle:actionHandler:]): Use the new initializer.
2850         (+[_WKElementAction _elementActionWithType:customTitle:assistant:]): A new helper method to create _WKElementAction with assistant.
2851         (+[_WKElementAction _elementActionWithType:assistant:]):
2852         (+[_WKElementAction elementActionWithType:customTitle:]):
2853         (-[_WKElementAction runActionWithElementInfo:]):
2854         * UIProcess/API/Cocoa/_WKElementActionInternal.h:
2855         * UIProcess/ios/WKActionSheetAssistant.h: Add a method defaultActionsForLinkSheet.
2856         * UIProcess/ios/WKActionSheetAssistant.mm:
2857         (-[WKActionSheetAssistant defaultActionsForLinkSheet]): Get default actions for current link that is activated.
2858         (-[WKActionSheetAssistant showLinkSheet]): Use defaultActionsForLinkSheet.
2859         * UIProcess/ios/WKContentViewInteraction.mm:
2860         (-[WKContentView previewViewControllerForPosition:inSourceView:]): Pass defaultActions and elementInfo to UIDelegate when querying
2861             for preview view controller.
2862         (-[WKContentView didDismissPreviewViewController:committing:]):
2863
2864 2015-07-06  Brady Eidson  <beidson@apple.com>
2865
2866         ShouldOpenExternalURLsPolicy should default to "Allow" for WK2 API loads.
2867         <rdar://problem/21640050> and https://bugs.webkit.org/show_bug.cgi?id=146563
2868
2869         Reviewed by Geoff Garen.
2870
2871         * UIProcess/API/Cocoa/WKWebView.mm:
2872         (-[WKWebView loadRequest:]): Move _loadRequest:withOptions: logic back here, just without options.
2873         (-[WKWebView _loadRequest:withOptions:]): This SPI is now unneeded, but must remain inactive.
2874         * UIProcess/WebPageProxy.h:
2875
2876 2015-07-06  Csaba Osztrogonác  <ossy@webkit.org>
2877
2878         URTBF after r186357 to fix non Cocoa platforms.
2879
2880         * NetworkProcess/NetworkProcess.cpp:
2881         (WebKit::NetworkProcess::deleteWebsiteData):
2882
2883 2015-07-06  Antti Koivisto  <antti@apple.com>
2884
2885         With multipart/replaced (e.g. motion JPEG), m_bufferedDataForCache grows unbounded in Networking process
2886         https://bugs.webkit.org/show_bug.cgi?id=146630
2887         <rdar://problem/21677340>
2888
2889         Follow-up.
2890
2891         * NetworkProcess/NetworkResourceLoader.cpp:
2892         (WebKit::NetworkResourceLoader::didReceiveBuffer):
2893
2894             Typo 1014 -> 1024
2895
2896 2015-07-06  Commit Queue  <commit-queue@webkit.org>
2897
2898         Unreviewed, rolling out r185896.
2899         https://bugs.webkit.org/show_bug.cgi?id=146647
2900
2901         Caused by a refcounting error in GTK+; it's actually legal for
2902         the event to be null, just the gi annotations were wrong.
2903         (Requested by mcatanzaro on #webkit).
2904
2905         Reverted changeset:
2906
2907         "[GTK] Crash performing drag-and-drop"
2908         https://bugs.webkit.org/show_bug.cgi?id=146267
2909         http://trac.webkit.org/changeset/185896
2910
2911 2015-07-06  Anders Carlsson  <andersca@apple.com>
2912
2913         Provide API to clear the HSTS cache
2914         https://bugs.webkit.org/show_bug.cgi?id=146565
2915         rdar://problem/20023805
2916
2917         Reviewed by Tim Horton.
2918
2919         * NetworkProcess/NetworkProcess.cpp:
2920         (WebKit::NetworkProcess::deleteWebsiteData):
2921         * NetworkProcess/NetworkProcess.h:
2922         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
2923         (WebKit::NetworkProcess::clearHSTSCache):
2924         * Shared/WebsiteData/WebsiteDataTypes.h:
2925         * UIProcess/API/Cocoa/WKWebsiteDataRecord.mm:
2926         (dataTypesToString):
2927         * UIProcess/API/Cocoa/WKWebsiteDataRecordInternal.h:
2928         (WebKit::toWebsiteDataTypes):
2929         (WebKit::toWKWebsiteDataTypes):
2930         * UIProcess/API/Cocoa/WKWebsiteDataRecordPrivate.h:
2931         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2932         (WebKit::computeNetworkProcessAccessTypeForDataRemoval):
2933
2934 2015-07-06  Antti Koivisto  <antti@apple.com>
2935
2936         With multipart/replaced (e.g. motion JPEG), m_bufferedDataForCache grows unbounded in Networking process
2937         https://bugs.webkit.org/show_bug.cgi?id=146630
2938         <rdar://problem/21677340>
2939
2940         Reviewed by Chris Dumez.
2941
2942         * NetworkProcess/NetworkResourceLoader.cpp:
2943         (WebKit::NetworkResourceLoader::didReceiveResponseAsync):
2944
2945             Don't buffer multipart/x-mixed-replace. We never want to cache these.
2946
2947         (WebKit::NetworkResourceLoader::didReceiveBuffer):
2948
2949             Limit the maximum size of the cache buffer to 10MB. This prevents unbounded memory growth if the resource
2950             keeps streaming. It also prevents giant entries from pushing other data out of the cache.
2951
2952         (WebKit::NetworkResourceLoader::didFinishLoading):
2953
2954 2015-07-06  Zan Dobersek  <zdobersek@igalia.com>
2955
2956         [GTK] Guard X11-specific code in webkitWebViewBaseDidRelaunchWebProcess()
2957         https://bugs.webkit.org/show_bug.cgi?id=146627
2958
2959         Reviewed by Carlos Garcia Campos.
2960
2961         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
2962         (webkitWebViewBaseDidRelaunchWebProcess):
2963         Guard calls to DrawingAreaImpl::setNativeSurfaceHandleForCompositing()
2964         that pass in an X11 Window ID with the PLATFORM(X11) build guards.
2965
2966 2015-07-05  Chris Dumez  <cdumez@apple.com>
2967
2968         [WK2] Current page's scroll position is lost when transferring sessionState from one view to another
2969         https://bugs.webkit.org/show_bug.cgi?id=146625
2970         <rdar://problem/21585268>
2971
2972         Reviewed by Gavin Barraclough.
2973
2974         The current page's scroll position was lost when transferring the
2975         sessionState from one view to another. This is because we only update
2976         the current WebBackForwardListItem after navigating away.
2977         However, when the client swaps WebViews for navigating, we don't detect
2978         this as navigating away and the current WebBackForwardListItem is not
2979         updated with the current page's state (including the scroll position).
2980         This means that the information is not transferred via the sessionState
2981         and the scroll position (among other things) ends up being lost when
2982         navigating back in the new WebView.
2983
2984         Retrieving the session state is a synchronous API and we want to avoid
2985         doing a synchronous IPC between the UIProcess and the WebProcess to
2986         retrieve the current page's state. Therefore, the approach chosen in
2987         this patch is to detect when the user is done scrolling the main frame
2988         (using a HystererisActivity) and then update the scroll position on the
2989         current HistoryItem. This way, the current WebBackForwardListItem
2990         normally has an up-to-date scroll position for the main frame when the
2991         sessionState is queried by the client.
2992
2993         The solution is not perfect as we don't keep the whole page state
2994         up-to-date for the current WebBackForwardListItem, only the main frame
2995         state. However, the proposed solution is cheap, avoid synchronous IPC
2996         and provides a much better user experience in most cases.
2997
2998         * WebProcess/WebPage/WebPage.cpp:
2999         (WebKit::WebPage::WebPage):
3000         (WebKit::WebPage::pageDidScroll):
3001         (WebKit::WebPage::pageStoppedScrolling):
3002         * WebProcess/WebPage/WebPage.h:
3003
3004 2015-07-05  Timothy Hatcher  <timothy@apple.com>
3005
3006         Crash when closing the web inspector
3007         https://bugs.webkit.org/show_bug.cgi?id=146620
3008
3009         Reviewed by Darin Adler.
3010
3011         * WebProcess/WebPage/WebInspectorUI.cpp:
3012         (WebKit::WebInspectorUI::closeWindow): Null check the connection, like it is
3013         in other places where it is used.
3014
3015 2015-07-04  Chris Dumez  <cdumez@apple.com>
3016
3017         Drop RefPtr::clear() method
3018         https://bugs.webkit.org/show_bug.cgi?id=146556
3019
3020         Reviewed by Brady Eidson.
3021
3022         Drop RefPtr::clear() method in favor of "= nullptr;" pattern.        
3023
3024 2015-07-03  Dan Bernstein  <mitz@apple.com>
3025
3026         [Xcode] Update some build settings as recommended by Xcode 7
3027         https://bugs.webkit.org/show_bug.cgi?id=146597
3028
3029         Reviewed by Sam Weinig.
3030
3031         * Configurations/Base.xcconfig: Enabled CLANG_WARN_UNREACHABLE_CODE and
3032         GCC_NO_COMMON_BLOCKS. Removed GCC_MODEL_TUNING.
3033
3034         * WebKit2.xcodeproj/project.pbxproj: Updated LastUpgradeCheck.
3035
3036 2015-07-03  Carlos Garcia Campos  <cgarcia@igalia.com>
3037
3038         REGRESSION(r186025): [SOUP] NetworkCache gets blocked in traverse since r186025
3039         https://bugs.webkit.org/show_bug.cgi?id=146545
3040
3041         Reviewed by Sergio Villar Senin.
3042
3043         In r186025 the readSync method used when traversing the cache
3044         files was removed in favor of using parallel async reads to speed
3045         up the traverse. The approach used doesn't work for soup, because
3046         the IO operations are async, but run their callbacks in the
3047         current thread. The network cache now runs up to 5 async reads in
3048         the io work queue thread, and waits for them to finish, and those
3049         asycn reads never finish for the soup backend because the thread
3050         is blocked waiting for them. We need to use a different thread to
3051         run those reads.
3052
3053         * NetworkProcess/cache/NetworkCacheIOChannel.h: Add
3054         readSyncInThread private method.
3055         * NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp:
3056         (WebKit::NetworkCache::IOChannel::read): When not called in the
3057         main thread, call readSyncInThread() instead.
3058         (WebKit::NetworkCache::IOChannel::readSyncInThread): Run the read
3059         operation synchronously in a different thread, since the current
3060         thread might be blocked waiting for us.
3061
3062 2015-07-02  Przemek Piorkowski  <piorkowskiprzemyslaw@gmail.com>
3063
3064         [EFL] test_ewk2_application_cache_manager has been failed since r185527
3065         https://bugs.webkit.org/show_bug.cgi?id=146016
3066
3067         Reviewed by Gyuyoung Kim.
3068
3069         In order to handle properly WebApplicationCacheManagerProxy implementation which use
3070         WebsiteDataRecord it is necessary to enable PUBLIC_SUFFIX_LIST for EFL.
3071         Implementation of PUBLIC_SUFFIX_LIST already exists for soup so EFL can use it as well.
3072
3073         * UIProcess/API/efl/tests/test_ewk2_application_cache_manager.cpp:
3074         (TEST_F): enable ewk_application_cache_manager as it is passing now.
3075
3076 2015-07-02  Commit Queue  <commit-queue@webkit.org>
3077
3078         Unreviewed, rolling out r186247 and r186250.
3079         https://bugs.webkit.org/show_bug.cgi?id=146572
3080
3081         Broke the build on Mavericks bots (Requested by cdumez on
3082         #webkit).
3083
3084         Reverted changesets:
3085
3086         "Provide API to clear the HSTS cache"
3087         https://bugs.webkit.org/show_bug.cgi?id=146565
3088         http://trac.webkit.org/changeset/186247
3089
3090         "Unreviewed build fix for non-COCOA ports after r186247."
3091         http://trac.webkit.org/changeset/186250
3092
3093 2015-07-02  Jinwoo Song  <jinwoo7.song@samsung.com>
3094
3095         Unreviewed build fix for non-COCOA ports after r186247.
3096
3097         * NetworkProcess/NetworkProcess.cpp:
3098         (WebKit::NetworkProcess::deleteWebsiteData): Add PLATFORM(COCOA) guard.
3099
3100 2015-07-02  Anders Carlsson  <andersca@apple.com>
3101
3102         Provide API to clear the HSTS cache
3103         https://bugs.webkit.org/show_bug.cgi?id=146565
3104         rdar://problem/20023805
3105
3106         Reviewed by Tim Horton.
3107
3108         * NetworkProcess/NetworkProcess.cpp:
3109         (WebKit::NetworkProcess::deleteWebsiteData):
3110         * NetworkProcess/NetworkProcess.h:
3111         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
3112         (WebKit::NetworkProcess::clearHSTSCache):
3113         * Shared/WebsiteData/WebsiteDataTypes.h:
3114         * UIProcess/API/Cocoa/WKWebsiteDataRecord.mm:
3115         (dataTypesToString):
3116         * UIProcess/API/Cocoa/WKWebsiteDataRecordInternal.h:
3117         (WebKit::toWebsiteDataTypes):
3118         (WebKit::toWKWebsiteDataTypes):
3119         * UIProcess/API/Cocoa/WKWebsiteDataRecordPrivate.h:
3120         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
3121         (WebKit::computeNetworkProcessAccessTypeForDataRemoval):
3122
3123 2015-07-02  Mark Lam  <mark.lam@apple.com>
3124
3125         Gardening: fix broken 32-bit build..
3126         https://bugs.webkit.org/show_bug.cgi?id=146416
3127
3128         Not reviewed.
3129
3130         * UIProcess/API/Cocoa/APISerializedScriptValueCocoa.mm:
3131         (API::SerializedScriptValue::deserialize):
3132
3133 2015-07-02  Brent Fulgham  <bfulgham@apple.com>
3134
3135         Correct *another* typo in r186238.
3136
3137         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: Fix parameter name scrolView -> scrollView.
3138
3139 2015-07-02  Brent Fulgham  <bfulgham@apple.com>
3140
3141         Correct typo in r186238.
3142
3143         * UIProcess/API/Cocoa/WKWebView.mm:
3144         (-[WKWebView scrollViewWillEndDragging:withVelocity:targetContentOffset:]):
3145
3146 2015-07-02  Brent Fulgham  <bfulgham@apple.com>
3147
3148         Provide delegate SPI for clients to notify WebKit about content inset changes
3149         https://bugs.webkit.org/show_bug.cgi?id=146482
3150         <rdar://problem/21602741>
3151
3152         Reviewed by Darin Adler.
3153
3154         Provide a new SPI for WebKit client applications to use to inform WebKit of planned
3155         adjustments to the edge insets of the view.
3156
3157         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: Add new optional delegate method.
3158         * UIProcess/API/Cocoa/WKWebView.mm:
3159         (-[WKWebView scrollViewWillEndDragging:withVelocity:targetContentOffset:]): If the new delegate
3160         method exists, use the specified content insets, rather than the current state of the view.
3161
3162 2015-07-02  Beth Dakin  <bdakin@apple.com>
3163
3164         Allow the UIDelegate to customize an image preview
3165         https://bugs.webkit.org/show_bug.cgi?id=146557
3166         -and corresponding-
3167         rdar://problem/21657424
3168
3169         Reviewed by Tim Horton.
3170
3171         Add imageURL to InteractionInformationAtPosition.
3172         * Shared/InteractionInformationAtPosition.cpp:
3173         (WebKit::InteractionInformationAtPosition::encode):
3174         (WebKit::InteractionInformationAtPosition::decode):
3175         * Shared/InteractionInformationAtPosition.h:
3176
3177         Two new delegate methods.
3178         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
3179
3180         Call the delegate methods at the appropriate time.
3181         * UIProcess/ios/WKContentViewInteraction.mm:
3182         (-[WKContentView previewViewControllerForPosition:inSourceView:]):
3183         (-[WKContentView commitPreviewViewController:]):
3184
3185         Include the imageURL in InteractionInformationAtPosition.
3186         * WebProcess/WebPage/ios/WebPageIOS.mm:
3187         (WebKit::WebPage::getPositionInformation):
3188
3189 2015-07-02  Anders Carlsson  <andersca@apple.com>
3190
3191         Instead of requiring ToT UIKIt, check that UI_WEB_TOUCH_EVENT_HAS_IS_POTENTIAL_TAP is defined to 1
3192         https://bugs.webkit.org/show_bug.cgi?id=146558
3193
3194         Reviewed by Beth Dakin.
3195
3196         * Shared/ios/NativeWebTouchEventIOS.mm:
3197         (WebKit::NativeWebTouchEvent::NativeWebTouchEvent):
3198
3199 2015-07-02  Brady Eidson  <beidson@apple.com>
3200
3201         Remove change I accidentally committed in r186232
3202
3203         * UIProcess/WebsiteData/WebsiteDataStore.h:
3204
3205 2015-07-02  Alex Christensen  <achristensen@webkit.org>
3206
3207         Fix EWS build after r186182.
3208
3209         * WebProcess/WebPage/WebPage.h:
3210         (WebKit::WebPage::userMediaPermissionRequestManager):
3211         Don't export a function defined in a header, or it will generate a weak external symbol.
3212
3213 2015-07-02  Brady Eidson  <beidson@apple.com>
3214
3215         Add preference to disable all http-equiv.
3216         <rdar://problem/9091261> and https://bugs.webkit.org/show_bug.cgi?id=146553
3217
3218         Reviewed by Sam Weinig.
3219
3220         * Shared/WebPreferencesDefinitions.h:
3221         
3222         * UIProcess/API/C/WKPreferences.cpp:
3223         (WKPreferencesSetMetaRefreshEnabled): Still expose this SPI, but have it affect
3224           the "httpEquivEnabled" setting.
3225         (WKPreferencesGetMetaRefreshEnabled): Ditto
3226         (WKPreferencesSetHTTPEquivEnabled):
3227         (WKPreferencesGetHTTPEquivEnabled):
3228         * UIProcess/API/C/WKPreferencesRefPrivate.h:
3229         
3230         * WebProcess/InjectedBundle/InjectedBundle.cpp:
3231         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
3232         
3233         * WebProcess/WebPage/WebPage.cpp:
3234         (WebKit::WebPage::updatePreferences):
3235
3236 2015-07-02  Mark Lam  <mark.lam@apple.com>
3237
3238         WKWebView evaluateJavaScript:completionHandler: should reuse its JSContext instance.
3239         https://bugs.webkit.org/show_bug.cgi?id=146416
3240
3241         Reviewed by Anders Carlsson.
3242
3243         The core issue here is that we need to be able to deserialized an
3244         API::SerializedScriptValue instance into an ObjC object graph.  We'll solve this
3245         by introducing a API::SerializedScriptValue::deserialize() functions that does
3246         the job.  The deserialize() function will will use a SharedJSContext to provide
3247         the needed JSContext for doing this work.
3248
3249         Also updated ScriptMessageHandlerDelegate::didPostMessage() to use this new
3250         deserialize() function.
3251
3252         * Shared/API/APISerializedScriptValue.h:
3253         (API::SerializedScriptValue::deserialize):
3254         (API::SerializedScriptValue::internalRepresentation):
3255         - Changed to return a WebCore::SerializedScriptValue*.  This makes it friendlier
3256           to use in the 2 places that need it.
3257
3258         * UIProcess/API/Cocoa/APISerializedScriptValueCocoa.mm: Added.
3259         (API::SharedJSContext::SharedJSContext):
3260         (API::SharedJSContext::ensureContext):
3261         (API::SharedJSContext::releaseContext):
3262         (API::SerializedScriptValue::deserialize):
3263         * UIProcess/API/Cocoa/WKUserContentController.mm:
3264         * UIProcess/API/Cocoa/WKWebView.mm:
3265         (-[WKWebView evaluateJavaScript:completionHandler:]):
3266         * UIProcess/API/gtk/WebKitWebView.cpp:
3267         (webkitWebViewRunJavaScriptCallback):
3268         - Removed a now unnecessary cast.
3269         * WebKit2.xcodeproj/project.pbxproj:
3270
3271 2015-07-02  Dan Bernstein  <mitz@apple.com>
3272
3273         <rdar://problem/21429613> [iOS] Stop making symlinks from PrivateFrameworks to Frameworks
3274         https://bugs.webkit.org/show_bug.cgi?id=146542
3275
3276         Reviewed by Sam Weinig.
3277
3278         * WebKit2.xcodeproj/project.pbxproj: Removed the build phase that makes the directory of
3279         symlinks.
3280
3281 2015-07-02  Carlos Garcia Campos  <cgarcia@igalia.com>
3282
3283         [GTK] WebSQL doesn't work because openDatabase always fails with DOM Exception 18
3284         https://bugs.webkit.org/show_bug.cgi?id=146234
3285
3286         Reviewed by Sergio Villar Senin.
3287
3288         This is because we don't provide any quota, and 0 is used by
3289         default, so there's never enough quota and openDatabase fails. We
3290         should expose this in the API, but for now, we could use a default
3291         quota of 5MB like WTR does.
3292
3293         * UIProcess/API/gtk/WebKitUIClient.cpp: Override
3294         exceededDatabaseQuota and return always the default quota.
3295         * UIProcess/gtk/WebInspectorProxyGtk.cpp:
3296         (WebKit::exceededDatabaseQuota): Return the quota based on the
3297         expected usage and current database usabe like mac does.
3298         (WebKit::WebInspectorProxy::platformCreateInspectorPage): Add
3299         custom UI client to implement exceededDatabaseQuota.
3300
3301 2015-07-02  Commit Queue  <commit-queue@webkit.org>
3302
3303         Unreviewed, rolling out r185704.
3304         https://bugs.webkit.org/show_bug.cgi?id=146544
3305
3306         Didn't fix the problem (Requested by anttik on #webkit).
3307
3308         Reverted changeset:
3309
3310         "~4% Membuster regression after WebKit r185452"
3311         https://bugs.webkit.org/show_bug.cgi?id=146112
3312         http://trac.webkit.org/changeset/185704
3313
3314 2015-07-02  Carlos Garcia Campos  <cgarcia@igalia.com>
3315
3316         [GTK] Accelerated Compositing stops working after a web process crash
3317         https://bugs.webkit.org/show_bug.cgi?id=146508
3318
3319         Reviewed by Martin Robinson.
3320
3321         The problem is that we don't send the window ID again to the new
3322         web process.
3323
3324         * UIProcess/API/gtk/PageClientImpl.cpp:
3325         (WebKit::PageClientImpl::didRelaunchProcess): Call
3326         webkitWebViewBaseDidRelaunchWebProcess().
3327         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
3328         (webkitWebViewBaseDidRelaunchWebProcess): Set the window ID to
3329         the new drawing area.
3330         * UIProcess/API/gtk/WebKitWebViewBasePrivate.h:
3331
3332 2015-07-01  Joseph Pecoraro  <pecoraro@apple.com>
3333
3334         Web Inspector: [Mac] InspectorFrontendHost.beep() doesn't play a sound, sandbox warnings
3335         https://bugs.webkit.org/show_bug.cgi?id=146525
3336
3337         Reviewed by Timothy Hatcher.
3338
3339         * WebProcess/com.apple.WebProcess.sb.in:
3340         Get NSBeep working without any sandbox warnings.
3341
3342 2015-07-01  Anders Carlsson  <andersca@apple.com>
3343
3344         Remove code to recompute rounded window corners
3345         https://bugs.webkit.org/show_bug.cgi?id=146534
3346
3347         Reviewed by Simon Fraser.
3348
3349         This code is no longer needed since we're always layer-backed now.
3350
3351         * UIProcess/API/mac/WKView.mm:
3352         (-[WKView displayIfNeeded]): Deleted.
3353         (-[WKView _cacheWindowBottomCornerRect]): Deleted.
3354         * UIProcess/API/mac/WKViewInternal.h:
3355
3356 2015-07-01  Yongjun Zhang  <yongjun_zhang@apple.com>
3357
3358         Web page doesn't update its loading state when web process becomes suspended if there are pending network requests (XHR).
3359         https://bugs.webkit.org/show_bug.cgi?id=146439
3360
3361         When web page is loading, we hold a background activity token in NavigationState and we release the token when the page done
3362         loading. A web page can start loading subresources (like XHR) after the page is loaded, and WebPageProxy will update its
3363         _networkRequestsInProgress state which will notify the client there is network actvity on-going. Since we don't hold
3364         the background activity token after page is loaded, the WebContent process could become suspended without notifying the client
3365         and the client will lose track of the loading state.
3366
3367         The first thought was to hold another background activity when _networkRequestsInProgress flag is set in NavigationState.
3368         However, this could result in side-effect that a WebContent process can stay active for too long if there is a long lasting
3369         XHR resquest.
3370         
3371         This patch fix this by notifying the client that network activity is stopped when WebContent process is going to be suspended.
3372         We also cache the networkRequestsInProgress state for suspended process, so that when it becomes foreground, we can tell
3373         the client the correct state of network activity.
3374
3375         Reviewed by Dan Bernstein.
3376
3377         * UIProcess/WebPageProxy.cpp:
3378         (WebKit::WebPageProxy::WebPageProxy): Initialize m_hasNetworkRequestsOnSuspended.
3379         (WebKit::WebPageProxy::processWillBecomeSuspended): If there is pending requests on suspend, cache the network activity state
3380             and notify the client.
3381         (WebKit::WebPageProxy::processWillBecomeForground): Restore the network activity state when the process becomes foreground. 
3382         (WebKit::WebPageProxy::resetState):
3383         * UIProcess/WebPageProxy.h: Add a data member m_hasNetworkRequestsOnSuspended to cache the network activity state on process
3384             suspend.
3385         * UIProcess/WebProcessProxy.cpp:
3386         (WebKit::WebProcessProxy::didSetAssertionState):
3387
3388 2015-07-01  Dean Jackson  <dino@apple.com>
3389
3390         Disable the experimental WebGL2 implementation
3391         https://bugs.webkit.org/show_bug.cgi?id=146526
3392         <rdar://problem/21641235>
3393
3394         Reviewed by Myles Maxfield.
3395
3396         Add (and disable) an ENABLE_WEBGL2 flag.
3397
3398         * Configurations/FeatureDefines.xcconfig:
3399
3400 2015-07-01  Brady Eidson  <beidson@apple.com>
3401
3402         Never try to pass URLs to LaunchServices when they're the same domain as the current URL.
3403         <rdar://problem/20731429> and https://bugs.webkit.org/show_bug.cgi?id=146521
3404
3405         Reviewed by Alex Christensen.
3406
3407         * UIProcess/Cocoa/NavigationState.mm:
3408         (WebKit::tryAppLink): Compare the proposed URL to the current URL to see if they’re in the same domain.
3409         (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):
3410
3411 2015-07-01  Tim Horton  <timothy_horton@apple.com>
3412
3413         WKWebView snapshots have the wrong scale after rotation
3414         https://bugs.webkit.org/show_bug.cgi?id=146476
3415         <rdar://problem/18345247>
3416
3417         Reviewed by Anders Carlsson.
3418
3419         * UIProcess/API/Cocoa/WKWebView.mm:
3420         (-[WKWebView _didCommitLayerTree:]):
3421         "Coordinate" -> "Coordinates".
3422
3423         (-[WKWebView _snapshotRect:intoImageOfWidth:completionHandler:]):
3424         Defer any snapshotting that happens during a resize until after
3425         the resize completes. This will ensure that (in the case of an IOSurface
3426         snapshot) the tiles are up to date, and (in the case of a software snapshot)
3427         that our understanding of the scale and scroll offset of the WKContentView
3428         are up to date, so that we can correctly convert from view to content coordinates
3429         in the UI process.
3430
3431         (-[WKWebView _endAnimatedResize]):
3432         Perform the deferred snapshotting after the resize completes.
3433
3434 2015-07-01  Beth Dakin  <bdakin@apple.com>
3435
3436         This is a quick follow-on to http://trac.webkit.org/changeset/186132
3437
3438         Rubber-stamped by Darin Adler.
3439
3440         Make this a one-liner.
3441         * WebProcess/WebPage/ios/WebPageIOS.mm:
3442         (WebKit::WebPage::getPositionInformation):
3443
3444 2015-07-01  Matthew Daiter  <mdaiter@apple.com>
3445
3446         Enable MEDIA_STREAM flag
3447         https://bugs.webkit.org/show_bug.cgi?id=145947
3448         <rdar://problem/21365829>
3449
3450         Reviewed by Eric Carlson.
3451
3452         * Configurations/FeatureDefines.xcconfig: Add MEDIA_STREAM flag
3453         * WebKit2.xcodeproj/project.pbxproj: Changed some project to private
3454         declarations of headers
3455         * WebProcess/WebCoreSupport/WebUserMediaClient.cpp:
3456         * WebProcess/WebPage/WebPage.h:
3457         (WebKit::WebPage::userMediaPermissionRequestManager):
3458
3459 2015-07-01  Brady Eidson  <beidson@apple.com>
3460
3461         Check shouldOpenExternalURLs instead of isProcessingUserGesture before passing URL to LaunchServices.
3462         <rdar://problem/20577859> and https://bugs.webkit.org/show_bug.cgi?id=146513
3463
3464         Reviewed by Darin Adler.
3465
3466         * UIProcess/Cocoa/NavigationState.mm:
3467         (WebKit::tryAppLink): The expected value of isProcessingUserGesture is lost over redirects.
3468           shouldOpenExternalURLs actually fits this role perfectly.
3469
3470 2015-07-01  Michael Catanzaro  <mcatanzaro@igalia.com>
3471
3472         [GTK] [Wayland] Build broken with ENABLE_WAYLAND_TARGET=ON
3473         https://bugs.webkit.org/show_bug.cgi?id=146512
3474
3475         Unreviewed, fix build with ENABLE_WAYLAND_TARGET=ON after r185949.
3476
3477         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
3478         (webkitWebViewBaseCreateWebPage):
3479
3480 2015-06-30  Martin Robinson  <mrobinson@igalia.com>
3481
3482         [GTK] REGRESSION(r183936): Test /webkit2/WebKitWebContext/spell-checker fails since r183936
3483         https://bugs.webkit.org/show_bug.cgi?id=144828
3484
3485         Reviewed by Carlos Garcia Campos.
3486
3487         Instead of setting spell checking languages unconditionally when building int
3488         developer mode, add some C API that allows setting them in WebKitTestRunner.
3489
3490         * PlatformGTK.cmake: Add the new C API file to the source list.
3491         * UIProcess/API/C/gtk/WKTextCheckerGtk.cpp:
3492         (WKTextCheckerSetSpellCheckingLanguages): Added this function which allows settings
3493         the spell checking languages from the C API.
3494         * UIProcess/API/C/gtk/WKTextCheckerGtk.h: Added.
3495         * UIProcess/gtk/TextCheckerGtk.cpp:
3496         (WebKit::enchantTextChecker): Remove the hack which sets the spell checking languages automatically
3497         for development builds.
3498
3499 2015-07-01  Joseph Pecoraro  <pecoraro@apple.com>
3500
3501         [Mac] Numerous CGColor leaks in swipe gestures
3502         https://bugs.webkit.org/show_bug.cgi?id=146501
3503
3504         Reviewed by Tim Horton.
3505
3506         * UIProcess/mac/ViewGestureControllerMac.mm:
3507         (WebKit::ViewGestureController::beginSwipeGesture):
3508
3509 2015-07-01  Joseph Pecoraro  <pecoraro@apple.com>
3510
3511         [Mac] Confusing RetainPtr use in TiledCoreAnimationDrawingArea
3512         https://bugs.webkit.org/show_bug.cgi?id=146503
3513
3514         Reviewed by Tim Horton.
3515
3516         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
3517         (WebKit::TiledCoreAnimationDrawingArea::commitTransientZoom):
3518         Simplify adoption into a new RetainPtr.
3519
3520 2015-06-30  Simon Fraser  <simon.fraser@apple.com>
3521
3522         Fix CoordinatedGraphics.
3523
3524         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
3525         (WebKit::CoordinatedLayerTreeHost::didFlushRootLayer):
3526
3527 2015-06-30  Simon Fraser  <simon.fraser@apple.com>
3528
3529         More Gtk/EFL fixing.
3530
3531         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
3532         (WebKit::CoordinatedLayerTreeHost::didFlushRootLayer):
3533         * WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp:
3534         (WebKit::LayerTreeHostGtk::flushPendingLayerChanges):
3535
3536 2015-06-30  Andy VanWagoner  <thetalecrafter@gmail.com>
3537
3538         Implement ECMAScript Internationalization API
3539         https://bugs.webkit.org/show_bug.cgi?id=90906
3540
3541         Reviewed by Benjamin Poulain.
3542
3543         * Configurations/FeatureDefines.xcconfig: add ENABLE_INTL flag
3544
3545 2015-06-30  Simon Fraser  <simon.fraser@apple.com>
3546
3547         Fix Mac and Windows builds.
3548
3549         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
3550         (WebKit::TiledCoreAnimationDrawingArea::flushLayers):
3551
3552 2015-06-30  Simon Fraser  <simon.fraser@apple.com>
3553
3554         [iOS] Missing tiles inside position:fixed on scrolling
3555         https://bugs.webkit.org/show_bug.cgi?id=146485
3556         rdar://problem/21226861
3557
3558         Reviewed by Tim Horton.
3559
3560         Layer flushing adjusts the coverage rect for tiled layers, but does so at times
3561         when position:fixed layers are moved around by the scrolling tree. The computed
3562         coverage rect then doesn't reflect the layer's on-screen position, causing missing
3563         tiles.
3564
3565         Fix by pushing the notion of being in a "stable state" onto FrameView, and passing
3566         that state into the layer flush. When not in a stable state, flushing doesn't change
3567         the visible and coverage rects for layers that are viewport-constrained.
3568
3569         * WebProcess/WebPage/ios/WebPageIOS.mm:
3570         (WebKit::WebPage::updateVisibleContentRects):
3571         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
3572         (WebKit::RemoteLayerTreeDrawingArea::flushLayers):
3573
3574 2015-06-30  Hyungwook Lee  <hyungwook.lee@navercorp.com>
3575
3576         [EFL] Implement ewk_favicon_database_clear() API.
3577         https://bugs.webkit.org/show_bug.cgi?id=146337
3578
3579         Reviewed by Gyuyoung Kim.
3580
3581         We need to provide way to clear favicon data.
3582
3583         * UIProcess/API/efl/ewk_favicon_database.cpp:
3584         (EwkFaviconDatabase::getIconSurfaceSynchronously):
3585         (EwkFaviconDatabase::clearFaviconDatabase):
3586         (EwkFaviconDatabase::iconDataReadyForPageURL):
3587         (ewk_favicon_database_icon_change_callback_del):
3588         (ewk_favicon_database_clear):
3589         * UIProcess/API/efl/ewk_favicon_database.h:
3590         * UIProcess/API/efl/ewk_favicon_database_private.h:
3591         * UIProcess/API/efl/tests/test_ewk2_favicon_database.cpp:
3592         (TEST_F):
3593
3594 2015-06-30  Andreas Kling  <akling@apple.com>
3595
3596         [iOS] Ignore viewport rect changes during zoom bouncing.
3597         <https://webkit.org/b/146480>
3598
3599         Reviewed by Benjamin Poulain.
3600
3601         When the user has pinch-zoomed past the maximum zoom scale and lets go of the screen,
3602         we animate a bounce back to the maximum scale.
3603
3604         Suppress viewport rect updates during this bounce animation since we don't need them
3605         anyway. This fixes an issue where we'd sometimes get a weird rect during the animation
3606         and if could send that to the web process, causing it to generate tiles for a part of
3607         the page that's not actually exposed.
3608
3609         * UIProcess/API/Cocoa/WKWebView.mm:
3610         (-[WKWebView _updateVisibleContentRects]):
3611
3612 2015-06-30  Enrica Casucci  <enrica@apple.com>
3613
3614         <rdar://problem/20655729> WebKit should heuristically exclude scrolling touch events from the user gesture category
3615
3616         Reviewed by Benjamin Poulain.
3617
3618         * Platform/spi/ios/UIKitSPI.h:
3619         * Shared/WebEvent.h:
3620         (WebKit::WebTouchEvent::WebTouchEvent):
3621         (WebKit::WebTouchEvent::position):
3622         (WebKit::WebTouchEvent::isPotentialTap):
3623         (WebKit::WebTouchEvent::isGesture):
3624         (WebKit::WebTouchEvent::gestureScale):
3625         (WebKit::WebTouchEvent::gestureRotation):
3626         * Shared/WebEventConversion.cpp:
3627         (WebKit::WebKit2PlatformTouchEvent::WebKit2PlatformTouchEvent):
3628         * Shared/ios/NativeWebTouchEventIOS.mm:
3629         (WebKit::NativeWebTouchEvent::NativeWebTouchEvent):
3630         * Shared/ios/WebTouchEventIOS.cpp:
3631         (WebKit::WebTouchEvent::encode):
3632         (WebKit::WebTouchEvent::decode):
3633         Pipe isPotentialTap through.
3634
3635 2015-06-30  Carlos Alberto Lopez Perez  <clopez@igalia.com>
3636
3637         [GTK] [EFL] Unreviewed build fix after r186118.
3638
3639         Add if PLATFORM(COCOA) back.
3640
3641         * WebProcess/WebProcess.cpp:
3642         (WebKit::WebProcess::nonVisibleProcessCleanupTimerFired):
3643         * WebProcess/WebProcess.h:
3644
3645 2015-06-30  Simon Fraser  <simon.fraser@apple.com>
3646
3647         Crash under _layoutForNodeHighlight: when inspecting espn.com
3648         https://bugs.webkit.org/show_bug.cgi?id=146422
3649
3650         Reviewed by Joseph Pecoraro.
3651         
3652         When inspecting espn.com, MobileSafari sometimes crashes, because
3653         highlight.quads is empty. I was not able to quickly determine why.
3654
3655         Fix by bailing in this case.
3656
3657         * UIProcess/WKInspectorHighlightView.mm:
3658         (-[WKInspectorHighlightView _layoutForNodeHighlight:]):
3659
3660 2015-06-30  Matt Baker  <mattbaker@apple.com>
3661
3662         Web Inspector: Reduce rendering frames "Other" time by instrumenting compositing
3663         https://bugs.webkit.org/show_bug.cgi?id=146168
3664
3665         Reviewed by Brian Burg.
3666
3667         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
3668         (WebKit::RemoteLayerTreeDrawingArea::flushLayers):
3669         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
3670         (WebKit::TiledCoreAnimationDrawingArea::flushLayers):
3671         Added CA transaction post-commit handlers to instrument end of composite.
3672
3673 2015-06-30  Beth Dakin  <bdakin@apple.com>
3674
3675         The bounds on InteractionInformationAtPosition should be more precise
3676         https://bugs.webkit.org/show_bug.cgi?id=146468
3677         -and corresponding-
3678         rdar://problem/20739834
3679
3680         Reviewed by Enrica Casucci and Simon Fraser.
3681
3682         For links, get the TextQuads from the Range, and for images, look at the 
3683         absoluteContentQuad(). All other items can continue to use absoluteBoundingBox.
3684         * WebProcess/WebPage/ios/WebPageIOS.mm:
3685         (WebKit::WebPage::getPositionInformation):
3686
3687 2015-06-30  Anders Carlsson  <andersca@apple.com>
3688
3689         Disable Spintracer when getting the list of plug-ins
3690         https://bugs.webkit.org/show_bug.cgi?id=146467
3691         rdar://problem/21616640
3692
3693         Reviewed by Tim Horton.
3694
3695         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
3696         (WebKit::WebPlatformStrategies::populatePluginCache):
3697
3698 2015-06-30  Anders Carlsson  <andersca@apple.com>
3699
3700         Java Plugin cannot launch JavaUpdater.app after renaming
3701         https://bugs.webkit.org/show_bug.cgi?id=146464
3702         rdar://problem/19747153
3703
3704         Reviewed by Tim Horton.
3705
3706         Check for both "JavaUpdater.app" and "Java Updater.app".
3707
3708         * UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
3709         (WebKit::isJavaUpdaterURL):
3710
3711 2015-06-30  Chris Dumez  <cdumez@apple.com>
3712
3713         [WK2] Avoid taking a useless / blank navigation snapshot when navigating after restoring sessionState
3714         https://bugs.webkit.org/show_bug.cgi?id=146446
3715         <rdar://problem/21584231>
3716
3717         Reviewed by Darin Adler.
3718
3719         We currently take a useless / blank navigation snapshot when navigating
3720         after restoring the back / forward list from a sessionState object.
3721         This is because we get a current HistoryItem from the sessionState
3722         which we have never really navigated to. We then take a navigation
3723         snapshot for the current HistoryItem when navigating away as we usually
3724         do. However, in this case, the HistoryItem was imported and there is
3725         nothing to snapshot.
3726
3727         Taking this snapshot is not only wasteful, it can also potentially
3728         overwrite the snapshot that was set by the client using
3729         WKWebView._saveBackForwardSnapshotForItem() SPI.
3730
3731         To address the problem, this patch suppresses navigation snapshotting
3732         after restoring the back / forward list from a session state and until
3733         the next load is committed.
3734
3735         * UIProcess/WebPageProxy.cpp:
3736         (WebKit::WebPageProxy::recordNavigationSnapshot):
3737         (WebKit::WebPageProxy::restoreFromSessionState):
3738         (WebKit::WebPageProxy::didCommitLoadForFrame):
3739         * UIProcess/WebPageProxy.h:
3740
3741 2015-06-29  Anders Carlsson  <andersca@apple.com>
3742
3743         Get rid of unused WKSI functions
3744         https://bugs.webkit.org/show_bug.cgi?id=146443
3745
3746         Reviewed by Tim Horton.
3747
3748         * UIProcess/API/Cocoa/WKWebView.mm:
3749         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
3750         (InitWebCoreSystemInterface): Deleted.
3751         * WebProcess/WebProcess.cpp:
3752         (WebKit::WebProcess::nonVisibleProcessCleanupTimerFired):
3753         * WebProcess/WebProcess.h:
3754         * WebProcess/cocoa/WebProcessCocoa.mm:
3755         (WebKit::WebProcess::destroyRenderingResources):
3756
3757 2015-06-29  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
3758
3759         [GTK] Unreviewed GTK build fix since r186088 and r186095.
3760         https://bugs.webkit.org/show_bug.cgi?id=146449
3761
3762         * PlatformGTK.cmake:
3763         * UIProcess/API/gtk/PageClientImpl.h:
3764
3765 2015-06-29  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
3766
3767         Unreviewed EFL build fix since r186088 and r186095.
3768
3769         * CMakeLists.txt: Remove ConnectionStack.cpp.
3770         * UIProcess/CoordinatedGraphics/WebView.h: Override virtual didFailLoadForMainFrame().
3771
3772 2015-06-29  Brady Eidson  <beidson@apple.com>
3773
3774         Flag sync XHRs from the network process so they can be handled appropriately.
3775         <rdar://problem/21579162> and https://bugs.webkit.org/show_bug.cgi?id=146441
3776
3777         Reviewed by Darin Adler.
3778
3779         * NetworkProcess/NetworkResourceLoader.h:
3780         (WebKit::NetworkResourceLoader::loadingSynchronousXHR): Return isSynchronous().
3781
3782 2015-06-29  Anders Carlsson  <andersca@apple.com>
3783
3784         Remove an empty group from the Xcode project.
3785
3786         * WebKit2.xcodeproj/project.pbxproj:
3787
3788 2015-06-29  Anders Carlsson  <andersca@apple.com>
3789
3790         Get rid of ConnectionStack
3791         https://bugs.webkit.org/show_bug.cgi?id=146437
3792
3793         Reviewed by Andreas Kling.
3794
3795         Just use a TemporaryChange and a static variable instead.
3796
3797         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
3798         * PluginProcess/WebProcessConnection.cpp:
3799         (WebKit::WebProcessConnection::setGlobalException):
3800         (WebKit::WebProcessConnection::didReceiveMessage):
3801         (WebKit::WebProcessConnection::didReceiveSyncMessage):
3802         * Shared/ConnectionStack.cpp: Removed.
3803         (WebKit::ConnectionStack::singleton): Deleted.
3804         * Shared/ConnectionStack.h: Removed.
3805         (WebKit::ConnectionStack::current): Deleted.
3806         (WebKit::ConnectionStack::CurrentConnectionPusher::CurrentConnectionPusher): Deleted.
3807         (WebKit::ConnectionStack::CurrentConnectionPusher::~CurrentConnectionPusher): Deleted.
3808         * WebKit2.xcodeproj/project.pbxproj:
3809
3810 2015-06-29  Tim Horton  <timothy_horton@apple.com>
3811
3812         Fix the build.
3813
3814         * UIProcess/API/Cocoa/WKWebView.mm:
3815         (-[WKWebView _didFailLoadForMainFrame]):
3816         * UIProcess/API/Cocoa/WKWebViewInternal.h:
3817         * UIProcess/ios/PageClientImplIOS.h:
3818         * UIProcess/ios/PageClientImplIOS.mm:
3819         (WebKit::PageClientImpl::didFailLoadForMainFrame):
3820
3821 2015-06-29  Dean Jackson  <dino@apple.com>
3822
3823         Temporarily disable PICTURE_SIZES
3824         https://bugs.webkit.org/show_bug.cgi?id=146435
3825         <rdar://problem/21087013>
3826
3827         Temporarily disable PICTURE_SIZES because it causes problems with out
3828         of date <picture> polyfills.
3829
3830         Temporarily disable PICTURE_SIZES until Safari branches.
3831
3832         * Configurations/FeatureDefines.xcconfig:
3833
3834 2015-06-29  Anders Carlsson  <andersca@apple.com>
3835
3836         Don't try to access a possibly deallocated WebFrameProxy object
3837         https://bugs.webkit.org/show_bug.cgi?id=146428
3838         rdar://problem/21446364
3839
3840         Reviewed by Tim Horton.
3841
3842         Make sure to call isMainFrame before calling out to the client inside
3843         WebPageProxy::didFailLoadForFrame, matching what we do for WebPageProxy::didFinishLoadForFrame.
3844
3845         Also, add a ViewGestureController::didFailLoadForMainFrame function and call that instead of
3846         calling didFinishLoadForMainFrame in the failure case.
3847
3848         * UIProcess/API/mac/WKView.mm:
3849         (-[WKView _didFailLoadForMainFrame]):
3850         * UIProcess/API/mac/WKViewInternal.h:
3851         * UIProcess/PageClient.h:
3852         * UIProcess/WebPageProxy.cpp:
3853         (WebKit::WebPageProxy::didFailLoadForFrame):
3854         * UIProcess/ios/ViewGestureControllerIOS.mm:
3855         (WebKit::ViewGestureController::mainFrameLoadDidReachTerminalState):
3856         (WebKit::ViewGestureController::didFinishLoadForMainFrame): Deleted.
3857         * UIProcess/mac/PageClientImpl.h:
3858         * UIProcess/mac/PageClientImpl.mm:
3859         (WebKit::PageClientImpl::didFailLoadForMainFrame):
3860         * UIProcess/mac/ViewGestureController.h:
3861         (WebKit::ViewGestureController::didFinishLoadForMainFrame):
3862         (WebKit::ViewGestureController::didFailLoadForMainFrame):
3863         * UIProcess/mac/ViewGestureControllerMac.mm:
3864         (WebKit::ViewGestureController::mainFrameLoadDidReachTerminalState):
3865         (WebKit::ViewGestureController::didFinishLoadForMainFrame): Deleted.
3866
3867 2015-06-29  Yongjun Zhang  <yongjun_zhang@apple.com>
3868
3869         Disable default gesture recognizers on preview.
3870         https://bugs.webkit.org/show_bug.cgi?id=146424
3871         rdar://problem/21572828
3872
3873         We should disable default gesture recognizers on preview, to avoid activating links or
3874         triggering touch events accidentally. We can enable them after preview finishes.
3875
3876         Reviewed by Beth Dakin.
3877
3878         * UIProcess/ios/WKContentViewInteraction.mm:
3879         (-[WKContentView willPresentPreviewViewController:forPosition:inSourceView:]):
3880         (-[WKContentView didDismissPreviewViewController:committing:]):
3881
3882 2015-06-27  Ryosuke Niwa  <rniwa@webkit.org>
3883
3884         Font panel doesn't get updated when bolding text via cmd+b in Mail on OS X
3885         https://bugs.webkit.org/show_bug.cgi?id=146379
3886
3887         Reviewed by Darin Adler.
3888
3889         Since font panel doesn't open in WebKit2 at the moment, just add an empty implementation of didApplyStyle
3890
3891         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
3892         (WebKit::WebEditorClient::didApplyStyle):
3893         * WebProcess/WebCoreSupport/WebEditorClient.h:
3894         * WebProcess/WebPage/WebPage.h:
3895
3896 2015-06-29  Dean Jackson  <dino@apple.com>
3897
3898         Setting to enable/disable media controls sizing on page zoom
3899         https://bugs.webkit.org/show_bug.cgi?id=146423
3900         <rdar://problem/18379634>
3901
3902         Reviewed by Eric Carlson.
3903
3904         Add a new setting "MediaControlsScaleWithPageZoom" that can disable
3905         the behaviour we currently implement on iOS, where the media controls
3906         attempt to remain at a fixed size independent of page zoom.
3907
3908         * Shared/WebPreferencesDefinitions.h: Initialize to false on iOS, true otherwise.
3909         * UIProcess/API/C/WKPreferences.cpp:
3910         (WKPreferencesSetMediaControlsScaleWithPageZoom):
3911         (WKPreferencesGetMediaControlsScaleWithPageZoom):
3912         * UIProcess/API/C/WKPreferencesRefPrivate.h:
3913         * WebProcess/WebPage/WebPage.cpp:
3914         (WebKit::WebPage::updatePreferences):
3915
3916 2015-06-29  Chris Dumez  <cdumez@apple.com>
3917
3918         [WK2][iOS] Swipe gesture snapshot stays up for 3 seconds when swiping back after top-hit navigation
3919         https://bugs.webkit.org/show_bug.cgi?id=146415
3920         <rdar://problem/21595801>
3921
3922         Reviewed by Tim Horton.
3923
3924         Swipe gesture snapshot previously stayed up for 3 seconds when swiping
3925         back after a top-hit navigation. This is because we do not restore the
3926         scroll position in this case and the ViewGestureController was waiting
3927         for the scroll position to be restored before taking down the snapshot.
3928
3929         This patch adds a fail-safe mechanism so that the WebProcess can let
3930         the UIProcess know (via a CouldNotRestorePageState IPC) that the page
3931         state (including scroll position) could not be restored so that it can
3932         let the ViewGestureController it should not wait for the scroll
3933         position to be restored.
3934
3935         * UIProcess/API/Cocoa/WKWebView.mm:
3936         (-[WKWebView _couldNotRestorePageState]):
3937         * UIProcess/API/Cocoa/WKWebViewInternal.h:
3938         * UIProcess/PageClient.h:
3939         * UIProcess/WebPageProxy.h:
3940         * UIProcess/WebPageProxy.messages.in:
3941         * UIProcess/ios/PageClientImplIOS.h:
3942         * UIProcess/ios/PageClientImplIOS.mm:
3943         (WebKit::PageClientImpl::couldNotRestorePageState):
3944         * UIProcess/ios/WebPageProxyIOS.mm:
3945         (WebKit::WebPageProxy::couldNotRestorePageState):
3946         * WebProcess/WebPage/ios/WebPageIOS.mm:
3947         (WebKit::WebPage::restorePageState):
3948
3949 2015-06-29  Chris Dumez  <cdumez@apple.com>
3950
3951         [WK2][iOS] Add WKWebView private API to save a back/forward snapshot
3952         https://bugs.webkit.org/show_bug.cgi?id=146398
3953         <rdar://problem/21584231>
3954
3955         Reviewed by Dan Bernstein.
3956
3957         Add WKWebView private API to save a back/forward snapshot so that the
3958         client can make sure a back/forward snapshot is available even when
3959         swapping WKWebView upon navigation.
3960
3961         This matches the WKView.saveBackForwardSnapshotForItem API we have on
3962         Mac.
3963
3964         * UIProcess/API/Cocoa/WKWebView.mm:
3965         (-[WKWebView saveBackForwardSnapshotForItem:]):
3966         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
3967
3968 2015-06-29  Anders Carlsson  <andersca@apple.com>
3969
3970         Use DISPATCH_SOURCE_TYPE_MEMORYPRESSURE instead of DISPATCH_SOURCE_TYPE_MEMORYSTATUS
3971         https://bugs.webkit.org/show_bug.cgi?id=146413
3972
3973         Reviewed by Andreas Kling.
3974
3975         Replace SPI with API.
3976
3977         * UIProcess/ios/WebMemoryPressureHandlerIOS.mm:
3978         (WebKit::WebMemoryPressureHandler::WebMemoryPressureHandler):
3979         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
3980         (InitWebCoreSystemInterface): Deleted.
3981
3982 2015-06-29  Enrica Casucci  <enrica@apple.com>
3983
3984         [iOS] Hardware Keyboard: All combinations of arrow keys and space key do not scroll the view.
3985         https://bugs.webkit.org/show_bug.cgi?id=146290
3986         rdar://problem/18466015
3987
3988         We don't normally get called by the keyboard to handle the event if we are not
3989         interacting with editable content. In order to receive all the hardware keyboard events
3990         we need to implement _handleKeyUIEvent which is called for every key event
3991         when the view is first responder. This gives us the opportunity to send each keystroke
3992         to the WebProcess to let any Javascript handler intercept it and then perform the default
3993         action for the key combination.
3994         Unfortunately this mechanism does not provide key repeat, which is implemented in the
3995         keyboard layer. In order to have it at least for the arrow keys, we use the keyCommands
3996         mechanism only for those.
3997
3998         Reviewed by Darin Adler.
3999
4000         * Platform/spi/ios/UIKitSPI.h:
4001         * UIProcess/API/Cocoa/WKWebView.mm:
4002         (-[WKWebView _scrollByOffset:]):
4003         * UIProcess/API/Cocoa/WKWebViewInternal.h:
4004         * UIProcess/ios/WKContentViewInteraction.mm:
4005         (-[WKContentView canPerformAction:withSender:]):
4006         (-[WKContentView keyCommands]):
4007         (-[WKContentView _arrowKey:]):
4008         (-[WKContentView _handleKeyUIEvent:]):
4009         (-[WKContentView handleKeyEvent:]):
4010         (-[WKContentView handleKeyWebEvent:]):
4011         (-[WKContentView _interpretKeyEvent:isCharEvent:]):
4012
4013 2015-06-28  Dan Bernstein  <mitz@apple.com>
4014
4015         Fixed the iOS 8.x build after r186066.
4016
4017         * UIProcess/ios/WebVideoFullscreenManagerProxy.h:
4018         * UIProcess/ios/WebVideoFullscreenManagerProxy.mm:
4019         (WebKit::WebVideoFullscreenManagerProxy::create):
4020
4021 2015-06-28  Dan Bernstein  <mitz@apple.com>
4022
4023         Fixed the iOS build after r186059.
4024
4025         * UIProcess/ios/WebVideoFullscreenManagerProxy.h:
4026
4027 2015-06-28  Chris Fleizach  <cfleizach@apple.com>
4028
4029         AX: iOS: Crash at accessibilityObjectForMainFramePlugin()
4030         https://bugs.webkit.org/show_bug.cgi?id=146399
4031
4032         Reviewed by Darin Adler.
4033
4034         Could not reproduce issue, but the invalid address seems to indicate this is a nullptr access is happening when we try to get the plugin of the m_page variable when
4035         it has not been initialized.
4036
4037         * WebProcess/WebPage/ios/WebPageIOS.mm:
4038         (WebKit::WebPage::accessibilityObjectForMainFramePlugin):
4039
4040 2015-06-28  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
4041
4042         Use Ref/RefPtr instead of PassRefPtr in WebKit2
4043         https://bugs.webkit.org/show_bug.cgi?id=146190
4044
4045         Reviewed by Darin Adler.
4046
4047         As a step to remove PassRefPtr, this patch reduces use of PassRefPtr in WebKit2.
4048
4049         * Shared/API/c/WKContextMenuItem.cpp:
4050         (WKContextMenuItemCreateAsAction):
4051         (WKContextMenuItemCreateAsCheckableAction):
4052         * Shared/CoordinatedGraphics/WebCoordinatedSurface.cpp:
4053         (WebKit::WebCoordinatedSurface::create):
4054         * Shared/CoordinatedGraphics/WebCoordinatedSurface.h:
4055         * Shared/CoordinatedGraphics/threadedcompositor/ThreadSafeCoordinatedSurface.cpp:
4056         (WebKit::ThreadSafeCoordinatedSurface::create):
4057         * Shared/CoordinatedGraphics/threadedcompositor/ThreadSafeCoordinatedSurface.h:
4058         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
4059         (WebKit::ThreadedCompositor::create):
4060         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:
4061         * Shared/Plugins/NPRemoteObjectMap.cpp:
4062         (WebKit::NPRemoteObjectMap::create):
4063         * Shared/Plugins/NPRemoteObjectMap.h:
4064         * Shared/WebBatteryStatus.h:
4065         (WebKit::WebBatteryStatus::create):
4066         * Shared/WebCertificateInfo.h:
4067         (WebKit::WebCertificateInfo::create):
4068         * Shared/WebContextMenuItem.h:
4069         (WebKit::WebContextMenuItem::create):
4070         * Shared/WebRenderObject.cpp:
4071         (WebKit::WebRenderObject::create):
4072         * Shared/WebRenderObject.h:
4073         (WebKit::WebRenderObject::create):
4074         * UIProcess/API/APINavigationData.h:
4075         (API::NavigationData::create):
4076         * UIProcess/API/APISession.cpp:
4077         (API::Session::createEphemeral):
4078         * UIProcess/API/APISession.h:
4079         * UIProcess/API/APISessionState.cpp: