Add specialization for encoding/decoding WebCore::CertificateInfos in the Network...
[WebKit-https.git] / Source / WebKit2 / ChangeLog
1 2016-07-24  Sam Weinig  <sam@webkit.org>
2
3         Add specialization for encoding/decoding WebCore::CertificateInfos in the Network Cache
4         <rdar://problem/27409315>
5         https://bugs.webkit.org/show_bug.cgi?id=160144
6
7         Reviewed by Chris Dumez.
8
9         * NetworkProcess/cache/NetworkCacheCoders.cpp:
10         (WebKit::NetworkCache::encodeCFData):
11         (WebKit::NetworkCache::decodeCFData):
12         (WebKit::NetworkCache::encodeSecTrustRef):
13         (WebKit::NetworkCache::decodeSecTrustRef):
14         (WebKit::NetworkCache::encodeCertificateChain):
15         (WebKit::NetworkCache::decodeCertificateChain):
16         (WebKit::NetworkCache::Coder<WebCore::CertificateInfo>::encode):
17         (WebKit::NetworkCache::Coder<WebCore::CertificateInfo>::decode):
18
19         * NetworkProcess/cache/NetworkCacheStorage.h:
20         (WebKit::NetworkCache::Storage::version):
21         Bump the version and lastStableVersion to account for the format change.
22
23 2016-07-22  Joseph Pecoraro  <pecoraro@apple.com>
24
25         Web Automation: All key events should be processed before sending response
26         https://bugs.webkit.org/show_bug.cgi?id=160114
27         <rdar://problem/27505943>
28
29         Reviewed by Darin Adler.
30
31         When evaluating performKeyboardInteractions, we were sending all
32         NSEvents synchronously, but because WebPageProxy was doing its
33         own queueing and asynchronous processing of those key events, we
34         would receive and respond to the next Automation command before
35         having completed all of the key events.
36
37         This change makes performKeyboardInteractions asynchronous. It
38         will be notified only after WebPageProxy has exhausted its queue
39         of key events.
40
41         * UIProcess/Automation/Automation.json:
42         * UIProcess/Automation/WebAutomationSession.cpp:
43         (WebKit::WebAutomationSession::keyboardEventsFlushedForPage):
44         (WebKit::WebAutomationSession::evaluateJavaScriptFunction):
45         (WebKit::WebAutomationSession::performKeyboardInteractions):
46         * UIProcess/Automation/WebAutomationSession.h:
47         * UIProcess/WebPageProxy.cpp:
48         (WebKit::WebPageProxy::didReceiveEvent):
49
50 2016-07-22  Joseph Pecoraro  <pecoraro@apple.com>
51
52         Web Automation: WebAutomationSession::deleteAllCookies never calls callback, hangs automation session
53         https://bugs.webkit.org/show_bug.cgi?id=160113
54         <rdar://problem/27308124>
55
56         Reviewed by Darin Adler.
57
58         Delete all cookies appears to be a straightforward action
59         where we don't need to wait for a callback. So drop the
60         async altogether and implicitly complete the action.
61
62         * UIProcess/Automation/Automation.json:
63         * UIProcess/Automation/WebAutomationSession.cpp:
64         (WebKit::WebAutomationSession::deleteAllCookies):
65         * UIProcess/Automation/WebAutomationSession.h:
66
67 2016-07-22  Zalan Bujtas  <zalan@apple.com>
68
69         Handle cases when IOSurface initialization fails.
70         https://bugs.webkit.org/show_bug.cgi?id=160006
71         <rdar://problem/27495102>
72
73         Reviewed by Tim Horton and Simon Fraser.
74
75         This is an additional fix to r203514 to check if IOSurface initialization was successful.
76
77         Unable to test.
78
79         * Shared/mac/RemoteLayerBackingStore.mm:
80         (WebKit::RemoteLayerBackingStore::encode):
81         (WebKit::RemoteLayerBackingStore::display):
82         (WebKit::RemoteLayerBackingStore::applyBackingStoreToLayer):
83         * UIProcess/API/Cocoa/WKWebView.mm:
84         (-[WKWebView _takeViewSnapshot]):
85         (-[WKWebView _snapshotRect:intoImageOfWidth:completionHandler:]):
86
87 2016-07-22  Chelsea Pugh  <cpugh@apple.com>
88
89         [iOS] Clients should be able to decide if they want secure text entry in a form field
90         https://bugs.webkit.org/show_bug.cgi?id=160109
91         rdar://problem/27504958
92
93         Reviewed by Dan Bernstein.
94
95         * UIProcess/API/Cocoa/_WKFormInputSession.h:
96         * UIProcess/ios/WKContentViewInteraction.mm:
97         (-[WKFormInputSession forceSecureTextEntry]): Getter.
98         (-[WKFormInputSession setForceSecureTextEntry:]): Setter.
99         (-[WKContentView textInputTraits]): If the form input session has specified that secure text
100         entry is desired, we should use secure text entry.
101
102 2016-07-22  Anders Carlsson  <andersca@apple.com>
103
104         Get rid of an unused API typedef
105         https://bugs.webkit.org/show_bug.cgi?id=160103
106
107         Reviewed by Sam Weinig.
108
109         * Shared/API/c/WKSharedAPICast.h:
110
111 2016-07-22  Dan Bernstein  <mitz@apple.com>
112
113         run-safari doesn't work with Safari 10 on 10.11
114         https://bugs.webkit.org/show_bug.cgi?id=159958
115         <rdar://problem/27422805>
116
117         Reviewed by Alexey Proskuryakov.
118
119         Safari’s injected bundle may depend on the newer versions of frameworks installed in a
120         staging location. Have the engineering builds of the Web Content service look for newer
121         versions in that location.
122
123         * Configurations/BaseTarget.xcconfig: Shortened a linker flag.
124
125         * Configurations/BaseXPCService.xcconfig: Increased Mach-O header padding in production
126           builds to allow for more dyld environment commands to be added after the fact.
127
128         * Configurations/DebugRelease.xcconfig: Have the new
129           WK_WEBCONTENT_SERVICE_NEEDS_VERSIONED_FRAMEWORK_PATH_LDFLAG set to YES for macOS
130           engineering builds.
131
132         * Configurations/WebContentService.xcconfig: Include the versioned frameworks whenever
133           WK_WEBCONTENT_SERVICE_NEEDS_VERSIONED_FRAMEWORK_PATH_LDFLAG is set to YES. Have the
134           value of WK_WEBCONTENT_SERVICE_NEEDS_VERSIONED_FRAMEWORK_PATH_LDFLAG default to
135           the value of USE_STAGING_INSTALL_PATH, while letting DebugRelease.xcconfig override it.
136
137 2016-07-21  Myles C. Maxfield  <mmaxfield@apple.com>
138
139         Remove support for deprecated SPI inlineMediaPlaybackRequiresPlaysInlineAttribute
140         https://bugs.webkit.org/show_bug.cgi?id=160066
141
142         Reviewed by Dean Jackson.
143
144         * Shared/WebPreferencesDefinitions.h:
145         * UIProcess/API/C/WKPreferences.cpp:
146         (WKPreferencesSetInlineMediaPlaybackRequiresPlaysInlineAttribute): Deleted.
147         (WKPreferencesGetInlineMediaPlaybackRequiresPlaysInlineAttribute): Deleted.
148         * UIProcess/API/C/WKPreferencesRefPrivate.h:
149         * UIProcess/API/Cocoa/WKWebView.mm:
150         (-[WKWebView _initializeWithConfiguration:]): Deleted.
151         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
152         (-[WKWebViewConfiguration init]): Deleted.
153         (-[WKWebViewConfiguration copyWithZone:]): Deleted.
154         (-[WKWebViewConfiguration _inlineMediaPlaybackRequiresPlaysInlineAttribute]): Deleted.
155         (-[WKWebViewConfiguration _setInlineMediaPlaybackRequiresPlaysInlineAttribute:]): Deleted.
156         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
157         * WebProcess/WebPage/WebPage.cpp:
158         (WebKit::WebPage::updatePreferences): Deleted.
159
160 2016-07-21  Chelsea Pugh  <cpugh@apple.com>
161
162         [iOS] Apps using WKWebView will crash if they set the scroll view's delegate and don't nil it out later
163         https://bugs.webkit.org/show_bug.cgi?id=159980
164         rdar://problem/27450825
165
166         Reviewed by Dan Bernstein.
167
168         The root cause of this crash is that we are not abiding the UIScrollView API that the scroll view
169         delegate property should be weak. If setters of this delegate do not know that, since the WKWebView
170         exposes the scroll view as a UIScrollView, they may forget to nil out the delegate they set and will
171         then crash.
172
173         * UIProcess/ios/WKScrollView.mm:
174         (-[WKScrollViewDelegateForwarder methodSignatureForSelector:]): Get a RetainPtr holding the
175         external delegate and use where needed.
176         (-[WKScrollViewDelegateForwarder respondsToSelector:]): Ditto.
177         (-[WKScrollViewDelegateForwarder forwardInvocation:]): Ditto.
178         (-[WKScrollViewDelegateForwarder forwardingTargetForSelector:]): Ditto. When returning a reference
179         to the external delegate, get a retained and autoreleased reference so the caller needn't release
180         the object when done.
181         (-[WKScrollView delegate]): Ditto.
182         (-[WKScrollView _updateDelegate]): Get a RetainPtr holding the external delegate that can be
183         used throughout this method. Use the RetainPtr to get the external delegate for setting super's
184         delegate as well as creating the delegate forwarder.
185         (-[WKScrollView setDelegate:]): Get a RetainPtr holding the external delegate and use its value for
186         comparison to the object we are setting the external delegate to.
187
188 2016-07-21  Myles C. Maxfield  <mmaxfield@apple.com>
189
190         [iPhone] Playing a video on tudou.com plays only sound, no video
191         https://bugs.webkit.org/show_bug.cgi?id=159967
192         <rdar://problem/26964090>
193
194         Reviewed by Jon Lee, Jeremy Jones, and Anders Carlsson.
195
196         Add the two preferences to WKWebViewConfiguration and WKPreferences to cover both
197         the Obj-C API and the C SPI.
198
199         * Shared/WebPreferencesDefinitions.h:
200         * UIProcess/API/C/WKPreferences.cpp:
201         (WKPreferencesSetAllowsInlineMediaPlaybackWithPlaysInlineAttribute):
202         (WKPreferencesGetAllowsInlineMediaPlaybackWithPlaysInlineAttribute):
203         (WKPreferencesSetAllowsInlineMediaPlaybackWithWebKitPlaysInlineAttribute):
204         (WKPreferencesGetAllowsInlineMediaPlaybackWithWebKitPlaysInlineAttribute):
205         * UIProcess/API/C/WKPreferencesRefPrivate.h:
206         * UIProcess/API/Cocoa/WKWebView.mm:
207         (-[WKWebView _initializeWithConfiguration:]):
208         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
209         (-[WKWebViewConfiguration init]):
210         (-[WKWebViewConfiguration copyWithZone:]):
211         (-[WKWebViewConfiguration _allowsInlineMediaPlaybackWithPlaysInlineAttribute]):
212         (-[WKWebViewConfiguration _setAllowsInlineMediaPlaybackWithPlaysInlineAttribute:]):
213         (-[WKWebViewConfiguration _allowsInlineMediaPlaybackWithWebKitPlaysInlineAttribute]):
214         (-[WKWebViewConfiguration _setAllowsInlineMediaPlaybackWithWebKitPlaysInlineAttribute:]):
215         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
216         * WebProcess/WebPage/WebPage.cpp:
217         (WebKit::WebPage::updatePreferences):
218
219 2016-07-21  Yongjun Zhang  <yongjun_zhang@apple.com>
220
221         WebBackForwardList's currentIndex could get out of bounds when filtering items.
222         https://bugs.webkit.org/show_bug.cgi?id=159986
223
224         When generating a new BackForwardListState object, if we filter out multiple items in the list, the currentIndex could get
225         out of bounds.
226
227         Reviewed by Dan Bernstein.
228
229         * UIProcess/WebBackForwardList.cpp:
230         (WebKit::WebBackForwardList::backForwardListState): Make currentIndex point to the last item if it is out of bounds.
231
232 2016-07-21  Joseph Pecoraro  <pecoraro@apple.com>
233
234         Web Automation: Allow JavaScript evaluation to return an InvalidElementState error
235         https://bugs.webkit.org/show_bug.cgi?id=160015
236         <rdar://problem/27434529>
237
238         Reviewed by Brian Burg.
239
240         * UIProcess/Automation/Automation.json:
241         * WebProcess/Automation/WebAutomationSessionProxy.cpp:
242         (WebKit::WebAutomationSessionProxy::evaluateJavaScriptFunction):
243
244 2016-07-21  Carlos Garcia Campos  <cgarcia@igalia.com>
245
246         [GTK][Threaded Compositor] WTR generates fully white images for pixel tests most of the time
247         https://bugs.webkit.org/show_bug.cgi?id=160016
248
249         Reviewed by Žan Doberšek.
250
251         WTR sends a force repaint message to the web process before taking a snapshot of the web view. With the threaded
252         compositor, the UI process is notified about the force repaint callback before the contents have been actually
253         painted. We need to ensure that the contents are rendered before the UI process is notified.
254
255         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
256         (WebKit::ThreadedCompositor::forceRepaint): Synchronously render the layer tree.
257         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:
258         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
259         (webkitWebViewRenderAcceleratedCompositingResults): Always mark the redirected window surface as dirty before
260         rendering, since it can be modified by the web process at any time.
261         * UIProcess/gtk/RedirectedXCompositeWindow.cpp:
262         (WebKit::XDamageNotifier::add):
263         (WebKit::RedirectedXCompositeWindow::RedirectedXCompositeWindow): Do not mark the surface as dirty on every
264         damage since the view will do it before rendering.
265         * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp:
266         (WebKit::ThreadedCoordinatedLayerTreeHost::forceRepaint): Call ThreadedCompositor::forceRepaint().
267         * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h:
268
269 2016-07-21  Carlos Garcia Campos  <cgarcia@igalia.com>
270
271         [GTK] White page when loaded tab is visited until it's hovered when AC mode is always on
272         https://bugs.webkit.org/show_bug.cgi?id=159512
273
274         Reviewed by Michael Catanzaro.
275
276         The redirected window is always mapped, but offscreen, to ensure that the web process can always render
277         there. When the web process renders something into the offscreen window, we receive a damage event in the UI
278         process and queue a redraw of the web view. However, when the web view is not mapped, even if we still receive
279         the damage events, the web view redraws are ignored until the view is mapped again (gtk_widget_queue_draw()
280         returns early when the widget is not visible). The redirected window updates its pixmap on demand when the
281         surface is requested, which happens when the web view draws its contents. So when the web view becames visible,
282         the redirected window creates a new pixmap and surface (the first time or if the web view was resized), that we
283         initialize to avoid artifacts when the web process hasn't render anything yet. That initialization is actually
284         overwriting anything rendered into the redirected window while the view was unmapped. That's why see white pages
285         the first time, and previous contents after a resize, and we don't see the actual contents until the web process
286         renders again and we reuse the existing pixmap. The white page didn't happen for tabs with accelerated content,
287         because in those cases the web process was rendering a new frame every 16ms, but instead there was a flickering
288         effect due to the current frame being overwritten when the view is mapped until the next frame.
289         So, instead of lazily create and initialize the redirected window pixmap and surface, we should always create
290         the new pixmap as soon as the window is created or resized (and not empty) This fixes the issues but also makes
291         resizing the window a bit smoother when AC mode is enabled.
292
293         * UIProcess/gtk/RedirectedXCompositeWindow.cpp:
294         (WebKit::RedirectedXCompositeWindow::RedirectedXCompositeWindow): Create the pixmap and surface if the window is
295         not empty.
296         (WebKit::RedirectedXCompositeWindow::resize): Ditto.
297         (WebKit::RedirectedXCompositeWindow::createNewPixampAndPixampSurface): Create the pixmap and surface.
298         (WebKit::RedirectedXCompositeWindow::surface): Deleted.
299         * UIProcess/gtk/RedirectedXCompositeWindow.h:
300         (WebKit::RedirectedXCompositeWindow::surface):
301
302 2016-07-21  Carlos Garcia Campos  <cgarcia@igalia.com>
303
304         [GTK][Threaded Compositor] Web view background colors don't work
305         https://bugs.webkit.org/show_bug.cgi?id=159465
306
307         Reviewed by Michael Catanzaro.
308
309         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
310         (WebKit::ThreadedCompositor::setDrawsBackground): Set m_drawsBackground in compositing thread and schedule a
311         layer flush.
312         (WebKit::ThreadedCompositor::renderLayerTree): Clear the area when not rendering backgrounds.
313         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:
314         * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp:
315         (WebKit::ThreadedCoordinatedLayerTreeHost::pageBackgroundTransparencyChanged): Notify the compositor.
316         * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h:
317
318 2016-07-21  Carlos Garcia Campos  <cgarcia@igalia.com>
319
320         [GTK] Web view background colors don't work in accelerated compositing mode
321         https://bugs.webkit.org/show_bug.cgi?id=159455
322
323         Reviewed by Michael Catanzaro.
324
325         In non AC mode it's the drawing area backing store the one drawing the background, and the web process just
326         renders into a transparent bitmap. In AC mode we need to make the redirected window pixmap transparent for the
327         web process to render there, and let the web view fill the background color before rendering the redirected
328         window pixmap on top. To be able to make the redirected window surface transparent, we need to ensure the parent
329         window has an RGBA visual, even when setting a fully opaque background, because we still need the web process
330         to render on the transparent xwindow.
331
332         * UIProcess/API/gtk/WebKitWebView.cpp: Update documentation of webkit_web_view_set_background_color() since now
333         it's required to set the RGBA visual even for opaque colors in case AC mode is enabled.
334         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
335         (webkitWebViewRenderAcceleratedCompositingResults): When a background color has been set, fill it before
336         rendering the redirected window surface.
337         * UIProcess/gtk/RedirectedXCompositeWindow.cpp:
338         (WebKit::RedirectedXCompositeWindow::RedirectedXCompositeWindow): Mark the surface as dirty after every damage
339         event, since the web process has modified it.
340         (WebKit::RedirectedXCompositeWindow::surface): Initialize the surface after creating it, to avoid flickering and
341         rendering artifacts when waiting for the first damage event from the web process.
342         * WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp:
343         (WebKit::LayerTreeHostGtk::compositeLayersToContext): Use a fully transparent color to clear the context when the page
344         is resized or when a view background color has been set.
345
346 2016-07-20  Carlos Garcia Campos  <cgarcia@igalia.com>
347
348         [GTK] Avoid the redirected window resize when the view is realized in AC mode
349         https://bugs.webkit.org/show_bug.cgi?id=159463
350
351         Reviewed by Michael Catanzaro.
352
353         We are always creating the redirected window at 1x1 and then resizing it if we are in AC mode. When the view is
354         realized and AC mode is already enabled, which happens for example when AC mode is forced, or when the threaded
355         compositor is enabled, we could just pass the initial size to the redirected window constructor to create the
356         XWindow at the right size.
357
358         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
359         (webkitWebViewBaseResizeRedirectedWindow): We no longer need to pass the device scale factor, since the
360         RedirectedXCompositeWindow already knows it.
361         (webkitWebViewBaseRealize): Pass the WebPageProxy and an initial size to the RedirectedXCompositeWindow
362         constructor instead of the parent GdkWindow. If AC mode is disabled, the initial size will be empty. With the
363         WebPageProxy the redirected window has access to the device scale factor and view widget to get the parent
364         GdkWindow.
365         (deviceScaleFactorChanged): Resize the redirected window when device scale factor changes.
366         * UIProcess/gtk/RedirectedXCompositeWindow.cpp:
367         (WebKit::RedirectedXCompositeWindow::create):
368         (WebKit::RedirectedXCompositeWindow::RedirectedXCompositeWindow):
369         (WebKit::RedirectedXCompositeWindow::resize):
370         (WebKit::RedirectedXCompositeWindow::surface):
371         (WebKit::RedirectedXCompositeWindow::~RedirectedXCompositeWindow):
372         * UIProcess/gtk/RedirectedXCompositeWindow.h:
373
374 2016-07-20  Carlos Garcia Campos  <cgarcia@igalia.com>
375
376         [GTK][Threaded Compositor] Web Process crash when the page is closed before the web view is realized
377         https://bugs.webkit.org/show_bug.cgi?id=159918
378
379         Reviewed by Michael Catanzaro.
380
381         When the web view is unrealized, we send a sync message to the web process to destroy the native surface handle
382         for compositing, and then we actually destroy the redirected window. But if the page is closed explicitly before
383         the web view is unrealized, the drawing area proxy is destroyed so that when the web view is unrealized we can't
384         notify the web process that keeps trying to render to a now deleted window handle. That produces a BadDrawable
385         X error and the web process crashes.
386
387         * UIProcess/API/gtk/PageClientImpl.cpp:
388         (WebKit::PageClientImpl::pageClosed): Call webkitWebViewBasePageClosed().
389         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
390         (webkitWebViewBasePageClosed): If the web view is still realized, destroy the native surface handle and the
391         redirected window.
392         * UIProcess/API/gtk/WebKitWebViewBasePrivate.h: Add webkitWebViewBasePageClosed().
393
394 2016-07-20  Commit Queue  <commit-queue@webkit.org>
395
396         Unreviewed, rolling out r203471.
397         https://bugs.webkit.org/show_bug.cgi?id=160003
398
399         many iOS-simulator tests are failing (Requested by litherum on
400         #webkit).
401
402         Reverted changeset:
403
404         "[iPhone] Playing a video on tudou.com plays only sound, no
405         video"
406         https://bugs.webkit.org/show_bug.cgi?id=159967
407         http://trac.webkit.org/changeset/203471
408
409 2016-07-20  Simon Fraser  <simon.fraser@apple.com>
410
411         REGRESSION (r203189): Webpage snapshots are partially or fully blank when edge swiping back
412         https://bugs.webkit.org/show_bug.cgi?id=160000
413         rdar://problem/27455589
414         
415         Reviewed by Zalan Bujtas.
416
417         r203189 triggered a call to -_updateContentRectsWithState: in the middle of a swipe,
418         during which we'd compute the visible rect of the view as having zero width, causing us
419         to not create tiles.
420
421         -_navigationGestureDidBegin already snapshots the visibleContentRect in _frozenVisibleContentRect,
422         but -_visibleContentRect then clipped that with ancestor views, causing the issue.
423
424         Fix by having -_visibleContentRect just return _frozenVisibleContentRect if we have one.
425
426         * UIProcess/API/Cocoa/WKWebView.mm:
427         (-[WKWebView _visibleContentRect]):
428
429 2016-07-20  Myles C. Maxfield  <mmaxfield@apple.com>
430
431         [iPhone] Playing a video on tudou.com plays only sound, no video
432         https://bugs.webkit.org/show_bug.cgi?id=159967
433         <rdar://problem/26964090>
434
435         Reviewed by Jon Lee.
436
437         Add the two preferences to WKWebViewConfiguration and WKPreferences to cover both
438         the Obj-C API and the C SPI.
439
440         * Shared/WebPreferencesDefinitions.h:
441         * UIProcess/API/C/WKPreferences.cpp:
442         (WKPreferencesSetAllowsInlineMediaPlaybackWithPlaysInlineAttribute):
443         (WKPreferencesGetAllowsInlineMediaPlaybackWithPlaysInlineAttribute):
444         (WKPreferencesSetAllowsInlineMediaPlaybackWithWebKitPlaysInlineAttribute):
445         (WKPreferencesGetAllowsInlineMediaPlaybackWithWebKitPlaysInlineAttribute):
446         * UIProcess/API/C/WKPreferencesRefPrivate.h:
447         * UIProcess/API/Cocoa/WKWebView.mm:
448         (-[WKWebView _initializeWithConfiguration:]):
449         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
450         (-[WKWebViewConfiguration init]):
451         (-[WKWebViewConfiguration copyWithZone:]):
452         (-[WKWebViewConfiguration _allowsInlineMediaPlaybackWithPlaysInlineAttribute]):
453         (-[WKWebViewConfiguration _setAllowsInlineMediaPlaybackWithPlaysInlineAttribute:]):
454         (-[WKWebViewConfiguration _allowsInlineMediaPlaybackWithWebKitPlaysInlineAttribute]):
455         (-[WKWebViewConfiguration _setAllowsInlineMediaPlaybackWithWebKitPlaysInlineAttribute:]):
456         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
457         * WebProcess/WebPage/WebPage.cpp:
458         (WebKit::WebPage::updatePreferences):
459
460 2016-07-20  ChangSeok Oh  <changseok@webkit.org>
461
462         Fix a linking failure caused by NetworkCache::Data::~Data()
463         https://bugs.webkit.org/show_bug.cgi?id=159931
464
465         Linking is failed with clang 3.6. It says WebKit::NetworkCache::Data::~Data is undefined.
466         It is fixed by adding a destructor for NetworkCache::Data.
467
468         Reviewed by Alex Christensen.
469
470         * NetworkProcess/cache/NetworkCacheData.h:
471         (WebKit::NetworkCache::Data::~Data):
472
473 2016-07-20  Tim Horton  <timothy_horton@apple.com>
474
475         Explain the default value of WKWebViewConfiguration's ignoresViewportScaleLimits
476         https://bugs.webkit.org/show_bug.cgi?id=159978
477         <rdar://problem/27453189>
478
479         Reviewed by Dan Bernstein.
480
481         * UIProcess/API/Cocoa/WKWebViewConfiguration.h:
482         This defaults to NO.
483
484 2016-07-20  Carlos Garcia Campos  <cgarcia@igalia.com>
485
486         [Linux] MemoryPressureMonitor fallback code to get memory available in older linux kernels doesn't work
487         https://bugs.webkit.org/show_bug.cgi?id=159970
488
489         Reviewed by Antonio Gomes.
490
491         We are failing to detect zones when parsing /proc/zoneinfo.
492
493         * UIProcess/linux/MemoryPressureMonitor.cpp:
494         (WebKit::lowWatermarkPages): Use strncmp since we want to know whether the line starts with "Node".
495         (WebKit::MemoryPressureMonitor::MemoryPressureMonitor): Stop the polling if we fail to get the memory available,
496         because that means it's not sopported in the system for whatever reason.
497
498 2016-07-20  Carlos Garcia Campos  <cgarcia@igalia.com>
499
500         [Threaded Compositor] Web Process crash when the layer tree host is destroyed
501         https://bugs.webkit.org/show_bug.cgi?id=159922
502
503         Reviewed by Sergio Villar Senin.
504
505         It happens when the layer tree host is destroyed after the didChangeVisibleRect is scheduled to be run in the
506         main thread, but before it's actually dispatched. In that case the threaded compositor client points to a
507         deleted object and crashes when trying to dereference it.
508
509         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
510         (WebKit::ThreadedCompositor::~ThreadedCompositor): Add an assert to ensure invalidate is always called before
511         the object is deleted.
512         (WebKit::ThreadedCompositor::invalidate): Terminate the compositing thread and nullify the client.
513         (WebKit::ThreadedCompositor::didChangeVisibleRect): Return early if the client is null when the task is
514         dispatched in the main thread.
515         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h: Add invalidate().
516         * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp:
517         (WebKit::ThreadedCoordinatedLayerTreeHost::invalidate): Invalidate the ThreadedCompositor and chain up.
518         * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h:
519
520 2016-07-19  Brian Burg  <bburg@apple.com>
521
522         Web Automation: WebAutomationSessionProxy's HashMaps should support '0' as valid keys
523         https://bugs.webkit.org/show_bug.cgi?id=159957
524         <rdar://problem/27376446>
525
526         Reviewed by Joseph Pecoraro.
527
528         * WebProcess/Automation/WebAutomationSessionProxy.h:
529         Use UnsignedWithZeroKeyHashTraits to avoid problems with zero as a key.
530
531 2016-07-19  Anders Carlsson  <andersca@apple.com>
532
533         Some payment authorization status values should keep the sheet active
534         https://bugs.webkit.org/show_bug.cgi?id=159936
535         rdar://problem/26756701
536
537         Reviewed by Tim Horton.
538
539         * UIProcess/ApplePay/WebPaymentCoordinatorProxy.cpp:
540         (WebKit::WebPaymentCoordinatorProxy::completePaymentSession):
541         If the status isn't a final state status, bounce the current state back to active.
542
543         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.h:
544         Rename the _authorized ivar to _didReachFinalState.
545
546         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
547         (-[WKPaymentAuthorizationViewControllerDelegate paymentAuthorizationViewControllerDidFinish:]):
548         (WebKit::WebPaymentCoordinatorProxy::platformCompletePaymentSession):
549         Set _didReachFinalState based on the return value of isFinalStateStatus.
550
551 2016-07-18  Csaba Osztrogonác  <ossy@webkit.org>
552
553         Fix the --minimal build fail in InjectedBundle.cpp
554         https://bugs.webkit.org/show_bug.cgi?id=159770
555
556         Reviewed by Benjamin Poulain.
557
558         * WebProcess/InjectedBundle/InjectedBundle.cpp:
559
560 2016-07-18  Alex Christensen  <achristensen@webkit.org>
561
562         webbookmarksd needs to use the same AppCache directory as MobileSafari
563         https://bugs.webkit.org/show_bug.cgi?id=159912
564         <rdar://problem/27056844>
565
566         Reviewed by Alexey Proskuryakov.
567
568         * UIProcess/API/Cocoa/APIWebsiteDataStoreCocoa.mm:
569         (API::WebsiteDataStore::defaultApplicationCacheDirectory):
570         Make webbookmarksd match MobileSafari by adding a matching runtime exception.
571
572 2016-07-18  Anders Carlsson  <andersca@apple.com>
573
574         Don't null out the IPC::Connection's XPC connection
575         https://bugs.webkit.org/show_bug.cgi?id=159911
576         rdar://problem/27018065
577
578         Reviewed by Alex Christensen.
579
580         The function that nulls out the XPC connection, platformInvalidate(), is called from the connection queue,
581         whereas the XPC connection is normally accessed from the main thread leading to inconsistencies when the
582         connection is being invalidated while the main thread is trying to access it.
583         
584         Fix this by simply never nulling out the XPC connection. It will be released when the IPC::Connection is destroyed anyway.
585
586         * Platform/IPC/mac/ConnectionMac.mm:
587         (IPC::Connection::platformInvalidate):
588
589 2016-07-18  Tim Horton  <timothy_horton@apple.com>
590
591         Tapping on an apple.com tab in tab overview stutters when switching to it
592         https://bugs.webkit.org/show_bug.cgi?id=159904
593         <rdar://problem/27192350>
594
595         Reviewed by Simon Fraser.
596
597         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
598         (WebKit::RemoteLayerTreeDrawingAreaProxy::waitForDidUpdateViewState):
599         In any case where we get to waitForDidUpdateViewState (usually a tab switch),
600         if we have an outstanding didUpdate message, the Web process will not commit
601         a new layer tree until it receives the didUpdate message. However, since
602         waitForDidUpdateViewState synchronously blocks the UI process, we also
603         won't *send* the didUpdate message, so we block for the full timeout duration.
604
605         Instead, if we get to waitForDidUpdateViewState, just send the didUpdate without
606         waiting for the DisplayLink or anything else, because calling rAF slightly too
607         quickly, once, is certainly better than blocking the UI process for a whole second.
608
609 2016-07-18  Carlos Alberto Lopez Perez  <clopez@igalia.com>
610
611         [GTK] ENABLE_OPENGL=OFF build broken since r201802
612         https://bugs.webkit.org/show_bug.cgi?id=159909
613
614         Reviewed by Antonio Gomes.
615
616         * WebProcess/WebPage/LayerTreeHost.h: Add missing include.
617
618 2016-07-18  Anders Carlsson  <andersca@apple.com>
619
620         WebKit nightly fails to build on macOS Sierra
621         https://bugs.webkit.org/show_bug.cgi?id=159902
622         rdar://problem/27365672
623
624         Reviewed by Tim Horton.
625
626         * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm:
627         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.h:
628         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
629         * UIProcess/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm:
630         Use new PassKitSPI header.
631
632 2016-07-18  Tim Horton  <timothy_horton@apple.com>
633
634         Mail contents are temporarily obscured by black rectangles when returning from suspend and in app switcher
635         https://bugs.webkit.org/show_bug.cgi?id=159894
636         <rdar://problem/26973202>
637
638         Reviewed by Simon Fraser.
639
640         * UIProcess/ApplicationStateTracker.h:
641         * UIProcess/ApplicationStateTracker.mm:
642         (WebKit::ApplicationStateTracker::ApplicationStateTracker):
643         (WebKit::ApplicationStateTracker::~ApplicationStateTracker):
644         (WebKit::ApplicationStateTracker::applicationDidCreateWindowContext):
645         * UIProcess/ios/WKContentView.mm:
646         (-[WKContentView didMoveToWindow]):
647         (-[WKContentView _applicationDidCreateWindowContext]):
648         (-[WKContentView _applicationWillEnterForeground]): Deleted.
649         * UIProcess/ios/WKPDFView.mm:
650         (-[WKPDFView didMoveToWindow]):
651         (-[WKPDFView _applicationDidCreateWindowContext]):
652         * UIProcess/ios/WebPageProxyIOS.mm:
653         (WebKit::WebPageProxy::applicationDidFinishSnapshottingAfterEnteringBackground):
654         Hide content at window context creation time, instead of when the application
655         becomes foregrounded. Otherwise, background snapshots (which create/destroy
656         window contexts, but do not bring the app into the foreground) can have
657         parented layers that have volatile surfaces in them. In the normal case,
658         we will subsequently get foregrounded and re-build the layer tree; in the
659         background snapshot case, we will just have an empty layer tree.
660
661         In the future, we should consider making ApplicationStateTracker use
662         window context creation/destruction to drive web process lifetime, so
663         that we can actually paint correctly for background snapshots.
664
665 2016-07-18  Carlos Garcia Campos  <cgarcia@igalia.com>
666
667         Unreviewed. Update OptionsGTK.cmake and NEWS for 2.13.3 release.
668
669         * gtk/NEWS: Add release notes for 2.13.3.
670
671 2016-07-18  Csaba Osztrogonác  <ossy@webkit.org>
672
673         [Mac][cmake] Unreviewed buildfix after r203338. Just for fun.
674
675         * PlatformMac.cmake:
676
677 2016-07-18  Carlos Garcia Campos  <cgarcia@igalia.com>
678
679         MemoryPressureHandler doesn't work if cgroups aren't present in Linux
680         https://bugs.webkit.org/show_bug.cgi?id=155255
681
682         Reviewed by Sergio Villar Senin.
683
684         There's no way to get notifications about memory pressure in Linux without using cgroups that doesn't require a
685         manual polling. We can get that information from /proc/meminfo, but that's not pollable so it requires to
686         manually check its contents in a loop sleeping for a while between checks. This means we would be waking up the
687         process on every poll iteration, most of the times for nothing. That's specially problematic on devices running
688         on battery. And taking into account that there's a memory pressure handler in every secondary process (Web,
689         Network and Plugin), we would be waking up all those process all the time. However, not having a memory pressure
690         handler is even more problematic than the manual polling.
691         This patch adds a class MemoryPressureMonitor to the manual polling of /proc/meminfo, but runs in the UI
692         process, to avoid the weakups in all other secondary processes, and uses an eventFD to notify all other
693         processes. It's only used in case cgroups is not available. The eventFD descriptor is sent to all other
694         processes at startup, and passed to the MemoryPressureHandler before install() is called for the first
695         time. To minimize the wakeups even in the UI process, the poll interval is calculated from 1 to 5 seconds
696         depending on the current memory used, so in case of low memory level we sleep for a longer time.
697         It's also important to make the memory calculations as accurate as possible to avoid cleaning resources in the
698         secondary processes unnecessarily.
699
700         * NetworkProcess/NetworkProcess.cpp:
701         (WebKit::NetworkProcess::initializeNetworkProcess): Pass the memory pressure monitor file descriptor to the MemoryPressureHandler.
702         * NetworkProcess/NetworkProcess.h:
703         * NetworkProcess/NetworkProcessCreationParameters.cpp:
704         (WebKit::NetworkProcessCreationParameters::encode): Encode memory pressure monitor handle.
705         (WebKit::NetworkProcessCreationParameters::decode): Decode memory pressure monitor handle.
706         * NetworkProcess/NetworkProcessCreationParameters.h:
707         * PlatformEfl.cmake: Add new file to compilation, and update include dirs.
708         * PlatformGTK.cmake: Ditto.
709         * PluginProcess/PluginProcess.cpp:
710         (WebKit::PluginProcess::initializePluginProcess): Pass the memory pressure monitor file descriptor to the MemoryPressureHandler.
711         * Shared/Plugins/PluginProcessCreationParameters.cpp:
712         (WebKit::PluginProcessCreationParameters::encode): Encode memory pressure monitor handle.
713         (WebKit::PluginProcessCreationParameters::decode): Decode memory pressure monitor handle.
714         * Shared/Plugins/PluginProcessCreationParameters.h:
715         * Shared/WebProcessCreationParameters.cpp:
716         (WebKit::WebProcessCreationParameters::encode): Encode memory pressure monitor handle.
717         (WebKit::WebProcessCreationParameters::decode): Decode memory pressure monitor handle.
718         * Shared/WebProcessCreationParameters.h:
719         * UIProcess/Plugins/PluginProcessProxy.cpp:
720         (WebKit::PluginProcessProxy::didFinishLaunching): Create the memory pressure monitor handle for the plugin
721         process if needed.
722         * UIProcess/WebProcessPool.cpp:
723         (WebKit::WebProcessPool::ensureNetworkProcess): Create the memory pressure monitor handle for the network
724         process if needed.
725         (WebKit::WebProcessPool::createNewWebProcess): Create the memory pressure monitor handle for the web process if
726         needed.
727         * UIProcess/linux/MemoryPressureMonitor.cpp: Added.
728         (WebKit::lowWatermarkPages):
729         (WebKit::systemPageSize):
730         (WebKit::calculateMemoryAvailable):
731         (WebKit::systemMemoryUsedAsPercentage):
732         (WebKit::pollIntervalForUsedMemoryPercentage):
733         (WebKit::isSystemdMemoryPressureMonitorAvailable):
734         (WebKit::MemoryPressureMonitor::isEnabled):
735         (WebKit::MemoryPressureMonitor::singleton):
736         (WebKit::MemoryPressureMonitor::MemoryPressureMonitor):
737         (WebKit::MemoryPressureMonitor::createHandle):
738         * UIProcess/linux/MemoryPressureMonitor.h:
739         * WebProcess/WebProcess.cpp:
740         (WebKit::WebProcess::initializeWebProcess): Pass the memory pressure monitor file descriptor to the MemoryPressureHandler.
741
742 2016-07-17  Carlos Garcia Campos  <cgarcia@igalia.com>
743
744         REGRESSION(r202855): [GTK] ASSERTION FAILED: m_webPage.bounds().contains(bounds)
745         https://bugs.webkit.org/show_bug.cgi?id=159806
746
747         Reviewed by Žan Doberšek.
748
749         The problem is that since r202855, in case of non accelerated mode, the dirty region is updated too late when
750         updating backing store state.
751
752         * WebProcess/WebPage/DrawingAreaImpl.cpp:
753         (WebKit::DrawingAreaImpl::updateBackingStoreState): Update the dirty region to the new size when not in
754         accelerated compositing mode.
755         * WebProcess/WebPage/WebPage.cpp:
756         (WebKit::WebPage::setSize): Update the WebPage size before resizing the frame and calling setNeedsDisplay() to
757         ensure that any call to setNeedsDisplay() uses the new web page bounds. This is actually a regression introduced
758         in r143472, where setNeedsDisplay was changed to use the web page bounds as directy rectangle. Before r143472
759         the dirty rectangle was passed to setNeedsDisplay and it passed the right one.
760
761 2016-07-16  Sam Weinig  <sam@webkit.org>
762
763         [WebKit API] Add SPI to track multiple navigations caused by a single user gesture
764         <rdar://problem/26554137>
765         https://bugs.webkit.org/show_bug.cgi?id=159856
766
767         Reviewed by Dan Bernstein.
768
769         * Shared/API/APIObject.h:
770         * Shared/Cocoa/APIObject.mm:
771         (API::Object::newObject):
772         * UIProcess/API/APIUserInitiatedAction.h: Added.
773         Add new APIObject type, UserInitiatedAction.
774
775         * UIProcess/API/Cocoa/WKNavigationAction.mm:
776         * UIProcess/API/Cocoa/WKNavigationActionPrivate.h:
777         Expose a _WKUserInitiatedAction on the WKNavigationAction.
778
779         * UIProcess/API/Cocoa/_WKUserInitiatedAction.h: Added.
780         * UIProcess/API/Cocoa/_WKUserInitiatedAction.mm: Added.
781         (-[_WKUserInitiatedAction consume]):
782         (-[_WKUserInitiatedAction isConsumed]):
783         (-[_WKUserInitiatedAction _apiObject]):
784         * UIProcess/API/Cocoa/_WKUserInitiatedActionInternal.h: Added.
785         Add new _WKUserInitiatedAction type wrapping API::UserInitiatedAction.
786
787         * Shared/NavigationActionData.cpp:
788         (WebKit::NavigationActionData::encode):
789         (WebKit::NavigationActionData::decode):
790         * Shared/NavigationActionData.h:
791         Store the userGestureTokenIdentifier (as determined from the WebProcess's map) rather
792         than just a single bit. This allows us to track if a user gesture is used for multiple navigations.
793
794         * UIProcess/API/APINavigationAction.h:
795         Add UserInitiatedAction member and re-implement isProcessingUserGesture in terms of it.
796
797         * UIProcess/API/C/WKPage.cpp:
798         (WKPageSetPageUIClient):
799         * UIProcess/Cocoa/UIDelegate.mm:
800         (WebKit::UIDelegate::UIClient::createNewPage):
801         * UIProcess/WebPageProxy.cpp:
802         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
803         (WebKit::WebPageProxy::decidePolicyForNewWindowAction):
804         Get the API::UserInitiatedAction from the WebProcessProxy (if it exists), and pass
805         it along to the API::NavigationAction.
806
807         * UIProcess/WebProcessProxy.cpp:
808         (WebKit::WebProcessProxy::shutDown):
809         (WebKit::WebProcessProxy::userInitiatedActivity):
810         (WebKit::WebProcessProxy::didDestroyUserGestureToken):
811         * UIProcess/WebProcessProxy.h:
812         Keep a map of active userInitiatedActivity objects.
813
814         * UIProcess/WebProcessProxy.messages.in:
815         Add DidDestroyUserGestureToken message to manager API::UserInitiatedActivity lifetimes.
816
817         * WebKit2.xcodeproj/project.pbxproj:
818         Add new files.
819
820         * WebProcess/Notifications/WebNotificationManager.cpp:
821         (WebKit::WebNotificationManager::didClickNotification):
822         * WebProcess/Plugins/PluginView.cpp:
823         (WebKit::PluginView::performFrameLoadURLRequest):
824         (WebKit::PluginView::evaluate):
825         * WebProcess/WebCoreSupport/WebContextMenuClient.cpp:
826         (WebKit::WebContextMenuClient::searchWithGoogle):
827         * WebProcess/cocoa/WebPlaybackSessionManager.mm:
828         (WebKit::WebPlaybackSessionManager::play):
829         (WebKit::WebPlaybackSessionManager::pause):
830         (WebKit::WebPlaybackSessionManager::togglePlayState):
831         (WebKit::WebPlaybackSessionManager::beginScrubbing):
832         (WebKit::WebPlaybackSessionManager::endScrubbing):
833         (WebKit::WebPlaybackSessionManager::seekToTime):
834         (WebKit::WebPlaybackSessionManager::fastSeek):
835         (WebKit::WebPlaybackSessionManager::beginScanningForward):
836         (WebKit::WebPlaybackSessionManager::beginScanningBackward):
837         (WebKit::WebPlaybackSessionManager::endScanning):
838         (WebKit::WebPlaybackSessionManager::selectAudioMediaOption):
839         (WebKit::WebPlaybackSessionManager::selectLegibleMediaOption):
840         Update for new UserGestureIndicator interface.
841
842         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
843         (WebKit::WebChromeClient::createWindow):
844         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
845         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNewWindowAction):
846         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
847         Get an identifier for the UserGestureToken from the WebProcess singleton
848         to pass to the WebProcess.
849
850         * WebProcess/WebProcess.cpp:
851         (WebKit::nextUserGestureTokenIdentifier):
852         (WebKit::WebProcess::userGestureTokenIdentifier):
853         (WebKit::WebProcess::userGestureTokenDestroyed):
854         * WebProcess/WebProcess.h:
855         Track UserGestureToken lifetimes utilizing the destructionObserver mechanism
856         off the tokens to indicate destruction. When destroyed, notify the UIProcess
857         to avoid leaks.
858
859 2016-07-17  Ryosuke Niwa  <rniwa@webkit.org>
860
861         Rename fastHasAttribute to hasAttributeWithoutSynchronization
862         https://bugs.webkit.org/show_bug.cgi?id=159864
863
864         Reviewed by Chris Dumez.
865
866         * WebProcess/WebPage/ios/WebPageIOS.mm:
867         (WebKit::WebPage::getAssistedNodeInformation):
868
869 2016-07-17  Jeremy Jones  <jeremyj@apple.com>
870
871         REGRESSION (r191907): Maxthon Browser -After exit full screen video playback the browser window is blank with audio running
872         https://bugs.webkit.org/show_bug.cgi?id=159731
873         <rdar://problem/26674003>
874
875         Reviewed by Tim Horton.
876
877         Primarily written by Jer Noble  <jer.noble@apple.com>.
878
879         When a view is removed from it's superview, and that superview's constraints property references
880         the removed superview, those constraints are removed as well. Make sure to save off a copy of
881         the superview's constraints before swapping in the placeholder view, and reapply those constraints
882         when swapping the web view back into its original superview.
883
884         * UIProcess/mac/WKFullScreenWindowController.h:
885         * UIProcess/mac/WKFullScreenWindowController.mm:
886         (-[WKFullScreenWindowController setSavedConstraints:]):
887         (-[WKFullScreenWindowController savedConstraints]):
888         (-[WKFullScreenWindowController enterFullScreen:]):
889         (-[WKFullScreenWindowController finishedEnterFullScreenAnimation:]):
890         (-[WKFullScreenWindowController finishedExitFullScreenAnimation:]):
891
892 2016-07-16  Ryosuke Niwa  <rniwa@webkit.org>
893
894         Rename fastGetAttribute to attributeWithoutSynchronization
895         https://bugs.webkit.org/show_bug.cgi?id=159852
896
897         Reviewed by Darin Adler.
898
899         * WebProcess/WebPage/ios/WebPageIOS.mm:
900         (WebKit::WebPage::getPositionInformation):
901         (WebKit::WebPage::performActionOnElement):
902         (WebKit::WebPage::getAssistedNodeInformation):
903
904 2016-07-15  Timothy Hatcher  <timothy@apple.com>
905
906         Web Automation: Fix element and event coord space issues
907         https://bugs.webkit.org/show_bug.cgi?id=159851
908         rdar://problem/27375780
909
910         Reviewed by Brian Burg.
911
912         * UIProcess/Automation/WebAutomationSession.cpp:
913         (WebKit::WebAutomationSession::performMouseInteraction): Subtract topContentInset() before
914         it goes back out to WebDriver.
915         * WebProcess/Automation/WebAutomationSessionProxy.cpp:
916         (WebKit::WebAutomationSessionProxy::computeElementLayout): When using useViewportCoordinates,
917         subtract topContentInset() so it matches expectations.
918
919 2016-07-15  Beth Dakin  <bdakin@apple.com>
920
921         Mac UI process needs to know about element focus and blur, much like iOS
922         https://bugs.webkit.org/show_bug.cgi?id=159843
923         -and corresponding-
924         rdar://problem/27229504
925
926         Reviewed by Tim Horton.
927
928         This patch makes the existing iOS machinery to handle focus and blurring of 
929         elements cross-platform. Instead of using the existing iOS messages for 
930         startAssistingNode/stopAssistingNode, this patch adds a new message that 
931         require only a boolean parameter: setEditableElementIsFocused.
932
933         Now that more of this code is shared, this patch teases 
934         m_hasFocusedDueToUserInteraction out into two variables. I realized that it 
935         was being used to mean two slightly different things on Mac and iOS, which 
936         was very confusing. Now we have m_isAssistingNodeDueToUserInteraction to 
937         represent the way iOS was using the variable, and we have 
938         m_hasEverFocusedElementDueToUserInteractionSincePageTransition to represent 
939         how Mac was using the variable. There should not be any behavior changes with 
940         this re-name, just added clarity.
941
942         WebViewImpl has a new member variable m_editableElementIsFocused.
943         * UIProcess/Cocoa/WebViewImpl.h:
944         * UIProcess/Cocoa/WebViewImpl.mm:
945         (WebKit::WebViewImpl::setEditableElementIsFocused):
946
947         Pipe the new setEditableElementIsFocused message to WebViewImpl.
948         * UIProcess/PageClient.h:
949         * UIProcess/WebPageProxy.cpp:
950         (WebKit::WebPageProxy::setEditableElementIsFocused):
951         * UIProcess/WebPageProxy.h:
952         * UIProcess/WebPageProxy.messages.in:
953         * UIProcess/mac/PageClientImpl.h:
954         * UIProcess/mac/PageClientImpl.mm:
955         (WebKit::PageClientImpl::setEditableElementIsFocused):
956
957         elementDidFocus() and elementDidBlur() are now PLATFORM(COCOA) instead of 
958         PLATFORM(IOS)
959         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
960         (WebKit::WebChromeClient::elementDidFocus):
961         (WebKit::WebChromeClient::elementDidBlur):
962         * WebProcess/WebCoreSupport/WebChromeClient.h:
963         * WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm:
964         (WebKit::WebChromeClient::elementDidFocus): Deleted.
965         (WebKit::WebChromeClient::elementDidBlur): Deleted.
966
967         m_hasPendingBlurNotification is no longer iOS-only.
968         * WebProcess/WebPage/WebPage.cpp:
969
970         Use our two new bools m_isAssistingNodeDueToUserInteraction and 
971         m_hasEverFocusedElementDueToUserInteractionSincePageTransition 
972         (WebKit::WebPage::didStartPageTransition):
973         (WebKit::WebPage::didChangeSelection):
974
975         These functions are all newly cross-platform. The Messages they send are 
976         still platform-specific, but otherwise the logic is the same. We 
977         dispatch_async the blur messages so that the UI process features won’t be 
978         flashy when the user is tapping, tabbing, or clicking through form fields.
979         (WebKit::WebPage::resetAssistedNodeForFrame):
980         (WebKit::WebPage::elementDidFocus):
981         (WebKit::WebPage::elementDidBlur):
982
983         resetAssistedNodeForFrame() is no longer iOS-only. 
984         (WebKit::WebPage::didCommitLoad):
985
986         Move variables and functions around so that they are defined for the right 
987         platform, and declare the two new bools in place of the old one.
988         * WebProcess/WebPage/WebPage.h:
989
990         These functions are now defined in WebPage.cpp
991         * WebProcess/WebPage/ios/WebPageIOS.mm:
992         (WebKit::WebPage::resetAssistedNodeForFrame): Deleted.
993         (WebKit::WebPage::elementDidFocus): Deleted.
994         (WebKit::WebPage::elementDidBlur): Deleted.
995
996 2016-07-15  Geoffrey Garen  <ggaren@apple.com>
997
998         Added a makeRef<T> helper
999         https://bugs.webkit.org/show_bug.cgi?id=159835
1000
1001         Reviewed by Andreas Kling.
1002
1003         Anders told me to!
1004
1005         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1006         (WebKit::NetworkConnectionToWebProcess::writeBlobsToTemporaryFiles):
1007         * NetworkProcess/NetworkResourceLoader.cpp:
1008         (WebKit::NetworkResourceLoader::tryStoreAsCacheEntry):
1009         * Platform/IPC/Connection.cpp:
1010         (IPC::Connection::addWorkQueueMessageReceiver):
1011         (IPC::Connection::removeWorkQueueMessageReceiver):
1012         (IPC::Connection::invalidate):
1013         (IPC::Connection::sendMessage):
1014         (IPC::Connection::processIncomingMessage):
1015         (IPC::Connection::postConnectionDidCloseOnConnectionWorkQueue):
1016         (IPC::Connection::connectionDidClose):
1017         (IPC::Connection::enqueueIncomingMessage):
1018         * Platform/IPC/mac/ConnectionMac.mm:
1019         (IPC::Connection::receiveSourceEventHandler):
1020         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
1021         (WebKit::ThreadedCompositor::setNativeSurfaceHandleForCompositing):
1022         (WebKit::ThreadedCompositor::setDeviceScaleFactor):
1023         (WebKit::ThreadedCompositor::didChangeViewportSize):
1024         (WebKit::ThreadedCompositor::didChangeViewportAttribute):
1025         (WebKit::ThreadedCompositor::didChangeContentsSize):
1026         (WebKit::ThreadedCompositor::scrollTo):
1027         (WebKit::ThreadedCompositor::scrollBy):
1028         (WebKit::ThreadedCompositor::didChangeVisibleRect):
1029         * UIProcess/API/APIUserContentExtensionStore.cpp:
1030         (API::UserContentExtensionStore::lookupContentExtension):
1031         (API::UserContentExtensionStore::compileContentExtension):
1032         (API::UserContentExtensionStore::removeContentExtension):
1033         * UIProcess/Launcher/ProcessLauncher.cpp:
1034         (WebKit::ProcessLauncher::ProcessLauncher):
1035         * UIProcess/Storage/LocalStorageDatabaseTracker.cpp:
1036         (WebKit::LocalStorageDatabaseTracker::LocalStorageDatabaseTracker):
1037         * UIProcess/Storage/StorageManager.cpp:
1038         (WebKit::StorageManager::createSessionStorageNamespace):
1039         (WebKit::StorageManager::destroySessionStorageNamespace):
1040         (WebKit::StorageManager::setAllowedSessionStorageNamespaceConnection):
1041         (WebKit::StorageManager::cloneSessionStorageNamespace):
1042         (WebKit::StorageManager::processDidCloseConnection):
1043         (WebKit::StorageManager::getSessionStorageOrigins):
1044         (WebKit::StorageManager::deleteSessionStorageOrigins):
1045         (WebKit::StorageManager::deleteSessionStorageEntriesForOrigins):
1046         (WebKit::StorageManager::getLocalStorageOrigins):
1047         (WebKit::StorageManager::getLocalStorageOriginDetails):
1048         (WebKit::StorageManager::deleteLocalStorageEntriesForOrigin):
1049         (WebKit::StorageManager::deleteLocalStorageOriginsModifiedSince):
1050         (WebKit::StorageManager::deleteLocalStorageEntriesForOrigins):
1051         * UIProcess/WebResourceLoadStatisticsStore.cpp:
1052         (WebKit::WebResourceLoadStatisticsStore::readDataFromDiskIfNeeded):
1053         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1054         (WebKit::WebsiteDataStore::fetchData):
1055         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
1056         (WebKit::NetscapePlugin::pluginThreadAsyncCall):
1057         * WebProcess/WebPage/EventDispatcher.cpp:
1058         (WebKit::EventDispatcher::wheelEvent):
1059         (WebKit::EventDispatcher::gestureEvent):
1060         (WebKit::EventDispatcher::touchEvent):
1061         * WebProcess/WebPage/ViewUpdateDispatcher.cpp:
1062         (WebKit::ViewUpdateDispatcher::visibleContentRectUpdate):
1063
1064 2016-07-15  Chris Dumez  <cdumez@apple.com>
1065
1066         Use fastGetAttribute() / setAttributeWithoutSynchronization() when possible
1067         https://bugs.webkit.org/show_bug.cgi?id=159793
1068
1069         Reviewed by Ryosuke Niwa.
1070
1071         Use fastGetAttribute() / setAttributeWithoutSynchronization() when possible, for performance.
1072
1073         * WebProcess/Plugins/PDF/DeprecatedPDFPlugin.mm:
1074         (WebKit::PDFPlugin::PDFPlugin):
1075         * WebProcess/Plugins/PDF/PDFPlugin.mm:
1076         (WebKit::PDFPlugin::createPasswordEntryForm):
1077         * WebProcess/Plugins/PDF/PDFPluginAnnotation.mm:
1078         (WebKit::PDFPluginAnnotation::attach):
1079         * WebProcess/Plugins/PDF/PDFPluginChoiceAnnotation.mm:
1080         (WebKit::PDFPluginChoiceAnnotation::createAnnotationElement):
1081
1082 2016-07-15  Ryosuke Niwa  <rniwa@webkit.org>
1083
1084         Disable custom elements in Safari Tech Preview
1085         https://bugs.webkit.org/show_bug.cgi?id=159829
1086
1087         Reviewed by Chris Dumez.
1088  
1089         Disable custom elements API in Safari Technology Preview. Our implementation is so out of sync
1090         with the latest spec that it's actively harmful to have this feature enabled.
1091
1092         * Shared/WebPreferencesDefinitions.h:
1093
1094 2016-07-15  Jer Noble  <jer.noble@apple.com>
1095
1096         Full screen ePub embedded video is playing on 1/4 screen, cut off
1097         https://bugs.webkit.org/show_bug.cgi?id=159737
1098         <rdar://problem/26259404>
1099
1100         Reviewed by Tim Horton.
1101
1102         Set the fixedLayoutSize to CGSizeZero when disabling fixed layout due to the 
1103         WebView not supporting arbitrary layout modes, and reset to the saved value
1104         when the view does begin supporting arbitrary layout modes.
1105
1106         * UIProcess/Cocoa/WebViewImpl.h:
1107         * UIProcess/Cocoa/WebViewImpl.mm:
1108         (WebKit::WebViewImpl::setFixedLayoutSize):
1109         (WebKit::WebViewImpl::updateSupportsArbitraryLayoutModes):
1110
1111 2016-07-14  Ryan Haddad  <ryanhaddad@apple.com>
1112
1113         Unreviewed, rolling out r203248.
1114
1115         This change causes LayoutTests to crash and exit early
1116
1117         Reverted changeset:
1118
1119         "Use more Refs with WorkQueues"
1120         https://bugs.webkit.org/show_bug.cgi?id=159792
1121         http://trac.webkit.org/changeset/203248
1122
1123 2016-07-14  Chris Dumez  <cdumez@apple.com>
1124
1125         Use emptyString() instead of "" when possible
1126         https://bugs.webkit.org/show_bug.cgi?id=159789
1127
1128         Reviewed by Alex Christensen.
1129
1130         Use emptyString() instead of "" when possible to reduce String allocations.
1131
1132         * UIProcess/Cocoa/WebViewImpl.mm:
1133         (WebKit::WebViewImpl::pasteboardChangedOwner):
1134         * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp:
1135         (WebKit::parseRFC822HeaderFields):
1136         (WebKit::NPN_Status):
1137
1138 2016-07-14  Alex Christensen  <achristensen@webkit.org>
1139
1140         Use more Refs with WorkQueues
1141         https://bugs.webkit.org/show_bug.cgi?id=159792
1142
1143         Reviewed by Brady Eidson.
1144
1145         * NetworkProcess/CustomProtocols/CustomProtocolManager.h:
1146         * Platform/IPC/Connection.cpp:
1147         (IPC::Connection::setShouldExitOnSyncMessageSendFailure):
1148         (IPC::Connection::addWorkQueueMessageReceiver):
1149         * Platform/IPC/Connection.h:
1150         * Shared/mac/SecItemShim.cpp:
1151         (WebKit::SecItemShim::initializeConnection):
1152         * UIProcess/Storage/LocalStorageDatabaseTracker.cpp:
1153         (WebKit::LocalStorageDatabaseTracker::create):
1154         (WebKit::LocalStorageDatabaseTracker::LocalStorageDatabaseTracker):
1155         * UIProcess/Storage/LocalStorageDatabaseTracker.h:
1156         * UIProcess/Storage/StorageManager.cpp:
1157         (WebKit::StorageManager::StorageArea::openDatabaseAndImportItemsIfNeeded):
1158         (WebKit::StorageManager::StorageManager):
1159         * UIProcess/Storage/StorageManager.h:
1160         * UIProcess/WebResourceLoadStatisticsStore.cpp:
1161         (WebKit::WebResourceLoadStatisticsStore::processWillOpenConnection):
1162         (WebKit::WebResourceLoadStatisticsStore::processDidCloseConnection):
1163         * UIProcess/mac/SecItemShimProxy.cpp:
1164         (WebKit::SecItemShimProxy::initializeConnection):
1165         (WebKit::SecItemShimProxy::secItemRequest):
1166         * WebProcess/Plugins/PluginProcessConnectionManager.cpp:
1167         (WebKit::PluginProcessConnectionManager::initializeConnection):
1168         (WebKit::PluginProcessConnectionManager::getPluginProcessConnection):
1169         * WebProcess/WebPage/EventDispatcher.cpp:
1170         (WebKit::EventDispatcher::initializeConnection):
1171         (WebKit::EventDispatcher::wheelEvent):
1172         * WebProcess/WebPage/ViewUpdateDispatcher.cpp:
1173         (WebKit::ViewUpdateDispatcher::initializeConnection):
1174         (WebKit::ViewUpdateDispatcher::visibleContentRectUpdate):
1175
1176 2016-07-14  Timothy Hatcher  <timothy@apple.com>
1177
1178         Web Automation: FrameNotFound errors happen a lot for the main frame
1179         https://bugs.webkit.org/show_bug.cgi?id=159777
1180         rdar://problem/27224628
1181
1182         Send both pageID and frameID, and have the WebProcess side resolve the
1183         mainFrame from 0 based on the known pageID. This avoids a race waiting
1184         for the DidCreateMainFrame message.
1185
1186         Reviewed by Brian Burg.
1187
1188         * UIProcess/Automation/WebAutomationSession.cpp:
1189         (WebKit::WebAutomationSession::webFrameIDForHandle):
1190         (WebKit::WebAutomationSession::switchToBrowsingContext):
1191         (WebKit::WebAutomationSession::evaluateJavaScriptFunction):
1192         (WebKit::WebAutomationSession::resolveChildFrameHandle):
1193         (WebKit::WebAutomationSession::resolveParentFrameHandle):
1194         (WebKit::WebAutomationSession::computeElementLayout):
1195         (WebKit::WebAutomationSession::getAllCookies):
1196         (WebKit::WebAutomationSession::deleteSingleCookie):
1197         (WebKit::WebAutomationSession::webFrameProxyForHandle): Deleted.
1198         (WebKit::WebAutomationSession::webFrameIDForHandle): Added.
1199         * UIProcess/Automation/WebAutomationSession.h:
1200         * WebProcess/Automation/WebAutomationSessionProxy.cpp:
1201         (WebKit::WebAutomationSessionProxy::evaluateJavaScriptFunction):
1202         (WebKit::WebAutomationSessionProxy::resolveChildFrameWithOrdinal):
1203         (WebKit::WebAutomationSessionProxy::resolveChildFrameWithNodeHandle):
1204         (WebKit::WebAutomationSessionProxy::resolveChildFrameWithName):
1205         (WebKit::WebAutomationSessionProxy::resolveParentFrame):
1206         (WebKit::WebAutomationSessionProxy::focusFrame):
1207         (WebKit::WebAutomationSessionProxy::computeElementLayout):
1208         (WebKit::WebAutomationSessionProxy::takeScreenshot):
1209         (WebKit::WebAutomationSessionProxy::getCookiesForFrame):
1210         (WebKit::WebAutomationSessionProxy::deleteCookie):
1211         * WebProcess/Automation/WebAutomationSessionProxy.h:
1212         * WebProcess/Automation/WebAutomationSessionProxy.messages.in:
1213
1214 2016-07-14  Alex Christensen  <achristensen@webkit.org>
1215
1216         Use SocketProvider to create SocketStreamHandles
1217         https://bugs.webkit.org/show_bug.cgi?id=159774
1218
1219         Reviewed by Brady Eidson.
1220
1221         * WebProcess/Network/WebSocketProvider.cpp:
1222         (WebKit::WebSocketProvider::createSocketStreamHandle):
1223         (WebKit::WebSocketProvider::createWebSocketChannel): Deleted.
1224         * WebProcess/Network/WebSocketProvider.h:
1225
1226 2016-07-14  Chris Dumez  <cdumez@apple.com>
1227
1228         [WK2][iOS] Potential null dereference under ViewGestureController::beginSwipeGesture()
1229         https://bugs.webkit.org/show_bug.cgi?id=159776
1230         <rdar://problem/22467100>
1231
1232         Reviewed by Tim Horton.
1233
1234         Potential null dereference under ViewGestureController::beginSwipeGesture() of:
1235         m_webPageProxy.backForwardList().currentItem()
1236
1237         The client side is expected to call ViewGestureController::canSwipeInDirection() but
1238         this only guarantees that the m_alternateBackForwardListSourceView's currentItem is
1239         non-null when m_alternateBackForwardListSourceView is non-null. It does not guarantee
1240         that m_webPageProxy's currentItem is non-null.
1241
1242         * UIProcess/ios/ViewGestureControllerIOS.mm:
1243         (WebKit::ViewGestureController::beginSwipeGesture):
1244
1245 2016-07-14  Csaba Osztrogonác  <ossy@webkit.org>
1246
1247         Fix the !ENABLE(WEB_SOCKETS) build after r202930
1248         https://bugs.webkit.org/show_bug.cgi?id=159768
1249
1250         Reviewed by Alex Christensen.
1251
1252         * WebProcess/Network/WebSocketProvider.h:
1253
1254 2016-07-14  Chris Dumez  <cdumez@apple.com>
1255
1256         Possible crash under NavigationState::NavigationClient::processDidCrash()
1257         https://bugs.webkit.org/show_bug.cgi?id=159773
1258         <rdar://problem/19814215>
1259
1260         Reviewed by Anders Carlsson.
1261
1262         Add a m_navigationState.m_navigationDelegateMethods.webViewWebProcessDidCrash before
1263         trying to call it to avoid crashing if the client does not implement it.
1264
1265         At the beginning of the method, we abort early only if both webViewWebContentProcessDidTerminate
1266         and webViewWebProcessDidCrash are implemented. However, if webViewWebContentProcessDidTerminate
1267         implemented but not webViewWebProcessDidCrash we can end up crashing as we fail to check later
1268         on before trying to call it.
1269
1270         * UIProcess/Cocoa/NavigationState.mm:
1271         (WebKit::NavigationState::NavigationClient::processDidCrash):
1272
1273 2016-07-14  Csaba Osztrogonác  <ossy@webkit.org>
1274
1275         Fix the DatabaseProcess build with disabled IDB
1276         https://bugs.webkit.org/show_bug.cgi?id=159769
1277
1278         Reviewed by Alex Christensen.
1279
1280         * WebProcess/Databases/WebToDatabaseProcessConnection.cpp:
1281         (WebKit::WebToDatabaseProcessConnection::didClose):
1282
1283 2016-07-14  Hyunjun Ko  <zzoon@igalia.com>
1284
1285         [ThreadedCompositor] Build fails in debug mode after r202040
1286         https://bugs.webkit.org/show_bug.cgi?id=159757
1287
1288         Reviewed by Michael Catanzaro.
1289
1290         Debug mode build failed due to call getter method, which is
1291         removed, in ASSERT().
1292
1293         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
1294         (WebKit::ThreadedCompositor::glContext): Deleted.
1295         (WebKit::ThreadedCompositor::didChangeVisibleRect): Deleted.
1296         (WebKit::ThreadedCompositor::renderLayerTree): Deleted.
1297
1298 2016-07-13  Alex Christensen  <achristensen@webkit.org>
1299
1300         Modernize WebSocket handle
1301         https://bugs.webkit.org/show_bug.cgi?id=159750
1302
1303         Reviewed by Brady Eidson.
1304
1305         * UIProcess/InspectorServer/soup/WebSocketServerSoup.cpp:
1306         (WebKit::connectionCallback):
1307
1308 2016-07-13  Carlos Garcia Campos  <cgarcia@igalia.com>
1309
1310         REGRESSION(r202273): [GTK] Redirected X window is resized to the previous size on size allocate
1311         https://bugs.webkit.org/show_bug.cgi?id=159551
1312
1313         Reviewed by Michael Catanzaro.
1314
1315         In r202273 I added webkitWebViewBaseResizeRedirectedWindow() helper to remove duplicated code in all places
1316         where we were resizing the redirected window to the current drawing area size. But on size allocate, we were
1317         updating the redirected window first, and then the drawing area, to ensure that when the drawing area notifies
1318         the web process the redirected window is already at the new size. This regression doesn't have any visual
1319         effect, because we are ensure the right size always before rendering, but there's a small extra resize in this case.
1320
1321         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
1322         (webkitWebViewBaseSizeAllocate): Resize the redirected window before updating the drawing area size.
1323
1324 2016-07-13  Chris Dumez  <cdumez@apple.com>
1325
1326         [WK2] Use more references for connections
1327         https://bugs.webkit.org/show_bug.cgi?id=159739
1328
1329         Reviewed by Alex Christensen.
1330
1331         Use more references for connections to make it more obvious they cannot
1332         be null.
1333
1334         * DatabaseProcess/DatabaseToWebProcessConnection.cpp:
1335         (WebKit::DatabaseToWebProcessConnection::DatabaseToWebProcessConnection):
1336         * DatabaseProcess/DatabaseToWebProcessConnection.h:
1337         (WebKit::DatabaseToWebProcessConnection::connection):
1338         * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.cpp:
1339         (WebKit::WebIDBConnectionToClient::messageSenderConnection):
1340         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1341         (WebKit::NetworkConnectionToWebProcess::NetworkConnectionToWebProcess):
1342         (WebKit::NetworkConnectionToWebProcess::writeBlobsToTemporaryFiles):
1343         * NetworkProcess/NetworkConnectionToWebProcess.h:
1344         (WebKit::NetworkConnectionToWebProcess::connection):
1345         * NetworkProcess/NetworkResourceLoader.cpp:
1346         (WebKit::NetworkResourceLoader::messageSenderConnection):
1347         * Shared/mac/CookieStorageShim.mm:
1348         (WebKit::webKitCookieStorageCopyRequestHeaderFieldsForURL):
1349         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
1350         (WebKit::WebIDBConnectionToServer::messageSenderConnection):
1351         (WebKit::preregisterSandboxExtensionsIfNecessary):
1352         * WebProcess/Databases/WebToDatabaseProcessConnection.cpp:
1353         (WebKit::WebToDatabaseProcessConnection::WebToDatabaseProcessConnection):
1354         * WebProcess/Databases/WebToDatabaseProcessConnection.h:
1355         (WebKit::WebToDatabaseProcessConnection::connection):
1356         * WebProcess/FileAPI/BlobRegistryProxy.cpp:
1357         (WebKit::BlobRegistryProxy::registerFileBlobURL):
1358         (WebKit::BlobRegistryProxy::registerBlobURL):
1359         (WebKit::BlobRegistryProxy::registerBlobURLOptionallyFileBacked):
1360         (WebKit::BlobRegistryProxy::unregisterBlobURL):
1361         (WebKit::BlobRegistryProxy::registerBlobURLForSlice):
1362         (WebKit::BlobRegistryProxy::blobSize):
1363         (WebKit::BlobRegistryProxy::writeBlobsToTemporaryFiles):
1364         * WebProcess/Network/NetworkProcessConnection.cpp:
1365         (WebKit::NetworkProcessConnection::NetworkProcessConnection):
1366         (WebKit::NetworkProcessConnection::writeBlobsToTemporaryFiles):
1367         * WebProcess/Network/NetworkProcessConnection.h:
1368         (WebKit::NetworkProcessConnection::connection):
1369         * WebProcess/Network/WebLoaderStrategy.cpp:
1370         (WebKit::WebLoaderStrategy::scheduleLoad):
1371         (WebKit::WebLoaderStrategy::remove):
1372         (WebKit::WebLoaderStrategy::setDefersLoading):
1373         (WebKit::WebLoaderStrategy::loadResourceSynchronously):
1374         (WebKit::WebLoaderStrategy::createPingHandle):
1375         * WebProcess/Network/WebResourceLoader.cpp:
1376         (WebKit::WebResourceLoader::messageSenderConnection):
1377         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
1378         (WebKit::WebPlatformStrategies::cookiesForDOM):
1379         (WebKit::WebPlatformStrategies::setCookiesFromDOM):
1380         (WebKit::WebPlatformStrategies::cookiesEnabled):
1381         (WebKit::WebPlatformStrategies::cookieRequestHeaderFieldValue):
1382         (WebKit::WebPlatformStrategies::getRawCookies):
1383         (WebKit::WebPlatformStrategies::deleteCookie):
1384         (WebKit::WebPlatformStrategies::addCookie):
1385         * WebProcess/WebPage/WebFrame.cpp:
1386         (WebKit::WebFrame::startDownload):
1387         (WebKit::WebFrame::convertMainResourceLoadToDownload):
1388         * WebProcess/WebProcess.cpp:
1389         (WebKit::WebProcess::ensureLegacyPrivateBrowsingSessionInNetworkProcess):
1390         (WebKit::WebProcess::networkConnection):
1391         (WebKit::WebProcess::prefetchDNS):
1392         * WebProcess/WebProcess.h:
1393
1394 2016-07-13  Anders Carlsson  <andersca@apple.com>
1395
1396         Move WKPreferencesRef functions to the correct file
1397         https://bugs.webkit.org/show_bug.cgi?id=159741
1398
1399         Reviewed by Sam Weinig.
1400
1401         Also, get rid of WKPreferencesGetPaymentsEnabled and WKPreferencesSetPaymentsEnabled.
1402
1403         * UIProcess/API/C/WKPreferences.cpp:
1404         (WKPreferencesGetApplePayEnabled):
1405         (WKPreferencesSetApplePayEnabled):
1406         (WKPreferencesGetApplePayCapabilityDisclosureAllowed):
1407         (WKPreferencesSetApplePayCapabilityDisclosureAllowed):
1408         * UIProcess/API/C/WKPreferencesRef.h:
1409         * UIProcess/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm:
1410         (WKPreferencesGetApplePayEnabled): Deleted.
1411         (WKPreferencesSetApplePayEnabled): Deleted.
1412         (WKPreferencesGetApplePayCapabilityDisclosureAllowed): Deleted.
1413         (WKPreferencesSetApplePayCapabilityDisclosureAllowed): Deleted.
1414         (WKPreferencesGetPaymentsEnabled): Deleted.
1415         (WKPreferencesSetPaymentsEnabled): Deleted.
1416
1417 2016-07-13  Anders Carlsson  <andersca@apple.com>
1418
1419         Add _applePayCapabilityDisclosureAllowed SPI declaration
1420         https://bugs.webkit.org/show_bug.cgi?id=159740
1421
1422         Reviewed by Dan Bernstein.
1423
1424         Also, delete an old method that is no longer used.
1425
1426         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
1427         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
1428         (-[WKWebViewConfiguration _paymentsEnabled]): Deleted.
1429         (-[WKWebViewConfiguration _setPaymentsEnabled:]): Deleted.
1430
1431 2016-07-13  Zalan Bujtas  <zalan@apple.com>
1432
1433         Blank news article on kottke.org
1434         https://bugs.webkit.org/show_bug.cgi?id=159733
1435         <rdar://problem/26743065>
1436
1437         Reviewed by Simon Fraser.
1438
1439         This patch ensures that we update the visible content rect, when Auto Layout moves the WKWebView around.
1440         We normally expect setFrameRect to be called to position WKWebView. However Auto Layout relies on layoutSubviews,
1441         and in order to always have up-to-date visible content rect, we need to override layoutSubviews in WKWebView. 
1442
1443         * UIProcess/API/Cocoa/WKWebView.mm:
1444         (-[WKWebView layoutSubviews]):
1445
1446 2016-07-13  Chris Dumez  <cdumez@apple.com>
1447
1448         WebKit2 shouldn't signal custom protocol clients from the NSURLConnection loader thread.
1449         https://bugs.webkit.org/show_bug.cgi?id=159725
1450         <rdar://problem/27323131>
1451
1452         Reviewed by Andy Estes.
1453
1454         WebKit2 shouldn't signal custom protocol clients from the NSURLConnection
1455         loader thread. Instead, use the RunLoop the WKCustomProtocol was initialized
1456         on.
1457
1458         * NetworkProcess/CustomProtocols/Cocoa/CustomProtocolManagerCocoa.mm:
1459         (-[WKCustomProtocol initWithRequest:cachedResponse:client:]):
1460         (WebKit::dispatchOnInitializationRunLoop):
1461         (WebKit::CustomProtocolManager::didFailWithError):
1462         (WebKit::CustomProtocolManager::didLoadData):
1463         (WebKit::CustomProtocolManager::didReceiveResponse):
1464         (WebKit::CustomProtocolManager::didFinishLoading):
1465         (WebKit::CustomProtocolManager::wasRedirectedToRequest):
1466         (WebKit::dispatchOnResourceLoaderRunLoop): Deleted.
1467
1468 2016-07-13  Enrica Casucci  <enrica@apple.com>
1469
1470         Update supported platforms in xcconfig files to match the sdk names.
1471         https://bugs.webkit.org/show_bug.cgi?id=159728
1472
1473         Reviewed by Tim Horton.
1474
1475         * Configurations/Base.xcconfig:
1476
1477 2016-07-13  Carlos Garcia Campos  <cgarcia@igalia.com>
1478
1479         [Coordinated Graphics] Remove toCoordinatedGraphicsLayer and use downcast instead
1480         https://bugs.webkit.org/show_bug.cgi?id=159469
1481
1482         Reviewed by Michael Catanzaro.
1483
1484         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
1485         (WebKit::CompositingCoordinator::flushPendingLayerChanges):
1486         (WebKit::CompositingCoordinator::initializeRootCompositingLayerIfNeeded):
1487         (WebKit::CompositingCoordinator::mainContentsLayer):
1488
1489 2016-07-13  Carlos Garcia Campos  <cgarcia@igalia.com>
1490
1491         [GTK] WebKitGtk+ uses too many file descriptors
1492         https://bugs.webkit.org/show_bug.cgi?id=152316
1493
1494         Reviewed by Michael Catanzaro.
1495
1496         The problem is that we are keeping file descriptors open in SharedMemory objects. Those objects can be kept
1497         alive for a long time, for example in case of cached resources sent from the network process as shareable
1498         resources. The thing is that we keep the file descriptor in the SharedMemory object only to be able to create a
1499         Handle, duplicating the file descriptor. However, we are also assuming that we create handles for SharedMemory
1500         objects created by another handle which is wrong. SharedMemory objects are created to map a file or data and
1501         then a handle is created to send it to another process, or to map an existing file or data for a given handle
1502         received from another process. They can also be created to wrap another map, but in that case we don't own the
1503         file descritor nor the mapped data. So, after mapping from a handle, we no longer need the file descriptor, and
1504         it can be closed to release it, while the mapped memory data will still be alive until munmap() is called. This
1505         drastically reduces the amount of file descriptors used by WebKitGTK+.
1506
1507         * Platform/IPC/unix/ConnectionUnix.cpp:
1508         (IPC::readBytesFromSocket): Use setCloseOnExec().
1509         (IPC::Connection::createPlatformConnection): Ditto.
1510         * Platform/SharedMemory.h:
1511         * Platform/unix/SharedMemoryUnix.cpp:
1512         (WebKit::SharedMemory::map): Close the file descriptor right after mmap.
1513         (WebKit::SharedMemory::~SharedMemory): Close the file descriptor only if it hasn't been closed yet.
1514         (WebKit::SharedMemory::createHandle): Add an ASSERT to ensure we only try to create a handle for SharedMemory
1515         objects having a valid file descriptor. Use dupCloseOnExec() to duplicate the handle and set the close on exec flag.
1516         * UIProcess/Launcher/gtk/ProcessLauncherGtk.cpp:
1517         (WebKit::ProcessLauncher::launchProcess): Use setCloseOnExec().
1518
1519 2016-07-12  Simon Fraser  <simon.fraser@apple.com>
1520
1521         [iOS WK2] After zooming and when under memory pressure, page tiles sometimes don't redraw while panning
1522         https://bugs.webkit.org/show_bug.cgi?id=159697
1523         rdar://problem/26314075
1524
1525         Reviewed by Benjamin Poulain.
1526
1527         When under memory pressure, and after pinching back to minimum scale, WebPage::updateVisibleContentRects()
1528         would sometimes always bail under the "boundedScale != currentScale..." condition.
1529
1530         This happened because the visibleContentRectUpdateInfo.scale() is a double, but m_page->pageScaleFactor()
1531         is a float, and the constraining between min and max scale (which are doubles) caused boundedScale
1532         to be always different from currentScale.
1533
1534         Fix by using floats throughout.
1535
1536         No test because there's no way to simulate memory pressure for testing.
1537
1538         * WebProcess/WebPage/ios/WebPageIOS.mm:
1539         (WebKit::WebPage::updateVisibleContentRects):
1540
1541 2016-07-12  Chris Dumez  <cdumez@apple.com>
1542
1543         [WK2][NetworkSession] Fix unsafe RunLoop::dispatch() in NetworkLoad constructor
1544         https://bugs.webkit.org/show_bug.cgi?id=159691
1545
1546         Reviewed by Brady Eidson.
1547
1548         Remove unsafe RunLoop::dispatch() in NetworkLoad constructor. It captured |this| but there
1549         was no guarantee the NetworkLoad would still be alive by the time the lambda gets executed.
1550
1551         Instead, the constructor now takes a NetworkSession& parameter so that the call sites
1552         have to retrieve the NetworkSession for a given SessionID and deal with the fact that
1553         there may be no such NetworkSession before constructing the NetworkLoad.
1554
1555         * NetworkProcess/Downloads/DownloadManager.cpp:
1556         (WebKit::DownloadManager::startDownload):
1557         * NetworkProcess/Downloads/PendingDownload.cpp:
1558         (WebKit::PendingDownload::PendingDownload):
1559         * NetworkProcess/Downloads/PendingDownload.h:
1560         * NetworkProcess/NetworkLoad.cpp:
1561         (WebKit::NetworkLoad::NetworkLoad):
1562         * NetworkProcess/NetworkLoad.h:
1563         * NetworkProcess/NetworkResourceLoader.cpp:
1564         (WebKit::NetworkResourceLoader::startNetworkLoad):
1565         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
1566         (WebKit::NetworkCache::SpeculativeLoad::SpeculativeLoad):
1567
1568 2016-07-12  Chris Dumez  <cdumez@apple.com>
1569
1570         [WK2] Protect against bad database data in LocalStorageDatabase::importItems()
1571         https://bugs.webkit.org/show_bug.cgi?id=159663
1572         <rdar://problem/18995873>
1573
1574         Reviewed by Benjamin Poulain.
1575
1576         Protect against bad database data in LocalStorageDatabase::importItems(). We
1577         crash if the database contains a null key or a null value so protect against
1578         it given that we have evidence it can happen.
1579
1580         With this change, I can no longer reproduce the UIProcess crash on evernote.com
1581         that is documented at <rdar://problem/18995873>.
1582
1583         * UIProcess/Storage/LocalStorageDatabase.cpp:
1584         (WebKit::LocalStorageDatabase::importItems):
1585
1586 2016-07-12  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
1587
1588         Remove ENABLE_CSS3_TEXT_LINE_BREAK flag
1589         https://bugs.webkit.org/show_bug.cgi?id=159671
1590
1591         Reviewed by Csaba Osztrogonác.
1592
1593         ENABLE_CSS3_TEXT_LINE_BREAK feature was implemented without guards.
1594         https://bugs.webkit.org/show_bug.cgi?id=89235
1595
1596         So this guard can be removed in build scripts.
1597
1598         * Configurations/FeatureDefines.xcconfig:
1599
1600 2016-07-11  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
1601
1602         Purge PassRefPtr in platform/efl and platform/mac 
1603         https://bugs.webkit.org/show_bug.cgi?id=159548
1604
1605         Reviewed by Alex Christensen.
1606
1607         Remove all use of PassRefPtr and clean up unnecessary tabs and spaces.
1608         WebKit2 codes are also changed because of setBufferForType()'s modification.
1609
1610         * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
1611         (WebKit::WebPasteboardProxy::setPasteboardBufferForType):
1612         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
1613         (WebKit::WebPlatformStrategies::setBufferForType):
1614         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
1615
1616 2016-07-11  Chris Dumez  <cdumez@apple.com>
1617
1618         [WK2][iOS] Intermittent crash in [UIApplication beginBackgroundTaskWithName] expiration handler
1619         https://bugs.webkit.org/show_bug.cgi?id=159648
1620         <rdar://problem/27219361>
1621
1622         Reviewed by Anders Carlsson.
1623
1624         We see an intermittent crash in [UIApplication beginBackgroundTaskWithName] expiration handler.
1625         From the traces, we noticed the expiration handler can get called on a non-main thread under
1626         certain conditions, which our code is designed to deal with.
1627
1628         In particular, we get called on a non-main thread when UIKit fails to acquire the assertion.
1629         Update our expiration handler to always notify the clients on the main thread.
1630
1631         * UIProcess/ios/ProcessAssertionIOS.mm:
1632         (-[WKProcessAssertionBackgroundTaskManager _updateBackgroundTask]):
1633
1634 2016-07-11  Dan Bernstein  <mitz@apple.com>
1635
1636         Tried to fix the macOS build.
1637
1638         * UIProcess/API/Cocoa/WKNavigationAction.mm:
1639         (-[WKNavigationAction description]):
1640
1641 2016-07-11  Dan Bernstein  <mitz@apple.com>
1642
1643         Cleaned up API availability.
1644
1645         Requested by Tim Horton.
1646
1647         * UIProcess/API/Cocoa/WKNavigationAction.mm:
1648         * UIProcess/API/Cocoa/WKNavigationActionPrivate.h:
1649
1650 2016-07-11  Enrica Casucci  <enrica@apple.com>
1651
1652         Add synthetic click origin to WKNavigationAction.
1653         https://bugs.webkit.org/show_bug.cgi?id=159584
1654         rdar://problem/25610422
1655
1656         Reviewed by Tim Horton.
1657
1658         Adds a private property to WKNavigationAction to retrieve
1659         the origin of the synthetic click.
1660
1661         * Shared/NavigationActionData.cpp:
1662         (WebKit::NavigationActionData::encode):
1663         (WebKit::NavigationActionData::decode):
1664         * Shared/NavigationActionData.h:
1665         * Shared/WebEvent.h:
1666         (WebKit::WebMouseEvent::button):
1667         (WebKit::WebMouseEvent::menuTypeForEvent):
1668         (WebKit::WebMouseEvent::force):
1669         (WebKit::WebMouseEvent::syntheticClickType):
1670         * Shared/WebMouseEvent.cpp:
1671         (WebKit::WebMouseEvent::WebMouseEvent):
1672         (WebKit::WebMouseEvent::encode):
1673         (WebKit::WebMouseEvent::decode):
1674         * Shared/mac/WebEventFactory.mm:
1675         (WebKit::WebEventFactory::createWebMouseEvent):
1676         (WebKit::WebEventFactory::createWebWheelEvent):
1677         * UIProcess/API/APINavigationAction.h:
1678         * UIProcess/API/Cocoa/WKNavigationAction.mm:
1679         (toWKNavigationType):
1680         (toWKSyntheticClickType):
1681         (-[WKNavigationAction description]):
1682         (-[WKNavigationAction sourceFrame]):
1683         (-[WKNavigationAction request]):
1684         (-[WKNavigationAction _syntheticClickType]):
1685         (-[WKNavigationAction modifierFlags]):
1686         * UIProcess/API/Cocoa/WKNavigationActionPrivate.h:
1687         * UIProcess/WebPageProxy.h:
1688         * UIProcess/ios/WKContentViewInteraction.mm:
1689         (-[WKContentView _twoFingerSingleTapGestureRecognized:]):
1690         (-[WKContentView _longPressRecognized:]):
1691         * UIProcess/ios/WebPageProxyIOS.mm:
1692         (WebKit::WebPageProxy::getSelectionContext):
1693         (WebKit::WebPageProxy::handleTwoFingerTapAtPoint):
1694         (WebKit::WebPageProxy::selectWithTwoTouches):
1695         * WebProcess/InjectedBundle/InjectedBundleNavigationAction.cpp:
1696         (WebKit::mouseButtonForMouseEvent):
1697         (WebKit::syntheticClickTypeForMouseEvent):
1698         (WebKit::InjectedBundleNavigationAction::modifiersForNavigationAction):
1699         (WebKit::InjectedBundleNavigationAction::mouseButtonForNavigationAction):
1700         (WebKit::InjectedBundleNavigationAction::syntheticClickTypeForNavigationAction):
1701         (WebKit::InjectedBundleNavigationAction::create):
1702         (WebKit::InjectedBundleNavigationAction::InjectedBundleNavigationAction):
1703         * WebProcess/InjectedBundle/InjectedBundleNavigationAction.h:
1704         (WebKit::InjectedBundleNavigationAction::navigationType):
1705         (WebKit::InjectedBundleNavigationAction::modifiers):
1706         (WebKit::InjectedBundleNavigationAction::mouseButton):
1707         (WebKit::InjectedBundleNavigationAction::hitTestResult):
1708         (WebKit::InjectedBundleNavigationAction::formElement):
1709         (WebKit::InjectedBundleNavigationAction::syntheticClickType):
1710         (WebKit::InjectedBundleNavigationAction::shouldOpenExternalURLs):
1711         (WebKit::InjectedBundleNavigationAction::shouldTryAppLinks):
1712         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1713         (WebKit::WebChromeClient::createWindow):
1714         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1715         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNewWindowAction):
1716         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
1717         * WebProcess/WebPage/WebPage.cpp:
1718         (WebKit::WebPage::navigateToPDFLinkWithSimulatedClick):
1719         (WebKit::WebPage::contextMenuAtPointInWindow):
1720         (WebKit::WebPage::dragEnded):
1721         (WebKit::WebPage::simulateMouseDown):
1722         (WebKit::WebPage::simulateMouseUp):
1723         (WebKit::WebPage::simulateMouseMotion):
1724         (WebKit::WebPage::setCompositionForTesting):
1725         * WebProcess/WebPage/WebPage.h:
1726         * WebProcess/WebPage/WebPage.messages.in:
1727         * WebProcess/WebPage/ios/WebPageIOS.mm:
1728         (WebKit::WebPage::handleSyntheticClick):
1729         (WebKit::WebPage::completePendingSyntheticClickForContentChangeObserver):
1730         (WebKit::WebPage::completeSyntheticClick):
1731         (WebKit::WebPage::sendTapHighlightForNodeIfNecessary):
1732         (WebKit::WebPage::handleTwoFingerTapAtPoint):
1733         (WebKit::WebPage::potentialTapAtPosition):
1734         (WebKit::WebPage::inspectorNodeSearchMovedToPosition):
1735
1736 2016-07-11  Anders Carlsson  <andersca@apple.com>
1737
1738         Able to open multiple payment sheets in Safari at the same time
1739         https://bugs.webkit.org/show_bug.cgi?id=159637
1740         rdar://problem/26411339
1741
1742         Reviewed by Beth Dakin.
1743
1744         * UIProcess/ApplePay/WebPaymentCoordinatorProxy.cpp:
1745         (WebKit::WebPaymentCoordinatorProxy::showPaymentUI):
1746         Add result out parameter. Set the result to false if isShowingPaymentUI is true, otherwise set isShowingPaymentUI to true.
1747     
1748         (WebKit::WebPaymentCoordinatorProxy::didReachFinalState):
1749         Set isShowingPaymentUI to false.
1750
1751         * UIProcess/ApplePay/WebPaymentCoordinatorProxy.h:
1752         * UIProcess/ApplePay/WebPaymentCoordinatorProxy.messages.in:
1753         * WebProcess/ApplePay/WebPaymentCoordinator.cpp:
1754         (WebKit::WebPaymentCoordinator::showPaymentUI):
1755         * WebProcess/ApplePay/WebPaymentCoordinator.h:
1756         The showPaymentUI message and client functions now return booleans.
1757
1758 2016-07-11  Commit Queue  <commit-queue@webkit.org>
1759
1760         Unreviewed, rolling out r203064.
1761         https://bugs.webkit.org/show_bug.cgi?id=159642
1762
1763         This change causes LayoutTest crashes on WK1 ASan (Requested
1764         by ryanhaddad on #webkit).
1765
1766         Reverted changeset:
1767
1768         "Use refs for ResourceLoaders"
1769         https://bugs.webkit.org/show_bug.cgi?id=159592
1770         http://trac.webkit.org/changeset/203064
1771
1772 2016-07-11  Nan Wang  <n_wang@apple.com>
1773
1774         AX: WKWebView should have API to prevent pinch-to-zoom always being allowed
1775         https://bugs.webkit.org/show_bug.cgi?id=158364
1776
1777         Reviewed by Anders Carlsson.
1778
1779         Added a property in WKWebViewConfiguration so that developers can toggle the ignoring
1780         viewport scale limits setting.
1781
1782         Changes are covered in modified tests.
1783
1784         * Shared/WebPageCreationParameters.cpp:
1785         (WebKit::WebPageCreationParameters::encode):
1786         (WebKit::WebPageCreationParameters::decode):
1787         * Shared/WebPageCreationParameters.h:
1788         * UIProcess/API/C/WKPage.cpp:
1789         (WKPageSetResourceCachingDisabled):
1790         (WKPageSetIgnoresViewportScaleLimits):
1791         * UIProcess/API/C/WKPagePrivate.h:
1792         * UIProcess/API/Cocoa/WKWebView.mm:
1793         (shouldAllowPictureInPictureMediaPlayback):
1794         (-[WKWebView _initializeWithConfiguration:]):
1795         (-[WKWebView _navigationGestureDidEnd]):
1796         (forceAlwaysUserScalableChangedCallback): Deleted.
1797         (-[WKWebView _updateForceAlwaysUserScalable]): Deleted.
1798         * UIProcess/API/Cocoa/WKWebViewConfiguration.h:
1799         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
1800         (-[WKWebViewConfiguration init]):
1801         (-[WKWebViewConfiguration encodeWithCoder:]):
1802         (-[WKWebViewConfiguration initWithCoder:]):
1803         (-[WKWebViewConfiguration copyWithZone:]):
1804         * UIProcess/API/Cocoa/WKWebViewInternal.h:
1805         * UIProcess/WebPageProxy.cpp:
1806         (WebKit::WebPageProxy::creationParameters):
1807         * UIProcess/WebPageProxy.h:
1808         * UIProcess/ios/WebPageProxyIOS.mm:
1809         (WebKit::WebPageProxy::setViewportConfigurationMinimumLayoutSize):
1810         (WebKit::WebPageProxy::setForceAlwaysUserScalable):
1811         (WebKit::WebPageProxy::setMaximumUnobscuredSize):
1812         (WebKit::WebPageProxy::updateForceAlwaysUserScalable): Deleted.
1813         * WebProcess/WebPage/WebPage.cpp:
1814         (WebKit::WebPage::updatePreferences):
1815         * WebProcess/WebPage/WebPage.h:
1816         * WebProcess/WebPage/WebPage.messages.in:
1817         * WebProcess/WebPage/ios/WebPageIOS.mm:
1818         (WebKit::WebPage::disableInspectorNodeSearch):
1819         (WebKit::WebPage::setForceAlwaysUserScalable):
1820         (WebKit::innerFrameQuad):
1821         (WebKit::WebPage::updateForceAlwaysUserScalable): Deleted.
1822
1823 2016-07-08  Alex Christensen  <achristensen@webkit.org>
1824
1825         Use refs for ResourceLoaders
1826         https://bugs.webkit.org/show_bug.cgi?id=159592
1827
1828         Reviewed by Chris Dumez.
1829
1830         * WebProcess/Network/WebLoaderStrategy.cpp:
1831         (WebKit::WebLoaderStrategy::scheduleInternallyFailedLoad):
1832         (WebKit::WebLoaderStrategy::internallyFailedLoadTimerFired):
1833         (WebKit::WebLoaderStrategy::startLocalLoad):
1834         (WebKit::WebLoaderStrategy::remove):
1835         (WebKit::WebLoaderStrategy::setDefersLoading):
1836         (WebKit::WebLoaderStrategy::crossOriginRedirectReceived):
1837         * WebProcess/Network/WebLoaderStrategy.h:
1838
1839 2016-07-11  Antti Koivisto  <antti@apple.com>
1840
1841         Update stable cache version in NetworkCache::Storage::deleteOldVersions()
1842         https://bugs.webkit.org/show_bug.cgi?id=159618
1843         rdar://problem/26715745
1844
1845         Reviewed by Chris Dumez.
1846
1847         NetworkCache::Storage::deleteOldVersions() keeps the previous shipped cache version (4) for Mac around so
1848         development WebKit doesn’t clobber system Safari cache. Update this to the current version so old caches
1849         go away in customer systems.
1850
1851         * NetworkProcess/cache/NetworkCacheStorage.cpp:
1852         (WebKit::NetworkCache::Storage::deleteOldVersions):
1853         * NetworkProcess/cache/NetworkCacheStorage.h:
1854
1855             Move lastStableVersion to header next to the current version.
1856
1857 2016-07-10  Beth Dakin  <bdakin@apple.com>
1858
1859         Update mediaIcon.pdf
1860         https://bugs.webkit.org/show_bug.cgi?id=159613
1861         -and corresponding-
1862         rdar://problem/27268111
1863
1864         Reviewed by Sam Weinig.
1865
1866         * Resources/mediaIcon.pdf: Replaced.
1867
1868 2016-07-10  Alex Christensen  <achristensen@webkit.org>
1869
1870         Add self to WebKit2 Owners
1871         https://bugs.webkit.org/show_bug.cgi?id=159499
1872
1873         Reviewed by Sam Weinig.
1874
1875         * Owners:
1876
1877 2016-07-10  Alex Christensen  <achristensen@webkit.org>
1878
1879         Fix client certificate authentication after r200463
1880         https://bugs.webkit.org/show_bug.cgi?id=159574
1881         <rdar://problem/26931006>
1882
1883         Reviewed by Sam Weinig.
1884
1885         * Shared/Authentication/mac/AuthenticationManager.mac.mm:
1886         (WebKit::leafCertificate):
1887         (WebKit::chain):
1888         Handle the different types of CertificateInfos.
1889
1890 2016-07-08  Yongjun Zhang  <yongjun_zhang@apple.com>
1891
1892         When WKWebView prepares the session state blob, we should be able to filter it.
1893         https://bugs.webkit.org/show_bug.cgi?id=159410
1894
1895         Add a SPI to WKWebView so that a client can decide how to filter backforward items
1896         when WKWebView perparing session state.
1897
1898         Reviewed by Brady Eidson.
1899
1900         * UIProcess/API/Cocoa/WKWebView.mm:
1901         (-[WKWebView _sessionStateWithFilter:]): When preparing session state, check each
1902         backforward item against the filter block.
1903         * UIProcess/API/Cocoa/WKWebViewPrivate.h: Add the SPI _sessionStateWithFilter:
1904
1905
1906 2016-07-08  Tim Horton  <timothy_horton@apple.com>
1907
1908         Mail messages don't start loading until scrolling completes
1909         https://bugs.webkit.org/show_bug.cgi?id=159585
1910         <rdar://problem/27088405>
1911
1912         Reviewed by Andy Estes.
1913
1914         * UIProcess/Network/CustomProtocols/mac/CustomProtocolManagerProxyMac.mm:
1915         (-[WKCustomProtocolLoader initWithCustomProtocolManagerProxy:customProtocolID:request:connection:]):
1916         When scrolling, NSDefaultRunLoopMode isn't run, but NSRunLoopCommonModes are.
1917         CFNetwork uses NSDefaultRunLoopMode if we tell NSURLConnection to "start immediately",
1918         but we can instead schedule our NSURLConnection into NSRunLoopCommonModes
1919         and start it ourselves, ensuring that it will be able to do work while scrolling is happening.
1920
1921 2016-07-08  Andy Estes  <aestes@apple.com>
1922
1923         [Content Filtering] Load blocked pages more like other error pages are loaded
1924         https://bugs.webkit.org/show_bug.cgi?id=159485
1925         <rdar://problem/26014076>
1926
1927         Reviewed by Brady Eidson.
1928
1929         * Shared/API/c/WKErrorRef.h: Defined kWKErrorCodeFrameLoadBlockedByContentFilter.
1930         * UIProcess/Cocoa/WebProcessProxyCocoa.mm:
1931         (WebKit::WebProcessProxy::platformPathsWithAssumedReadAccess): Added the resource directories
1932         of WebCore.framework and WebKit.framework as paths with assumed read access.
1933         * UIProcess/WebProcessProxy.cpp:
1934         (WebKit::WebProcessProxy::hasAssumedReadAccessToURL): Checked platformPathsWithAssumedReadAccess()
1935         as well as m_localPathsWithAssumedReadAccess.
1936         (WebKit::WebProcessProxy::platformPathsWithAssumedReadAccess): Added a non-Cocoa implementation.
1937         * UIProcess/WebProcessProxy.h:
1938         * WebProcess/WebCoreSupport/WebErrors.h:
1939         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1940         (WebKit::WebFrameLoaderClient::blockedByContentFilterError): Called WebKit::blockedByContentFilterError().
1941         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
1942         * WebProcess/WebCoreSupport/mac/WebErrorsMac.mm:
1943         (WebKit::blockedByContentFilterError): Returned a ResourceError for kWKErrorCodeFrameLoadBlockedByContentFilter.
1944
1945 2016-07-08  Anders Carlsson  <andersca@apple.com>
1946
1947         Fix 32-bit build.
1948
1949         * PluginProcess/mac/PluginProcessShim.mm:
1950
1951 2016-07-07  Anders Carlsson  <andersca@apple.com>
1952
1953         REGRESSION (r196321): Adobe Reader DC + Safari : Zoom level pulldown is not displayed at the correct position
1954         https://bugs.webkit.org/show_bug.cgi?id=159531
1955         rdar://problem/26382579
1956
1957         Reviewed by Tim Horton.
1958
1959         There's code in the Adobe Acrobat framework that checks if the main bundle identifier is "com.apple.WebKit.PluginProcess"
1960         and assumes that it's running inside the Adobe Reader app if it's something else. Since we're now using the XPC service
1961         for all plug-ins, the bundle identifier is "com.apple.WebKit.Plugin.64", so the Acrobat framework assumes it's running in the app
1962         and doesn't use any special tricks to show the popup menu.
1963         
1964         Work around this by shimming CFStringCompare, and looking for the exact conditions when this can happen and return kCFCompareEqualTo
1965         when all conditions are true.
1966         
1967         * PluginProcess/mac/PluginProcessMac.mm:
1968         (WebKit::isAdobeAcrobatAddress):
1969         (WebKit::stringCompare):
1970         (WebKit::initializeShim):
1971         (WebKit::PluginProcess::platformInitializeProcess):
1972         * PluginProcess/mac/PluginProcessShim.h:
1973         * PluginProcess/mac/PluginProcessShim.mm:
1974         (WebKit::shimCFStringCompare):
1975
1976 2016-07-08  Brady Eidson  <beidson@apple.com>
1977
1978         Unreviewed: Fix case-sensitive filesystem build.
1979
1980         * UIProcess/Storage/LocalStorageDatabaseTracker.cpp:
1981
1982 2016-07-08  Commit Queue  <commit-queue@webkit.org>
1983
1984         Unreviewed, rolling out r202944.
1985         https://bugs.webkit.org/show_bug.cgi?id=159570
1986
1987         caused some tests to crash under GuardMalloc (Requested by
1988         estes on #webkit).
1989
1990         Reverted changeset:
1991
1992         "[Content Filtering] Load blocked pages more like other error
1993         pages are loaded"
1994         https://bugs.webkit.org/show_bug.cgi?id=159485
1995         http://trac.webkit.org/changeset/202944
1996
1997 2016-07-08  Keith Rollin  <krollin@apple.com>
1998
1999         Add always-on logging for downloads
2000         https://bugs.webkit.org/show_bug.cgi?id=159521
2001         <rdar://problem/26630645>
2002
2003         Reviewed by Alex Christensen.
2004
2005         Add logging statements that track when a download starts, when it
2006         first receives data, and when the download is done (due to completion,
2007         cancelation, or failure).
2008
2009         * NetworkProcess/Downloads/Download.cpp:
2010         (WebKit::Download::Download):
2011         (WebKit::Download::didReceiveResponse):
2012         (WebKit::Download::didReceiveData):
2013         (WebKit::Download::didFinish):
2014         (WebKit::Download::didFail):
2015         (WebKit::Download::didCancel):
2016         (WebKit::Download::isAlwaysOnLoggingAllowed):
2017         * NetworkProcess/Downloads/Download.h:
2018         (WebKit::Download::Download):
2019         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
2020         (-[WKNetworkSessionDelegate URLSession:dataTask:didBecomeDownloadTask:]):
2021
2022 2016-07-08  Brady Eidson  <beidson@apple.com>
2023
2024         Clearing LocalStorage doesn't also delete -wal and -shm files.
2025         <rdar://problem/27206772> and https://bugs.webkit.org/show_bug.cgi?id=159566
2026
2027         Reviewed by Brent Fulgham.
2028         Also helpfully picked over by Andy "Never Forgets" Estes.
2029
2030         * UIProcess/Storage/LocalStorageDatabaseTracker.cpp:
2031         (WebKit::LocalStorageDatabaseTracker::removeDatabaseWithOriginIdentifier):
2032
2033 2016-07-07  Andy Estes  <aestes@apple.com>
2034
2035         [Content Filtering] Load blocked pages more like other error pages are loaded
2036         https://bugs.webkit.org/show_bug.cgi?id=159485
2037         <rdar://problem/26014076>
2038
2039         Reviewed by Brady Eidson.
2040
2041         * Shared/API/c/WKErrorRef.h: Defined kWKErrorCodeFrameLoadBlockedByContentFilter.
2042         * UIProcess/Cocoa/WebProcessProxyCocoa.mm:
2043         (WebKit::WebProcessProxy::platformPathsWithAssumedReadAccess): Added the resource directories
2044         of WebCore.framework and WebKit.framework as paths with assumed read access.
2045         * UIProcess/WebProcessProxy.cpp:
2046         (WebKit::WebProcessProxy::hasAssumedReadAccessToURL): Checked platformPathsWithAssumedReadAccess()
2047         as well as m_localPathsWithAssumedReadAccess.
2048         (WebKit::WebProcessProxy::platformPathsWithAssumedReadAccess): Added a non-Cocoa implementation.
2049         * UIProcess/WebProcessProxy.h:
2050         * WebProcess/WebCoreSupport/WebErrors.h:
2051         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2052         (WebKit::WebFrameLoaderClient::blockedByContentFilterError): Called WebKit::blockedByContentFilterError().
2053         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
2054         * WebProcess/WebCoreSupport/mac/WebErrorsMac.mm:
2055         (WebKit::blockedByContentFilterError): Returned a ResourceError for kWKErrorCodeFrameLoadBlockedByContentFilter.
2056
2057 2016-07-07  Alex Christensen  <achristensen@webkit.org>
2058
2059         Followup to r202939.
2060         https://bugs.webkit.org/show_bug.cgi?id=159526
2061
2062         * NetworkProcess/NetworkResourceLoader.cpp:
2063         (WebKit::NetworkResourceLoader::didFailLoading):
2064         We need the correct destination id when sending a message.
2065
2066 2016-07-07  Alex Christensen  <achristensen@webkit.org>
2067
2068         Fix crash when sending failure message to closed WebProcess
2069         https://bugs.webkit.org/show_bug.cgi?id=159526
2070         <rdar://problem/26767037>
2071
2072         Reviewed by Brady Eidson.
2073
2074         * NetworkProcess/NetworkResourceLoader.cpp:
2075         (WebKit::NetworkResourceLoader::didFailLoading):
2076         Check to see if there is a connection before using it to send a message.
2077         Sometimes it was null.
2078         I think this could be tested if we had real network loading from TestWebKitAPI
2079         by cancelling slow loads and closing WebProcesses around the same time, but no such infrastructure exists yet.
2080
2081 2016-07-07  Alex Christensen  <achristensen@webkit.org>
2082
2083         Use SocketProvider to create WebSocketChannels
2084         https://bugs.webkit.org/show_bug.cgi?id=158776
2085
2086         Reviewed by Brent Fulgham.
2087
2088         * CMakeLists.txt:
2089         * WebKit2.xcodeproj/project.pbxproj:
2090         * WebProcess/Network/WebSocketProvider.cpp: Copied from Source/WebCore/Modules/websockets/ThreadableWebSocketChannel.cpp.
2091         (WebKit::WebSocketProvider::createWebSocketChannel):
2092         (WebCore::ThreadableWebSocketChannel::create): Deleted.
2093         * WebProcess/Network/WebSocketProvider.h:
2094         * WebProcess/WebPage/WebPage.cpp:
2095         (WebKit::m_shouldDispatchFakeMouseMoveEvents):
2096
2097 2016-07-07  Antoine Quint  <graouts@apple.com>
2098
2099         <img> with a wide gamut PDF does not display using a wide gamut color space
2100         https://bugs.webkit.org/show_bug.cgi?id=158983
2101         <rdar://problem/25720247>
2102
2103         Reviewed by Dean Jackson.
2104
2105         ColorSpace parameters have been replaced with CGColorSpaceRef parameters for IOSurface.
2106
2107         * Shared/mac/RemoteLayerBackingStore.mm:
2108         (WebKit::RemoteLayerBackingStore::decode):
2109         (WebKit::RemoteLayerBackingStore::swapToValidFrontBuffer):
2110         * UIProcess/API/Cocoa/WKWebView.mm:
2111         (-[WKWebView _takeViewSnapshot]):
2112         (-[WKWebView _snapshotRect:intoImageOfWidth:completionHandler:]):
2113
2114 2016-07-07  Anders Carlsson  <andersca@apple.com>
2115
2116         Memory corruption destroying PaymentCoordinator
2117         https://bugs.webkit.org/show_bug.cgi?id=159516
2118         rdar://problem/27222517
2119
2120         Reviewed by Tim Horton.
2121
2122         Introduce a new MessageReceiverMap::removeMessageReceiver that takes a MessageReceiver
2123         and removes all traces of it in the message receiver map. Use it in the WebPaymentCoordinator destructor.
2124
2125         * Platform/IPC/MessageReceiverMap.cpp:
2126         (IPC::MessageReceiverMap::removeMessageReceiver):
2127         * Platform/IPC/MessageReceiverMap.h:
2128         * Shared/ChildProcess.cpp:
2129         (WebKit::ChildProcess::removeMessageReceiver):
2130         * Shared/ChildProcess.h:
2131         * WebProcess/ApplePay/WebPaymentCoordinator.cpp:
2132         (WebKit::WebPaymentCoordinator::~WebPaymentCoordinator):
2133
2134 2016-07-07  Csaba Osztrogonác  <ossy@webkit.org>
2135
2136         [Mac][cmake] Unreviewed buildfix after r202889. Just for fun.
2137
2138         * PlatformMac.cmake:
2139
2140 2016-07-06  Tim Horton  <timothy_horton@apple.com>
2141
2142         Some API tests started failing after r202889
2143         https://bugs.webkit.org/show_bug.cgi?id=159498
2144
2145         * UIProcess/WebPageProxy.cpp:
2146         (WebKit::WebPageProxy::loadHTMLString):
2147         Fix a typo; this is a MIME type, not an encoding :|
2148
2149 2016-07-06  Tim Horton  <timothy_horton@apple.com>
2150
2151         Email from June 1st containing text 'Today @ 7:10PM' is linkified, but shouldn't be
2152         https://bugs.webkit.org/show_bug.cgi?id=159498
2153         <rdar://problem/26719903>
2154
2155         Reviewed by Sam Weinig.
2156
2157         * Shared/Cocoa/LoadParametersCocoa.mm: Added.
2158         (WebKit::LoadParameters::platformEncode):
2159         (WebKit::LoadParameters::platformDecode):
2160         * Shared/LoadParameters.cpp: Added.
2161         (WebKit::LoadParameters::encode):
2162         (WebKit::LoadParameters::decode):
2163         * Shared/LoadParameters.h: Added.
2164         Add a struct that knows how to encode all of the different parameters
2165         to all of the Load* messages, including the platform-specific DataDetectors parameters.
2166
2167         * Shared/mac/ArgumentCodersMac.h:
2168         * Shared/mac/ArgumentCodersMac.mm:
2169         (IPC::typeFromObject):
2170         (IPC::encode):
2171         (IPC::decode):
2172         Add NSURL coders that defer to the CFURL coders.
2173
2174         * UIProcess/API/APIUIClient.h:
2175         (API::UIClient::dataDetectionContext):
2176         * UIProcess/Cocoa/UIDelegate.h:
2177         * UIProcess/Cocoa/UIDelegate.mm:
2178         (WebKit::UIDelegate::setDelegate):
2179         (WebKit::UIDelegate::UIClient::dataDetectionContext):
2180         Add APIUIClient methods to retrieve the DataDetectors context dictionary.
2181
2182         * UIProcess/Cocoa/WebPageProxyCocoa.mm:
2183         (WebKit::WebPageProxy::addPlatformLoadParameters):
2184         Add the DataDetectors context dictionary to the given LoadParameters.
2185
2186         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2187         (WebKit::WebFrameLoaderClient::dataDetectionContext):
2188         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
2189         * WebProcess/WebPage/WebPage.h:
2190         (WebKit::WebPage::dataDetectionContext):
2191         Store the dataDetectionContext on WebPage, and make it accessible to WebCore
2192         via the FrameLoaderClient (it is used in FrameLoader when the load completes).
2193
2194         * UIProcess/WebPageProxy.cpp:
2195         (WebKit::WebPageProxy::loadRequest):
2196         (WebKit::WebPageProxy::loadFile):
2197         (WebKit::WebPageProxy::loadData):
2198         (WebKit::WebPageProxy::loadHTMLString):
2199         (WebKit::WebPageProxy::loadAlternateHTMLString):
2200         (WebKit::WebPageProxy::loadPlainTextString):
2201         (WebKit::WebPageProxy::loadWebArchiveData):
2202         * UIProcess/WebPageProxy.h:
2203         * WebKit2.xcodeproj/project.pbxproj:
2204         * WebProcess/WebPage/WebPage.cpp:
2205         (WebKit::WebPage::loadRequest):
2206         (WebKit::WebPage::loadStringImpl):
2207         (WebKit::WebPage::loadData):
2208         (WebKit::WebPage::loadString):
2209         (WebKit::WebPage::loadAlternateHTMLString):
2210         (WebKit::WebPage::loadHTMLString): Deleted.
2211         (WebKit::WebPage::loadPlainTextString): Deleted.
2212         (WebKit::WebPage::loadWebArchiveData): Deleted.
2213         * WebProcess/WebPage/WebPage.messages.in:
2214         Adopt LoadParameters, taking this opportunity to reduce the number of very similar messages.
2215         We can take this further (we should be able to get it down to just LoadRequest
2216         and LoadData) in the future. When any load occurs, grab the client's DataDetectorse
2217         context dictionary and send it along with the load request, storing it in WebPage.
2218
2219 2016-07-06  Chris Dumez  <cdumez@apple.com>
2220
2221         [WK2][Cocoa] Disable ResourceResponse lazy initialization
2222         https://bugs.webkit.org/show_bug.cgi?id=159497
2223         <rdar://problem/27209066>
2224
2225         Reviewed by Alex Christensen.
2226
2227         Disable ResourceResponse lazy initialization for WebKit2 as
2228         we always end up initializing all the fields anyway when
2229         sending the response to the WebContent process via IPC.
2230
2231         Even worse, we always do a partial lazy initialization (common
2232         fields only) before the IPC so we always do the initialization
2233         in 2 steps. This normally would not be an issue but the 2 steps
2234         actually have some overlap because both call
2235         CFHTTPMessageCopyAllHeaderFields(), which is expensive (See
2236         <rdar://problem/26796059>) to first get the common HTTP headers,
2237         then ALL the HTTP headers.
2238
2239         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
2240         (-[WKNetworkSessionDelegate URLSession:dataTask:didReceiveResponse:completionHandler:]):
2241
2242 2016-07-06  Chelsea Pugh  <cpugh@apple.com>
2243
2244         [iOS] Text suggestions should be cleared when form input session is invalidated        
2245         https://bugs.webkit.org/show_bug.cgi?id=159477
2246
2247         Reviewed by Dan Bernstein.
2248
2249         * UIProcess/ios/WKContentViewInteraction.mm:
2250         (-[WKFormInputSession invalidate]): Set input delegate's suggestions to nil when a form input session is
2251         invalidated. This will set the keyboard QuickType suggestions back to their default values.
2252
2253 2016-07-06  Alex Christensen  <achristensen@webkit.org>
2254
2255         Call continueCanAuthenticateAgainstProtectionSpace when cancelling loads waiting for the callback
2256         https://bugs.webkit.org/show_bug.cgi?id=159492
2257         <rdar://problem/26921670>
2258
2259         Reviewed by Brady Eidson.
2260
2261         * NetworkProcess/NetworkLoad.cpp:
2262         (WebKit::NetworkLoad::~NetworkLoad):
2263         (WebKit::NetworkLoad::canAuthenticateAgainstProtectionSpaceAsync):
2264         (WebKit::NetworkLoad::continueCanAuthenticateAgainstProtectionSpace):
2265         * NetworkProcess/NetworkLoad.h:
2266
2267 2016-07-06  Myles C. Maxfield  <mmaxfield@apple.com>
2268
2269         [RTL Scrollbars] RTL Scrollbars broken with clients creating Web Views via [WKView initWithFrame:contextRef:pageGroupRef:]
2270         https://bugs.webkit.org/show_bug.cgi?id=159383
2271         <rdar://problem/26921117>
2272
2273         Reviewed by Anders Carlsson.
2274
2275         The code which consults with the userInterfaceLayoutDirection of the view is
2276         inside [WKWebView _initializeWithConfiguration:]. However, some clients create
2277         Web Views via [WKView initWithFrame:contextRef:pageGroupRef:] which doesn't
2278         call this code. Therefore, this codepath should do the same kind of direction
2279         consulting.
2280
2281         * UIProcess/API/mac/WKView.mm:
2282         (toUserInterfaceLayoutDirection):
2283         (-[WKView initWithFrame:contextRef:pageGroupRef:relatedToPage:]):
2284
2285 2016-07-06  Commit Queue  <commit-queue@webkit.org>
2286
2287         Unreviewed, rolling out r202867.
2288         https://bugs.webkit.org/show_bug.cgi?id=159491
2289
2290         This change caused an existing LayoutTest to crash on ios-
2291         simulator (Requested by ryanhaddad on #webkit).
2292
2293         Reverted changeset:
2294
2295         "<img> with a wide gamut PDF does not display using a wide
2296         gamut color space"
2297         https://bugs.webkit.org/show_bug.cgi?id=158983
2298         http://trac.webkit.org/changeset/202867
2299
2300 2016-07-06  Enrica Casucci  <enrica@apple.com>
2301
2302         Limit touch distance for two finger tap.
2303         https://bugs.webkit.org/show_bug.cgi?id=159476
2304         rdar://problem/26439052
2305
2306         Reviewed by Beth Dakin.
2307
2308         * UIProcess/ios/WKContentViewInteraction.mm:
2309         (-[WKContentView setupInteraction]):
2310         * Platform/spi/ios/UIKitSPI.h
2311
2312 2016-07-06  Antoine Quint  <graouts@apple.com>
2313
2314         <img> with a wide gamut PDF does not display using a wide gamut color space
2315         https://bugs.webkit.org/show_bug.cgi?id=158983
2316         <rdar://problem/25720247>
2317
2318         Reviewed by Tim Horton.
2319
2320         ColorSpace parameters have been replaced with CGColorSpaceRef parameters for IOSurface.
2321
2322         * Shared/mac/RemoteLayerBackingStore.mm:
2323         (WebKit::RemoteLayerBackingStore::decode):
2324         (WebKit::RemoteLayerBackingStore::swapToValidFrontBuffer):
2325         * UIProcess/API/Cocoa/WKWebView.mm:
2326         (-[WKWebView _takeViewSnapshot]):
2327         (-[WKWebView _snapshotRect:intoImageOfWidth:completionHandler:]):
2328
2329 2016-07-06  Commit Queue  <commit-queue@webkit.org>
2330
2331         Unreviewed, rolling out r202725.
2332         https://bugs.webkit.org/show_bug.cgi?id=159473
2333
2334         didn't reduce coreui memory usage (Requested by kling on
2335         #webkit).
2336
2337         Reverted changeset:
2338
2339         "[Mac] Get rid of the old timey rubber-banding linen pattern."
2340         https://bugs.webkit.org/show_bug.cgi?id=159329
2341         http://trac.webkit.org/changeset/202725
2342
2343 2016-07-06  Carlos Garcia Campos  <cgarcia@igalia.com>
2344
2345         Duplicated code in DrawingAreaImpl and CoordinatedDrawingArea
2346         https://bugs.webkit.org/show_bug.cgi?id=159259
2347
2348         Reviewed by Žan Doberšek.
2349
2350         It seems that CoordinatedDrawingArea is just a copy paste of DrawingAreaImpl with non-accelerated code path
2351         removed. There's actually nothing (or very little) specific to coordinated graphics in the
2352         CoordinatedDrawingArea implementation. This patch renames CoordinatedDrawingArea as AcceleratedDrawingArea and
2353         makes DrawingAreaImpl inherit from it, so that in case of accelerated compositing the parent class is used, and
2354         DrawingAreaImpl only adds the non accelerated code path.
2355
2356         * PlatformEfl.cmake:
2357         * PlatformGTK.cmake:
2358         * WebProcess/WebPage/AcceleratedDrawingArea.cpp: Renamed from Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedDrawingArea.cpp.
2359         (WebKit::AcceleratedDrawingArea::~AcceleratedDrawingArea):
2360         (WebKit::AcceleratedDrawingArea::AcceleratedDrawingArea):
2361         (WebKit::AcceleratedDrawingArea::setNeedsDisplay):
2362         (WebKit::AcceleratedDrawingArea::setNeedsDisplayInRect):
2363         (WebKit::AcceleratedDrawingArea::scroll):
2364         (WebKit::AcceleratedDrawingArea::pageBackgroundTransparencyChanged):
2365         (WebKit::AcceleratedDrawingArea::setLayerTreeStateIsFrozen):
2366         (WebKit::AcceleratedDrawingArea::forceRepaint):
2367         (WebKit::AcceleratedDrawingArea::forceRepaintAsync):
2368         (WebKit::AcceleratedDrawingArea::setPaintingEnabled):
2369         (WebKit::AcceleratedDrawingArea::updatePreferences):
2370         (WebKit::AcceleratedDrawingArea::mainFrameContentSizeChanged):
2371         (WebKit::AcceleratedDrawingArea::layerHostDidFlushLayers):
2372         (WebKit::AcceleratedDrawingArea::graphicsLayerFactory):
2373         (WebKit::AcceleratedDrawingArea::setRootCompositingLayer):
2374         (WebKit::AcceleratedDrawingArea::scheduleCompositingLayerFlush):
2375         (WebKit::AcceleratedDrawingArea::scheduleCompositingLayerFlushImmediately):
2376         (WebKit::AcceleratedDrawingArea::updateBackingStoreState):
2377         (WebKit::AcceleratedDrawingArea::sendDidUpdateBackingStoreState):
2378         (WebKit::AcceleratedDrawingArea::suspendPainting):
2379         (WebKit::AcceleratedDrawingArea::resumePainting):
2380         (WebKit::AcceleratedDrawingArea::enterAcceleratedCompositingMode):
2381         (WebKit::AcceleratedDrawingArea::exitAcceleratedCompositingModeSoon):
2382         (WebKit::AcceleratedDrawingArea::didReceiveCoordinatedLayerTreeHostMessage):
2383         (WebKit::AcceleratedDrawingArea::viewStateDidChange):
2384         (WebKit::AcceleratedDrawingArea::attachViewOverlayGraphicsLayer):
2385         * WebProcess/WebPage/AcceleratedDrawingArea.h: Renamed from Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedDrawingArea.h.
2386         (WebKit::AcceleratedDrawingArea::exitAcceleratedCompositingModePending):
2387         (WebKit::AcceleratedDrawingArea::didUpdateBackingStoreState):
2388         (WebKit::AcceleratedDrawingArea::exitAcceleratedCompositingMode):
2389         * WebProcess/WebPage/DrawingArea.cpp:
2390         (WebKit::DrawingArea::create):
2391         * WebProcess/WebPage/DrawingAreaImpl.cpp:
2392         (WebKit::DrawingAreaImpl::DrawingAreaImpl):
2393         (WebKit::DrawingAreaImpl::setNeedsDisplay):
2394         (WebKit::DrawingAreaImpl::setNeedsDisplayInRect):
2395         (WebKit::DrawingAreaImpl::scroll):
2396         (WebKit::DrawingAreaImpl::forceRepaint):
2397         (WebKit::DrawingAreaImpl::setRootCompositingLayer):
2398         (WebKit::DrawingAreaImpl::updateBackingStoreState):
2399         (WebKit::DrawingAreaImpl::didUpdateBackingStoreState):
2400         (WebKit::DrawingAreaImpl::sendDidUpdateBackingStoreState):
2401         (WebKit::DrawingAreaImpl::suspendPainting):
2402         (WebKit::DrawingAreaImpl::enterAcceleratedCompositingMode):
2403         (WebKit::DrawingAreaImpl::~DrawingAreaImpl): Deleted.
2404         (WebKit::DrawingAreaImpl::mainFrameContentSizeChanged): Deleted.
2405         (WebKit::DrawingAreaImpl::updatePreferences): Deleted.
2406         (WebKit::DrawingAreaImpl::didUpdate): Deleted.
2407         (WebKit::DrawingAreaImpl::exitAcceleratedCompositingMode): Deleted.
2408         (WebKit::DrawingAreaImpl::scheduleDisplay): Deleted.
2409         (WebKit::DrawingAreaImpl::displayTimerFired): Deleted.
2410         (WebKit::DrawingAreaImpl::display): Deleted.
2411         (WebKit::shouldPaintBoundsRect): Deleted.
2412         (WebKit::DrawingAreaImpl::setNativeSurfaceHandleForCompositing): Deleted.
2413         * WebProcess/WebPage/DrawingAreaImpl.h:
2414
2415 2016-07-06  Youenn Fablet  <youenn@apple.com>
2416
2417         Refactor NetworkResourceLoadParameters
2418         https://bugs.webkit.org/show_bug.cgi?id=159402
2419
2420         Reviewed by Alex Christensen.
2421
2422         Making NetworkResourceLoadParameters derive from NetworkLoadParameters.
2423
2424         * CMakeLists.txt: Removed NetworkLoadParameters.cpp
2425         * NetworkProcess/NetworkLoadParameters.cpp: Deleted.
2426         * NetworkProcess/NetworkLoadParameters.h:
2427         * NetworkProcess/NetworkResourceLoadParameters.cpp:
2428         (WebKit::NetworkResourceLoadParameters::NetworkResourceLoadParameters): Deleted.
2429         * NetworkProcess/NetworkResourceLoadParameters.h: Making it derive from NetworkLoadParameters.
2430         * WebKit2.xcodeproj/project.pbxproj:
2431
2432 2016-07-05  Alex Christensen  <achristensen@webkit.org>
2433
2434         Actually persist changes to cookie accept policy.
2435         https://bugs.webkit.org/show_bug.cgi?id=159377
2436         <rdar://problem/22774152>
2437
2438         Reviewed by Alexey Proskuryakov.
2439
2440         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
2441         (WebKit::NetworkSession::NetworkSession):
2442         Added logging.
2443         * UIProcess/mac/WebCookieManagerProxyMac.mm:
2444         (WebKit::WebCookieManagerProxy::persistHTTPCookieAcceptPolicy):
2445         When we persist the cookie accept policy, we want to call _saveCookies to actually write the
2446         change to disk so that when we create a new process which reads from disk to determine its
2447         cookie accept policy, it will read the new cookie accept policy.  Before this patch it was
2448         reading the old one in some cases where the changes had not yet been persisted to disk.
2449
2450 2016-07-04  Carlos Garcia Campos  <cgarcia@igalia.com>
2451
2452         [Coordinated Graphics] Modernize and cleanup CompositingCoordinator
2453         https://bugs.webkit.org/show_bug.cgi?id=159212
2454
2455         Reviewed by Žan Doberšek.
2456
2457         Changes done:
2458
2459           - Use references instead of pointers when possible.
2460           - Add missing final/override keywords.
2461           - Reduce the use of PassRefPtr
2462           - Move member initializations to the declaration.
2463           - Use nullptr instead of 0.
2464           - Use HashMap::ensure() instead of complicated code with iterators.
2465           - Avoid heap allocation when possible.
2466
2467         * Shared/CoordinatedGraphics/WebCoordinatedSurface.cpp:
2468         (WebKit::WebCoordinatedSurface::paintToSurface):
2469         * Shared/CoordinatedGraphics/WebCoordinatedSurface.h:
2470         * Shared/CoordinatedGraphics/threadedcompositor/ThreadSafeCoordinatedSurface.cpp:
2471         (WebKit::ThreadSafeCoordinatedSurface::paintToSurface):
2472         * Shared/CoordinatedGraphics/threadedcompositor/ThreadSafeCoordinatedSurface.h:
2473         * WebProcess/WebPage/CoordinatedGraphics/AreaAllocator.cpp:
2474         (WebKit::GeneralAreaAllocator::expand):
2475         (WebKit::GeneralAreaAllocator::splitNode):
2476         (WebKit::GeneralAreaAllocator::release):
2477         (WebKit::GeneralAreaAllocator::GeneralAreaAllocator): Deleted.
2478         * WebProcess/WebPage/CoordinatedGraphics/AreaAllocator.h:
2479         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
2480         (WebKit::CompositingCoordinator::CompositingCoordinator):
2481         (WebKit::CompositingCoordinator::flushPendingLayerChanges):
2482         (WebKit::CompositingCoordinator::createImageBackingIfNeeded):
2483         (WebKit::CompositingCoordinator::updateImageBacking):
2484         (WebKit::CompositingCoordinator::notifyFlushRequired):
2485         (WebKit::CompositingCoordinator::paintContents):
2486         (WebKit::CompositingCoordinator::createUpdateAtlas):
2487         (WebKit::CompositingCoordinator::commitScrollOffset):
2488         (WebKit::CompositingCoordinator::paintToSurface):
2489         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h:
2490         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
2491         (WebKit::CoordinatedLayerTreeHost::CoordinatedLayerTreeHost):
2492         (WebKit::CoordinatedLayerTreeHost::setViewOverlayRootLayer):
2493         (WebKit::CoordinatedLayerTreeHost::setRootCompositingLayer):
2494         (WebKit::CoordinatedLayerTreeHost::invalidate):
2495         (WebKit::CoordinatedLayerTreeHost::forceRepaint):
2496         (WebKit::CoordinatedLayerTreeHost::sizeDidChange):
2497         (WebKit::CoordinatedLayerTreeHost::setVisibleContentsRect):
2498         (WebKit::CoordinatedLayerTreeHost::renderNextFrame):
2499         (WebKit::CoordinatedLayerTreeHost::purgeBackingStores):
2500         (WebKit::CoordinatedLayerTreeHost::layerFlushTimerFired):
2501         (WebKit::CoordinatedLayerTreeHost::deviceOrPageScaleFactorChanged):
2502         (WebKit::CoordinatedLayerTreeHost::graphicsLayerFactory):
2503         (WebKit::CoordinatedLayerTreeHost::scheduleAnimation):
2504         (WebKit::CoordinatedLayerTreeHost::commitScrollOffset):
2505         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h:
2506         * WebProcess/WebPage/CoordinatedGraphics/UpdateAtlas.cpp:
2507         (WebKit::UpdateAtlas::UpdateAtlas):
2508         (WebKit::UpdateAtlas::~UpdateAtlas):
2509         (WebKit::UpdateAtlas::buildLayoutIfNeeded):
2510         (WebKit::UpdateAtlas::paintOnAvailableBuffer):
2511         (WebKit::UpdateAtlasSurfaceClient::UpdateAtlasSurfaceClient): Deleted.
2512         * WebProcess/WebPage/CoordinatedGraphics/UpdateAtlas.h:
2513
2514 2016-07-04  Brady Eidson  <beidson@apple.com>
2515
2516         WebProcesses don't handle DatabaseProcess going away uncleanly..
2517         https://bugs.webkit.org/show_bug.cgi?id=159371
2518
2519         Reviewed by Alex Christensen.
2520
2521         * UIProcess/WebProcessPool.cpp:
2522         (WebKit::WebProcessPool::terminateDatabaseProcess): Deleted.
2523
2524         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
2525         (WebKit::WebIDBConnectionToServer::connectionToServerLost):
2526         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h:
2527
2528         * WebProcess/Databases/WebToDatabaseProcessConnection.cpp:
2529         (WebKit::WebToDatabaseProcessConnection::didReceiveMessage):
2530         (WebKit::WebToDatabaseProcessConnection::didClose): Notify each connection
2531           that the database server connection dropped.
2532
2533 2016-07-04  Fujii Hironori  <Hironori.Fujii@sony.com>
2534
2535         [GTK] Null WebCore::Range dereference in WebEditorClient::updateGlobalSelection
2536         https://bugs.webkit.org/show_bug.cgi?id=159341
2537
2538         Reviewed by Carlos Garcia Campos.
2539
2540         FrameSelection::toNormalizedRange() can return null. Null check is
2541         needed.
2542
2543         Tests:
2544             editing/input/set-value-on-input-and-delete.html
2545             editing/selection/selection-in-iframe-removed-crash.html
2546             imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/sizes/parse-a-sizes-attribute.html
2547             imported/w3c/web-platform-tests/html/semantics/forms/textfieldselection/selection-after-content-change.html
2548             imported/w3c/web-platform-tests/html/semantics/forms/textfieldselection/selection-not-application-textarea.html
2549             imported/w3c/web-platform-tests/html/semantics/forms/textfieldselection/selection-not-application.html
2550
2551         * WebProcess/WebCoreSupport/gtk/WebEditorClientGtk.cpp:
2552         (WebKit::WebEditorClient::updateGlobalSelection): Do not update
2553         global selection if FrameSelection::toNormalizedRange() returns
2554         null.
2555
2556 2016-07-04  Fujii Hironori  <Hironori.Fujii@sony.com>
2557
2558         [GTK] ASSERTION_FAILED: m_key != PTHREAD_KEYS_MAX when defining WEBKIT2_PAUSE_WEB_PROCESS_ON_LAUNCH
2559         https://bugs.webkit.org/show_bug.cgi?id=158149
2560
2561         Reviewed by Carlos Garcia Campos.
2562
2563         WTF::sleep can not be used at the beginning of web process because
2564         WTF is not initialized at the moment yet.
2565
2566         * WebProcess/gtk/WebProcessMainGtk.cpp: Use g_usleep instead of WTF::sleep.
2567
2568 2016-07-03  Dan Bernstein  <mitz@apple.com>
2569
2570         Follow-up to r202789.
2571
2572         Reviewed by Sam Weinig.
2573
2574         Ensure that API that isn’t available at all on a platform is declared under an appropriate
2575         TARGET_OS_* conditional.
2576
2577         * Shared/API/Cocoa/_WKHitTestResult.h:
2578         * Shared/API/Cocoa/_WKHitTestResult.mm:
2579         * Shared/API/Cocoa/_WKHitTestResultInternal.h:
2580         * UIProcess/API/Cocoa/WKOpenPanelParameters.h:
2581         * UIProcess/API/Cocoa/WKOpenPanelParameters.mm:
2582         * UIProcess/API/Cocoa/WKOpenPanelParametersInternal.h:
2583         * UIProcess/API/Cocoa/WKPreviewActionItemIdentifiers.h:
2584         * UIProcess/API/Cocoa/WKPreviewActionItemIdentifiers.mm:
2585         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2586
2587 2016-07-03  Dan Bernstein  <mitz@apple.com>
2588
2589         [Cocoa] Adopt modern API availability macros
2590         https://bugs.webkit.org/show_bug.cgi?id=159378
2591
2592         Reviewed by Sam Weinig.
2593
2594         iOS 10 and macOS Sierra introduce new macros for declaring API availability, defined in
2595         CFAvailability.h, including API_AVAILABLE, API_DEPRECATED, and
2596         API_DEPRECATED_WITH_REPLACEMENT. Rather than having positional parameters for macOS and iOS
2597         versions, the new macros take a variable number of function-like parameters, where the
2598         function specifies the platform to which it applies.
2599
2600         To have WebKit2’s postprocessed headers use the new macros, we make the following changes:
2601
2602         - Replace instances of WK_AVAILABLE(_mac, _ios) with WK_API_AVAILABLE(macosx(_mac), ios(_ios)),
2603           eliding a platform if its current availability is NA.
2604         - Change instances of WK_CLASS_AVAILABLE(_mac, _ios) to
2605           WK_CLASS_AVAILABLE(macosx(_mac), ios(_ios)), eliding a platform if its current
2606           availability is NA.
2607         - Replace instances of WK_DEPRECATED(_macIntro, _macDep, _iosIntro, _iosDep, ...) with
2608           WK_API_DEPRECATED_WITH_REPLACEMENT(_replacement, macosx(_macIntro, _macDep), ios(_iosIntro, _iosDep))
2609           when there is a one-for-one replacement, and with
2610           WK_API_DEPRECATED(_message, macosx(_macIntro, _macDep), ios(_iosIntro, _iosDep)) when the
2611           replacement isn’t one-for-one. Again, if the API doesn’t apply to a platform, then it’s
2612           elided.
2613         - Replace instances of WK_CLASS_DEPRECATED with WK_CLASS_DEPRECATED_WITH_REPLACEMENT,
2614           following the same rules.
2615         - Replace instances of the WK_ENUM_* macros with corresponding WK_API_* macros, now that
2616           all supported compilers support availability attributes on enum values.
2617
2618         * Configurations/WebKit.xcconfig: Disable header postprocessing when building for iOS 9.x,
2619           which doesn’t have the new macros.
2620
2621         * mac/postprocess-framework-headers.sh: Handle the new WK_* macros: WK_API_AVAILABLE becomes
2622           API_AVAILABLE; WK_API_DEPRECATED(_WITH_REPLACEMENT) become API_DEPRECATED(_WITH_REPLACEMENT);
2623           WK_CLASS_AVAILABLE and WK_CLASS_DEPRECATED(_WITH_REPLACEMENT) change to the corresponding
2624           API_ macros, prefixed with WK_EXTERN.
2625         * Shared/API/Cocoa/WKFoundation.h: When header postprocessing is disabled, provide
2626           definitions of the new WK_* macros we use.
2627
2628         * UIProcess/API/Cocoa/WKWebViewConfiguration.h: In addition to the above, changed one
2629           instance of (iOS) 10_0 to WK_IOS_TBA.
2630
2631         Made the above changes in the following headers:
2632
2633         * Shared/API/Cocoa/WKBrowsingContextHandle.h:
2634         * Shared/API/Cocoa/_WKFrameHandle.h:
2635         * Shared/API/Cocoa/_WKHitTestResult.h:
2636         * Shared/API/Cocoa/_WKRemoteObjectInterface.h:
2637         * Shared/API/Cocoa/_WKRemoteObjectRegistry.h:
2638         * Shared/API/Cocoa/_WKRenderingProgressEvents.h:
2639         * Shared/API/Cocoa/_WKSameDocumentNavigationType.h:
2640         * UIProcess/API/Cocoa/WKBackForwardList.h:
2641         * UIProcess/API/Cocoa/WKBackForwardListItem.h:
2642         * UIProcess/API/Cocoa/WKBrowsingContextController.h:
2643         * UIProcess/API/Cocoa/WKBrowsingContextGroup.h:
2644         * UIProcess/API/Cocoa/WKConnection.h:
2645         * UIProcess/API/Cocoa/WKError.h:
2646         * UIProcess/API/Cocoa/WKErrorPrivate.h:
2647         * UIProcess/API/Cocoa/WKFrameInfo.h:
2648         * UIProcess/API/Cocoa/WKFrameInfoPrivate.h:
2649         * UIProcess/API/Cocoa/WKMenuItemIdentifiersPrivate.h:
2650         * UIProcess/API/Cocoa/WKNavigation.h:
2651         * UIProcess/API/Cocoa/WKNavigationAction.h:
2652         * UIProcess/API/Cocoa/WKNavigationActionPrivate.h:
2653         * UIProcess/API/Cocoa/WKNavigationData.h:
2654         * UIProcess/API/Cocoa/WKNavigationDelegate.h:
2655         * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
2656         * UIProcess/API/Cocoa/WKNavigationResponse.h:
2657         * UIProcess/API/Cocoa/WKOpenPanelParameters.h:
2658         * UIProcess/API/Cocoa/WKPreferences.h:
2659         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
2660         * UIProcess/API/Cocoa/WKPreviewActionItem.h:
2661         * UIProcess/API/Cocoa/WKPreviewActionItemIdentifiers.h:
2662         * UIProcess/API/Cocoa/WKPreviewElementInfo.h:
2663         * UIProcess/API/Cocoa/WKProcessGroup.h:
2664         * UIProcess/API/Cocoa/WKProcessPool.h:
2665         * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
2666         * UIProcess/API/Cocoa/WKScriptMessage.h:
2667         * UIProcess/API/Cocoa/WKSecurityOrigin.h:
2668         * UIProcess/API/Cocoa/WKTypeRefWrapper.h:
2669         * UIProcess/API/Cocoa/WKUIDelegate.h:
2670         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
2671         * UIProcess/API/Cocoa/WKUserContentController.h:
2672         * UIProcess/API/Cocoa/WKUserContentControllerPrivate.h:
2673         * UIProcess/API/Cocoa/WKUserScript.h:
2674         * UIProcess/API/Cocoa/WKUserScriptPrivate.h:
2675         * UIProcess/API/Cocoa/WKViewPrivate.h:
2676         * UIProcess/API/Cocoa/WKWebView.h:
2677         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
2678         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2679         * UIProcess/API/Cocoa/WKWebsiteDataRecord.h:
2680         * UIProcess/API/Cocoa/WKWebsiteDataRecordPrivate.h:
2681         * UIProcess/API/Cocoa/WKWebsiteDataStore.h:
2682         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
2683         * UIProcess/API/Cocoa/WKWindowFeatures.h:
2684         * UIProcess/API/Cocoa/_WKActivatedElementInfo.h:
2685         * UIProcess/API/Cocoa/_WKAutomationSession.h:
2686         * UIProcess/API/Cocoa/_WKContextMenuElementInfo.h:
2687         * UIProcess/API/Cocoa/_WKDiagnosticLoggingDelegate.h:
2688         * UIProcess/API/Cocoa/_WKDownload.h:
2689         * UIProcess/API/Cocoa/_WKElementAction.h:
2690         * UIProcess/API/Cocoa/_WKExperimentalFeature.h:
2691         * UIProcess/API/Cocoa/_WKFindOptions.h:
2692         * UIProcess/API/Cocoa/_WKFormInputSession.h:
2693         * UIProcess/API/Cocoa/_WKInputDelegate.h:
2694         * UIProcess/API/Cocoa/_WKLayoutMode.h:
2695         * UIProcess/API/Cocoa/_WKOverlayScrollbarStyle.h:
2696         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
2697         * UIProcess/API/Cocoa/_WKSessionState.h:
2698         * UIProcess/API/Cocoa/_WKThumbnailView.h:
2699         * UIProcess/API/Cocoa/_WKUserContentExtensionStore.h:
2700         * UIProcess/API/Cocoa/_WKUserContentFilter.h:
2701         * UIProcess/API/Cocoa/_WKUserContentWorld.h:
2702         * UIProcess/API/Cocoa/_WKUserStyleSheet.h:
2703         * UIProcess/API/Cocoa/_WKVisitedLinkProvider.h:
2704         * UIProcess/API/Cocoa/_WKVisitedLinkStore.h:
2705         * UIProcess/API/Cocoa/_WKWebsiteDataRecord.h:
2706         * UIProcess/API/Cocoa/_WKWebsiteDataSize.h:
2707         * UIProcess/API/Cocoa/_WKWebsiteDataStore.h:
2708         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFormDelegatePrivate.h:
2709         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFrame.h:
2710         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInHitTestResult.h:
2711         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.h:
2712         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInPageGroup.h:
2713         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInScriptWorld.h:
2714         * WebProcess/InjectedBundle/API/mac/WKDOMDocument.h:
2715         * WebProcess/InjectedBundle/API/mac/WKDOMElement.h:
2716         * WebProcess/InjectedBundle/API/mac/WKDOMNode.h:
2717         * WebProcess/InjectedBundle/API/mac/WKDOMRange.h:
2718         * WebProcess/InjectedBundle/API/mac/WKDOMText.h:
2719         * WebProcess/InjectedBundle/API/mac/WKDOMTextIterator.h:
2720         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugIn.h:
2721         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.h:
2722
2723 2016-07-01  Hunseop Jeong  <hs85.jeong@samsung.com>
2724
2725         [EFL] Many layout tests are timeout after r202532.
2726         https://bugs.webkit.org/show_bug.cgi?id=159337
2727
2728         Reviewed by Gyuyoung Kim.
2729
2730         WebPageProxy::forceRepaint() wait for the next commit from the web process
2731         after r202532, but WebPageProxy::callAfterNextPresentationUpdate() is not 
2732         implemented in CoordinatedDrawingAreaProxy.
2733
2734         * UIProcess/CoordinatedGraphics/CoordinatedDrawingAreaProxy.cpp:
2735         (WebKit::CoordinatedDrawingAreaProxy::contentsRect):
2736         (WebKit::CoordinatedDrawingAreaProxy::dispatchAfterEnsuringDrawing):
2737         (WebKit::CoordinatedDrawingAreaProxy::sizeDidChange):
2738         * UIProcess/CoordinatedGraphics/CoordinatedDrawingAreaProxy.h:
2739         (WebKit::CoordinatedDrawingAreaProxy::page):
2740
2741 2016-07-01  Myles C. Maxfield  <mmaxfield@apple.com>
2742
2743         REGRESSION(r189668): Notification tests are flakey
2744         https://bugs.webkit.org/show_bug.cgi?id=159375
2745         <rdar://problem/22760990>
2746
2747         Reviewed by Alexey Proskuryakov.
2748
2749         Implement WKNotificationManagerGetLocalID(). For more information, see the entry in Tools/ChangeLog.
2750
2751         * UIProcess/API/C/WKNotificationManager.cpp:
2752         (WKNotificationManagerGetLocalID):
2753         * UIProcess/Notifications/WebNotificationManagerProxy.cpp:
2754         (WebKit::WebNotificationManagerProxy::notificationLocalIDForTesting):
2755         * UIProcess/Notifications/WebNotificationManagerProxy.h:
2756         * WebKit2.xcodeproj/project.pbxproj:
2757
2758 2016-07-01  Jer Noble  <jer.noble@apple.com>
2759
2760         REGRESSION(r201405): Fullscreen video no longer enters low-power mode
2761         https://bugs.webkit.org/show_bug.cgi?id=159220
2762         <rdar://problem/26701056>
2763
2764         Reviewed by Beth Dakin.
2765
2766         In r201405, we removed the call to setTopContentInset(0) to avoid a flash
2767         during repainting where the WebProcess still thought it had an inset and
2768         the UIProcess did not, but the >0 inset breaks low power video playback 
2769         in fullscreen. So, instead, fix the repaint issue by setting a CALayer
2770         fence which makes sure both the UIProcess and WebProcess paint simultaneously
2771         after resizing and changing the top content inset.
2772
2773         This requires a new message from WebPageProxy -> WebPage: setTopContentInsetFenced().
2774
2775         * UIProcess/WebPageProxy.cpp:
2776         (WebKit::WebPageProxy::setTopContentInset):
2777         * UIProcess/mac/WKFullScreenWindowController.h:
2778         * UIProcess/mac/WKFullScreenWindowController.mm:
2779         (-[WKFullScreenWindowController enterFullScreen:]):
2780         (-[WKFullScreenWindowController finishedEnterFullScreenAnimation:]):
2781         * WebProcess/WebPage/WebPage.cpp:
2782         (WebKit::WebPage::setTopContentInsetFenced):
2783         * WebProcess/WebPage/WebPage.h:
2784         * WebProcess/WebPage/WebPage.messages.in:
2785
2786 2016-07-01  Dan Bernstein  <mitz@apple.com>
2787
2788         [Mac] Get rid of support for old SDKs
2789         https://bugs.webkit.org/show_bug.cgi?id=159369
2790
2791         Reviewed by Anders Carlsson.
2792
2793         * Shared/API/Cocoa/WKFoundation.h: Removed the WK_ARRAY, WK_DICTIONARY, and WK_SET macros,
2794           which were only needed for pre-10.11 SDKs.
2795
2796         * Shared/mac/WebEventFactory.mm:
2797         (WebKit::mouseButtonForEvent): Removed checking for pre-10.10.3 SDKs.
2798         (WebKit::globalPointForEvent): Ditto.
2799         (WebKit::pointForEvent): Ditto.
2800         (WebKit::WebEventFactory::createWebMouseEvent): Ditto.
2801
2802         * UIProcess/API/Cocoa/WKBackForwardList.h: Replaced WK_ARRAY(...) with NSArray<...>.
2803
2804         * UIProcess/API/Cocoa/WKPreferences.mm: Ditto.
2805         (-[WKPreferences _setFixedPitchFontFamily:]):
2806         (+[WKPreferences _experimentalFeatures]):
2807         * UIProcess/API/Cocoa/WKPreferencesPrivate.h: Ditto.
2808
2809         * UIProcess/API/Cocoa/WKUIDelegate.h: Ditto.
2810         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: Ditto.
2811
2812         * UIProcess/API/Cocoa/WKUserContentController.h: Ditto.
2813         * UIProcess/API/Cocoa/WKUserContentControllerPrivate.h: Ditto.
2814
2815         * UIProcess/API/Cocoa/WKUserScriptPrivate.h: Ditto.
2816
2817         * UIProcess/API/Cocoa/WKWebsiteDataRecord.h: Replaced WK_SET(...) with NSSet<...>.
2818         * UIProcess/API/Cocoa/WKWebsiteDataStore.h: Ditto.
2819         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm: Ditto.
2820         (-[WKWebsiteDataStore fetchDataRecordsOfTypes:completionHandler:]):
2821         (-[WKWebsiteDataStore _fetchDataRecordsOfTypes:withOptions:completionHandler:]):
2822
2823         * UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h: Ditto.
2824
2825         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h: Replaced WK_ARRAY(...) with NSArray<...>.
2826
2827         * UIProcess/API/Cocoa/_WKUserStyleSheet.h: Ditto.
2828         * UIProcess/API/Cocoa/_WKUserStyleSheet.mm: Ditto.
2829         (-[_WKUserStyleSheet initWithSource:forMainFrameOnly:]):
2830         (-[_WKUserStyleSheet initWithSource:forMainFrameOnly:legacyWhitelist:legacyBlacklist:userContentWorld:]):
2831         (-[_WKUserStyleSheet initWithSource:forMainFrameOnly:legacyWhitelist:legacyBlacklist:baseURL:userContentWorld:]):
2832
2833         * UIProcess/API/Cocoa/_WKWebsiteDataSize.h: Replaced WK_SET(...) with NSSet<...>.
2834
2835         * UIProcess/Cocoa/WebViewImpl.mm:
2836         (WebKit::WebViewImpl::pressureChangeWithEvent): Removed checking for pre-10.10.3 SDKs.
2837
2838         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFrame.h: Replaced WK_ARRAY(...) with
2839           NSArray<...>.
2840
2841         * mac/postprocess-framework-headers.sh: Removed sed rules for WK_ARRAY, WK_DICTIONARY and
2842           WK_SET.
2843
2844 2016-07-01  Chris Dumez  <cdumez@apple.com>
2845
2846         [iOS] Possible null Range dereference under computeAutocorrectionContext()
2847         https://bugs.webkit.org/show_bug.cgi?id=159328
2848         <rdar://problem/26766720>
2849
2850         Reviewed by Benjamin Poulain.
2851
2852         The code in computeAutocorrectionContext() was checking Editor::hasComposition()
2853         before dereferencing Editor::compositionRange(). However, compositionRange()
2854         can also return null in other cases (e.g. compositionStart == compositionEnd).
2855
2856         Drop the check for hasComposition() and do a null check on the value returned
2857         by compositionRange() instead.
2858
2859         * WebProcess/WebPage/ios/WebPageIOS.mm:
2860         (WebKit::computeAutocorrectionContext):
2861
2862 2016-07-01  Brent Fulgham  <bfulgham@apple.com>
2863
2864         Prevent crash when attempting to copy an image
2865         https://bugs.webkit.org/show_bug.cgi?id=159288
2866         <rdar://problem/23507828>
2867
2868         Reviewed by Brady Eidson.
2869         
2870         WebKit could crash if the HTMLImageElement had a null cachedImage member.
2871         A little investigation showed that the URL we retrieve from the cachedImage
2872         is never used, so rather than adding a null check, let's just pass a
2873         default argument. The actual URL gets read from elsewhere in the pasteboard
2874         processing code.
2875
2876         * WebProcess/WebPage/ios/WebPageIOS.mm:
2877         (WebKit::WebPage::performActionOnElement): Don't bother passing the
2878         unused URL argument to the pasteboard method.
2879
2880 2016-07-01  Brady Eidson  <beidson@apple.com>
2881
2882         Blob content type not preserved when retrieving blobs from IndexedDB.
2883         <rdar://problem/27057357> and https://bugs.webkit.org/show_bug.cgi?id=159360
2884
2885         Reviewed by Alex Christensen.
2886
2887         * NetworkProcess/FileAPI/NetworkBlobRegistry.cpp:
2888         (WebKit::NetworkBlobRegistry::registerBlobURLOptionallyFileBacked):
2889         * NetworkProcess/FileAPI/NetworkBlobRegistry.h:
2890
2891         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
2892         (WebKit::NetworkConnectionToWebProcess::registerBlobURLOptionallyFileBacked):
2893         * NetworkProcess/NetworkConnectionToWebProcess.h:
2894         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
2895
2896         * WebProcess/FileAPI/BlobRegistryProxy.cpp:
2897         (WebKit::BlobRegistryProxy::registerBlobURLOptionallyFileBacked):
2898         * WebProcess/FileAPI/BlobRegistryProxy.h:
2899
2900 2016-07-01  Dan Bernstein  <mitz@apple.com>
2901
2902         [Cocoa] Get rid of WK_NULLABLE_SPECIFIER now that all supported compilers understand _Nullable
2903         https://bugs.webkit.org/show_bug.cgi?id=159361
2904
2905         Reviewed by Anders Carlsson.
2906
2907         * Shared/API/Cocoa/WKFoundation.h:
2908         * UIProcess/API/Cocoa/WKNavigationDelegate.h:
2909         * UIProcess/API/Cocoa/WKUIDelegate.h:
2910         * UIProcess/API/Cocoa/WKWebView.h:
2911         * mac/postprocess-framework-headers.sh:
2912
2913 2016-07-01  Youenn Fablet  <youennf@gmail.com>
2914
2915         Add a runtime flag for DOM iterators
2916         https://bugs.webkit.org/show_bug.cgi?id=159300
2917
2918         Reviewed by Alex Christensen.
2919
2920         * Shared/WebPreferencesDefinitions.h:
2921         * WebProcess/InjectedBundle/InjectedBundle.cpp:
2922         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
2923         * WebProcess/WebPage/WebPage.cpp:
2924         (WebKit::WebPage::updatePreferences):
2925
2926 2016-07-01  Andreas Kling  <akling@apple.com>
2927
2928         [Mac] Get rid of the old timey rubber-banding linen pattern.
2929         <https://webkit.org/b/159329>
2930
2931         Reviewed by Benjamin Poulain.
2932
2933         * Shared/mac/RemoteLayerTreePropertyApplier.mm:
2934         (WebKit::updateCustomAppearance):
2935
2936 2016-06-30  Tina Liu  <iting_liu@apple.com>
2937
2938         Add SPI to allow restoring session state without navigation in WKPage
2939         https://bugs.webkit.org/show_bug.cgi?id=159326
2940
2941         Reviewed by Brady Eidson.
2942
2943         * UIProcess/API/C/WKPage.cpp:
2944         (restoreFromSessionState):
2945         Added a helper function that takes a bool parameter to specify whether
2946         to navigate or not when restoring from the session state.
2947         (WKPageRestoreFromSessionState):
2948         Calling restoreFromSessionState, passing navigate = true.
2949         (WKPageRestoreFromSessionStateWithoutNavigation):
2950         Ditto but passing navigate = false.
2951         * UIProcess/API/C/WKPagePrivate.h:
2952
2953 2016-06-30  Chris Dumez  <cdumez@apple.com>
2954
2955         [iOS] WebContent processes do not exit promptly
2956         https://bugs.webkit.org/show_bug.cgi?id=159301
2957         <rdar://problem/26965488>
2958
2959         Reviewed by Anders Carlsson.
2960
2961         WebContent processes do not exit promptly, they hang around for 10 seconds
2962         until the watchdog forcefully calls exit().
2963
2964         This patch addresses the issue by asking XPC to exit when clean. It also
2965         fixes 2 XPC transactions that were leaking so that XPC can become clean.
2966
2967         * DatabaseProcess/EntryPoint/mac/XPCService/DatabaseServiceEntryPoint.mm:
2968         (DatabaseServiceInitializer):
2969         * NetworkProcess/EntryPoint/mac/XPCService/NetworkServiceEntryPoint.mm:
2970         (NetworkServiceInitializer):
2971         * PluginProcess/EntryPoint/mac/XPCService/PluginServiceEntryPoint.mm:
2972         (PluginServiceInitializer):
2973         * WebProcess/EntryPoint/mac/XPCService/WebContentServiceEntryPoint.mm:
2974         (WebContentServiceInitializer):
2975         Add extra priorityBoostMessage parameter which is then passed along to
2976         ChildProcess via initialization parameters. ChildProcess is now in
2977         charge of retaining the message for as long as it needs the priority
2978         boost. In particular, ChildProcess now takes care of releasing the
2979         boost message before existing to avoid leaking an XPC transaction.
2980
2981         * Shared/ChildProcess.cpp:
2982         (WebKit::ChildProcess::initialize):
2983         Retain priorityBoostMessage as a data member.
2984
2985         (WebKit::ChildProcess::stopRunLoop):
2986         (WebKit::ChildProcess::platformStopRunLoop):
2987         * Shared/ios/ChildProcessIOS.mm:
2988         (WebKit::ChildProcess::platformStopRunLoop):
2989         On iOS, call XPCServiceExit() to exit instead of RunLoop::main().stop()
2990         which did not work.
2991
2992         * Shared/ChildProcess.h:
2993         * Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.h:
2994         (WebKit::XPCServiceInitializer):
2995         Set priorityBoostMessage on ChildProcessInitializationParameters.
2996
2997         * Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.mm:
2998         (WebKit::XPCServiceExit):
2999         Add XPCServiceExit() function which destroys the priority boost
3000         message, calls xpc_transaction_end() to balance the
3001         xpc_transaction_begin() in XPCServiceInitializer() and then call
3002         xpc_transaction_exit_clean() to ask XPC to exit when clean.
3003
3004         * Shared/EntryPointUtilities/mac/XPCService/XPCServiceMain.mm:
3005         (WebKit::XPCServiceEventHandler):
3006         Leaking the "pre-bootstrap" event for priority boosting would cause us to
3007         leak an XPC transaction, which would prevent XPC from becoming clean and
3008         exiting. Instead, we now pass it along to the initialization function.
3009         We then pass it to ChildProcess which manages the lifetime of this message
3010         instead of leaking it.
3011
3012 2016-06-30  Brian Burg  <bburg@apple.com>
3013
3014         REGRESSION(r202329): WebInspectorProxy's WKPagePolicyClient callbacks are not being called
3015         https://bugs.webkit.org/show_bug.cgi?id=159308
3016         <rdar://problem/27111764>
3017
3018         Reviewed by Tim Horton.
3019
3020         Adopt WKPageNavigationClient and ditch WKPolicyClient and WKPageLoaderClient.
3021         After r202329, it's not possible to set a WKPolicyClient for a WKPage/WebPageProxy that backs a WKWebView.
3022
3023         * UIProcess/WebInspectorProxy.cpp:
3024         (WebKit::isMainOrTestInspectorPage): Take a WebCore::ResourceRequest.
3025         (WebKit::processDidCrash): Deleted.
3026         (WebKit::webProcessDidCrash): Rename to match new client callback name.
3027         (WebKit::decidePolicyForNavigationAction): Rework this to take new argument types.
3028         (WebKit::WebInspectorProxy::eagerlyCreateInspectorPage):
3029         Install a WKPageNavigationClient. 
3030
3031 2016-06-30  Chris Dumez  <cdumez@apple.com>
3032
3033         [iOS] Process suspension is prevented for 30 seconds after closing a tab
3034         https://bugs.webkit.org/show_bug.cgi?id=159280
3035         <rdar://problem/27014867>
3036
3037         Reviewed by Gavin Barraclough.
3038
3039         When closing a tab, ConnectionTerminationWatchdog takes a background
3040         assertion on behalf of the WebContent process and only releases it
3041         after 30 seconds, allowing for the WebContent process to exit cleanly
3042         without worrying about getting suspended too early.
3043
3044         However, the child process normally exits much sooner than this and
3045         we end up holding a process assertion for no reason for a full 30
3046         seconds anyway. This patch addresses the issue by registering an
3047         invalidation handler with the BKSProcessAssertion and releasing our
3048         our assertion in such case. The invalidation handler gets called
3049         as soon as the child process exits.
3050
3051         * Platform/spi/ios/AssertionServicesSPI.h:
3052         * UIProcess/ProcessAssertion.cpp:
3053         (WebKit::ProcessAssertion::ProcessAssertion):
3054         * UIProcess/ProcessAssertion.h:
3055         (WebKit::ProcessAssertion::ProcessAssertion):
3056         (WebKit::ProcessAssertion::validity):
3057         * UIProcess/ios/ProcessAssertionIOS.mm:
3058         (WebKit::ProcessAssertion::ProcessAssertion):
3059         (WebKit::ProcessAssertion::~ProcessAssertion):
3060         (WebKit::ProcessAndUIAssertion::updateRunInBackgroundCount):
3061         (WebKit::ProcessAndUIAssertion::ProcessAndUIAssertion):
3062         (WebKit::ProcessAssertion::setState): Deleted.
3063
3064 2016-06-30  Tim Horton  <timothy_horton@apple.com>
3065
3066         Keep track of when a WKWebView is blank before the initial non-empty layout
3067         https://bugs.webkit.org/show_bug.cgi?id=159217
3068         <rdar://problem/26071766>
3069
3070         Reviewed by Beth Dakin.
3071
3072         * UIProcess/API/Cocoa/WKWebView.mm:
3073         (-[WKWebView _initializeWithConfiguration:]):
3074         (-[WKWebView _setIsBlankBeforeFirstNonEmptyLayout:]):
3075         (-[WKWebView _didFirstVisuallyNonEmptyLayoutForMainFrame]):
3076         * UIProcess/API/Cocoa/WKWebViewInternal.h:
3077         * UIProcess/ios/PageClientImplIOS.mm:
3078         (WebKit::PageClientImpl::didFirstVisuallyNonEmptyLayoutForMainFrame):
3079
3080 2016-06-29  Gavin Barraclough  <barraclough@apple.com>
3081
3082         Cleanup ProcessAssertion RunInBackground management
3083         https://bugs.webkit.org/show_bug.cgi?id=159284
3084
3085         Reviewed by Chris Dumez.
3086
3087         Factor out code that handles taking a background assertion on the UI app into
3088         ProcessAndUIAssertion::updateRunInBackgroundCount helper.
3089
3090         This patch just cleanup to enable a futher fix.
3091
3092         * UIProcess/ProcessAssertion.h:
3093         (WebKit::ProcessAssertion::state):
3094             - Added ProcessAndUIAssertion::updateRunInBackgroundCount
3095             - Added ProcessAndUIAssertion::m_isHoldingBackgroundAssertionOnApp
3096         * UIProcess/ios/ProcessAssertionIOS.mm:
3097         (WebKit::ProcessAndUIAssertion::updateRunInBackgroundCount):
3098             - helper to manage calls to incrementNeedsToRunInBackgroundCount/decrementNeedsToRunInBackgroundCount
3099         (WebKit::ProcessAndUIAssertion::ProcessAndUIAssertion):
3100             - call updateRunInBackgroundCount
3101         (WebKit::ProcessAndUIAssertion::~ProcessAndUIAssertion):
3102             changed to use m_isHoldingBackgroundAssertionOnApp
3103         (WebKit::ProcessAndUIAssertion::setState):
3104             - call updateRunInBackgroundCount
3105
3106 2016-06-30  Carlos Garcia Campos  <cgarcia@igalia.com>
3107
3108         [Coordinated Graphics] Move CompositingCoordinator from platform to WebKit2 layer
3109         https://bugs.webkit.org/show_bug.cgi?id=159209
3110
3111         Reviewed by Žan Doberšek.
3112
3113         Move CompositingCoordinator and its helper classes to the WebKit2 layer.
3114
3115         * PlatformEfl.cmake:
3116         * PlatformGTK.cmake:
3117         * WebProcess/WebPage/CoordinatedGraphics/AreaAllocator.cpp: Renamed from Source/WebCore/platform/graphics/texmap/coordinated/AreaAllocator.cpp.
3118         (WebKit::AreaAllocator::AreaAllocator):
3119         (WebKit::AreaAllocator::~AreaAllocator):
3120         (WebKit::AreaAllocator::expand):
3121         (WebKit::AreaAllocator::expandBy):
3122         (WebKit::AreaAllocator::release):
3123         (WebKit::AreaAllocator::overhead):
3124         (WebKit::AreaAllocator::roundAllocation):
3125         (WebKit::GeneralAreaAllocator::GeneralAreaAllocator):
3126         (WebKit::GeneralAreaAllocator::~GeneralAreaAllocator):
3127         (WebKit::GeneralAreaAllocator::freeNode):
3128         (WebKit::GeneralAreaAllocator::expand):
3129         (WebKit::fitsWithin):
3130         (WebKit::GeneralAreaAllocator::allocate):
3131         (WebKit::GeneralAreaAllocator::allocateFromNode):
3132         (WebKit::GeneralAreaAllocator::splitNode):
3133         (WebKit::GeneralAreaAllocator::updateLargestFree):
3134         (WebKit::GeneralAreaAllocator::release):
3135         (WebKit::GeneralAreaAllocator::overhead):
3136         * WebProcess/WebPage/CoordinatedGraphics/AreaAllocator.h: Renamed from Source/WebCore/platform/graphics/texmap/coordinated/AreaAllocator.h.
3137         (WebKit::nextPowerOfTwo):
3138         (WebKit::AreaAllocator::size):
3139         (WebKit::AreaAllocator::minimumAllocation):
3140         (WebKit::AreaAllocator::setMinimumAllocation):
3141         (WebKit::AreaAllocator::margin):
3142         (WebKit::AreaAllocator::setMargin):
3143         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp: Renamed from Source/WebCore/platform/graphics/texmap/coordinated/CompositingCoordinator.cpp.
3144         (WebKit::CompositingCoordinator::CompositingCoordinator):
3145         (WebKit::CompositingCoordinator::~CompositingCoordinator):
3146         (WebKit::CompositingCoordinator::setRootCompositingLayer):
3147         (WebKit::CompositingCoordinator::setViewOverlayRootLayer):
3148         (WebKit::CompositingCoordinator::sizeDidChange):
3149         (WebKit::CompositingCoordinator::flushPendingLayerChanges):
3150         (WebKit::CompositingCoordinator::timestamp):
3151         (WebKit::CompositingCoordinator::syncDisplayState):
3152         (WebKit::CompositingCoordinator::nextAnimationServiceTime):
3153         (WebKit::CompositingCoordinator::clearPendingStateChanges):
3154         (WebKit::CompositingCoordinator::initializeRootCompositingLayerIfNeeded):
3155         (WebKit::CompositingCoordinator::createRootLayer):
3156         (WebKit::CompositingCoordinator::syncLayerState):
3157         (WebKit::CompositingCoordinator::createImageBackingIfNeeded):
3158         (WebKit::CompositingCoordinator::createImageBacking):
3159         (WebKit::CompositingCoordinator::updateImageBacking):
3160         (WebKit::CompositingCoordinator::clearImageBackingContents):
3161         (WebKit::CompositingCoordinator::removeImageBacking):
3162         (WebKit::CompositingCoordinator::flushPendingImageBackingChanges):
3163         (WebKit::CompositingCoordinator::notifyAnimationStarted):
3164         (WebKit::CompositingCoordinator::notifyFlushRequired):
3165         (WebKit::CompositingCoordinator::paintContents):
3166         (WebKit::CompositingCoordinator::createGraphicsLayer):
3167         (WebKit::CompositingCoordinator::deviceScaleFactor):
3168         (WebKit::CompositingCoordinator::pageScaleFactor):
3169         (WebKit::CompositingCoordinator::createUpdateAtlas):
3170         (WebKit::CompositingCoordinator::removeUpdateAtlas):
3171         (WebKit::CompositingCoordinator::visibleContentsRect):
3172         (WebKit::CompositingCoordinator::mainContentsLayer):
3173         (WebKit::CompositingCoordinator::setVisibleContentsRect):
3174         (WebKit::CompositingCoordinator::deviceOrPageScaleFactorChanged):
3175         (WebKit::CompositingCoordinator::detachLayer):
3176         (WebKit::CompositingCoordinator::commitScrollOffset):
3177         (WebKit::CompositingCoordinator::renderNextFrame):
3178         (WebKit::CompositingCoordinator::purgeBackingStores):
3179         (WebKit::CompositingCoordinator::paintToSurface):
3180         (WebKit::CompositingCoordinator::scheduleReleaseInactiveAtlases):
3181         (WebKit::CompositingCoordinator::releaseInactiveAtlasesTimerFired):
3182         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h: Renamed from Source/WebCore/platform/graphics/texmap/coordinated/CompositingCoordinator.h.
3183         (WebKit::CompositingCoordinator::clearRootLayer):
3184         (WebKit::CompositingCoordinator::rootLayer):
3185         (WebKit::CompositingCoordinator::state):
3186         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h:
3187         * WebProcess/WebPage/CoordinatedGraphics/UpdateAtlas.cpp: Renamed from Source/WebCore/platform/graphics/texmap/coordinated/UpdateAtlas.cpp.
3188         (WebKit::UpdateAtlasSurfaceClient::UpdateAtlasSurfaceClient):
3189         (WebKit::UpdateAtlas::UpdateAtlas):
3190         (WebKit::UpdateAtlas::~UpdateAtlas):
3191         (WebKit::UpdateAtlas::buildLayoutIfNeeded):
3192         (WebKit::UpdateAtlas::didSwapBuffers):
3193         (WebKit::UpdateAtlas::paintOnAvailableBuffer):
3194         * WebProcess/WebPage/CoordinatedGraphics/UpdateAtlas.h: Renamed from Source/WebCore/platform/graphics/texmap/coordinated/UpdateAtlas.h.
3195         (WebKit::UpdateAtlas::size):
3196         (WebKit::UpdateAtlas::supportsAlpha):
3197         (WebKit::UpdateAtlas::addTimeInactive):
3198         (WebKit::UpdateAtlas::isInactive):
3199         (WebKit::UpdateAtlas::isInUse):
3200
3201 2016-06-29  Hunseop Jeong  <hs85.jeong@samsung.com>
3202
3203         Unreviewed, CMake build fix.
3204
3205         * PlatformMac.cmake:
3206
3207 2016-06-29  Beth Dakin  <bdakin@apple.com>
3208
3209         Add media_icon to WebKit2
3210         https://bugs.webkit.org/show_bug.cgi?id=159273
3211         -and corresponding-
3212         rdar://problem/27087714
3213
3214         Reviewed by Dean Jackson.
3215
3216         * Resources/mediaIcon.pdf: Added.
3217         * WebKit2.xcodeproj/project.pbxproj:
3218
3219 2016-06-29  Anders Carlsson  <andersca@apple.com>
3220
3221         Rename addressFields to contactFields
3222         https://bugs.webkit.org/show_bug.cgi?id=159271
3223         rdar://problem/27086955
3224
3225         Reviewed by Beth Dakin.
3226
3227         * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm:
3228         (IPC::ArgumentCoder<PaymentRequest>::encode):
3229         (IPC::ArgumentCoder<PaymentRequest>::decode):
3230         (IPC::ArgumentCoder<PaymentRequest::ContactFields>::encode):
3231         (IPC::ArgumentCoder<PaymentRequest::ContactFields>::decode):
3232         (IPC::ArgumentCoder<PaymentRequest::AddressFields>::encode): Deleted.
3233         (IPC::ArgumentCoder<PaymentRequest::AddressFields>::decode): Deleted.
3234         * Shared/WebCoreArgumentCoders.h:
3235         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
3236         (WebKit::toPKAddressField):
3237         (WebKit::toPKPaymentRequest):
3238
3239 2016-06-29  Jer Noble  <jer.noble@apple.com>
3240
3241         Adopt MediaRemote.
3242         https://bugs.webkit.org/show_bug.cgi?id=159250
3243
3244         Reviewed by Eric Carlson.
3245
3246         Add a sandbox exception allowing access to the mediaremoted XPC service.
3247
3248         * WebProcess/com.apple.WebProcess.sb.in:
3249
3250 2016-06-29  Alex Christensen  <achristensen@webkit.org>
3251
3252         WKWebView should ask WKNavigationDelegate about bad ssl certificates
3253         https://bugs.webkit.org/show_bug.cgi?id=159176
3254         rdar://problem/26864882
3255
3256         Reviewed by Sam Weinig.
3257
3258         This can be tested manually by visiting a site in MiniBrowser that has invalid ssl certificates, but we don't have proper ssl testing yet.
3259         Before this change, we would just open the site as if nothing were invalid, now we call the WKNavigationDelegate's didReceiveAuthenticationChallenge
3260         like we did before using NSURLSession, and we do not open the page, also like we did before using NSURLSession.
3261
3262         * NetworkProcess/NetworkLoad.cpp:
3263         (WebKit::NetworkLoad::continueCanAuthenticateAgainstProtectionSpace):
3264         When using NSURLConnection and responding to canAuthenticateAgainstProtectionSpace with YES,
3265         we get an NSURLAuthenticationChallenge when a bad ssl certificate is encountered in the handshake.
3266         When using NSURLSession, we want to call webView:didReceiveAuthenticationChallenge:completionHandler: in this case.
3267         The default implementation of NavigationState::NavigationClient::canAuthenticateAgainstProtectionSpace returns true
3268         if there is an implementation of webView:didReceiveAuthenticationChallenge:completionHandler: in its WKNavigationDelegate.
3269         Internal clients can implement _webView:canAuthenticateAgainstProtectionSpace: 
3270         and Safari uses canHandleHTTPSServerTrustEvaluation, so it will be unaffected.
3271
3272 2016-06-29  Beth Dakin  <bdakin@apple.com>
3273
3274         Delete WKElementInfo since it's not used
3275         https://bugs.webkit.org/show_bug.cgi?id=159265
3276
3277         Reviewed by Sam Weinig.
3278
3279         * Shared/API/Cocoa/WebKit.h:
3280         * UIProcess/API/Cocoa/WKElementInfo.h: Removed.
3281         * UIProcess/API/Cocoa/WKElementInfo.mm: Removed.
3282         * UIProcess/API/Cocoa/WKElementInfoInternal.h: Removed.
3283         * UIProcess/API/Cocoa/WKPreviewElementInfo.h:
3284         * UIProcess/API/Cocoa/WKPreviewElementInfo.mm:
3285         (-[WKPreviewElementInfo _initWithLinkURL:]):
3286         (-[WKPreviewElementInfo copyWithZone:]):
3287         (-[WKPreviewElementInfo linkURL]):
3288         * UIProcess/API/Cocoa/WKPreviewElementInfoInternal.h:
3289         * UIProcess/API/Cocoa/_WKContextMenuElementInfo.h:
3290         * UIProcess/API/Cocoa/_WKContextMenuElementInfo.mm:
3291         (-[_WKContextMenuElementInfo copyWithZone:]):
3292         * WebKit2.xcodeproj/project.pbxproj:
3293
3294 2016-06-29  Jeremy Jones  <jeremyj@apple.com>
3295
3296         Replace MPAudioVideoRoutingActionSheet with MPAVRoutingSheet.
3297         https://bugs.webkit.org/show_bug.cgi?id=159161
3298         <rdar://problem/26017691>
3299
3300         Reviewed by Sam Weinig.
3301
3302         MPAudioVideoRoutingActionSheet is being replaced by MPAVRoutingSheet,
3303         with only minor changes to the interface.
3304
3305         * UIProcess/ios/forms/WKAirPlayRoutePicker.mm:
3306         (-[WKAirPlayRoutePicker dealloc]):
3307         (-[WKAirPlayRoutePicker showAirPlayPickerIPhone:]):
3308
3309 2016-06-29  Carlos Garcia Campos  <cgarcia@igalia.com>
3310
3311         Too much duplicated code in LayerTreeHosts implementations
3312         https://bugs.webkit.org/show_bug.cgi?id=159144
3313
3314         Reviewed by Žan Doberšek.
3315
3316         There's some code common and duplicated in all current LayerTreeHosts implementations (Gtk, Coordinated, and
3317         ThreadedCoordinated). The thing is even worse in the case of ThreadedCoordinated and Coordinated, where the
3318         former is actually a special case of the later, and it seems like code was copy pasted and then modified to add
3319         ThreadedCoordinated specific code. The problem of that approach, apart from the code duplication, is that common
3320         parts end up diverging too. This patch moves the common parts to the base class LayerTreeHost and makes
3321         ThreadedCoordinatedLayerTreeHost inherit from CoordinatedLayerTreeHost, to share the common code and simply add
3322         the specific one.
3323
3324         * PlatformGTK.cmake:
3325         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedDrawingArea.h:
3326         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
3327         (WebKit::CoordinatedLayerTreeHost::CoordinatedLayerTreeHost):
3328         (WebKit::CoordinatedLayerTreeHost::scheduleLayerFlush):
3329         (WebKit::CoordinatedLayerTreeHost::setViewOverlayRootLayer):
3330         (WebKit::CoordinatedLayerTreeHost::setRootCompositingLayer):
3331         (WebKit::CoordinatedLayerTreeHost::invalidate):
3332         (WebKit::CoordinatedLayerTreeHost::sizeDidChange):
3333         (WebKit::CoordinatedLayerTreeHost::layerFlushTimerFired):
3334         (WebKit::CoordinatedLayerTreeHost::commitSceneState):
3335         (WebKit::CoordinatedLayerTreeHost::createCoordinatedSurface):
3336         (WebKit::CoordinatedLayerTreeHost::cancelPendingLayerFlush): Deleted.
3337         (WebKit::CoordinatedLayerTreeHost::forceRepaint): Deleted.
3338         (WebKit::CoordinatedLayerTreeHost::forceRepaintAsync): Deleted.
3339         (WebKit::CoordinatedLayerTreeHost::didFlushRootLayer): Deleted.
3340         (WebKit::CoordinatedLayerTreeHost::deviceOrPageScaleFactorChanged): Deleted.
3341         (WebKit::CoordinatedLayerTreeHost::pageBackgroundTransparencyChanged): Deleted.
3342         (WebKit::CoordinatedLayerTreeHost::graphicsLayerFactory): Deleted.
3343         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h:
3344         * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp:
3345         (WebKit::ThreadedCoordinatedLayerTreeHost::ThreadedCoordinatedLayerTreeHost):
3346         (WebKit::ThreadedCoordinatedLayerTreeHost::deviceOrPageScaleFactorChanged):
3347         (WebKit::ThreadedCoordinatedLayerTreeHost::sizeDidChange):
3348         (WebKit::ThreadedCoordinatedLayerTreeHost::setVisibleContentsRect):
3349         (WebKit::ThreadedCoordinatedLayerTreeHost::commitSceneState):
3350         (WebKit::ThreadedCoordinatedLayerTreeHost::create): Deleted.
3351         (WebKit::ThreadedCoordinatedLayerTreeHost::scrollNonCompositedContents): Deleted.
3352         (WebKit::ThreadedCoordinatedLayerTreeHost::contentsSizeChanged): Deleted.
3353         (WebKit::ThreadedCoordinatedLayerTreeHost::didChangeViewportProperties): Deleted.
3354         (WebKit::ThreadedCoordinatedLayerTreeHost::didScaleFactorChanged): Deleted.
3355         (WebKit::ThreadedCoordinatedLayerTreeHost::setNativeSurfaceHandleForCompositing): Deleted.
3356         * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h:
3357         * WebProcess/WebPage/DrawingArea.h:
3358         (WebKit::DrawingArea::layerHostDidFlushLayers):
3359         * WebProcess/WebPage/DrawingAreaImpl.h:
3360         * WebProcess/WebPage/LayerTreeHost.cpp:
3361         (WebKit::LayerTreeHost::~LayerTreeHost):
3362         (WebKit::LayerTreeHost::setLayerFlushSchedulingEnabled):
3363         (WebKit::LayerTreeHost::pauseRendering):
3364         (WebKit::LayerTreeHost::resumeRendering):
3365         (WebKit::LayerTreeHost::invalidate):
3366         * WebProcess/WebPage/LayerTreeHost.h:
3367         (WebKit::LayerTreeHost::layerTreeContext):
3368         (WebKit::LayerTreeHost::setShouldNotifyAfterNextScheduledLayerFlush):
3369         (WebKit::LayerTreeHost::setNonCompositedContentsNeedDisplay):
3370         (WebKit::LayerTreeHost::setNonCompositedContentsNeedDisplayInRect):
3371         (WebKit::LayerTreeHost::scrollNonCompositedContents):
3372         (WebKit::LayerTreeHost::graphicsLayerFactory):
3373         (WebKit::LayerTreeHost::contentsSizeChanged):
3374         (WebKit::LayerTreeHost::didChangeViewportProperties):
3375         (WebKit::LayerTreeHost::setNativeSurfaceHandleForCompositing):
3376         (WebKit::LayerTreeHost::setViewOverlayRootLayer):
3377         (WebKit::LayerTreeHost::forceRepaintAsync): Deleted.
3378         * WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp:
3379         (WebKit::LayerTreeHostGtk::invalidate):
3380         (WebKit::LayerTreeHostGtk::setViewOverlayRootLayer):
3381         (WebKit::LayerTreeHostGtk::LayerTreeHostGtk): Deleted.
3382         (WebKit::LayerTreeHostGtk::setRootCompositingLayer): Deleted.
3383         (WebKit::LayerTreeHostGtk::setNonCompositedContentsNeedDisplay): Deleted.
3384         (WebKit::LayerTreeHostGtk::scrollNonCompositedContents): Deleted.
3385         (WebKit::LayerTreeHostGtk::setNativeSurfaceHandleForCompositing): Deleted.
3386         * WebProcess/WebPage/gtk/LayerTreeHostGtk.h:
3387
3388 2016-06-28  Commit Queue  <commit-queue@webkit.org>
3389
3390         Unreviewed, rolling out r202586 and r202595.
3391         https://bugs.webkit.org/show_bug.cgi?id=159247
3392
3393         These changes broke the iOS build (Requested by ryanhaddad on
3394         #webkit).
3395
3396         Reverted changesets:
3397
3398         "Keep track of when a WKWebView is blank before the initial
3399         non-empty layout"
3400         https://bugs.webkit.org/show_bug.cgi?id=159217
3401         http://trac.webkit.org/changeset/202586
3402
3403         "Try to fix the build."
3404         http://trac.webkit.org/changeset/202595