Source/WebCore:
[WebKit-https.git] / Source / WebKit2 / ChangeLog
1 2016-12-04  Sam Weinig  <sam@webkit.org>
2
3         [WebIDL] Add support for converting dictionaries to JS
4         https://bugs.webkit.org/show_bug.cgi?id=165367
5
6         Reviewed by Chris Dumez.
7
8         * CMakeLists.txt:
9         Add missing directories to look in for headers.
10
11 2016-12-14  Anders Carlsson  <andersca@apple.com>
12
13         Add WKContextRefreshPlugIns
14         https://bugs.webkit.org/show_bug.cgi?id=165879
15         rdar://problem/29602414
16
17         Reviewed by Tim Horton.
18
19         * UIProcess/API/C/WKContext.cpp:
20         (WKContextRefreshPlugIns):
21         * UIProcess/API/C/WKContext.h:
22         * UIProcess/WebProcessPool.cpp:
23         (WebKit::WebProcessPool::refreshPlugins):
24         * UIProcess/WebProcessPool.h:
25         * WebProcess/Plugins/WebPluginInfoProvider.h:
26         * WebProcess/WebProcess.cpp:
27         (WebKit::WebProcess::refreshPlugins):
28         * WebProcess/WebProcess.h:
29         * WebProcess/WebProcess.messages.in:
30
31 2016-12-14  Tim Horton  <timothy_horton@apple.com>
32
33         API Test Fullscreen.TopContentInset is asserting on Yosemite
34         https://bugs.webkit.org/show_bug.cgi?id=165877
35
36         Reviewed by Brady Eidson.
37
38         * UIProcess/WebPageProxy.cpp:
39         (WebKit::WebPageProxy::setTopContentInset):
40         * WebProcess/WebPage/WebPage.cpp:
41         * WebProcess/WebPage/WebPage.h:
42         * WebProcess/WebPage/WebPage.messages.in:
43         We don't use fences on Yosemite, but this codepath still tried to.
44         Instead of guarding with PLATFORM(COCOA), make use of the more accurate
45         HAVE(COREANIMATION_FENCES) guard.
46
47 2016-12-14  Anders Carlsson  <andersca@apple.com>
48
49         Add some instrumentation to try to detect a crash on the bots
50         https://bugs.webkit.org/show_bug.cgi?id=165866
51
52         Reviewed by Sam Weinig.
53
54         * Platform/IPC/mac/ConnectionMac.mm:
55         (IPC::Connection::sendMessage):
56
57 2016-12-14  Dave Hyatt  <hyatt@apple.com>
58
59         [CSS Parser] Implement deferred parsing of properties, @media, @supports and @keyframes
60         https://bugs.webkit.org/show_bug.cgi?id=165743
61
62         Reviewed by Dean Jackson.
63
64         Repurpose the newCSSParserEnabled preference for deferred parsing. Just change the name
65         from "new" to "deferred."
66
67         * Shared/WebPreferencesDefinitions.h:
68         * UIProcess/API/C/WKPreferences.cpp:
69         (WKPreferencesSetDeferredCSSParserEnabled):
70         (WKPreferencesGetDeferredCSSParserEnabled):
71         (WKPreferencesSetNewCSSParserEnabled): Deleted.
72         (WKPreferencesGetNewCSSParserEnabled): Deleted.
73         * UIProcess/API/C/WKPreferencesRefPrivate.h:
74         * WebProcess/WebPage/WebPage.cpp:
75         (WebKit::WebPage::updatePreferences):
76
77 2016-12-14  Brent Fulgham  <bfulgham@apple.com>
78
79         Unreviewed test fix after r209806.
80
81         Plugin-common doesn't define 'home-subpath'. Instead it has 'home-library-subpath'. Switch to the correct
82         function. Also, 'home-library-subpath' adds '/Library' to the path, so revise the arguments so that we
83         do not generate paths like '/home/username/Library/Library/Keychains'.
84
85         * PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in:
86
87 2016-12-14  Brent Fulgham  <bfulgham@apple.com>
88
89         Unreviewed test fix after r209779.
90
91         The 'Keygen' element requires the ability to create new keys in '$HOME/Library/Keychains'. Remove the
92         WebProcess and Plugin sandbox restrictions on per-user Keychain creation to support this use.
93
94         * PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in:
95         * WebProcess/com.apple.WebProcess.sb.in:
96
97 2016-12-13  Yusuke Suzuki  <utatane.tea@gmail.com>
98
99         Use JSValue::toWTFString instead of calling toString(exec) and value(exec)
100         https://bugs.webkit.org/show_bug.cgi?id=165795
101
102         Reviewed by Saam Barati.
103
104         * WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp:
105         (WebKit::NPRuntimeObjectMap::convertJSValueToNPVariant):
106
107 2016-12-14  Enrique Ocaña González  <eocanha@igalia.com>
108
109         REGRESSION(r207879-207891): [GStreamer] Introduced many layout test failures and crashes, bots exiting early
110         https://bugs.webkit.org/show_bug.cgi?id=164022
111
112         Reviewed by Xabier Rodriguez-Calvar.
113
114         * Shared/WebPreferencesDefinitions.h:
115         New GStreamerEnabled preference, defaults to true.
116         * WebProcess/WebPage/WebPage.cpp: Ditto.
117         (WebKit::WebPage::updatePreferences):
118
119 2016-12-13  Commit Queue  <commit-queue@webkit.org>
120
121         Unreviewed, rolling out r209792.
122         https://bugs.webkit.org/show_bug.cgi?id=165841
123
124         Cause build failures (Requested by yusukesuzuki on #webkit).
125
126         Reverted changeset:
127
128         "Use JSValue::toWTFString instead of calling toString(exec)
129         and value(exec)"
130         https://bugs.webkit.org/show_bug.cgi?id=165795
131         http://trac.webkit.org/changeset/209792
132
133 2016-12-13  Yusuke Suzuki  <utatane.tea@gmail.com>
134
135         Use JSValue::toWTFString instead of calling toString(exec) and value(exec)
136         https://bugs.webkit.org/show_bug.cgi?id=165795
137
138         Reviewed by Saam Barati.
139
140         * WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp:
141         (WebKit::NPRuntimeObjectMap::convertJSValueToNPVariant):
142
143 2016-12-13  Alex Christensen  <achristensen@webkit.org>
144
145         Fix CMake build.
146
147         * PlatformMac.cmake:
148
149 2016-12-13  Jer Noble  <jer.noble@apple.com>
150
151         Fullscreen in WebKit2 does not restore topContentInset upon exiting; leaves top of page not visible
152         https://bugs.webkit.org/show_bug.cgi?id=165697
153
154         Delegate the values of topContentInset() from WebViewImpl (used by WKWebView and WKView) to the
155         WebPageProxy, so that setting the topContentInset() on WebPageProxy is reflected in the getters
156         for the two view classes.
157
158         Reviewed by Tim Horton.
159
160         * UIProcess/Cocoa/WebViewImpl.h:
161         (WebKit::WebViewImpl::topContentInset): Deleted.
162         * UIProcess/Cocoa/WebViewImpl.mm:
163         (WebKit::WebViewImpl::updateContentInsetsIfAutomatic):
164         (WebKit::WebViewImpl::topContentInset):
165         (WebKit::WebViewImpl::setTopContentInset):
166         (WebKit::WebViewImpl::dispatchSetTopContentInset):
167         * UIProcess/mac/WKFullScreenWindowController.mm:
168         (-[WKFullScreenWindowController enterFullScreen:]):
169         (-[WKFullScreenWindowController finishedEnterFullScreenAnimation:]):
170         (-[WKFullScreenWindowController finishedExitFullScreenAnimation:]):
171         (-[WKFullScreenWindowController _saveTopContentInset]): Deleted.
172         (-[WKFullScreenWindowController _restoreTopContentInset]): Deleted.
173
174 2016-12-13  Brent Fulgham  <bfulgham@apple.com>
175
176         [Mac][WK2] Tighten Keychain directory access
177         https://bugs.webkit.org/show_bug.cgi?id=165818
178         <rdar://problem/16863857>
179
180         Reviewed by Anders Carlsson.
181
182         Lock down Keychain directory access to just the file-read-data, file-read-metadata, and
183         file-write-data operations we actually need.
184
185         * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
186         * PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in:
187         * WebProcess/com.apple.WebProcess.sb.in:
188
189 2016-12-13  Andy Estes  <aestes@apple.com>
190
191         [Cocoa] Implement -shouldInsertText: on WKWebProcessPlugInEditingDelegate
192         https://bugs.webkit.org/show_bug.cgi?id=165785
193         <rdar://problem/26929398>
194
195         Reviewed by Darin Adler.
196
197         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInEditingDelegate.h: Defined
198         WKEditorInsertAction and declared
199         -_webProcessPlugInBrowserContextController:shouldInsertText:replacingRange:givenAction:.
200         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
201         (toWK): Added. Mapped a WebCore::EditorInsertAction to a WKEditorInsertAction.
202         (-[WKWebProcessPlugInBrowserContextController _setEditingDelegate:]): Implemented
203         EditorClient::shouldInsertText() by calling
204         -_webProcessPlugInBrowserContextController:shouldInsertText:replacingRange:givenAction: with
205         the text, wrapped range handle, and action. Added shouldInsertText to DelegateMethods and
206         initialized it according to whether the delegate responds to shouldInsertText:.
207
208 2016-12-13  Joseph Pecoraro  <pecoraro@apple.com>
209
210         NSArray leaks seen in Safari, allocated under WKIconDatabaseTryCopyCGImageArrayForURL
211         https://bugs.webkit.org/show_bug.cgi?id=165809
212
213         Reviewed by Dan Bernstein.
214
215         * UIProcess/API/C/cg/WKIconDatabaseCG.cpp:
216         (WKIconDatabaseTryCopyCGImageArrayForURL):
217         Avoid an extra retain on already newly created array.
218
219 2016-12-13  Eric Carlson  <eric.carlson@apple.com>
220
221         Annotate MediaStream and WebRTC idl with EnabledAtRuntime flag
222         https://bugs.webkit.org/show_bug.cgi?id=165251
223
224         Reviewed by Youenn Fablet.
225
226         * WebProcess/WebPage/WebPage.cpp:
227         (WebKit::WebPage::updatePreferences): Update the media stream and peer connection runtime
228         feature instead of the setting.
229
230 2016-12-13  Sergio Villar Senin  <svillar@igalia.com>
231
232         Fix GTK build after r209733
233         https://bugs.webkit.org/show_bug.cgi?id=165794
234
235         Document::visibilityState() now returns an IDL string enumeration.
236
237         Reviewed by Žan Doberšek.
238
239         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocument.cpp:
240         (webkit_dom_document_get_visibility_state):
241
242 2016-12-12  Dean Jackson  <dino@apple.com>
243
244         [iOS] MediaDocument "Done" button should navigate the page back
245         https://bugs.webkit.org/show_bug.cgi?id=165779
246
247         Reviewed by Sam Weinig.
248
249         * UIProcess/Cocoa/WebVideoFullscreenManagerProxy.h:
250         * UIProcess/Cocoa/WebVideoFullscreenManagerProxy.mm:
251         (WebKit::WebVideoFullscreenModelContext::requestFullscreenMode):
252         (WebKit::WebVideoFullscreenManagerProxy::requestFullscreenMode):
253         * WebProcess/cocoa/WebVideoFullscreenManager.h:
254         * WebProcess/cocoa/WebVideoFullscreenManager.messages.in:
255         * WebProcess/cocoa/WebVideoFullscreenManager.mm:
256         (WebKit::WebVideoFullscreenManager::requestFullscreenMode):
257
258 2016-12-12  Tim Horton  <timothy_horton@apple.com>
259
260         Provide SPI to avoid blocking on painting when coming into view
261         https://bugs.webkit.org/show_bug.cgi?id=165780
262         <rdar://problem/29009559>
263
264         Reviewed by Simon Fraser.
265
266         By default, when parenting a WKWebView which was previously in-window,
267         we block on painting to ensure that we don't flash stale content.
268         We added SPI to disable this behavior to WKWebViewConfiguration, but
269         some clients might want the behavior most of the time, but sometimes
270         instead want to not block the UI process main thread, but instead do
271         their own work (e.g. removing a snapshot) when painting eventually occurs.
272
273         * UIProcess/API/Cocoa/WKWebView.mm:
274         (-[WKWebView _doAfterNextPresentationUpdateWithoutWaitingForPainting:]):
275         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
276         Tell WebPageProxy not to block on painting next time we are parented,
277         and use doAfterNextPresentationUpdate to call the block when the painting
278         does eventually happen. This SPI must be called before - but in the same
279         runloop cycle - the WKWebView is brought back in-window to work correctly.
280         
281         * UIProcess/WebPageProxy.cpp:
282         (WebKit::WebPageProxy::dispatchActivityStateChange):
283         * UIProcess/WebPageProxy.h:
284         (WebKit::WebPageProxy::skipWaitingForPaintAfterNextViewDidMoveToWindow):
285         If we would block because we're coming in-window, but the bit to skip
286         blocking the next time we get brought in-window is set, reset the bit, 
287         and avoid blocking.
288
289 2016-12-12  Chris Dumez  <cdumez@apple.com>
290
291         Document.visibilityState should use an IDL string enumeration
292         https://bugs.webkit.org/show_bug.cgi?id=165774
293
294         Reviewed by Daniel Bates.
295
296         * Shared/API/c/WKSharedAPICast.h:
297         (WebKit::toPageVisibilityState):
298
299 2016-12-11  Konstantin Tokarev  <annulen@yandex.ru>
300
301         Unreviewed attempt to fix EFL and Mac/cmake builds after r209665.
302         https://bugs.webkit.org/show_bug.cgi?id=165686
303
304         * PlatformEfl.cmake: WebKit2 should precede other target so that right
305         config.h comes first in include path.
306
307 2016-12-11  Tim Horton  <timothy_horton@apple.com>
308
309         Quarter-second stalls scrolling images that are links because of sync getPositionInformation
310         https://bugs.webkit.org/show_bug.cgi?id=165707
311
312         Reviewed by Simon Fraser.
313
314         * UIProcess/ios/WKContentViewInteraction.mm:
315         (-[WKContentView positionInformationForActionSheetAssistant:]):
316         (-[WKContentView updatePositionInformationForActionSheetAssistant:]):
317         For now, synchronously block when presenting the action sheet if we
318         don't have a snapshot ready.
319
320         * WebProcess/WebPage/ios/WebPageIOS.mm:
321         (WebKit::WebPage::getPositionInformation):
322         Respect includeSnapshot in another place in getPositionInformation,
323         so that many getPositionInformations don't have to do extra snapshotting work.
324
325 2016-12-10  Filip Pizlo  <fpizlo@apple.com>
326
327         The DOM should have an advancing wavefront opaque root barrier
328         https://bugs.webkit.org/show_bug.cgi?id=165712
329
330         Reviewed by Yusuke Suzuki.
331         
332         Propagate the JSDOMWindowBase::commonVM() -> commonVM() change.
333
334         * Shared/linux/WebMemorySamplerLinux.cpp:
335         (WebKit::WebMemorySampler::sampleWebKit):
336         * Shared/mac/WebMemorySampler.mac.mm:
337         (WebKit::WebMemorySampler::sampleWebKit):
338         * WebProcess/InjectedBundle/InjectedBundle.cpp:
339         (WebKit::InjectedBundle::javaScriptObjectsCount):
340         * WebProcess/Plugins/Netscape/JSNPObject.cpp:
341         (WebKit::JSNPObject::callMethod):
342         (WebKit::JSNPObject::callObject):
343         (WebKit::JSNPObject::callConstructor):
344         (WebKit::JSNPObject::put):
345         (WebKit::JSNPObject::deleteProperty):
346         (WebKit::JSNPObject::getOwnPropertyNames):
347         (WebKit::JSNPObject::propertyGetter):
348         * WebProcess/WebPage/WebPage.cpp:
349         (WebKit::WebPage::runJavaScriptInMainFrame):
350         (WebKit::WebPage::getBytecodeProfile):
351         (WebKit::WebPage::getSamplingProfilerOutput):
352         * WebProcess/WebProcess.cpp:
353         (WebKit::WebProcess::getWebCoreStatistics):
354
355 2016-12-11  Konstantin Tokarev  <annulen@yandex.ru>
356
357         Unreviewed build fix for EFL after r209665
358
359         * UIProcess/efl/TextCheckerClientEfl.h:
360
361 2016-12-10  Konstantin Tokarev  <annulen@yandex.ru>
362
363         [cmake] Include WTF, JSC, and WebCore headers automatically to targers using them
364         https://bugs.webkit.org/show_bug.cgi?id=165686
365
366         Reviewed by Michael Catanzaro.
367
368         This change reduces duplication of include path lists between modules,
369         and reduces future need for fixes like r209605 (broken build because of
370         WebCore header suddenly becoming used in WebKit2).
371
372         * CMakeLists.txt:
373         * PlatformEfl.cmake:
374         * PlatformGTK.cmake:
375         * PlatformMac.cmake:
376
377 2016-12-10  Antti Koivisto  <antti@apple.com>
378
379         CrashTracer: com.apple.WebKit.Networking at WTF::ThreadSafeRefCounted<WebKit::NetworkCache::IOChannel>::deref
380         https://bugs.webkit.org/show_bug.cgi?id=165659
381         <rdar://problem/27077977>
382
383         Reviewed by Darin Adler.
384
385         * NetworkProcess/cache/NetworkCacheIOChannel.h:
386         * NetworkProcess/cache/NetworkCacheIOChannelCocoa.mm:
387         (WebKit::NetworkCache::IOChannel::~IOChannel):
388
389             Add non-inlined destructor and release assert against double deletion to narrow down this crash.
390
391 2016-12-09  Brent Fulgham  <bfulgham@apple.com>
392
393         WebCore::Timer is not compatible with UIProcess
394         https://bugs.webkit.org/show_bug.cgi?id=165706
395         <rdar://problem/29360564>
396
397         Reviewed by Andy Estes.
398
399         Anders has explained to me (at least twice) that WebCore::Timer must not
400         be used in UIProcess code. A recent bug fix introduced a WebCore::Timer,
401         which led to another crash.
402         
403         This patch switches from WebCore::Timer to WTF::RunLoop::Timer to avoid
404         the problem.
405
406         * UIProcess/Cocoa/NavigationState.h:
407         * UIProcess/Cocoa/NavigationState.mm:
408         (WebKit::NavigationState::NavigationState):
409
410 2016-12-09  Eric Carlson  <eric.carlson@apple.com>
411
412         Annotate MediaStream and WebRTC idl with EnabledAtRuntime flag
413         https://bugs.webkit.org/show_bug.cgi?id=165251
414
415         Reviewed by Dean Jackson.
416
417         Based on a patch by Dr Alex Gouaillard <agouaillard@gmail.com>
418
419         * Shared/WebPreferencesDefinitions.h: Add peerConnectionEnabled.
420
421         * UIProcess/API/C/WKPreferences.cpp:
422         (WKPreferencesSetPeerConnectionEnabled): Added.
423         (WKPreferencesGetPeerConnectionEnabled): Added.
424         * UIProcess/API/C/WKPreferencesRef.h:
425
426         * WebProcess/InjectedBundle/InjectedBundle.cpp:
427         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner): Add WebKitMediaStreamEnabled
428           and WebKitPeerConnectionEnabled.
429
430         * WebProcess/WebPage/WebPage.cpp:
431         (WebKit::WebPage::updatePreferences): Initialize the peerConnection preference.
432
433 2016-12-09  Brady Eidson  <beidson@apple.com>
434
435         Re-landing:
436         Add _WKIconLoadingDelegate SPI.
437         https://bugs.webkit.org/show_bug.cgi?id=164894
438
439         Reviewed by Alex Christensen.
440
441         With this client, WebCore will ask the FrameLoaderClient about each icon found in the <head>.
442
443         WebKit2 will then ask the embedding app - for each icon - if it wants that icon to load.
444
445         For icons the app decides to load, WebKit will pass the data to the app without storing locally.
446
447         * UIProcess/API/APIIconLoadingClient.h: Copied from Source/WebCore/html/LinkIconCollector.h.
448         (API::IconLoadingClient::~IconLoadingClient):
449         (API::IconLoadingClient::getLoadDecisionForIcon):
450
451         * UIProcess/API/Cocoa/WKWebView.mm:
452         (-[WKWebView _initializeWithConfiguration:]):
453         (-[WKWebView _iconLoadingDelegate]):
454         (-[WKWebView _setIconLoadingDelegate:]):
455         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
456
457         * UIProcess/API/Cocoa/_WKIconLoadingDelegate.h: Copied from Source/WebCore/html/LinkIconCollector.h.
458
459         * UIProcess/API/Cocoa/_WKLinkIconParameters.h: Copied from Source/WebCore/html/LinkIconCollector.h.
460         * UIProcess/API/Cocoa/_WKLinkIconParameters.mm: Copied from Source/WebCore/html/LinkIconCollector.h.
461         (-[_WKLinkIconParameters _initWithLinkIcon:]):
462         (-[_WKLinkIconParameters url]):
463         (-[_WKLinkIconParameters mimeType]):
464         (-[_WKLinkIconParameters size]):
465         (-[_WKLinkIconParameters iconType]):
466         * UIProcess/API/Cocoa/_WKLinkIconParametersInternal.h: Copied from Source/WebCore/html/LinkIconCollector.h.
467
468         * UIProcess/Cocoa/IconLoadingDelegate.h: Copied from Source/WebCore/html/LinkIconCollector.h.
469         * UIProcess/Cocoa/IconLoadingDelegate.mm: Added.
470         (WebKit::IconLoadingDelegate::IconLoadingDelegate):
471         (WebKit::IconLoadingDelegate::~IconLoadingDelegate):
472         (WebKit::IconLoadingDelegate::createIconLoadingClient):
473         (WebKit::IconLoadingDelegate::delegate):
474         (WebKit::IconLoadingDelegate::setDelegate):
475         (WebKit::IconLoadingDelegate::IconLoadingClient::IconLoadingClient):
476         (WebKit::IconLoadingDelegate::IconLoadingClient::~IconLoadingClient):
477         (WebKit::IconLoadingDelegate::IconLoadingClient::getLoadDecisionForIcon):
478
479         * UIProcess/WebPageProxy.cpp:
480         (WebKit::WebPageProxy::setIconLoadingClient):
481         (WebKit::WebPageProxy::getLoadDecisionForIcon):
482         (WebKit::WebPageProxy::finishedLoadingIcon):
483         * UIProcess/WebPageProxy.h:
484         (WebKit::WebPageProxy::iconLoadingClient):
485         * UIProcess/WebPageProxy.messages.in:
486
487         * WebKit2.xcodeproj/project.pbxproj:
488
489         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
490         (WebKit::WebFrameLoaderClient::useIconLoadingClient):
491         (WebKit::WebFrameLoaderClient::getLoadDecisionForIcon):
492         (WebKit::WebFrameLoaderClient::finishedLoadingIcon):
493         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
494         (WebKit::WebFrameLoaderClient::setUseIconLoadingClient):
495
496         * WebProcess/WebPage/WebPage.cpp:
497         (WebKit::WebPage::didGetLoadDecisionForIcon):
498         (WebKit::WebPage::setUseIconLoadingClient):
499         * WebProcess/WebPage/WebPage.h:
500         * WebProcess/WebPage/WebPage.messages.in:
501
502 2016-12-09  Simon Fraser  <simon.fraser@apple.com>
503
504         Fix initialization of contentUpdateFrequency
505         https://bugs.webkit.org/show_bug.cgi?id=165705
506         rdar://problem/29602039
507
508         Reviewed by Tim Horton.
509
510         The value that controls web content update frequency was not being initialized.
511
512         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
513         (-[WKWebViewConfiguration init]):
514
515 2016-12-09  Anders Carlsson  <andersca@apple.com>
516
517         Once we can send Mach messages again, make sure to send any pending outgoing messages
518         https://bugs.webkit.org/show_bug.cgi?id=165693
519
520         Reviewed by Brady Eidson.
521
522         * Platform/IPC/mac/ConnectionMac.mm:
523         (IPC::Connection::initializeSendSource):
524
525 2016-12-09  Beth Dakin  <bdakin@apple.com>
526
527         Password fields should not show the emoji button in TouchBar
528         https://bugs.webkit.org/show_bug.cgi?id=165673
529         -and corresponding-
530         rdar://problem/29235739
531
532         Reviewed by Wenson Hsieh.
533
534         This patch adds a new member variable for the password touch bar and password 
535         candidateListTouchBarItem. Since this TouchBar will actually have a different set 
536         of identifiers than the plain text TouchBar, it should just have its own variable.
537         * UIProcess/Cocoa/WebViewImpl.h:
538         * UIProcess/Cocoa/WebViewImpl.mm:
539
540         Return m_passwordTextCandidateListTouchBarItem when appropriate.
541         (WebKit::WebViewImpl::candidateListTouchBarItem):
542
543         The candidate list should be the only item for passwords.
544         (WebKit::passwordTextTouchBarDefaultItemIdentifiers):
545
546         Account for m_passwordTextTouchBar.
547         (WebKit::WebViewImpl::updateTouchBarAndRefreshTextBarIdentifiers):
548         (WebKit::WebViewImpl::setUpTextTouchBar):
549         (WebKit::WebViewImpl::textTouchBar):
550
551         The empty candidates array is not needed. We can just set @[ ] as the candidates 
552         for the m_passwordTextCandidateListTouchBarItem. Safe guards already exist in the 
553         other parts of the code to prevent us from requesting or setting other candidates 
554         when in a password field. 
555         (WebKit::WebViewImpl::updateTextTouchBar):
556
557 2016-12-09  Keith Rollin  <krollin@apple.com>
558
559         Fix string specification in print format
560         https://bugs.webkit.org/show_bug.cgi?id=165650
561
562         Reviewed by Alex Christensen.
563
564         Change "%{public}s" string specifier to something that can be changed
565         to "%s" at compile time when the build environment doesn't support the
566         former.
567
568         * NetworkProcess/capture/NetworkCaptureLogging.h:
569         * NetworkProcess/capture/NetworkCaptureManager.cpp:
570         (WebKit::NetworkCapture::Manager::initialize):
571         (WebKit::NetworkCapture::Manager::findMatch):
572         (WebKit::NetworkCapture::Manager::findExactMatch):
573         (WebKit::NetworkCapture::Manager::findBestFuzzyMatch):
574         (WebKit::NetworkCapture::Manager::fuzzyMatchURLs):
575         (WebKit::NetworkCapture::Manager::logPlayedBackResource):
576         (WebKit::NetworkCapture::Manager::openCacheFile):
577         (WebKit::NetworkCapture::Manager::getLine):
578         * NetworkProcess/capture/NetworkCaptureRecorder.cpp:
579         (WebKit::NetworkCapture::Recorder::recordRequestSent):
580         (WebKit::NetworkCapture::Recorder::recordResponseReceived):
581         (WebKit::NetworkCapture::Recorder::recordRedirectReceived):
582         (WebKit::NetworkCapture::Recorder::recordRedirectSent):
583         (WebKit::NetworkCapture::Recorder::writeEvents):
584         * NetworkProcess/capture/NetworkCaptureResource.cpp:
585         (WebKit::NetworkCapture::Resource::url):
586         (WebKit::NetworkCapture::Resource::EventStream::nextEvent):
587         * NetworkProcess/capture/NetworkDataTaskReplay.cpp:
588         (WebKit::NetworkCapture::NetworkDataTaskReplay::NetworkDataTaskReplay):
589         (WebKit::NetworkCapture::NetworkDataTaskReplay::~NetworkDataTaskReplay):
590         (WebKit::NetworkCapture::NetworkDataTaskReplay::resume):
591         (WebKit::NetworkCapture::NetworkDataTaskReplay::suspend):
592         (WebKit::NetworkCapture::NetworkDataTaskReplay::complete):
593         (WebKit::NetworkCapture::NetworkDataTaskReplay::invalidateAndCancel):
594         (WebKit::NetworkCapture::NetworkDataTaskReplay::enqueueEventHandler):
595         (WebKit::NetworkCapture::NetworkDataTaskReplay::replayRequestSent):
596         (WebKit::NetworkCapture::NetworkDataTaskReplay::replayResponseReceived):
597         (WebKit::NetworkCapture::NetworkDataTaskReplay::replayRedirectReceived):
598         (WebKit::NetworkCapture::NetworkDataTaskReplay::replayRedirectSent):
599         (WebKit::NetworkCapture::NetworkDataTaskReplay::replayDataReceived):
600         (WebKit::NetworkCapture::NetworkDataTaskReplay::replayFinished):
601         (WebKit::NetworkCapture::NetworkDataTaskReplay::didReceiveResponse):
602
603 2016-12-09  Jeremy Jones  <jeremyj@apple.com>
604
605         WebView doesn't become first responder in element fullscreen.
606         https://bugs.webkit.org/show_bug.cgi?id=165664
607         rdar://problem/28927252
608
609         Reviewed by Tim Horton.
610
611         WebView was being set as the first responder while the contentView was still hidden.
612         A view can not become first responder while it or its ancestor is hidden.
613
614         This change waits until after the contentView is visible to make the web view the first responder.
615
616         * UIProcess/mac/WKFullScreenWindowController.mm:
617         (-[WKFullScreenWindowController enterFullScreen:]):
618         (-[WKFullScreenWindowController _startEnterFullScreenAnimationWithDuration:]):
619
620 2016-12-09  Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>
621
622         Unreviewed build fix. Thanks to Konstantin Tokarev and Csaba Osztrogonác
623         for pointing out the fix.
624
625         * CMakeLists.txt: add WebCore/html/canvas to include paths.
626
627 2016-12-09  Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>
628
629         [GTK] Fix build after r209558
630         https://bugs.webkit.org/show_bug.cgi?id=165653
631
632         Unreviewed build fix.
633
634         * UIProcess/API/APIPolicyClient.h: include WebsitePolicies.h.
635         * UIProcess/API/gtk/WebKitPolicyClient.cpp: ditto.
636         * UIProcess/API/gtk/WebKitPolicyDecision.cpp:
637         (webkit_policy_decision_use):  pass empty structure to new required argument.
638
639 2016-12-09  Gavin Barraclough  <barraclough@apple.com>
640
641         Revert - Add _WKIconLoadingDelegate SPI
642         https://bugs.webkit.org/show_bug.cgi?id=164894
643
644         Unreviewed rollout due to performance regression.
645
646         * PlatformMac.cmake:
647         * UIProcess/API/APIIconLoadingClient.h: Removed.
648         * UIProcess/API/Cocoa/WKWebView.mm:
649         (-[WKWebView _initializeWithConfiguration:]):
650         (-[WKWebView _iconLoadingDelegate]): Deleted.
651         (-[WKWebView _setIconLoadingDelegate:]): Deleted.
652         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
653         * UIProcess/API/Cocoa/_WKIconLoadingDelegate.h: Removed.
654         * UIProcess/API/Cocoa/_WKLinkIconParameters.h: Removed.
655         * UIProcess/API/Cocoa/_WKLinkIconParameters.mm: Removed.
656         * UIProcess/API/Cocoa/_WKLinkIconParametersInternal.h: Removed.
657         * UIProcess/Cocoa/IconLoadingDelegate.h: Removed.
658         * UIProcess/Cocoa/IconLoadingDelegate.mm: Removed.
659         * UIProcess/WebPageProxy.cpp:
660         (WebKit::WebPageProxy::setIconLoadingClient): Deleted.
661         (WebKit::WebPageProxy::getLoadDecisionForIcon): Deleted.
662         (WebKit::WebPageProxy::finishedLoadingIcon): Deleted.
663         * UIProcess/WebPageProxy.h:
664         (WebKit::WebPageProxy::iconLoadingClient): Deleted.
665         * UIProcess/WebPageProxy.messages.in:
666         * WebKit2.xcodeproj/project.pbxproj:
667         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
668         (WebKit::WebFrameLoaderClient::useIconLoadingClient): Deleted.
669         (WebKit::WebFrameLoaderClient::getLoadDecisionForIcon): Deleted.
670         (WebKit::WebFrameLoaderClient::finishedLoadingIcon): Deleted.
671         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
672         (WebKit::WebFrameLoaderClient::setUseIconLoadingClient): Deleted.
673         (): Deleted.
674         * WebProcess/WebPage/WebPage.cpp:
675         (WebKit::WebPage::didGetLoadDecisionForIcon): Deleted.
676         (WebKit::WebPage::setUseIconLoadingClient): Deleted.
677         * WebProcess/WebPage/WebPage.h:
678         * WebProcess/WebPage/WebPage.messages.in:
679
680 2016-12-08  Keith Rollin  <krollin@apple.com>
681
682         Move FileHandle to WebCore FileHandle.h
683         https://bugs.webkit.org/show_bug.cgi?id=165562
684
685         Reviewed by Alex Christensen.
686
687         Move FileHandle from NetworkCaptureTypes.h (which can now be deleted)
688         to WebCore. Update client code to use the new version.
689
690         * NetworkProcess/capture/NetworkCaptureEvent.cpp:
691         * NetworkProcess/capture/NetworkCaptureEvent.h:
692         * NetworkProcess/capture/NetworkCaptureManager.cpp:
693         (WebKit::NetworkCapture::Manager::initialize):
694         (WebKit::NetworkCapture::Manager::terminate):
695         (WebKit::NetworkCapture::Manager::logRecordedResource):
696         (WebKit::NetworkCapture::Manager::logLoadedResource):
697         (WebKit::NetworkCapture::Manager::logPlayedBackResource):
698         (WebKit::NetworkCapture::Manager::openCacheFile):
699         (WebKit::NetworkCapture::Manager::ensureFileHandle): Deleted.
700         (WebKit::NetworkCapture::Manager::printToFile): Deleted.
701         * NetworkProcess/capture/NetworkCaptureManager.h:
702         * NetworkProcess/capture/NetworkCaptureRecorder.cpp:
703         (WebKit::NetworkCapture::Recorder::writeEvents):
704         * NetworkProcess/capture/NetworkCaptureTypes.h: Removed.
705         * WebKit2.xcodeproj/project.pbxproj:
706
707 2016-12-08  Anders Carlsson  <andersca@apple.com>
708
709         Attempt to fix the iOS build.
710
711         * Platform/IPC/mac/MachMessage.cpp:
712
713 2016-12-08  Anders Carlsson  <andersca@apple.com>
714
715         Defer sending Mach messages if the queue is full
716         https://bugs.webkit.org/show_bug.cgi?id=165622
717         rdar://problem/29518036
718
719         Reviewed by Brady Eidson.
720
721         * Platform/IPC/Connection.cpp:
722         Include MachMessage.h so the Connection destructor can do its thing.
723
724         * Platform/IPC/Connection.h:
725         Add new members.
726
727         * Platform/IPC/mac/ConnectionMac.mm:
728         (IPC::Connection::platformInvalidate):
729         Null out the pending outgoing mach message.
730
731         (IPC::Connection::sendMessage):
732         New helper that will send a Mach message. If we time out, store the message in m_pendingOutgoingMachMessage.
733         When our send source will be triggered we'll try to send the message again.
734
735         (IPC::Connection::platformCanSendOutgoingMessages):
736         We can only send messages if we don't have a pending outgoing message.
737
738         (IPC::Connection::sendOutgoingMessage):
739         Call the newly added sendMessage function.
740
741         (IPC::Connection::initializeSendSource):
742         Add the DISPATCH_MACH_SEND_POSSIBLE mask (and DISPATCH_MACH_SEND_DEAD which was previously implicit).
743         In our event handler, check for DISPATCH_MACH_SEND_POSSIBLE and try to send the pending outgoing message again.
744
745         * Platform/IPC/mac/MachMessage.cpp:
746         (IPC::MachMessage::create):
747         Rename length to size.
748
749         (IPC::MachMessage::MachMessage):
750         Initialize m_shouldFreeDescriptors.
751
752         (IPC::MachMessage::~MachMessage):
753         Call mach_msg_destroy, which will free the descriptors.
754
755         (IPC::MachMessage::leakDescriptors):
756         Set m_shouldFreeDescriptors to false.
757
758         * Platform/IPC/mac/MachMessage.h:
759         (IPC::MachMessage::size):
760         (IPC::MachMessage::length): Deleted.
761
762 2016-12-08  Chelsea Pugh  <cpugh@apple.com>
763
764         [iOS] WKWebView should not allow app links to be opened on back or forward navigation
765         https://bugs.webkit.org/show_bug.cgi?id=165502
766
767         Reviewed by Dan Bernstein.
768
769         * UIProcess/WebPageProxy.cpp:
770         (WebKit::WebPageProxy::decidePolicyForNavigationAction): Add a condition to shouldOpenAppLinks
771         (which we use when creating a NavigationAction) that the navigationActionData is not a navigation
772         of type BackForward. This way, we don't open app links when a navigation is done via back or
773         forward.
774
775 2016-12-08  Filip Pizlo  <fpizlo@apple.com>
776
777         Enable SharedArrayBuffer, remove the flag
778         https://bugs.webkit.org/show_bug.cgi?id=165614
779
780         Rubber stamped by Geoffrey Garen.
781
782         * UIProcess/API/C/WKPreferencesRefPrivate.h:
783         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
784
785 2016-12-08  Alex Christensen  <achristensen@webkit.org>
786
787         Add SPI for sending WebsiteSettings to WebProcess during navigation
788         https://bugs.webkit.org/show_bug.cgi?id=165517
789         <rdar://29341068>
790
791         We add the ability for the navigation client to send settings to the WebProcess 
792         based on the URL of the document being navigated to. This approach adds no new IPC 
793         messages and allows the application to decide what settings to use during navigation 
794         instead of declaratively before navigation. Right now there is only one setting, 
795         whether to disable content blockers, but this infrastructure can be used for more settings.
796
797         Reviewed by Anders Carlsson.
798
799         * CMakeLists.txt:
800         * PlatformMac.cmake:
801         * Shared/API/APIObject.h:
802         * Shared/API/c/WKBase.h:
803         * Shared/WebsitePolicies.h: Added.
804         (WebKit::WebsitePolicies::encode):
805         (WebKit::WebsitePolicies::decode):
806         * UIProcess/API/APINavigationClient.h:
807         (API::NavigationClient::decidePolicyForNavigationAction):
808         (API::NavigationClient::decidePolicyForNavigationResponse):
809         * UIProcess/API/APIPolicyClient.h:
810         (API::PolicyClient::decidePolicyForNavigationAction):
811         (API::PolicyClient::decidePolicyForNewWindowAction):
812         (API::PolicyClient::decidePolicyForResponse):
813         * UIProcess/API/APIWebsitePolicies.cpp: Added.
814         (API::WebsitePolicies::create):
815         * UIProcess/API/APIWebsitePolicies.h: Added.
816         * UIProcess/API/C/WKAPICast.h:
817         * UIProcess/API/C/WKFramePolicyListener.cpp:
818         (WKFramePolicyListenerUse):
819         (WKFramePolicyListenerUseWithPolicies):
820         * UIProcess/API/C/WKFramePolicyListener.h:
821         * UIProcess/API/C/WKPage.cpp:
822         (WKPageSetPagePolicyClient):
823         * UIProcess/API/C/WKWebsitePolicies.cpp: Added.
824         (WKWebsitePoliciesGetTypeID):
825         (WKWebsitePoliciesCreate):
826         (WKWebsitePoliciesSetContentBlockersEnabled):
827         (WKWebsitePoliciesGetContentBlockersEnabled):
828         * UIProcess/API/C/WKWebsitePolicies.h: Added.
829         * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
830         * UIProcess/API/Cocoa/_WKWebsitePolicies.h: Added.
831         * UIProcess/API/Cocoa/_WKWebsitePolicies.mm: Added.
832         (-[_WKWebsitePolicies dealloc]):
833         (-[_WKWebsitePolicies init]):
834         (-[_WKWebsitePolicies setContentBlockersEnabled:]):
835         (-[_WKWebsitePolicies contentBlockersEnabled]):
836         (-[_WKWebsitePolicies description]):
837         (-[_WKWebsitePolicies _apiObject]):
838         * UIProcess/API/Cocoa/_WKWebsitePoliciesInternal.h: Added.
839         (WebKit::wrapper):
840         * UIProcess/Automation/WebAutomationSession.cpp:
841         (WebKit::WebAutomationSession::reloadBrowsingContext):
842         * UIProcess/Cocoa/NavigationState.h:
843         * UIProcess/Cocoa/NavigationState.mm:
844         (WebKit::NavigationState::setNavigationDelegate):
845         (WebKit::tryAppLink):
846         (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):
847         (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationResponse):
848         * UIProcess/WebFormSubmissionListenerProxy.cpp:
849         (WebKit::WebFormSubmissionListenerProxy::continueSubmission):
850         * UIProcess/WebFrameListenerProxy.cpp:
851         (WebKit::WebFrameListenerProxy::receivedPolicyDecision):
852         * UIProcess/WebFrameListenerProxy.h:
853         * UIProcess/WebFramePolicyListenerProxy.cpp:
854         (WebKit::WebFramePolicyListenerProxy::use):
855         (WebKit::WebFramePolicyListenerProxy::download):
856         (WebKit::WebFramePolicyListenerProxy::ignore):
857         * UIProcess/WebFramePolicyListenerProxy.h:
858         (WebKit::WebFramePolicyListenerProxy::create):
859         * UIProcess/WebFrameProxy.cpp:
860         (WebKit::WebFrameProxy::receivedPolicyDecision):
861         * UIProcess/WebFrameProxy.h:
862         * UIProcess/WebInspectorProxy.cpp:
863         (WebKit::decidePolicyForNavigationAction):
864         * UIProcess/WebPageProxy.cpp:
865         (WebKit::WebPageProxy::receivedPolicyDecision):
866         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
867         * UIProcess/WebPageProxy.h:
868         * UIProcess/WebPageProxy.messages.in:
869         * WebKit2.xcodeproj/project.pbxproj:
870         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
871         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
872
873 2016-12-08  Antti Koivisto  <antti@apple.com>
874
875         Salt network cache hashes
876         https://bugs.webkit.org/show_bug.cgi?id=164924
877
878         Reviewed by Alex Christensen.
879
880         To enhance privacy make cache content unidentifiable from file names alone.
881         This is done by generating a unique persistent salt for each cache instance.
882         It is used when computing hashes used in file names.
883
884         The patch also replaces plain text partition directory names with salted hashes.
885
886         * NetworkProcess/cache/NetworkCache.cpp:
887         (WebKit::NetworkCache::Cache::makeCacheKey):
888         (WebKit::NetworkCache::makeCacheKey): Deleted.
889         * NetworkProcess/cache/NetworkCache.h:
890
891             Increment cache version.
892
893         * NetworkProcess/cache/NetworkCacheBlobStorage.cpp:
894         (WebKit::NetworkCache::BlobStorage::BlobStorage):
895         (WebKit::NetworkCache::BlobStorage::add):
896         (WebKit::NetworkCache::BlobStorage::get):
897
898             Use salt for blob content hash.
899
900         * NetworkProcess/cache/NetworkCacheBlobStorage.h:
901         * NetworkProcess/cache/NetworkCacheData.cpp:
902         (WebKit::NetworkCache::computeSHA1):
903
904             For simplicity all SHA1s are now salted.
905
906         (WebKit::NetworkCache::makeSalt):
907         (WebKit::NetworkCache::readOrMakeSalt):
908
909             Read salt if it exists, generate and persist it otherwise.
910
911         * NetworkProcess/cache/NetworkCacheData.h:
912         * NetworkProcess/cache/NetworkCacheKey.cpp:
913         (WebKit::NetworkCache::Key::Key):
914
915             Remove the "No partition" string and just empty.
916             That was only needed to have a directory name of some sort.
917
918         (WebKit::NetworkCache::Key::computeHash):
919
920             Use salt for key hash.
921
922         (WebKit::NetworkCache::Key::computePartitionHash):
923
924             Separate hash for partition.
925
926         * NetworkProcess/cache/NetworkCacheKey.h:
927         * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
928         (WebKit::NetworkCache::makeSubresourcesKey):
929         (WebKit::NetworkCache::SpeculativeLoadManager::PendingFrameLoad::saveToDiskIfReady):
930         (WebKit::NetworkCache::SpeculativeLoadManager::retrieveSubresourcesEntry):
931         * NetworkProcess/cache/NetworkCacheStorage.cpp:
932         (WebKit::NetworkCache::makeSaltFilePath):
933         (WebKit::NetworkCache::Storage::open):
934
935             Cache can't be opened if we can't read or persist a salt.
936
937         (WebKit::NetworkCache::traverseRecordsFiles):
938         (WebKit::NetworkCache::Storage::Storage):
939         (WebKit::NetworkCache::Storage::synchronize):
940         (WebKit::NetworkCache::Storage::recordDirectoryPathForKey):
941
942             Use the partition hash in the directory name instead of a plain text name.
943
944         (WebKit::NetworkCache::decodeRecordHeader):
945         (WebKit::NetworkCache::Storage::readRecord):
946         (WebKit::NetworkCache::Storage::encodeRecord):
947         (WebKit::NetworkCache::Storage::traverse):
948         (WebKit::NetworkCache::Storage::clear):
949         * NetworkProcess/cache/NetworkCacheStorage.h:
950         (WebKit::NetworkCache::Storage::salt):
951
952 2016-12-08  Eric Carlson  <eric.carlson@apple.com>
953
954         Fix the EFL build.
955
956         * UIProcess/WebPageProxy.cpp:
957         (WebKit::WebPageProxy::isPlayingMediaDidChange): Add another ENABLE(MEDIA_STREAM) guard.
958
959 2016-12-08  Tomas Popela  <tpopela@redhat.com>
960
961         [GTK] Process accelerated compositing env variables only if they are really enabled
962         https://bugs.webkit.org/show_bug.cgi?id=165300
963
964         Don't process the WEBKIT_FORCE_COMPOSITING_MODE and
965         WEBKIT_DISABLE_COMPOSITING_MODE env variables if they are disabled
966         (eg. WEBKIT_DISABLE_COMPOSITING_MODE=0).
967
968         Reviewed by Michael Catanzaro.
969
970         * UIProcess/gtk/WebPreferencesGtk.cpp:
971         (WebKit::WebPreferences::platformInitializeStore):
972
973 2016-12-08  Alex Christensen  <achristensen@webkit.org>
974
975         Fix CMake build.
976
977         * CMakeLists.txt:
978         Add the new NetworkProcess/capture include directory to find new headers from r209498.
979         * NetworkProcess/capture/NetworkCaptureEvent.cpp:
980         (WebKit::NetworkCapture::Response::Response):
981         (WebKit::NetworkCapture::Error::Error):
982         The String constructor was ambiguous after r209498 because URL has an operator NSString* and String has an NSString constructor.
983         We should get rid of operator NSString* and operator String on URL.
984         * UIProcess/WebPageProxy.cpp:
985         * UIProcess/WebPageProxy.h:
986         Add some ENABLE(MEDIA_STREAM) macros to fix the build without it enabled after r209512.
987
988 2016-12-08  Alex Christensen  <achristensen@webkit.org>
989
990         Fix iOS debug build after r209498
991         https://bugs.webkit.org/show_bug.cgi?id=164527
992
993         * NetworkProcess/capture/NetworkCaptureLogging.h:
994         Logs were causing compile warnings/errors.  Disable logs for now.
995
996 2016-12-07  Dean Jackson  <dino@apple.com>
997
998         Remove runtime toggle for pointer-lock
999         https://bugs.webkit.org/show_bug.cgi?id=165577
1000         <rdar://problems/29566996>
1001
1002         Reviewed by Jon Lee.
1003
1004         Remove any runtime calls to check if pointer-lock is enabled. It's
1005         either compiled in or out.
1006
1007         * Shared/WebPreferencesDefinitions.h:
1008         * UIProcess/API/C/WKPreferences.cpp:
1009         (WKPreferencesSetPointerLockEnabled): Deleted.
1010         (WKPreferencesGetPointerLockEnabled): Deleted.
1011         * UIProcess/API/C/WKPreferencesRefPrivate.h:
1012         * WebProcess/WebPage/WebPage.cpp:
1013         (WebKit::WebPage::updatePreferences):
1014
1015 2016-12-07  Eric Carlson  <eric.carlson@apple.com>
1016
1017         [MediaStream][Mac] Revoke sandbox extensions when capture ends
1018         https://bugs.webkit.org/show_bug.cgi?id=165476
1019
1020         Reviewed by Brady Eidson.
1021
1022         Track media capture by process so it is possible to revoke the sandbox extensions issued to
1023         a web process when capture stops. Allocate WK2 user media permission manager lazily rather
1024         than every time a page is created as most pages won't need one.
1025
1026         * CMakeLists.txt: Add new files.
1027
1028         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
1029         (WebKit::UserMediaPermissionRequestManagerProxy::UserMediaPermissionRequestManagerProxy): Register
1030           with process manager.
1031         (WebKit::UserMediaPermissionRequestManagerProxy::~UserMediaPermissionRequestManagerProxy):
1032         (WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasGranted): Move sandbox 
1033           extension code to the process manager.
1034         (WebKit::UserMediaPermissionRequestManagerProxy::stopCapture): New.
1035         (WebKit::UserMediaPermissionRequestManagerProxy::startedCaptureSession): New, report state
1036           change to the process manager.
1037         (WebKit::UserMediaPermissionRequestManagerProxy::endedCaptureSession): Ditto.
1038         * UIProcess/UserMediaPermissionRequestManagerProxy.h:
1039
1040         * UIProcess/UserMediaProcessManager.cpp: Added.
1041         (WebKit::ProcessState::ProcessState):
1042         (WebKit::ProcessState::managers):
1043         (WebKit::ProcessState::sandboxExtensionsGranted):
1044         (WebKit::ProcessState::setSandboxExtensionsGranted):
1045         (WebKit::stateMap):
1046         (WebKit::processState):
1047         (WebKit::ProcessState::addRequestManager):
1048         (WebKit::ProcessState::removeRequestManager):
1049         (WebKit::UserMediaProcessManager::singleton):
1050         (WebKit::UserMediaProcessManager::addUserMediaPermissionRequestManagerProxy):
1051         (WebKit::UserMediaProcessManager::removeUserMediaPermissionRequestManagerProxy):
1052         (WebKit::UserMediaProcessManager::willCreateMediaStream):
1053         (WebKit::UserMediaProcessManager::startedCaptureSession):
1054         (WebKit::UserMediaProcessManager::endedCaptureSession):
1055         * UIProcess/UserMediaProcessManager.h: Added.
1056
1057         * UIProcess/WebPageProxy.cpp:
1058         (WebKit::WebPageProxy::WebPageProxy): Don't allocate m_userMediaPermissionRequestManager.
1059         (WebKit::WebPageProxy::resetState): Set m_userMediaPermissionRequestManager to null.
1060         (WebKit::WebPageProxy::userMediaPermissionRequestManager): Allocate m_userMediaPermissionRequestManager
1061           lazily as most pages don't need it.
1062         (WebKit::WebPageProxy::requestUserMediaPermissionForFrame): Call userMediaPermissionRequestManager().
1063         (WebKit::WebPageProxy::enumerateMediaDevicesForFrame): Ditto.
1064         (WebKit::WebPageProxy::clearUserMediaState): Ditto.
1065         (WebKit::WebPageProxy::isPlayingMediaDidChange): Report capture state changes to the request
1066           manager proxy.
1067         * UIProcess/WebPageProxy.h:
1068
1069         * WebKit2.xcodeproj/project.pbxproj: Add new files.
1070
1071         * WebProcess/MediaStream/MediaDeviceSandboxExtensions.cpp: Added.
1072         (WebKit::MediaDeviceSandboxExtensions::MediaDeviceSandboxExtensions):
1073         (WebKit::MediaDeviceSandboxExtensions::encode):
1074         (WebKit::MediaDeviceSandboxExtensions::decode):
1075         (WebKit::MediaDeviceSandboxExtensions::operator[]):
1076         (WebKit::MediaDeviceSandboxExtensions::size):
1077         * WebProcess/MediaStream/MediaDeviceSandboxExtensions.h: Added.
1078
1079         * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
1080         (WebKit::UserMediaPermissionRequestManager::~UserMediaPermissionRequestManager): Sandbox extension
1081           is now in a HashMap, not a Vector.
1082         (WebKit::UserMediaPermissionRequestManager::grantUserMediaDeviceSandboxExtensions): Record
1083           IDs with extensions so they can be revoked later.
1084         (WebKit::UserMediaPermissionRequestManager::revokeUserMediaDeviceSandboxExtensions): New.
1085         (WebKit::UserMediaPermissionRequestManager::grantUserMediaDevicesSandboxExtension): Deleted.
1086         * WebProcess/MediaStream/UserMediaPermissionRequestManager.h:
1087
1088         * WebProcess/WebPage/WebPage.cpp:
1089         (WebKit::WebPage::grantUserMediaDeviceSandboxExtensions):
1090         (WebKit::WebPage::revokeUserMediaDeviceSandboxExtensions):
1091         (WebKit::WebPage::grantUserMediaDevicesSandboxExtension): Deleted.
1092         * WebProcess/WebPage/WebPage.h:
1093         * WebProcess/WebPage/WebPage.messages.in:
1094
1095 2016-12-07  Jeremy Jones  <jeremyj@apple.com>
1096
1097         One esc to exit fullscreen and pointer lock
1098         https://bugs.webkit.org/show_bug.cgi?id=165416
1099         rdar://problem/29430711
1100
1101         Reviewed by Jer Noble.
1102
1103         Fix a crash when didLosePointerLock is not specified.
1104
1105         * UIProcess/API/C/WKPage.cpp:
1106         (WKPageSetPageUIClient):
1107
1108 2016-12-07  Keith Rollin  <krollin@apple.com>
1109
1110         Network event record/replay
1111         https://bugs.webkit.org/show_bug.cgi?id=164527
1112         <rdar://problem/29168157>
1113
1114         Reviewed by Alex Christensen.
1115
1116         Add WebKit2/NetworkProcess/capture/* for recording the network events
1117         that occur when loading a page and for replaying them later. Update
1118         NetworkLoad to invoke capture facilities. Add preferences for enabling
1119         record or replay.
1120
1121         * CMakeLists.txt:
1122         * NetworkProcess/NetworkLoad.cpp:
1123         (WebKit::NetworkLoad::NetworkLoad):
1124         (WebKit::NetworkLoad::initializeForRecord):
1125         (WebKit::NetworkLoad::initializeForReplay):
1126         (WebKit::NetworkLoad::initialize):
1127         (WebKit::NetworkLoad::setDefersLoading):
1128         (WebKit::NetworkLoad::continueWillSendRequest):
1129         (WebKit::NetworkLoad::sharedWillSendRedirectedRequest):
1130         (WebKit::NetworkLoad::notifyDidReceiveResponse):
1131         (WebKit::NetworkLoad::didReceiveData):
1132         (WebKit::NetworkLoad::didCompleteWithError):
1133         * NetworkProcess/NetworkLoad.h:
1134         * NetworkProcess/NetworkProcess.cpp:
1135         (WebKit::NetworkProcess::initializeNetworkProcess):
1136         (WebKit::NetworkProcess::terminate):
1137         * NetworkProcess/NetworkProcessCreationParameters.cpp:
1138         (WebKit::NetworkProcessCreationParameters::encode):
1139         (WebKit::NetworkProcessCreationParameters::decode):
1140         * NetworkProcess/NetworkProcessCreationParameters.h:
1141         * NetworkProcess/capture/NetworkCaptureEvent.cpp: Added.
1142         (WebKit::NetworkCapture::copyHeaders):
1143         (WebKit::NetworkCapture::KeyValuePair::KeyValuePair):
1144         (WebKit::NetworkCapture::ResourceRequest::ResourceRequest):
1145         (WebKit::NetworkCapture::ResourceRequest::operator WebCore::ResourceRequest):
1146         (WebKit::NetworkCapture::ResourceResponse::ResourceResponse):
1147         (WebKit::NetworkCapture::ResourceResponse::operator WebCore::ResourceResponse):
1148         (WebKit::NetworkCapture::ResourceError::ResourceError):
1149         (WebKit::NetworkCapture::ResourceError::operator WebCore::ResourceError):
1150         (WebKit::NetworkCapture::JSONCoder::encode):
1151         (WebKit::NetworkCapture::JSONCoder::decode):
1152         (WebKit::NetworkCapture::JSONCoder<String>::encode):
1153         (WebKit::NetworkCapture::JSONCoder<String>::decode):
1154         (WebKit::NetworkCapture::JSONCoder<CaptureTimeType>::encode):
1155         (WebKit::NetworkCapture::JSONCoder<CaptureTimeType>::decode):
1156         (WebKit::NetworkCapture::JSONCoder<KeyValuePair>::encode):
1157         (WebKit::NetworkCapture::JSONCoder<KeyValuePair>::decode):
1158         (WebKit::NetworkCapture::JSONCoder<Vector<T>>::encode):
1159         (WebKit::NetworkCapture::JSONCoder<Vector<T>>::decode):
1160         (WebKit::NetworkCapture::JSONCoder<ResourceRequest>::encode):
1161         (WebKit::NetworkCapture::JSONCoder<ResourceRequest>::decode):
1162         (WebKit::NetworkCapture::JSONCoder<ResourceResponse>::encode):
1163         (WebKit::NetworkCapture::JSONCoder<ResourceResponse>::decode):
1164         (WebKit::NetworkCapture::JSONCoder<ResourceError>::encode):
1165         (WebKit::NetworkCapture::JSONCoder<ResourceError>::decode):
1166         (WebKit::NetworkCapture::JSONCoder<WebCore::SharedBuffer>::encode):
1167         (WebKit::NetworkCapture::JSONCoder<WebCore::SharedBuffer>::decode):
1168         (WebKit::NetworkCapture::JSONCoder<RequestSentEvent>::encode):
1169         (WebKit::NetworkCapture::JSONCoder<RequestSentEvent>::decode):
1170         (WebKit::NetworkCapture::JSONCoder<ResponseReceivedEvent>::encode):
1171         (WebKit::NetworkCapture::JSONCoder<ResponseReceivedEvent>::decode):
1172         (WebKit::NetworkCapture::JSONCoder<RedirectReceivedEvent>::encode):
1173         (WebKit::NetworkCapture::JSONCoder<RedirectReceivedEvent>::decode):
1174         (WebKit::NetworkCapture::JSONCoder<RedirectSentEvent>::encode):
1175         (WebKit::NetworkCapture::JSONCoder<RedirectSentEvent>::decode):
1176         (WebKit::NetworkCapture::JSONCoder<DataReceivedEvent>::encode):
1177         (WebKit::NetworkCapture::JSONCoder<DataReceivedEvent>::decode):
1178         (WebKit::NetworkCapture::JSONCoder<FinishedEvent>::encode):
1179         (WebKit::NetworkCapture::JSONCoder<FinishedEvent>::decode):
1180         (WebKit::NetworkCapture::eventToString):
1181         (WebKit::NetworkCapture::stringToEvent):
1182         * NetworkProcess/capture/NetworkCaptureEvent.h: Added.
1183         (WebKit::NetworkCapture::TimedEvent::TimedEvent):
1184         * NetworkProcess/capture/NetworkCaptureLogging.h: Added.
1185         * NetworkProcess/capture/NetworkCaptureManager.cpp: Added.
1186         (WebKit::NetworkCapture::Manager::singleton):
1187         (WebKit::NetworkCapture::Manager::initialize):
1188         (WebKit::NetworkCapture::Manager::terminate):
1189         (WebKit::NetworkCapture::Manager::findMatch):
1190         (WebKit::NetworkCapture::Manager::findExactMatch):
1191         (WebKit::NetworkCapture::Manager::findBestFuzzyMatch):
1192         (WebKit::NetworkCapture::Manager::fuzzyMatchURLs):
1193         (WebKit::NetworkCapture::Manager::loadResources):
1194         (WebKit::NetworkCapture::Manager::reportLoadPath):
1195         (WebKit::NetworkCapture::Manager::reportRecordPath):
1196         (WebKit::NetworkCapture::Manager::reportReplayPath):
1197         (WebKit::NetworkCapture::Manager::requestToPath):
1198         (WebKit::NetworkCapture::Manager::stringToHash):
1199         (WebKit::NetworkCapture::Manager::hashToPath):
1200         (WebKit::NetworkCapture::Manager::logRecordedResource):
1201         (WebKit::NetworkCapture::Manager::logLoadedResource):
1202         (WebKit::NetworkCapture::Manager::logPlayedBackResource):
1203         (WebKit::NetworkCapture::Manager::ensureFileHandle):
1204         (WebKit::NetworkCapture::Manager::openCacheFile):
1205         (WebKit::NetworkCapture::Manager::readFile):
1206         (WebKit::NetworkCapture::Manager::getLine):
1207         (WebKit::NetworkCapture::Manager::getWord):
1208         (WebKit::NetworkCapture::Manager::printToFile):
1209         * NetworkProcess/capture/NetworkCaptureManager.h: Added.
1210         (WebKit::NetworkCapture::Manager::isRecording):
1211         (WebKit::NetworkCapture::Manager::isReplaying):
1212         (WebKit::NetworkCapture::Manager::mode):
1213         * NetworkProcess/capture/NetworkCaptureRecorder.cpp: Added.
1214         (WebKit::NetworkCapture::Recorder::recordRequestSent):
1215         (WebKit::NetworkCapture::Recorder::recordResponseReceived):
1216         (WebKit::NetworkCapture::Recorder::recordRedirectReceived):
1217         (WebKit::NetworkCapture::Recorder::recordRedirectSent):
1218         (WebKit::NetworkCapture::Recorder::recordDataReceived):
1219         (WebKit::NetworkCapture::Recorder::recordFinish):
1220         (WebKit::NetworkCapture::Recorder::writeEvents):
1221         * NetworkProcess/capture/NetworkCaptureRecorder.h: Added.
1222         (WebKit::NetworkCapture::Recorder::recordEvent):
1223         * NetworkProcess/capture/NetworkCaptureReplayer.cpp: Added.
1224         (WebKit::NetworkCapture::Replayer::replayResource):
1225         * NetworkProcess/capture/NetworkCaptureReplayer.h: Added.
1226         * NetworkProcess/capture/NetworkCaptureResource.cpp: Added.
1227         (WebKit::NetworkCapture::Resource::Resource):
1228         (WebKit::NetworkCapture::Resource::url):
1229         (WebKit::NetworkCapture::Resource::baseURL):
1230         (WebKit::NetworkCapture::Resource::queryParameters):
1231         (WebKit::NetworkCapture::Resource::eventStream):
1232         (WebKit::NetworkCapture::Resource::EventStream::EventStream):
1233         (WebKit::NetworkCapture::Resource::EventStream::nextEvent):
1234         * NetworkProcess/capture/NetworkCaptureResource.h: Added.
1235         * NetworkProcess/capture/NetworkCaptureTypes.h: Added.
1236         (WebKit::NetworkCapture::TypeHolder::forEachTypeImpl):
1237         (WebKit::NetworkCapture::TypeHolder::forEachType):
1238         * NetworkProcess/capture/NetworkDataTaskReplay.cpp: Added.
1239         (WebKit::NetworkCapture::NetworkDataTaskReplay::NetworkDataTaskReplay):
1240         (WebKit::NetworkCapture::NetworkDataTaskReplay::~NetworkDataTaskReplay):
1241         (WebKit::NetworkCapture::NetworkDataTaskReplay::resume):
1242         (WebKit::NetworkCapture::NetworkDataTaskReplay::suspend):
1243         (WebKit::NetworkCapture::NetworkDataTaskReplay::cancel):
1244         (WebKit::NetworkCapture::NetworkDataTaskReplay::complete):
1245         (WebKit::NetworkCapture::NetworkDataTaskReplay::invalidateAndCancel):
1246         (WebKit::NetworkCapture::NetworkDataTaskReplay::enqueueEventHandler):
1247         (WebKit::NetworkCapture::NetworkDataTaskReplay::replayRequestSent):
1248         (WebKit::NetworkCapture::NetworkDataTaskReplay::replayResponseReceived):
1249         (WebKit::NetworkCapture::NetworkDataTaskReplay::replayRedirectReceived):
1250         (WebKit::NetworkCapture::NetworkDataTaskReplay::replayRedirectSent):
1251         (WebKit::NetworkCapture::NetworkDataTaskReplay::replayDataReceived):
1252         (WebKit::NetworkCapture::NetworkDataTaskReplay::replayFinished):
1253         (WebKit::NetworkCapture::NetworkDataTaskReplay::didReceiveResponse):
1254         (WebKit::NetworkCapture::NetworkDataTaskReplay::didFinish):
1255         * NetworkProcess/capture/NetworkDataTaskReplay.h: Added.
1256         (WebKit::NetworkCapture::NetworkDataTaskReplay::create):
1257         * NetworkProcess/capture/json.hpp: Added.
1258         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
1259         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
1260         * WebKit2.xcodeproj/project.pbxproj:
1261         * config.h:
1262
1263 2016-12-07  Anders Carlsson  <andersca@apple.com>
1264
1265         Fix build.
1266
1267         * Platform/IPC/mac/ConnectionMac.mm:
1268         (IPC::Connection::open):
1269
1270 2016-12-07  Anders Carlsson  <andersca@apple.com>
1271
1272         Rename the connection sources to better indicate what data direction they are used for
1273         https://bugs.webkit.org/show_bug.cgi?id=165548
1274
1275         Reviewed by Tim Horton.
1276
1277         * Platform/IPC/Connection.h:
1278         * Platform/IPC/mac/ConnectionMac.mm:
1279         (IPC::Connection::platformInvalidate):
1280         (IPC::Connection::platformInitialize):
1281         (IPC::createReceiveSource):
1282         (IPC::Connection::initializeSendSource):
1283         (IPC::Connection::receiveSourceEventHandler):
1284         (IPC::createDataAvailableSource): Deleted.
1285         (IPC::Connection::initializeDeadNameSource): Deleted.
1286         Rename m_deadNameSource to m_sendSource, and m_receivePortDataAvailableSource to m_receiveSource.
1287
1288         (IPC::Connection::open):
1289         Initialize the send source before we attempt to send a first message.
1290
1291 2016-12-07  Simon Fraser  <simon.fraser@apple.com>
1292
1293         Fix use of enum in a WK2 C SPI header.
1294         rdar://problem/28725583
1295
1296         Followup to correctly prefix the enum values.
1297
1298         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
1299         (WKBundlePageSetEventThrottlingBehaviorOverride):
1300         * WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h:
1301
1302 2016-12-07  Simon Fraser  <simon.fraser@apple.com>
1303
1304         Fix use of enum in a WK2 C SPI header.
1305         rdar://problem/28725583
1306
1307         Reviewed by Dan Bernstein.
1308
1309         Use correct enum style for a C SPI header and fix the callers.
1310
1311         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
1312         (WKBundlePageSetEventThrottlingBehaviorOverride):
1313         * WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h:
1314
1315 2016-12-07  Beth Dakin  <bdakin@apple.com>
1316
1317         Remove iCloud Pages and Keynote site-specific hacks
1318         https://bugs.webkit.org/show_bug.cgi?id=165544
1319         -and corresponding-
1320         rdar://problem/29082536
1321
1322         Reviewed by Wenson Hsieh.
1323
1324         * WebProcess/WebPage/WebPage.cpp:
1325         (WebKit::needsHiddenContentEditableQuirk):
1326         (WebKit::needsPlainTextQuirk):
1327
1328 2016-12-05  Ada Chan  <adachan@apple.com>
1329
1330         Add a getter for serverTrust in _WKObservablePageState
1331         https://bugs.webkit.org/show_bug.cgi?id=165433
1332
1333         Reviewed by Anders Carlsson.
1334
1335         * UIProcess/API/C/mac/WKPagePrivateMac.h:
1336         * UIProcess/API/C/mac/WKPagePrivateMac.mm:
1337         (-[WKObservablePageState serverTrust]):
1338
1339 2016-12-07  Jer Noble  <jer.noble@apple.com>
1340
1341         Exiting Element Fullscreen mode loses focus on WKWebView.
1342         https://bugs.webkit.org/show_bug.cgi?id=165512
1343
1344         Reviewed by Eric Carlson.
1345
1346         Setting 'window.contentView.hidden = YES' will reset the first-responder (whereas
1347         previously setting 'window.contentView.layer.hidden = YES' did not). Grab the first-
1348         responder before doing so, so that it can be reset correctly when moving the WKWebView
1349         back to it's original window.
1350
1351         * UIProcess/mac/WKFullScreenWindowController.mm:
1352         (-[WKFullScreenWindowController finishedExitFullScreenAnimation:]):
1353
1354 2016-12-07  Alex Christensen  <achristensen@webkit.org>
1355
1356         Fix CMake build after r209418.
1357         https://bugs.webkit.org/show_bug.cgi?id=165484
1358
1359         * PlatformMac.cmake:
1360
1361 2016-12-07  Philippe Normand  <pnormand@igalia.com>
1362
1363         Unreviewed, GTK build fix after r209407.
1364
1365         * Platform/IPC/unix/ConnectionUnix.cpp:
1366         (IPC::Connection::processMessage):
1367         * UIProcess/LegacySessionStateCodingNone.cpp:
1368         (WebKit::decodeLegacySessionState):
1369
1370 2016-12-06  Ryan Haddad  <ryanhaddad@apple.com>
1371
1372         Unreviewed, rolling out r209422.
1373
1374         This change caused assertion failures during API tests.
1375
1376         Reverted changeset:
1377
1378         "[MediaStream][Mac] Revoke sandbox extensions when capture
1379         ends"
1380         https://bugs.webkit.org/show_bug.cgi?id=165476
1381         http://trac.webkit.org/changeset/209422
1382
1383 2016-12-06  Dean Jackson  <dino@apple.com>
1384
1385         Include default value in Experimental Feature information
1386         https://bugs.webkit.org/show_bug.cgi?id=165509
1387         <rdar://problems/29547177>
1388
1389         Reviewed by Tim Horton.
1390
1391         Add a defaultValue member variable to experimental
1392         features, both the C++ and ObjC interfaces.
1393
1394         * UIProcess/API/APIExperimentalFeature.cpp:
1395         (API::ExperimentalFeature::create):
1396         (API::ExperimentalFeature::ExperimentalFeature):
1397         * UIProcess/API/APIExperimentalFeature.h:
1398         * UIProcess/API/Cocoa/_WKExperimentalFeature.h:
1399         * UIProcess/API/Cocoa/_WKExperimentalFeature.mm:
1400         (-[_WKExperimentalFeature description]):
1401         (-[_WKExperimentalFeature defaultValue]):
1402         * UIProcess/WebPreferences.cpp:
1403         (WebKit::createExperimentalFeaturesVector):
1404
1405 2016-12-06  Commit Queue  <commit-queue@webkit.org>
1406
1407         Unreviewed, rolling out r209391.
1408         https://bugs.webkit.org/show_bug.cgi?id=165501
1409
1410         requires explicit nullptr checks so missing env vars don't
1411         flip AC mode (Requested by mcatanzaro on #webkit).
1412
1413         Reverted changeset:
1414
1415         "[GTK] Process accelerated compositing env variables only if
1416         they are really enabled"
1417         https://bugs.webkit.org/show_bug.cgi?id=165300
1418         http://trac.webkit.org/changeset/209391
1419
1420 2016-12-06  Alexey Proskuryakov  <ap@apple.com>
1421
1422         Correct SDKROOT values in xcconfig files
1423         https://bugs.webkit.org/show_bug.cgi?id=165487
1424         rdar://problem/29539209
1425
1426         Reviewed by Dan Bernstein.
1427
1428         Fix suggested by Dan Bernstein.
1429
1430         * Configurations/DebugRelease.xcconfig:
1431
1432 2016-12-06  Andreas Kling  <akling@apple.com>
1433
1434         [Cocoa] Add some memory usage related information to sysdiagnose state dumps
1435         <https://webkit.org/b/165375>
1436         <rdar://problem/29057243>
1437
1438         Reviewed by Darin Adler.
1439
1440         Follow-up to address two more review comments.
1441
1442         * WebProcess/cocoa/WebProcessCocoa.mm:
1443         (WebKit::WebProcess::registerWithStateDumper): Use adoptNS() instead of autorelease for NSStrings.
1444
1445 2016-12-06  Eric Carlson  <eric.carlson@apple.com>
1446
1447         [MediaStream][Mac] Revoke sandbox extensions when capture ends
1448         https://bugs.webkit.org/show_bug.cgi?id=165476
1449
1450         Reviewed by Brady Eidson.
1451         
1452         Track media capture by process so it is possible to revoke the sandbox extensions issued to
1453         a web process when capture stops.
1454
1455         * CMakeLists.txt: Add new files.
1456
1457         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
1458         (WebKit::UserMediaPermissionRequestManagerProxy::UserMediaPermissionRequestManagerProxy): Register
1459           with process manager.
1460         (WebKit::UserMediaPermissionRequestManagerProxy::~UserMediaPermissionRequestManagerProxy):
1461         (WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasGranted): Move sandbox 
1462           extension code to the process manager.
1463         (WebKit::UserMediaPermissionRequestManagerProxy::stopCapture): New.
1464         (WebKit::UserMediaPermissionRequestManagerProxy::startedCaptureSession): New, report state
1465           change to the process manager.
1466         (WebKit::UserMediaPermissionRequestManagerProxy::endedCaptureSession): Ditto.
1467         * UIProcess/UserMediaPermissionRequestManagerProxy.h:
1468
1469         * UIProcess/UserMediaProcessManager.cpp: Added.
1470         (WebKit::ProcessState::ProcessState):
1471         (WebKit::ProcessState::managers):
1472         (WebKit::ProcessState::sandboxExtensionsGranted):
1473         (WebKit::ProcessState::setSandboxExtensionsGranted):
1474         (WebKit::stateMap):
1475         (WebKit::processState):
1476         (WebKit::ProcessState::addRequestManager):
1477         (WebKit::ProcessState::removeRequestManager):
1478         (WebKit::UserMediaProcessManager::singleton):
1479         (WebKit::UserMediaProcessManager::addUserMediaPermissionRequestManagerProxy):
1480         (WebKit::UserMediaProcessManager::removeUserMediaPermissionRequestManagerProxy):
1481         (WebKit::UserMediaProcessManager::willCreateMediaStream):
1482         (WebKit::UserMediaProcessManager::startedCaptureSession):
1483         (WebKit::UserMediaProcessManager::endedCaptureSession):
1484         * UIProcess/UserMediaProcessManager.h: Added.
1485
1486         * UIProcess/WebPageProxy.cpp:
1487         (WebKit::WebPageProxy::isPlayingMediaDidChange): Report capture state changes to the request
1488           manager proxy.
1489         * UIProcess/WebPageProxy.h:
1490
1491         * WebKit2.xcodeproj/project.pbxproj: Add new files.
1492
1493         * WebProcess/MediaStream/MediaDeviceSandboxExtensions.cpp: Added.
1494         (WebKit::MediaDeviceSandboxExtensions::MediaDeviceSandboxExtensions):
1495         (WebKit::MediaDeviceSandboxExtensions::encode):
1496         (WebKit::MediaDeviceSandboxExtensions::decode):
1497         (WebKit::MediaDeviceSandboxExtensions::operator[]):
1498         (WebKit::MediaDeviceSandboxExtensions::size):
1499         * WebProcess/MediaStream/MediaDeviceSandboxExtensions.h: Added.
1500
1501         * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
1502         (WebKit::UserMediaPermissionRequestManager::~UserMediaPermissionRequestManager): Sandbox extension
1503           is now in a HashMap, not a Vector.
1504         (WebKit::UserMediaPermissionRequestManager::grantUserMediaDeviceSandboxExtensions): Record
1505           IDs with extensions so they can be revoked later.
1506         (WebKit::UserMediaPermissionRequestManager::revokeUserMediaDeviceSandboxExtensions): New.
1507         (WebKit::UserMediaPermissionRequestManager::grantUserMediaDevicesSandboxExtension): Deleted.
1508         * WebProcess/MediaStream/UserMediaPermissionRequestManager.h:
1509
1510         * WebProcess/WebPage/WebPage.cpp:
1511         (WebKit::WebPage::grantUserMediaDeviceSandboxExtensions):
1512         (WebKit::WebPage::revokeUserMediaDeviceSandboxExtensions):
1513         (WebKit::WebPage::grantUserMediaDevicesSandboxExtension): Deleted.
1514         * WebProcess/WebPage/WebPage.h:
1515         * WebProcess/WebPage/WebPage.messages.in:
1516
1517 2016-12-06  Anders Carlsson  <andersca@apple.com>
1518
1519         Add a new MachMessage class and use it for sending outgoing messages
1520         https://bugs.webkit.org/show_bug.cgi?id=165484
1521
1522         Reviewed by Sam Weinig.
1523
1524         * Platform/IPC/mac/ConnectionMac.mm:
1525         (IPC::Connection::sendOutgoingMessage):
1526         Instead of trying to randomly use memory from the stack as well as using mmap for the message data for out of line messages
1527         (which makes no sense at all, since the body data is already mmapped), just always create a MachMessage object and use it.
1528         
1529         (IPC::machMessageSize): Deleted.
1530         This has been moved to MachMessage::messageSize().
1531         
1532         * Platform/IPC/mac/MachMessage.cpp: Added.
1533         (IPC::MachMessage::create):
1534         Allocate extra memory to store the actual buffer.
1535
1536         (IPC::MachMessage::MachMessage):
1537         Initialize variables. m_size isn't really used right now, but will be in a subsequent patch.
1538
1539         (IPC::MachMessage::header):
1540         Return the header.
1541         
1542         * Platform/IPC/mac/MachMessage.h: Added.
1543         (IPC::MachMessage::length):
1544
1545         * WebKit2.xcodeproj/project.pbxproj:
1546         Add new files.
1547
1548 2016-12-06  Simon Fraser  <simon.fraser@apple.com>
1549
1550         Enable visual viewports by default on Mac, and iOS Wk2
1551         https://bugs.webkit.org/show_bug.cgi?id=165452
1552
1553         Reviewed by Zalan Bujtas.
1554
1555         Turn visual viewports on by default for WK2.
1556
1557         * Shared/WebPreferencesDefinitions.h:
1558
1559 2016-12-06  Daniel Bates  <dabates@apple.com>
1560
1561         WebKitTestRunner: Plugins are disabled in new windows
1562         https://bugs.webkit.org/show_bug.cgi?id=165410
1563
1564         Reviewed by Alex Christensen.
1565
1566         Remove SPI exposed to explicitly toggle plugins from WebKitTestRunner.
1567         Instead we will update WebKitTestRunner to make use of the SPI
1568         WKBundleOverrideBoolPreferenceForTestRunner() to toggle plugins in
1569         all windows.
1570
1571         * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
1572         (WKBundleSetPluginsEnabled): Deleted.
1573         * WebProcess/InjectedBundle/API/c/WKBundlePrivate.h:
1574         * WebProcess/InjectedBundle/InjectedBundle.cpp:
1575         (WebKit::InjectedBundle::setPluginsEnabled): Deleted.
1576
1577 2016-12-05  Anders Carlsson  <andersca@apple.com>
1578
1579         Don't memcpy out of line data
1580         https://bugs.webkit.org/show_bug.cgi?id=165434
1581
1582         Reviewed by Sam Weinig.
1583
1584         Change the Decoder constructor to take a buffer deallocator parameter. If the buffer deallocator is null, the
1585         data will be copied as before. Otherwise, the memory will be adopted by the Decoder object, and will be deallocated
1586         by invoking the data deallocator.
1587
1588         * Platform/IPC/Decoder.cpp:
1589         (IPC::copyBuffer):
1590         Add a new helper.
1591
1592         (IPC::Decoder::Decoder):
1593         Copy the buffer if the deallocator is null.
1594
1595         (IPC::Decoder::~Decoder):
1596         Invoke the deallocator or call fastFree if it is null.
1597
1598         (IPC::Decoder::unwrapForTesting):
1599         Update constructor.
1600         
1601         (IPC::roundUpToAlignment):
1602         (IPC::Decoder::alignBufferPosition):
1603         (IPC::Decoder::decodeVariableLengthByteArray):
1604         (IPC::decodeValueFromBuffer):
1605         Change all these to deal with const pointers.
1606
1607         * Platform/IPC/Decoder.h:
1608         Add new members.
1609
1610         * Platform/IPC/mac/ConnectionMac.mm:
1611         (IPC::createMessageDecoder):
1612         When we have out of line data, pass a deallocator that calls vm_deallocate, instead of copying the data
1613         and then immediately throwing the original away.
1614
1615 2016-12-06  Tim Horton  <timothy_horton@apple.com>
1616
1617         Almost half-second stall scrolling apple.com because of synchronous getPositionInformation
1618         https://bugs.webkit.org/show_bug.cgi?id=165403
1619         <rdar://problem/29493285>
1620
1621         Reviewed by Enrica Casucci.
1622
1623         When retrieving interaction information, we don't always need to do
1624         snapshots for 3D Touch or the action sheet, especially if we're
1625         synchronously blocking the UI process main thread waiting for the reply.
1626
1627         Add a new InteractionInformationRequest, which allows callers of
1628         getPositionInformation and requestPositionInformation to specify which
1629         optional pieces of information they would like to compute.
1630
1631         * Shared/AssistedNodeInformation.h:
1632         Fix a incorrect comment.
1633
1634         * Shared/ios/InteractionInformationRequest.cpp: Added.
1635         (WebKit::InteractionInformationRequest::encode):
1636         (WebKit::InteractionInformationRequest::decode):
1637         (WebKit::InteractionInformationRequest::isValidForRequest):
1638         * Shared/ios/InteractionInformationRequest.h: Added.
1639         (WebKit::InteractionInformationRequest::InteractionInformationRequest):
1640         * WebKit2.xcodeproj/project.pbxproj:
1641         Add InteractionInformationRequest, which encapsulates all of the
1642         parameters required to generate an InteractionInformationAtPosition.
1643         Previously, that was just a point, but now we have two new parameters:
1644         whether we should generate a snapshot of the element, and whether
1645         we should generate a TextIndicator if the element is a link.
1646
1647         * Shared/ios/InteractionInformationAtPosition.h:
1648         * Shared/ios/InteractionInformationAtPosition.mm:
1649         (WebKit::InteractionInformationAtPosition::encode):
1650         (WebKit::InteractionInformationAtPosition::decode):
1651         (WebKit::InteractionInformationAtPosition::mergeCompatibleOptionalInformation):
1652         Adopt InteractionInformationRequest.
1653
1654         * UIProcess/WebPageProxy.h:
1655         * UIProcess/ios/WebPageProxyIOS.mm:
1656         (WebKit::WebPageProxy::getPositionInformation):
1657         (WebKit::WebPageProxy::requestPositionInformation):
1658         * UIProcess/ios/WKActionSheetAssistant.mm:
1659         (-[WKActionSheetAssistant initialPresentationRectInHostViewForSheet]):
1660         (-[WKActionSheetAssistant presentationRectInHostViewForSheet]):
1661         (-[WKActionSheetAssistant showImageSheet]):
1662         (-[WKActionSheetAssistant showLinkSheet]):
1663         * UIProcess/ios/WKPDFView.mm:
1664         (-[WKPDFView annotation:isBeingPressedAtPoint:controller:]):
1665         * WebProcess/WebPage/WebPage.h:
1666         * WebProcess/WebPage/WebPage.messages.in:
1667         Adopt InteractionInformationRequest.
1668         
1669         * UIProcess/ios/WKContentViewInteraction.h:
1670         * UIProcess/ios/WKContentViewInteraction.mm:
1671         (-[WKContentView _showAttachmentSheet]):
1672         (-[WKContentView ensurePositionInformationIsUpToDate:]):
1673         If we have a outstanding asynchronous position information request
1674         for the current point, instead of sending a second separate request,
1675         just wait for the async one to come in.
1676
1677         (-[WKContentView requestAsynchronousPositionInformationUpdate:]):
1678         If asked to do an asynchronous request with more optional bits than
1679         the current otherwise-valid response's request, update the position information.
1680
1681         (-[WKContentView gestureRecognizerShouldBegin:]):
1682         The design of this mechanism is that during the highlight long press,
1683         we do an async position information update, and then when we actually
1684         begin a 3D Touch gesture, we hope to already have the requisite snapshots
1685         ready (so that we can avoid synchronously blocking for them, there).
1686         So, in the highlight long-press async request, ask for all the goodies.
1687
1688         (-[WKContentView hasSelectablePositionAtPoint:]):
1689         (-[WKContentView pointIsNearMarkedText:]):
1690         (-[WKContentView pointIsInAssistedNode:]):
1691         (-[WKContentView _didNotHandleTapAsClick:]):
1692         (-[WKContentView _positionInformationDidChange:]):
1693         If we get a position information update for the same point, but with less
1694         goodies attached (the snapshot/link indicator), copy them over from the old
1695         position information, so that we never accidentally "downgrade" our info.
1696
1697         (-[WKContentView updatePositionInformationForActionSheetAssistant:]):
1698         (-[WKContentView actionSheetAssistant:willStartInteractionWithElement:]):
1699         (-[WKContentView _interactionShouldBeginFromPreviewItemController:forPosition:]):
1700         (-[WKContentView _dataForPreviewItemController:atPosition:type:]):
1701         (-[WKContentView _presentedViewControllerForPreviewItemController:]):        
1702         More adoption.
1703         
1704         * WebProcess/WebPage/ios/WebPageIOS.mm:
1705         (WebKit::WebPage::handleTap):
1706         (WebKit::WebPage::handleTwoFingerTapAtPoint):
1707         (WebKit::WebPage::commitPotentialTap):
1708         Adopt InteractionInformationRequest.
1709
1710         (WebKit::WebPage::getPositionInformation):
1711         (WebKit::WebPage::requestPositionInformation):
1712         Copy the request into the response.
1713         Only snapshot if the request wants a snapshot.
1714         Only make a link indicator if the request wants one.
1715
1716 2016-12-06  Daniel Bates  <dabates@apple.com>
1717
1718         Cleanup: Rename some HTTP 0.9-specific functions to conform to WebKit Code Style Guidelines
1719         https://bugs.webkit.org/show_bug.cgi?id=165451
1720
1721         Reviewed by Alex Christensen.
1722
1723         * NetworkProcess/NetworkDataTask.cpp:
1724         (WebKit::NetworkDataTask::didReceiveResponse):
1725
1726 2016-12-06  Daniel Bates  <dabates@apple.com>
1727
1728         Remove unused InjectedBundle::overrideXSSAuditorEnabledForTestRunner()
1729         https://bugs.webkit.org/show_bug.cgi?id=165408
1730
1731         Reviewed by Alex Christensen.
1732
1733         InjectedBundle::overrideXSSAuditorEnabledForTestRunner() is unused. This function was only
1734         called by WKBundleOverrideXSSAuditorEnabledForTestRunner(), which was removed in r106005.
1735
1736         * WebProcess/InjectedBundle/InjectedBundle.cpp:
1737         (WebKit::InjectedBundle::overrideXSSAuditorEnabledForTestRunner): Deleted.
1738         * WebProcess/InjectedBundle/InjectedBundle.h:
1739
1740 2016-12-04  Darin Adler  <darin@apple.com>
1741
1742         Use ASCIICType more, and improve it a little bit
1743         https://bugs.webkit.org/show_bug.cgi?id=165360
1744
1745         Reviewed by Sam Weinig.
1746
1747         * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp:
1748         (WebKit::capitalizeRFC822HeaderFieldName): Removed unneeded checks to simplify code.
1749
1750 2016-12-06  Dave Hyatt  <hyatt@apple.com>
1751
1752         [CSS Parser] Turn on the new CSS parser
1753         https://bugs.webkit.org/show_bug.cgi?id=165213
1754
1755         Reviewed by Zalan Bujtas.
1756
1757         * Shared/WebPreferencesDefinitions.h:
1758
1759 2016-12-06  Tomas Popela  <tpopela@redhat.com>
1760
1761         [GTK] Process accelerated compositing env variables only if they are really enabled
1762         https://bugs.webkit.org/show_bug.cgi?id=165300
1763
1764         Don't process the WEBKIT_FORCE_COMPOSITING_MODE and
1765         WEBKIT_DISABLE_COMPOSITING_MODE env variables if they are disabled
1766         (eg. WEBKIT_DISABLE_COMPOSITING_MODE=0).
1767
1768         Reviewed by Michael Catanzaro.
1769
1770         * UIProcess/gtk/WebPreferencesGtk.cpp:
1771         (WebKit::WebPreferences::platformInitializeStore):
1772
1773 2016-12-06  Sam Weinig  <sam@webkit.org>
1774
1775         [WebIDL] Add support for converting dictionaries to JS
1776         https://bugs.webkit.org/show_bug.cgi?id=165367
1777
1778         Reviewed by Darin Adler and Alex Christensen.
1779
1780         * CMakeLists.txt:
1781         Add missing directories to look in for headers.
1782
1783 2016-12-05  Tim Horton  <timothy_horton@apple.com>
1784
1785         Try to fix the iOS Simulator build.
1786
1787         * UIProcess/mac/RemoteLayerTreeHost.mm:
1788         (WebKit::RemoteLayerTreeHost::mapAllIOSurfaceBackingStore):
1789
1790 2016-12-03  Simon Fraser  <simon.fraser@apple.com>
1791
1792         Minor reformat and renames in -didUpdateVisibleRect:
1793         https://bugs.webkit.org/show_bug.cgi?id=165365
1794
1795         Reviewed by Dave Hyatt.
1796         
1797         didUpdateVisibleRect:... has lots of parameters. Put one on each line.
1798
1799         Rename the rects to make it clear they are "content" rects (i.e. in document coordinates).
1800
1801         * UIProcess/ios/WKContentView.h:
1802         * UIProcess/ios/WKContentView.mm:
1803         (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:obscuredInset:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]):
1804
1805 2016-12-05  Tim Horton  <timothy_horton@apple.com>
1806
1807         Adopt CAMachPort-as-layer-contents
1808         https://bugs.webkit.org/show_bug.cgi?id=141687
1809         <rdar://problem/19393233>
1810
1811         Reviewed by Darin Adler.
1812
1813         * Shared/mac/RemoteLayerBackingStore.h:
1814         * Shared/mac/RemoteLayerBackingStore.mm:
1815         (WebKit::RemoteLayerBackingStore::decode):
1816         On the UI process side, instead of actually looking up the surface,
1817         just keep the MachSendRight around, to later be turned into a CAMachPort.
1818
1819         (WebKit::RemoteLayerBackingStore::applyBackingStoreToLayer):
1820         Make a CAMachPort and leak our send right into it. CAMachPort
1821         will adopt the port and destroy it when needed.
1822
1823         (WebKit::RemoteLayerBackingStore::setBufferVolatility):
1824         Tiny style fix.
1825
1826         * Shared/mac/RemoteLayerTreePropertyApplier.h:
1827         * Shared/mac/RemoteLayerTreePropertyApplier.mm:
1828         (WebKit::applyPropertiesToLayer):
1829         (WebKit::RemoteLayerTreePropertyApplier::applyProperties):
1830         * UIProcess/DrawingAreaProxy.h:
1831         (WebKit::DrawingAreaProxy::prepareForAppSuspension):
1832         * UIProcess/ios/WebPageProxyIOS.mm:
1833         (WebKit::WebPageProxy::applicationDidFinishSnapshottingAfterEnteringBackground):
1834         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h:
1835         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
1836         (WebKit::RemoteLayerTreeDrawingAreaProxy::prepareForAppSuspension):
1837         * UIProcess/mac/RemoteLayerTreeHost.h:
1838         * UIProcess/mac/RemoteLayerTreeHost.mm:
1839         (WebKit::RemoteLayerTreeHost::updateLayerTree):
1840         (WebKit::RemoteLayerTreeHost::mapAllIOSurfaceBackingStore):
1841         * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
1842         (WebKit::PlatformCALayerRemote::recursiveBuildTransaction):
1843         Two supporting changes in order to fix the two regressions that this
1844         caused when we tried to land it two years ago:
1845
1846         When an app is being suspended, resolve all CAMachPort backing store
1847         into actual IOSurfaces. Otherwise, any live CAMachPorts will keep a
1848         +1 on their respective IOSurface's use count, causing us to fail to
1849         mark them volatile, keeping the app alive for more time (re-trying the
1850         volatility change), and increasing the likelihood of background jetsam.
1851
1852         If the debugging tile map is enabled, do not use CAMachPort, because
1853         we don't have a great way to plumb the same CAMachPort to two layers
1854         (and it doesn't seem to work even if you do). Instead, just map the
1855         IOSurface into the UI process like we used to.
1856
1857 2016-12-05  Dean Jackson  <dino@apple.com>
1858
1859         pointer lock needs to be feature detectable
1860         https://bugs.webkit.org/show_bug.cgi?id=165426
1861         <rdar://problem/29486715>
1862
1863         Reviewed by Antoine Quint.
1864
1865         Set the RuntimeEnabledFeature as preferences
1866         change.
1867
1868         * UIProcess/API/C/WKPreferences.cpp:
1869         (WKPreferencesSetPointerLockEnabled):
1870         (WKPreferencesGetPointerLockEnabled):
1871         * UIProcess/API/C/WKPreferencesRefPrivate.h:
1872         * WebProcess/WebPage/WebPage.cpp:
1873         (WebKit::WebPage::updatePreferences):
1874
1875 2016-12-05  Andreas Kling  <akling@apple.com>
1876
1877         [Cocoa] Add some memory usage related information to sysdiagnose state dumps
1878         <https://webkit.org/b/165375>
1879         <rdar://problem/29057243>
1880
1881         Reviewed by Darin Adler.
1882
1883         Add two new entries to the sysdiagnose state dumps for WebContent processes:
1884         "Memory Usage Stats" and "JavaScript Object Counts".
1885
1886         The first category contains all the interesting stuff from task_info()
1887         along with some WebCore and JavaScriptCore object/memory counters.
1888
1889         The second category contains a list of all the JS object types currently live
1890         on the heap, along with a count.
1891
1892         * WebProcess/cocoa/WebProcessCocoa.mm:
1893         (WebKit::WebProcess::registerWithStateDumper): Add two new entries to the
1894         state dictionary: "Memory Usage Stats" and "JavaScript Object Counts".
1895
1896 2016-12-05  Csaba Osztrogonác  <ossy@webkit.org>
1897
1898         Unreviewed cmake buildfix after r209307.
1899
1900         * PlatformMac.cmake:
1901
1902 2016-12-03  Dan Bernstein  <mitz@apple.com>
1903
1904         [Cocoa] Expose InjectedBundlePageEditorClient via the Objective-C bundle SPI
1905         https://bugs.webkit.org/show_bug.cgi?id=165276
1906         <rdar://problem/29467040>
1907
1908         Reviewed by Darin Adler.
1909
1910         Test: TestWebKitAPI/Tests/WebKit2Cocoa/BundleEditingDelegate.mm
1911
1912         * Shared/Cocoa/APIObject.mm:
1913         (API::Object::newObject): Wrap InjectedBundleRangeHandle in WKWebProcessPlugInRangeHandle.
1914
1915         * WebKit2.xcodeproj/project.pbxproj: Added references to new files, making
1916           WKWebProcessPlugInEditingDelegate.h and WKWebProcessPlugInRangeHandle.h private headers.
1917
1918         * WebProcess/InjectedBundle/API/APIInjectedBundleEditorClient.h: Added. An base class
1919           based on InjectedBundlePageEditorClient.
1920         (API::InjectedBundle::EditorClient::~EditorClient):
1921         (API::InjectedBundle::EditorClient::shouldBeginEditing):
1922         (API::InjectedBundle::EditorClient::shouldEndEditing):
1923         (API::InjectedBundle::EditorClient::shouldInsertNode):
1924         (API::InjectedBundle::EditorClient::shouldInsertText):
1925         (API::InjectedBundle::EditorClient::shouldDeleteRange):
1926         (API::InjectedBundle::EditorClient::shouldChangeSelectedRange):
1927         (API::InjectedBundle::EditorClient::shouldApplyStyle):
1928         (API::InjectedBundle::EditorClient::didBeginEditing):
1929         (API::InjectedBundle::EditorClient::didEndEditing):
1930         (API::InjectedBundle::EditorClient::didChange):
1931         (API::InjectedBundle::EditorClient::didChangeSelection):
1932         (API::InjectedBundle::EditorClient::willWriteToPasteboard):
1933         (API::InjectedBundle::EditorClient::getPasteboardDataForRange):
1934         (API::InjectedBundle::EditorClient::didWriteToPasteboard):
1935
1936         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInEditingDelegate.h: Added. Declares
1937           the new delegate protocol, currently comprising three methods corresponding to
1938           willWriteToPasteboard, getPasteboardDataForRange, and didWriteToPasteboard.
1939
1940         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFrame.h:
1941         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFrame.mm:
1942         (-[WKWebProcessPlugInFrame jsRangeForRangeHandle:inWorld:]): Added. Gets the JS wrapper for
1943           the specified range handle.
1944
1945         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInRangeHandle.h: Added.
1946         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInRangeHandle.mm: Added.
1947         (-[WKWebProcessPlugInRangeHandle dealloc]): Call the InjectedBundleRangeHandle destructor.
1948         (+[WKWebProcessPlugInRangeHandle rangeHandleWithJSValue:inContext:]): Get or create an
1949           InjectedBundleRangeHandle for the specified object.
1950         (-[WKWebProcessPlugInRangeHandle frame]): Return the range’s owner document’s frame.
1951         (-[WKWebProcessPlugInRangeHandle _rangeHandle]): Return the InjectedBundleRangeHandle.
1952         (-[WKWebProcessPlugInRangeHandle _apiObject]): Ditto.
1953
1954         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInRangeHandleInternal.h: Added.
1955         (WebKit::wrapper):
1956
1957         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
1958         (WKBundlePageSetEditorClient): Updated for WebPage change.
1959
1960         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
1961         (-[WKWebProcessPlugInBrowserContextController _editingDelegate]): Added. Returns the
1962           delegate.
1963         (-[WKWebProcessPlugInBrowserContextController _setEditingDelegate:]): Added. Defines a
1964           Client class, which derives from API::InjectedBundle::EditorClient, and invokes the
1965           delegate methods. Instantiates a Client and sets it on the WebPage.
1966
1967         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextControllerPrivate.h:
1968           Declared new _editingDelegate property.
1969
1970         * WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp:
1971         (WebKit::InjectedBundleRangeHandle::document): Added. Returns an InjectedBundleNodeHandle
1972           for the range’s owner document.
1973         * WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.h:
1974
1975         * WebProcess/InjectedBundle/InjectedBundlePageEditorClient.cpp:
1976         (WebKit::InjectedBundlePageEditorClient::InjectedBundlePageEditorClient): Added. Calls
1977           initialize().
1978         (WebKit::InjectedBundlePageEditorClient::shouldBeginEditing): Updated for type change.
1979         (WebKit::InjectedBundlePageEditorClient::shouldEndEditing): Ditto.
1980         (WebKit::InjectedBundlePageEditorClient::shouldInsertNode): Ditto.
1981         (WebKit::InjectedBundlePageEditorClient::shouldInsertText): Ditto.
1982         (WebKit::InjectedBundlePageEditorClient::shouldDeleteRange): Ditto.
1983         (WebKit::InjectedBundlePageEditorClient::shouldChangeSelectedRange): Ditto.
1984         (WebKit::InjectedBundlePageEditorClient::shouldApplyStyle): Ditto.
1985         (WebKit::InjectedBundlePageEditorClient::didBeginEditing): Ditto.
1986         (WebKit::InjectedBundlePageEditorClient::didEndEditing): Ditto.
1987         (WebKit::InjectedBundlePageEditorClient::didChange): Ditto.
1988         (WebKit::InjectedBundlePageEditorClient::didChangeSelection): Ditto.
1989         (WebKit::InjectedBundlePageEditorClient::willWriteToPasteboard): Ditto.
1990         (WebKit::InjectedBundlePageEditorClient::getPasteboardDataForRange): Ditto.
1991         (WebKit::InjectedBundlePageEditorClient::didWriteToPasteboard): Ditto.
1992         * WebProcess/InjectedBundle/InjectedBundlePageEditorClient.h: Now derives from
1993           API::InjectedBundle::EditorClient.
1994
1995         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
1996         (WebKit::WebEditorClient::shouldDeleteRange): Ditto.
1997         (WebKit::WebEditorClient::shouldBeginEditing): Ditto.
1998         (WebKit::WebEditorClient::shouldEndEditing): Ditto.
1999         (WebKit::WebEditorClient::shouldInsertNode): Ditto.
2000         (WebKit::WebEditorClient::shouldInsertText): Ditto.
2001         (WebKit::WebEditorClient::shouldChangeSelectedRange): Ditto.
2002         (WebKit::WebEditorClient::shouldApplyStyle): Ditto.
2003         (WebKit::WebEditorClient::didBeginEditing): Ditto.
2004         (WebKit::WebEditorClient::respondToChangedContents): Ditto.
2005         (WebKit::WebEditorClient::respondToChangedSelection): Ditto.
2006         (WebKit::WebEditorClient::didEndEditing): Ditto.
2007         (WebKit::WebEditorClient::didWriteSelectionToPasteboard): Ditto.
2008         (WebKit::WebEditorClient::willWriteSelectionToPasteboard): Ditto.
2009         (WebKit::WebEditorClient::getClientPasteboardDataForRange): Ditto.
2010
2011         * WebProcess/WebPage/WebPage.cpp:
2012         (WebKit::WebPage::WebPage): Initialize m_editorClient.
2013         (WebKit::WebPage::setInjectedBundleEditorClient): Replaces
2014           initializeInjectedBundleEditorClient and just sets m_editorClient.
2015         (WebKit::WebPage::close): Resets m_editorClient.
2016
2017         * WebProcess/WebPage/WebPage.h: Changed m_editorClient to a unique_ptr.
2018
2019 2016-12-02  Said Abou-Hallawa  <sabouhallawa@apple.com>
2020
2021         [iOS] Add a WebView private configuration for changing the WebContent update frequency
2022         https://bugs.webkit.org/show_bug.cgi?id=165289
2023         <rdar://problem/29472577>
2024
2025         Reviewed by Tim Horton.
2026         
2027         Expose a preference which allows us to control the fps of web content updates.
2028
2029         * UIProcess/API/APIPageConfiguration.h:
2030         (API::PageConfiguration::contentUpdateFrequency):
2031         (API::PageConfiguration::setContentUpdateFrequency):
2032         * UIProcess/API/Cocoa/WKWebView.mm:
2033         (-[WKWebView _initializeWithConfiguration:]):
2034         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
2035         (-[WKWebViewConfiguration copyWithZone:]):
2036         (-[WKWebViewConfiguration _contentUpdateFrequency]):
2037         (-[WKWebViewConfiguration _setContentUpdateFrequency:]):
2038         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
2039         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h:
2040         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
2041         (-[WKOneShotDisplayLinkHandler initWithDrawingAreaProxy:]):
2042         (WebKit::RemoteLayerTreeDrawingAreaProxy::contentUpdateFrequency):
2043
2044 2016-12-02  Andy Estes  <aestes@apple.com>
2045
2046         [Cocoa] Adopt the PRODUCT_BUNDLE_IDENTIFIER build setting
2047         https://bugs.webkit.org/show_bug.cgi?id=164492
2048
2049         Reviewed by Dan Bernstein.
2050
2051         * Configurations/DatabaseService.xcconfig: Set PRODUCT_BUNDLE_IDENTIFIER to
2052         $(PRODUCT_NAME).
2053         * Configurations/NetworkService.xcconfig: Ditto.
2054         * Configurations/PluginService.32.xcconfig: Ditto.
2055         * Configurations/PluginService.64.xcconfig: Ditto.
2056         * Configurations/WebContentService.xcconfig: Ditto.
2057         * Configurations/WebKit.xcconfig: Set PRODUCT_BUNDLE_IDENTIFIER to
2058         com.apple.$(PRODUCT_NAME:rfc1034identifier).
2059         * DatabaseProcess/EntryPoint/mac/XPCService/DatabaseService/Info.plist: Changed
2060         CFBundleIdentifier's value from ${PRODUCT_NAME} to ${PRODUCT_BUNDLE_IDENTIFIER}.
2061         * Info.plist: Changed CFBundleIdentifier's value from com.apple.${PRODUCT_NAME} to
2062         ${PRODUCT_BUNDLE_IDENTIFIER}.
2063         * NetworkProcess/EntryPoint/mac/XPCService/NetworkService/Info-OSX-10.9-10.10.plist: Changed
2064         CFBundleIdentifier's value from ${PRODUCT_NAME} to ${PRODUCT_BUNDLE_IDENTIFIER}.
2065         * NetworkProcess/EntryPoint/mac/XPCService/NetworkService/Info-OSX.plist: Ditto.
2066         * NetworkProcess/EntryPoint/mac/XPCService/NetworkService/Info-iOS.plist: Ditto.
2067         * PluginProcess/EntryPoint/mac/XPCService/PluginService.32-64-10.9-10.10.Info.plist: Ditto.
2068         * PluginProcess/EntryPoint/mac/XPCService/PluginService.32-64.Info.plist: Ditto.
2069         * WebProcess/EntryPoint/mac/XPCService/WebContentService/Info-OSX-10.9-10.10.plist: Ditto.
2070         * WebProcess/EntryPoint/mac/XPCService/WebContentService/Info-OSX.plist: Ditto.
2071         * WebProcess/EntryPoint/mac/XPCService/WebContentService/Info-iOS.plist: Ditto.
2072
2073 2016-12-02  Brent Fulgham  <bfulgham@apple.com>
2074
2075         [Mac] Update sandbox profiles to use modern syntax and avoid duplication
2076         https://bugs.webkit.org/show_bug.cgi?id=165332
2077         <rdar://problem/26898991>
2078
2079         Reviewed by Anders Carlsson.
2080
2081         Update the Mac sandbox profiles to reflect that modern Cocoa applications
2082         communicate with cfprefsd, rather than plists on disk (and have done so
2083         for the past several releases).
2084
2085         Get rid of some duplicated rules, as well as old compatibility rules that
2086         are never triggered under supported operating systems.
2087
2088         * DatabaseProcess/mac/com.apple.WebKit.Databases.sb.in:
2089         * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
2090         * PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in:
2091         * WebProcess/com.apple.WebProcess.sb.in:
2092
2093 2016-12-02  Gustavo Sverzut Barbieri  <barbieri@profusion.mobi>
2094
2095         Fix build break when disabling some features.
2096         https://bugs.webkit.org/show_bug.cgi?id=165254
2097
2098         The EFL port was broken if SPELLCHECK was disabled or
2099         PLUGIN_ARCHITECTURE is not x11.
2100
2101         Reviewed by Michael Catanzaro.
2102
2103         * UIProcess/efl/TextCheckerEfl.cpp:
2104         (WebKit::TextChecker::checkTextOfParagraph):
2105         (WebKit::TextChecker::checkSpellingOfString):
2106         Fix UNUSED_PARAM() usage if SPELLCHECK is disabled.
2107         * UIProcess/efl/WebPageProxyEfl.cpp:
2108         Isolate methods within #if PLUGIN_ARCHITECTURE(X11).
2109
2110 2016-12-01  Jiewen Tan  <jiewen_tan@apple.com>
2111
2112         Add a runtime flag for SubtleCrypto
2113         https://bugs.webkit.org/show_bug.cgi?id=164982
2114
2115         Reviewed by Brent Fulgham.
2116
2117         * Shared/WebPreferencesDefinitions.h:
2118         * UIProcess/API/C/WKPreferences.cpp:
2119         (WKPreferencesSetSubtleCryptoEnabled):
2120         (WKPreferencesGetSubtleCryptoEnabled):
2121         * UIProcess/API/C/WKPreferencesRefPrivate.h:
2122         * WebProcess/InjectedBundle/InjectedBundle.cpp:
2123         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
2124         * WebProcess/WebPage/WebPage.cpp:
2125         (WebKit::WebPage::updatePreferences):
2126
2127 2016-12-01  Saam Barati  <sbarati@apple.com>
2128
2129         Rename CallFrame::callee() to CallFrame::jsCallee()
2130         https://bugs.webkit.org/show_bug.cgi?id=165293
2131
2132         Reviewed by Keith Miller.
2133
2134         * WebProcess/Plugins/Netscape/JSNPMethod.cpp:
2135         (WebKit::callMethod):
2136         * WebProcess/Plugins/Netscape/JSNPObject.cpp:
2137         (WebKit::callNPJSObject):
2138         (WebKit::constructWithConstructor):
2139
2140 2016-12-01  Chris Dumez  <cdumez@apple.com>
2141
2142         [iOS][WK2] Tapping an element generates a 'click' event that has 0 as timeStamp
2143         https://bugs.webkit.org/show_bug.cgi?id=165270
2144         <rdar://problem/29224355>
2145
2146         Reviewed by Simon Fraser.
2147
2148         Tapping an element generates a 'click' event that has 0 as timeStamp
2149         instead of having a proper timeStamp value. This is breaking some
2150         sites.
2151
2152         * WebProcess/WebPage/ios/WebPageIOS.mm:
2153         (WebKit::WebPage::handleSyntheticClick):
2154         (WebKit::WebPage::completeSyntheticClick):
2155
2156 2016-12-01  Tim Horton  <timothy_horton@apple.com>
2157
2158         Try to fix the EFL/Gtk build
2159
2160         * UIProcess/efl/WebProcessPoolEfl.cpp:
2161         (WebKit::WebProcessPool::platformResolvePathsForSandboxExtensions):
2162         * UIProcess/gtk/WebProcessPoolGtk.cpp:
2163         (WebKit::WebProcessPool::platformResolvePathsForSandboxExtensions):
2164
2165 2016-12-01  Tim Horton  <timothy_horton@apple.com>
2166
2167         Every WKWebView initialization spends a few milliseconds hitting the disk
2168         https://bugs.webkit.org/show_bug.cgi?id=165268
2169         <rdar://problem/29010113>
2170
2171         Reviewed by Brady Eidson.
2172
2173         Every WKWebView init currently involves doing directory creation and
2174         symlink resolution for a number of paths (to create sandbox extensions
2175         for all of our storage directories), which means touching the disk a
2176         lot during init. All of these paths are immutable per-WebProcessPool,
2177         so, instead, cache them on WebProcessPool and create sandbox extensions
2178         from the already-resolved paths. This is a sizable (~4x) speedup when
2179         initializing subsequent web views.
2180
2181         * Shared/SandboxExtension.h:
2182         (WebKit::SandboxExtension::createHandleWithoutResolvingPath):
2183         Add createHandleWithoutResolvingPath, which makes a sandbox extension
2184         handle without doing symlink resolution.
2185
2186         (WebKit::resolvePathForSandboxExtension):
2187         (WebKit::resolveAndCreateReadWriteDirectoryForSandboxExtension):
2188         Add two functions that do the same resolution that SandboxExtension::createHandle
2189         and ::createHandleForReadWriteDirectory do, but just return the paths,
2190         for later use with createHandleWithoutResolvingPath.
2191
2192         * Shared/mac/SandboxExtensionMac.mm:
2193         (WebKit::resolveAndCreateReadWriteDirectoryForSandboxExtension):
2194         (WebKit::resolvePathForSandboxExtension):
2195         (WebKit::SandboxExtension::createHandleWithoutResolvingPath):
2196         (WebKit::SandboxExtension::createHandle):
2197         (WebKit::SandboxExtension::createHandleForReadWriteDirectory):
2198         Implement the aforementioned functions, and reimplement the existing
2199         createHandle{ForReadWriteDirectory} functions in terms of them.
2200
2201         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
2202         (WebKit::WebProcessPool::platformDefaultIconDatabasePath):
2203         Stop wasting time generating and resolving a platform default icon
2204         database path, since we don't actually use it for anything anymore except
2205         to determine whether the icon database is enabled, and we only want to
2206         enable it if the client has provided a path.
2207
2208         (WebKit::WebProcessPool::platformResolvePathsForSandboxExtensions):
2209         (WebKit::WebProcessPool::platformInitializeWebProcess):
2210         * UIProcess/WebProcessPool.cpp:
2211         (WebKit::m_hiddenPageThrottlingTimer):
2212         (WebKit::WebProcessPool::resolvePathsForSandboxExtensions):
2213         (WebKit::WebProcessPool::createNewWebProcess):
2214         * UIProcess/WebProcessPool.h:
2215         Resolve paths in resolvePathsForSandboxExtensions, and use the resolved
2216         paths along with createHandleWithoutResolvingPath in order to effectively
2217         cache the resolution operation.
2218
2219 2016-12-01  Antti Koivisto  <antti@apple.com>
2220
2221         Revert r208931
2222         https://bugs.webkit.org/show_bug.cgi?id=164924
2223
2224         PLT regression.
2225
2226         * NetworkProcess/cache/NetworkCache.cpp:
2227         (WebKit::NetworkCache::makeCacheKey):
2228         (WebKit::NetworkCache::Cache::makeCacheKey): Deleted.
2229         * NetworkProcess/cache/NetworkCache.h:
2230         * NetworkProcess/cache/NetworkCacheBlobStorage.cpp:
2231         (WebKit::NetworkCache::BlobStorage::BlobStorage):
2232         (WebKit::NetworkCache::BlobStorage::add):
2233         (WebKit::NetworkCache::BlobStorage::get):
2234         * NetworkProcess/cache/NetworkCacheBlobStorage.h:
2235         * NetworkProcess/cache/NetworkCacheData.cpp:
2236         (WebKit::NetworkCache::computeSHA1):
2237         (WebKit::NetworkCache::makeSalt): Deleted.
2238         (WebKit::NetworkCache::readOrMakeSalt): Deleted.
2239         * NetworkProcess/cache/NetworkCacheData.h:
2240         * NetworkProcess/cache/NetworkCacheKey.cpp:
2241         (WebKit::NetworkCache::noPartitionString):
2242         (WebKit::NetworkCache::Key::Key):
2243         (WebKit::NetworkCache::Key::hasPartition):
2244         (WebKit::NetworkCache::Key::computeHash):
2245         (WebKit::NetworkCache::Key::hashAsString):
2246         (WebKit::NetworkCache::Key::computePartitionHash): Deleted.
2247         * NetworkProcess/cache/NetworkCacheKey.h:
2248         (WebKit::NetworkCache::Key::hash):
2249         (WebKit::NetworkCache::Key::partitionHash): Deleted.
2250         (WebKit::NetworkCache::Key::hashAsString): Deleted.
2251         (WebKit::NetworkCache::Key::partitionHashAsString): Deleted.
2252         * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
2253         (WebKit::NetworkCache::makeSubresourcesKey):
2254         (WebKit::NetworkCache::constructRevalidationRequest):
2255         (WebKit::NetworkCache::SpeculativeLoadManager::PendingFrameLoad::saveToDiskIfReady):
2256         (WebKit::NetworkCache::SpeculativeLoadManager::retrieveSubresourcesEntry):
2257         * NetworkProcess/cache/NetworkCacheStorage.cpp:
2258         (WebKit::NetworkCache::Storage::open):
2259         (WebKit::NetworkCache::traverseRecordsFiles):
2260         (WebKit::NetworkCache::Storage::Storage):
2261         (WebKit::NetworkCache::Storage::recordDirectoryPathForKey):
2262         (WebKit::NetworkCache::decodeRecordHeader):
2263         (WebKit::NetworkCache::Storage::readRecord):
2264         (WebKit::NetworkCache::Storage::encodeRecord):
2265         (WebKit::NetworkCache::Storage::traverse):
2266         (WebKit::NetworkCache::makeSaltFilePath): Deleted.
2267         * NetworkProcess/cache/NetworkCacheStorage.h:
2268         (WebKit::NetworkCache::Storage::salt): Deleted.
2269
2270 2016-11-30  Sam Weinig  <sam@webkit.org>
2271
2272         [WebIDL] Remove custom bindings for File and Blob constructors
2273         https://bugs.webkit.org/show_bug.cgi?id=165218
2274
2275         Reviewed by Darin Adler.
2276
2277         * NetworkProcess/FileAPI/NetworkBlobRegistry.cpp:
2278         (WebKit::NetworkBlobRegistry::registerBlobURL):
2279         * NetworkProcess/FileAPI/NetworkBlobRegistry.h:
2280         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
2281         (WebKit::NetworkConnectionToWebProcess::registerBlobURL):
2282         * NetworkProcess/NetworkConnectionToWebProcess.h:
2283         * WebProcess/FileAPI/BlobRegistryProxy.cpp:
2284         (WebKit::BlobRegistryProxy::registerBlobURL):
2285         * WebProcess/FileAPI/BlobRegistryProxy.h:
2286         Avoid copies of the BlobPart Vector.
2287
2288 2016-11-30  Carlos Garcia Campos  <cgarcia@igalia.com>
2289
2290         [GTK] UI process crash in WebKit::WaylandCompositor::Surface::prepareTextureForPainting
2291         https://bugs.webkit.org/show_bug.cgi?id=164911
2292
2293         Reviewed by Michael Catanzaro.
2294
2295         The problem is that m_buffer is nullptr in Surface::prepareTextureForPainting() even though we have already an
2296         image. We only use the buffer to get the image size, so we could save the image size when the image is created,
2297         and then we don't need to care about the buffer anymore.
2298
2299         * UIProcess/gtk/WaylandCompositor.cpp:
2300         (WebKit::WaylandCompositor::Surface::prepareTextureForPainting):
2301         (WebKit::WaylandCompositor::Surface::commit):
2302         * UIProcess/gtk/WaylandCompositor.h:
2303
2304 2016-11-30  Antoine Quint  <graouts@apple.com>
2305
2306         [Modern Media Controls] Add an HTML comment flag to turn the feature on
2307         https://bugs.webkit.org/show_bug.cgi?id=165226
2308
2309         Reviewed by Dean Jackson.
2310
2311         Add new methods to set the Modern Media Controls preference.
2312
2313         * UIProcess/API/C/WKPreferences.cpp:
2314         (WKPreferencesSetModernMediaControlsEnabled):
2315         (WKPreferencesGetModernMediaControlsEnabled):
2316         * UIProcess/API/C/WKPreferencesRefPrivate.h:
2317
2318 2016-11-30  Said Abou-Hallawa  <sabouhallawa@apple.com>
2319
2320         Add separate settings and preferences to enable/disable async decoding for large images and animated images
2321         https://bugs.webkit.org/show_bug.cgi?id=165177
2322
2323         Reviewed by Simon Fraser.
2324         
2325         Hook up the async image decoding settings for WebKit2.
2326
2327         * Shared/WebPreferencesDefinitions.h:
2328         * UIProcess/API/Cocoa/WKPreferences.mm:
2329         (-[WKPreferences _largeImageAsyncDecodingEnabled]):
2330         (-[WKPreferences _setLargeImageAsyncDecodingEnabled:]):
2331         (-[WKPreferences _animatedImageAsyncDecodingEnabled]):
2332         (-[WKPreferences _setAnimatedImageAsyncDecodingEnabled:]):
2333         (-[WKPreferences _asyncImageDecodingEnabled]): Deleted.
2334         (-[WKPreferences _setAsyncImageDecodingEnabled:]): Deleted.
2335         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
2336         * WebProcess/InjectedBundle/InjectedBundle.cpp:
2337         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
2338         * WebProcess/WebPage/WebPage.cpp:
2339         (WebKit::WebPage::updatePreferences):
2340
2341 2016-11-30  Chris Dumez  <cdumez@apple.com>
2342
2343         [iOS][WK2] Turn on HTML interactive form validation feature
2344         https://bugs.webkit.org/show_bug.cgi?id=165212
2345         <rdar://problem/29444356>
2346
2347         Reviewed by Simon Fraser.
2348
2349         Turn on HTML interactive form validation feature on iOS WK2
2350         now that we have a native UI.
2351
2352         * Shared/WebPreferencesDefinitions.h:
2353
2354 2016-11-30  Brent Fulgham  <bfulgham@apple.com>
2355
2356         Correct plugin sandbox after r208611
2357         https://bugs.webkit.org/show_bug.cgi?id=165187
2358         <rdar://problem/29431165>
2359
2360         Reviewed by Alex Christensen.
2361
2362         In r208611 I removed the 'else' clause of a Scheme conditional
2363         that was needed to properly run plugins (such as Flash Player).
2364
2365         This change retains the relevant current sandbox content, while
2366         still stripping out the old code that is no longer needed.
2367
2368         * PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in:
2369
2370 2016-11-29  Carlos Garcia Campos  <cgarcia@igalia.com>
2371
2372         [GTK] Database process should not initialize gtk
2373         https://bugs.webkit.org/show_bug.cgi?id=165138
2374
2375         Reviewed by Sergio Villar Senin.
2376
2377         It doesn't use GTK+ at all.
2378
2379         * DatabaseProcess/gtk/DatabaseProcessMainGtk.cpp:
2380         (WebKit::DatabaseProcessMainUnix):
2381         (): Deleted.
2382
2383 2016-11-29  Gavin Barraclough  <barraclough@apple.com>
2384
2385         Remove WebPage::SetPageSuppressed
2386         https://bugs.webkit.org/show_bug.cgi?id=165158
2387
2388         Unreviewed revert accidental change.
2389
2390         * WebProcess/WebPage/WebPage.cpp:
2391         (WebKit::WebPage::setActivityState):
2392
2393 2016-11-29  Gavin Barraclough  <barraclough@apple.com>
2394
2395         Remove WebPage::SetPageSuppressed
2396         https://bugs.webkit.org/show_bug.cgi?id=165158
2397
2398         Reviewed by Tim Horton.
2399
2400         This was scaffolding. We've now refactored to the point that the information driving throttling originates
2401         from the UI process (so UI and web processes can have a consistent view of what should throttle), but we
2402         don't need a separate message to handle this - necessary state to determine is provided in ActivityState.
2403
2404         * UIProcess/WebPageProxy.cpp:
2405         (WebKit::WebPageProxy::updateThrottleState):
2406             - used to send SetPageSuppressed; no longer does.
2407         * UIProcess/WebPageProxy.h:
2408             - removed m_pageSuppressed (was used to avoid duplicated messages).
2409         * WebProcess/WebPage/WebPage.cpp:
2410         (WebKit::WebPage::updateThrottleState):
2411             - compute throttle state based on m_activityState.
2412         (WebKit::WebPage::setActivityState):
2413             - update throttle state whenever activity state changes.
2414         (WebKit::WebPage::updatePreferences):
2415             - update throttle state whenever preferences change (throttling can be disabled via preference).
2416         (WebKit::WebPage::setPageSuppressed): Deleted.
2417             - Removed WebPage::SetPageSuppressed.
2418         * WebProcess/WebPage/WebPage.h:
2419             - Removed WebPage::SetPageSuppressed.
2420             - Added m_processSuppressionEnabled, to cache preference state.
2421         * WebProcess/WebPage/WebPage.messages.in:
2422             - Removed WebPage::SetPageSuppressed.
2423
2424 2016-11-29  Andy Estes  <aestes@apple.com>
2425
2426         [Cocoa] Enable two clang warnings recommended by Xcode
2427         https://bugs.webkit.org/show_bug.cgi?id=164498
2428
2429         Reviewed by Mark Lam.
2430
2431         * Configurations/Base.xcconfig: Enabled CLANG_WARN_INFINITE_RECURSION and CLANG_WARN_SUSPICIOUS_MOVE.
2432
2433 2016-11-29  Eric Carlson  <eric.carlson@apple.com>
2434
2435         [MediaStream] Don't request user permission for a device if it has already been granted in the current browsing context
2436         https://bugs.webkit.org/show_bug.cgi?id=164760
2437         <rdar://problem/29261266>
2438
2439         Reviewed by Youenn Fablet.
2440
2441         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
2442         (WebKit::FrameAuthorizationState::FrameAuthorizationState):
2443         (WebKit::FrameAuthorizationState::hasPermissionToUseCaptureDevice):
2444         (WebKit::FrameAuthorizationState::setHasPermissionToUseCaptureDevice):
2445         (WebKit::FrameAuthorizationState::reset):
2446         (WebKit::FrameAuthorizationState::securityOriginsAreEqual):
2447         (WebKit::UserMediaPermissionRequestManagerProxy::stateForRequest):
2448         (WebKit::UserMediaPermissionRequestManagerProxy::invalidateRequests):
2449         (WebKit::UserMediaPermissionRequestManagerProxy::createRequest):
2450         (WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasDenied):
2451         (WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasGranted):
2452         (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame):
2453         * UIProcess/UserMediaPermissionRequestManagerProxy.h:
2454         (WebKit::FrameAuthorizationState::~FrameAuthorizationState):
2455         (WebKit::FrameAuthorizationState::frameID):
2456         * UIProcess/UserMediaPermissionRequestProxy.cpp:
2457         (WebKit::UserMediaPermissionRequestProxy::UserMediaPermissionRequestProxy):
2458         * UIProcess/UserMediaPermissionRequestProxy.h:
2459         (WebKit::UserMediaPermissionRequestProxy::create):
2460         (WebKit::UserMediaPermissionRequestProxy::frameID):
2461         (WebKit::UserMediaPermissionRequestProxy::userMediaDocumentSecurityOrigin):
2462         (WebKit::UserMediaPermissionRequestProxy::topLevelDocumentSecurityOrigin):
2463         * UIProcess/WebPageProxy.cpp:
2464         (WebKit::WebPageProxy::didCommitLoadForFrame):
2465         * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
2466         (WebKit::UserMediaPermissionRequestManager::removeMediaRequestFromMaps):
2467
2468 2016-11-29  Wenson Hsieh  <wenson_hsieh@apple.com>
2469
2470         Scroll snapping on Mac should use AppKit animations
2471         https://bugs.webkit.org/show_bug.cgi?id=147261
2472         <rdar://problem/29395293>
2473
2474         Reviewed by Brent Fulgham.
2475
2476         Add some logic to plumb filtered wheel velocity over to WebCore in the case of mainframe scrolling. See
2477         WebCore/ChangeLog for more details.
2478
2479         * WebProcess/WebPage/EventDispatcher.cpp:
2480         (WebKit::EventDispatcher::wheelEvent):
2481
2482 2016-11-21  Brian Burg  <bburg@apple.com>
2483
2484         Web Automation: add ObjC SPI to set whether a page is controlled by automation
2485         https://bugs.webkit.org/show_bug.cgi?id=165001
2486         <rdar://problem/29350432>
2487
2488         Reviewed by Dan Bernstein.
2489
2490         Add SPI property to WKWebViewConfiguration and plumb it through to
2491         initialize WebPageProxy::m_controlledByAutomation. This is propagated
2492         to the WebProcess on creation via WebPageCreationParameters.
2493
2494         * UIProcess/API/APIPageConfiguration.cpp:
2495         (API::PageConfiguration::copy):
2496         * UIProcess/API/APIPageConfiguration.h:
2497         (API::PageConfiguration::isControlledByAutomation):
2498         (API::PageConfiguration::setControlledByAutomation):
2499         * UIProcess/API/Cocoa/WKWebView.mm:
2500         (-[WKWebView _initializeWithConfiguration:]):
2501         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
2502         (-[WKWebViewConfiguration init]):
2503         (-[WKWebViewConfiguration copyWithZone:]):
2504         (-[WKWebViewConfiguration _isControlledByAutomation]):
2505         (-[WKWebViewConfiguration _setControlledByAutomation:]):
2506         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
2507         * UIProcess/WebPageProxy.cpp:
2508         (WebKit::WebPageProxy::WebPageProxy):
2509
2510 2016-11-28  Carlos Garcia Campos  <cgarcia@igalia.com>
2511
2512         [GTK] BadDamage X Window System error in WebKit::AcceleratedBackingStoreX11::update when called from WebPageProxy::exitAcceleratedCompositingMode
2513         https://bugs.webkit.org/show_bug.cgi?id=164303
2514
2515         Reviewed by Michael Catanzaro.
2516
2517         Trap also BadDrawable and BadDamage X errors when creating the surface and damage.
2518
2519         * UIProcess/gtk/AcceleratedBackingStoreX11.cpp:
2520         (WebKit::AcceleratedBackingStoreX11::update):
2521
2522 2016-11-28  Chris Dumez  <cdumez@apple.com>
2523
2524         [Mac][WK2] Enable HTML interactive form validation
2525         https://bugs.webkit.org/show_bug.cgi?id=165123
2526         <rdar://problem/28944652>
2527
2528         Reviewed by Simon Fraser.
2529
2530         Enable HTML interactive form validation now that we have a native UI
2531         for it.
2532
2533         * Shared/WebPreferencesDefinitions.h:
2534
2535 2016-11-28  Brent Fulgham  <bfulgham@apple.com>
2536
2537         Generated sandbox profile is not being put in the correct Resources directory
2538         https://bugs.webkit.org/show_bug.cgi?id=165126
2539
2540         Reviewed by Tim Horton.
2541
2542         * WebKit2.xcodeproj/project.pbxproj: Copy the generated file to the 'PlugInSandboxProfiles'
2543         sub-directory.
2544
2545 2016-11-28  Ryan Haddad  <ryanhaddad@apple.com>
2546
2547         Unreviewed, rolling out r209008.
2548
2549         This change appears to have caused two fast/mediastrem
2550         LayoutTests to fail.
2551
2552         Reverted changeset:
2553
2554         "[MediaStream] Don't request user permission for a device if
2555         it has already been granted in the current browsing context"
2556         https://bugs.webkit.org/show_bug.cgi?id=164760
2557         http://trac.webkit.org/changeset/209008
2558
2559 2016-11-28  Andrew Gold  <agold@apple.com>
2560
2561         Support for HTML Media Capture API
2562         https://bugs.webkit.org/show_bug.cgi?id=43239
2563
2564         Reviewed by Tim Horton.
2565
2566         In order to enable media capture on iOS, we must first use the AVFoundation API to 
2567         check/request capture permission from the user for Safari. Then, Safari must request
2568         permission on behalf of the webpage to use the capture devices. Additionally, Safari
2569         must present UI when the capture is taking place, so WebKit needs to notify the client
2570         of a capture session beginning and ending. To do this, we added four methods to 
2571         WKUIDelegatePrivate to request permission from the user, check for permissions, notify
2572         that a capture session has begun, and notify that a capture session has ended. Additionally,
2573         we added a private method to WKWebView that allows the client to stop a capture session.
2574
2575         * UIProcess/API/APIUIClient.h:
2576         (API::UIClient::didBeginCaptureSession): Notifies the client of a capture session beginning.
2577         (API::UIClient::didEndCaptureSession): Notifies the client of a capture session ending.
2578
2579         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: Added new delegate methods to request permission,
2580         check for permission, notify of a capture session beginning, and notify of a capture session
2581         ending.
2582
2583         * UIProcess/API/Cocoa/WKWebView.mm:
2584         (-[WKWebView _stopMediaCapture]): Cancels a media capture session.
2585         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2586
2587         * UIProcess/Cocoa/UIDelegate.h:
2588         * UIProcess/Cocoa/UIDelegate.mm:
2589         (WebKit::UIDelegate::setDelegate): Added the new delegate methods.
2590         (WebKit::UIDelegate::UIClient::decidePolicyForUserMediaPermissionRequest):
2591         First checks if the user has authorized the client application access capture devices,
2592         then uses the WKUIDelegate to request permission for a site from the user.
2593         (WebKit::UIDelegate::UIClient::checkUserMediaPermissionForOrigin): Checks the client
2594         for permission to access capture devices.
2595         (WebKit::UIDelegate::UIClient::didBeginCaptureSession): Notifies the client of a capture
2596         session beginning.
2597         (WebKit::UIDelegate::UIClient::didEndCaptureSession): Notifies the client of a capture
2598         session ending.
2599
2600         * UIProcess/WebPageProxy.cpp:
2601         (WebKit::WebPageProxy::isPlayingMediaDidChange): Calls UIDelegate method to notify the
2602         client of a capture session beginning/ending.
2603
2604 2016-11-28  Eric Carlson  <eric.carlson@apple.com>
2605
2606         [MediaStream] Don't request user permission for a device if it has already been granted in the current browsing context
2607         https://bugs.webkit.org/show_bug.cgi?id=164760
2608         <rdar://problem/29261266>
2609
2610         Reviewed by Youenn Fablet.
2611
2612         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
2613         (WebKit::FrameAuthorizationState::FrameAuthorizationState):
2614         (WebKit::FrameAuthorizationState::hasPermissionToUseCaptureDevice):
2615         (WebKit::FrameAuthorizationState::setHasPermissionToUseCaptureDevice):
2616         (WebKit::FrameAuthorizationState::reset):
2617         (WebKit::FrameAuthorizationState::securityOriginsAreEqual):
2618         (WebKit::UserMediaPermissionRequestManagerProxy::stateForRequest):
2619         (WebKit::UserMediaPermissionRequestManagerProxy::invalidateRequests):
2620         (WebKit::UserMediaPermissionRequestManagerProxy::createRequest):
2621         (WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasDenied):
2622         (WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasGranted):
2623         (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame):
2624         * UIProcess/UserMediaPermissionRequestManagerProxy.h:
2625         (WebKit::FrameAuthorizationState::~FrameAuthorizationState):
2626         (WebKit::FrameAuthorizationState::frameID):
2627         * UIProcess/UserMediaPermissionRequestProxy.cpp:
2628         (WebKit::UserMediaPermissionRequestProxy::UserMediaPermissionRequestProxy):
2629         * UIProcess/UserMediaPermissionRequestProxy.h:
2630         (WebKit::UserMediaPermissionRequestProxy::create):
2631         (WebKit::UserMediaPermissionRequestProxy::frameID):
2632         (WebKit::UserMediaPermissionRequestProxy::userMediaDocumentSecurityOrigin):
2633         (WebKit::UserMediaPermissionRequestProxy::topLevelDocumentSecurityOrigin):
2634         * UIProcess/WebPageProxy.cpp:
2635         (WebKit::WebPageProxy::didCommitLoadForFrame):
2636         * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
2637         (WebKit::UserMediaPermissionRequestManager::removeMediaRequestFromMaps):
2638
2639 2016-11-27  Dean Jackson  <dino@apple.com>
2640
2641         Removed a WTFLogAlways I left in with a recent commit.
2642
2643         * UIProcess/Cocoa/WebViewImpl.mm:
2644         (-[WKAccessibilitySettingsObserver _settingsDidChange:]):
2645
2646 2016-11-27  Csaba Osztrogonác  <ossy@webkit.org>
2647
2648         Fix unused-private-field build warning in WebKit2/Platform/SharedMemory.h
2649         https://bugs.webkit.org/show_bug.cgi?id=165069
2650
2651         Reviewed by Darin Adler.
2652
2653         * Platform/SharedMemory.h:
2654
2655 2016-11-26  Simon Fraser  <simon.fraser@apple.com>
2656
2657         Fix the iOS build.
2658
2659         * WebProcess/WebPage/ios/WebPageIOS.mm:
2660         (WebKit::WebPage::eventThrottlingDelay):
2661
2662 2016-11-26  Yusuke Suzuki  <utatane.tea@gmail.com>
2663
2664         [WTF] Import std::optional reference implementation as WTF::Optional
2665         https://bugs.webkit.org/show_bug.cgi?id=164199
2666
2667         Reviewed by Saam Barati and Sam Weinig.
2668
2669         * NetworkProcess/NetworkDataTask.cpp:
2670         (WebKit::NetworkDataTask::didReceiveResponse):
2671         * NetworkProcess/NetworkLoad.h:
2672         * NetworkProcess/cache/NetworkCache.cpp:
2673         (WebKit::NetworkCache::responseHasExpired):
2674         * NetworkProcess/cache/NetworkCacheCoders.h:
2675         (WebKit::NetworkCache::Coder<std::optional<T>>::encode):
2676         (WebKit::NetworkCache::Coder<std::optional<T>>::decode):
2677         (WebKit::NetworkCache::Coder<Optional<T>>::encode): Deleted.
2678         (WebKit::NetworkCache::Coder<Optional<T>>::decode): Deleted.
2679         * NetworkProcess/cache/NetworkCacheData.cpp:
2680         (WebKit::NetworkCache::readOrMakeSalt):
2681         * NetworkProcess/cache/NetworkCacheData.h:
2682         * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
2683         (WebKit::NetworkCache::SpeculativeLoadManager::PreloadedEntry::PreloadedEntry):
2684         (WebKit::NetworkCache::SpeculativeLoadManager::PreloadedEntry::revalidationRequest):
2685         (WebKit::NetworkCache::SpeculativeLoadManager::addPreloadedEntry):
2686         * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.h:
2687         * NetworkProcess/cache/NetworkCacheStatistics.cpp:
2688         (WebKit::NetworkCache::Statistics::recordNotUsingCacheForRequest):
2689         (WebKit::NetworkCache::Statistics::recordRetrievalFailure):
2690         (WebKit::NetworkCache::Statistics::queryWasEverRequested):
2691         * NetworkProcess/cache/NetworkCacheStatistics.h:
2692         * NetworkProcess/cache/NetworkCacheStorage.cpp:
2693         (WebKit::NetworkCache::Storage::storeBodyAsBlob):
2694         (WebKit::NetworkCache::Storage::encodeRecord):
2695         (WebKit::NetworkCache::Storage::dispatchWriteOperation):
2696         * NetworkProcess/cache/NetworkCacheStorage.h:
2697         * Platform/IPC/ArgumentCoders.h:
2698         (IPC::ArgumentCoder<std::optional<T>>::encode):
2699         (IPC::ArgumentCoder<std::optional<T>>::decode):
2700         (IPC::ArgumentCoder<WTF::Optional<T>>::encode): Deleted.
2701         (IPC::ArgumentCoder<WTF::Optional<T>>::decode): Deleted.
2702         * Platform/IPC/Connection.h:
2703         (IPC::Connection::sendWithReply):
2704         * Platform/SharedMemory.h:
2705         * Platform/unix/SharedMemoryUnix.cpp:
2706         (WebKit::SharedMemory::map):
2707         * Scripts/webkit/messages.py:
2708         (class_template_headers):
2709         * Shared/API/APISecurityOrigin.h:
2710         (API::SecurityOrigin::create):
2711         * Shared/API/Cocoa/_WKRemoteObjectInterface.mm:
2712         * Shared/API/c/WKSecurityOriginRef.cpp:
2713         (WKSecurityOriginGetPort):
2714         * Shared/SessionState.h:
2715         * Shared/WebPageCreationParameters.h:
2716         * Shared/mac/ObjCObjectGraph.mm:
2717         (WebKit::typeFromObject):
2718         * Shared/mac/SecItemShim.cpp:
2719         (WebKit::sendSecItemRequest):
2720         * UIProcess/API/C/WKKeyValueStorageManager.cpp:
2721         (WKKeyValueStorageManagerGetStorageDetailsByOrigin):
2722         * UIProcess/API/Cocoa/WKSecurityOrigin.mm:
2723         (-[WKSecurityOrigin port]):
2724         * UIProcess/API/Cocoa/WKWebView.mm:
2725         (-[WKWebView _didCommitLayerTree:]):
2726         (-[WKWebView _navigationGestureDidEnd]):
2727         * UIProcess/API/Cocoa/WKWebsiteDataRecordInternal.h:
2728         (WebKit::toWebsiteDataType):
2729         * UIProcess/API/efl/EwkView.cpp:
2730         (EwkView::setCursor):
2731         * UIProcess/API/mac/WKView.mm:
2732         (toCoreScrollbarStyle):
2733         (toAPIScrollbarStyle):
2734         * UIProcess/ApplePay/WebPaymentCoordinatorProxy.cpp:
2735         (WebKit::WebPaymentCoordinatorProxy::completeShippingMethodSelection):
2736         (WebKit::WebPaymentCoordinatorProxy::completeShippingContactSelection):
2737         (WebKit::WebPaymentCoordinatorProxy::completePaymentMethodSelection):
2738         * UIProcess/ApplePay/WebPaymentCoordinatorProxy.h:
2739         * UIProcess/ApplePay/WebPaymentCoordinatorProxy.messages.in:
2740         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
2741         (WebKit::toPKPaymentSummaryItem):
2742         (WebKit::WebPaymentCoordinatorProxy::platformCompleteShippingMethodSelection):
2743         (WebKit::WebPaymentCoordinatorProxy::platformCompleteShippingContactSelection):
2744         (WebKit::WebPaymentCoordinatorProxy::platformCompletePaymentMethodSelection):
2745         * UIProcess/Automation/WebAutomationSession.cpp:
2746         (WebKit::WebAutomationSession::webFrameIDForHandle):
2747         (WebKit::WebAutomationSession::switchToBrowsingContext):
2748         (WebKit::WebAutomationSession::evaluateJavaScriptFunction):
2749         (WebKit::WebAutomationSession::resolveChildFrameHandle):
2750         (WebKit::WebAutomationSession::resolveParentFrameHandle):
2751         (WebKit::WebAutomationSession::computeElementLayout):
2752         * UIProcess/Automation/WebAutomationSession.h:
2753         * UIProcess/Cocoa/WebViewImpl.h:
2754         * UIProcess/Cocoa/WebViewImpl.mm:
2755         (WebKit::WebViewImpl::updateViewExposedRect):
2756         (WebKit::WebViewImpl::setOverlayScrollbarStyle):
2757         (WebKit::WebViewImpl::overlayScrollbarStyle):
2758         * UIProcess/DrawingAreaProxy.cpp:
2759         (WebKit::DrawingAreaProxy::setViewExposedRect):
2760         * UIProcess/DrawingAreaProxy.h:
2761         (WebKit::DrawingAreaProxy::viewExposedRect):
2762         * UIProcess/InspectorServer/WebSocketServerConnection.cpp:
2763         (WebKit::WebSocketServerConnection::didReceiveSocketStreamData):
2764         * UIProcess/InspectorServer/WebSocketServerConnection.h:
2765         * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp:
2766         (WebKit::RemoteScrollingCoordinatorProxy::scrollingTreeNodeDidScroll):
2767         * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h:
2768         * UIProcess/Scrolling/RemoteScrollingTree.cpp:
2769         (WebKit::RemoteScrollingTree::scrollingTreeNodeDidScroll):
2770         * UIProcess/Scrolling/RemoteScrollingTree.h:
2771         * UIProcess/Storage/LocalStorageDatabaseTracker.cpp:
2772         (WebKit::fileCreationTime):
2773         (WebKit::fileModificationTime):
2774         * UIProcess/Storage/LocalStorageDatabaseTracker.h:
2775         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
2776         (WebKit::UserMediaPermissionRequestManagerProxy::enumerateMediaDevicesForFrame):
2777         * UIProcess/WebBackForwardList.cpp:
2778         (WebKit::WebBackForwardList::backForwardListState):
2779         (WebKit::WebBackForwardList::restoreFromState):
2780         * UIProcess/WebPageProxy.cpp:
2781         (WebKit::WebPageProxy::didCommitLoadForFrame):
2782         (WebKit::WebPageProxy::creationParameters):
2783         (WebKit::WebPageProxy::setOverlayScrollbarStyle):
2784         * UIProcess/WebPageProxy.h:
2785         (WebKit::WebPageProxy::overlayScrollbarStyle):
2786         * UIProcess/WebPageProxy.messages.in:
2787         * UIProcess/WebsiteData/WebsiteDataRecord.h:
2788         * UIProcess/efl/WebView.cpp:
2789         (WebKit::WebView::transformFromScene):
2790         * UIProcess/gtk/AcceleratedBackingStoreX11.cpp:
2791         * UIProcess/gtk/WebPreferencesGtk.cpp:
2792         (WebKit::WebPreferences::platformInitializeStore):
2793         * UIProcess/ios/WKContentViewInteraction.mm:
2794         (-[WKContentView _scrollOffsetForEvent:]):
2795         (-[WKContentView _interpretKeyEvent:isCharEvent:]):
2796         * UIProcess/mac/LegacySessionStateCoding.cpp:
2797         (WebKit::encodeFormDataElement):
2798         (WebKit::decodeFormDataElement):
2799         (WebKit::decodeV1SessionHistory):
2800         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h:
2801         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
2802         (WebKit::RemoteLayerTreeDrawingAreaProxy::setViewExposedRect):
2803         * WebProcess/ApplePay/WebPaymentCoordinator.cpp:
2804         (WebKit::WebPaymentCoordinator::completeShippingMethodSelection):
2805         (WebKit::WebPaymentCoordinator::completeShippingContactSelection):
2806         (WebKit::WebPaymentCoordinator::completePaymentMethodSelection):
2807         * WebProcess/ApplePay/WebPaymentCoordinator.h:
2808         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
2809         (WKBundlePageSetEventThrottlingBehaviorOverride):
2810         * WebProcess/Plugins/PDF/DeprecatedPDFPlugin.mm:
2811         (WebKit::PDFPlugin::convertFromPDFViewToRootView):
2812         (WebKit::PDFPlugin::convertFromPDFViewToScreen):
2813         (WebKit::PDFPlugin::boundsOnScreen):
2814         (WebKit::PDFPlugin::geometryDidChange):
2815         * WebProcess/Plugins/PDF/PDFPlugin.mm:
2816         (WebKit::PDFPlugin::geometryDidChange):
2817         * WebProcess/Plugins/PluginView.cpp:
2818         (WebKit::PluginView::performFrameLoadURLRequest):
2819         (WebKit::PluginView::evaluate):
2820         * WebProcess/Plugins/WebPluginInfoProvider.cpp:
2821         (WebKit::WebPluginInfoProvider::pluginLoadClientPolicyForHost):
2822         * WebProcess/Plugins/WebPluginInfoProvider.h:
2823         * WebProcess/Scrolling/RemoteScrollingCoordinator.mm:
2824         (WebKit::RemoteScrollingCoordinator::scrollPositionChangedForNode):
2825         * WebProcess/WebCoreSupport/SessionStateConversion.cpp:
2826         (WebKit::toFormData):
2827         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2828         (WebKit::WebChromeClient::preferredScrollbarOverlayStyle):
2829         * WebProcess/WebCoreSupport/WebChromeClient.h:
2830         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2831         (WebKit::WebFrameLoaderClient::dispatchDidCommitLoad):
2832         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
2833         * WebProcess/WebPage/DrawingArea.h:
2834         * WebProcess/WebPage/DrawingArea.messages.in:
2835         * WebProcess/WebPage/WebFrame.cpp:
2836         (WebKit::WebFrame::certificateInfo):
2837         * WebProcess/WebPage/WebPage.cpp:
2838         (WebKit::m_userInterfaceLayoutDirection):
2839         (WebKit::WebPage::setScrollbarOverlayStyle):
2840         * WebProcess/WebPage/WebPage.h:
2841         (WebKit::WebPage::scrollbarOverlayStyle):
2842         * WebProcess/WebPage/WebPage.messages.in:
2843         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
2844         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
2845         (WebKit::RemoteLayerTreeDrawingArea::setViewExposedRect):
2846         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
2847         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
2848         (WebKit::TiledCoreAnimationDrawingArea::setViewExposedRect):
2849
2850 2016-11-26  Sam Weinig  <sam@webkit.org>
2851
2852         Convert IntersectionObserver over to using RuntimeEnabledFeatures so it can be properly excluded from script
2853         https://bugs.webkit.org/show_bug.cgi?id=164965
2854
2855         Reviewed by Simon Fraser.
2856
2857         * Shared/WebPreferencesDefinitions.h:
2858         * UIProcess/API/C/WKPreferences.cpp:
2859         (WKPreferencesSetIntersectionObserverEnabled):
2860         (WKPreferencesGetIntersectionObserverEnabled):
2861         * UIProcess/API/C/WKPreferencesRefPrivate.h:
2862         * WebProcess/WebPage/WebPage.cpp:
2863         (WebKit::WebPage::updatePreferences):
2864         Add a preference, defaulting to off, for enabling IntersectionObserver.
2865
2866 2016-11-26  Simon Fraser  <simon.fraser@apple.com>
2867
2868         Migrate some layout timer-related code from std::chrono to Seconds and MonotonicTime
2869         https://bugs.webkit.org/show_bug.cgi?id=164992
2870
2871         Reviewed by Darin Adler.
2872         
2873         No more ugly conversion from seconds to milliseconds.
2874
2875         * WebProcess/WebPage/WebPage.cpp:
2876         (WebKit::WebPage::updatePreferences):
2877         * WebProcess/WebPage/ios/WebPageIOS.mm:
2878         (WebKit::WebPage::eventThrottlingDelay):
2879
2880 2016-11-25  Michael Catanzaro  <mcatanzaro@igalia.com>
2881
2882         [GTK] Follow-up fixes to r208974
2883         https://bugs.webkit.org/show_bug.cgi?id=164771
2884
2885         Unreviewed, implement Carlos's review feedback.
2886
2887         * UIProcess/API/gtk/WebKitNotification.cpp:
2888         (webkit_notification_get_tag):
2889         * UIProcess/API/gtk/WebKitNotificationProvider.cpp:
2890         (WebKitNotificationProvider::withdrawAnyPreviousNotificationMatchingTag):
2891         (WebKitNotificationProvider::show):
2892         * UIProcess/API/gtk/WebKitNotificationProvider.h:
2893
2894 2016-11-24  Michael Catanzaro  <mcatanzaro@igalia.com>
2895
2896         [GTK] Notifications API does not expose or respect the "tag" attribute
2897         https://bugs.webkit.org/show_bug.cgi?id=164771
2898
2899         Reviewed by Gustavo Noronha Silva.
2900
2901         Expose a tag property on WebKitNotification. Ensure that any previous notification with the
2902         same tag is closed when showing a new notification with that tag.
2903
2904         * UIProcess/API/gtk/WebKitNotification.cpp:
2905         (webkit_notification_class_init):
2906         (webkitNotificationCreate):
2907         (webkit_notification_get_tag):
2908         * UIProcess/API/gtk/WebKitNotification.h:
2909         * UIProcess/API/gtk/WebKitNotificationProvider.cpp:
2910         (WebKitNotificationProvider::withdrawAnyPreviousNotificationMatchingTag):
2911         (WebKitNotificationProvider::show):
2912         * UIProcess/API/gtk/WebKitNotificationProvider.h:
2913         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
2914
2915 2016-11-22  Sergio Villar Senin  <svillar@igalia.com>
2916
2917         [GTK] Fix introspection warning
2918         https://bugs.webkit.org/show_bug.cgi?id=165026
2919
2920         Reviewed by Michael Catanzaro.
2921
2922         This fixes an introspection annotation for a new API added in r208532.
2923
2924         * WebProcess/InjectedBundle/API/gtk/WebKitWebPage.cpp:
2925         (webkit_web_page_class_init):
2926
2927 2016-11-21  Carlos Garcia Campos  <cgarcia@igalia.com>
2928
2929         [SOUP] Simplify custom protocols handler implementation
2930         https://bugs.webkit.org/show_bug.cgi?id=164922
2931
2932         Reviewed by Michael Catanzaro.
2933
2934         We are using too many classes for this and also the C API that is not needed, because both GTK+ and EFL have
2935         their own APIs and this is not used by WTR at all.
2936
2937         * PlatformEfl.cmake: Remove files from compilation.
2938         * PlatformGTK.cmake: Ditto.
2939         * Shared/API/c/WKBase.h:
2940         * Shared/API/c/soup/WKBaseSoup.h: Removed.
2941         * UIProcess/API/APICustomProtocolManagerClient.h: Added.
2942         (API::CustomProtocolManagerClient::~CustomProtocolManagerClient):
2943         (API::CustomProtocolManagerClient::startLoading):
2944         (API::CustomProtocolManagerClient::stopLoading):
2945         (API::CustomProtocolManagerClient::invalidate):
2946         * UIProcess/API/C/WKAPICast.h:
2947         * UIProcess/API/C/soup/WKAPICastSoup.h: Removed.
2948         * UIProcess/API/C/soup/WKContextSoup.h: Removed.
2949         * UIProcess/API/C/soup/WKSoupCustomProtocolRequestManager.cpp: Removed.
2950         * UIProcess/API/C/soup/WKSoupCustomProtocolRequestManager.h: Removed.
2951         * UIProcess/API/C/soup/WKSoupRequestManager.h: Removed.
2952         * UIProcess/API/efl/ewk_context.cpp: Remove unneeded include.
2953         * UIProcess/API/efl/ewk_url_scheme_request.cpp: Use CustomProtocolManagerProxy instead of WKSoupCustomProtocolRequestManagerRef.
2954         (EwkUrlSchemeRequest::EwkUrlSchemeRequest):
2955         (EwkUrlSchemeRequest::finish):
2956         (EwkUrlSchemeRequest::invalidate):
2957         * UIProcess/API/efl/ewk_url_scheme_request_private.h:
2958         (EwkUrlSchemeRequest::create):
2959         (EwkUrlSchemeRequest::manager):
2960         * UIProcess/API/gtk/WebKitCustomProtocolManagerClient.cpp: Added.
2961         (attachCustomProtocolManagerClientToContext):
2962         * UIProcess/API/gtk/WebKitCustomProtocolManagerClient.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitRequestManagerClient.h.
2963         * UIProcess/API/gtk/WebKitPrivate.h:
2964         * UIProcess/API/gtk/WebKitRequestManagerClient.cpp: Removed.
2965         * UIProcess/API/gtk/WebKitRequestManagerClient.h: Removed.
2966         * UIProcess/API/gtk/WebKitURISchemeRequest.cpp: Use CustomProtocolManagerProxy instead of WebSoupCustomProtocolRequestManager.
2967         (webkitURISchemeRequestCreate):
2968         (webkitURISchemeRequestCancel):
2969         (webkitURISchemeRequestGetManager):
2970         (webkitURISchemeRequestInvalidate):
2971         (webkitURISchemeRequestReadCallback):
2972         (webkit_uri_scheme_request_finish_error):
2973         * UIProcess/API/gtk/WebKitURISchemeRequestPrivate.h:
2974         * UIProcess/API/gtk/WebKitWebContext.cpp:
2975         (webkitWebContextConstructed):
2976         (webkitWebContextDispose):
2977         (webkit_web_context_register_uri_scheme):
2978         (webkitWebContextStartLoadingCustomProtocol):
2979         (webkitWebContextInvalidateCustomProtocolRequests):
2980         * UIProcess/API/gtk/WebKitWebContextPrivate.h:
2981         * UIProcess/Network/CustomProtocols/CustomProtocolManagerProxy.h:
2982         * UIProcess/Network/CustomProtocols/mac/CustomProtocolManagerProxyMac.mm:
2983         (WebKit::CustomProtocolManagerProxy::processDidClose):
2984         * UIProcess/Network/CustomProtocols/soup/CustomProtocolManagerProxySoup.cpp:
2985         (WebKit::CustomProtocolManagerProxy::processDidClose): Invalidate the client.
2986         (WebKit::CustomProtocolManagerProxy::startLoading): Notify the client.
2987         (WebKit::CustomProtocolManagerProxy::stopLoading): Ditto.
2988         (WebKit::CustomProtocolManagerProxy::didReceiveResponse): Notify the network process.
2989         (WebKit::CustomProtocolManagerProxy::didLoadData): Ditto.
2990         (WebKit::CustomProtocolManagerProxy::didFailWithError): Ditto.
2991         (WebKit::CustomProtocolManagerProxy::didFinishLoading): Ditto.
2992         * UIProcess/Network/CustomProtocols/soup/WebSoupCustomProtocolRequestManager.cpp: Removed.
2993         * UIProcess/Network/CustomProtocols/soup/WebSoupCustomProtocolRequestManager.h: Removed.
2994         * UIProcess/Network/CustomProtocols/soup/WebSoupCustomProtocolRequestManagerClient.cpp: Removed.
2995         * UIProcess/Network/CustomProtocols/soup/WebSoupCustomProtocolRequestManagerClient.h: Removed.
2996         * UIProcess/Network/NetworkProcessProxy.cpp:
2997         (WebKit::NetworkProcessProxy::didClose): Notify the CustomProtocolManagerProxy.
2998         * UIProcess/WebProcessPool.cpp:
2999         (WebKit::WebProcessPool::WebProcessPool): Initialize the CustomProtocolManagerClient and remove the all supplement.
3000         (WebKit::WebProcessPool::setCustomProtocolManagerClient):
3001         (WebKit::WebProcessPool::registerSchemeForCustomProtocol): In case of soup cache the given protocol.
3002         (WebKit::WebProcessPool::unregisterSchemeForCustomProtocol): In case of soup delete the given protocol from the cache.
3003         * UIProcess/WebProcessPool.h:
3004         * UIProcess/efl/RequestManagerClientEfl.cpp: Do not use the C API, but API::CustomProtocolManagerClient.
3005         (WebKit::RequestManagerClientEfl::RequestManagerClientEfl):
3006         (WebKit::RequestManagerClientEfl::registerURLSchemeHandler):
3007         * UIProcess/efl/RequestManagerClientEfl.h:
3008         * UIProcess/efl/WebProcessPoolEfl.cpp:
3009         * UIProcess/gtk/WebProcessPoolGtk.cpp:
3010         * UIProcess/soup/WebProcessPoolSoup.cpp:
3011         (WebKit::WebProcessPool::platformInitializeNetworkProcess): Use m_urlSchemesRegisteredForCustomProtocols to
3012         build the list of custom protocols to send to the network process.
3013
3014 2016-11-21  Alex Christensen  <achristensen@webkit.org>
3015
3016         Fix Sierra CMake build after r208452
3017         https://bugs.webkit.org/show_bug.cgi?id=164437
3018
3019         * UIProcess/Cocoa/WebViewImpl.mm:
3020         (WebKit::WebViewImpl::updateMediaTouchBar):
3021         I haven't enabled VIDEO_PRESENTATION_MODE in the CMake build yet.
3022         It's needed for WebPlaybackSessionInterfaceMac to exist.
3023
3024 2016-11-21  Carlos Garcia Campos  <cgarcia@igalia.com>
3025
3026         Unreviewed. Update OptionsGTK.cmake and NEWS for 2.15.2 release.
3027
3028         * gtk/NEWS: Add release notes for 2.15.2.
3029
3030 2016-11-21  Carlos Garcia Campos  <cgarcia@igalia.com>
3031
3032         Remove m_customProtocolManagerProxy from WebProcessProxy
3033         https://bugs.webkit.org/show_bug.cgi?id=164908
3034
3035         Reviewed by Andreas Kling.
3036
3037         Since the network process is mandatory, the custom protocol manager proxy of WebProcessProxy is unused and can
3038         be removed.
3039
3040         * UIProcess/WebProcessProxy.cpp:
3041         (WebKit::WebProcessProxy::WebProcessProxy):
3042         * UIProcess/WebProcessProxy.h:
3043
3044 2016-11-20  Zan Dobersek  <zdobersek@igalia.com>
3045
3046         [EncryptedMedia] Make EME API runtime-enabled
3047         https://bugs.webkit.org/show_bug.cgi?id=164927
3048
3049         Reviewed by Jer Noble.
3050
3051         Add the new EncryptedMediaAPI preference. Set the same feature
3052         flag on the shared RuntimeEnabledFeatures object to the
3053         corresponding value that's stored in the WebPreferencesStore.
3054
3055         InjectedBundle::overrideBoolPreferenceForTestRunner() does the
3056         same when the 'WebKitEncryptedMediaAPIEnabled' preference is
3057         overridden in WKTR for testing purposes.
3058
3059         * Shared/WebPreferencesDefinitions.h:
3060         * WebProcess/InjectedBundle/InjectedBundle.cpp:
3061         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
3062         * WebProcess/WebPage/WebPage.cpp:
3063         (WebKit::WebPage::updatePreferences):
3064
3065 2016-11-19  Antti Koivisto  <antti@apple.com>
3066
3067         Salt network cache hashes
3068         https://bugs.webkit.org/show_bug.cgi?id=164924
3069
3070         Reviewed by Alex Christensen.
3071
3072         To enhance privacy make cache content unidentifiable from file names alone.
3073         This is done by generating a unique persistent salt for each cache instance.
3074         It is used when computing hashes used in file names.
3075
3076         The patch also replaces plain text partition directory names with salted hashes.
3077
3078         * NetworkProcess/cache/NetworkCache.cpp:
3079         (WebKit::NetworkCache::Cache::makeCacheKey):
3080         (WebKit::NetworkCache::makeCacheKey): Deleted.
3081         * NetworkProcess/cache/NetworkCache.h:
3082
3083             Increment cache version.
3084
3085         * NetworkProcess/cache/NetworkCacheBlobStorage.cpp:
3086         (WebKit::NetworkCache::BlobStorage::BlobStorage):
3087         (WebKit::NetworkCache::BlobStorage::add):
3088         (WebKit::NetworkCache::BlobStorage::get):
3089
3090             Use salt for blob content hash.
3091
3092         * NetworkProcess/cache/NetworkCacheBlobStorage.h:
3093         * NetworkProcess/cache/NetworkCacheData.cpp:
3094         (WebKit::NetworkCache::computeSHA1):
3095
3096             For simplicity all SHA1s are now salted.
3097
3098         (WebKit::NetworkCache::makeSalt):
3099         (WebKit::NetworkCache::readOrMakeSalt):
3100
3101             Read salt if it exists, generate and persist it otherwise.
3102
3103         * NetworkProcess/cache/NetworkCacheData.h:
3104         * NetworkProcess/cache/NetworkCacheKey.cpp:
3105         (WebKit::NetworkCache::Key::Key):
3106
3107             Remove the "No partition" string and just empty.
3108             That was only needed to have a directory name of some sort.
3109
3110         (WebKit::NetworkCache::Key::computeHash):
3111
3112             Use salt for key hash.
3113
3114         (WebKit::NetworkCache::Key::computePartitionHash):
3115
3116             Separate hash for partition.
3117
3118         * NetworkProcess/cache/NetworkCacheKey.h:
3119         * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
3120         (WebKit::NetworkCache::makeSubresourcesKey):
3121         (WebKit::NetworkCache::SpeculativeLoadManager::PendingFrameLoad::saveToDiskIfReady):
3122         (WebKit::NetworkCache::SpeculativeLoadManager::retrieveSubresourcesEntry):
3123         * NetworkProcess/cache/NetworkCacheStorage.cpp:
3124         (WebKit::NetworkCache::makeSaltFilePath):
3125         (WebKit::NetworkCache::Storage::open):
3126
3127             Cache can't be opened if we can't read or persist a salt.
3128
3129         (WebKit::NetworkCache::traverseRecordsFiles):
3130         (WebKit::NetworkCache::Storage::Storage):
3131         (WebKit::NetworkCache::Storage::synchronize):
3132         (WebKit::NetworkCache::Storage::recordDirectoryPathForKey):
3133
3134             Use the partition hash in the directory name instead of a plain text name.
3135
3136         (WebKit::NetworkCache::decodeRecordHeader):
3137         (WebKit::NetworkCache::Storage::readRecord):
3138         (WebKit::NetworkCache::Storage::encodeRecord):
3139         (WebKit::NetworkCache::Storage::traverse):
3140         (WebKit::NetworkCache::Storage::clear):
3141         * NetworkProcess/cache/NetworkCacheStorage.h:
3142         (WebKit::NetworkCache::Storage::salt):
3143
3144 2016-11-19  Simon Fraser  <simon.fraser@apple.com>
3145
3146         [iOS WK2] When zoomed in and panning on pages with fixed bars, parts of the bars are sometimes missing
3147         https://bugs.webkit.org/show_bug.cgi?id=164855
3148
3149         Reviewed by Sam Weinig.
3150
3151         During UI-process panning and zooming, we send visible rect updates to the web process
3152         with inStableState=false, and don't update GraphicsLayers until we get into a stable state.
3153
3154         This causes a problem where the web process has a stale notion of where the GraphicsLayers
3155         for position:fixed elements are, but is then told to update tiling coverage with an up-to-date
3156         visible rect. The existing "sync layer positions" path isn't useful to fix this, because it
3157         breaks the relationship between the GraphicsLayer positions and their FixedPositionViewportConstraints
3158         in the scrolling tree.
3159
3160         To address this, add the notion of an Optional<> approximatePosition on GraphicsLayers. This is used
3161         only by the coverageRect computation code path, and is cleared by a setPosition(). ApproximatePositions
3162         are pushed onto GraphicsLayers via the syncViewportConstrainedLayerPositions() code path (renamed to
3163         reconcileViewportConstrainedLayerPositions).
3164
3165         Tested by scrollingcoordinator/ios/non-stable-viewport-scroll.html
3166
3167         * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp:
3168         (WebKit::RemoteScrollingCoordinatorProxy::scrollingTreeNodeDidScroll):
3169         * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h:
3170         * UIProcess/Scrolling/RemoteScrollingTree.cpp:
3171         (WebKit::RemoteScrollingTree::scrollingTreeNodeDidScroll):
3172         * UIProcess/Scrolling/RemoteScrollingTree.h:
3173         * WebProcess/Scrolling/RemoteScrollingCoordinator.mm:
3174         (WebKit::RemoteScrollingCoordinator::scrollPositionChangedForNode):
3175         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
3176         (WebKit::CompositingCoordinator::flushPendingLayerChanges):
3177         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
3178         (WebKit::CoordinatedLayerTreeHost::didFlushRootLayer):
3179         * WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp:
3180         (WebKit::LayerTreeHostGtk::flushPendingLayerChanges):
3181         * WebProcess/WebPage/ios/WebPageIOS.mm:
3182         (WebKit::WebPage::updateVisibleContentRects): Always push the custom fixed position rect down, but send
3183         ScrollingLayerPositionAction::SetApproximate if the state is not stable.
3184         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
3185         (WebKit::RemoteLayerTreeDrawingArea::flushLayers):
3186         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
3187         (WebKit::TiledCoreAnimationDrawingArea::flushLayers):
3188
3189 2016-11-18  Simon Fraser  <simon.fraser@apple.com>
3190
3191         Make it possible to test non-stable-state scrolling on iOS
3192         https://bugs.webkit.org/show_bug.cgi?id=164905
3193
3194         Reviewed by Dan Bernstein.
3195
3196         Make it possible for an iOS layout test to force every visible rect update
3197         from the UI process to the web process to be in a non-stable state. This emulates
3198         what happens during panning and zooming interactions, and allows us to test the
3199         scrolling and layer trees in these transient states.
3200
3201         This is done by adding a testing property on WKWebView, _stableStateOverride, whose
3202         getters and setters are overridden in TestRunnerWKWebView. When non-nil, we _updateVisibleContentRectAfterScrollInView
3203         consults the NSNumber's boolValue and uses it to override the stable state.
3204
3205         To facilitate this kind of testing, also add immediateScrollToOffset() and
3206         immediateZoomToScale() to UIScriptController. Finally, add doAfterPresentationUpdate()
3207         which provides a callback that fires after one trip to the web process and back.
3208
3209         * UIProcess/API/Cocoa/WKWebView.mm:
3210         (-[WKWebView _updateVisibleContentRectAfterScrollInView:]):
3211         (-[WKWebView _stableStateOverride]):
3212         (-[WKWebView _setStableStateOverride:]):
3213         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
3214
3215 2016-11-18  Simon Fraser  <simon.fraser@apple.com>
3216
3217         [iOS WK2] Eliminate a source of flakiness in layout tests by forcing WebPage into "responsive" mode for all tests, with an internals override
3218         https://bugs.webkit.org/show_bug.cgi?id=164980
3219
3220         Reviewed by Chris Dumez.
3221
3222         WebPage::eventThrottlingDelay() uses a latency estimate based on the round-trip time from the UI process
3223         to affect behavior, including whether scroll events are fired. This also affects the FrameView "scrolledByUser"
3224         flag that impacts tile coverage.
3225
3226         During testing, latency falling above or below the 16ms threshold could affect behavior. Fix by forcing
3227         WebPage into "responsive" mode while running tests, via InjectedBundlePage::prepare().
3228
3229         Add a nullable internals property so that a test can specify responsive, unresponsive or default behavior.
3230
3231         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
3232         (WKBundlePageSetEventThrottlingBehaviorOverride):
3233         * WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h:
3234         * WebProcess/WebPage/ios/WebPageIOS.mm:
3235         (WebKit::WebPage::eventThrottlingDelay):
3236
3237 2016-11-18  Simon Fraser  <simon.fraser@apple.com>
3238
3239         Remove use of std::chrono in WebPage and entrained code
3240         https://bugs.webkit.org/show_bug.cgi?id=164967
3241
3242         Reviewed by Tim Horton.
3243
3244         Replace std::chrono with Seconds and Monotonic Time.
3245
3246         Use more C++11 initialization for WebPage data members.
3247
3248         * Shared/VisibleContentRectUpdateInfo.cpp:
3249         (WebKit::operator<<):
3250         * Shared/VisibleContentRectUpdateInfo.h:
3251         (WebKit::VisibleContentRectUpdateInfo::VisibleContentRectUpdateInfo):
3252         (WebKit::VisibleContentRectUpdateInfo::timestamp):
3253         * Shared/WebCoreArgumentCoders.cpp:
3254         (IPC::ArgumentCoder<MonotonicTime>::encode):
3255         (IPC::ArgumentCoder<MonotonicTime>::decode):
3256         (IPC::ArgumentCoder<Seconds>::encode):
3257         (IPC::ArgumentCoder<Seconds>::decode):
3258         * Shared/WebCoreArgumentCoders.h:
3259         * UIProcess/ios/WKContentView.mm:
3260         (WebKit::HistoricalVelocityData::HistoricalVelocityData):
3261         (WebKit::HistoricalVelocityData::velocityForNewData):
3262         (WebKit::HistoricalVelocityData::append):
3263         (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:obscuredInset:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]):
3264         * WebProcess/WebCoreSupport/WebChromeClient.h:
3265         * WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm:
3266         (WebKit::WebChromeClient::eventThrottlingDelay):
3267         * WebProcess/WebPage/ViewUpdateDispatcher.h:
3268         * WebProcess/WebPage/WebPage.cpp:
3269         (WebKit::WebPage::WebPage):
3270         (WebKit::m_userActivityHysteresis):
3271         (WebKit::WebPage::didFlushLayerTreeAtTime):
3272         (WebKit::WebPage::didCommitLoad):
3273         * WebProcess/WebPage/WebPage.h:
3274         * WebProcess/WebPage/ios/WebPageIOS.mm:
3275         (WebKit::WebPage::eventThrottlingDelay):
3276         (WebKit::WebPage::updateVisibleContentRects):
3277         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
3278         (WebKit::RemoteLayerTreeDrawingArea::flushLayers):
3279
3280 2016-11-18  Dean Jackson  <dino@apple.com>
3281
3282         AX: "(inverted-colors)" media query only matches on page reload; should match on change
3283         https://bugs.webkit.org/show_bug.cgi?id=163564
3284         <rdar://problem/28807350>
3285
3286         Reviewed by Simon Fraser.
3287
3288         Listen for the appropriate notifications that accessibility settings
3289         have changed. This is a single notification on macOS, which uses WebViewImpl,
3290         and more fine-grained notifications on iOS, using WKWebView.
3291
3292         When we see the notification, send a message to the WebProcess which will
3293         then tell the WebCore::Page.
3294
3295         * UIProcess/API/Cocoa/WKWebView.mm:
3296         (-[WKWebView _initializeWithConfiguration:]):
3297         (-[WKWebView _accessibilitySettingsDidChange:]):
3298         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
3299         * UIProcess/Cocoa/WebViewImpl.h:
3300         * UIProcess/Cocoa/WebViewImpl.mm:
3301         (-[WKAccessibilitySettingsObserver initWithImpl:]):
3302         (-[WKAccessibilitySettingsObserver dealloc]):
3303         (-[WKAccessibilitySettingsObserver _settingsDidChange:]):
3304         (WebKit::WebViewImpl::WebViewImpl):
3305         (WebKit::WebViewImpl::accessibilitySettingsDidChange):
3306         * UIProcess/WebPageProxy.cpp:
3307         (WebKit::WebPageProxy::accessibilitySettingsDidChange):
3308         * UIProcess/WebPageProxy.h:
3309         * WebProcess/WebPage/WebPage.cpp:
3310         (WebKit::WebPage::accessibilitySettingsDidChange):
3311         * WebProcess/WebPage/WebPage.h:
3312         * WebProcess/WebPage/WebPage.messages.in:
3313
3314 2016-11-18  Jeremy Jones  <jeremyj@apple.com>
3315
3316         USE WK_MAC_TBA for version number in _webViewRequestPointerLock:(WKWebView *)webView WK_API_AVAILABLE(macosx(10.12))
3317         https://bugs.webkit.org/show_bug.cgi?id=164962
3318
3319         Reviewed by Dean Jackson.
3320
3321         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
3322
3323 2016-11-18  Enrica Casucci  <enrica@apple.com>
3324
3325         Refactor drag and drop for WebKit2 to encode DragData message exchange.
3326         https://bugs.webkit.org/show_bug.cgi?id=164945
3327
3328         Reviewed by Tim Horton.
3329
3330         * Shared/WebCoreArgumentCoders.cpp:
3331         (IPC::ArgumentCoder<DragData>::encode):
3332         (IPC::ArgumentCoder<DragData>::decode):
3333         * Shared/WebCoreArgumentCoders.h:
3334         * UIProcess/WebPageProxy.cpp:
3335         (WebKit::WebPageProxy::performDragControllerAction):
3336         * WebProcess/WebCoreSupport/WebDragClient.cpp:
3337         (WebKit::WebDragClient::willPerformDragDestinationAction):
3338         (WebKit::WebDragClient::actionMaskForDrag):
3339         * WebProcess/WebCoreSupport/WebDragClient.h:
3340         * WebProcess/WebPage/WebPage.cpp:
3341         (WebKit::WebPage::performDragControllerAction):
3342         * WebProcess/WebPage/WebPage.h:
3343         * WebProcess/WebPage/WebPage.messages.in:
3344
3345 2016-11-18  Jeremy Jones  <jeremyj@apple.com>
3346
3347         Add runtime flag to enable pointer lock. Enable pointer lock feature for mac.
3348         https://bugs.webkit.org/show_bug.cgi?id=163801
3349
3350         Reviewed by Simon Fraser.
3351
3352         Add SPI to notify client of pointer lock and for client to allow or deny.
3353         Unlock pointer when view is not longer active.
3354
3355         * Configurations/FeatureDefines.xcconfig:
3356         * Shared/WebPreferencesDefinitions.h:
3357         * UIProcess/API/APIUIClient.h:
3358         (API::UIClient::requestPointerLock):
3359         (API::UIClient::didLosePointerLock):
3360         * UIProcess/API/C/WKPage.cpp:
3361         (WKPageSetPageUIClient):
3362         (WKPageDidAllowPointerLock):
3363         (WKPageDidDenyPointerLock):
3364         * UIProcess/API/C/WKPagePrivate.h:
3365         * UIProcess/API/C/WKPageUIClient.h:
3366         * UIProcess/API/C/WKPreferences.cpp:
3367         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
3368         * UIProcess/Cocoa/UIDelegate.h:
3369         * UIProcess/Cocoa/UIDelegate.mm:
3370         (WebKit::UIDelegate::setDelegate):
3371         (WebKit::UIDelegate::UIClient::requestPointerLock):
3372         (WebKit::UIDelegate::UIClient::didLosePointerLock):
3373         * UIProcess/WebPageProxy.cpp:
3374         (WebKit::WebPageProxy::dispatchActivityStateChange):
3375         (WebKit::WebPageProxy::resetStateAfterProcessExited):
3376         (WebKit::WebPageProxy::requestPointerLock):
3377         (WebKit::WebPageProxy::didAllowPointerLock):
3378         (WebKit::WebPageProxy::didDenyPointerLock):
3379         (WebKit::WebPageProxy::requestPointerUnlock):
3380         * UIProcess/WebPageProxy.h:
3381         * WebProcess/WebPage/WebPage.cpp:
3382         (WebKit::WebPage::updatePreferences):
3383
3384 2016-11-17  Carlos Garcia Campos  <cgarcia@igalia.com>
3385
3386         Downloads started by context menu actions should also have a web view associated
3387         https://bugs.webkit.org/show_bug.cgi?id=164364
3388
3389         Reviewed by Michael Catanzaro.
3390
3391         When a request is converted to a download WebPageProxy calls handleDownloadRequest() and clients handle that to
3392         associate the web view to the download. When a download is started by a context menu action, WebPageProxy calls
3393         WebProcessPool::download() with this as initiatingPage parameter, but clients are not notified in this case.
3394
3395         * UIProcess/API/gtk/WebKitDownload.cpp:
3396         (webkitDownloadCreateForRequest): Deleted.
3397         * UIProcess/API/gtk/WebKitDownloadPrivate.h:
3398         * UIProcess/API/gtk/WebKitWebContext.cpp:
3399         (webkitWebContextStartDownload): Use webkitWebContextGetOrCreateDownload() after WebProcessPool::download()
3400         because the WebKitDownload could have already been created by the web view download handler at this point.
3401         * UIProcess/API/gtk/WebKitWebView.cpp:
3402         (webkit_web_view_download_uri): We no longer need to associate the web view to the download here.
3403         * UIProcess/WebProcessPool.cpp:
3404         (WebKit::WebProcessPool::download): If an initiatingPage has been passed, call handleDownloadRequest() to notify
3405         the page client.
3406
3407 2016-11-17  Alex Christensen  <achristensen@webkit.org>
3408
3409         REGRESSION: API test _WKDownload.ConvertResponseToDownload is a flaky timeout
3410         https://bugs.webkit.org/show_bug.cgi?id=164631
3411
3412         Reviewed by Carlos Garcia Campos.
3413
3414         * NetworkProcess/NetworkResourceLoader.cpp:
3415         (WebKit::NetworkResourceLoader::convertToDownload):
3416         I could reproduce the flaky failure 100% of the time when not using NETWORK_SESSION
3417         by adding a usleep(1000000) in NetworkResourceLoader::convertToDownload.  m_networkLoad
3418         was not being set to nullptr before it was being checked in NetworkResourceLoader::abort
3419
3420 2016-11-17  Alex Christensen  <achristensen@webkit.org>
3421
3422         Fix CMake build after r208865
3423         https://bugs.webkit.org/show_bug.cgi?id=164894
3424
3425         * PlatformMac.cmake:
3426         Add new files.
3427
3428 2016-11-17  Ryosuke Niwa  <rniwa@webkit.org>
3429
3430         WKBundleNodeHandleSetHTMLInputElementSpellcheckEnabled should keep text replacement enabled
3431         https://bugs.webkit.org/show_bug.cgi?id=164857
3432         <rdar://problem/27721742>
3433
3434         Reviewed by Wenson Hsieh.
3435
3436         * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp:
3437         (WebKit::InjectedBundleNodeHandle::setHTMLInputElementSpellcheckEnabled):
3438
3439 2016-11-17  John Wilander  <wilander@apple.com>
3440
3441         Resource load statistics: Cover further data records, count removed data records, and only fire handler when needed
3442         https://bugs.webkit.org/show_bug.cgi?id=164659
3443
3444         Reviewed by Andy Estes.
3445
3446         * UIProcess/WebResourceLoadStatisticsStore.cpp:
3447         (WebKit::WebResourceLoadStatisticsStore::removeDataRecords):
3448             Consistent naming with 'remove' rather than 'delete'.
3449             Now removes localStorage, IndexDB, disk cache, and memory cache too.
3450             Updates statistics with number of times it has removed data records.
3451         (WebKit::WebResourceLoadStatisticsStore::resourceLoadStatisticsUpdated):
3452             No longer checks whether it has enough data since the classification rules
3453             are absolute, not relative.
3454         (WebKit::WebResourceLoadStatisticsStore::clearDataRecords): Deleted.
3455         * UIProcess/WebResourceLoadStatisticsStore.h:
3456             Consistent naming with 'remove' rather than 'delete'.
3457