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