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