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