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